audit_modal.ejs 50 KB

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