list.ejs 9.2 KB

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