소스 검색

审核比较,审批退回原报,未重新上报时,页面数据调整

MaiXinRong 4 년 전
부모
커밋
30a7c18300
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 3
      app/controller/stage_controller.js

+ 7 - 3
app/controller/stage_controller.js

@@ -1195,7 +1195,9 @@ module.exports = app => {
             try {
                 await this._getStageAuditViewData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
-                if (ctx.stage.times !== ctx.stage.curTimes) {
+                if (ctx.stage.status === auditConst.status.checkNo && !ctx.stage.readOnly) {
+                    renderData.compareAuditors = ctx.stage.auditHistory[ctx.stage.curTimes - 2];
+                } else if (ctx.stage.times !== ctx.stage.curTimes) {
                     renderData.compareAuditors = ctx.stage.auditHistory[ctx.stage.curTimes - 1];
                 } else {
                     renderData.compareAuditors = ctx.stage.auditors;
@@ -1224,8 +1226,10 @@ module.exports = app => {
                 }
                 for (const order of data.roles) {
                     const data = { order, bills: [], pos: [] };
-                    data.bills = await ctx.service.stageBills.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, order);
-                    data.pos = await ctx.service.stagePos.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, order);
+                    const compareTimes = ctx.stage.status === auditConst.status.checkNo && !ctx.stage.readOnly
+                        ? ctx.stage.curTimes - 1 : ctx.stage.curTimes;
+                    data.bills = await ctx.service.stageBills.getAuditorStageData(ctx.tender.id, ctx.stage.id, compareTimes, order);
+                    data.pos = await ctx.service.stagePos.getAuditorStageData(ctx.tender.id, ctx.stage.id, compareTimes, order);
                     result.roles.push(data);
                 }
                 ctx.body = { err: 0, msg: '', data: result };