audit_modal.ejs 54 KB

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