pay_detail_modal.ejs 73 KB

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