myWordOrderDe.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title></title>
  8. <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  9. <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  10. <link rel="stylesheet" href="../../css/select.css">
  11. <style>
  12. body {
  13. background: #fff;
  14. }
  15. .api_layout {
  16. background: #009FE8;
  17. width: 100%;
  18. /*margin-top: -10px;*/
  19. }
  20. .column {
  21. margin-bottom: 10px;
  22. }
  23. .aui-row {
  24. border: 1px dashed #c8d2de;
  25. -webkit-border-radius: 5px;
  26. -moz-border-radius: 5px;
  27. border-radius: 5px;
  28. padding: 10px;
  29. }
  30. .technological-process {
  31. margin-top: 10px;
  32. }
  33. /*****/
  34. /*审批进度条*/
  35. .layui-timeline {
  36. padding-left: 5px;
  37. }
  38. .layui-timeline-item {
  39. position: relative;
  40. padding-bottom: 20px;
  41. }
  42. .layui-timeline-item:first-child:before {
  43. display: block;
  44. }
  45. .layui-timeline-item:before {
  46. content: '';
  47. position: absolute;
  48. left: 5px;
  49. top: 0;
  50. z-index: 0;
  51. width: 1px;
  52. height: 100%;
  53. }
  54. .layui-timeline-item:before,
  55. hr {
  56. background-color: #e6e6e6;
  57. }
  58. .layui-timeline-axis {
  59. font-size: 12px;
  60. font-weight: bold;
  61. position: absolute;
  62. left: -5px;
  63. top: 0;
  64. z-index: 10;
  65. width: 20px;
  66. height: 20px;
  67. line-height: 20px;
  68. background-color: #fff;
  69. border-radius: 50%;
  70. text-align: center;
  71. cursor: pointer;
  72. }
  73. .Correct {
  74. color: #5FB878;
  75. border: 1px solid #5FB878;
  76. }
  77. .closes {
  78. color: red;
  79. border: 1px solid red;
  80. }
  81. .layui-timeline-content {
  82. padding-left: 25px;
  83. }
  84. .layui-text {
  85. line-height: 22px;
  86. font-size: 14px;
  87. color: #666;
  88. }
  89. .layui-timeline-title {
  90. position: relative;
  91. margin-bottom: 10px;
  92. display: flex;
  93. justify-content: flex-start;
  94. }
  95. .remark {
  96. padding: 2px 3px;
  97. border-radius: 2px;
  98. display: none;
  99. }
  100. /******/
  101. .aui-list-item-input label {
  102. font-size: 14px;
  103. height: 21px;
  104. display: inline-block;
  105. line-height: 22px;
  106. margin-right: 5px;
  107. }
  108. .aui-list-item-input label:last-child {
  109. margin-right: 0;
  110. }
  111. .itmes li {
  112. display: flex;
  113. justify-content: space-between;
  114. flex-wrap: nowrap;
  115. padding: 10px 0;
  116. position: relative;
  117. }
  118. .itmes li p:first-child {
  119. width: 33%;
  120. color: #2c3e50;
  121. font-size: 15px;
  122. }
  123. .itmes li p:last-child {
  124. margin-left: 2%;
  125. width: 65%;
  126. color: #3498db;
  127. }
  128. .header-img {
  129. width: 50px;
  130. height: 50px;
  131. -webkit-border-radius: 50%;
  132. -moz-border-radius: 50%;
  133. border-radius: 50%;
  134. object-fit: cover;
  135. margin-right: 10px;
  136. }
  137. .img-title {
  138. display: flex;
  139. justify-content: flex-start;
  140. flex-wrap: nowrap;
  141. }
  142. .details-message {
  143. width: 100%;
  144. background: #fff;
  145. }
  146. .details-message-child {
  147. padding: 15px;
  148. }
  149. .personalInfo {
  150. padding: 10px 0;
  151. }
  152. .personalInfo span {
  153. display: block;
  154. font-size: 14px;
  155. color: #6c6f74;
  156. }
  157. .personalInfo span:first-child {
  158. font-size: 18px;
  159. color: #002257;
  160. }
  161. .examine-success {
  162. background: #1abc9c;
  163. }
  164. .examine-red {
  165. background: #e74c3c;
  166. }
  167. .staff_name {
  168. width: 50px;
  169. height: 50px;
  170. -webkit-border-radius: 50%;
  171. -moz-border-radius: 50%;
  172. border-radius: 50%;
  173. margin-right: 10px;
  174. line-height: 50px;
  175. text-align: center;
  176. color: #fff;
  177. }
  178. .aui-col-xs-4 img {
  179. object-fit: cover;
  180. border-radius: 3px;
  181. margin: auto;
  182. }
  183. .aui-col-xs-4 span {
  184. overflow: hidden;
  185. text-overflow: ellipsis;
  186. display: -webkit-box;
  187. -webkit-line-clamp: 2;
  188. -webkit-box-orient: vertical;
  189. padding: 0 3px;
  190. height: 48px;
  191. text-align: center;
  192. margin: 5px 0;
  193. font-size: 15px;
  194. }
  195. .fileList img {
  196. width: 35px;
  197. height: 35px;
  198. }
  199. .name-column span {
  200. background: #009fe8;
  201. padding: 3px;
  202. color: #fff;
  203. border-radius: 2px;
  204. font-size: 13px;
  205. }
  206. .column-title {
  207. display: block;
  208. font-size: 15px;
  209. color: #97a3b4;
  210. /*#2c3e50*/
  211. margin-bottom: 10px;
  212. }
  213. .column-textarea {
  214. border: 1px solid rgba(200, 210, 222, 1);
  215. -webkit-border-radius: 5px;
  216. -moz-border-radius: 5px;
  217. border-radius: 5px;
  218. padding: 10px;
  219. height: 40px;
  220. }
  221. .column-textarea::placeholder {
  222. font-size: 14px;
  223. color: #333;
  224. }
  225. /*定位*/
  226. .position-photo-notes {
  227. padding: 15px;
  228. }
  229. /*position*/
  230. .flex-space {
  231. display: flex;
  232. align-items: center;
  233. white-space: nowrap;
  234. }
  235. .flex-start {
  236. display: flex;
  237. justify-content: space-between;
  238. white-space: nowrap;
  239. align-items: center;
  240. }
  241. .ico-map {
  242. width: 25px;
  243. height: 25px;
  244. background: url("../../icon/position.png") no-repeat;
  245. background-position: center;
  246. background-size: cover;
  247. }
  248. .position {
  249. padding: 4px 10px 4px 15px;
  250. border-radius: 50px;
  251. background: #F0F0F0;
  252. font-size: 14px;
  253. margin-top: 10px;
  254. }
  255. .map1 {
  256. color: #009FE8;
  257. }
  258. .again {
  259. color: #6C6F74;
  260. }
  261. .map-name {
  262. width: 99%;
  263. }
  264. .names {
  265. width: 85%;
  266. }
  267. .names .map1 {
  268. width: 100%;
  269. padding-top: 3px;
  270. white-space: pre-wrap;
  271. overflow: hidden;
  272. text-overflow: ellipsis;
  273. display: -webkit-box;
  274. -webkit-box-orient: vertical;
  275. -webkit-line-clamp: 2;
  276. }
  277. .textarea {
  278. height: 45px;
  279. line-height: 1.5;
  280. }
  281. /*图片上传*/
  282. .input-recode {
  283. border: dashed 1px rgba(200, 210, 222, 1);
  284. display: flex;
  285. flex-flow: wrap;
  286. align-items: center;
  287. line-height: 100%;
  288. }
  289. .file-width {
  290. width: 33.3333333%;
  291. box-sizing: border-box;
  292. font-size: 14px;
  293. color: #333;
  294. }
  295. .upload {
  296. padding-top: 10px;
  297. }
  298. .upload img {
  299. width: 80px;
  300. height: 80px;
  301. margin-left: 15px;
  302. }
  303. /*图片*/
  304. /*未提交定位信息的图片容器*/
  305. .img-item {
  306. text-align: center;
  307. line-height: 100%;
  308. }
  309. .img-item img {
  310. width: 80px;
  311. height: 80px;
  312. border-radius: 3px;
  313. object-fit: cover;
  314. }
  315. .img-items .upload {
  316. text-align: center;
  317. }
  318. .img-items .upload img {
  319. width: 80px;
  320. height: 80px;
  321. margin: 0;
  322. }
  323. .add-message-remark {
  324. background: #009FE8;
  325. width: 100%;
  326. position: relative;
  327. }
  328. .add-message-remark-child {
  329. background: #fff;
  330. margin: 0 15px 15px 15px;
  331. border-radius: 5px;
  332. }
  333. .add-msg-list {
  334. margin-top: 10px;
  335. }
  336. .add-msg-list div {
  337. width: 100%;
  338. height: 40px;
  339. line-height: 40px;
  340. text-align: center;
  341. border-radius: 4px;
  342. color: #fff;
  343. background: #009fe8;
  344. font-size: 14px;
  345. }
  346. .work-order-remarks {
  347. font-size: 20px;
  348. font-weight: bold;
  349. color: #009FE8;
  350. }
  351. .remarkInfo {
  352. color: #232627
  353. }
  354. .remarkInfo-message {
  355. color: #009FE8;
  356. white-space: pre-wrap;
  357. }
  358. .more-icon {
  359. width: 20px;
  360. height: 20px;
  361. background: url("../../image/more.png") no-repeat;
  362. background-position: center;
  363. background-size: cover;
  364. }
  365. .img-item-two {
  366. position: relative;
  367. display: inline-block;
  368. width: 32%;
  369. margin-left: 6px;
  370. margin-top: 6px;
  371. }
  372. .img-item-two img {
  373. z-index: 0;
  374. height: 27vw;
  375. width: 27vw;
  376. object-fit: cover;
  377. border-radius: 5px;
  378. }
  379. .notes-content {
  380. margin-top: 15px;
  381. }
  382. </style>
  383. </head>
  384. <body>
  385. <div class="api_layout" id="wordOrder_details">
  386. </div>
  387. </body>
  388. <script type="text/template" id="template">
  389. {{?api.pageParam.status == 2 || api.pageParam.type == '工单完结'}}
  390. <div class="add-message-remark">
  391. <div style="height: 15px; width: 100%"></div>
  392. <div class="add-message-remark-child">
  393. <!-- 是否定位 -->
  394. {{?it.open_gps == 1 && it.open_remark == 1}} {{=getLonLat(it.open_gps)}} {{?}}
  395. <!-- 定位信息 拍照 以及备注信息 -->
  396. <div class="position-photo-notes">
  397. <label class="work-order-remarks">目的地打卡</label> {{? it.open_gps == 1 && it.open_remark == 1}}
  398. <div class="position-content" id="position_warp"></div>
  399. {{?}} {{? it.open_gps == 1 && it.open_remark == 2}}
  400. <div class="position flex-space" onclick="openMaps('{{=it.longitude}}','{{=it.latitude}}')">
  401. <div class="map-name flex-start">
  402. <i class="ico-map"></i>
  403. <div class="names">
  404. <p class="map1">{{=it.address}}</p>
  405. </div>
  406. </div>
  407. <p class="more-icon"></p>
  408. </div>
  409. {{?}} {{? it.open_remark == 1}}
  410. <div class="notes-content">
  411. <div class="column">
  412. <label class="remarkInfo">备注信息:</label>
  413. <textarea oninput="Oninput(this)" id="remark_information" class="column-textarea font-s column-textarea1" placeholder="请输入备注信息"></textarea>
  414. </div>
  415. </div>
  416. {{?}} {{? it.open_remark == 2 && JSON.parse(it.remark_info).remarkInfo != ''}}
  417. <div class="notes-content">
  418. <div class="column">
  419. <!-- <label class="column-title">备注信息:</label> -->
  420. <div class="remarkInfo">
  421. {{=JSON.parse(it.remark_info).remarkInfo}}
  422. </div>
  423. </div>
  424. </div>
  425. {{?}} {{? it.open_remark == 1}}
  426. <div class="modula img-warp">
  427. <label class="remarkInfo">现场照片:</label>
  428. <div class="text-input input-recode file-items-add img-items photoFile">
  429. <div class="upload file-width" onclick="uploadImg('remote',this)">
  430. <!-- 'remote',this -->
  431. <img src="../../image/upload.png" alt="">
  432. </div>
  433. </div>
  434. </div>
  435. {{?}} {{? it.open_remark == 2 && JSON.parse(it.remark_info).imageList.length > 0}}
  436. <div class="modula img-warp">
  437. <label class="remarkInfo">现场照片:</label>
  438. <div class="text-input input-recode file-items-add img-items photoFile">
  439. {{ for (var i = 0; i
  440. < JSON.parse(it.remark_info).imageList.length; i++) { }} <div class="img-dv img-item-two" onclick="browseImgTwo('{{=i}}','{{=JSON.parse(it.remark_info).imageList.toString()}}')">
  441. <a href="javascript:;">
  442. <img src="{{=JSON.parse(it.remark_info).imageList[i]}}">
  443. </a>
  444. </div>
  445. {{ } }}
  446. </div>
  447. </div>
  448. {{?}} {{? it.open_remark == 1}}
  449. <div class="add-msg-list">
  450. <div onclick="addPositionNotes()">提交</div>
  451. </div>
  452. {{?}}
  453. </div>
  454. </div>
  455. </div>
  456. {{?}}
  457. <div class="details-message">
  458. <div class="details-message-child">
  459. <div class="personalInfo">
  460. <div class="img-title">
  461. {{?it.staff_avatar === null}}
  462. <p class="staff_name" style="background:#{{=Math.random().toString(16).slice(2,8)}}">{{=it.staff.substr(it.staff.length-1,1)}}</p>
  463. {{??}}
  464. <img src="{{=it.staff_avatar}}" alt="" class="header-img"> {{?}}
  465. <div>
  466. <span>{{=it.staff}}</span>
  467. <span>{{=it.section}}</span>
  468. </div>
  469. </div>
  470. </div>
  471. <ul class="itmes">
  472. <li>
  473. <p>工单编号:</p>
  474. <p>#{{=it.id}}</p>
  475. </li>
  476. <li>
  477. <p>工单分类:</p>
  478. <p>{{=it.classify}}</p>
  479. </li>
  480. <li>
  481. <p>流程名称:</p>
  482. <p>{{=it.title}}</p>
  483. </li>
  484. </ul>
  485. <ul class="itmes">
  486. {{ for (var i = 0;i
  487. <it.form.length;i++) { }} {{?it.form[i].type !='images' && it.form[i].type !='files' }} <li>
  488. <p>{{=it.form[i].label}}:</p>
  489. <p>{{=it.form[i].value}}</p>
  490. </li>
  491. {{?}} {{ } }}
  492. </ul>
  493. <div class="column-row">
  494. {{ for (var i = 0;i
  495. <it.form.length;i++) { }} {{? it.form[i].type=='images' && it.form[i].value.length > 0 }} <div class="column">
  496. <label class="column-title">{{=it.form[i].label}}:</label>
  497. <div class="aui-row aui-row-padded">
  498. {{ for (var j = 0;j
  499. <it.form[i].value.length;j++) { }} <div class="aui-col-xs-4">
  500. <img src="{{=it.form[i].value[j]}}" class="colsImg" onload="setUpHeight(this)" onclick="browseImg('{{=it.form[i].value}}','{{=j}}')" />
  501. </div>
  502. {{ } }}
  503. </div>
  504. </div>
  505. {{??it.form[i].type == 'files' && it.form[i].value.length > 0}}
  506. <div class="column">
  507. <label class="column-title">{{=it.form[i].label}}:</label>
  508. <div class="aui-row aui-row-padded fileList">
  509. {{ for (var j = 0;j
  510. <it.form[i].value.length;j++) { }} {{?it.form[i].value[j].path.endsWith( 'docx') || it.form[i].value[j].path.endsWith( 'doc')}} <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  511. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  512. <span>{{=it.form[i].value[j].name}}</span>
  513. </div>
  514. {{??it.form[i].value[j].path.endsWith('pdf')}}
  515. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  516. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  517. <span>{{=it.form[i].value[j].name}}</span>
  518. </div>
  519. {{??it.form[i].value[j].path.endsWith('ppt') || it.form[i].value[j].path.endsWith('ptx')}}
  520. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  521. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  522. <span>{{=it.form[i].value[j].name}}</span>
  523. </div>
  524. {{??it.form[i].value[j].path.endsWith('zip') || it.form[i].value[j].path.endsWith('rar')}}
  525. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}',true)">
  526. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  527. <span>{{=it.form[i].value[j].name}}</span>
  528. </div>
  529. {{??it.form[i].value[j].path.endsWith('xlsx')}}
  530. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  531. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  532. <span>{{=it.form[i].value[j].name}}</span>
  533. </div>
  534. {{??}}
  535. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  536. <img src="../../icon/OTHER.png" />
  537. <span>{{=it.form[i].value[j].name}}</span>
  538. </div>
  539. {{?}} {{ } }}
  540. </div>
  541. </div>
  542. {{?}} {{ } }}
  543. </div>
  544. <div class="technologicals" style="margin-top:10px">
  545. <label class="column-title">固定审批流程:</label>
  546. <div class="technological-process">
  547. {{ for(var prop in it.flows) { }}
  548. <ul class="layui-timeline">
  549. <li class="layui-timeline-item">
  550. <i class="{{=it.flows[prop].status == 2?'aui-iconfont aui-icon-correct Correct':(it.flows[prop].status == 3?'aui-iconfont aui-icon-close closes':'Correct')}} layui-timeline-axis"></i>
  551. <!-- <i class="layui-timeline-axis" style="background:{{=it.flows[prop].status == '1'?'#5FB878':''}}"></i> -->
  552. <div class="layui-timeline-content layui-text">
  553. <div class="layui-timeline-title">
  554. <span>{{=it.flows[prop].flow_name}}:</span>
  555. <div class="name-column">
  556. {{ for (var j = 0;j
  557. <it.flows[prop].flow.length;j++) { }} <span>{{=it.flows[prop].flow[j]}}</span>
  558. {{ } }}
  559. </div>
  560. </div>
  561. </div>
  562. </li>
  563. </ul>
  564. {{ } }}
  565. </div>
  566. </div>
  567. <!-- 定位 拍照 备注信息 -->
  568. <!-- <div class="postion-reson">
  569. hahahahah
  570. </div> -->
  571. <div style="text-align: right;margin-top: 15px;{{=it.id !=" "?'display:none':'display:block'}}">
  572. <div class="aui-btn aui-btn-danger examine-red" onclick="openReject('{{=it.id}}')">驳回</div>
  573. <div class="aui-btn aui-btn-success examine-success" onclick="openAdopt('{{=it.id}}')">通过</div>
  574. </div>
  575. </div>
  576. </div>
  577. </script>
  578. <script type="text/javascript" src="../../script/api.js"></script>
  579. <script type="text/javascript" src="../../script/doT.min.js"></script>
  580. <script src="../../script/zepto.js" charset="utf-8"></script>
  581. <script type="text/javascript" src="../../script/config.js"></script>
  582. <!-- 地图 -->
  583. <script type="text/template" id="mapTemplate">
  584. <div class="position flex-space">
  585. <div class="map-name flex-start">
  586. <i class="ico-map"></i>
  587. <div class="names">
  588. <p class="map1">{{=it.address}}</p>
  589. </div>
  590. </div>
  591. <p class="again" onclick="getLonLat(false)">重新定位</p>
  592. </div>
  593. </script>
  594. <script type="text/javascript">
  595. var toast = new auiToast()
  596. var token
  597. apiready = function() {
  598. var info = $api.getStorage('data');
  599. token = JSON.parse(info).data.access_token;
  600. getApplyDe(api.pageParam.ID, token)
  601. };
  602. function getApplyDe(id, token) {
  603. var headers = {
  604. "Authorization": "Bearer " + token
  605. };
  606. $http.fnReuestData(UrlRouter.submitApplyDe + id, headers, 'get', '', function(ret, err) {
  607. // console.log(JSON.stringify(ret.data));
  608. // console.log(JSON.stringify(err));
  609. if (ret.code === 0) {
  610. $apis.html(wordOrder_details, '#template', ret.data);
  611. toast.hide();
  612. } else {
  613. toast.hide();
  614. }
  615. })
  616. }
  617. // // 上传图片的高度
  618. function setUpHeight(that) {
  619. that.style.width = that.offsetWidth+ 'px'
  620. that.style.height = that.offsetWidth+ 'px'
  621. }
  622. //  上传图浏览
  623. // function browseImg(data, i) {
  624. // var imageBrowser = api.require('imageBrowser');
  625. // imageBrowser.openImages({
  626. // imageUrls: data.split(','),
  627. // activeIndex:i,
  628. // showList:false
  629. // });
  630. // }
  631. // 上传文件在线浏览
  632. function browseFile(paths, flag) {
  633. api.download({
  634. url: paths,
  635. report: true,
  636. cache: true,
  637. allowResume: true
  638. }, function(ret, err) {
  639. if (ret.state == 1) {
  640. if (!flag) {
  641. var superFile = api.require('superFile');
  642. superFile.open({
  643. path: ret.savePath
  644. });
  645. }
  646. setTimeout(function() {
  647. api.toast({
  648. msg: '下载成功',
  649. duration: 2000,
  650. location: 'top'
  651. });
  652. }, 100)
  653. } else {
  654. }
  655. });
  656. }
  657. // 通过
  658. function openAdopt(id) {
  659. // var node_personal= $('.node-personal')
  660. // var hadFlows={};
  661. // var hadFlows1=[];
  662. // node_personal.each(function (index) {
  663. // var personal_names = $(this).find('.personal-name')
  664. // var key = $(this).attr('flowName')+'-'+index
  665. // for (var i=0;i<personal_names.length;i++){
  666. // hadFlows1.push($(personal_names[i]).attr('jobId'))
  667. // }
  668. // hadFlows[key] = hadFlows1.join(',');
  669. // });
  670. api.openFrame({
  671. name: 'myAdopt',
  672. bounces: false,
  673. url: 'myAdopt.html',
  674. bgColor: 'rgba(0,0,0,.6)',
  675. animation: {
  676. type: "fade",
  677. subType: "from_right",
  678. duration: 300
  679. },
  680. rect: {
  681. x: 0,
  682. y: 0,
  683. w: api.winWidth,
  684. h: 'auto',
  685. },
  686. pageParam: {
  687. ID: id,
  688. // forward_content: $api.val($api.dom('.column-textarea')),
  689. // forward_staff: hadFlows1
  690. }
  691. });
  692. }
  693. // 驳回
  694. function openReject(id) {
  695. api.openFrame({
  696. name: 'myReject',
  697. bounces: false,
  698. url: 'myReject.html',
  699. bgColor: 'rgba(0,0,0,.6)',
  700. rect: {
  701. x: 0,
  702. y: 0,
  703. w: api.winWidth,
  704. h: 'auto',
  705. },
  706. animation: {
  707. type: "fade",
  708. subType: "from_right",
  709. duration: 300
  710. },
  711. pageParam: {
  712. ID: id
  713. }
  714. });
  715. }
  716. // 定位初始化
  717. var spName = '',
  718. lon = '',
  719. lat = '';
  720. function getLonLat(flag) {
  721. if (flag == 1) {
  722. api.showProgress({
  723. title: '提示',
  724. text: '定位中...',
  725. });
  726. }
  727. var aMap = api.require('aMap');
  728. aMap.getLocation(function(ret, err) {
  729. if (ret.status) {
  730. api.hideProgress();
  731. lon = ret.lon;
  732. lat = ret.lat;
  733. aMap.getNameFromCoords({
  734. lon: ret.lon,
  735. lat: ret.lat
  736. }, function(ret, err) {
  737. if (ret.status) {
  738. spName = ret.address
  739. $apis.html(position_warp, '#mapTemplate', ret);
  740. } else {
  741. api.toast({
  742. msg: '请打开手机定位',
  743. duration: 2000,
  744. location: 'top'
  745. });
  746. }
  747. });
  748. } else {
  749. api.hideProgress();
  750. api.toast({
  751. msg: '定位失败请重新定位',
  752. duration: 2000,
  753. location: 'top'
  754. });
  755. }
  756. });
  757. return '';
  758. }
  759. function uploadImg(type, that) {
  760. if (type == 'remote') {
  761. api.getPicture({
  762. sourceType: 'camera',
  763. mediaValue: 'pic',
  764. saveToPhotoAlbum: false
  765. }, function(ret, err) {
  766. if (ret && ret.data != '') {
  767. uploadHead(ret.data, that);
  768. } else {
  769. alert(JSON.stringify(err));
  770. }
  771. });
  772. }
  773. }
  774. // upload img
  775. function uploadHead(imgUrl, that) {
  776. $http.fileUploadRequest(UrlRouter.up_images, 'post', {
  777. image: imgUrl
  778. })
  779. .then(ret => {
  780. if (ret.code == 0) {
  781. var html = `<div class="img-item file-width" img-Url="${ret.data.path}">
  782. <img src="${ret.data.path}" alt="">
  783. </div>`;
  784. $api.append(that.parentNode, html);
  785. api.toast({
  786. msg: '上传成功',
  787. duration: 2000,
  788. location: 'top'
  789. });
  790. } else {
  791. api.toast({
  792. msg: '上传失败',
  793. duration: 2000,
  794. location: 'top'
  795. });
  796. }
  797. })
  798. .catch(err => {
  799. api.toast({
  800. msg: '网络错误',
  801. duration: 2000,
  802. location: 'top'
  803. });
  804. })
  805. }
  806. // 获取相册图片路径
  807. function changeImageUrl(el) {
  808. UIAlbumBrowser.imagePicker({
  809. max: 9,
  810. styles: {
  811. bg: '#000000',
  812. //cameraImg: 'widget://res/cameraImg.png',
  813. mark: {
  814. position: 'top_right',
  815. size: 20
  816. },
  817. nav: {
  818. bg: '#000000',
  819. cancelColor: '#fff',
  820. cancelSize: 16,
  821. nextStepColor: '#7fff00',
  822. nextStepSize: 16
  823. },
  824. thumbnail: {
  825. w: 100,
  826. h: 100
  827. }
  828. },
  829. animation: true,
  830. }, function(ret) {
  831. if (ret.eventType == 'nextStep') {
  832. UIAlbumBrowser.closePicker();
  833. if (ret.list && ret.list.length > 0) {
  834. imgarr = ret.list;
  835. // 转换缩略图路径 ios
  836. UIAlbumBrowser_transPath(el);
  837. }
  838. }
  839. if (ret.originalPath && ret.originalPath.length > 0) {
  840. uploadHead(ret.originalPath, el)
  841. }
  842. });
  843. }
  844. // 转换缩略图路径 ios
  845. function UIAlbumBrowser_transPath(el) {
  846. UIAlbumBrowser.transPath({
  847. path: imgarr[i].path
  848. }, function(ret, err) {
  849. if (ret) {
  850. i++;
  851. if (i < imgarr.length) {
  852. UIAlbumBrowser_transPath(el);
  853. } else {
  854. i = 0;
  855. }
  856. uploadHead(ret.path, el)
  857. }
  858. });
  859. }
  860. // 备注地理位置
  861. function addPositionNotes() {
  862. var headers = {
  863. "Authorization": "Bearer " + token
  864. };
  865. var photoFile = $('.photoFile'),
  866. photoArray = [],
  867. inputObj = {};
  868. photoFile.each(function() {
  869. inputObj = {};
  870. photoArray = [];
  871. var photoList = $(this).find('.img-item');
  872. photoList.each(function() {
  873. photoArray.push($(this).attr('img-Url'));
  874. });
  875. inputObj.inputValue = photoArray.join(',');
  876. });
  877. const query = {
  878. address: spName,
  879. longitude: lon,
  880. latitude: lat,
  881. remark_info: {
  882. remarkInfo: $api.val($api.byId('remark_information')),
  883. imageList: photoArray
  884. }
  885. }
  886. $http.fnReuestData(UrlRouter.fill_order + api.pageParam.ID, headers, 'post', query, function(ret, err) {
  887. if (ret.code === 0) {
  888. toast.hide();
  889. getApplyDe(api.pageParam.ID, token)
  890. } else {
  891. api.toast({
  892. msg: ret.message,
  893. duration: 2000,
  894. location: 'bottom'
  895. });
  896. toast.hide();
  897. }
  898. })
  899. }
  900. // textarea根据文字多少自适应高度
  901. function Oninput(that) {
  902. $(that).height(that.scrollHeight);
  903. }
  904. // 打开地图
  905. function openMaps(lon, lat) {
  906. $event.openTabLayout('map', '../browseQrcode/map', '', {
  907. lon: lon,
  908. lat: lat
  909. })
  910. }
  911. // 图片浏览
  912. function browseImgTwo(i, value) {
  913. var imageBrowser = api.require('imageBrowser');
  914. imageBrowser.openImages({
  915. imageUrls: value.split(','),
  916. activeIndex: i,
  917. showList: false
  918. });
  919. }
  920. </script>
  921. </html>