audit_modal.ejs 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. <% if (tender.ledger_status === auditConst.status.checking && tender.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  2. <!--审批通过-->
  3. <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
  4. <div class="modal-dialog modal-lg" role="document">
  5. <form class="modal-content" action="<%- preUrl %>/ledger/audit/check" method="post" onsubmit="return auditCheck(0);">
  6. <div class="modal-header">
  7. <h5 class="modal-title">审批通过</h5>
  8. </div>
  9. <div class="modal-body">
  10. <div class="row">
  11. <div class="col-4">
  12. <% if(tender.ledger_status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  13. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  14. <% } %>
  15. <div class="card modal-height-500 mt-3 scroll-y">
  16. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  17. <% tender.userGroups.forEach((group, idx) => { %>
  18. <% if (idx === 0) { %>
  19. <li class="list-group-item d-flex justify-content-between align-items-center">
  20. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  21. <span class="text-muted">
  22. <% for (const u of group) { %>
  23. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  24. <% } %>
  25. </span>
  26. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  27. </li>
  28. <% } else if(idx === tender.userGroups.length -1 && idx !== 0) { %>
  29. <li class="list-group-item d-flex justify-content-between align-items-center">
  30. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  31. <span class="text-muted">
  32. <% for (const u of group) { %>
  33. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  34. <% } %>
  35. </span>
  36. <div class="d-flex ml-auto">
  37. <% if (group[0].audit_type !== auditType.key.common) { %>
  38. <span class="badge badge-pill badge-<%- auditType.info[group[0].audit_type].class %> p-1"><small><%- auditType.info[group[0].audit_type].short %></small></span>
  39. <% } %>
  40. <span class="badge badge-light badge-pill"><small>终审</small></span>
  41. </div>
  42. </li>
  43. <% } else {%>
  44. <li class="list-group-item d-flex justify-content-between align-items-center">
  45. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  46. <span class="text-muted">
  47. <% for (const u of group) { %>
  48. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  49. <% } %>
  50. </span>
  51. <div class="d-flex ml-auto">
  52. <% if (group[0].audit_type !== auditType.key.common) { %>
  53. <span class="badge badge-pill badge-<%- auditType.info[group[0].audit_type].class %> p-1"><small><%- auditType.info[group[0].audit_type].short %></small></span>
  54. <% } %>
  55. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  56. </div>
  57. </li>
  58. <% } %>
  59. <% }) %>
  60. </ul>
  61. </div>
  62. </div>
  63. <div class="col-8 modal-height-500 scroll-y">
  64. <% tender.auditHistory.forEach((his, idx) => { %>
  65. <!-- 展开/收起历史流程 -->
  66. <% if(idx === tender.auditHistory.length - 1 && tender.auditHistory.length !== 1) { %>
  67. <div class="text-right">
  68. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  69. </div>
  70. <% } %>
  71. <div class="<%- idx < tender.auditHistory.length - 1 ? 'fold-card' : '' %>">
  72. <div class="text-center text-muted"><%- idx+1 %>#</div>
  73. <ul class="timeline-list list-unstyled mt-2 <% if (idx === tender.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  74. <% his.forEach((group, index) => { %>
  75. <% if (index === 0) { %>
  76. <li class="timeline-list-item pb-2">
  77. <div class="timeline-item-date">
  78. <%- group.beginYear %>
  79. <span><%- group.beginDate %></span>
  80. <span><%- group.beginTime %></span>
  81. </div>
  82. <div class="timeline-item-tail"></div>
  83. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  84. <div class="timeline-item-content">
  85. <div class="py-1">
  86. <span class="text-black-50">原报</span>
  87. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  88. </div>
  89. <div class="card">
  90. <div class="card-body px-3 py-0">
  91. <div class="card-text p-2 py-3 row">
  92. <div class="col">
  93. <span class="h6"><%- tender.user.name %></span>
  94. <span class="text-muted ml-1"><%- tender.user.role %></span>
  95. </div>
  96. <div class="col">
  97. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </li>
  104. <% } %>
  105. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === tender.auditHistory.length - 1) { %>is_uncheck<% } %>">
  106. <% if (group.endYear) { %>
  107. <div class="timeline-item-date">
  108. <%- group.endYear %>
  109. <span><%- group.endDate %></span>
  110. <span><%- group.endTime %></span>
  111. </div>
  112. <% } %>
  113. <% if (index < his.length - 1) { %>
  114. <div class="timeline-item-tail"></div>
  115. <% } %>
  116. <% if (group.status === auditConst.status.checked) { %>
  117. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  118. <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
  119. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  120. <% } else if (group.status === auditConst.status.checking) { %>
  121. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  122. <% } else { %>
  123. <div class="timeline-item-icon bg-secondary text-light"></div>
  124. <% } %>
  125. <div class="timeline-item-content">
  126. <div class="py-1">
  127. <span class="text-black-50">
  128. <%- (!group.is_final ? group.audit_order : '终') %>审
  129. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  130. </span>
  131. <% if (group.status !== auditConst.status.uncheck) { %>
  132. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  133. <% } %>
  134. </div>
  135. <div class="card">
  136. <div class="card-body px-3 py-0">
  137. <% for (const [i, auditor] of group.auditors.entries()) { %>
  138. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  139. <div class="col-10">
  140. <span class="h6"><%- auditor.name %></span>
  141. <span class="text-muted ml-1"><%- auditor.company %>
  142. <% if (auditor.role) { %>
  143. - <%= auditor.role %>
  144. <% } %>
  145. </span>
  146. </div>
  147. <div class="col">
  148. <% if (auditor.status === auditConst.status.checked) { %>
  149. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  150. <% } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
  151. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  152. <% } else if (auditor.status === auditConst.status.checking) { %>
  153. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  154. <% } %>
  155. </div>
  156. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  157. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  158. <% } %>
  159. <% if (auditor.status === auditConst.status.checking && auditor.audit_id === ctx.session.sessionUser.accountId) { %>
  160. <div class="col-12 py-1 bg-light">
  161. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  162. </div>
  163. <% } %>
  164. </div>
  165. <% } %>
  166. </div>
  167. </div>
  168. </div>
  169. </li>
  170. <% }) %>
  171. </ul>
  172. </div>
  173. <% }) %>
  174. </div>
  175. </div>
  176. </div>
  177. <div class="modal-footer">
  178. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  179. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  180. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  181. <button type="submit" class="btn btn-success btn-sm">确认通过</button>
  182. </div>
  183. </form>
  184. </div>
  185. </div>
  186. <!--审批退回-->
  187. <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
  188. <div class="modal-dialog modal-lg" role="document">
  189. <form class="modal-content modal-lg" action="<%- preUrl %>/ledger/audit/check" method="post"
  190. onsubmit="return auditCheck(1);">
  191. <div class="modal-header">
  192. <h5 class="modal-title">审批退回</h5>
  193. </div>
  194. <div class="modal-body">
  195. <div class="row">
  196. <div class="col-4">
  197. <% if(tender.ledger_status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  198. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  199. <% } %>
  200. <div class="card modal-height-500 mt-3 scroll-y" style="overflow: auto">
  201. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  202. <% tender.userGroups.forEach((item, idx) => { %>
  203. <% if (idx === 0) { %>
  204. <li class="list-group-item d-flex justify-content-between align-items-center">
  205. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  206. <span class="text-muted">
  207. <% for (const u of item) { %>
  208. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  209. <% } %>
  210. </span>
  211. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  212. </li>
  213. <% } else if(idx === tender.userGroups.length -1 && idx !== 0) { %>
  214. <li class="list-group-item d-flex justify-content-between align-items-center">
  215. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  216. <span class="text-muted">
  217. <% for (const u of item) { %>
  218. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  219. <% } %>
  220. </span>
  221. <div class="d-flex ml-auto">
  222. <% if (item[0].audit_type !== auditType.key.common) { %>
  223. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  224. <% } %>
  225. <span class="badge badge-light badge-pill"><small>终审</small></span>
  226. </div>
  227. </li>
  228. <% } else {%>
  229. <li class="list-group-item d-flex justify-content-between align-items-center">
  230. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  231. <span class="text-muted">
  232. <% for (const u of item) { %>
  233. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  234. <% } %>
  235. </span>
  236. <div class="d-flex ml-auto">
  237. <% if (item[0].audit_type !== auditType.key.common) { %>
  238. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  239. <% } %>
  240. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  241. </div>
  242. </li>
  243. <% } %>
  244. <% }) %>
  245. </ul>
  246. </div>
  247. </div>
  248. <div class="col-8 modal-height-500" style="overflow: auto">
  249. <% tender.auditHistory.forEach((his, idx) => { %>
  250. <!-- 展开/收起历史流程 -->
  251. <% if(idx === tender.auditHistory.length - 1 && tender.auditHistory.length !== 1) { %>
  252. <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
  253. data-idx="<%- idx + 1 %>">展开历史审批流程</a></div>
  254. <% } %>
  255. <div class="<%- idx < tender.auditHistory.length - 1 ? 'fold-card' : '' %>">
  256. <div class="text-center text-muted"><%- idx+1 %>#</div>
  257. <ul class="timeline-list list-unstyled mt-2 <% if (idx === tender.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  258. <% his.forEach((group, index) => { %>
  259. <% if (index === 0) { %>
  260. <li class="timeline-list-item pb-2">
  261. <div class="timeline-item-date">
  262. <%- group.beginYear %>
  263. <span><%- group.beginDate %></span>
  264. <span><%- group.beginTime %></span>
  265. </div>
  266. <div class="timeline-item-tail"></div>
  267. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  268. <div class="timeline-item-content">
  269. <div class="py-1">
  270. <span class="text-black-50">原报</span>
  271. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  272. </div>
  273. <div class="card">
  274. <div class="card-body px-3 py-0">
  275. <div class="card-text p-2 py-3 row">
  276. <div class="col-10">
  277. <span class="h6"><%- tender.user.name %></span>
  278. <span class="text-muted ml-1"><%- tender.user.role %></span>
  279. </div>
  280. <div class="col">
  281. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. </li>
  288. <% } %>
  289. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === tender.auditHistory.length - 1) { %>is_uncheck<% } %>">
  290. <% if (his.endYear) { %>
  291. <div class="timeline-item-date">
  292. <%- group.endYear %>
  293. <span><%- group.endDate %></span>
  294. <span><%- group.endTime %></span>
  295. </div>
  296. <% } %>
  297. <% if (index < his.length - 1) { %>
  298. <div class="timeline-item-tail"></div>
  299. <% } %>
  300. <% if (group.status === auditConst.status.checked) { %>
  301. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  302. <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
  303. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  304. <% } else if (group.status === auditConst.status.checking) { %>
  305. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  306. <% } else { %>
  307. <div class="timeline-item-icon bg-secondary text-light"></div>
  308. <% } %>
  309. <div class="timeline-item-content">
  310. <div class="py-1">
  311. <span class="text-black-50">
  312. <%- (!group.is_final ? group.audit_order : '终') %>审
  313. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  314. </span>
  315. <% if (group.status !== auditConst.status.uncheck) { %>
  316. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  317. <% } %>
  318. </div>
  319. <div class="card">
  320. <div class="card-body px-3 py-0">
  321. <% for (const [i, auditor] of group.auditors.entries()) { %>
  322. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  323. <div class="col-10">
  324. <span class="h6"><%- auditor.name %></span>
  325. <span class="text-muted ml-1"><%- auditor.company %>
  326. <% if (auditor.role) { %>
  327. - <%= auditor.role %>
  328. <% } %>
  329. </span>
  330. </div>
  331. <div class="col">
  332. <% if (auditor.status === auditConst.status.checked) { %>
  333. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  334. <% } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
  335. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  336. <% } else if (auditor.status === auditConst.status.checking) { %>
  337. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  338. <% } %>
  339. </div>
  340. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  341. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  342. <% } %>
  343. <% if (auditor.status === auditConst.status.checking && auditor.audit_id === ctx.session.sessionUser.accountId) { %>
  344. <div class="col-12 py-1 bg-light">
  345. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  346. </div>
  347. <% } %>
  348. </div>
  349. <% } %>
  350. </div>
  351. </div>
  352. </div>
  353. </li>
  354. <% }) %>
  355. </ul>
  356. </div>
  357. <% }) %>
  358. </div>
  359. </div>
  360. </div>
  361. <div class="modal-footer">
  362. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  363. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  364. <input type="hidden" name="checkType" value="<%= auditConst.status.checkNo %>" />
  365. <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
  366. </div>
  367. </form>
  368. </div>
  369. </div>
  370. <% } %>
  371. <% if (tender.ledger_status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  372. <!--上报审批-->
  373. <div class="modal fade" id="sub-sp2" data-backdrop="static">
  374. <div class="modal-dialog" style="max-width: 650px" role="document">
  375. <div class="modal-content">
  376. <div class="modal-header">
  377. <h5 class="modal-title">修改审批流程</h5>
  378. </div>
  379. <div class="modal-body">
  380. <div class="card mt-1">
  381. <div class="modal-height-500" style="overflow: visible">
  382. <style>
  383. #admin-edit-shenpi thead th {
  384. border-bottom: 0;
  385. }
  386. #admin-edit-shenpi td, #admin-edit-shenpi th {
  387. padding: 0.75rem;
  388. }
  389. #admin-edit-shenpi th {
  390. background: none;
  391. color: #212529;
  392. border-top: 0;
  393. }
  394. </style>
  395. <table class="table table-hover" id="admin-edit-shenpi">
  396. <thead>
  397. <tr class="card-header text-center">
  398. <th width="100px">审批流程</th>
  399. <th>审批人员</th>
  400. <th width="80" style="text-align: center">审批状态</th>
  401. <th width="200" style="text-align: center">操作</th>
  402. </tr>
  403. </thead>
  404. <tbody id="admin-edit-shenpi-list">
  405. <% for (const [i, group] of tender.auditors2.entries()) { %>
  406. <% if (i === 0) continue; %>
  407. <% for (const [j, auditor] of group.entries()) { %>
  408. <tr>
  409. <td class="text-left d-flex">
  410. <% if (j === 0) { %>
  411. <%- i + '审' %>
  412. <% if (auditor.audit_type !== auditType.key.common) { %>
  413. <span class="ml-2 badge badge-pill badge-<%- auditType.info[auditor.audit_type].class %> p-1"><small><%- auditType.info[auditor.audit_type].short %></small></span>
  414. <% } %>
  415. <% } %>
  416. </td>
  417. <td></span> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small></td>
  418. <td style="text-align: center"><span class="<%- auditConst.auditStringClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.auditString[auditor.status] : '待审批' %></span></td>
  419. <td style="text-align: center">
  420. <% if (auditor.status === auditConst.status.checking && j === group.length - 1) { %>
  421. <span class="dropdown mr-2">
  422. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.audit_id %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  423. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.audit_id %>_add_dropdownMenu" aria-labelledby="<%- auditor.audit_id %>_add_dropdownMenuButton" style="width:220px">
  424. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  425. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.audit_id %>_add"></div>
  426. <dl class="list-unstyled book-list" data-aid="<%- auditor.audit_id %>" data-operate="add">
  427. <% accountGroup.forEach((group, idx) => { %>
  428. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  429. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  430. <div class="dd-content" data-toggleid="<%- idx %>">
  431. <% group.groupList.forEach(item => { %>
  432. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  433. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  434. class="ml-auto"><%- item.mobile %></span></p>
  435. <span class="text-muted"><%- item.role %></span>
  436. </dd>
  437. <% });%>
  438. </div>
  439. <% }) %>
  440. </dl>
  441. </div>
  442. </span>
  443. <% } %>
  444. <% if (auditor.status === auditConst.status.uncheck) { %>
  445. <% if (j === group.length - 1) { %>
  446. <span class="dropdown mr-2">
  447. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.audit_id %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  448. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.audit_id %>_add_dropdownMenu" aria-labelledby="<%- auditor.audit_id %>_add_dropdownMenuButton" style="width:220px">
  449. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  450. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
  451. <dl class="list-unstyled book-list" data-aid="<%- auditor.audit_id %>" data-operate="add">
  452. <% accountGroup.forEach((group, idx) => { %>
  453. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  454. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  455. <div class="dd-content" data-toggleid="<%- idx %>">
  456. <% group.groupList.forEach(item => { %>
  457. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  458. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  459. class="ml-auto"><%- item.mobile %></span></p>
  460. <span class="text-muted"><%- item.role %></span>
  461. </dd>
  462. <% });%>
  463. </div>
  464. <% }) %>
  465. </dl>
  466. </div>
  467. </span>
  468. <% if (auditor.audit_type !== auditType.key.common) { %>
  469. <span class="dropdown mr-2">
  470. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.audit_id %>_add-sibling_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">平级</a>
  471. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.audit_id %>_add-sibling_dropdownMenu" aria-labelledby="<%- auditor.audit_id %>_add-sibling_dropdownMenuButton" style="width:220px">
  472. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  473. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.audit_id %>_add-sibling"></div>
  474. <dl class="list-unstyled book-list" data-aid="<%- auditor.audit_id %>" data-operate="add-sibling">
  475. <% accountGroup.forEach((group, idx) => { %>
  476. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  477. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  478. <div class="dd-content" data-toggleid="<%- idx %>">
  479. <% group.groupList.forEach(item => { %>
  480. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  481. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  482. class="ml-auto"><%- item.mobile %></span></p>
  483. <span class="text-muted"><%- item.role %></span>
  484. </dd>
  485. <% });%>
  486. </div>
  487. <% }) %>
  488. </dl>
  489. </div>
  490. </span>
  491. <% } %>
  492. <% } %>
  493. <span class="dropdown mr-2">
  494. <a href="javascript: void(0)" class="change-audit" id="<%- auditor.audit_id %>_change_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更换</a>
  495. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.audit_id %>_change_dropdownMenu" aria-labelledby="<%- auditor.audit_id %>_change_dropdownMenuButton" style="width:220px">
  496. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  497. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.audit_id %>_change"></div>
  498. <dl class="list-unstyled book-list" data-aid="<%- auditor.audit_id %>" data-operate="change">
  499. <% accountGroup.forEach((group, idx) => { %>
  500. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  501. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  502. <div class="dd-content" data-toggleid="<%- idx %>">
  503. <% group.groupList.forEach(item => { %>
  504. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  505. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  506. class="ml-auto"><%- item.mobile %></span></p>
  507. <span class="text-muted"><%- item.role %></span>
  508. </dd>
  509. <% });%>
  510. </div>
  511. <% }) %>
  512. </dl>
  513. </div>
  514. </span>
  515. <span class="dropdown">
  516. <a href="javascript: void(0)" class="text-danger" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">移除</a>
  517. <div class="dropdown-menu">
  518. <span class="dropdown-item" href="javascript:void(0);">确认移除审批人?</span>
  519. <div class="dropdown-divider"></div>
  520. <div class="px-2 py-1 text-center">
  521. <button class="remove-audit btn btn-sm btn-danger" data-id="<%- auditor.audit_id %>">移除</button>
  522. <button class="btn btn-sm btn-secondary">取消</button>
  523. </div>
  524. </div>
  525. </span>
  526. <% } %>
  527. </td>
  528. </tr>
  529. <% } %>
  530. <% } %>
  531. </tbody>
  532. </table>
  533. </div>
  534. </div>
  535. </div>
  536. <form class="modal-footer">
  537. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  538. </form>
  539. </div>
  540. </div>
  541. </div>
  542. <% } %>
  543. <% if (tender.ledger_status === auditConst.status.checked && tender.finalAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0 && !tender.hasStage && !tender.hasRevise) { %>
  544. <% if (!authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
  545. <!--终审重新审批-->
  546. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  547. <div class="modal-dialog" role="document">
  548. <div class="modal-content">
  549. <div class="modal-header">
  550. <h5 class="modal-title">重新审批</h5>
  551. </div>
  552. <div class="modal-body">
  553. <h5>重新审批需要您的手机短信验证</h5>
  554. <h5>您目前还没设置认证手机,请先设置。</h5>
  555. </div>
  556. <div class="modal-footer">
  557. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  558. <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
  559. </div>
  560. </div>
  561. </div>
  562. </div>
  563. <% } else { %>
  564. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  565. <div class="modal-dialog" role="document">
  566. <form class="modal-content" action="<%- preUrl %>/ledger/audit/check/again" method="post"
  567. onsubmit="return auditAgainCheck();">
  568. <div class="modal-header">
  569. <h5 class="modal-title">重新审批</h5>
  570. </div>
  571. <div class="modal-body">
  572. <h5>确认由「终审-<%= auditors[auditors.length-1].name %>」重新审批 ?
  573. </h5>
  574. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  575. <div class="form-group">
  576. <label>重审需要验证码确认,验证码将发送至尾号<%- authMobile.slice(-4) %>的手机</label>
  577. <div class="input-group input-group-sm mb-3">
  578. <input class="form-control" type="text" readonly="readonly" name="code"
  579. placeholder="输入短信中的6位验证码" />
  580. <div class="input-group-append">
  581. <button class="btn btn-outline-secondary" type="button" id="get-code">获取验证码</button>
  582. </div>
  583. </div>
  584. </div>
  585. <% } %>
  586. </div>
  587. <div class="modal-footer">
  588. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  589. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  590. <button <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %> id="re-shenpi-btn"
  591. class="btn btn-warning btn-sm">确定重审</button>
  592. </div>
  593. </form>
  594. </div>
  595. </div>
  596. <% } %>
  597. <% } %>
  598. <script>
  599. $('.sp-location-list').on('shown.bs.modal', function () {
  600. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  601. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  602. scrollBox.scrollTop(0);
  603. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  604. const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
  605. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
  606. scrollBox.scrollTop(hdheight - bdiv);
  607. }
  608. });
  609. function divSearch(div) {
  610. if (div.length > 0) {
  611. return true;
  612. }
  613. return false;
  614. }
  615. // 展开历史审核记录
  616. $('.modal-body #fold-btn').click(function () {
  617. const type = $(this).data('target')
  618. const auditCard = $(this).parent().parent()
  619. if (type === 'show') {
  620. $(this).data('target', 'hide')
  621. auditCard.find('.fold-card').slideDown('swing', () => {
  622. auditCard.find('#fold-btn').text('收起历史审核记录')
  623. })
  624. } else {
  625. $(this).data('target', 'show')
  626. auditCard.find('.fold-card').slideUp('swing', () => {
  627. auditCard.find('#fold-btn').text('展开历史审核记录')
  628. })
  629. }
  630. });
  631. // 重新审批获取手机验证码
  632. // 获取验证码
  633. let isPosting = false;
  634. $("#get-code").click(function() {
  635. if (isPosting) {
  636. return false;
  637. }
  638. const btn = $(this);
  639. $.ajax({
  640. url: '/profile/code?_csrf_j=<%= ctx.csrf %>',
  641. type: 'post',
  642. data: { mobile: '<%- authMobile %>', type: 'shenpi' },
  643. dataTye: 'json',
  644. error: function() {
  645. isPosting = false;
  646. },
  647. beforeSend: function() {
  648. isPosting = true;
  649. },
  650. success: function(response) {
  651. isPosting = false;
  652. if (response.err === 0) {
  653. codeSuccess(btn);
  654. $("input[name='code']").removeAttr('readonly');
  655. $("#re-shenpi-btn").removeAttr('disabled');
  656. } else {
  657. toast(response.msg, 'error');
  658. }
  659. }
  660. });
  661. });
  662. /**
  663. * 获取成功后的操作
  664. *
  665. * @param {Object} btn - 点击的按钮
  666. * @return {void}
  667. */
  668. function codeSuccess(btn) {
  669. let counter = 60;
  670. btn.addClass('disabled').text('重新获取 ' + counter + 'S');
  671. btn.parent().siblings('input').removeAttr('readonly').attr('placeholder', '输入短信中的6位验证码');
  672. const bindBtn = $("#bind-btn");
  673. bindBtn.removeClass('btn-secondary disabled').addClass('btn-primary');
  674. const countDown = setInterval(function() {
  675. const countString = counter - 1 <= 0 ? '' : ' ' + (counter - 1) + 'S';
  676. // 倒数结束后
  677. if (countString === '') {
  678. clearInterval(countDown);
  679. btn.removeClass('disabled');
  680. }
  681. const text = '重新获取' + countString;
  682. btn.text(text);
  683. counter -= 1;
  684. }, 1000);
  685. }
  686. // 重新审批按钮
  687. $("#re-shenpi-btn").click(function () {
  688. const data = {
  689. };
  690. $.ajax({
  691. url: '<%- preUrl %>/audit/check/again',
  692. type: 'get',
  693. data: data,
  694. dataTye: 'json',
  695. success: function (response) {
  696. if (response.err === 0) {
  697. window.location.href = response.url;
  698. } else {
  699. toast(response.msg, 'error');
  700. }
  701. }
  702. });
  703. });
  704. function auditAgainCheck() {
  705. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  706. const code = $("#sp-down-back input[name='code']").val();
  707. if ($(this).hasClass('disabled')) {
  708. return false;
  709. }
  710. if (code.length < 6) {
  711. toastr.error('请填写正确的验证码');
  712. return false;
  713. }
  714. <% } %>
  715. return true;
  716. }
  717. </script>