audit_modal.ejs 56 KB

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