audit_modal.ejs 56 KB

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