audit_modal.ejs 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  1. <% if (ctx.phasePay && (ctx.phasePay.audit_status === auditConst.status.uncheck || ctx.phasePay.audit_status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === ctx.phasePay.create_user_id) { %>
  2. <!--上报审批-->
  3. <div class="modal fade" id="sub-sp" data-backdrop="static">
  4. <div class="modal-dialog" role="document">
  5. <div class="modal-content">
  6. <div class="modal-header">
  7. <h5 class="modal-title">上报审批</h5>
  8. </div>
  9. <div class="modal-body">
  10. <div class="dropdown text-right">
  11. <% if (ctx.tender.info.shenpi.phasePay !== shenpiConst.sp_status.gdspl && ctx.session.sessionUser.accountId === ctx.phasePay.create_user_id) { %>
  12. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton"
  13. data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  14. 添加审批流程
  15. </button>
  16. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton" style="width:220px">
  17. <div class="mb-2 p-2"><input class="form-control form-control-sm" placeholder="姓名/手机 检索"
  18. id="gr-search" autocomplete="off"></div>
  19. <dl class="list-unstyled book-list" id="book-list">
  20. <% accountGroup.forEach((group, idx) => { %>
  21. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  22. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  23. <div class="dd-content" data-toggleid="<%- idx %>">
  24. <% group.groupList.forEach(item => { %>
  25. <% if (item.id !== ctx.session.sessionUser.accountId) { %>
  26. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  27. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  28. class="ml-auto"><%- item.mobile %></span></p>
  29. <span class="text-muted"><%- item.role %></span>
  30. </dd>
  31. <% } %>
  32. <% });%>
  33. </div>
  34. <% }) %>
  35. </dl>
  36. </div>
  37. <% } %>
  38. </div>
  39. <div class="card mt-3">
  40. <div class="card-header">
  41. 审批流程
  42. </div>
  43. <div class="modal-height-500" style="overflow: auto">
  44. <ul class="list-group list-group-flush" id="auditors">
  45. <% for (let i = 0, iLen = ctx.phasePay.auditorGroups.length; i < iLen; i++) { %>
  46. <% if (ctx.phasePay.auditorGroups[i][0].audit_order === 0) continue; %>
  47. <li class="list-group-item d-flex" auditorId="<%- ctx.phasePay.auditorGroups[i][0].audit_id %>">
  48. <div class="col-auto"><%- ctx.phasePay.auditorGroups[i][0].audit_order %></div>
  49. <div class="col">
  50. <% for (const auditor of ctx.phasePay.auditorGroups[i]) { %>
  51. <div class="d-inline-block mx-1" auditorId="<%- auditor.audit_id %>">
  52. <i class="fa fa-user text-muted"></i> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small>
  53. </div>
  54. <% } %>
  55. </div>
  56. <div class="col-auto">
  57. <% if (ctx.phasePay.auditorGroups[i][0].audit_type !== auditType.key.common) { %>
  58. <span class="badge badge-pill badge-<%- auditType.info[ctx.phasePay.auditorGroups[i][0].audit_type].class %> badge-bg-small"><small><%- auditType.info[ctx.phasePay.auditorGroups[i][0].audit_type].long%></small></span>
  59. <% } %>
  60. <% if ((ctx.tender.info.shenpi.phasePay === shenpiConst.sp_status.sqspr ||
  61. (ctx.tender.info.shenpi.phasePay === shenpiConst.sp_status.gdzs && i+1 !== iLen)) && ctx.session.sessionUser.accountId === ctx.phasePay.create_user_id && !ctx.tender.isTourist) { %>
  62. <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
  63. <% } %>
  64. </div>
  65. </li>
  66. <% } %>
  67. </ul>
  68. </div>
  69. </div>
  70. </div>
  71. <form class="modal-footer" method="post" action="audit/start" name="phase-start">
  72. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  73. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  74. <% if (ctx.session.sessionUser.accountId === ctx.phasePay.create_user_id) { %>
  75. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  76. <% } %>
  77. </form>
  78. </div>
  79. </div>
  80. </div>
  81. <% } %>
  82. <% if(ctx.phasePay && (ctx.phasePay.audit_status !== auditConst.status.uncheck)) { %>
  83. <!--审批流程/结果-->
  84. <div class="modal fade" id="sp-list" data-backdrop="static">
  85. <div class="modal-dialog modal-lg" role="document">
  86. <div class="modal-content">
  87. <div class="modal-header">
  88. <h5 class="modal-title">审批流程</h5>
  89. </div>
  90. <div class="modal-body">
  91. <div class="row">
  92. <div class="col-4">
  93. <% if(ctx.phasePay.audit_status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.phasePay.create_user_id) { %>
  94. <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp"
  95. id="hideSp">修改审批流程</a>
  96. <% } else if(ctx.phasePay.audit_status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  97. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
  98. id="hideSp">修改审批流程</a>
  99. <% } %>
  100. <div class="card modal-height-500 mt-3" style="overflow: auto">
  101. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  102. <% ctx.phasePay.userGroups.forEach((item, idx) => { %>
  103. <% if (idx === 0) { %>
  104. <li class="list-group-item d-flex justify-content-between align-items-center">
  105. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  106. <span class="text-muted">
  107. <% for (const u of item) { %>
  108. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  109. <% } %>
  110. </span>
  111. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  112. </li>
  113. <% } else if(idx === ctx.phasePay.userGroups.length -1 && idx !== 0) { %>
  114. <li class="list-group-item d-flex justify-content-between align-items-center">
  115. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  116. <span class="text-muted">
  117. <% for (const u of item) { %>
  118. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  119. <% } %>
  120. </span>
  121. <div class="d-flex ml-auto">
  122. <% if (item[0].audit_type !== auditType.key.common) { %>
  123. <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>
  124. <% } %>
  125. <span class="badge badge-light badge-pill"><small>终审</small></span>
  126. </div>
  127. </li>
  128. <% } else {%>
  129. <li class="list-group-item d-flex justify-content-between align-items-center">
  130. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  131. <span class="text-muted">
  132. <% for (const u of item) { %>
  133. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  134. <% } %>
  135. </span>
  136. <div class="d-flex ml-auto">
  137. <% if (item[0].audit_type !== auditType.key.common) { %>
  138. <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>
  139. <% } %>
  140. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  141. </div>
  142. </li>
  143. <% } %>
  144. <% }) %>
  145. </ul>
  146. </div>
  147. </div>
  148. <div class="col-8 modal-height-500" style="overflow: auto">
  149. <% ctx.phasePay.auditHistory.forEach((his, idx) => { %>
  150. <!-- 展开/收起历史流程 -->
  151. <% if(idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>
  152. <div class="text-right">
  153. <a href="javascript: void(0);" id="fold-btn" data-target="show" >展开历史审批流程</a>
  154. </div>
  155. <% } %>
  156. <div class="<%- idx < ctx.phasePay.auditHistory.length - 1 ? 'fold-card' : '' %>">
  157. <div class="text-center text-muted"><%- idx+1 %>#</div>
  158. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>last-auditor-list<% } %>">
  159. <% his.forEach((group, index) => { %>
  160. <li class="timeline-list-item pb-2 <% if (group.audit_status === auditConst.status.uncheck && idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>is_uncheck<% } %>">
  161. <% if (group.auditYear) { %>
  162. <div class="timeline-item-date">
  163. <%- group.auditYear %>
  164. <span><%- group.auditDate %></span>
  165. <span><%- group.auditTime %></span>
  166. </div>
  167. <% } %>
  168. <% if (index < his.length - 1) { %>
  169. <div class="timeline-item-tail"></div>
  170. <% } %>
  171. <% if (group.audit_order === 0) { %>
  172. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  173. <% } else if (group.audit_status === auditConst.status.checked) { %>
  174. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  175. <% } else if (group.audit_status === auditConst.status.checkNo || group.audit_status === auditConst.status.checkNoPre || group.audit_status === auditConst.status.checkCancel) { %>
  176. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  177. <% } else if (group.audit_status === auditConst.status.checking) { %>
  178. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  179. <% } else { %>
  180. <div class="timeline-item-icon bg-secondary text-light"></div>
  181. <% } %>
  182. <div class="timeline-item-content">
  183. <div class="py-1">
  184. <span class="text-black-50">
  185. <%- group.auditName %>
  186. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  187. </span>
  188. <% if (group.audit_order === 0) { %>
  189. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  190. <% } else if (group.audit_status !== auditConst.status.uncheck) { %>
  191. <span class="pull-right <%- auditConst.statusClass[group.audit_status] %>"><%- auditConst.statusString[group.audit_status] %></span>
  192. <% } %>
  193. </div>
  194. <div class="card">
  195. <div class="card-body px-3 py-0">
  196. <% for (const [i, auditor] of group.auditors.entries()) { %>
  197. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  198. <div class="col">
  199. <span class="h6"><%- auditor.name %></span>
  200. <span class="text-muted ml-1"><%- auditor.role %></span>
  201. </div>
  202. <div class="col">
  203. <% if (auditor.audit_status === auditConst.status.checked) { %>
  204. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  205. <% } if (auditor.audit_status === auditConst.status.checkNo || auditor.audit_status === auditConst.status.checkNoPre || auditor.audit_status === auditConst.status.checkCancel) { %>
  206. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  207. <% } %>
  208. </div>
  209. <% if (auditor.opinion) { %>
  210. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  211. <% } %>
  212. </div>
  213. <% } %>
  214. </div>
  215. </div>
  216. </div>
  217. </li>
  218. <% }) %>
  219. </ul>
  220. </div>
  221. <% }) %>
  222. </div>
  223. </div>
  224. </div>
  225. <form class="modal-footer" method="post" action="audit/start" name="phase-start">
  226. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  227. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  228. <% if(ctx.phasePay.audit_status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.phasePay.create_user_id) { %>
  229. <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
  230. <% } %>
  231. </form>
  232. </div>
  233. </div>
  234. </div>
  235. <% } %>
  236. <% if (ctx.phasePay && (ctx.phasePay.audit_status === auditConst.status.checking || ctx.phasePay.audit_status === auditConst.status.checkNoPre) && ctx.phasePay.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  237. <!--审批通过-->
  238. <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
  239. <div class="modal-dialog modal-lg" role="document">
  240. <form class="modal-content" action="audit/check" method="post" id="audit-check">
  241. <div class="modal-header">
  242. <h5 class="modal-title">审批通过</h5>
  243. </div>
  244. <div class="modal-body">
  245. <div class="row">
  246. <div class="col-4">
  247. <% if(ctx.phasePay.audit_status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  248. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  249. <% } %>
  250. <div class="card modal-height-500 mt-3" style="overflow: auto">
  251. <ul class="list-group list-group-flush auditors-list">
  252. <% ctx.phasePay.userGroups.forEach((item, idx) => { %>
  253. <li class="list-group-item d-flex justify-content-between align-items-center">
  254. <% if (idx === 0) { %>
  255. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  256. <% } else if (idx === ctx.phasePay.userGroups.length -1 && idx !== 0) { %>
  257. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  258. <% } else { %>
  259. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  260. <% } %>
  261. <span class="text-muted">
  262. <% for (const u of item) { %>
  263. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  264. <% } %>
  265. </span>
  266. <div class="d-flex ml-auto">
  267. <% if (item[0].audit_type !== auditType.key.common) { %>
  268. <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>
  269. <% } %>
  270. <span class="badge badge-light badge-pill"><small><%- item.auditName %></small></span>
  271. </div>
  272. </li>
  273. <% }) %>
  274. </ul>
  275. </div>
  276. </div>
  277. <div class="col-8 modal-height-500" style="overflow: auto">
  278. <% ctx.phasePay.auditHistory.forEach((his, idx) => { %>
  279. <!-- 展开/收起历史流程 -->
  280. <% if(idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>
  281. <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a></div>
  282. <% } %>
  283. <div class="<%- idx < ctx.phasePay.auditHistory.length - 1 ? 'fold-card' : '' %>">
  284. <div class="text-center text-muted"><%- idx+1 %>#</div>
  285. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>last-auditor-list<% } %>">
  286. <% his.forEach((group, index) => { %>
  287. <li class="timeline-list-item pb-2 <% if (group.audit_status === auditConst.status.uncheck && idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>is_uncheck<% } %>">
  288. <% if (group.auditYear) { %>
  289. <div class="timeline-item-date">
  290. <%- group.auditYear %>
  291. <span><%- group.auditDate %></span>
  292. <span><%- group.auditTime %></span>
  293. </div>
  294. <% } %>
  295. <% if (index < his.length - 1) { %>
  296. <div class="timeline-item-tail"></div>
  297. <% } %>
  298. <% if (group.audit_order === 0) { %>
  299. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  300. <% } else if (group.audit_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.audit_status === auditConst.status.checkNo || group.audit_status === auditConst.status.checkNoPre || group.audit_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.audit_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.auditName %>
  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.audit_order === 0) { %>
  316. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  317. <% } else if (group.audit_status !== auditConst.status.uncheck) { %>
  318. <span class="pull-right <%- auditConst.statusClass[group.audit_status] %>"><%- auditConst.statusString[group.audit_status] %></span>
  319. <% } %>
  320. </div>
  321. <div class="card">
  322. <div class="card-body px-3 py-0">
  323. <% for (const [i, auditor] of group.auditors.entries()) { %>
  324. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  325. <div class="col">
  326. <span class="h6"><%- auditor.name %></span>
  327. <span class="text-muted ml-1"><%- auditor.role %></span>
  328. </div>
  329. <div class="col">
  330. <% if (auditor.audit_status === auditConst.status.checked) { %>
  331. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  332. <% } if (auditor.audit_status === auditConst.status.checkNo || auditor.audit_status === auditConst.status.checkNoPre || auditor.audit_status === auditConst.status.checkCancel) { %>
  333. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  334. <% } else if (auditor.audit_status === auditConst.status.checking) { %>
  335. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  336. <% } %>
  337. </div>
  338. <% if (auditor.audit_status !== auditConst.status.uncheck && auditor.opinion) { %>
  339. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  340. <% } %>
  341. <% if (auditor.audit_status === auditConst.status.checking && auditor.audit_id === ctx.session.sessionUser.accountId) { %>
  342. <div class="col-12 py-1 bg-light">
  343. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  344. </div>
  345. <% } %>
  346. </div>
  347. <% } %>
  348. </div>
  349. </div>
  350. </div>
  351. </li>
  352. <% }) %>
  353. </ul>
  354. </div>
  355. <% }) %>
  356. </div>
  357. </div>
  358. </div>
  359. <div class="modal-footer">
  360. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  361. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  362. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  363. <button type="submit" class="btn btn-success btn-sm">确认通过</button>
  364. </div>
  365. </form>
  366. </div>
  367. </div>
  368. <!--审批退回-->
  369. <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
  370. <div class="modal-dialog modal-lg" role="document">
  371. <form class="modal-content modal-lg" action="audit/check" method="post" id="audit-check-no">
  372. <div class="modal-header">
  373. <h5 class="modal-title">审批退回</h5>
  374. </div>
  375. <div class="modal-body">
  376. <div class="row">
  377. <div class="col-4">
  378. <% if(ctx.phasePay.audit_status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  379. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  380. <% } %>
  381. <div class="card modal-height-500 mt-3" style="overflow: auto">
  382. <ul class="list-group list-group-flush auditors-list">
  383. <% ctx.phasePay.userGroups.forEach((item, idx) => { %>
  384. <li class="list-group-item d-flex justify-content-between align-items-center">
  385. <% if (idx === 0) { %>
  386. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  387. <% } else if (idx === ctx.phasePay.userGroups.length -1 && idx !== 0) { %>
  388. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  389. <% } else { %>
  390. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  391. <% } %>
  392. <span class="text-muted">
  393. <% for (const u of item) { %>
  394. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  395. <% } %>
  396. </span>
  397. <div class="d-flex ml-auto">
  398. <% if (item[0].audit_type !== auditType.key.common) { %>
  399. <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>
  400. <% } %>
  401. <span class="badge badge-light badge-pill"><small><%- item.auditName %></small></span>
  402. </div>
  403. </li>
  404. <% }) %>
  405. </ul>
  406. </div>
  407. </div>
  408. <div class="col-8 modal-height-500" style="overflow: auto">
  409. <% ctx.phasePay.auditHistory.forEach((his, idx) => { %>
  410. <!-- 展开/收起历史流程 -->
  411. <% if(idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>
  412. <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show" data-idx="<%- idx + 1 %>">展开历史审批流程</a></div>
  413. <% } %>
  414. <div class="<%- idx < ctx.phasePay.auditHistory.length - 1 ? 'fold-card' : '' %>">
  415. <div class="text-center text-muted"><%- idx+1 %>#</div>
  416. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>last-auditor-list<% } %>">
  417. <% his.forEach((group, index) => { %>
  418. <li class="timeline-list-item pb-2 <% if (group.audit_status === auditConst.status.uncheck && idx === ctx.phasePay.auditHistory.length - 1 && ctx.phasePay.auditHistory.length !== 1) { %>is_uncheck<% } %>">
  419. <% if (group.auditYear) { %>
  420. <div class="timeline-item-date">
  421. <%- group.auditYear %>
  422. <span><%- group.auditDate %></span>
  423. <span><%- group.auditTime %></span>
  424. </div>
  425. <% } %>
  426. <% if (index < his.length - 1) { %>
  427. <div class="timeline-item-tail"></div>
  428. <% } %>
  429. <% if (group.audit_order === 0) { %>
  430. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  431. <% } else if (group.audit_status === auditConst.status.checked) { %>
  432. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  433. <% } else if (group.audit_status === auditConst.status.checkNo || group.audit_status === auditConst.status.checkNoPre || group.audit_status === auditConst.status.checkCancel) { %>
  434. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  435. <% } else if (group.audit_status === auditConst.status.checking) { %>
  436. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  437. <% } else { %>
  438. <div class="timeline-item-icon bg-secondary text-light"></div>
  439. <% } %>
  440. <div class="timeline-item-content">
  441. <div class="py-1">
  442. <span class="text-black-50">
  443. <%- group.auditName %>
  444. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  445. </span>
  446. <% if (group.audit_order === 0) { %>
  447. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  448. <% } else if (group.audit_status !== auditConst.status.uncheck) { %>
  449. <span class="pull-right <%- auditConst.statusClass[group.audit_status] %>"><%- auditConst.statusString[group.audit_status] %></span>
  450. <% } %>
  451. </div>
  452. <div class="card">
  453. <div class="card-body px-3 py-0">
  454. <% for (const [i, auditor] of group.auditors.entries()) { %>
  455. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  456. <div class="col">
  457. <span class="h6"><%- auditor.name %></span>
  458. <span class="text-muted ml-1"><%- auditor.role %></span>
  459. </div>
  460. <div class="col">
  461. <% if (auditor.audit_status === auditConst.status.checked) { %>
  462. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  463. <% } if (auditor.audit_status === auditConst.status.checkNo || auditor.audit_status === auditConst.status.checkNoPre || auditor.audit_status === auditConst.status.checkCancel) { %>
  464. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  465. <% } else if (auditor.audit_status === auditConst.status.checking) { %>
  466. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  467. <% } %>
  468. </div>
  469. <% if (auditor.audit_status !== auditConst.status.uncheck && auditor.opinion) { %>
  470. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  471. <% } %>
  472. <% if (auditor.audit_status === auditConst.status.checking && auditor.audit_id === ctx.session.sessionUser.accountId) { %>
  473. <div class="col-12 py-1 bg-light">
  474. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  475. <div id="reject-process" class="alert alert-warning mt-1 mb-0 p-2">
  476. <div class="form-check form-check-inline">
  477. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
  478. <label class="form-check-label" for="inlineRadio1">退回原报 <%- ctx.phasePay.user.name %></label>
  479. </div>
  480. <% if (auditor.audit_order > 1) { %>
  481. <div class="form-check form-check-inline">
  482. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>">
  483. <label class="form-check-label" for="inlineRadio2">退回上一审批人
  484. <% const pre = his.find(x => { return x.audit_order === auditor.audit_order - 1}); %>
  485. <%- ( pre ? pre.name : '') %>
  486. </label>
  487. </div>
  488. <% } %>
  489. </div>
  490. </div>
  491. <% } %>
  492. </div>
  493. <% } %>
  494. </div>
  495. </div>
  496. </div>
  497. </li>
  498. <% }) %>
  499. </ul>
  500. </div>
  501. <% }) %>
  502. </div>
  503. </div>
  504. </div>
  505. <div class="modal-footer">
  506. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  507. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  508. <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
  509. </div>
  510. </form>
  511. </div>
  512. </div>
  513. <% } %>
  514. <% if (ctx.phasePay && ctx.phasePay.finalAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0 && ctx.phasePay.audit_status === auditConst.status.checked && ctx.phasePay.phase_order === ctx.phasePay.highOrder) { %>
  515. <% if (!authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
  516. <!--终审重新审批-->
  517. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  518. <div class="modal-dialog" role="document">
  519. <div class="modal-content">
  520. <div class="modal-header">
  521. <h5 class="modal-title">重新审批</h5>
  522. </div>
  523. <div class="modal-body">
  524. <h5>重新审批需要您的手机短信验证</h5>
  525. <h5>您目前还没设置认证手机,请先设置。</h5>
  526. </div>
  527. <div class="modal-footer">
  528. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  529. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  530. <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
  531. </div>
  532. </div>
  533. </div>
  534. </div>
  535. <% } else { %>
  536. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  537. <div class="modal-dialog" role="document">
  538. <form class="modal-content" method="post" action="audit/checkAgain" name="pay-checkAgain">
  539. <div class="modal-header">
  540. <h5 class="modal-title">重新审批</h5>
  541. </div>
  542. <div class="modal-body">
  543. <h5>确认由「终审-<%= ctx.session.sessionUser.name %>」重新审批「第<%= ctx.phasePay.phase_order %>期」?
  544. </h5>
  545. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  546. <div class="form-group">
  547. <label>重审需要验证码确认,验证码将发送至尾号<%- authMobile.slice(-4) %>的手机</label>
  548. <div class="input-group input-group-sm mb-3">
  549. <input class="form-control" type="text" readonly="readonly" name="code"
  550. placeholder="输入短信中的6位验证码" />
  551. <div class="input-group-append">
  552. <button class="btn btn-outline-secondary" type="button" id="get-code">获取验证码</button>
  553. </div>
  554. </div>
  555. </div>
  556. <% } %>
  557. </div>
  558. <div class="modal-footer">
  559. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  560. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  561. <button <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %> id="re-shenpi-btn" class="btn btn-warning btn-sm" type="submit">确定重审</button>
  562. </div>
  563. </form>
  564. </div>
  565. </div>
  566. <% } %>
  567. <% } %>
  568. <% if (ctx.phasePay && ctx.phasePay.create_user_id === ctx.session.sessionUser.accountId && ctx.phasePay.phase_order === ctx.phasePay.highOrder && (ctx.phasePay.audit_status === auditConst.status.checkNo || ctx.phasePay.audit_status === auditConst.status.uncheck)) { %>
  569. <div class="modal fade" id="del-qi" data-backdrop="static">
  570. <div class="modal-dialog" role="document">
  571. <form class="modal-content" action='/tender/<%= ctx.tender.id %>/pay/delete' method="post">
  572. <div class="modal-header">
  573. <h5 class="modal-title">删除期</h5>
  574. </div>
  575. <div class="modal-body">
  576. <h5>确认删除「第<%= ctx.phasePay.phase_order %>期」?</h5>
  577. <h5>删除后,数据无法恢复,请谨慎操作。</h5>
  578. </div>
  579. <div class="modal-footer">
  580. <input type="hidden" name="phase_id" value="<%= ctx.phasePay.id %>">
  581. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  582. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  583. <button type="submit" class="btn btn-danger btn-sm">确定删除</button>
  584. </div>
  585. </form>
  586. </div>
  587. </div>
  588. <% } %>
  589. <% if (ctx.phasePay && ctx.phasePay.cancancel) { %>
  590. <div class="modal fade" id="sp-down-cancel" data-backdrop="static">
  591. <div class="modal-dialog" role="document">
  592. <div class="modal-content">
  593. <div class="modal-header">
  594. <h5 class="modal-title">撤回</h5>
  595. </div>
  596. <div class="modal-body">
  597. <h5>确定撤回?</h5>
  598. </div>
  599. <form class="modal-footer" action="audit/checkCancel" method="post">
  600. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  601. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  602. <button type="submit" class="btn btn-danger btn-sm" type="submit">确定撤回</button>
  603. </form>
  604. </div>
  605. </div>
  606. </div>
  607. <% } %>
  608. <% if (ctx.phasePay && ctx.phasePay.audit_status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  609. <!--上报审批-->
  610. <div class="modal fade" id="sub-sp2" data-backdrop="static">
  611. <div class="modal-dialog" style="max-width: 650px" role="document">
  612. <div class="modal-content">
  613. <div class="modal-header">
  614. <h5 class="modal-title">修改审批流程</h5>
  615. </div>
  616. <div class="modal-body">
  617. <div class="card mt-1">
  618. <div class="modal-height-500" style="overflow: auto">
  619. <style>
  620. #admin-edit-shenpi thead th {
  621. border-bottom: 0;
  622. }
  623. #admin-edit-shenpi td, #admin-edit-shenpi th {
  624. padding: 0.75rem;
  625. }
  626. #admin-edit-shenpi th {
  627. background: none;
  628. color: #212529;
  629. border-top: 0;
  630. }
  631. </style>
  632. <table class="table table-hover" id="admin-edit-shenpi">
  633. <thead>
  634. <tr class="card-header text-center">
  635. <th width="100px">审批流程</th>
  636. <th>审批人员</th>
  637. <th width="80" style="text-align: center">审批状态</th>
  638. <th width="200" style="text-align: center">操作</th>
  639. </tr>
  640. </thead>
  641. <tbody id="admin-edit-shenpi-list">
  642. <% for (const [i, group] of ctx.phasePay.userGroups.entries()) { %>
  643. <% if (i === 0) continue; %>
  644. <% for (const [j, auditor] of group.entries()) { %>
  645. <tr>
  646. <td class="text-left d-flex">
  647. <% if (j === 0) { %>
  648. <%- i + '审' %>
  649. <% if (auditor.audit_type !== auditType.key.common) { %>
  650. <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>
  651. <% } %>
  652. <% } %>
  653. </td>
  654. <td></span> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small></td>
  655. <td style="text-align: center"><span class="<%- auditConst.auditStringClass[auditor.audit_status] %>"><%- auditor.audit_status !== auditConst.status.uncheck ? auditConst.auditString[auditor.audit_status] : '待审批' %></span></td>
  656. <td style="text-align: center">
  657. <% if (auditor.audit_status === auditConst.status.checking && j === group.length - 1) { %>
  658. <span class="dropdown mr-2">
  659. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.audit_id %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  660. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.audit_id %>_add_dropdownMenu" aria-labelledby="<%- auditor.audit_id %>_add_dropdownMenuButton" style="width:220px">
  661. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  662. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.audit_id %>_add"></div>
  663. <dl class="list-unstyled book-list" data-aid="<%- auditor.audit_id %>" data-operate="add">
  664. <% accountGroup.forEach((group, idx) => { %>
  665. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  666. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  667. <div class="dd-content" data-toggleid="<%- idx %>">
  668. <% group.groupList.forEach(item => { %>
  669. <% if (item.id !== ctx.phasePay.create_user_id) { %>
  670. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  671. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  672. class="ml-auto"><%- item.mobile %></span></p>
  673. <span class="text-muted"><%- item.role %></span>
  674. </dd>
  675. <% } %>
  676. <% });%>
  677. </div>
  678. <% }) %>
  679. </dl>
  680. </div>
  681. </span>
  682. <% } %>
  683. <% if (auditor.audit_status === auditConst.status.uncheck) { %>
  684. <% if (j === group.length - 1) { %>
  685. <span class="dropdown mr-2">
  686. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.audit_id %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  687. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.audit_id %>_add_dropdownMenu" aria-labelledby="<%- auditor.audit_id %>_add_dropdownMenuButton" style="width:220px">
  688. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  689. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.audit_id %>_add"></div>
  690. <dl class="list-unstyled book-list" data-aid="<%- auditor.audit_id %>" data-operate="add">
  691. <% accountGroup.forEach((group, idx) => { %>
  692. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  693. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  694. <div class="dd-content" data-toggleid="<%- idx %>">
  695. <% group.groupList.forEach(item => { %>
  696. <% if (item.id !== ctx.phasePay.create_user_id) { %>
  697. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  698. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  699. class="ml-auto"><%- item.mobile %></span></p>
  700. <span class="text-muted"><%- item.role %></span>
  701. </dd>
  702. <% } %>
  703. <% });%>
  704. </div>
  705. <% }) %>
  706. </dl>
  707. </div>
  708. </span>
  709. <% if (auditor.audit_type !== auditType.key.common) { %>
  710. <span class="dropdown mr-2">
  711. <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>
  712. <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">
  713. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  714. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.audit_id %>_add-sibling"></div>
  715. <dl class="list-unstyled book-list" data-aid="<%- auditor.audit_id %>" data-operate="add-sibling">
  716. <% accountGroup.forEach((group, idx) => { %>
  717. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  718. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  719. <div class="dd-content" data-toggleid="<%- idx %>">
  720. <% group.groupList.forEach(item => { %>
  721. <% if (item.id !== ctx.phasePay.create_user_id) { %>
  722. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  723. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  724. class="ml-auto"><%- item.mobile %></span></p>
  725. <span class="text-muted"><%- item.role %></span>
  726. </dd>
  727. <% } %>
  728. <% });%>
  729. </div>
  730. <% }) %>
  731. </dl>
  732. </div>
  733. </span>
  734. <% } %>
  735. <% } %>
  736. <span class="dropdown mr-2">
  737. <a href="javascript: void(0)" class="change-audit" id="<%- auditor.audit_id %>_change_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更换</a>
  738. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.audit_id %>_change_dropdownMenu" aria-labelledby="<%- auditor.audit_id %>_change_dropdownMenuButton" style="width:220px">
  739. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  740. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.audit_id %>_change"></div>
  741. <dl class="list-unstyled book-list" data-aid="<%- auditor.audit_id %>" data-operate="change">
  742. <% accountGroup.forEach((group, idx) => { %>
  743. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  744. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  745. <div class="dd-content" data-toggleid="<%- idx %>">
  746. <% group.groupList.forEach(item => { %>
  747. <% if (item.id !== ctx.phasePay.create_user_id) { %>
  748. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  749. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  750. class="ml-auto"><%- item.mobile %></span></p>
  751. <span class="text-muted"><%- item.role %></span>
  752. </dd>
  753. <% } %>
  754. <% });%>
  755. </div>
  756. <% }) %>
  757. </dl>
  758. </div>
  759. </span>
  760. <span class="dropdown">
  761. <a href="javascript: void(0)" class="text-danger" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">移除</a>
  762. <div class="dropdown-menu">
  763. <span class="dropdown-item" href="javascript:void(0);">确认移除审批人?</span>
  764. <div class="dropdown-divider"></div>
  765. <div class="px-2 py-1 text-center">
  766. <button class="remove-audit btn btn-sm btn-danger" data-id="<%- auditor.audit_id %>">移除</button>
  767. <button class="btn btn-sm btn-secondary">取消</button>
  768. </div>
  769. </div>
  770. </span>
  771. <% } %>
  772. </td>
  773. </tr>
  774. <% } %>
  775. <% } %>
  776. </tbody>
  777. </table>
  778. </div>
  779. </div>
  780. </div>
  781. <form class="modal-footer">
  782. <div class="mr-auto text-warning">
  783. <span class="mr-3">增加:后级审核人</span>
  784. <span class="">平级:会签/或签增加平级审核人</span>
  785. </div>
  786. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  787. </form>
  788. </div>
  789. </div>
  790. </div>
  791. <% } %>
  792. <script>
  793. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  794. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  795. const shenpi_status = <%- ctx.tender.info.shenpi.phasePay %>;
  796. const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
  797. const phaseUserId = parseInt('<%= ctx.phasePay.create_user_id %>');
  798. </script>
  799. <script>
  800. $('[name=phase-start]').submit(function (e) {
  801. if (checkAuditorFrom()) {
  802. $(this).parent().parent().parent().modal('hide');
  803. $('#hide-all').hide();
  804. } else {
  805. return false;
  806. }
  807. });
  808. $('#audit-check-no').submit(function (e) {
  809. const checkType = parseInt($('[name=checkType]:checked').val());
  810. if ($('#warning-text').length) $('#warning-text').remove();
  811. if (!checkType && !$('#warning-text').length) {
  812. $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
  813. return false;
  814. }
  815. $('#hide-all').hide();
  816. });
  817. $('.sp-location-list').on('shown.bs.modal', function () {
  818. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  819. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  820. scrollBox.scrollTop(0);
  821. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  822. const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
  823. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
  824. scrollBox.scrollTop(hdheight - bdiv);
  825. }
  826. });
  827. function divSearch(div) {
  828. if (div.length > 0) {
  829. return true;
  830. }
  831. return false;
  832. }
  833. // 展开历史审核记录
  834. $('.modal-body #fold-btn').click(function () {
  835. const type = $(this).data('target')
  836. const auditCard = $(this).parent().parent()
  837. if (type === 'show') {
  838. $(this).data('target', 'hide')
  839. auditCard.find('.fold-card').slideDown('swing', () => {
  840. auditCard.find('#fold-btn').text('收起历史审核记录')
  841. })
  842. } else {
  843. $(this).data('target', 'show')
  844. auditCard.find('.fold-card').slideUp('swing', () => {
  845. auditCard.find('#fold-btn').text('展开历史审核记录')
  846. })
  847. }
  848. });
  849. // 重新审批
  850. $('[name=phase-checkAgain]').submit(function (e) {
  851. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  852. const code = $("#sp-down-back input[name='code']").val();
  853. if ($(this).hasClass('disabled')) return false;
  854. if (code.length < 6) {
  855. toast('请填写正确的验证码', 'error');
  856. return false;
  857. }
  858. <% } %>
  859. $('#hide-all').hide();
  860. });
  861. </script>