wordorderDetails.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. <!DOCTYPE html>
  2. <html class="mask">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta
  6. name="viewport"
  7. content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
  8. />
  9. <meta
  10. name="format-detection"
  11. content="telephone=no,email=no,date=no,address=no"
  12. />
  13. <title></title>
  14. <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  15. <link rel="stylesheet" href="../../css/style.css" />
  16. <link rel="stylesheet" href="../../css/projeck.css" />
  17. <style>
  18. body {
  19. background: #fff;
  20. }
  21. .hidden {
  22. width: 100%;
  23. height: 100%;
  24. overflow: hidden;
  25. }
  26. .api_layout {
  27. padding: 15px;
  28. }
  29. .column {
  30. margin-bottom: 10px;
  31. }
  32. .aui-row {
  33. border: 1px dashed #c8d2de;
  34. -webkit-border-radius: 5px;
  35. -moz-border-radius: 5px;
  36. border-radius: 5px;
  37. padding: 10px;
  38. }
  39. .technological-process {
  40. margin-top: 10px;
  41. }
  42. /*****/
  43. /*审批进度条*/
  44. .layui-timeline {
  45. padding-left: 5px;
  46. }
  47. .layui-timeline-item {
  48. position: relative;
  49. padding-bottom: 20px;
  50. }
  51. .layui-timeline-item:first-child:before {
  52. display: block;
  53. }
  54. .layui-timeline-item:before {
  55. content: '';
  56. position: absolute;
  57. left: 5px;
  58. top: 0;
  59. z-index: 0;
  60. width: 1px;
  61. height: 100%;
  62. }
  63. .layui-timeline-item:before {
  64. background-color: #e6e6e6;
  65. }
  66. .layui-timeline-axis {
  67. position: absolute;
  68. left: -5px;
  69. top: 0;
  70. z-index: 10;
  71. width: 20px;
  72. height: 20px;
  73. line-height: 20px;
  74. background-color: #fff;
  75. color: #5fb878;
  76. border-radius: 50%;
  77. text-align: center;
  78. cursor: pointer;
  79. border: 1px solid #5fb878;
  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. /******/
  96. .aui-list-item-input label {
  97. font-size: 14px;
  98. height: 21px;
  99. display: inline-block;
  100. line-height: 22px;
  101. margin-right: 5px;
  102. }
  103. .aui-list-item-input label:last-child {
  104. margin-right: 0;
  105. }
  106. .itmes li {
  107. display: flex;
  108. justify-content: space-between;
  109. flex-wrap: nowrap;
  110. padding: 10px 0;
  111. position: relative;
  112. }
  113. .itmes li:after {
  114. content: '';
  115. position: absolute;
  116. bottom: 0;
  117. left: 0;
  118. height: 1px;
  119. background: #ebeef3;
  120. width: 100%;
  121. }
  122. .itmes p {
  123. width: 40%;
  124. color: #2c3e50;
  125. font-size: 15px;
  126. }
  127. .itmes p:last-child {
  128. width: 60%;
  129. color: #3498db;
  130. }
  131. .column {
  132. margin-top: 15px;
  133. }
  134. .column-title {
  135. font-size: 15px;
  136. color: #2c3e50;
  137. margin-bottom: 5px;
  138. display: block;
  139. }
  140. .header-img {
  141. width: 50px;
  142. height: 50px;
  143. -webkit-border-radius: 50%;
  144. -moz-border-radius: 50%;
  145. border-radius: 50%;
  146. object-fit: cover;
  147. margin-right: 10px;
  148. }
  149. .img-title {
  150. display: flex;
  151. justify-content: flex-start;
  152. flex-wrap: nowrap;
  153. }
  154. .personalInfo {
  155. margin-bottom: 20px;
  156. }
  157. .personalInfo span {
  158. display: block;
  159. font-size: 14px;
  160. color: #6c6f74;
  161. }
  162. .personalInfo span:first-child {
  163. font-size: 18px;
  164. color: #002257;
  165. }
  166. .examine-success {
  167. background: #1abc9c;
  168. margin-left: 20px;
  169. }
  170. .examine-red {
  171. background: #e74c3c;
  172. }
  173. .staff_name {
  174. width: 50px;
  175. height: 50px;
  176. -webkit-border-radius: 50%;
  177. -moz-border-radius: 50%;
  178. border-radius: 50%;
  179. margin-right: 10px;
  180. line-height: 50px;
  181. text-align: center;
  182. color: #fff;
  183. }
  184. .aui-col-xs-4 img {
  185. object-fit: cover;
  186. border-radius: 3px;
  187. margin: auto;
  188. }
  189. .aui-col-xs-4 span {
  190. overflow: hidden;
  191. text-overflow: ellipsis;
  192. display: -webkit-box;
  193. -webkit-line-clamp: 2;
  194. -webkit-box-orient: vertical;
  195. padding: 0 3px;
  196. height: 48px;
  197. text-align: center;
  198. margin: 5px 0;
  199. font-size: 15px;
  200. }
  201. .fileList img {
  202. width: 35px;
  203. height: 35px;
  204. }
  205. .name-column span {
  206. background: #009fe8;
  207. padding: 3px;
  208. color: #fff;
  209. border-radius: 2px;
  210. font-size: 13px;
  211. }
  212. /*抄送人部分*/
  213. .addNode-name {
  214. padding: 5px 5px;
  215. background: #009fe8;
  216. font-size: 16px;
  217. color: #fff;
  218. font-weight: bold;
  219. text-align: center;
  220. display: inline-block;
  221. border-radius: 2px;
  222. margin-left: 5px;
  223. }
  224. .aui-list-item-input label {
  225. font-size: 14px;
  226. height: 21px;
  227. display: inline-block;
  228. line-height: 22px;
  229. margin-right: 5px;
  230. }
  231. .aui-list-item-input label:last-child {
  232. margin-right: 0;
  233. }
  234. .column {
  235. margin-bottom: 10px;
  236. }
  237. .node-personal {
  238. width: 65%;
  239. display: -webkit-box;
  240. justify-items: flex-start;
  241. align-items: center;
  242. align-content: center;
  243. flex-wrap: wrap;
  244. line-height: normal;
  245. }
  246. .personal-name {
  247. display: inline-block;
  248. font-size: 13px;
  249. padding: 4px 3px;
  250. background: #009fe8;
  251. color: #fff;
  252. border-radius: 2px;
  253. margin-left: 5px;
  254. margin-bottom: 5px;
  255. position: relative;
  256. }
  257. .ico-loading {
  258. position: absolute;
  259. top: 0;
  260. left: 0;
  261. bottom: 0;
  262. right: 0;
  263. margin: auto;
  264. width: 35px;
  265. height: 35px;
  266. background: url('../../icon/loading.gif') no-repeat;
  267. background-size: cover;
  268. background-position: center;
  269. }
  270. .loading {
  271. position: absolute;
  272. width: 100%;
  273. height: 100%;
  274. background: rgba(255, 255, 255, 0.3);
  275. top: 0;
  276. left: 0;
  277. }
  278. /*#personal_List {
  279. background: red;
  280. overflow: scroll;
  281. }*/
  282. .api_layout_box {
  283. z-index: 10000;
  284. }
  285. .forward-content {
  286. margin-top: 10px;
  287. }
  288. .column-textarea {
  289. /*border: 1px solid #97a3b4;*/
  290. border: 1px solid #ccc;
  291. -webkit-border-radius: 5px;
  292. -moz-border-radius: 5px;
  293. border-radius: 5px;
  294. padding: 10px;
  295. height: 160px;
  296. }
  297. .column-textarea::placeholder {
  298. font-size: 14px;
  299. color: #333;
  300. }
  301. .aui-btn-danger-reject,
  302. .aui-btn-success-adopt {
  303. width: 60px;
  304. height: 35px;
  305. text-align: center;
  306. line-height: 35px;
  307. color: #ffffff;
  308. font-size: 14px;
  309. }
  310. .column-select {
  311. -webkit-appearance: none;
  312. /* google */
  313. -moz-appearance: none;
  314. /* firefox */
  315. appearance: none;
  316. /* IE */
  317. }
  318. /* .sureCircle,
  319. .rejectCircle,
  320. .waitCircle {
  321. width: 20px;
  322. height: 20px;
  323. border-radius: 20px;
  324. background-size: 100% 100%;
  325. background-repeat: no-repeat;
  326. } */
  327. .sureCircle {
  328. width: 30px;
  329. height: 30px;
  330. border-radius: 30px;
  331. background-size: cover;
  332. background: url('../../image/sureCircle.png') no-repeat;
  333. }
  334. .rejectCircle {
  335. background: url('../../image/rejectCircle.png') no-repeat;
  336. }
  337. .waitCircle {
  338. background: url('../../image/waitCircle.png') no-repeat;
  339. }
  340. </style>
  341. </head>
  342. <body>
  343. <div class="api_layout" id="wordOrder_details">
  344. <!-- <div class="sureCircle"></div> -->
  345. <!-- <div class="technologicals" style="margin-top:10px">
  346. <label class="column-title">固定审批流程:</label>
  347. <div class="technological-process">
  348. <ul class="layui-timeline">
  349. <li class="layui-timeline-item">
  350. <i class="aui-iconfont aui-icon-correct Correct layui-timeline-axis" ></i>
  351. <div class="layui-timeline-content layui-text">
  352. <div class="layui-timeline-title">
  353. <span>部门负责人:</span>
  354. <div class="name-column">
  355. <span>章三</span>
  356. </div>
  357. </div>
  358. </div>
  359. </li>
  360. <li class="layui-timeline-item">
  361. <i class="aui-iconfont aui-icon-correct Correct layui-timeline-axis" ></i>
  362. <div class="layui-timeline-content layui-text">
  363. <div class="layui-timeline-title">
  364. <span>部门负责人:</span>
  365. <div class="name-column">
  366. <span>章三</span>
  367. </div>
  368. </div>
  369. </div>
  370. </li>
  371. </ul>
  372. </div>
  373. </div> -->
  374. </div>
  375. <!--添加抄送人员-->
  376. <div class="api_layout_box hide">
  377. <div class="box_m">
  378. <div class="api_box">
  379. <div class="selectTitle after-border relative">
  380. <h3 class="h3">选择抄送人</h3>
  381. <i
  382. class="aui-iconfont aui-icon-close api-icon-close"
  383. onclick="closesss()"
  384. ></i>
  385. </div>
  386. <div class="aui-list-item-input relative">
  387. <select
  388. class="column-select input-s font-s"
  389. style="height:40px;-webkit-appearance:none;appearance:none;border:none;font-size:18px;padding:0px 10px;display:block;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color: #FFFFFF;color:#333333;border-radius:4px;"
  390. onchange="getApproList($api.val(this))"
  391. >
  392. <option value="0">请选择部门</option>
  393. </select>
  394. </div>
  395. </div>
  396. <ul class="column" id="personal_List" style="margin-bottom: 0"></ul>
  397. <div class="loading hide">
  398. <i class="ico-loading"></i>
  399. </div>
  400. </div>
  401. </div>
  402. </body>
  403. <!-- 部门人员 -->
  404. <script type="text/template" id="getApproList">
  405. {{ for (var i = 0;i
  406. <it.length;i++) { }} <li class="after-border relative">
  407. <label class="remember-me-label flex-space">
  408. <div class="flex-start">
  409. <img src="" onerror=javascript:this.src="http://jiewei-icon.oss-cn-beijing.aliyuncs.com/icon/default-avatar.png" class="api_leader_head">
  410. <div>
  411. <p class="name font-s">{{=it[i].name}}</p>
  412. <p class="del font-s">{{=it[i].section_fullname}}</p>
  413. </div>
  414. </div>
  415. <div class="remember-password-container">
  416. <div class="remember-password-content">
  417. <input type="checkbox" class='checkbox' onchange="addApproValPesonal(this)" {{=personals.length>0?(it[i].staff_num == personals[i]?'checked':''):''}} value="{{=it[i].staff_num}}" name="{{=it[i].name}}">
  418. <span></span>
  419. </div>
  420. </div>
  421. </label>
  422. </li>
  423. {{ } }}
  424. </script>
  425. <!-- 审批流程 -->
  426. <script type="text/template" id="templateApply">
  427. <label class="column-title">固定审批流程:</label>
  428. <div class="technological-process">
  429. {{ for(var i=0;i
  430. <it.length;i++) { }} <div class="node-content">
  431. <span class="node-name">{{=it[i]}}:</span>
  432. <div class="node-personal" flowName='{{=it[i]}}' jobIDs="">
  433. <i class="aui-iconfont aui-icon-plus addNode-name" onclick="approValPesonal(this)"></i>
  434. </div>
  435. </div>
  436. {{ } }}
  437. </div>
  438. </script>
  439. <!-- 工单编号 分类 名称等 -->
  440. <script type="text/template" id="template">
  441. <div class="personalInfo">
  442. <div class="img-title">
  443. {{?it.staff_avatar === null}}
  444. <p class="staff_name" style="background:#{{=Math.random().toString(16).slice(2,8)}}">{{=it.staff.substr(it.staff.length-1,1)}}</p>
  445. {{??}}
  446. <img src="{{=it.staff_avatar}}" alt="" class="header-img"> {{?}}
  447. <div>
  448. <span>{{=it.staff}}</span>
  449. <span>{{=it.section}}</span>
  450. </div>
  451. </div>
  452. </div>
  453. <ul class="itmes ">
  454. <li>
  455. <p>工单编号:</p>
  456. <p>#{{=it.id}}</p>
  457. </li>
  458. <li>
  459. <p>工单分类:</p>
  460. <p>{{=it.classify}}</p>
  461. </li>
  462. <li>
  463. <p>流程名称:</p>
  464. <p>{{=it.title}}</p>
  465. </li>
  466. </ul>
  467. <ul class="itmes ">
  468. {{ for (var i = 0;i
  469. <it.form.length;i++) { }} {{?it.form[i].type !='images' && it.form[i].type !='files' }} <li>
  470. <p>{{=it.form[i].label}}:</p>
  471. <p>{{=it.form[i].value}}</p>
  472. </li>
  473. {{?}} {{ } }}
  474. </ul>
  475. <div class="column-row">
  476. {{ for (var i = 0;i
  477. <it.form.length;i++) { }} {{?it.form[i].type=='images' }} <div class="column">
  478. <label class="column-title">{{=it.form[i].label}}:</label>
  479. <div class="aui-row aui-row-padded">
  480. {{ for (var j = 0;j
  481. <it.form[i].value.length;j++) { }} <div class="aui-col-xs-4">
  482. <img src="{{=it.form[i].value[j]}}" class="colsImg" onload="setUpHeight(this)" onclick="browseImg('{{=it.form[i].value}}','{{=j}}')" />
  483. </div>
  484. {{ } }}
  485. </div>
  486. </div>
  487. {{??it.form[i].type == 'files' && it.form[i].value.length > 0}}
  488. <div class="column">
  489. <label class="column-title">{{=it.form[i].label}}:</label>
  490. <div class="aui-row aui-row-padded fileList">
  491. {{ for (var j = 0;j
  492. <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}}')">
  493. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  494. <span>{{=it.form[i].value[j].name}}</span>
  495. </div>
  496. {{??it.form[i].value[j].path.endsWith('pdf')}}
  497. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  498. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  499. <span>{{=it.form[i].value[j].name}}</span>
  500. </div>
  501. {{??it.form[i].value[j].path.endsWith('ppt') || it.form[i].value[j].path.endsWith('ptx')}}
  502. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  503. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  504. <span>{{=it.form[i].value[j].name}}</span>
  505. </div>
  506. {{??it.form[i].value[j].path.endsWith('zip') || it.form[i].value[j].path.endsWith('rar')}}
  507. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}',true)">
  508. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  509. <span>{{=it.form[i].value[j].name}}</span>
  510. </div>
  511. {{??it.form[i].value[j].path.endsWith('xlsx')}}
  512. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  513. <img src="../../icon/{{=it.form[i].value[j].path.substr(it.form[i].value[j].path.length-3,3)}}.png" />
  514. <span>{{=it.form[i].value[j].name}}</span>
  515. </div>
  516. {{??}}
  517. <div class="aui-col-xs-4" onclick="browseFile('{{=it.form[i].value[j].path}}')">
  518. <img src="../../icon/OTHER.png" />
  519. <span>{{=it.form[i].value[j].name}}</span>
  520. </div>
  521. {{?}} {{ } }}
  522. </div>
  523. </div>
  524. {{?}} {{ } }}
  525. </div>
  526. <!-- <div class="copy-person" style="margin-top: 10px">
  527. <label class="column-title">固定抄送人流程:</label>
  528. </div> -->
  529. <div class="technologicals" style="margin-top:10px">
  530. <label class="column-title">固定审批流程:</label>
  531. <div class="technological-process">
  532. {{ for(var prop in it.flows) { }}
  533. <ul class="layui-timeline">
  534. <li class="layui-timeline-item">
  535. <!-- {{? it.flows[prop].status == 2}}
  536. <div class="sureCircle"></div>
  537. {{?? it.flows[prop].status == 3}}
  538. <div class="rejectCircle"></div>
  539. {{??}}
  540. <div class="waitCircle"></div>
  541. {{?}} -->
  542. <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>
  543. <div class="layui-timeline-content layui-text">
  544. <div class="layui-timeline-title">
  545. <span>{{=it.flows[prop].flow_name}}:</span>
  546. <div class="name-column">
  547. {{ for (var j = 0;j
  548. <it.flows[prop].flow.length;j++) { }} <span>{{=it.flows[prop].flow[j]}}</span>
  549. {{ } }}
  550. </div>
  551. </div>
  552. </div>
  553. </li>
  554. </ul>
  555. {{ } }}
  556. </div>
  557. </div>
  558. <!-- 抄送人 根据is- -->
  559. {{?it.is_forward == 1}}
  560. <div class="is-cpoy-module">
  561. <label class="column-title">抄送人:</label>
  562. <div class="chioce-copy-person">
  563. <div class="node-personal" jobIDs="">
  564. <i class="aui-iconfont aui-icon-plus addNode-name" onclick="approValPesonal(this)"></i>
  565. </div>
  566. </div>
  567. <div class="forward-content">
  568. <textarea rows="4" cols="40" class="column-textarea font-s column-textarea1" placeholder="请输入抄送原因"></textarea>
  569. </div>
  570. </div>
  571. {{?}}
  572. <div style="text-align: center;margin-top: 15px">
  573. <div class="aui-btn aui-btn-danger-reject examine-red" onclick="openReject('{{=it.id}}')">驳回</div>
  574. <div class="aui-btn aui-btn-success-adopt examine-success" onclick="openAdopt('{{=it.id}}')">通过</div>
  575. </div>
  576. </script>
  577. <script type="text/javascript" src="../../script/api.js"></script>
  578. <script type="text/javascript" src="../../script/doT.min.js"></script>
  579. <script src="../../script/zepto.js" charset="utf-8"></script>
  580. <script type="text/javascript" src="../../script/config.js"></script>
  581. <script type="text/javascript">
  582. var toast = new auiToast(),
  583. personals = '',
  584. addNodeThis = '';
  585. apiready = function() {
  586. var info = $api.getStorage('data');
  587. token = JSON.parse(info).data.access_token;
  588. getApplyDe(api.pageParam.ID, token);
  589. getApplyDeTwo(api.pageParam.id, token);
  590. };
  591. function getApplyDe(id, token) {
  592. var headers = {
  593. Authorization: 'Bearer ' + token,
  594. };
  595. $http.fnReuestData(
  596. UrlRouter.getExamineDe + id,
  597. headers,
  598. 'get',
  599. '',
  600. function(ret, err) {
  601. // console.log(JSON.stringify(ret.data));
  602. if (ret.code === 0) {
  603. $apis.html(wordOrder_details, '#template', ret.data);
  604. toast.hide();
  605. } else if (ret.code == 1) {
  606. $apis.ToastType(ret.message, 'bottom');
  607. toast.hide();
  608. }
  609. }
  610. );
  611. }
  612. //
  613. function getApplyDeTwo(id, token) {
  614. var headers = {
  615. Authorization: 'Bearer ' + token,
  616. };
  617. $http.fnReuestDataNologing(
  618. UrlRouter.getApplyD + id,
  619. headers,
  620. 'get',
  621. '',
  622. function(ret, err) {
  623. if (ret.code === 0) {
  624. toast.hide();
  625. $apis.append(column_row, '#template', ret.data.form);
  626. $apis.append(technologicals, '#templateApply', ret.data.flow);
  627. }
  628. }
  629. );
  630. }
  631. // 通过
  632. function openAdopt(id) {
  633. var node_personal = $('.node-personal');
  634. var hadFlows = {};
  635. var hadFlows1 = [];
  636. node_personal.each(function(index) {
  637. var personal_names = $(this).find('.personal-name');
  638. // + '-' + index
  639. var key = $(this).attr('flowName');
  640. for (var i = 0; i < personal_names.length; i++) {
  641. hadFlows1.push($(personal_names[i]).attr('jobId'));
  642. }
  643. hadFlows[key] = hadFlows1.join(',');
  644. });
  645. api.openFrame({
  646. name: 'adopt',
  647. bounces: false,
  648. url: 'adopt.html',
  649. bgColor: 'rgba(0,0,0,.6)',
  650. animation: {
  651. type: 'fade',
  652. subType: 'from_right',
  653. duration: 300,
  654. },
  655. rect: {
  656. x: 0,
  657. y: 0,
  658. w: api.winWidth,
  659. h: 'auto',
  660. },
  661. pageParam: {
  662. ID: id,
  663. forward_content: $api.val($api.dom('.column-textarea')),
  664. forward_staff: hadFlows1,
  665. },
  666. });
  667. }
  668. // 驳回
  669. function openReject(id) {
  670. api.openFrame({
  671. name: 'reject',
  672. bounces: false,
  673. url: 'reject.html',
  674. bgColor: 'rgba(0,0,0,.6)',
  675. rect: {
  676. x: 0,
  677. y: 0,
  678. w: api.winWidth,
  679. h: 'auto',
  680. },
  681. animation: {
  682. type: 'fade',
  683. subType: 'from_right',
  684. duration: 300,
  685. },
  686. pageParam: {
  687. ID: id,
  688. },
  689. });
  690. }
  691. // 获取部门
  692. function getDep() {
  693. var headers = {
  694. Authorization: 'Bearer ' + token,
  695. };
  696. $http.fnReuestDataNologing(
  697. UrlRouter.getAlllist,
  698. headers,
  699. 'get',
  700. '',
  701. function(ret, err) {
  702. var html = '';
  703. for (var i = 0; i < ret.data.length; i++) {
  704. if (i == 0) {
  705. html += `<option value="0">请选择部门</option>`;
  706. }
  707. html += `<option value="${ret.data[i].id}">${ret.data[i].title}</option>`;
  708. }
  709. $api.html($api.dom('.column-select'), html);
  710. }
  711. );
  712. }
  713. // 获取人员列表
  714. function getApproList(id) {
  715. $api.removeCls($api.dom('.loading'), 'hide');
  716. $apis.html(personal_List, '#getApproList', '');
  717. var headers = {
  718. Authorization: 'Bearer ' + token,
  719. };
  720. $http.fnReuestDataNologing(
  721. UrlRouter.getPersonalList,
  722. headers,
  723. 'post',
  724. {
  725. id: id,
  726. },
  727. function(ret, err) {
  728. if (ret.code === 0) {
  729. $api.addCls($api.dom('.loading'), 'hide');
  730. $apis.html(personal_List, '#getApproList', ret.data);
  731. }
  732. }
  733. );
  734. }
  735. // 添加抄送人员
  736. function addApproValPesonal(that) {
  737. var personal_name = $(addNodeThis)
  738. .parent()
  739. .find('.personal-name');
  740. var name = $api.attr(that, 'name'),
  741. ID = $api.val(that),
  742. IDS = [];
  743. let addSdtaffNum = [];
  744. if (that.checked) {
  745. $api.prepend(
  746. addNodeThis.parentNode,
  747. `<sapn class="personal-name" jobId="${ID}" ondblclick="this.remove()">${name}</span>`
  748. );
  749. $(addNodeThis)
  750. .parent()
  751. .attr('jobIDs', IDS.push(ID));
  752. // console.log(JSON.stringify($('.personal-name').attr('jobId')));
  753. } else {
  754. $(addNodeThis)
  755. .parent()
  756. .find('[jobid*="' + ID + '"]')
  757. .remove();
  758. // console.log(JSON.stringify($('.personal-name').attr('jobId')));
  759. }
  760. }
  761. // 打开抄送人
  762. var ruleTop = '';
  763. function approValPesonal(that) {
  764. addNodeThis = that;
  765. $('.api_layout_box').show();
  766. $('.mask').addClass('hidden');
  767. ruleTop = $(addNodeThis).offset().top;
  768. $apis.html(personal_List, '#getApproList', '');
  769. getDep(); //调用部门接口
  770. }
  771. // 关闭
  772. function closesss() {
  773. $('.api_layout_box').hide();
  774. $('.mask').removeClass('hidden');
  775. $('body,html').scrollTop(ruleTop);
  776. }
  777. // 上传图片的高度
  778. function setUpHeight(that) {
  779. that.style.width = that.offsetWidth + 'px';
  780. that.style.height = that.offsetWidth + 'px';
  781. }
  782. // 上传图浏览
  783. function browseImg(data, i) {
  784. var imageBrowser = api.require('imageBrowser');
  785. imageBrowser.openImages({
  786. imageUrls: data.split(','),
  787. activeIndex: i,
  788. showList: false,
  789. });
  790. }
  791. // 上传文件在线浏览
  792. function browseFile(paths, flag) {
  793. api.download(
  794. {
  795. url: paths,
  796. report: true,
  797. cache: true,
  798. allowResume: true,
  799. },
  800. function(ret, err) {
  801. if (ret.state == 1) {
  802. if (!flag) {
  803. var superFile = api.require('superFile');
  804. superFile.open({
  805. path: ret.savePath,
  806. });
  807. }
  808. setTimeout(function() {
  809. api.toast({
  810. msg: '下载成功',
  811. duration: 2000,
  812. location: 'top',
  813. });
  814. }, 100);
  815. } else {
  816. }
  817. }
  818. );
  819. }
  820. </script>
  821. </html>