audit_modal.ejs 46 KB

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