detail.ejs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <% include ../tender/tender_sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main d-flex justify-content-between">
  5. <% include ../tender/tender_sub_mini_menu.ejs %>
  6. <div>
  7. <div class="d-inline-block">
  8. 第<%- advance.order %>期
  9. </div>
  10. </div>
  11. <div id="au-btn">
  12. <% include ./audit_btn.ejs %>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="content-wrap">
  17. <div class="c-body">
  18. <div class="sjs-height-0">
  19. <div class="col-xl-8 mx-auto">
  20. <h4 class="mt-3 text-center mb-3">第<%- advance.order %>期
  21. <%- typeColMap[advance.type].text %></h4>
  22. <table class="table table-bordered">
  23. <thead>
  24. <tr>
  25. <th colspan="4" class="text-center">
  26. <%- typeColMap[advance.type].text %>:<%- ctx.helper.formatMoney(advancePayTotal, ',', parseFloat(advancePayTotal).toString().split('.')[1] && parseFloat(advancePayTotal).toString().split('.')[1].length || 0) %>
  27. </th>
  28. </tr>
  29. </thead>
  30. <tbody id="pay-content">
  31. <tr>
  32. <th width="150" class="text-center">支付比例</th>
  33. <td class="text-right" width="405">
  34. <div class="input-group input-group-sm">
  35. <input type="number" class="pay-input form-control nospin text-right"
  36. max="<%- max_pr %>" min="1" step="0.01" placeholder="请填写支付比例,将自动计算本期金额" data-type="0" <%- isEdited ? '' : 'disabled' %>
  37. value="<%- advance.pay_ratio && ctx.helper.mul(ctx.helper.div(advance.cur_amount, advancePayTotal), 100, 2) || 0 %>">
  38. <div class="input-group-append"><span class="input-group-text">%</span></div>
  39. </div>
  40. </td>
  41. <th width="150" class="text-center">本期金额</th>
  42. <td class="text-right" width="405">
  43. <div class="input-group input-group-sm">
  44. <input type="number" class="pay-input form-control nospin text-right" min="1" <%- isEdited ? '' : 'disabled' %>
  45. placeholder="请填写本期金额,将自动计算支付比例" data-type="1"
  46. value="<%- cur_amount %>">
  47. <div class="input-group-append"><span class="input-group-text">元</span></div>
  48. </div>
  49. </td>
  50. </tr>
  51. <tr>
  52. <th class="text-center">截止上期</th>
  53. <td class="text-right" id="p_total1" width="405">
  54. <%- prev_amount %>元
  55. </td>
  56. <th class="text-center">截止本期金额</th>
  57. <td class="text-right" id="p_total2" width="405">
  58. <%- prev_total_amount %>元
  59. </td>
  60. </tr>
  61. <tr>
  62. <th class="text-center" >备注</th>
  63. <td colspan="3">
  64. <textarea id="ad-remark" class="form-control form-control-sm" rows="2"
  65. <%- isEdited ? '' : 'disabled' %>></textarea>
  66. </td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. <table class="table table-bordered mt-3">
  71. <thead>
  72. <tr>
  73. <th colspan="3" class="text-center">附件</th>
  74. </tr>
  75. </thead>
  76. <tbody id="file-content">
  77. </tbody>
  78. </table>
  79. <% if(isEdited) { %>
  80. <table class="table table-bordered mt-3">
  81. <thead>
  82. <tr>
  83. <th colspan="2" class="text-center">审批流程</th>
  84. </tr>
  85. </thead>
  86. <tbody>
  87. <tr>
  88. <td width="30%">
  89. <div class="card">
  90. <ul class="list-group list-group-flush" id="auditors2">
  91. <% auditors.forEach((item, idx) => { %>
  92. <% if (idx === 0) { %>
  93. <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
  94. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- item.name %>
  95. <small class="text-muted"><%- item.role %></small>
  96. <span class="pull-right">原报</span>
  97. </li>
  98. <% } else if(idx === auditors.length -1 && idx !== 0) { %>
  99. <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
  100. <i class="fa fa fa-stop-circle"></i> <%- item.name %>
  101. <small class="text-muted"><%- item.role %></small>
  102. <span class="pull-right">终审</span>
  103. </li>
  104. <% } else {%>
  105. <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
  106. <i class="fa fa-chevron-circle-down"></i> <%- item.name %>
  107. <small class="text-muted"><%- item.role %></small>
  108. <span class="pull-right"><%- ctx.helper.transFormToChinese(idx) -%>审</span>
  109. </li>
  110. <% } %>
  111. <% }) %>
  112. </ul>
  113. </div>
  114. </td>
  115. <td width="70%">
  116. <div class="dropdown text-right">
  117. <% if (ctx.tender.info.shenpi.advance !== shenpiConst.sp_status.gdspl) { %>
  118. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
  119. id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
  120. aria-expanded="false">
  121. 添加审批流程
  122. </button>
  123. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
  124. style="width:220px">
  125. <div class="mb-2 p-2"><input class="form-control form-control-sm"
  126. placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
  127. <dl class="list-unstyled book-list">
  128. <% accountGroup.forEach((group, idx) => { %>
  129. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  130. <div class="dd-content" data-toggleid="<%- idx %>">
  131. <% group.groupList.forEach(item => { %>
  132. <% if (item.id !== ctx.session.sessionUser.accountId) { %>
  133. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  134. <p class="mb-0 d-flex">
  135. <span class="text-primary"><%- item.name %></span>
  136. <span class="ml-auto"><%- item.mobile %></span></p>
  137. <span class="text-muted"><%- item.role %></span>
  138. </dd>
  139. <% } %>
  140. <% });%>
  141. </div>
  142. <% }) %>
  143. </dl>
  144. </div>
  145. <% } %>
  146. </div>
  147. <div class="card mt-3">
  148. <div class="card-header">
  149. 审批流程
  150. </div>
  151. <ul class="list-group list-group-flush" id="auditors">
  152. <% auditorList.forEach((item, idx) => { %>
  153. <li class="list-group-item" auditorId="<%- item.audit_id %>">
  154. <% if (ctx.tender.info.shenpi.advance === shenpiConst.sp_status.sqspr ||
  155. (ctx.tender.info.shenpi.advance === shenpiConst.sp_status.gdzs && idx+1 !== auditorList.length)) { %>
  156. <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
  157. <% } %>
  158. <span><%- idx+1 %> <%- item.name %></span>
  159. <small class="text-muted"><%- item.role %> </small>
  160. <p class="m-0 ml-2">
  161. <small class="text-muted"><%- item.company %></small>
  162. </p>
  163. </li>
  164. <% }) %>
  165. </ul>
  166. </div>
  167. </td>
  168. </tr>
  169. </tbody>
  170. </table>
  171. <% } else {%>
  172. <table class="table table-bordered mt-3">
  173. <thead>
  174. <tr>
  175. <th colspan="2" class="text-center">审批流程</th>
  176. </tr>
  177. </thead>
  178. <tbody>
  179. <tr>
  180. <td width="30%">
  181. <div class="card">
  182. <ul class="list-group list-group-flush">
  183. <% auditors.forEach((item, idx) => { %>
  184. <% if (idx === 0) { %>
  185. <li class="list-group-item" data-auditorid="<%- item.audit_id %>">
  186. <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- item.name %>
  187. <small class="text-muted"><%- item.role %></small>
  188. <span class="pull-right">原报</span>
  189. </li>
  190. <% } else if(idx === auditors.length -1 && idx !== 0) { %>
  191. <li class="list-group-item" data-auditorid="<%- item.audit_id %>">
  192. <i class="fa fa fa-stop-circle"></i> <%- item.name %>
  193. <small class="text-muted"><%- item.role %></small>
  194. <span class="pull-right">终审</span>
  195. </li>
  196. <% } else {%>
  197. <li class="list-group-item" data-auditorid="<%- item.audit_id %>">
  198. <i class="fa fa-chevron-circle-down"></i> <%- item.name %>
  199. <small class="text-muted"><%- item.role %></small>
  200. <span
  201. class="pull-right"><%= ctx.helper.transFormToChinese(idx) %>审</span>
  202. </li>
  203. <% } %>
  204. <% }) %>
  205. </ul>
  206. </div>
  207. </td>
  208. <td width="70%">
  209. <% auditHistory.forEach((history, idx) => { %>
  210. <!-- 展开/收起历史流程 -->
  211. <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
  212. <div class="text-right">
  213. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  214. </div>
  215. <% } %>
  216. <div class="<%- idx < auditHistory.length - 1 ? 'fold-card' : '' %>">
  217. <div class="text-center text-muted" ><%- idx+1 %>#</div>
  218. <ul class="timeline-list list-unstyled mt-2">
  219. <% history.forEach((auditor, index) => { %>
  220. <% if (index === 0) { %>
  221. <li class="timeline-list-item pb-2">
  222. <div class="timeline-item-date">
  223. <%- ctx.helper.formatDate(auditor.create_time) %>
  224. </div>
  225. <div class="timeline-item-tail"></div>
  226. <div class="timeline-item-icon bg-success text-light">
  227. <i class="fa fa-caret-down"></i>
  228. </div>
  229. <div class="timeline-item-content">
  230. <div class="card">
  231. <div class="card-body p-3">
  232. <div class="card-text">
  233. <p class="mb-1"><span
  234. class="h5"><%- advance.user.name %></span><span
  235. class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  236. </p>
  237. <p class="text-muted mb-0"><%- advance.user.role %></p>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. </li>
  243. <li class="timeline-list-item pb-2">
  244. <div class="timeline-item-date">
  245. <%- ctx.helper.formatDate(auditor.end_time) %>
  246. </div>
  247. <% if(index < history.length - 1) { %>
  248. <div class="timeline-item-tail"></div>
  249. <% } %>
  250. <% if(auditor.status === auditConst.status.checked) { %>
  251. <div class="timeline-item-icon bg-success text-light">
  252. <i class="fa fa-check"></i>
  253. </div>
  254. <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
  255. <div class="timeline-item-icon bg-warning text-light">
  256. <i class="fa fa-level-up"></i>
  257. </div>
  258. <% } else if(auditor.status === auditConst.status.checking) { %>
  259. <div class="timeline-item-icon bg-warning text-light">
  260. <i class="fa fa-ellipsis-h"></i>
  261. </div>
  262. <% } else {%>
  263. <div class="timeline-item-icon bg-secondary text-light">
  264. </div>
  265. <% } %>
  266. <div class="timeline-item-content">
  267. <div class="card">
  268. <div class="card-body p-3">
  269. <div class="card-text">
  270. <p class="mb-1"><span
  271. class="h5"><%- auditor.name %></span><span
  272. class="pull-right <%- auditConst.statusClass[auditor.status] %>"><%- auditConst.statusString[auditor.status] %></span>
  273. </p>
  274. <p class="text-muted mb-0"><%- auditor.role %></p>
  275. </div>
  276. </div>
  277. <!--审批意见-->
  278. <% if (auditor.opinion) { %>
  279. <div class="card-body p-3 border-top">
  280. <p style="margin: 0;"><%- auditor.opinion %></p>
  281. </div>
  282. <% } %>
  283. </div>
  284. </div>
  285. </li>
  286. <% } else {%>
  287. <li class="timeline-list-item pb-2">
  288. <div class="timeline-item-date">
  289. <%- ctx.helper.formatDate(auditor.end_time) %>
  290. </div>
  291. <% if(index < history.length - 1) { %>
  292. <div class="timeline-item-tail"></div>
  293. <% } %>
  294. <% if(auditor.status === auditConst.status.checked) { %>
  295. <div class="timeline-item-icon bg-success text-light">
  296. <i class="fa fa-check"></i>
  297. </div>
  298. <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
  299. <div class="timeline-item-icon bg-warning text-light">
  300. <i class="fa fa-level-up"></i>
  301. </div>
  302. <% } else if(auditor.status === auditConst.status.checking) { %>
  303. <div class="timeline-item-icon bg-warning text-light">
  304. <i class="fa fa-ellipsis-h"></i>
  305. </div>
  306. <% } else { %>
  307. <div class="timeline-item-icon bg-secondary text-light">
  308. </div>
  309. <% } %>
  310. <div class="timeline-item-content">
  311. <div class="card">
  312. <div class="card-body p-3">
  313. <div class="card-text">
  314. <p class="mb-1"><span
  315. class="h5"><%- auditor.name %></span>
  316. <span
  317. class="pull-right
  318. <%- auditConst.statusClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.statusString[auditor.status] : ''%>
  319. <%- auditor.status === auditConst.status.checkNo ? advance.user.name : '' %>
  320. <%- auditor.status === auditConst.status.checkNoPre ? auditors.find(item => item.order === auditor.sort-1).name : '' %>
  321. </span>
  322. </p>
  323. <p class="text-muted mb-0"><%- auditor.role %></p>
  324. </div>
  325. </div>
  326. <!--审批意见-->
  327. <% if (auditor.opinion) { %>
  328. <div class="card-body p-3 border-top">
  329. <p style="margin: 0;"><%- auditor.opinion %></p>
  330. </div>
  331. <% } %>
  332. </div>
  333. </div>
  334. </li>
  335. <% } %>
  336. <% }) %>
  337. </ul>
  338. </div>
  339. <% }) %>
  340. </td>
  341. </tr>
  342. </tbody>
  343. </table>
  344. <% } %>
  345. </div>
  346. </div>
  347. </div>
  348. </div>
  349. </div>
  350. <script>
  351. const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');
  352. // const decimal = parseInt('<%- decimal %>');
  353. const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
  354. const advance = JSON.parse(unescape('<%- escape(JSON.stringify(advance)) %>'));
  355. const prevAdvance = JSON.parse(unescape('<%- escape(JSON.stringify(prevAdvance)) %>'));
  356. const isEdited = JSON.parse('<%- isEdited %>');
  357. const advancePayTotal = parseFloat('<%- advancePayTotal %>');
  358. const preUrl = '<%- preUrl %>';
  359. const fileList = JSON.parse(unescape('<%- escape(JSON.stringify(fileList)) %>')) || [];
  360. const whiteList = JSON.parse('<%- JSON.stringify(whiteList) %>');
  361. const curAuditor = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.advance.curAuditor)) %>'));
  362. // 展开历史审核记录
  363. $('td #fold-btn').click(function () {
  364. const type = $(this).data('target')
  365. const auditCard = $(this).parent().parent()
  366. if (type === 'show') {
  367. $(this).data('target', 'hide')
  368. auditCard.find('.fold-card').slideDown('swing', () => {
  369. auditCard.find('#fold-btn').text('收起历史审核记录')
  370. })
  371. } else {
  372. $(this).data('target', 'show')
  373. auditCard.find('.fold-card').slideUp('swing', () => {
  374. auditCard.find('#fold-btn').text('展开历史审核记录')
  375. })
  376. }
  377. });
  378. // 处理换行
  379. advance.remark && $('#ad-remark').html(advance.remark.replace(/<br\/>/g, '\n').replace(/' '/, '\s'));
  380. </script>
  381. <% if(isEdited && ctx.session.sessionUser.accountId === ctx.advance.uid) { %>
  382. <script>
  383. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  384. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  385. const shenpi_status = <%- ctx.tender.info.shenpi.advance %>;
  386. const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
  387. </script>
  388. <% } %>