audit_modal.ejs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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" role="document">
  5. <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post">
  6. <div class="modal-header">
  7. <h5 class="modal-title">审批通过</h5>
  8. </div>
  9. <div class="modal-body">
  10. <div class="card mt-3">
  11. <ul class="list-group list-group-flush">
  12. <% for (let i = 0, iLen = auditors.length; i < iLen; i++) { %>
  13. <li class="list-group-item" auditorId="<%- auditors[i].audit_id %>">
  14. <% if (auditors[i].status !== auditConst.status.uncheck) { %>
  15. <span class="<%- auditConst.statusClass[auditors[i].status] %> pull-right"><%- auditConst.statusString[auditors[i].status] %></span>
  16. <% } %>
  17. <h5 class="card-title"><%- auditors[i].audit_order %> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small></h5>
  18. <% if (auditors[i].status === auditConst.status.checked) { %>
  19. <p class="card-text"><%- auditors[i].opinion %> <%- auditors[i].end_time ? auditors[i].end_time.toLocaleString() : '' %></p>
  20. <% } else if (auditors[i].status === auditConst.status.checking) { %>
  21. <div class="form-group">
  22. <label>审批意见<b class="text-danger">*</b></label>
  23. <textarea class="form-control" name="opinion">同意</textarea>
  24. </div>
  25. <% } %>
  26. </li>
  27. <% } %>
  28. </ul>
  29. </div>
  30. </div>
  31. <div class="modal-footer">
  32. <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
  33. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  34. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  35. <button type="submit" class="btn btn-success" >确认通过</button>
  36. </div>
  37. </form>
  38. </div>
  39. </div>
  40. <!--审批退回-->
  41. <div class="modal fade" id="sp-back" data-backdrop="static">
  42. <div class="modal-dialog" role="document">
  43. <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post">
  44. <div class="modal-header">
  45. <h5 class="modal-title">审批退回</h5>
  46. </div>
  47. <div class="modal-body">
  48. <div class="card mt-3">
  49. <ul class="list-group list-group-flush">
  50. <% for (let i = 0, iLen = auditors.length; i < iLen; i++) { %>
  51. <li class="list-group-item" auditorId="<%- auditors[i].audit_id %>">
  52. <% if (auditors[i].status !== auditConst.status.uncheck) { %>
  53. <span class="<%- auditConst.statusClass[auditors[i].status] %> pull-right"><%- auditConst.statusString[auditors[i].status] %></span>
  54. <% } %>
  55. <h5 class="card-title"><%- auditors[i].audit_order %> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small></h5>
  56. <% if (auditors[i].status === auditConst.status.checked) { %>
  57. <p class="card-text"><%- auditors[i].opinion %> <%- auditors[i].end_time ? auditors[i].end_time.toLocaleString() : '' %></p>
  58. <% } else if (auditors[i].status === auditConst.status.checking) { %>
  59. <div class="form-group">
  60. <label>审批意见<b class="text-danger">*</b></label>
  61. <textarea class="form-control" name="opinion">不同意</textarea>
  62. </div>
  63. <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
  64. <% } %>
  65. </li>
  66. <% } %>
  67. </ul>
  68. </div>
  69. </div>
  70. <div class="modal-footer">
  71. <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
  72. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  73. <input type="hidden" name="checkType" value="<%= auditConst.status.checkNo %>" />
  74. <button type="submit" class="btn btn-warning" >确认退回</button>
  75. </div>
  76. </form>
  77. </div>
  78. </div>
  79. <% } else { %>
  80. <!--审批流程/结果-->
  81. <div class="modal fade" id="sp-list" data-backdrop="static">
  82. <div class="modal-dialog modal-lg" role="document">
  83. <div class="modal-content">
  84. <div class="modal-header">
  85. <h5 class="modal-title">审批流程</h5>
  86. </div>
  87. <div class="modal-body">
  88. <div class="row">
  89. <div class="col-4">
  90. <div class="card mt-3">
  91. <ul class="list-group list-group-flush">
  92. <li class="list-group-item">
  93. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small>
  94. </li>
  95. <% for (let i = 0; i < auditors.length; i++) { %>
  96. <li class="list-group-item">
  97. <% if (i < auditors.length - 1) { %>
  98. <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small>
  99. <% } else {%>
  100. <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small>
  101. <% } %>
  102. </li>
  103. <% } %>
  104. </ul>
  105. </div>
  106. </div>
  107. <div class="col-8 modal-height-500" style="overflow: auto">
  108. <% for (const ah of auditHistory) { %>
  109. <div class="card mt-3">
  110. <ul class="list-group list-group-flush">
  111. <% for (let iA = 0; iA < ah.length; iA++) { %>
  112. <% if (iA === 0) { %>
  113. <li class="list-group-item">
  114. <span class="text-success pull-right"><% if (auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  115. <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></h5>
  116. <p class="card-text"><small class="text-muted"><%- ah[iA].begin_time.toLocaleDateString() %></small></p>
  117. </li>
  118. <li class="list-group-item">
  119. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  120. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
  121. <% } %>
  122. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  123. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  124. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  125. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  126. <% } %>
  127. </li>
  128. <% } else if (iA === ah.length - 1) { %>
  129. <li class="list-group-item">
  130. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  131. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
  132. <% } %>
  133. <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  134. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  135. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  136. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  137. <% } %>
  138. </li>
  139. <% } else { %>
  140. <li class="list-group-item">
  141. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  142. <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
  143. <% } %>
  144. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
  145. <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
  146. <p class="card-text mb-1"><%- ah[iA].opinion %></p>
  147. <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
  148. <% } %>
  149. </li>
  150. <% } %>
  151. <% } %>
  152. </ul>
  153. </div>
  154. <% } %>
  155. <% if (tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked) {%>
  156. <div class="card mt-3">
  157. <ul class="list-group list-group-flush">
  158. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  159. <% if (iA === 0) { %>
  160. <li class="list-group-item">
  161. <span class="text-success pull-right"><% if (tender.ledger_times > 1) { %>重新<% } %>上报</span>
  162. <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></h5>
  163. <p class="card-text"><small class="text-muted"><%- auditors[iA].begin_time.toLocaleDateString() %></small></p>
  164. </li>
  165. <li class="list-group-item">
  166. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  167. <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
  168. <% } %>
  169. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
  170. <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>
  171. <p class="card-text mb-1"><%- auditors[iA].opinion %></p>
  172. <p class="card-text"><small class="text-muted"><%- auditors[iA].end_time.toLocaleDateString() %></small></p>
  173. <% } %>
  174. </li>
  175. <% } else if (iA === auditors.length - 1) { %>
  176. <li class="list-group-item">
  177. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  178. <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
  179. <% } %>
  180. <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
  181. <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>
  182. <p class="card-text"><%- auditors[iA].opinion %></p>
  183. <p class="card-text"><small class="text-muted"><%- auditors[iA].end_time.toLocaleDateString() %></small></p>
  184. <% } %>
  185. </li>
  186. <% } else { %>
  187. <li class="list-group-item">
  188. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  189. <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
  190. <% } %>
  191. <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
  192. <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>
  193. <p class="card-text"><%- auditors[iA].opinion %></p>
  194. <p class="card-text"><small class="text-muted"><%- auditors[iA].end_time.toLocaleDateString() %></small></p>
  195. <% } %>
  196. </li>
  197. <% } %>
  198. <% } %>
  199. </ul>
  200. </div>
  201. <% } %>
  202. </div>
  203. </div>
  204. </div>
  205. <div class="modal-footer">
  206. <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. <% } %>