stage.ejs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <% include ../tender/tender_sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main d-flex">
  5. <% include ../tender/tender_sub_mini_menu.ejs %>
  6. <h2>
  7. 期列表
  8. </h2>
  9. <div class="ml-auto">
  10. <% if (ctx.session.sessionProject.page_show.openSettle) { %>
  11. <a href="/tender/<%= ctx.tender.id %>/settle" class="btn btn-primary btn-sm">计量结算</a>
  12. <% } %>
  13. <% if (ctx.session.sessionUser.accountId === ctx.tender.data.user_id && ctx.tender.data.ledger_status === auditConst.status.checked) { %>
  14. <% if (!ctx.session.sessionProject.page_show.close1stStageCheckDealParam && ctx.helper.checkZero(ctx.tender.info.deal_param.contractPrice) && stages.length === 0) { %>
  15. <a href="#add-qi" data-toggle="modal" data-target="#tips" class="btn btn-primary btn-sm">开始新一期</a>
  16. <% } else { %>
  17. <a href="#add-qi" data-toggle="modal" data-target="#add-qi" class="btn btn-primary btn-sm">开始新一期</a>
  18. <% } %>
  19. <% } %>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="content-wrap">
  24. <div class="c-body">
  25. <div class="sjs-height-0">
  26. <table class="table table-bordered table-hover">
  27. <thead>
  28. <tr>
  29. <th class="text-center" width="70px">计量期数</th>
  30. <th class="text-center" width="70px">计量月份</th>
  31. <th class="text-center" width="70px">截止日期</th>
  32. <th class="text-center" width="100px" name="contract_tp">本期合同计量</th>
  33. <th class="text-center" width="100px" name="qc_tp">本期数量变更计量</th>
  34. <% if (ctx.tender.info.display.stage.priceDiff) { %>
  35. <th class="text-center" width="100px" name="pc_tp">本期补差</th>
  36. <% } %>
  37. <th class="text-center" width="100px" name="tp">本期完成计量</th>
  38. <th class="text-center" width="100px" name="pre_tp">截止上期完成计量</th>
  39. <th class="text-center" width="100px" name="end_tp">截止本期完成计量</th>
  40. <th class="text-center" width="100px" name="yf">本期应付</th>
  41. <th class="text-center" width="100px" name="sf">本期实付</th>
  42. <th class="text-center" width="200px">审批进度</th>
  43. <th class="text-center" width="90px">操作</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. <% for (const [i,s] of stages.entries()) { %>
  48. <tr>
  49. <td>
  50. <a href="<%- '/tender/' + ctx.tender.id + '/measure/stage/' + s.order %>" target="_blank">第 <%- s.order %> 期</a>
  51. <% if ((i === 0 || (stages[i-1] && stages[i-1].status !== auditConst.status.checked)) && s.user_id === ctx.session.sessionUser.accountId) { %>
  52. <a href="#edit" class="edit-stage" data-index="<%- i %>" data-toggle="modal" data-target="#edit"><i class="fa fa-pencil-square-o "></i></a>
  53. <% } %>
  54. </td>
  55. <td class="text-center"><%- s.s_time %></td>
  56. <td class="text-center">
  57. <span data-toggle="tooltip" data-placement="bottom" data-original-title="<%- (s.period ? s.period : '') %>">
  58. <%- (s.period ? (s.period.split('~')[1] ? s.period.split('~')[1] : s.period) : '') %>
  59. </span>
  60. </td>
  61. <% if (ctx.tender.info.display.thousandth) { %>
  62. <td class="text-right"><%- (s.contract_tp ? ctx.helper.formatNum(s.contract_tp, '#,##0.######') : '')%></td>
  63. <td class="text-right"><%- (s.qc_tp ? ctx.helper.formatNum(s.qc_tp, '#,##0.######') : '')%></td>
  64. <% if (ctx.tender.info.display.stage.priceDiff) { %>
  65. <td class="text-right"><%- (s.pc_tp ? ctx.helper.formatNum(s.pc_tp, '#,##0.######') : '')%></td>
  66. <% } %>
  67. <td class="text-right"><%- (s.tp ? ctx.helper.formatNum(s.tp, '#,##0.######') : '')%></td>
  68. <td class="text-right"><%- (s.pre_tp ? ctx.helper.formatNum(s.pre_tp, '#,##0.######') : '')%></td>
  69. <td class="text-right"><%- (s.end_tp ? ctx.helper.formatNum(s.end_tp, '#,##0.######') : '')%></td>
  70. <td class="text-right"><%- (s.yf_tp ? ctx.helper.formatNum(s.yf_tp, '#,##0.######') : '') %></td>
  71. <td class="text-right"><%- (s.sf_tp ? ctx.helper.formatNum(s.sf_tp, '#,##0.######') : '') %></td>
  72. <% } else { %>
  73. <td class="text-right"><%- (s.contract_tp ? s.contract_tp : '')%></td>
  74. <td class="text-right"><%- (s.qc_tp ? s.qc_tp : '')%></td>
  75. <% if (ctx.tender.info.display.stage.priceDiff) { %>
  76. <td class="text-right"><%- (s.pc_tp ? s.pc_tp : '')%></td>
  77. <% } %>
  78. <td class="text-right"><%- (s.tp ? s.tp : '')%></td>
  79. <td class="text-right"><%- (s.pre_tp ? s.pre_tp : '')%></td>
  80. <td class="text-right"><%- (s.end_tp ? s.end_tp : '')%></td>
  81. <td class="text-right"><%- (s.yf_tp ? s.yf_tp : '') %></td>
  82. <td class="text-right"><%- (s.sf_tp ? s.sf_tp : '') %></td>
  83. <% } %>
  84. <td class="<%- auditConst.auditProgressClass[s.status] %>">
  85. <% if (s.curAuditors.length > 0) { %>
  86. <% if (s.curAuditors[0].audit_type === auditType.key.common) { %>
  87. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" s-order="<%- s.order %>"><%- s.curAuditors[0].name %><%if (s.curAuditors[0].role !== '' && s.curAuditors[0].role !== null) { %>-<%- s.curAuditors[0].role %><% } %></a>
  88. <% } else { %>
  89. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" s-order="<%- s.order %>"><%- ctx.helper.transFormToChinese(s.curAuditors[0].audit_order) + '审' %></a>
  90. <% } %>
  91. <% } %>
  92. <%- auditConst.auditProgress[s.status] %>
  93. </td>
  94. <td class="text-center">
  95. <% if (s.status === auditConst.status.uncheck && s.user_id === ctx.session.sessionUser.accountId) { %>
  96. <a href="<%- '/tender/' + ctx.tender.id + '/measure/stage/' + s.order %>" target="_blank" class="btn <%- auditConst.statusButtonClass[s.status] %> btn-sm"><%- auditConst.statusButton[s.status] %></a>
  97. <% } else if (s.status === auditConst.status.checkNo && s.curAuditors && s.user_id === ctx.session.sessionUser.accountId) { %>
  98. <a href="<%- '/tender/' + ctx.tender.id + '/measure/stage/' + s.order %>" target="_blank" class="btn <%- auditConst.statusButtonClass[s.status] %> btn-sm"><%- auditConst.statusButton[s.status] %></a>
  99. <% } else if (s.status === auditConst.status.checking && s.curAuditors && s.curAuditors.findIndex(x => { return x.aid === ctx.session.sessionUser.accountId; }) >= 0) { %>
  100. <a href="<%- '/tender/' + ctx.tender.id + '/measure/stage/' + s.order %>" target="_blank" class="btn <%- auditConst.statusButtonClass[s.status] %> btn-sm"><%- auditConst.statusButton[s.status] %></a>
  101. <% } else if (s.status === auditConst.status.checkNoPre && s.curAuditor2 && s.curAuditor2.findIndex(x => { return x.aid === ctx.session.sessionUser.accountId; }) >= 0) { %>
  102. <a href="<%- '/tender/' + ctx.tender.id + '/measure/stage/' + s.order %>" target="_blank" class="btn <%- auditConst.statusButtonClass[s.status] %> btn-sm"><%- auditConst.statusButton[s.status] %></a>
  103. <% } else { %>
  104. <span class="<%- auditConst.auditStringClass[s.status] %>"><%- auditConst.auditString[s.status] %></span>
  105. <% } %>
  106. </td>
  107. </tr>
  108. <% } %>
  109. </tbody>
  110. </table>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <script src="/public/js/sub_menu.js"></script>
  116. <script>
  117. const stages = JSON.parse('<%- JSON.stringify(stages) %>');
  118. $.subMenu({
  119. menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
  120. toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
  121. key: 'menu.1.0.0',
  122. miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
  123. callback: function (info) {
  124. if (info.mini) {
  125. $('.panel-title').addClass('fluid');
  126. $('#sub-menu').removeClass('panel-sidebar');
  127. } else {
  128. $('.panel-title').removeClass('fluid');
  129. $('#sub-menu').addClass('panel-sidebar');
  130. }
  131. autoFlashHeight();
  132. }
  133. });
  134. </script>