ledger_list.ejs 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <% include ./list_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main d-flex">
  5. <% include ./list_mini_menu.ejs %>
  6. <h2>
  7. 审批列表
  8. </h2>
  9. <div class="ml-auto">
  10. <a href="#cost-ledger-col" data-toggle="modal" data-target="#cost-ledger-col" class="btn btn-primary btn-sm">列设置</a>
  11. <% if (ctx.permission.cost.ledger_add && (stages.length === 0 || stages[0].audit_status === auditConst.status.checked)) { %>
  12. <a href="#add-qi" data-toggle="modal" data-target="#add-qi" class="btn btn-primary btn-sm">新建报审</a>
  13. <% } %>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="content-wrap">
  18. <div class="c-body">
  19. <div class="sjs-height-0">
  20. <table class="table table-bordered table-hover">
  21. <thead>
  22. <tr class="text-center">
  23. <th width="80px" rowspan="2">期数</th>
  24. <th width="70px" rowspan="2">报审月份</th>
  25. <% if (colSet.cur) { %>
  26. <th colspan="4">本期金额</th>
  27. <% } %>
  28. <% if (colSet.cur_excl_tax) { %>
  29. <th colspan="2">本期金额(不含税)</th>
  30. <% } %>
  31. <% if (colSet.end) { %>
  32. <th colspan="4">截止本期金额</th>
  33. <% } %>
  34. <% if (colSet.end_excl_tax) { %>
  35. <th colspan="2">截止本期金额(不含税)</th>
  36. <% } %>
  37. <th rowspan="2">审批进度</th>
  38. <th width="100px" rowspan="2">操作</th>
  39. </tr>
  40. <tr class="text-center">
  41. <% if (colSet.cur) { %>
  42. <th width="100px" name="tp-col">付款</th>
  43. <th width="100px" name="tp-col">扣款</th>
  44. <th width="100px" name="tp-col">应付</th>
  45. <th width="100px" name="tp-col">实付</th>
  46. <% } %>
  47. <% if (colSet.cur_excl_tax) { %>
  48. <th width="100px" name="tp-col">应付</th>
  49. <th width="100px" name="tp-col">实付</th>
  50. <% } %>
  51. <% if (colSet.end) { %>
  52. <th width="100px" name="tp-col">付款</th>
  53. <th width="100px" name="tp-col">扣款</th>
  54. <th width="100px" name="tp-col">应付</th>
  55. <th width="100px" name="tp-col">实付</th>
  56. <% } %>
  57. <% if (colSet.end_excl_tax) { %>
  58. <th width="100px" name="tp-col">应付</th>
  59. <th width="100px" name="tp-col">实付</th>
  60. <% } %>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <% for (const s of stages) { %>
  65. <tr>
  66. <td>
  67. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/ledger/<%- s.stage_order %>/stage" target="_blank">第 <%- s.stage_order %> 期</a>
  68. </td>
  69. <td class="text-center"><%- s.stage_date %></td>
  70. <% if (colSet.cur) { %>
  71. <td class="text-right"><%- s.stage_tp.pay_tp %></td>
  72. <td class="text-right"><%- s.stage_tp.cut_tp %></td>
  73. <td class="text-right"><%- s.stage_tp.yf_tp %></td>
  74. <td class="text-right"><%- s.stage_tp.sf_tp %></td>
  75. <% } %>
  76. <% if (colSet.cur_excl_tax) { %>
  77. <td class="text-right"><%- s.stage_tp.yf_excl_tax_tp %></td>
  78. <td class="text-right"><%- s.stage_tp.sf_excl_tax_tp %></td>
  79. <% } %>
  80. <% if (colSet.end) { %>
  81. <td class="text-right"><%- s.stage_end_tp.pay_tp %></td>
  82. <td class="text-right"><%- s.stage_end_tp.cut_tp %></td>
  83. <td class="text-right"><%- s.stage_end_tp.yf_tp %></td>
  84. <td class="text-right"><%- s.stage_end_tp.sf_tp %></td>
  85. <% } %>
  86. <% if (colSet.end_excl_tax) { %>
  87. <td class="text-right"><%- s.stage_end_tp.yf_excl_tax_tp %></td>
  88. <td class="text-right"><%- s.stage_end_tp.sf_excl_tax_tp %></td>
  89. <% } %>
  90. <td class="<%- auditConst.info[s.audit_status].class %>">
  91. <% if (s.audit_status === auditConst.status.checked && s.final_auditor_str) { %>
  92. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" stage-order="<%- s.stage_order %>"><%- s.final_auditor_str %></a>
  93. <% } else { %>
  94. <% if (s.curAuditors.length > 0) { %>
  95. <% if (s.curAuditors[0].audit_type === auditType.key.common) { %>
  96. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" stage-order="<%- s.stage_order %>"><%- s.curAuditors[0].name %><%if (s.curAuditors[0].role !== '' && s.curAuditors[0].role !== null) { %>-<%- s.curAuditors[0].role %><% } %></a>
  97. <% } else { %>
  98. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" stage-order="<%- s.stage_order %>"><%- ctx.helper.transFormToChinese(s.curAuditors[0].audit_order) + '审' %></a>
  99. <% } %>
  100. <% } %>
  101. <% } %>
  102. <%- auditConst.info[s.audit_status].title %>
  103. </td>
  104. <td class="text-center">
  105. <% if (s.audit_status === auditConst.status.uncheck && s.create_user_id === ctx.session.sessionUser.accountId) { %>
  106. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/ledger/<%- s.stage_order %>/stage" target="_blank" class="btn <%- auditConst.info[s.audit_status].btnClass %> btn-sm"><%- auditConst.info[s.audit_status].btnTitle %></a>
  107. <% } else if (s.audit_status === auditConst.status.checkNo && s.create_user_id === ctx.session.sessionUser.accountId) { %>
  108. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/ledger/<%- s.stage_order %>/stage" target="_blank" class="btn <%- auditConst.info[s.audit_status].btnClass %> btn-sm"><%- auditConst.info[s.audit_status].btnTitle %></a>
  109. <% } else if ((s.audit_status === auditConst.status.checking || s.audit_status === auditConst.status.checkNoPre) && s.curAuditors && s.curAuditors.findIndex(x => { return x.audit_id === ctx.session.sessionUser.accountId; }) >= 0) { %>
  110. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/ledger/<%- s.stage_order %>/stage" target="_blank" class="btn <%- auditConst.info[s.audit_status].btnClass %> btn-sm"><%- auditConst.info[s.audit_status].btnTitle %></a>
  111. <% } else { %>
  112. <span class="<%- auditConst.info[s.audit_status].class %>"><%- auditConst.info[s.audit_status].title %></span>
  113. <% } %>
  114. </td>
  115. </tr>
  116. <% } %>
  117. </tbody>
  118. </table>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <script>
  124. const stages = JSON.parse('<%- JSON.stringify(stages) %>');
  125. const auditType = JSON.parse('<%- JSON.stringify(auditType) %>');
  126. const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
  127. if ($('[name="tp-col"]').length > 0) $('[name="tp-col"]').attr('width', (1200/$('[name="tp-col"]').length) + 'px')
  128. </script>