audit_modal.ejs 56 KB

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