audit_modal.ejs 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892
  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 id="reject-process" 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. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
  334. <label class="form-check-label" for="inlineRadio1">退回原报 <%- ctx.material.user.name %></label>
  335. </div>
  336. <% if (auditors[iA].order > 1 && auditors[iA].aid !== auditors[0].aid) { %>
  337. <% const auditorIndex = ctx.material.auditors.findIndex(function (item) { return item.aid === auditors[iA].aid }) %>
  338. <div class="form-check form-check-inline">
  339. <!-- <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>" checked> -->
  340. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>" >
  341. <label class="form-check-label" for="inlineRadio2">退回上一审批人 <%- ctx.material.auditors[auditorIndex-1].name %></label>
  342. </div>
  343. <% } %>
  344. </div>
  345. <% } %>
  346. </li>
  347. <% } %>
  348. </ul>
  349. </div>
  350. </div>
  351. </div>
  352. </div>
  353. <div class="modal-footer">
  354. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  355. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
  356. <button type="submit" class="btn btn-warning btn-sm" >确认退回</button>
  357. </div>
  358. </form>
  359. </div>
  360. </div>
  361. <% } else { %>
  362. <!--审批流程/结果-->
  363. <div class="modal fade" id="sp-list" data-backdrop="static">
  364. <div class="modal-dialog modal-lg" role="document">
  365. <div class="modal-content">
  366. <div class="modal-header">
  367. <h5 class="modal-title">审批流程</h5>
  368. </div>
  369. <div class="modal-body">
  370. <div class="row">
  371. <div class="col-4">
  372. <div class="card mt-3">
  373. <ul class="list-group list-group-flush">
  374. <li class="list-group-item">
  375. <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>
  376. </li>
  377. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  378. <li class="list-group-item">
  379. <% if (i < ctx.material.auditors2.length - 1) { %>
  380. <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>
  381. <% } else { %>
  382. <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>
  383. <% } %>
  384. </li>
  385. <% } %>
  386. </ul>
  387. </div>
  388. </div>
  389. <div class="col-8 modal-height-500" style="overflow: auto">
  390. <% for (const ah of ctx.material.auditHistory) { %>
  391. <div class="card mt-3">
  392. <ul class="list-group list-group-flush">
  393. <% for (let iA = 0; iA < ah.length; iA++) { %>
  394. <% if (iA === 0) { %>
  395. <li class="list-group-item">
  396. <h5 class="card-title">
  397. <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>
  398. </h5>
  399. <div class="ml-3">
  400. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  401. </div>
  402. </li>
  403. <li class="list-group-item">
  404. <h5 class="card-title">
  405. <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>
  406. </h5>
  407. <div class="ml-3">
  408. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  409. <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>
  410. <% } %>
  411. <p class="card-text"><%- ah[iA].opinion %></p>
  412. </div>
  413. </li>
  414. <% } else if (iA === ah.length - 1) { %>
  415. <li class="list-group-item">
  416. <h5 class="card-title">
  417. <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>
  418. </h5>
  419. <div class="ml-3">
  420. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  421. <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>
  422. <% } %>
  423. <p class="card-text"><%- ah[iA].opinion %></p>
  424. </div>
  425. </li>
  426. <% } else { %>
  427. <li class="list-group-item">
  428. <h5 class="card-title">
  429. <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>
  430. </h5>
  431. <div class="ml-3">
  432. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  433. <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>
  434. <% } %>
  435. <p class="card-text"><%- ah[iA].opinion %></p>
  436. </div>
  437. </li>
  438. <% } %>
  439. <% } %>
  440. </ul>
  441. </div>
  442. <% } %>
  443. <% if (ctx.material.status === auditConst.status.checking ) {%>
  444. <div class="card mt-3">
  445. <ul class="list-group list-group-flush">
  446. <% const auditors = ctx.material.auditors; %>
  447. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  448. <% if (iA === 0) { %>
  449. <li class="list-group-item">
  450. <h5 class="card-title">
  451. <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>
  452. </h5>
  453. <div class="ml-3">
  454. <span class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].begin_time) %></small> <% if (ctx.material.times > 1) { %>重新<% } %>上报</span>
  455. </div>
  456. </li>
  457. <li class="list-group-item">
  458. <h5 class="card-title">
  459. <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>
  460. </h5>
  461. <div class="ml-3">
  462. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  463. <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>
  464. <% } %>
  465. <p class="card-text"><%- auditors[iA].opinion %></p>
  466. </div>
  467. </li>
  468. <% } else if (iA === auditors.length - 1) { %>
  469. <li class="list-group-item">
  470. <h5 class="card-title">
  471. <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>
  472. </h5>
  473. <div class="ml-3">
  474. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  475. <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>
  476. <% } %>
  477. <p class="card-text"><%- auditors[iA].opinion %></p>
  478. </div>
  479. </li>
  480. <% } else { %>
  481. <li class="list-group-item">
  482. <h5 class="card-title">
  483. <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>
  484. </h5>
  485. <div class="ml-3">
  486. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  487. <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>
  488. <% } %>
  489. <p class="card-text"><%- auditors[iA].opinion %></p>
  490. </div>
  491. </li>
  492. <% } %>
  493. <% } %>
  494. </ul>
  495. </div>
  496. <% } %>
  497. </div>
  498. </div>
  499. </div>
  500. <div class="modal-footer">
  501. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  502. </div>
  503. </div>
  504. </div>
  505. </div>
  506. <% } %>
  507. <% } else if (ctx.material.status === auditConst.status.checked) { %>
  508. <!--审批流程/结果-->
  509. <div class="modal fade" id="sp-list" data-backdrop="static">
  510. <div class="modal-dialog modal-lg" role="document">
  511. <div class="modal-content">
  512. <div class="modal-header">
  513. <h5 class="modal-title">审批流程</h5>
  514. </div>
  515. <div class="modal-body">
  516. <div class="row">
  517. <div class="col-4">
  518. <div class="card mt-3">
  519. <ul class="list-group list-group-flush">
  520. <li class="list-group-item">
  521. <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>
  522. </li>
  523. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  524. <li class="list-group-item">
  525. <% if (i < ctx.material.auditors2.length - 1) { %>
  526. <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>
  527. <% } else { %>
  528. <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>
  529. <% } %>
  530. </li>
  531. <% } %>
  532. </ul>
  533. </div>
  534. </div>
  535. <div class="col-8 modal-height-500" style="overflow: auto">
  536. <% for (const ah of ctx.material.auditHistory) { %>
  537. <div class="card mt-3">
  538. <ul class="list-group list-group-flush">
  539. <% for (let iA = 0; iA < ah.length; iA++) { %>
  540. <% if (iA === 0) { %>
  541. <li class="list-group-item">
  542. <h5 class="card-title">
  543. <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>
  544. </h5>
  545. <div class="ml-3">
  546. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  547. </div>
  548. </li>
  549. <li class="list-group-item">
  550. <h5 class="card-title">
  551. <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>
  552. </h5>
  553. <div class="ml-3">
  554. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  555. <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>
  556. <% } %>
  557. <p class="card-text"><%- ah[iA].opinion %></p>
  558. </div>
  559. </li>
  560. <% } else if (iA === ah.length - 1) { %>
  561. <li class="list-group-item">
  562. <h5 class="card-title">
  563. <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>
  564. </h5>
  565. <div class="ml-3">
  566. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  567. <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>
  568. <% } %>
  569. <p class="card-text"><%- ah[iA].opinion %></p>
  570. </div>
  571. </li>
  572. <% } else { %>
  573. <li class="list-group-item">
  574. <h5 class="card-title">
  575. <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>
  576. </h5>
  577. <div class="ml-3">
  578. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  579. <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>
  580. <% } %>
  581. <p class="card-text"><%- ah[iA].opinion %></p>
  582. </div>
  583. </li>
  584. <% } %>
  585. <% } %>
  586. </ul>
  587. </div>
  588. <% } %>
  589. <div class="card mt-3">
  590. <ul class="list-group list-group-flush">
  591. <% const auditors = ctx.material.auditors; %>
  592. <% for (let iA = 0; iA < auditors.length; iA++) { %>
  593. <% if (iA === 0) { %>
  594. <li class="list-group-item">
  595. <h5 class="card-title">
  596. <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>
  597. </h5>
  598. <div class="ml-3">
  599. <span class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].begin_time) %></small> <% if (ctx.material.times > 1) { %>重新<% } %>上报</span>
  600. </div>
  601. </li>
  602. <li class="list-group-item">
  603. <h5 class="card-title">
  604. <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>
  605. </h5>
  606. <div class="ml-3">
  607. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  608. <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>
  609. <% } %>
  610. <p class="card-text"><%- auditors[iA].opinion %></p>
  611. </div>
  612. </li>
  613. <% } else if (iA === auditors.length - 1) { %>
  614. <li class="list-group-item">
  615. <h5 class="card-title">
  616. <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>
  617. </h5>
  618. <div class="ml-3">
  619. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  620. <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>
  621. <% } %>
  622. <p class="card-text"><%- auditors[iA].opinion %></p>
  623. </div>
  624. </li>
  625. <% } else { %>
  626. <li class="list-group-item">
  627. <h5 class="card-title">
  628. <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>
  629. </h5>
  630. <div class="ml-3">
  631. <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
  632. <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>
  633. <% } %>
  634. <p class="card-text"><%- auditors[iA].opinion %></p>
  635. </div>
  636. </li>
  637. <% } %>
  638. <% } %>
  639. </ul>
  640. </div>
  641. </div>
  642. </div>
  643. </div>
  644. <div class="modal-footer">
  645. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  646. </div>
  647. </div>
  648. </div>
  649. </div>
  650. <% } else if (ctx.material.status === auditConst.status.checkNo) { %>
  651. <!--审批流程/结果-->
  652. <div class="modal fade" id="sp-list" data-backdrop="static">
  653. <div class="modal-dialog modal-lg" role="document">
  654. <div class="modal-content">
  655. <div class="modal-header">
  656. <h5 class="modal-title">审批流程</h5>
  657. </div>
  658. <div class="modal-body">
  659. <div class="row">
  660. <div class="col-4">
  661. <div class="card mt-3">
  662. <ul class="list-group list-group-flush">
  663. <li class="list-group-item">
  664. <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>
  665. </li>
  666. <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
  667. <li class="list-group-item">
  668. <% if (i < ctx.material.auditors2.length - 1) { %>
  669. <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>
  670. <% } else { %>
  671. <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>
  672. <% } %>
  673. </li>
  674. <% } %>
  675. </ul>
  676. </div>
  677. </div>
  678. <div class="col-8 modal-height-500" style="overflow: auto">
  679. <% for (const ah of ctx.material.auditHistory) { %>
  680. <div class="card mt-3">
  681. <ul class="list-group list-group-flush">
  682. <% for (let iA = 0; iA < ah.length; iA++) { %>
  683. <% if (iA === 0) { %>
  684. <li class="list-group-item">
  685. <h5 class="card-title">
  686. <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>
  687. </h5>
  688. <div class="ml-3">
  689. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  690. </div>
  691. </li>
  692. <li class="list-group-item">
  693. <h5 class="card-title">
  694. <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>
  695. </h5>
  696. <div class="ml-3">
  697. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  698. <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>
  699. <% } %>
  700. <p class="card-text"><%- ah[iA].opinion %></p>
  701. </div>
  702. </li>
  703. <% } else if (iA === ah.length - 1) { %>
  704. <li class="list-group-item">
  705. <h5 class="card-title">
  706. <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>
  707. </h5>
  708. <div class="ml-3">
  709. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  710. <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>
  711. <% } %>
  712. <p class="card-text"><%- ah[iA].opinion %></p>
  713. </div>
  714. </li>
  715. <% } else { %>
  716. <li class="list-group-item">
  717. <h5 class="card-title">
  718. <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>
  719. </h5>
  720. <div class="ml-3">
  721. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  722. <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>
  723. <% } %>
  724. <p class="card-text"><%- ah[iA].opinion %></p>
  725. </div>
  726. </li>
  727. <% } %>
  728. <% } %>
  729. </ul>
  730. </div>
  731. <% } %>
  732. </div>
  733. </div>
  734. </div>
  735. <div class="modal-footer">
  736. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  737. </div>
  738. </div>
  739. </div>
  740. </div>
  741. <% if (ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  742. <!--重新上报-->
  743. <div class="modal fade" id="sp-list2" data-backdrop="static">
  744. <div class="modal-dialog modal-lg" role="document">
  745. <div class="modal-content">
  746. <div class="modal-header">
  747. <h5 class="modal-title">重新上报</h5>
  748. </div>
  749. <div class="modal-body">
  750. <div class="row">
  751. <div class="col-4 modal-height-500" style="overflow: auto">
  752. <a href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
  753. <div class="card mt-3">
  754. <ul class="list-group list-group-flush">
  755. <li class="list-group-item">
  756. <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>
  757. </li>
  758. </ul>
  759. <ul class="list-group list-group-flush" id="auditors-list">
  760. <% const auditorList = ctx.material.auditorList; %>
  761. <% for (let i = 0; i < auditorList.length; i++) { %>
  762. <li class="list-group-item" data-auditid="<%- auditorList[i].aid %>">
  763. <% if (i < auditorList.length - 1) { %>
  764. <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>
  765. <% } else { %>
  766. <i class="fa fa fa-stop-circle"></i> <%- auditorList[i].name %> <small class="text-muted"><%- auditorList[i].role %></small><span class="pull-right">终审</span>
  767. <% } %>
  768. </li>
  769. <% } %>
  770. </ul>
  771. </div>
  772. </div>
  773. <div class="col-8 modal-height-500" style="overflow: auto">
  774. <% for (const ah of ctx.material.auditHistory) { %>
  775. <div class="card mt-3">
  776. <ul class="list-group list-group-flush">
  777. <% for (let iA = 0; iA < ah.length; iA++) { %>
  778. <% if (iA === 0) { %>
  779. <li class="list-group-item">
  780. <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>
  781. <div class="ml-3">
  782. <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
  783. <p class="card-text"></p>
  784. </div>
  785. </li>
  786. <li class="list-group-item">
  787. <h5 class="card-title">
  788. <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>
  789. </h5>
  790. <div class="ml-3">
  791. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  792. <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>
  793. <% } %>
  794. <p class="card-text"><%- ah[iA].opinion %></p>
  795. </div>
  796. </li>
  797. <% } else if (iA === ah.length - 1) { %>
  798. <li class="list-group-item">
  799. <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>
  800. <div class="ml-3">
  801. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  802. <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>
  803. <% } %>
  804. <p class="card-text"><%- ah[iA].opinion %></p>
  805. </div>
  806. </li>
  807. <% } else { %>
  808. <li class="list-group-item">
  809. <h5 class="card-title">
  810. <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>
  811. </h5>
  812. <div class="ml-3">
  813. <% if (ah[iA].status !== auditConst.status.uncheck) { %>
  814. <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>
  815. <% } %>
  816. <p class="card-text"><%- ah[iA].opinion %></p>
  817. </div>
  818. </li>
  819. <% } %>
  820. <% } %>
  821. </ul>
  822. </div>
  823. <% } %>
  824. <% if (ctx.material.status === auditConst.status.checkNo) {%>
  825. <div class="card mt-3">
  826. <ul class="list-group list-group-flush">
  827. <li class="list-group-item">
  828. <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>
  829. <div class="ml-3">
  830. <span>重新上报中</span>
  831. <p class="card-text"><small class="text-muted"></small></p>
  832. </div>
  833. </li>
  834. </ul>
  835. <ul class="list-group list-group-flush" id="auditors-list2">
  836. <% const auditorList = ctx.material.auditorList; %>
  837. <% for (let iA = 0; iA < auditorList.length; iA++) { %>
  838. <% if (iA === auditorList.length - 1) { %>
  839. <li class="list-group-item" data-auditid="<%- auditorList[iA].aid %>">
  840. <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>
  841. </li>
  842. <% } else { %>
  843. <li class="list-group-item" data-auditid="<%- auditorList[iA].aid %>">
  844. <h5 class="card-title">
  845. <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>
  846. </h5>
  847. </li>
  848. <% } %>
  849. <% } %>
  850. </ul>
  851. </div>
  852. <% } %>
  853. </div>
  854. </div>
  855. </div>
  856. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  857. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
  858. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  859. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  860. </form>
  861. </div>
  862. </div>
  863. </div>
  864. <% } %>
  865. <% } %>
  866. <script>
  867. $('.modal').on('shown.bs.modal', function () {
  868. const height = $(this)[0].scrollHeight;
  869. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  870. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  871. // 450是modal没有滚动条时的最大高度,超过则出现滚动条,需要自动下拉到底部
  872. // if (scrollBox.length && scrollBox[0].scrollHeight > 450) {
  873. // scrollBox.scrollTop(height);
  874. // }
  875. scrollBox.scrollTop(0);
  876. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  877. const hdheight = hdiv ? hdiv.parents('.list-group-item').offset().top : null;
  878. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 450 && hdheight - bdiv > 450) {
  879. scrollBox.scrollTop(hdheight - bdiv);
  880. }
  881. });
  882. function divSearch(div) {
  883. if (div.length > 0) {
  884. return true;
  885. }
  886. return false;
  887. }
  888. </script>