audit_modal.ejs 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <% if ((ctx.material.status === auditConst.status.uncheck || ctx.material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === ctx.material.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="form-group">
  11. <label>选择审批人</label>
  12. <div class="input-group">
  13. <div class="input-group-prepend">
  14. <select class="form-control form-control-sm" id="account_group">
  15. <option value="0">所有分组</option>
  16. <% for (const dw in accountGroup) { %>
  17. <option value="<%= dw %>"><%= accountGroup[dw] %></option>
  18. <% } %>
  19. </select>
  20. </div>
  21. <select class="form-control form-control-sm" id="account_list">
  22. <option value="0">选择审批人</option>
  23. <% for (const account of accountList) { %>
  24. <option value="<%= account.id %>"><%= account.name %><% if (account.role !== '') { %>(<%= account.role %>)<% } %><% if (account.company !== '') { %> -<%= account.company %><% } %></option>
  25. <% } %>
  26. </select>
  27. </div>
  28. </div>
  29. <div class="card mt-3">
  30. <div class="card-header">
  31. 审批流程
  32. </div>
  33. <ul class="list-group list-group-flush" id="auditors">
  34. <% for (let i = 0, iLen = ctx.material.auditorList.length; i < iLen; i++) { %>
  35. <li class="list-group-item" auditorId="<%- ctx.material.auditorList[i].aid %>">
  36. <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
  37. <%- ctx.material.auditorList[i].order %> <%- ctx.material.auditorList[i].name %>
  38. <small class="text-muted"><%- ctx.material.auditorList[i].role %></small>
  39. </li>
  40. <% } %>
  41. </ul>
  42. </div>
  43. </div>
  44. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  45. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  46. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
  47. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  48. </form>
  49. </div>
  50. </div>
  51. </div>
  52. <% } %>
  53. <% if (ctx.material.status === auditConst.status.checking) { %>
  54. <% if (ctx.material.curAuditor && ctx.material.curAuditor.aid === ctx.session.sessionUser.accountId) { %>
  55. <!--审批通过-->
  56. <div class="modal fade" id="sp-done" data-backdrop="static">
  57. <div class="modal-dialog modal-lg" role="document">
  58. <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
  59. <div class="modal-header">
  60. <h5 class="modal-title">审批通过</h5>
  61. </div>
  62. <div class="modal-body">
  63. <div class="row">
  64. <div class="col-4">
  65. <div class="card mt-3">
  66. <ul class="list-group list-group-flush">
  67. <li class="list-group-item">
  68. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small>
  69. </li>
  70. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  71. <li class="list-group-item">
  72. <% if (i < ctx.material.auditors2.length - 1) { %>
  73. <i class="fa fa-chevron-circle-down"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  74. <% } else { %>
  75. <i class="fa fa fa-stop-circle"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  76. <% } %>
  77. </li>
  78. <% } %>
  79. </ul>
  80. </div>
  81. </div>
  82. <div class="col-8 modal-height-500" style="overflow: auto">
  83. <div class="card mt-3">
  84. <ul class="list-group list-group-flush">
  85. <li class="list-group-item">
  86. <span class="text-success pull-right"><small><%- ctx.material.auditors[0].begin_time.toLocaleDateString() %></small> 上报</span>
  87. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
  88. </li>
  89. <% for (let iA = 0; iA < ctx.material.auditors.length; iA++) { %>
  90. <% const auditors = ctx.material.auditors; %>
  91. <li class="list-group-item">
  92. <% if (auditors[iA].status === auditConst.status.checked) { %>
  93. <span class="text-success pull-right"><small><%- auditors[iA].end_time.toLocaleString() %></small> 审批通过</span>
  94. <h5 class="card-title">
  95. <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
  96. </h5>
  97. <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
  98. <span class="pull-right">审批中</span>
  99. <h5 class="card-title">
  100. <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
  101. </h5>
  102. <% } else { %>
  103. <h5 class="card-title">
  104. <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
  105. </h5>
  106. <% } %>
  107. <% if (auditors[iA].status === auditConst.status.checked) { %>
  108. <p class="card-text"><%- auditors[iA].opinion %></p>
  109. <% } else if (auditors[iA].status === auditConst.status.checking) { %>
  110. <div class="form-group">
  111. <label>审批意见<b class="text-danger">*</b></label>
  112. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  113. </div>
  114. <% } %>
  115. </li>
  116. <% } %>
  117. </ul>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="modal-footer">
  123. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  124. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  125. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  126. <button type="submit" class="btn btn-success btn-sm" >确认通过</button>
  127. </div>
  128. </form>
  129. </div>
  130. </div>
  131. <!--审批退回-->
  132. <div class="modal fade" id="sp-back" data-backdrop="static">
  133. <div class="modal-dialog modal-lg" role="document">
  134. <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post">
  135. <div class="modal-header">
  136. <h5 class="modal-title">审批退回</h5>
  137. </div>
  138. <div class="modal-body">
  139. <div class="row">
  140. <div class="col-4">
  141. <div class="card mt-3">
  142. <ul class="list-group list-group-flush">
  143. <li class="list-group-item">
  144. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small>
  145. </li>
  146. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  147. <li class="list-group-item">
  148. <% if (i < ctx.material.auditors2.length - 1) { %>
  149. <i class="fa fa-chevron-circle-down"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  150. <% } else { %>
  151. <i class="fa fa fa-stop-circle"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  152. <% } %>
  153. </li>
  154. <% } %>
  155. </ul>
  156. </div>
  157. </div>
  158. <div class="col-8 modal-height-500" style="overflow: auto">
  159. <div class="card mt-3">
  160. <ul class="list-group list-group-flush">
  161. <li class="list-group-item">
  162. <span class="text-success pull-right"><small><%- ctx.material.auditors[0].begin_time.toLocaleDateString() %></small> 上报</span>
  163. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
  164. </li>
  165. <% for (let iA = 0; iA < ctx.material.auditors.length; iA++) { %>
  166. <% const auditors = ctx.material.auditors; %>
  167. <li class="list-group-item">
  168. <% if (auditors[iA].status === auditConst.status.checked) { %>
  169. <span class="text-success pull-right"><small><%- auditors[iA].end_time.toLocaleString() %></small> 审批通过</span>
  170. <h5 class="card-title">
  171. <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
  172. </h5>
  173. <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
  174. <span class="pull-right">审批中</span>
  175. <h5 class="card-title">
  176. <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
  177. </h5>
  178. <% } else { %>
  179. <h5 class="card-title">
  180. <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
  181. </h5>
  182. <% } %>
  183. <% if (auditors[iA].status === auditConst.status.checked) { %>
  184. <p class="card-text"><%- auditors[iA].opinion %></p>
  185. <% } else if (auditors[iA].status === auditConst.status.checking) { %>
  186. <div class="form-group">
  187. <label>审批意见<b class="text-danger">*</b></label>
  188. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  189. </div>
  190. <% } %>
  191. </li>
  192. <% } %>
  193. </ul>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="modal-footer">
  199. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  200. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  201. <input type="hidden" name="checkType" value="<%= auditConst.status.checkNo %>" />
  202. <button type="submit" class="btn btn-warning btn-sm" >确认退回</button>
  203. </div>
  204. </form>
  205. </div>
  206. </div>
  207. <% } else { %>
  208. <!--审批流程/结果-->
  209. <div class="modal fade" id="sp-list" data-backdrop="static">
  210. <div class="modal-dialog modal-lg" role="document">
  211. <div class="modal-content">
  212. <div class="modal-header">
  213. <h5 class="modal-title">审批流程</h5>
  214. </div>
  215. <div class="modal-body">
  216. <div class="row">
  217. <div class="col-4">
  218. <div class="card mt-3">
  219. <ul class="list-group list-group-flush">
  220. <li class="list-group-item">
  221. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small>
  222. </li>
  223. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  224. <li class="list-group-item">
  225. <% if (i < ctx.material.auditors2.length - 1) { %>
  226. <i class="fa fa-chevron-circle-down"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  227. <% } else { %>
  228. <i class="fa fa fa-stop-circle"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  229. <% } %>
  230. </li>
  231. <% } %>
  232. </ul>
  233. </div>
  234. </div>
  235. <div class="col-8 modal-height-500" style="overflow: auto">
  236. <% for (const ah of ctx.material.auditHistory) { %>
  237. <div class="card mt-3">
  238. <ul class="list-group list-group-flush">
  239. <% for (let iA = 0; iA < ah.length; iA++) { %>
  240. <% if (iA === 0) { %>
  241. <li class="list-group-item">
  242. <span class="text-success pull-right"><% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  243. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
  244. <p class="card-text"><small class="text-muted"><%- ah[iA].begin_time.toLocaleDateString() %></small></p>
  245. </li>
  246. <li class="list-group-item">
  247. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  248. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  249. <% } %>
  250. <h5 class="card-title"><i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  251. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  252. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  253. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  254. <% } %>
  255. </li>
  256. <% } else if (iA === ah.length - 1) { %>
  257. <li class="list-group-item">
  258. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  259. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  260. <% } %>
  261. <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  262. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  263. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  264. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  265. <% } %>
  266. </li>
  267. <% } else { %>
  268. <li class="list-group-item">
  269. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  270. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  271. <% } %>
  272. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  273. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  274. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  275. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  276. <% } %>
  277. </li>
  278. <% } %>
  279. <% } %>
  280. </ul>
  281. </div>
  282. <% } %>
  283. <% if (ctx.material.status === auditConst.status.checking) {%>
  284. <div class="card mt-3">
  285. <ul class="list-group list-group-flush">
  286. <% const auditors = ctx.material.auditors; %>
  287. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  288. <% if (iA === 0) { %>
  289. <li class="list-group-item">
  290. <span class="text-success pull-right"><% if (ctx.material.times > 1) { %>重新<% } %>上报</span>
  291. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
  292. <p class="card-text"><small class="text-muted"><%- auditors[iA].begin_time.toLocaleDateString() %></small></p>
  293. </li>
  294. <li class="list-group-item">
  295. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  296. <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  297. <% } %>
  298. <h5 class="card-title"><i class="fa <%if (iA === auditors.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
  299. <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>
  300. <p class="card-text mb-1"><%- auditors[iA].opinion %></p>
  301. <p class="card-text"><small class="text-muted"><%- auditors[iA].end_time.toLocaleDateString() %></small></p>
  302. <% } %>
  303. </li>
  304. <% } else if (iA === auditors.length - 1) { %>
  305. <li class="list-group-item">
  306. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  307. <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  308. <% } %>
  309. <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
  310. <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>
  311. <p class="card-text mb-1"><%- auditors[iA].opinion %></p>
  312. <p class="card-text"><small class="text-muted"><%- auditors[iA].end_time.toLocaleDateString() %></small></p>
  313. <% } %>
  314. </li>
  315. <% } else { %>
  316. <li class="list-group-item">
  317. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  318. <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  319. <% } %>
  320. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
  321. <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>
  322. <p class="card-text mb-1"><%- auditors[iA].opinion %></p>
  323. <p class="card-text"><small class="text-muted"><%- auditors[iA].end_time.toLocaleDateString() %></small></p>
  324. <% } %>
  325. </li>
  326. <% } %>
  327. <% } %>
  328. </ul>
  329. </div>
  330. <% } %>
  331. </div>
  332. </div>
  333. </div>
  334. <div class="modal-footer">
  335. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  336. </div>
  337. </div>
  338. </div>
  339. </div>
  340. <% } %>
  341. <% } else if (ctx.material.status === auditConst.status.checked) { %>
  342. <!--审批流程/结果-->
  343. <div class="modal fade" id="sp-list" data-backdrop="static">
  344. <div class="modal-dialog modal-lg" role="document">
  345. <div class="modal-content">
  346. <div class="modal-header">
  347. <h5 class="modal-title">审批流程</h5>
  348. </div>
  349. <div class="modal-body">
  350. <div class="row">
  351. <div class="col-4">
  352. <div class="card mt-3">
  353. <ul class="list-group list-group-flush">
  354. <li class="list-group-item">
  355. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small>
  356. </li>
  357. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  358. <li class="list-group-item">
  359. <% if (i < ctx.material.auditors2.length - 1) { %>
  360. <i class="fa fa-chevron-circle-down"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  361. <% } else { %>
  362. <i class="fa fa fa-stop-circle"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  363. <% } %>
  364. </li>
  365. <% } %>
  366. </ul>
  367. </div>
  368. </div>
  369. <div class="col-8 modal-height-500" style="overflow: auto">
  370. <% for (const ah of ctx.material.auditHistory) { %>
  371. <div class="card mt-3">
  372. <ul class="list-group list-group-flush">
  373. <% for (let iA = 0; iA < ah.length; iA++) { %>
  374. <% if (iA === 0) { %>
  375. <li class="list-group-item">
  376. <span class="text-success pull-right"><% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  377. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
  378. <p class="card-text"><small class="text-muted"><%- ah[iA].begin_time.toLocaleDateString() %></small></p>
  379. </li>
  380. <li class="list-group-item">
  381. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  382. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  383. <% } %>
  384. <h5 class="card-title"><i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  385. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  386. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  387. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  388. <% } %>
  389. </li>
  390. <% } else if (iA === ah.length - 1) { %>
  391. <li class="list-group-item">
  392. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  393. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  394. <% } %>
  395. <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  396. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  397. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  398. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  399. <% } %>
  400. </li>
  401. <% } else { %>
  402. <li class="list-group-item">
  403. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  404. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  405. <% } %>
  406. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  407. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  408. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  409. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  410. <% } %>
  411. </li>
  412. <% } %>
  413. <% } %>
  414. </ul>
  415. </div>
  416. <% } %>
  417. </div>
  418. </div>
  419. </div>
  420. <div class="modal-footer">
  421. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  422. </div>
  423. </div>
  424. </div>
  425. </div>
  426. <% } else if (ctx.material.status === auditConst.status.checkNo) { %>
  427. <!--审批流程/结果-->
  428. <div class="modal fade" id="sp-list" data-backdrop="static">
  429. <div class="modal-dialog modal-lg" role="document">
  430. <div class="modal-content">
  431. <div class="modal-header">
  432. <h5 class="modal-title">审批流程</h5>
  433. </div>
  434. <div class="modal-body">
  435. <div class="row">
  436. <div class="col-4">
  437. <div class="card mt-3">
  438. <ul class="list-group list-group-flush">
  439. <li class="list-group-item">
  440. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small>
  441. </li>
  442. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  443. <li class="list-group-item">
  444. <% if (i < ctx.material.auditors2.length - 1) { %>
  445. <i class="fa fa-chevron-circle-down"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  446. <% } else { %>
  447. <i class="fa fa fa-stop-circle"></i> <%- ctx.material.auditors2[i].name %> <small class="text-muted"><%- ctx.material.auditors2[i].role %></small>
  448. <% } %>
  449. </li>
  450. <% } %>
  451. </ul>
  452. </div>
  453. </div>
  454. <div class="col-8 modal-height-500" style="overflow: auto">
  455. <% for (const ah of ctx.material.auditHistory) { %>
  456. <div class="card mt-3">
  457. <ul class="list-group list-group-flush">
  458. <% for (let iA = 0; iA < ah.length; iA++) { %>
  459. <% if (iA === 0) { %>
  460. <li class="list-group-item">
  461. <span class="text-success pull-right"><% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  462. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
  463. <p class="card-text"><small class="text-muted"><%- ah[iA].begin_time.toLocaleDateString() %></small></p>
  464. </li>
  465. <li class="list-group-item">
  466. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  467. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  468. <% } %>
  469. <h5 class="card-title"><i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  470. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  471. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  472. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  473. <% } %>
  474. </li>
  475. <% } else if (iA === ah.length - 1) { %>
  476. <li class="list-group-item">
  477. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  478. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  479. <% } %>
  480. <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  481. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  482. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  483. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  484. <% } %>
  485. </li>
  486. <% } else { %>
  487. <li class="list-group-item">
  488. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  489. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  490. <% } %>
  491. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  492. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  493. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  494. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  495. <% } %>
  496. </li>
  497. <% } %>
  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. </div>
  508. </div>
  509. </div>
  510. </div>
  511. <% if (ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  512. <!--重新上报-->
  513. <div class="modal fade" id="sp-list2" data-backdrop="static">
  514. <div class="modal-dialog modal-lg" role="document">
  515. <div class="modal-content">
  516. <div class="modal-header">
  517. <h5 class="modal-title">重新上报</h5>
  518. </div>
  519. <div class="modal-body">
  520. <div class="row">
  521. <div class="col-4">
  522. <a href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
  523. <div class="card mt-3">
  524. <ul class="list-group list-group-flush">
  525. <li class="list-group-item">
  526. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small>
  527. </li>
  528. </ul>
  529. <ul class="list-group list-group-flush" id="auditors-list">
  530. <% const auditorList = ctx.material.auditorList; %>
  531. <% for (let i = 0; i < auditorList.length; i++) { %>
  532. <li class="list-group-item" data-auditid="<%- auditorList[i].aid %>">
  533. <% if (i < auditorList.length - 1) { %>
  534. <i class="fa fa-chevron-circle-down"></i> <%- auditorList[i].name %> <small class="text-muted"><%- auditorList[i].role %></small>
  535. <% } else { %>
  536. <i class="fa fa fa-stop-circle"></i> <%- auditorList[i].name %> <small class="text-muted"><%- auditorList[i].role %></small>
  537. <% } %>
  538. </li>
  539. <% } %>
  540. </ul>
  541. </div>
  542. </div>
  543. <div class="col-8 modal-height-500" style="overflow: auto">
  544. <% for (const ah of ctx.material.auditHistory) { %>
  545. <div class="card mt-3">
  546. <ul class="list-group list-group-flush">
  547. <% for (let iA = 0; iA < ah.length; iA++) { %>
  548. <% if (iA === 0) { %>
  549. <li class="list-group-item">
  550. <span class="text-success pull-right"><% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  551. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
  552. <p class="card-text"><small class="text-muted"><%- ah[iA].begin_time.toLocaleDateString() %></small></p>
  553. </li>
  554. <li class="list-group-item">
  555. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  556. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  557. <% } %>
  558. <h5 class="card-title"><i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  559. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  560. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  561. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  562. <% } %>
  563. </li>
  564. <% } else if (iA === ah.length - 1) { %>
  565. <li class="list-group-item">
  566. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  567. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  568. <% } %>
  569. <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  570. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  571. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  572. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  573. <% } %>
  574. </li>
  575. <% } else { %>
  576. <li class="list-group-item">
  577. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  578. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  579. <% } %>
  580. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  581. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  582. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  583. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  584. <% } %>
  585. </li>
  586. <% } %>
  587. <% } %>
  588. </ul>
  589. </div>
  590. <% } %>
  591. <% if (ctx.material.status === auditConst.status.checkNo) {%>
  592. <div class="card mt-3">
  593. <ul class="list-group list-group-flush">
  594. <li class="list-group-item">
  595. <span class="pull-right">重新上报中</span>
  596. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
  597. <p class="card-text"><small class="text-muted"></small></p>
  598. </li>
  599. </ul>
  600. <ul class="list-group list-group-flush" id="auditors-list2">
  601. <% const auditorList = ctx.material.auditorList; %>
  602. <% for (let iA = 0; iA < auditorList.length; iA++) { %>
  603. <% if (iA === auditorList.length - 1) { %>
  604. <li class="list-group-item" data-auditid="<%- auditorList[iA].aid %>">
  605. <h5 class="card-title"><i class="fa fa-stop-circle"></i> <%- auditorList[iA].name %> <small class="text-muted"><%- auditorList[iA].role %></small></h5>
  606. </li>
  607. <% } else { %>
  608. <li class="list-group-item" data-auditid="<%- auditorList[iA].aid %>">
  609. <h5 class="card-title"><i class="fa fa-chevron-circle-down"></i> <%- auditorList[iA].name %> <small class="text-muted"><%- auditorList[iA].role %></small></h5>
  610. </li>
  611. <% } %>
  612. <% } %>
  613. </ul>
  614. </div>
  615. <% } %>
  616. </div>
  617. </div>
  618. </div>
  619. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  620. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
  621. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  622. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  623. </form>
  624. </div>
  625. </div>
  626. </div>
  627. <% } %>
  628. <% } %>