stage.ejs 9.9 KB

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