audit_modal.ejs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <% if (tender.ledger_status === auditConst.status.checking && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
  2. <!--审批通过-->
  3. <div class="modal fade" id="sp-done" data-backdrop="static">
  4. <div class="modal-dialog modal-lg" role="document">
  5. <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post" onsubmit="return auditCheck(0);">
  6. <div class="modal-header">
  7. <h5 class="modal-title">审批通过</h5>
  8. </div>
  9. <div class="modal-body">
  10. <div class="row">
  11. <div class="col-4">
  12. <div class="card mt-3">
  13. <ul class="list-group list-group-flush">
  14. <li class="list-group-item">
  15. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
  16. </li>
  17. <% for (let i = 0; i < auditors.length; i++) { %>
  18. <li class="list-group-item">
  19. <% if (i < auditors.length - 1) { %>
  20. <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right"><%= ctx.helper.transFormToChinese(i+1)%>审</span>
  21. <% } else {%>
  22. <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right">终审</span>
  23. <% } %>
  24. </li>
  25. <% } %>
  26. </ul>
  27. </div>
  28. </div>
  29. <div class="col-8 modal-height-500" style="overflow: auto">
  30. <% if (tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked) {%>
  31. <div class="card mt-3">
  32. <ul class="list-group list-group-flush">
  33. <li class="list-group-item">
  34. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span></h5>
  35. <div class="ml-3">
  36. <span class="text-success"><small><%- auditors[0].begin_time.toLocaleDateString() %></small> <% if (tender.ledger_times > 1) { %>重新<% } %>上报</span>
  37. </div>
  38. </li>
  39. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  40. <li class="list-group-item">
  41. <% if (auditors[iA].status === auditConst.status.checked) { %>
  42. <h5 class="card-title">
  43. <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>
  44. </h5>
  45. <div class="ml-3">
  46. <span class="text-success"><small><%- auditors[iA].end_time.toLocaleDateString() %></small> 审批通过</span>
  47. <p class="card-text"><%- auditors[iA].opinion %></p>
  48. </div>
  49. <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
  50. <h5 class="card-title">
  51. <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>
  52. </h5>
  53. <div class="ml-3">
  54. <span>审批中</span>
  55. <p class="card-text"><%- auditors[iA].opinion %></p>
  56. </div>
  57. <% } else { %>
  58. <h5 class="card-title">
  59. <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>
  60. </h5>
  61. <div class="ml-3">
  62. <p class="card-text"><%- auditors[iA].opinion %></p>
  63. </div>
  64. <% } %>
  65. <% if (auditors[iA].status === auditConst.status.checked) { %>
  66. <% } else if (auditors[iA].status === auditConst.status.checking) { %>
  67. <div class="form-group">
  68. <label>审批意见<b class="text-danger">*</b></label>
  69. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  70. </div>
  71. <% } %>
  72. </li>
  73. <% } %>
  74. </ul>
  75. </div>
  76. <% } %>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="modal-footer">
  81. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  82. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  83. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  84. <button type="submit" class="btn btn-success btn-sm" >确认通过</button>
  85. </div>
  86. </form>
  87. </div>
  88. </div>
  89. <!--审批退回-->
  90. <div class="modal fade" id="sp-back" data-backdrop="static">
  91. <div class="modal-dialog modal-lg" role="document">
  92. <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post" onsubmit="return auditCheck(1);">
  93. <div class="modal-header">
  94. <h5 class="modal-title">审批退回</h5>
  95. </div>
  96. <div class="modal-body">
  97. <div class="row">
  98. <div class="col-4">
  99. <div class="card mt-3">
  100. <ul class="list-group list-group-flush">
  101. <li class="list-group-item">
  102. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
  103. </li>
  104. <% for (let i = 0; i < auditors.length; i++) { %>
  105. <li class="list-group-item">
  106. <% if (i < auditors.length - 1) { %>
  107. <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right"><%= ctx.helper.transFormToChinese(i+1)%>审</span>
  108. <% } else {%>
  109. <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right">终审</span>
  110. <% } %>
  111. </li>
  112. <% } %>
  113. </ul>
  114. </div>
  115. </div>
  116. <div class="col-8 modal-height-500" style="overflow: auto">
  117. <% if (tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked) {%>
  118. <div class="card mt-3">
  119. <ul class="list-group list-group-flush">
  120. <li class="list-group-item">
  121. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span></h5>
  122. <div class="ml-3">
  123. <span class="text-success"><small><%- auditors[0].begin_time.toLocaleDateString() %></small> <% if (tender.ledger_times > 1) { %>重新<% } %>上报</span>
  124. </div>
  125. </li>
  126. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  127. <li class="list-group-item">
  128. <% if (auditors[iA].status === auditConst.status.checked) { %>
  129. <h5 class="card-title">
  130. <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>
  131. </h5>
  132. <div class="ml-3">
  133. <span class="text-success"><small><%- auditors[iA].end_time.toLocaleDateString() %></small> 审批通过</span>
  134. <p class="card-text"><%- auditors[iA].opinion %></p>
  135. </div>
  136. <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
  137. <h5 class="card-title">
  138. <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>
  139. </h5>
  140. <div class="ml-3">
  141. <span>审批中</span>
  142. <p class="card-text"><%- auditors[iA].opinion %></p>
  143. </div>
  144. <% } else { %>
  145. <h5 class="card-title">
  146. <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>
  147. </h5>
  148. <div class="ml-3">
  149. <p class="card-text"><%- auditors[iA].opinion %></p>
  150. </div>
  151. <% } %>
  152. <% if (auditors[iA].status === auditConst.status.checked) { %>
  153. <% } else if (auditors[iA].status === auditConst.status.checking) { %>
  154. <div class="form-group">
  155. <label>审批意见<b class="text-danger">*</b></label>
  156. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  157. </div>
  158. <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
  159. <% } %>
  160. </li>
  161. <% } %>
  162. </ul>
  163. </div>
  164. <% } %>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="modal-footer">
  169. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  170. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  171. <input type="hidden" name="checkType" value="<%= auditConst.status.checkNo %>" />
  172. <button type="submit" class="btn btn-warning btn-sm" >确认退回</button>
  173. </div>
  174. </form>
  175. </div>
  176. </div>
  177. <% } else { %>
  178. <!--审批流程/结果-->
  179. <div class="modal fade" id="sp-list" data-backdrop="static">
  180. <div class="modal-dialog modal-lg" role="document">
  181. <div class="modal-content">
  182. <div class="modal-header">
  183. <h5 class="modal-title">审批流程</h5>
  184. </div>
  185. <div class="modal-body">
  186. <div class="row">
  187. <div class="col-4">
  188. <div class="card mt-3">
  189. <ul class="list-group list-group-flush">
  190. <li class="list-group-item">
  191. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
  192. </li>
  193. <% for (let i = 0; i < auditors.length; i++) { %>
  194. <li class="list-group-item">
  195. <% if (i < auditors.length - 1) { %>
  196. <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right"><%= ctx.helper.transFormToChinese(i+1)%>审</span>
  197. <% } else {%>
  198. <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right">终审</span>
  199. <% } %>
  200. </li>
  201. <% } %>
  202. </ul>
  203. </div>
  204. </div>
  205. <div class="col-8 modal-height-500" style="overflow: auto">
  206. <% for (const ah of auditHistory) { %>
  207. <div class="card mt-3">
  208. <ul class="list-group list-group-flush">
  209. <% for (let iA = 0; iA < ah.length; iA++) { %>
  210. <% if (iA === 0) { %>
  211. <li class="list-group-item">
  212. <h5 class="card-title">
  213. <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
  214. </h5>
  215. <div class="ml-3">
  216. <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  217. </div>
  218. </li>
  219. <li class="list-group-item">
  220. <h5 class="card-title">
  221. <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>
  222. </h5>
  223. <div class="ml-3">
  224. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  225. <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) { %> <%- user.name %><% } %></span>
  226. <% } %>
  227. <p class="card-text"><%- ah[iA].opinion %></p>
  228. </div>
  229. </li>
  230. <% } else if (iA === ah.length - 1) { %>
  231. <li class="list-group-item">
  232. <h5 class="card-title">
  233. <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>
  234. </h5>
  235. <div class="ml-3">
  236. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  237. <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) { %> <%- user.name %><% } %></span>
  238. <% } %>
  239. <p class="card-text"><%- ah[iA].opinion %></p>
  240. </div>
  241. </li>
  242. <% } else { %>
  243. <li class="list-group-item">
  244. <h5 class="card-title">
  245. <i class="fa 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>
  246. </h5>
  247. <div class="ml-3">
  248. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  249. <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) { %> <%- user.name %><% } %></span>
  250. <% } %>
  251. <p class="card-text"><%- ah[iA].opinion %></p>
  252. </div>
  253. </li>
  254. <% } %>
  255. <% } %>
  256. </ul>
  257. </div>
  258. <% } %>
  259. <% if (tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked) {%>
  260. <div class="card mt-3">
  261. <ul class="list-group list-group-flush">
  262. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  263. <% if (iA === 0) { %>
  264. <li class="list-group-item">
  265. <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span></h5>
  266. <div class="ml-3">
  267. <span class="text-success"><small><%- auditors[iA].begin_time.toLocaleDateString() %></small> <% if (tender.ledger_times > 1) { %>重新<% } %>上报</span>
  268. </div>
  269. </li>
  270. <li class="list-group-item">
  271. <h5 class="card-title">
  272. <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>
  273. </h5>
  274. <div class="ml-3">
  275. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  276. <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) { %> <%- user.name %><% } %></span>
  277. <% } %>
  278. <p class="card-text"><%- auditors[iA].opinion %></p>
  279. </div>
  280. </li>
  281. <% } else if (iA === auditors.length - 1) { %>
  282. <li class="list-group-item">
  283. <h5 class="card-title">
  284. <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>
  285. </h5>
  286. <div class="ml-3">
  287. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  288. <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) { %> <%- user.name %><% } %></span>
  289. <% } %>
  290. <p class="card-text"><%- auditors[iA].opinion %></p>
  291. </div>
  292. </li>
  293. <% } else { %>
  294. <li class="list-group-item">
  295. <h5 class="card-title">
  296. <i class="fa 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>
  297. </h5>
  298. <div class="ml-3">
  299. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  300. <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) { %> <%- user.name %><% } %></span>
  301. <% } %>
  302. <p class="card-text"><%- auditors[iA].opinion %></p>
  303. </div>
  304. </li>
  305. <% } %>
  306. <% } %>
  307. </ul>
  308. </div>
  309. <% } %>
  310. </div>
  311. </div>
  312. </div>
  313. <div class="modal-footer">
  314. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  315. </div>
  316. </div>
  317. </div>
  318. </div>
  319. <% } %>