audit_modal.ejs 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  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. <% for (const ah of ctx.material.auditHistory) { %>
  86. <div class="card mt-3">
  87. <ul class="list-group list-group-flush">
  88. <% for (let iA = 0; iA < ah.length; iA++) { %>
  89. <% if (iA === 0) { %>
  90. <li class="list-group-item">
  91. <h5 class="card-title">
  92. <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>
  93. </h5>
  94. <div class="ml-3">
  95. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  96. </div>
  97. </li>
  98. <li class="list-group-item">
  99. <h5 class="card-title">
  100. <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>
  101. </h5>
  102. <div class="ml-3">
  103. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  104. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  105. <% } %>
  106. <p class="card-text"><%- ah[iA].opinion %></p>
  107. </div>
  108. </li>
  109. <% } else if (iA === ah.length - 1) { %>
  110. <li class="list-group-item">
  111. <h5 class="card-title">
  112. <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>
  113. </h5>
  114. <div class="ml-3">
  115. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  116. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  117. <% } %>
  118. <p class="card-text"><%- ah[iA].opinion %></p>
  119. </div>
  120. </li>
  121. <% } else { %>
  122. <li class="list-group-item">
  123. <h5 class="card-title">
  124. <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>
  125. </h5>
  126. <div class="ml-3">
  127. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  128. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  129. <% } %>
  130. <p class="card-text"><%- ah[iA].opinion %></p>
  131. </div>
  132. </li>
  133. <% } %>
  134. <% } %>
  135. </ul>
  136. </div>
  137. <% } %>
  138. <div class="card mt-3">
  139. <ul class="list-group list-group-flush">
  140. <li class="list-group-item">
  141. <h5 class="card-title">
  142. <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>
  143. </h5>
  144. <div class="ml-3">
  145. <span class="text-success"><small><%- ctx.helper.formatFullDate(ctx.material.auditors[0].begin_time) %></small> 上报</span>
  146. </div>
  147. </li>
  148. <% for (let iA = 0; iA < ctx.material.auditors.length; iA++) { %>
  149. <% const auditors = ctx.material.auditors; %>
  150. <li class="list-group-item">
  151. <% if (auditors[iA].status === auditConst.status.checked) { %>
  152. <h5 class="card-title">
  153. <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>
  154. </h5>
  155. <div class="ml-3">
  156. <span class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> 审批通过</span>
  157. <p class="card-text"><%- auditors[iA].opinion %></p>
  158. </div>
  159. <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
  160. <h5 class="card-title">
  161. <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>
  162. </h5>
  163. <div class="ml-3">
  164. <span>审批中</span>
  165. <p class="card-text"><%- auditors[iA].opinion %></p>
  166. </div>
  167. <% } else { %>
  168. <h5 class="card-title">
  169. <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>
  170. </h5>
  171. <div class="ml-3">
  172. <p class="card-text"><%- auditors[iA].opinion %></p>
  173. </div>
  174. <% } %>
  175. <% if (auditors[iA].status === auditConst.status.checked) { %>
  176. <% } else if (auditors[iA].status === auditConst.status.checking) { %>
  177. <div class="form-group">
  178. <label>审批意见<b class="text-danger">*</b></label>
  179. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  180. </div>
  181. <% } %>
  182. </li>
  183. <% } %>
  184. </ul>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="modal-footer">
  190. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  191. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  192. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  193. <button type="submit" class="btn btn-success btn-sm" >确认通过</button>
  194. </div>
  195. </form>
  196. </div>
  197. </div>
  198. <!--审批退回-->
  199. <div class="modal fade" id="sp-back" data-backdrop="static">
  200. <div class="modal-dialog modal-lg" role="document">
  201. <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck(1);">
  202. <div class="modal-header">
  203. <h5 class="modal-title">审批退回</h5>
  204. </div>
  205. <div class="modal-body">
  206. <div class="row">
  207. <div class="col-4">
  208. <div class="card mt-3">
  209. <ul class="list-group list-group-flush">
  210. <li class="list-group-item">
  211. <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>
  212. </li>
  213. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  214. <li class="list-group-item">
  215. <% if (i < ctx.material.auditors2.length - 1) { %>
  216. <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>
  217. <% } else { %>
  218. <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>
  219. <% } %>
  220. </li>
  221. <% } %>
  222. </ul>
  223. </div>
  224. </div>
  225. <div class="col-8 modal-height-500" style="overflow: auto">
  226. <% for (const ah of ctx.material.auditHistory) { %>
  227. <div class="card mt-3">
  228. <ul class="list-group list-group-flush">
  229. <% for (let iA = 0; iA < ah.length; iA++) { %>
  230. <% if (iA === 0) { %>
  231. <li class="list-group-item">
  232. <h5 class="card-title">
  233. <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>
  234. </h5>
  235. <div class="ml-3">
  236. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  237. </div>
  238. </li>
  239. <li class="list-group-item">
  240. <h5 class="card-title">
  241. <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>
  242. </h5>
  243. <div class="ml-3">
  244. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  245. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  246. <% } %>
  247. <p class="card-text"><%- ah[iA].opinion %></p>
  248. </div>
  249. </li>
  250. <% } else if (iA === ah.length - 1) { %>
  251. <li class="list-group-item">
  252. <h5 class="card-title">
  253. <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>
  254. </h5>
  255. <div class="ml-3">
  256. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  257. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  258. <% } %>
  259. <p class="card-text"><%- ah[iA].opinion %></p>
  260. </div>
  261. </li>
  262. <% } else { %>
  263. <li class="list-group-item">
  264. <h5 class="card-title">
  265. <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>
  266. </h5>
  267. <div class="ml-3">
  268. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  269. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  270. <% } %>
  271. <p class="card-text"><%- ah[iA].opinion %></p>
  272. </div>
  273. </li>
  274. <% } %>
  275. <% } %>
  276. </ul>
  277. </div>
  278. <% } %>
  279. <div class="card mt-3">
  280. <ul class="list-group list-group-flush">
  281. <li class="list-group-item">
  282. <h5 class="card-title">
  283. <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>
  284. </h5>
  285. <div class="ml-3">
  286. <span class="text-success"><small><%- ctx.helper.formatFullDate(ctx.material.auditors[0].begin_time) %></small> 上报</span>
  287. </div>
  288. </li>
  289. <% for (let iA = 0; iA < ctx.material.auditors.length; iA++) { %>
  290. <% const auditors = ctx.material.auditors; %>
  291. <li class="list-group-item">
  292. <% if (auditors[iA].status === auditConst.status.checked) { %>
  293. <h5 class="card-title">
  294. <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>
  295. </h5>
  296. <div class="ml-3">
  297. <span class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> 审批通过</span>
  298. <p class="card-text"><%- auditors[iA].opinion %></p>
  299. </div>
  300. <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
  301. <h5 class="card-title">
  302. <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>
  303. </h5>
  304. <div class="ml-3">
  305. <span>审批中</span>
  306. <p class="card-text"><%- auditors[iA].opinion %></p>
  307. </div>
  308. <% } else if (auditors[iA].status === auditConst.status.checkNoPre) { %>
  309. <h5 class="card-title">
  310. <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-warning' : 'fa fa-stop-circle text-warning') %>"></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>
  311. </h5>
  312. <div class="ml-3">
  313. <span class="text-warning"><small><%- ctx.helper.formatFullDate(auditors[iA].end_time)%></small> 审批退回</span>
  314. <p class="card-text"><%- auditors[iA].opinion %></p>
  315. </div>
  316. <% } else { %>
  317. <h5 class="card-title">
  318. <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>
  319. </h5>
  320. <div class="ml-3">
  321. <p class="card-text"><%- auditors[iA].opinion %></p>
  322. </div>
  323. <% } %>
  324. <% if (auditors[iA].status === auditConst.status.checked) { %>
  325. <% } else if (auditors[iA].status === auditConst.status.checking) { %>
  326. <div class="form-group">
  327. <label>审批意见<b class="text-danger">*</b></label>
  328. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  329. </div>
  330. <div class="alert alert-warning">
  331. <div class="form-check form-check-inline">
  332. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" <% if (auditors[iA].order === 1 || auditors[iA].aid === auditors[0].aid) { %>checked<% } %>>
  333. <label class="form-check-label" for="inlineRadio1">退回原报 <%- ctx.material.user.name %></label>
  334. </div>
  335. <% if (auditors[iA].order > 1 && auditors[iA].aid !== auditors[0].aid) { %>
  336. <% const auditorIndex = ctx.material.auditors.findIndex(function (item) { return item.aid === auditors[iA].aid }) %>
  337. <div class="form-check form-check-inline">
  338. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>" checked>
  339. <label class="form-check-label" for="inlineRadio2">退回上一审批人 <%- ctx.material.auditors[auditorIndex-1].name %></label>
  340. </div>
  341. <% } %>
  342. </div>
  343. <% } %>
  344. </li>
  345. <% } %>
  346. </ul>
  347. </div>
  348. </div>
  349. </div>
  350. </div>
  351. <div class="modal-footer">
  352. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  353. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  354. <button type="submit" class="btn btn-warning btn-sm" >确认退回</button>
  355. </div>
  356. </form>
  357. </div>
  358. </div>
  359. <% } else { %>
  360. <!--审批流程/结果-->
  361. <div class="modal fade" id="sp-list" data-backdrop="static">
  362. <div class="modal-dialog modal-lg" role="document">
  363. <div class="modal-content">
  364. <div class="modal-header">
  365. <h5 class="modal-title">审批流程</h5>
  366. </div>
  367. <div class="modal-body">
  368. <div class="row">
  369. <div class="col-4">
  370. <div class="card mt-3">
  371. <ul class="list-group list-group-flush">
  372. <li class="list-group-item">
  373. <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>
  374. </li>
  375. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  376. <li class="list-group-item">
  377. <% if (i < ctx.material.auditors2.length - 1) { %>
  378. <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>
  379. <% } else { %>
  380. <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>
  381. <% } %>
  382. </li>
  383. <% } %>
  384. </ul>
  385. </div>
  386. </div>
  387. <div class="col-8 modal-height-500" style="overflow: auto">
  388. <% for (const ah of ctx.material.auditHistory) { %>
  389. <div class="card mt-3">
  390. <ul class="list-group list-group-flush">
  391. <% for (let iA = 0; iA < ah.length; iA++) { %>
  392. <% if (iA === 0) { %>
  393. <li class="list-group-item">
  394. <h5 class="card-title">
  395. <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>
  396. </h5>
  397. <div class="ml-3">
  398. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  399. </div>
  400. </li>
  401. <li class="list-group-item">
  402. <h5 class="card-title">
  403. <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>
  404. </h5>
  405. <div class="ml-3">
  406. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  407. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  408. <% } %>
  409. <p class="card-text"><%- ah[iA].opinion %></p>
  410. </div>
  411. </li>
  412. <% } else if (iA === ah.length - 1) { %>
  413. <li class="list-group-item">
  414. <h5 class="card-title">
  415. <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>
  416. </h5>
  417. <div class="ml-3">
  418. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  419. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  420. <% } %>
  421. <p class="card-text"><%- ah[iA].opinion %></p>
  422. </div>
  423. </li>
  424. <% } else { %>
  425. <li class="list-group-item">
  426. <h5 class="card-title">
  427. <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>
  428. </h5>
  429. <div class="ml-3">
  430. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  431. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  432. <% } %>
  433. <p class="card-text"><%- ah[iA].opinion %></p>
  434. </div>
  435. </li>
  436. <% } %>
  437. <% } %>
  438. </ul>
  439. </div>
  440. <% } %>
  441. <% if (ctx.material.status === auditConst.status.checking ) {%>
  442. <div class="card mt-3">
  443. <ul class="list-group list-group-flush">
  444. <% const auditors = ctx.material.auditors; %>
  445. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  446. <% if (iA === 0) { %>
  447. <li class="list-group-item">
  448. <h5 class="card-title">
  449. <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>
  450. </h5>
  451. <div class="ml-3">
  452. <span class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].begin_time) %></small> <% if (ctx.material.times > 1) { %>重新<% } %>上报</span>
  453. </div>
  454. </li>
  455. <li class="list-group-item">
  456. <h5 class="card-title">
  457. <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>
  458. </h5>
  459. <div class="ml-3">
  460. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  461. <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo || auditors[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  462. <% } %>
  463. <p class="card-text"><%- auditors[iA].opinion %></p>
  464. </div>
  465. </li>
  466. <% } else if (iA === auditors.length - 1) { %>
  467. <li class="list-group-item">
  468. <h5 class="card-title">
  469. <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>
  470. </h5>
  471. <div class="ml-3">
  472. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  473. <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo || auditors[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  474. <% } %>
  475. <p class="card-text"><%- auditors[iA].opinion %></p>
  476. </div>
  477. </li>
  478. <% } else { %>
  479. <li class="list-group-item">
  480. <h5 class="card-title">
  481. <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>
  482. </h5>
  483. <div class="ml-3">
  484. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  485. <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo || auditors[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  486. <% } %>
  487. <p class="card-text"><%- auditors[iA].opinion %></p>
  488. </div>
  489. </li>
  490. <% } %>
  491. <% } %>
  492. </ul>
  493. </div>
  494. <% } %>
  495. </div>
  496. </div>
  497. </div>
  498. <div class="modal-footer">
  499. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  500. </div>
  501. </div>
  502. </div>
  503. </div>
  504. <% } %>
  505. <% } else if (ctx.material.status === auditConst.status.checked) { %>
  506. <!--审批流程/结果-->
  507. <div class="modal fade" id="sp-list" data-backdrop="static">
  508. <div class="modal-dialog modal-lg" role="document">
  509. <div class="modal-content">
  510. <div class="modal-header">
  511. <h5 class="modal-title">审批流程</h5>
  512. </div>
  513. <div class="modal-body">
  514. <div class="row">
  515. <div class="col-4">
  516. <div class="card mt-3">
  517. <ul class="list-group list-group-flush">
  518. <li class="list-group-item">
  519. <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>
  520. </li>
  521. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  522. <li class="list-group-item">
  523. <% if (i < ctx.material.auditors2.length - 1) { %>
  524. <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>
  525. <% } else { %>
  526. <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>
  527. <% } %>
  528. </li>
  529. <% } %>
  530. </ul>
  531. </div>
  532. </div>
  533. <div class="col-8 modal-height-500" style="overflow: auto">
  534. <% for (const ah of ctx.material.auditHistory) { %>
  535. <div class="card mt-3">
  536. <ul class="list-group list-group-flush">
  537. <% for (let iA = 0; iA < ah.length; iA++) { %>
  538. <% if (iA === 0) { %>
  539. <li class="list-group-item">
  540. <h5 class="card-title">
  541. <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>
  542. </h5>
  543. <div class="ml-3">
  544. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  545. </div>
  546. </li>
  547. <li class="list-group-item">
  548. <h5 class="card-title">
  549. <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>
  550. </h5>
  551. <div class="ml-3">
  552. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  553. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  554. <% } %>
  555. <p class="card-text"><%- ah[iA].opinion %></p>
  556. </div>
  557. </li>
  558. <% } else if (iA === ah.length - 1) { %>
  559. <li class="list-group-item">
  560. <h5 class="card-title">
  561. <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>
  562. </h5>
  563. <div class="ml-3">
  564. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  565. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  566. <% } %>
  567. <p class="card-text"><%- ah[iA].opinion %></p>
  568. </div>
  569. </li>
  570. <% } else { %>
  571. <li class="list-group-item">
  572. <h5 class="card-title">
  573. <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>
  574. </h5>
  575. <div class="ml-3">
  576. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  577. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  578. <% } %>
  579. <p class="card-text"><%- ah[iA].opinion %></p>
  580. </div>
  581. </li>
  582. <% } %>
  583. <% } %>
  584. </ul>
  585. </div>
  586. <% } %>
  587. <div class="card mt-3">
  588. <ul class="list-group list-group-flush">
  589. <% const auditors = ctx.material.auditors; %>
  590. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  591. <% if (iA === 0) { %>
  592. <li class="list-group-item">
  593. <h5 class="card-title">
  594. <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>
  595. </h5>
  596. <div class="ml-3">
  597. <span class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].begin_time) %></small> <% if (ctx.material.times > 1) { %>重新<% } %>上报</span>
  598. </div>
  599. </li>
  600. <li class="list-group-item">
  601. <h5 class="card-title">
  602. <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>
  603. </h5>
  604. <div class="ml-3">
  605. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  606. <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo || auditors[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  607. <% } %>
  608. <p class="card-text"><%- auditors[iA].opinion %></p>
  609. </div>
  610. </li>
  611. <% } else if (iA === auditors.length - 1) { %>
  612. <li class="list-group-item">
  613. <h5 class="card-title">
  614. <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>
  615. </h5>
  616. <div class="ml-3">
  617. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  618. <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo || auditors[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  619. <% } %>
  620. <p class="card-text"><%- auditors[iA].opinion %></p>
  621. </div>
  622. </li>
  623. <% } else { %>
  624. <li class="list-group-item">
  625. <h5 class="card-title">
  626. <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>
  627. </h5>
  628. <div class="ml-3">
  629. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  630. <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo || auditors[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  631. <% } %>
  632. <p class="card-text"><%- auditors[iA].opinion %></p>
  633. </div>
  634. </li>
  635. <% } %>
  636. <% } %>
  637. </ul>
  638. </div>
  639. </div>
  640. </div>
  641. </div>
  642. <div class="modal-footer">
  643. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  644. </div>
  645. </div>
  646. </div>
  647. </div>
  648. <% } else if (ctx.material.status === auditConst.status.checkNo) { %>
  649. <!--审批流程/结果-->
  650. <div class="modal fade" id="sp-list" data-backdrop="static">
  651. <div class="modal-dialog modal-lg" role="document">
  652. <div class="modal-content">
  653. <div class="modal-header">
  654. <h5 class="modal-title">审批流程</h5>
  655. </div>
  656. <div class="modal-body">
  657. <div class="row">
  658. <div class="col-4">
  659. <div class="card mt-3">
  660. <ul class="list-group list-group-flush">
  661. <li class="list-group-item">
  662. <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>
  663. </li>
  664. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  665. <li class="list-group-item">
  666. <% if (i < ctx.material.auditors2.length - 1) { %>
  667. <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>
  668. <% } else { %>
  669. <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>
  670. <% } %>
  671. </li>
  672. <% } %>
  673. </ul>
  674. </div>
  675. </div>
  676. <div class="col-8 modal-height-500" style="overflow: auto">
  677. <% for (const ah of ctx.material.auditHistory) { %>
  678. <div class="card mt-3">
  679. <ul class="list-group list-group-flush">
  680. <% for (let iA = 0; iA < ah.length; iA++) { %>
  681. <% if (iA === 0) { %>
  682. <li class="list-group-item">
  683. <h5 class="card-title">
  684. <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>
  685. </h5>
  686. <div class="ml-3">
  687. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  688. </div>
  689. </li>
  690. <li class="list-group-item">
  691. <h5 class="card-title">
  692. <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>
  693. </h5>
  694. <div class="ml-3">
  695. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  696. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  697. <% } %>
  698. <p class="card-text"><%- ah[iA].opinion %></p>
  699. </div>
  700. </li>
  701. <% } else if (iA === ah.length - 1) { %>
  702. <li class="list-group-item">
  703. <h5 class="card-title">
  704. <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>
  705. </h5>
  706. <div class="ml-3">
  707. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  708. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  709. <% } %>
  710. <p class="card-text"><%- ah[iA].opinion %></p>
  711. </div>
  712. </li>
  713. <% } else { %>
  714. <li class="list-group-item">
  715. <h5 class="card-title">
  716. <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>
  717. </h5>
  718. <div class="ml-3">
  719. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  720. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  721. <% } %>
  722. <p class="card-text"><%- ah[iA].opinion %></p>
  723. </div>
  724. </li>
  725. <% } %>
  726. <% } %>
  727. </ul>
  728. </div>
  729. <% } %>
  730. </div>
  731. </div>
  732. </div>
  733. <div class="modal-footer">
  734. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  735. </div>
  736. </div>
  737. </div>
  738. </div>
  739. <% if (ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  740. <!--重新上报-->
  741. <div class="modal fade" id="sp-list2" data-backdrop="static">
  742. <div class="modal-dialog modal-lg" role="document">
  743. <div class="modal-content">
  744. <div class="modal-header">
  745. <h5 class="modal-title">重新上报</h5>
  746. </div>
  747. <div class="modal-body">
  748. <div class="row">
  749. <div class="col-4 modal-height-500" style="overflow: auto">
  750. <a href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
  751. <div class="card mt-3">
  752. <ul class="list-group list-group-flush">
  753. <li class="list-group-item">
  754. <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>
  755. </li>
  756. </ul>
  757. <ul class="list-group list-group-flush" id="auditors-list">
  758. <% const auditorList = ctx.material.auditorList; %>
  759. <% for (let i = 0; i < auditorList.length; i++) { %>
  760. <li class="list-group-item" data-auditid="<%- auditorList[i].aid %>">
  761. <% if (i < auditorList.length - 1) { %>
  762. <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>
  763. <% } else { %>
  764. <i class="fa fa fa-stop-circle"></i> <%- auditorList[i].name %> <small class="text-muted"><%- auditorList[i].role %></small><span class="pull-right">终审</span>
  765. <% } %>
  766. </li>
  767. <% } %>
  768. </ul>
  769. </div>
  770. </div>
  771. <div class="col-8 modal-height-500" style="overflow: auto">
  772. <% for (const ah of ctx.material.auditHistory) { %>
  773. <div class="card mt-3">
  774. <ul class="list-group list-group-flush">
  775. <% for (let iA = 0; iA < ah.length; iA++) { %>
  776. <% if (iA === 0) { %>
  777. <li class="list-group-item">
  778. <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>
  779. <div class="ml-3">
  780. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  781. <p class="card-text"></p>
  782. </div>
  783. </li>
  784. <li class="list-group-item">
  785. <h5 class="card-title">
  786. <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>
  787. </h5>
  788. <div class="ml-3">
  789. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  790. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  791. <% } %>
  792. <p class="card-text"><%- ah[iA].opinion %></p>
  793. </div>
  794. </li>
  795. <% } else if (iA === ah.length - 1) { %>
  796. <li class="list-group-item">
  797. <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>
  798. <div class="ml-3">
  799. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  800. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  801. <% } %>
  802. <p class="card-text"><%- ah[iA].opinion %></p>
  803. </div>
  804. </li>
  805. <% } else { %>
  806. <li class="list-group-item">
  807. <h5 class="card-title">
  808. <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>
  809. </h5>
  810. <div class="ml-3">
  811. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  812. <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
  813. <% } %>
  814. <p class="card-text"><%- ah[iA].opinion %></p>
  815. </div>
  816. </li>
  817. <% } %>
  818. <% } %>
  819. </ul>
  820. </div>
  821. <% } %>
  822. <% if (ctx.material.status === auditConst.status.checkNo) {%>
  823. <div class="card mt-3">
  824. <ul class="list-group list-group-flush">
  825. <li class="list-group-item">
  826. <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>
  827. <div class="ml-3">
  828. <span>重新上报中</span>
  829. <p class="card-text"><small class="text-muted"></small></p>
  830. </div>
  831. </li>
  832. </ul>
  833. <ul class="list-group list-group-flush" id="auditors-list2">
  834. <% const auditorList = ctx.material.auditorList; %>
  835. <% for (let iA = 0; iA < auditorList.length; iA++) { %>
  836. <% if (iA === auditorList.length - 1) { %>
  837. <li class="list-group-item" data-auditid="<%- auditorList[iA].aid %>">
  838. <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>
  839. </li>
  840. <% } else { %>
  841. <li class="list-group-item" data-auditid="<%- auditorList[iA].aid %>">
  842. <h5 class="card-title">
  843. <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>
  844. </h5>
  845. </li>
  846. <% } %>
  847. <% } %>
  848. </ul>
  849. </div>
  850. <% } %>
  851. </div>
  852. </div>
  853. </div>
  854. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  855. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
  856. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  857. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  858. </form>
  859. </div>
  860. </div>
  861. </div>
  862. <% } %>
  863. <% } %>
  864. <script>
  865. const au = JSON.parse('<%- JSON.stringify(ctx.material.auditHistory) %>');
  866. console.log(au);
  867. </script>