analysis_list.ejs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.analysis_add && (stages.length === 0 || stages[0].audit_status === auditConst.status.checked) && validRelaStages.length > 0) { %>
  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">期数</th>
  23. <th width="70px">报审月份</th>
  24. <th width="70px">关联成本</th>
  25. <th width="70px">创建人</th>
  26. <th width="200px">项目收入</th>
  27. <th width="200px">项目支出</th>
  28. <th width="200px">利润</th>
  29. <th width="200px">利润率</th>
  30. <th>审批进度</th>
  31. <th width="100px">操作</th>
  32. </tr>
  33. </thead>
  34. <tbody>
  35. <% for (const s of stages) { %>
  36. <tr>
  37. <td>
  38. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/analysis/<%- s.stage_order %>/stage" target="_blank">第 <%- s.stage_order %> 期</a>
  39. </td>
  40. <td class="text-center"><%- s.stage_date %></td>
  41. <td class="text-center">第<%- s.rela_stage.sorder %>期</td>
  42. <td class="text-center"><%- s.user_name %></td>
  43. <td class="text-right"><%- s.stage_tp.in_tp %></td>
  44. <td class="text-right"><%- s.stage_tp.out_tp %></td>
  45. <td class="text-right"><%- s.stage_tp.profit %></td>
  46. <td class="text-right"><%- s.stage_tp.profit_percent %></td>
  47. <td class="<%- auditConst.info[s.audit_status].class %>">
  48. <% if (s.audit_status === auditConst.status.checked && s.final_auditor_str) { %>
  49. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" stage-order="<%- s.stage_order %>"><%- s.final_auditor_str %></a>
  50. <% } else { %>
  51. <% if (s.curAuditors.length > 0) { %>
  52. <% if (s.curAuditors[0].audit_type === auditType.key.common) { %>
  53. <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>
  54. <% } else { %>
  55. <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>
  56. <% } %>
  57. <% } %>
  58. <% } %>
  59. <%- auditConst.info[s.audit_status].title %>
  60. </td>
  61. <td class="text-center">
  62. <% if (s.audit_status === auditConst.status.uncheck && s.create_user_id === ctx.session.sessionUser.accountId) { %>
  63. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/analysis/<%- s.stage_order %>/stage" target="_blank" class="btn <%- auditConst.info[s.audit_status].btnClass %> btn-sm"><%- auditConst.info[s.audit_status].btnTitle %></a>
  64. <% } else if (s.audit_status === auditConst.status.checkNo && s.create_user_id === ctx.session.sessionUser.accountId) { %>
  65. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/analysis/<%- s.stage_order %>/stage" target="_blank" class="btn <%- auditConst.info[s.audit_status].btnClass %> btn-sm"><%- auditConst.info[s.audit_status].btnTitle %></a>
  66. <% } 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) { %>
  67. <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/analysis/<%- s.stage_order %>/stage" target="_blank" class="btn <%- auditConst.info[s.audit_status].btnClass %> btn-sm"><%- auditConst.info[s.audit_status].btnTitle %></a>
  68. <% } else { %>
  69. <span class="<%- auditConst.info[s.audit_status].class %>"><%- auditConst.info[s.audit_status].title %></span>
  70. <% } %>
  71. </td>
  72. </tr>
  73. <% } %>
  74. </tbody>
  75. </table>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <script>
  81. const stages = JSON.parse('<%- JSON.stringify(stages) %>');
  82. const auditType = JSON.parse('<%- JSON.stringify(auditType) %>');
  83. const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
  84. </script>