pay_detail_modal.ejs 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917
  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 if (group.status === auditConst.status.checkAgain) {%>
  288. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  289. <% } else { %>
  290. <div class="timeline-item-icon bg-secondary text-light"></div>
  291. <% } %>
  292. <div class="timeline-item-content">
  293. <div class="py-1">
  294. <span class="text-black-50">
  295. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  296. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  297. </span>
  298. <% if (group.status !== auditConst.status.uncheck) { %>
  299. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  300. <% } %>
  301. </div>
  302. <div class="card">
  303. <div class="card-body px-3 py-0">
  304. <% for (const [i, auditor] of group.auditors.entries()) { %>
  305. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  306. <div class="col">
  307. <span class="h6"><%- auditor.name %></span>
  308. <span class="text-muted ml-1"><%- auditor.role %></span>
  309. </div>
  310. <div class="col">
  311. <% if (auditor.status === auditConst.status.checked) { %>
  312. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  313. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], auditor.status)) { %>
  314. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  315. <% } else if(auditor.status === auditConst.status.checkAgain) {%>
  316. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  317. <% } else if (auditor.status === auditConst.status.checking) { %>
  318. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  319. <% } %>
  320. </div>
  321. <% if (auditor.opinion) { %>
  322. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion %></div>
  323. <% } %>
  324. </div>
  325. <% } %>
  326. </div>
  327. </div>
  328. </div>
  329. </li>
  330. <% }) %>
  331. </ul>
  332. </div>
  333. <% }) %>
  334. </div>
  335. </div>
  336. </div>
  337. <form class="modal-footer" method="post" action="<%- preUrl2 %>/audit/start" onsubmit="return checkStartFrom()">
  338. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  339. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  340. <% if(financialPay.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === financialPay.uid) { %>
  341. <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
  342. <% } %>
  343. </form>
  344. </div>
  345. </div>
  346. </div>
  347. <% } %>
  348. <% if (financialPay.status === auditConst.status.checking) { %>
  349. <% if (financialPay.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  350. <!--审批通过-->
  351. <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
  352. <div class="modal-dialog modal-lg" role="document">
  353. <form class="modal-content" action="<%- preUrl2 %>/audit/check" method="post" onsubmit="return auditCheck(0);">
  354. <div class="modal-header">
  355. <h5 class="modal-title">审批通过</h5>
  356. </div>
  357. <div class="modal-body">
  358. <div class="row">
  359. <div class="col-4">
  360. <div class="card modal-height-500 mt-3" style="overflow: auto">
  361. <ul class="list-group list-group-flush auditors-list">
  362. <% financialPay.auditors2.forEach((item, idx) => { %>
  363. <% if (idx === 0) { %>
  364. <li class="list-group-item d-flex justify-content-between align-items-center">
  365. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  366. <span class="text-muted">
  367. <% for (const u of item) { %>
  368. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  369. <% } %>
  370. </span>
  371. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  372. </li>
  373. <% } else if(idx === financialPay.auditors2.length -1 && idx !== 0) { %>
  374. <li class="list-group-item d-flex justify-content-between align-items-center">
  375. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  376. <span class="text-muted">
  377. <% for (const u of item) { %>
  378. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  379. <% } %>
  380. </span>
  381. <div class="d-flex ml-auto">
  382. <% if (item[0].audit_type !== auditType.key.common) { %>
  383. <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>
  384. <% } %>
  385. <span class="badge badge-light badge-pill"><small>终审</small></span>
  386. </div>
  387. </li>
  388. <% } else {%>
  389. <li class="list-group-item d-flex justify-content-between align-items-center">
  390. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  391. <span class="text-muted">
  392. <% for (const u of item) { %>
  393. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  394. <% } %>
  395. </span>
  396. <div class="d-flex ml-auto">
  397. <% if (item[0].audit_type !== auditType.key.common) { %>
  398. <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>
  399. <% } %>
  400. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  401. </div>
  402. </li>
  403. <% } %>
  404. <% }) %>
  405. </ul>
  406. </div>
  407. </div>
  408. <div class="col-8 modal-height-500" style="overflow: auto">
  409. <% financialPay.auditHistory.forEach((his, idx) => { %>
  410. <!-- 展开/收起历史流程 -->
  411. <% if(idx === financialPay.auditHistory.length - 1 && financialPay.auditHistory.length !== 1) { %>
  412. <div class="text-right">
  413. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  414. </div>
  415. <% } %>
  416. <div class="<%- idx < financialPay.auditHistory.length - 1 ? 'fold-card' : '' %>">
  417. <div class="text-center text-muted"><%- idx+1 %>#</div>
  418. <ul class="timeline-list list-unstyled mt-2 <% if (idx === financialPay.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  419. <% his.forEach((group, index) => { %>
  420. <% if (index === 0) { %>
  421. <li class="timeline-list-item pb-2">
  422. <div class="timeline-item-date">
  423. <%- group.beginYear %>
  424. <span><%- group.beginDate %></span>
  425. <span><%- group.beginTime %></span>
  426. </div>
  427. <div class="timeline-item-tail"></div>
  428. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  429. <div class="timeline-item-content">
  430. <div class="py-1">
  431. <span class="text-black-50">原报</span>
  432. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  433. </div>
  434. <div class="card">
  435. <div class="card-body px-3 py-0">
  436. <div class="card-text p-2 py-3 row">
  437. <div class="col">
  438. <span class="h6"><%- financialPay.user.name %></span>
  439. <span class="text-muted ml-1"><%- financialPay.user.role %></span>
  440. </div>
  441. <div class="col">
  442. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  443. </div>
  444. </div>
  445. </div>
  446. </div>
  447. </div>
  448. </li>
  449. <% } %>
  450. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === financialPay.auditHistory.length - 1) { %>is_uncheck<% } %>">
  451. <% if (group.endYear) { %>
  452. <div class="timeline-item-date">
  453. <%- group.endYear %>
  454. <span><%- group.endDate %></span>
  455. <span><%- group.endTime %></span>
  456. </div>
  457. <% } %>
  458. <% if (index < his.length - 1) { %>
  459. <div class="timeline-item-tail"></div>
  460. <% } %>
  461. <% if (group.status === auditConst.status.checked) { %>
  462. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  463. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], group.status)) { %>
  464. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  465. <% } else if (group.status === auditConst.status.checking) { %>
  466. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  467. <% } else if(group.status === auditConst.status.checkAgain) {%>
  468. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  469. <% } else { %>
  470. <div class="timeline-item-icon bg-secondary text-light"></div>
  471. <% } %>
  472. <div class="timeline-item-content">
  473. <div class="py-1">
  474. <span class="text-black-50">
  475. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  476. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  477. </span>
  478. <% if (group.status !== auditConst.status.uncheck) { %>
  479. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  480. <% } %>
  481. </div>
  482. <div class="card">
  483. <div class="card-body px-3 py-0">
  484. <% for (const [i, auditor] of group.auditors.entries()) { %>
  485. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  486. <div class="col">
  487. <span class="h6"><%- auditor.name %></span>
  488. <span class="text-muted ml-1"><%- auditor.role %></span>
  489. </div>
  490. <div class="col">
  491. <% if (auditor.status === auditConst.status.checked) { %>
  492. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  493. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], auditor.status)) { %>
  494. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  495. <% } else if (auditor.status === auditConst.status.checkAgain) {%>
  496. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  497. <% } else if (auditor.status === auditConst.status.checking) { %>
  498. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  499. <% } %>
  500. </div>
  501. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  502. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion %></div>
  503. <% } %>
  504. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  505. <div class="col-12 py-1 bg-light">
  506. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  507. </div>
  508. <% } %>
  509. </div>
  510. <% } %>
  511. </div>
  512. </div>
  513. </div>
  514. </li>
  515. <% }) %>
  516. </ul>
  517. </div>
  518. <% }) %>
  519. </div>
  520. </div>
  521. </div>
  522. <div class="modal-footer">
  523. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  524. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  525. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  526. <button type="submit" class="btn btn-success btn-sm">确认通过</button>
  527. </div>
  528. </form>
  529. </div>
  530. </div>
  531. <!--审批退回-->
  532. <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
  533. <div class="modal-dialog modal-lg" role="document">
  534. <form class="modal-content modal-lg" action="<%- preUrl2 %>/audit/check" method="post"
  535. onsubmit="return auditCheck(1);">
  536. <div class="modal-header">
  537. <h5 class="modal-title">审批退回</h5>
  538. </div>
  539. <div class="modal-body">
  540. <div class="row">
  541. <div class="col-4">
  542. <div class="card modal-height-500 mt-3" style="overflow: auto">
  543. <ul class="list-group list-group-flush auditors-list">
  544. <% financialPay.auditors2.forEach((item, idx) => { %>
  545. <% if (idx === 0) { %>
  546. <li class="list-group-item d-flex justify-content-between align-items-center">
  547. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  548. <span class="text-muted">
  549. <% for (const u of item) { %>
  550. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  551. <% } %>
  552. </span>
  553. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  554. </li>
  555. <% } else if(idx === financialPay.auditors2.length -1 && idx !== 0) { %>
  556. <li class="list-group-item d-flex justify-content-between align-items-center">
  557. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  558. <span class="text-muted">
  559. <% for (const u of item) { %>
  560. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  561. <% } %>
  562. </span>
  563. <div class="d-flex ml-auto">
  564. <% if (item[0].audit_type !== auditType.key.common) { %>
  565. <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>
  566. <% } %>
  567. <span class="badge badge-light badge-pill"><small>终审</small></span>
  568. </div>
  569. </li>
  570. <% } else {%>
  571. <li class="list-group-item d-flex justify-content-between align-items-center">
  572. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  573. <span class="text-muted">
  574. <% for (const u of item) { %>
  575. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  576. <% } %>
  577. </span>
  578. <div class="d-flex ml-auto">
  579. <% if (item[0].audit_type !== auditType.key.common) { %>
  580. <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>
  581. <% } %>
  582. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  583. </div>
  584. </li>
  585. <% } %>
  586. <% }) %>
  587. </ul>
  588. </div>
  589. </div>
  590. <div class="col-8 modal-height-500" style="overflow: auto">
  591. <% financialPay.auditHistory.forEach((his, idx) => { %>
  592. <!-- 展开/收起历史流程 -->
  593. <% if(idx === financialPay.auditHistory.length - 1 && financialPay.auditHistory.length !== 1) { %>
  594. <div class="text-right">
  595. <a href="javascript: void(0);" id="fold-btn" data-target="show" data-idx="<%- idx + 1 %>">展开历史审批流程</a>
  596. </div>
  597. <% } %>
  598. <div class="<%- idx < financialPay.auditHistory.length - 1 ? 'fold-card' : '' %>">
  599. <div class="text-center text-muted"><%- idx+1 %>#</div>
  600. <ul class="timeline-list list-unstyled mt-2 <% if (idx === financialPay.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  601. <% his.forEach((group, index) => { %>
  602. <% if (index === 0) { %>
  603. <li class="timeline-list-item pb-2">
  604. <div class="timeline-item-date">
  605. <%- group.beginYear %>
  606. <span><%- group.beginDate %></span>
  607. <span><%- group.beginTime %></span>
  608. </div>
  609. <div class="timeline-item-tail"></div>
  610. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  611. <div class="timeline-item-content">
  612. <div class="py-1">
  613. <span class="text-black-50">原报</span>
  614. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  615. </div>
  616. <div class="card">
  617. <div class="card-body px-3 py-0">
  618. <div class="card-text p-2 py-3 row">
  619. <div class="col">
  620. <span class="h6"><%- financialPay.user.name %></span>
  621. <span class="text-muted ml-1"><%- financialPay.user.role %></span>
  622. </div>
  623. <div class="col">
  624. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  625. </div>
  626. </div>
  627. </div>
  628. </div>
  629. </div>
  630. </li>
  631. <% } %>
  632. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === financialPay.auditHistory.length - 1) { %>is_uncheck<% } %>">
  633. <% if (his.endYear) { %>
  634. <div class="timeline-item-date">
  635. <%- group.endYear %>
  636. <span><%- group.endDate %></span>
  637. <span><%- group.endTime %></span>
  638. </div>
  639. <% } %>
  640. <% if (index < his.length - 1) { %>
  641. <div class="timeline-item-tail"></div>
  642. <% } %>
  643. <% if (group.status === auditConst.status.checked) { %>
  644. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  645. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], group.status)) { %>
  646. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  647. <% } else if (group.status === auditConst.status.checking) { %>
  648. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  649. <% } else if(group.status === auditConst.status.checkAgain) {%>
  650. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  651. <% } else { %>
  652. <div class="timeline-item-icon bg-secondary text-light"></div>
  653. <% } %>
  654. <div class="timeline-item-content">
  655. <div class="py-1">
  656. <span class="text-black-50">
  657. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  658. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  659. </span>
  660. <% if (group.status !== auditConst.status.uncheck) { %>
  661. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  662. <% } %>
  663. </div>
  664. <div class="card">
  665. <div class="card-body px-3 py-0">
  666. <% for (const [i, auditor] of group.auditors.entries()) { %>
  667. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  668. <div class="col">
  669. <span class="h6"><%- auditor.name %></span>
  670. <span class="text-muted ml-1"><%- auditor.role %></span>
  671. </div>
  672. <div class="col">
  673. <% if (auditor.status === auditConst.status.checked) { %>
  674. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  675. <% } else if (ctx.helper._.includes([auditConst.status.checkNo], auditor.status)) { %>
  676. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  677. <% } else if(auditor.status === auditConst.status.checkAgain) {%>
  678. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  679. <% } else if (auditor.status === auditConst.status.checking) { %>
  680. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  681. <% } %>
  682. </div>
  683. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  684. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  685. <% } %>
  686. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  687. <div class="col-12 py-1 bg-light">
  688. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  689. <div class="alert alert-warning mt-1 mb-0 p-2">
  690. <div class="form-check form-check-inline">
  691. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" checked>
  692. <label class="form-check-label" for="inlineRadio1">退回原报 <%- financialPay.user.name %></label>
  693. </div>
  694. </div>
  695. </div>
  696. <% } %>
  697. </div>
  698. <% } %>
  699. </div>
  700. </div>
  701. </div>
  702. </li>
  703. <% }) %>
  704. </ul>
  705. </div>
  706. <% }) %>
  707. </div>
  708. </div>
  709. </div>
  710. <div class="modal-footer">
  711. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  712. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  713. <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
  714. </div>
  715. </form>
  716. </div>
  717. </div>
  718. <% } %>
  719. <% } %>
  720. <% if (financialPay.status === auditConst.status.checked && financialPay.finalAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  721. <% if (!authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
  722. <!--终审重新审批-->
  723. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  724. <div class="modal-dialog" role="document">
  725. <div class="modal-content">
  726. <div class="modal-header">
  727. <h5 class="modal-title">重新审批</h5>
  728. </div>
  729. <div class="modal-body">
  730. <h5>重新审批需要您的手机短信验证</h5>
  731. <h5>您目前还没设置认证手机,请先设置。</h5>
  732. </div>
  733. <div class="modal-footer">
  734. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  735. <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
  736. </div>
  737. </div>
  738. </div>
  739. </div>
  740. <% } else { %>
  741. <!--重新审批-->
  742. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  743. <div class="modal-dialog" role="document">
  744. <form id="againForm" class="modal-content" method="post" action="<%- preUrl2 %>/audit/check/again" onsubmit="return false;">
  745. <div class="modal-header">
  746. <h5 class="modal-title">重新审批</h5>
  747. </div>
  748. <div class="modal-body">
  749. <h5>确认重新审批「<%= financialPay.code %>」?</h5>
  750. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  751. <div class="form-group">
  752. <label>重审需要验证码确认,验证码将发送至尾号<%- authMobile.slice(-4) %>的手机</label>
  753. <div class="input-group input-group-sm mb-3">
  754. <input class="form-control" type="text" readonly="readonly" name="code" placeholder="输入短信中的6位验证码" />
  755. <div class="input-group-append">
  756. <button class="btn btn-outline-secondary get-code" type="button">获取验证码</button>
  757. </div>
  758. </div>
  759. </div>
  760. <% } %>
  761. </div>
  762. <div class="modal-footer">
  763. <input type="hidden" name="fpid" value="<%= financialPay.id %>">
  764. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  765. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  766. <button type="button" id="re-shenpi-btn" class="btn btn-warning btn-sm" <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %>>确定重审</button>
  767. </div>
  768. </form>
  769. </div>
  770. </div>
  771. <% } %>
  772. <% } %>
  773. <script>
  774. const csrf = '<%= ctx.csrf %>';
  775. const authMobile = '<%= authMobile %>';
  776. $(function () {
  777. $('.sp-location-list').on('shown.bs.modal', function () {
  778. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  779. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  780. scrollBox.scrollTop(0);
  781. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  782. const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
  783. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
  784. scrollBox.scrollTop(hdheight - bdiv);
  785. }
  786. });
  787. function divSearch(div) {
  788. if (div.length > 0) {
  789. return true;
  790. }
  791. return false;
  792. }
  793. // 展开历史审核记录
  794. $('.modal-body #fold-btn').click(function () {
  795. const type = $(this).data('target')
  796. const auditCard = $(this).parent().parent()
  797. if (type === 'show') {
  798. $(this).data('target', 'hide')
  799. auditCard.find('.fold-card').slideDown('swing', () => {
  800. auditCard.find('#fold-btn').text('收起历史审核记录')
  801. })
  802. } else {
  803. $(this).data('target', 'show')
  804. auditCard.find('.fold-card').slideUp('swing', () => {
  805. auditCard.find('#fold-btn').text('展开历史审核记录')
  806. })
  807. }
  808. });
  809. $('.sp-list-btn').click(function () {
  810. const type = $(this).data('type')
  811. if (type === 'hide') {
  812. $('.sp-list-item').hide()
  813. $('.modal-title').text('审批流程')
  814. } else {
  815. $('.sp-list-item').show()
  816. $('.modal-title').text('重新上报')
  817. }
  818. });
  819. $('#re-shenpi-btn').click(function () {
  820. const data = {
  821. fpid: parseInt('<%- financialPay.id %>'),
  822. };
  823. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  824. const code = $("#againForm input[name='code']").val();
  825. if ($(this).hasClass('disabled')) {
  826. return false;
  827. }
  828. if (code.length < 6) {
  829. // alert('请填写正确的验证码');
  830. toastr.error('请填写正确的验证码');
  831. return false;
  832. }
  833. data.code = code;
  834. <% } %>
  835. $.ajax({
  836. url: '<%- preUrl2 %>/audit/check/again?_csrf_j=' + csrf,
  837. type: 'post',
  838. data: data,
  839. dataTye: 'json',
  840. success: function(response) {
  841. if (response.err === 0) {
  842. window.location.href = response.url;
  843. } else {
  844. toastr.error(response.msg);
  845. }
  846. }
  847. });
  848. })
  849. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  850. // 重新审批获取手机验证码
  851. // 获取验证码
  852. let isPosting = false;
  853. $(".get-code").on('click', function() {
  854. if (isPosting) {
  855. return false;
  856. }
  857. const btn = $(this);
  858. $.ajax({
  859. url: '/profile/code?_csrf_j=' + csrf,
  860. type: 'post',
  861. data: { mobile: authMobile, type: 'shenpi' },
  862. dataTye: 'json',
  863. error: function() {
  864. isPosting = false;
  865. },
  866. beforeSend: function() {
  867. isPosting = true;
  868. },
  869. success: function(response) {
  870. isPosting = false;
  871. if (response.err === 0) {
  872. codeSuccess(btn);
  873. $("input[name='code']").removeAttr('readonly');
  874. $("#re-shenpi-btn").removeAttr('disabled');
  875. // $("#re-shenpi-btn2").removeAttr('disabled');
  876. } else {
  877. toastr.error(response.msg);
  878. }
  879. }
  880. });
  881. });
  882. <% } %>
  883. });
  884. /**
  885. * 获取成功后的操作
  886. *
  887. * @param {Object} btn - 点击的按钮
  888. * @return {void}
  889. */
  890. function codeSuccess(btn) {
  891. let counter = 60;
  892. btn.addClass('disabled').text('重新获取 ' + counter + 'S');
  893. btn.parent().siblings('input').removeAttr('readonly').attr('placeholder', '输入短信中的6位验证码');
  894. const bindBtn = $("#bind-btn");
  895. bindBtn.removeClass('btn-secondary disabled').addClass('btn-primary');
  896. const countDown = setInterval(function () {
  897. const countString = counter - 1 <= 0 ? '' : ' ' + (counter - 1) + 'S';
  898. // 倒数结束后
  899. if (countString === '') {
  900. clearInterval(countDown);
  901. btn.removeClass('disabled');
  902. }
  903. const text = '重新获取' + countString;
  904. btn.text(text);
  905. counter -= 1;
  906. }, 1000);
  907. }
  908. </script>