MaiXinRong 1 tahun lalu
induk
melakukan
6ea7c8dc93
2 mengubah file dengan 10 tambahan dan 5 penghapusan
  1. 3 2
      app/controller/wap_controller.js
  2. 7 3
      app/view/wap/tender.ejs

+ 3 - 2
app/controller/wap_controller.js

@@ -315,14 +315,15 @@ module.exports = app => {
                     tpUnit: ctx.tender.info.decimal.tp,
                     monthProgress,
                     stagesEcharts: JSON.parse(JSON.stringify(stages)).reverse(),
+                    auditType: auditConst.auditType,
                 };
                 if (stages.length > 0) {
                     for (const s of stages) {
                         // s.curAuditor = null;
                         // 根据期状态返回展示用户
-                        s.curAuditor = await ctx.service.stageAudit.getAuditorByStatus(s.id, s.status, s.times);
+                        s.curAuditors = await ctx.service.stageAudit.getAuditorsByStatus(s.id, s.status, s.times);
                         if (s.status === auditConst.stage.status.checkNoPre) {
-                            s.curAuditor2 = await ctx.service.stageAudit.getAuditorByStatus(s.id, auditConst.stage.status.checking);
+                            s.curAuditors2 = await ctx.service.stageAudit.getAuditorsByStatus(s.id, auditConst.stage.status.checking);
                         }
                     }
                     renderData.stage = stages[0];

+ 7 - 3
app/view/wap/tender.ejs

@@ -141,8 +141,12 @@
                     <% for (const s of stages) { %>
                     <dt class="bg-light p-2 d-flex justify-content-between"><span>第<%- s.order %>期</span>
                         <span class="<%- auditConst.auditStringClass[s.status] %>">
-                            <% if (s.curAuditor && s.status !== auditConst.status.checked) { %>
-                                <%- s.curAuditor.name %><%if (s.curAuditor.role !== '' && s.curAuditor.role !== null) { %>-<%- s.curAuditor.role %><% } %>
+                            <% if (s.curAuditors.length > 0 && s.status !== auditConst.status.checked) { %>
+                                <% if (s.curAuditors[0].audit_type === auditType.key.common) { %>
+                                <%- s.curAuditors[0].name %><%if (s.curAuditors[0].role !== '' && s.curAuditors[0].role !== null) { %>-<%- s.curAuditors[0].role %><% } %>
+                                <% } else { %>
+                                <%- ctx.helper.transFormToChinese(s.curAuditors[0].audit_order) + '审' %>
+                                <% } %>
                             <% } %>
                                 <%- s.status === auditConst.status.checked ? '审批完成' : auditConst.auditProgress[s.status] %>
                         </span>
@@ -191,7 +195,7 @@
                                 </td>
                             </tr>
                             <% } %>
-                            <% if (s.curAuditor && s.status == auditConst.status.checking && s.curAuditor.aid === ctx.session.sessionUser.accountId) { %>
+                            <% if (s.curAuditors.length > 0 && s.status == auditConst.status.checking && s.curAuditors.find(x => { return x.aid === ctx.session.sessionUser.accountId})) { %>
                             <tr>
                                 <td colspan="2">
                                     <a class="btn btn-block btn-success" href="/wap/tender/<%- s.tid %>/measure/stage/<%- s.order %>">审批本期</a>