pay_detail_modal.ejs 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. <% include ../shares/delete_hint_modal.ejs %>
  2. <!--添加附件-->
  3. <div class="modal fade" id="addfujian">
  4. <div class="modal-dialog" role="document">
  5. <div class="modal-content">
  6. <div class="modal-header">
  7. <h5 class="modal-title" id="myModalLabel">上传附件</h5>
  8. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  9. <span aria-hidden="true">&times;</span>
  10. </button>
  11. </div>
  12. <div class="modal-body">
  13. <p>单个文件大小限制:f0MB,支持office等文档格式、图片格式、压缩包格式</p>
  14. <!-- <p><a href="javascript: void(0);" class="btn btn-primary" id="file-modal-target">选择文件</a></p> -->
  15. <input type="file" id="file-modal" multiple="multiple">
  16. </div>
  17. <div class="modal-footer">
  18. <button id="file-cancel" type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  19. <button id="file-ok" type="button" class="btn btn-primary btn-sm">添加</button>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. <!--附件-->
  25. <div class="modal fade" id="pay-contract-file" data-backdrop="static" style="z-index: 1049">
  26. <div class="modal-dialog modal-lg" role="document">
  27. <div class="modal-content">
  28. <div class="modal-header">
  29. <h5 class="modal-title">附件</h5>
  30. </div>
  31. <div class="modal-body">
  32. <% if (financialPay.filePermission) { %>
  33. <div class="form-group upload-permission">
  34. <label for="formGroupExampleInput">单个文件大小限制:50MB,支持<span data-toggle="tooltip" data-placement="bottom" title="doc,docx,xls,xlsx,ppt,pptx,pdf">office等文档格式</span>、<span data-toggle="tooltip" data-placement="bottom" title="jpg,png,bmp">图片格式</span>、<span data-toggle="tooltip" data-placement="bottom" title="rar,zip">压缩包格式</span></label>
  35. <br>
  36. <input type="file" class="" multiple>
  37. </div>
  38. <div>
  39. <div class="form-check form-check-inline">
  40. <input class="form-check-input" type="radio" name="type" id="file_type_0" value="0" checked>
  41. <label class="form-check-label" for="file_type_0">普通附件</label>
  42. </div>
  43. <% if (!financialPay.readOnly) { %>
  44. <div class="form-check form-check-inline">
  45. <input class="form-check-input" type="radio" name="type" id="file_type_1" value="1">
  46. <label class="form-check-label" for="file_type_1">发票</label>
  47. </div>
  48. <% } %>
  49. </div>
  50. <% } %>
  51. <div class="mt-2 modal-height-500" style="overflow:auto;">
  52. <table class="table table-sm table-bordered text-center" style="word-break:break-all; table-layout: fixed">
  53. <thead>
  54. <tr><th width="5%">序号</th><th>名称</th><th width="8%">上传人</th><th width="20%">发票号<th width="20%">上传时间</th><th width="15%">操作</th></tr>
  55. </thead>
  56. <tbody id="contract-files">
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. <div class="modal-footer">
  62. <input value="" type="hidden" id="file-contract-id">
  63. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <% if ((financialPay.status === auditConst.status.uncheck || financialPay.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === financialPay.uid) { %>
  69. <!--上报审批-->
  70. <div class="modal fade" id="sub-sp" data-backdrop="static">
  71. <div class="modal-dialog" role="document">
  72. <div class="modal-content">
  73. <div class="modal-header">
  74. <h5 class="modal-title">上报审批</h5>
  75. </div>
  76. <div class="modal-body">
  77. <div class="card mt-3">
  78. <div class="card-header">
  79. 审批流程
  80. </div>
  81. <div class="modal-height-500" style="overflow: auto">
  82. <ul class="list-group list-group-flush" id="auditors">
  83. <% for (let i = 0, iLen = financialPay.auditorGroups.length; i < iLen; i++) { %>
  84. <li class="list-group-item d-flex" auditorId="<%- financialPay.auditorGroups[i][0].aid %>">
  85. <div class="col-auto"><%- i+1 %></div>
  86. <div class="col">
  87. <% for (const auditor of financialPay.auditorGroups[i]) { %>
  88. <div class="d-inline-block mx-1" auditorId="<%- auditor.aid %>">
  89. <i class="fa fa-user text-muted"></i> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small>
  90. </div>
  91. <% } %>
  92. </div>
  93. <div class="col-auto">
  94. <% if (financialPay.auditorGroups[i][0].audit_type !== auditType.key.common) { %>
  95. <span class="badge badge-pill badge-<%- auditType.info[financialPay.auditorGroups[i][0].audit_type].class %> badge-bg-small"><small><%- auditType.info[financialPay.auditorGroups[i][0].audit_type].long%></small></span>
  96. <% } %>
  97. </div>
  98. </li>
  99. <% } %>
  100. </ul>
  101. </div>
  102. </div>
  103. </div>
  104. <form class="modal-footer" method="post" action="<%- preUrl2 %>/audit/start" onsubmit="return checkStartFrom()">
  105. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  106. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  107. <% if (ctx.session.sessionUser.accountId === financialPay.uid) { %>
  108. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  109. <% } %>
  110. </form>
  111. </div>
  112. </div>
  113. </div>
  114. <!-- 添加合同 -->
  115. <div class="modal fade show" id="add-deal" data-backdrop="static">
  116. <div class="modal-dialog modal-xl" role="document">
  117. <div class="modal-content">
  118. <div class="modal-header">
  119. <h5 class="modal-title">添加合同</h5>
  120. <div class="ml-auto"><strong><%- financialPay.tenderName %></strong> </div>
  121. </div>
  122. <div class="modal-body">
  123. <div class="mb-2">
  124. <div class="d-inline-block">
  125. <h6 class="mt-1 col-auto px-0">合同分类:</h6>
  126. </div>
  127. <div class="d-inline-block col-4">
  128. <select class="form-control form-control-sm col-auto" id="contract-tree">
  129. <option value="">劳务</option>
  130. <option value="" selected>材料</option>
  131. <option value="">机械</option>
  132. <option value="">其他</option>
  133. <option value="" selected>全部</option>
  134. </select>
  135. </div>
  136. <div class="d-inline-block col-5 px-0">
  137. <div class="input-group">
  138. <input placeholder="输入合同编号/名称可查询" type="text" id="contract-keyword" name="keyword" value="" class="form-control form-control-sm">
  139. <div class="input-group-append">
  140. <button class="btn btn-secondary btn-sm" id="search-contract-btn"><i aria-hidden="true" class="fa fa-search"></i></button>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <div style="max-height: 500px;overflow: auto;">
  146. <table class="table table-bordered">
  147. <tr class="text-center">
  148. <th width="50px"><input type="checkbox" id="select-all-contract"></th>
  149. <th width="100px">合同类别</th>
  150. <th width="150px">合同编号</th>
  151. <th width="">合同名称</th>
  152. <th width="100px">合同金额</th>
  153. <th width="200px">收款单位</th>
  154. <th width="200px">收款账号</th>
  155. </tr>
  156. <tbody id="contract-list">
  157. </tbody>
  158. </table>
  159. </div>
  160. </div>
  161. <div class="modal-footer">
  162. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  163. <button type="button" class="btn btn-sm btn-primary" id="add-contract-btn">确定添加</button>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <% } %>
  169. <% if(financialPay && (financialPay.status !== auditConst.status.uncheck)) { %>
  170. <!--审批流程/结果-->
  171. <div class="modal fade" id="sp-list" data-backdrop="static">
  172. <div class="modal-dialog modal-lg" role="document">
  173. <div class="modal-content">
  174. <div class="modal-header">
  175. <h5 class="modal-title"><%- financialPay.status === auditConst.status.checkNo ? '重新上报' : '审批流程' %></h5>
  176. </div>
  177. <div class="modal-body">
  178. <div class="row">
  179. <div class="col-4">
  180. <div class="card modal-height-500 mt-3" style="overflow: auto">
  181. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  182. <% financialPay.auditors2.forEach((item, idx) => { %>
  183. <% if (idx === 0) { %>
  184. <li class="list-group-item d-flex justify-content-between align-items-center">
  185. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  186. <span class="text-muted">
  187. <% for (const u of item) { %>
  188. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  189. <% } %>
  190. </span>
  191. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  192. </li>
  193. <% } else if(idx === financialPay.auditors2.length -1 && idx !== 0) { %>
  194. <li class="list-group-item d-flex justify-content-between align-items-center" data-auditorid="<%- item[0].aid %>">
  195. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  196. <span class="text-muted">
  197. <% for (const u of item) { %>
  198. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  199. <% } %>
  200. </span>
  201. <div class="d-flex ml-auto">
  202. <% if (item[0].audit_type !== auditType.key.common) { %>
  203. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  204. <% } %>
  205. <span class="badge badge-light badge-pill"><small>终审</small></span>
  206. </div>
  207. </li>
  208. <% } else {%>
  209. <li class="list-group-item d-flex justify-content-between align-items-center" data-auditorid="<%- item[0].aid %>">
  210. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  211. <span class="text-muted">
  212. <% for (const u of item) { %>
  213. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  214. <% } %>
  215. </span>
  216. <div class="d-flex ml-auto">
  217. <% if (item[0].audit_type !== auditType.key.common) { %>
  218. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  219. <% } %>
  220. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  221. </div>
  222. </li>
  223. <% } %>
  224. <% }) %>
  225. </ul>
  226. </div>
  227. </div>
  228. <div class="col-8 modal-height-500" style="overflow: auto">
  229. <% financialPay.auditHistory.forEach((his, idx) => { %>
  230. <!-- 展开/收起历史流程 -->
  231. <% if(idx === financialPay.auditHistory.length - 1 && financialPay.auditHistory.length !== 1) { %>
  232. <div class="text-right">
  233. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  234. </div>
  235. <% } %>
  236. <div class="<%- idx < financialPay.auditHistory.length - 1 ? 'fold-card' : '' %>">
  237. <div class="text-center text-muted"><%- idx+1 %>#</div>
  238. <ul class="timeline-list list-unstyled mt-2 <% if (idx === financialPay.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  239. <% his.forEach((group, index) => { %>
  240. <% if (index === 0) { %>
  241. <li class="timeline-list-item pb-2">
  242. <div class="timeline-item-date">
  243. <%- group.beginYear %>
  244. <span><%- group.beginDate %></span>
  245. <span><%- group.beginTime %></span>
  246. </div>
  247. <div class="timeline-item-tail"></div>
  248. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  249. <div class="timeline-item-content">
  250. <div class="py-1">
  251. <span class="text-black-50">原报</span>
  252. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  253. </div>
  254. <div class="card">
  255. <div class="card-body px-3 py-0">
  256. <div class="card-text p-2 py-3 row">
  257. <div class="col">
  258. <span class="h6"><%- financialPay.user.name %></span>
  259. <span class="text-muted ml-1"><%- financialPay.user.role %></span>
  260. </div>
  261. <div class="col">
  262. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  263. </div>
  264. </div>
  265. </div>
  266. </div>
  267. </div>
  268. </li>
  269. <% } %>
  270. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === financialPay.auditHistory.length - 1) { %>is_uncheck<% } %>">
  271. <% if (group.endYear) { %>
  272. <div class="timeline-item-date">
  273. <%- group.endYear %>
  274. <span><%- group.endDate %></span>
  275. <span><%- group.endTime %></span>
  276. </div>
  277. <% } %>
  278. <% if (index < his.length - 1) { %>
  279. <div class="timeline-item-tail"></div>
  280. <% } %>
  281. <% if (group.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
  282. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  283. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], group.status)) { %>
  284. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  285. <% } else if (group.status === auditConst.status.checking) { %>
  286. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  287. <% } else { %>
  288. <div class="timeline-item-icon bg-secondary text-light"></div>
  289. <% } %>
  290. <div class="timeline-item-content">
  291. <div class="py-1">
  292. <span class="text-black-50">
  293. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  294. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  295. </span>
  296. <% if (group.status !== auditConst.status.uncheck) { %>
  297. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  298. <% } %>
  299. </div>
  300. <div class="card">
  301. <div class="card-body px-3 py-0">
  302. <% for (const [i, auditor] of group.auditors.entries()) { %>
  303. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  304. <div class="col">
  305. <span class="h6"><%- auditor.name %></span>
  306. <span class="text-muted ml-1"><%- auditor.role %></span>
  307. </div>
  308. <div class="col">
  309. <% if (auditor.status === auditConst.status.checked) { %>
  310. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  311. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], auditor.status)) { %>
  312. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  313. <% } else if (auditor.status === auditConst.status.checking) { %>
  314. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  315. <% } %>
  316. </div>
  317. <% if (auditor.opinion) { %>
  318. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion %></div>
  319. <% } %>
  320. </div>
  321. <% } %>
  322. </div>
  323. </div>
  324. </div>
  325. </li>
  326. <% }) %>
  327. </ul>
  328. </div>
  329. <% }) %>
  330. </div>
  331. </div>
  332. </div>
  333. <form class="modal-footer" method="post" action="<%- preUrl2 %>/audit/start" onsubmit="return checkStartFrom()">
  334. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  335. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  336. <% if(financialPay.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === financialPay.uid) { %>
  337. <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
  338. <% } %>
  339. </form>
  340. </div>
  341. </div>
  342. </div>
  343. <% } %>
  344. <% if (financialPay.status === auditConst.status.checking) { %>
  345. <% if (financialPay.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  346. <!--审批通过-->
  347. <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
  348. <div class="modal-dialog modal-lg" role="document">
  349. <form class="modal-content" action="<%- preUrl2 %>/audit/check" method="post" onsubmit="return auditCheck(0);">
  350. <div class="modal-header">
  351. <h5 class="modal-title">审批通过</h5>
  352. </div>
  353. <div class="modal-body">
  354. <div class="row">
  355. <div class="col-4">
  356. <div class="card modal-height-500 mt-3" style="overflow: auto">
  357. <ul class="list-group list-group-flush auditors-list">
  358. <% financialPay.auditors2.forEach((item, idx) => { %>
  359. <% if (idx === 0) { %>
  360. <li class="list-group-item d-flex justify-content-between align-items-center">
  361. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  362. <span class="text-muted">
  363. <% for (const u of item) { %>
  364. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  365. <% } %>
  366. </span>
  367. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  368. </li>
  369. <% } else if(idx === financialPay.auditors2.length -1 && idx !== 0) { %>
  370. <li class="list-group-item d-flex justify-content-between align-items-center">
  371. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  372. <span class="text-muted">
  373. <% for (const u of item) { %>
  374. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  375. <% } %>
  376. </span>
  377. <div class="d-flex ml-auto">
  378. <% if (item[0].audit_type !== auditType.key.common) { %>
  379. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  380. <% } %>
  381. <span class="badge badge-light badge-pill"><small>终审</small></span>
  382. </div>
  383. </li>
  384. <% } else {%>
  385. <li class="list-group-item d-flex justify-content-between align-items-center">
  386. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  387. <span class="text-muted">
  388. <% for (const u of item) { %>
  389. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  390. <% } %>
  391. </span>
  392. <div class="d-flex ml-auto">
  393. <% if (item[0].audit_type !== auditType.key.common) { %>
  394. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1 ml-auto"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  395. <% } %>
  396. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  397. </div>
  398. </li>
  399. <% } %>
  400. <% }) %>
  401. </ul>
  402. </div>
  403. </div>
  404. <div class="col-8 modal-height-500" style="overflow: auto">
  405. <% financialPay.auditHistory.forEach((his, idx) => { %>
  406. <!-- 展开/收起历史流程 -->
  407. <% if(idx === financialPay.auditHistory.length - 1 && financialPay.auditHistory.length !== 1) { %>
  408. <div class="text-right">
  409. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  410. </div>
  411. <% } %>
  412. <div class="<%- idx < financialPay.auditHistory.length - 1 ? 'fold-card' : '' %>">
  413. <div class="text-center text-muted"><%- idx+1 %>#</div>
  414. <ul class="timeline-list list-unstyled mt-2 <% if (idx === financialPay.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  415. <% his.forEach((group, index) => { %>
  416. <% if (index === 0) { %>
  417. <li class="timeline-list-item pb-2">
  418. <div class="timeline-item-date">
  419. <%- group.beginYear %>
  420. <span><%- group.beginDate %></span>
  421. <span><%- group.beginTime %></span>
  422. </div>
  423. <div class="timeline-item-tail"></div>
  424. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  425. <div class="timeline-item-content">
  426. <div class="py-1">
  427. <span class="text-black-50">原报</span>
  428. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  429. </div>
  430. <div class="card">
  431. <div class="card-body px-3 py-0">
  432. <div class="card-text p-2 py-3 row">
  433. <div class="col">
  434. <span class="h6"><%- financialPay.user.name %></span>
  435. <span class="text-muted ml-1"><%- financialPay.user.role %></span>
  436. </div>
  437. <div class="col">
  438. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  439. </div>
  440. </div>
  441. </div>
  442. </div>
  443. </div>
  444. </li>
  445. <% } %>
  446. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === financialPay.auditHistory.length - 1) { %>is_uncheck<% } %>">
  447. <% if (group.endYear) { %>
  448. <div class="timeline-item-date">
  449. <%- group.endYear %>
  450. <span><%- group.endDate %></span>
  451. <span><%- group.endTime %></span>
  452. </div>
  453. <% } %>
  454. <% if (index < his.length - 1) { %>
  455. <div class="timeline-item-tail"></div>
  456. <% } %>
  457. <% if (group.status === auditConst.status.checked) { %>
  458. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  459. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], group.status)) { %>
  460. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  461. <% } else if (group.status === auditConst.status.checking) { %>
  462. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  463. <% } else { %>
  464. <div class="timeline-item-icon bg-secondary text-light"></div>
  465. <% } %>
  466. <div class="timeline-item-content">
  467. <div class="py-1">
  468. <span class="text-black-50">
  469. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  470. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  471. </span>
  472. <% if (group.status !== auditConst.status.uncheck) { %>
  473. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  474. <% } %>
  475. </div>
  476. <div class="card">
  477. <div class="card-body px-3 py-0">
  478. <% for (const [i, auditor] of group.auditors.entries()) { %>
  479. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  480. <div class="col">
  481. <span class="h6"><%- auditor.name %></span>
  482. <span class="text-muted ml-1"><%- auditor.role %></span>
  483. </div>
  484. <div class="col">
  485. <% if (auditor.status === auditConst.status.checked) { %>
  486. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  487. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], auditor.status)) { %>
  488. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  489. <% } else if (auditor.status === auditConst.status.checking) { %>
  490. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  491. <% } %>
  492. </div>
  493. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  494. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion %></div>
  495. <% } %>
  496. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  497. <div class="col-12 py-1 bg-light">
  498. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  499. </div>
  500. <% } %>
  501. </div>
  502. <% } %>
  503. </div>
  504. </div>
  505. </div>
  506. </li>
  507. <% }) %>
  508. </ul>
  509. </div>
  510. <% }) %>
  511. </div>
  512. </div>
  513. </div>
  514. <div class="modal-footer">
  515. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  516. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  517. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  518. <button type="submit" class="btn btn-success btn-sm">确认通过</button>
  519. </div>
  520. </form>
  521. </div>
  522. </div>
  523. <!--审批退回-->
  524. <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
  525. <div class="modal-dialog modal-lg" role="document">
  526. <form class="modal-content modal-lg" action="<%- preUrl2 %>/audit/check" method="post"
  527. onsubmit="return auditCheck(1);">
  528. <div class="modal-header">
  529. <h5 class="modal-title">审批退回</h5>
  530. </div>
  531. <div class="modal-body">
  532. <div class="row">
  533. <div class="col-4">
  534. <div class="card modal-height-500 mt-3" style="overflow: auto">
  535. <ul class="list-group list-group-flush auditors-list">
  536. <% financialPay.auditors2.forEach((item, idx) => { %>
  537. <% if (idx === 0) { %>
  538. <li class="list-group-item d-flex justify-content-between align-items-center">
  539. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  540. <span class="text-muted">
  541. <% for (const u of item) { %>
  542. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  543. <% } %>
  544. </span>
  545. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  546. </li>
  547. <% } else if(idx === financialPay.auditors2.length -1 && idx !== 0) { %>
  548. <li class="list-group-item d-flex justify-content-between align-items-center">
  549. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  550. <span class="text-muted">
  551. <% for (const u of item) { %>
  552. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  553. <% } %>
  554. </span>
  555. <div class="d-flex ml-auto">
  556. <% if (item[0].audit_type !== auditType.key.common) { %>
  557. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  558. <% } %>
  559. <span class="badge badge-light badge-pill"><small>终审</small></span>
  560. </div>
  561. </li>
  562. <% } else {%>
  563. <li class="list-group-item d-flex justify-content-between align-items-center">
  564. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  565. <span class="text-muted">
  566. <% for (const u of item) { %>
  567. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  568. <% } %>
  569. </span>
  570. <div class="d-flex ml-auto">
  571. <% if (item[0].audit_type !== auditType.key.common) { %>
  572. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  573. <% } %>
  574. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  575. </div>
  576. </li>
  577. <% } %>
  578. <% }) %>
  579. </ul>
  580. </div>
  581. </div>
  582. <div class="col-8 modal-height-500" style="overflow: auto">
  583. <% financialPay.auditHistory.forEach((his, idx) => { %>
  584. <!-- 展开/收起历史流程 -->
  585. <% if(idx === financialPay.auditHistory.length - 1 && financialPay.auditHistory.length !== 1) { %>
  586. <div class="text-right">
  587. <a href="javascript: void(0);" id="fold-btn" data-target="show" data-idx="<%- idx + 1 %>">展开历史审批流程</a>
  588. </div>
  589. <% } %>
  590. <div class="<%- idx < financialPay.auditHistory.length - 1 ? 'fold-card' : '' %>">
  591. <div class="text-center text-muted"><%- idx+1 %>#</div>
  592. <ul class="timeline-list list-unstyled mt-2 <% if (idx === financialPay.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  593. <% his.forEach((group, index) => { %>
  594. <% if (index === 0) { %>
  595. <li class="timeline-list-item pb-2">
  596. <div class="timeline-item-date">
  597. <%- group.beginYear %>
  598. <span><%- group.beginDate %></span>
  599. <span><%- group.beginTime %></span>
  600. </div>
  601. <div class="timeline-item-tail"></div>
  602. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  603. <div class="timeline-item-content">
  604. <div class="py-1">
  605. <span class="text-black-50">原报</span>
  606. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  607. </div>
  608. <div class="card">
  609. <div class="card-body px-3 py-0">
  610. <div class="card-text p-2 py-3 row">
  611. <div class="col">
  612. <span class="h6"><%- financialPay.user.name %></span>
  613. <span class="text-muted ml-1"><%- financialPay.user.role %></span>
  614. </div>
  615. <div class="col">
  616. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  617. </div>
  618. </div>
  619. </div>
  620. </div>
  621. </div>
  622. </li>
  623. <% } %>
  624. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === financialPay.auditHistory.length - 1) { %>is_uncheck<% } %>">
  625. <% if (his.endYear) { %>
  626. <div class="timeline-item-date">
  627. <%- group.endYear %>
  628. <span><%- group.endDate %></span>
  629. <span><%- group.endTime %></span>
  630. </div>
  631. <% } %>
  632. <% if (index < his.length - 1) { %>
  633. <div class="timeline-item-tail"></div>
  634. <% } %>
  635. <% if (group.status === auditConst.status.checked) { %>
  636. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  637. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], group.status)) { %>
  638. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  639. <% } else if (group.status === auditConst.status.checking) { %>
  640. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  641. <% } else { %>
  642. <div class="timeline-item-icon bg-secondary text-light"></div>
  643. <% } %>
  644. <div class="timeline-item-content">
  645. <div class="py-1">
  646. <span class="text-black-50">
  647. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  648. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  649. </span>
  650. <% if (group.status !== auditConst.status.uncheck) { %>
  651. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  652. <% } %>
  653. </div>
  654. <div class="card">
  655. <div class="card-body px-3 py-0">
  656. <% for (const [i, auditor] of group.auditors.entries()) { %>
  657. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  658. <div class="col">
  659. <span class="h6"><%- auditor.name %></span>
  660. <span class="text-muted ml-1"><%- auditor.role %></span>
  661. </div>
  662. <div class="col">
  663. <% if (auditor.status === auditConst.status.checked) { %>
  664. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  665. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], auditor.status)) { %>
  666. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  667. <% } else if (auditor.status === auditConst.status.checking) { %>
  668. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  669. <% } %>
  670. </div>
  671. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  672. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  673. <% } %>
  674. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  675. <div class="col-12 py-1 bg-light">
  676. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  677. <div class="alert alert-warning mt-1 mb-0 p-2">
  678. <div class="form-check form-check-inline">
  679. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" checked>
  680. <label class="form-check-label" for="inlineRadio1">退回原报 <%- financialPay.user.name %></label>
  681. </div>
  682. </div>
  683. </div>
  684. <% } %>
  685. </div>
  686. <% } %>
  687. </div>
  688. </div>
  689. </div>
  690. </li>
  691. <% }) %>
  692. </ul>
  693. </div>
  694. <% }) %>
  695. </div>
  696. </div>
  697. </div>
  698. <div class="modal-footer">
  699. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  700. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  701. <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
  702. </div>
  703. </form>
  704. </div>
  705. </div>
  706. <% } %>
  707. <% } %>
  708. <script>
  709. $(function () {
  710. $('.sp-location-list').on('shown.bs.modal', function () {
  711. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  712. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  713. scrollBox.scrollTop(0);
  714. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  715. const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
  716. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
  717. scrollBox.scrollTop(hdheight - bdiv);
  718. }
  719. });
  720. function divSearch(div) {
  721. if (div.length > 0) {
  722. return true;
  723. }
  724. return false;
  725. }
  726. // 展开历史审核记录
  727. $('.modal-body #fold-btn').click(function () {
  728. const type = $(this).data('target')
  729. const auditCard = $(this).parent().parent()
  730. if (type === 'show') {
  731. $(this).data('target', 'hide')
  732. auditCard.find('.fold-card').slideDown('swing', () => {
  733. auditCard.find('#fold-btn').text('收起历史审核记录')
  734. })
  735. } else {
  736. $(this).data('target', 'show')
  737. auditCard.find('.fold-card').slideUp('swing', () => {
  738. auditCard.find('#fold-btn').text('展开历史审核记录')
  739. })
  740. }
  741. });
  742. $('.sp-list-btn').click(function () {
  743. const type = $(this).data('type')
  744. if (type === 'hide') {
  745. $('.sp-list-item').hide()
  746. $('.modal-title').text('审批流程')
  747. } else {
  748. $('.sp-list-item').show()
  749. $('.modal-title').text('重新上报')
  750. }
  751. });
  752. });
  753. </script>