ledger_list.ejs 6.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. <% if (ctx.permission.cost.ledger_add && (stages.length === 0 || stages[0].audit_status === auditConst.status.checked)) { %>
  10. <div class="ml-auto">
  11. <a href="#add-qi" data-toggle="modal" data-target="#add-qi" class="btn btn-primary btn-sm">新建报审</a>
  12. </div>
  13. <% } %>
  14. </div>
  15. </div>
  16. <div class="content-wrap">
  17. <div class="c-body">
  18. <div class="sjs-height-0">
  19. <table class="table table-bordered table-hover">
  20. <thead>
  21. <tr class="text-center">
  22. <th width="80px" rowspan="2">期数</th>
  23. <th width="70px" rowspan="2">报审月份</th>
  24. <th colspan="4">本期金额</th>
  25. <th colspan="4">截止本期金额</th>
  26. <th rowspan="2">审批进度</th>
  27. <th width="100px" rowspan="2">操作</th>
  28. </tr>
  29. <tr class="text-center">
  30. <th width="150px">付款</th>
  31. <th width="150px">扣款</th>
  32. <th width="150px">应付</th>
  33. <th width="150px">实付</th>
  34. <th width="150px">付款</th>
  35. <th width="150px">扣款</th>
  36. <th width="150px">应付</th>
  37. <th width="150px">实付</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <% for (const s of stages) { %>
  42. <tr>
  43. <td>
  44. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/ledger/<%- s.stage_order %>/stage" target="_blank">第 <%- s.stage_order %> 期</a>
  45. </td>
  46. <td class="text-center"><%- s.stage_date %></td>
  47. <td class="text-right"><%- s.stage_tp.pay_tp %></td>
  48. <td class="text-right"><%- s.stage_tp.cut_tp %></td>
  49. <td class="text-right"><%- s.stage_tp.yf_tp %></td>
  50. <td class="text-right"><%- s.stage_tp.sf_tp %></td>
  51. <td class="text-right"><%- s.stage_end_tp.pay_tp %></td>
  52. <td class="text-right"><%- s.stage_end_tp.cut_tp %></td>
  53. <td class="text-right"><%- s.stage_end_tp.yf_tp %></td>
  54. <td class="text-right"><%- s.stage_end_tp.sf_tp %></td>
  55. <td class="<%- auditConst.info[s.audit_status].class %>">
  56. <% if (s.audit_status === auditConst.status.checked && s.final_auditor_str) { %>
  57. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" stage-order="<%- s.stage_order %>"><%- s.final_auditor_str %></a>
  58. <% } else { %>
  59. <% if (s.curAuditors.length > 0) { %>
  60. <% if (s.curAuditors[0].audit_type === auditType.key.common) { %>
  61. <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>
  62. <% } else { %>
  63. <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>
  64. <% } %>
  65. <% } %>
  66. <% } %>
  67. <%- auditConst.info[s.audit_status].title %>
  68. </td>
  69. <td class="text-center">
  70. <% if (s.audit_status === auditConst.status.uncheck && s.create_user_id === ctx.session.sessionUser.accountId) { %>
  71. <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>
  72. <% } else if (s.audit_status === auditConst.status.checkNo && s.create_user_id === ctx.session.sessionUser.accountId) { %>
  73. <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>
  74. <% } 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) { %>
  75. <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>
  76. <% } else { %>
  77. <span class="<%- auditConst.info[s.audit_status].class %>"><%- auditConst.info[s.audit_status].title %></span>
  78. <% } %>
  79. </td>
  80. </tr>
  81. <% } %>
  82. </tbody>
  83. </table>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <script>
  89. const stages = JSON.parse('<%- JSON.stringify(stages) %>');
  90. const auditType = JSON.parse('<%- JSON.stringify(auditType) %>');
  91. const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
  92. </script>