detail.ejs 27 KB

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