list.ejs 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <div class="panel-content">
  2. <div class="panel-title fluid">
  3. <div class="title-main d-flex justify-content-between">
  4. <div>
  5. <a class="mr-2" href="/sp/<%- ctx.subProject.id %>/payment"><i class="fa fa-chevron-left"></i> 返回</a><%- ctx.paymentTender.name %>
  6. </div>
  7. <div>
  8. <a href="#bd-attr" data-toggle="modal" data-target="#bd-attr" class="btn btn-sm btn-outline-primary pull-right ml-2">标段属性</a>
  9. </div>
  10. <div>
  11. <% if (ctx.session.sessionUser.accountId === trInfo.uid && trInfo.is_del === 0 && (rptMsg || trInfo.type === paymentConst.modes_value_object.safe)) { %>
  12. <% if (trDetailList.length === 0 || (trDetailList.length !== 0 && trDetailList[0].status === auditConst.status.checked)) { %>
  13. <a href="javascript:void(0);" id="show-add-btn" class="btn btn-sm btn-primary pull-right ml-2">新建审批</a>
  14. <% } %>
  15. <% if ((trDetailList.length === 0 || trDetailList[0].status === auditConst.status.checked || trDetailList[0].status === auditConst.status.uncheck || trDetailList[0].status === auditConst.status.checkNo) && trInfo.type !== paymentConst.modes_value_object.safe) { %>
  16. <a href="#set-bdjs" data-toggle="modal" data-target="#set-bdjs" class="btn btn-sm btn-primary pull-right">绑定表单角色</a>
  17. <span class="text-danger pull-right" id="first_msg" <% if (trInfo.is_first === 0) { %>style="display:none;" <% } %>>第一次新建审批,请点击右侧的“绑定表单角色” &nbsp; &nbsp; </span>
  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. <div class="row m-0 my-3">
  27. <div class="col-3">
  28. <div class="list-group">
  29. <% for (const tr of tenderRptList) { %>
  30. <a href="/sp/<%- ctx.subProject.id %>/payment/<%- ctx.paymentTender.id %>/list/<%- tr.id %>"
  31. class="list-group-item list-group-item-action <% if (trInfo.id === tr.id) { %>active<% } %>">
  32. <%- tr.rpt_name %><% if (tr.have_notice) { %><i class="fa fa-bell text-warning float-right mt-1" data-toggle="tooltip" data-placement="bottom" title="待处理提醒"></i><% } %>
  33. </a>
  34. <% } %>
  35. </div>
  36. </div>
  37. <div class="col-9">
  38. <div class="tab-content" id="v-pills-tabContent">
  39. <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
  40. <table class="table table-bordered">
  41. <thead>
  42. <tr>
  43. <th class="text-center">期数</th>
  44. <th class="text-center">编号</th>
  45. <th class="text-center">上报人</th>
  46. <th class="text-center">创建时间</th>
  47. <th class="text-center">审批进度</th>
  48. <th class="text-center">操作</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <% for (const info of trDetailList) { %>
  53. <tr>
  54. <td class="text-center">第<%- info.order %>期</td>
  55. <% if (info.type) { %>
  56. <td class="text-center"><a href="/sp/<%- ctx.subProject.id %>/payment/<%- info.tender_id %>/safe/<%- info.id %>/bills"><%- info.code %></a></td>
  57. <% } else { %>
  58. <td class="text-center"><a href="/sp/<%- ctx.subProject.id %>/payment/<%- info.tender_id %>/detail/<%- info.id %>"><%- info.code %></a></td>
  59. <% } %>
  60. <td class="text-center"><%- info.user_name %></td>
  61. <td class="text-center"><%- info.s_time %></td>
  62. <td class="<%- auditConst.auditProgressClass[info.status] %>">
  63. <% if (info.curAuditor) { %>
  64. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" m-order="<%- info.order %>"><%- info.curAuditor.name %><%if (info.curAuditor.role !== '' && info.curAuditor.role !== null) { %>-<%- info.curAuditor.role %><% } %></a>
  65. <% } %>
  66. <%- auditConst.auditProgress[info.status] %>
  67. </td>
  68. <td class="text-center">
  69. <% if (info.status === auditConst.status.uncheck && info.uid === ctx.session.sessionUser.accountId) { %>
  70. <% if (info.type) { %>
  71. <a href="<%- '/sp/' + ctx.subProject.id + '/payment/' + ctx.paymentTender.id + '/safe/' + info.id + '/bills' %>" class="btn <%- auditConst.statusButtonClass[info.status] %> btn-sm"><%- auditConst.statusButton[info.status] %></a>
  72. <% } else { %>
  73. <a href="<%- '/sp/' + ctx.subProject.id + '/payment/' + ctx.paymentTender.id + '/detail/' + info.id %>" class="btn <%- auditConst.statusButtonClass[info.status] %> btn-sm"><%- auditConst.statusButton[info.status] %></a>
  74. <% } %>
  75. <% } else if (info.status === auditConst.status.checkNo && info.curAuditor && info.uid === ctx.session.sessionUser.accountId) { %>
  76. <% if (info.type) { %>
  77. <a href="<%- '/sp/' + ctx.subProject.id + '/payment/' + ctx.paymentTender.id + '/safe/' + info.id + '/bills' %>" class="btn <%- auditConst.statusButtonClass[info.status] %> btn-sm"><%- auditConst.statusButton[info.status] %></a>
  78. <% } else { %>
  79. <a href="<%- '/sp/' + ctx.subProject.id + '/payment/' + ctx.paymentTender.id + '/detail/' + info.id %>" class="btn <%- auditConst.statusButtonClass[info.status] %> btn-sm"><%- auditConst.statusButton[info.status] %></a>
  80. <% } %>
  81. <% } else if (info.status === auditConst.status.checking && info.curAuditor && info.curAuditor.aid === ctx.session.sessionUser.accountId) { %>
  82. <% if (info.type) { %>
  83. <a href="<%- '/sp/' + ctx.subProject.id + '/payment/' + ctx.paymentTender.id + '/safe/' + info.id + '/bills' %>" class="btn <%- auditConst.statusButtonClass[info.status] %> btn-sm"><%- auditConst.statusButton[info.status] %></a>
  84. <% } else { %>
  85. <a href="<%- '/sp/' + ctx.subProject.id + '/payment/' + ctx.paymentTender.id + '/detail/' + info.id %>" class="btn <%- auditConst.statusButtonClass[info.status] %> btn-sm"><%- auditConst.statusButton[info.status] %></a>
  86. <% } %>
  87. <% } else { %>
  88. <span class="<%- auditConst.auditProgressClass[info.status] %>"><%- auditConst.auditProgress[info.status] %></span>
  89. <% } %>
  90. <% if ((ctx.session.sessionUser.is_admin || ((info.status === auditConst.status.uncheck || info.status === auditConst.status.checkNo) && info.uid === ctx.session.sessionUser.accountId)) && info.order === trDetailList.length) { %>
  91. <a href="#del-qi" class="btn btn-outline-danger btn-sm ml-1" data-toggle="modal" data-target="#del-qi">删除</a>
  92. <% } %>
  93. </td>
  94. </tr>
  95. <% } %>
  96. </tbody>
  97. </table>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <script>
  107. const tenderId = parseInt('<%- ctx.paymentTender.id %>');
  108. const trId = parseInt('<%- trInfo.id %>');
  109. const rptMsg = JSON.parse(unescape('<%- escape(JSON.stringify(rptMsg)) %>'));
  110. console.log(rptMsg);
  111. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  112. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  113. const auditConst = JSON.parse(unescape('<%- escape(JSON.stringify(auditConst)) %>'));
  114. let rpt_audit = JSON.parse(unescape('<%- escape(JSON.stringify(trInfo.rpt_audit)) %>'));
  115. let old_rpt_audit = _.cloneDeep(rpt_audit);
  116. const is_first = parseInt('<%- trInfo.is_first %>');
  117. const emptySign = <%- trDetailList && trDetailList[0] ? trDetailList[0].emptySign : false %>
  118. console.log(rpt_audit);
  119. </script>