Pārlūkot izejas kodu

汇总表相关

MaiXinRong 10 mēneši atpakaļ
vecāks
revīzija
2b4e1e340f
1 mainītis faili ar 13 papildinājumiem un 8 dzēšanām
  1. 13 8
      app/service/rpt_gather_memory.js

+ 13 - 8
app/service/rpt_gather_memory.js

@@ -1383,7 +1383,7 @@ module.exports = app => {
             const helper = this.ctx.helper;
 
             if (preStage) {
-                const preStageChange = await this.ctx.service.stageChangeFinal.getEndStageData(stage.tid, preStage.order);
+                const preStageChange = await this.ctx.service.stageChangeFinal.getEndStageData(preStage.tid, preStage.order);
                 if (gatherType === 'flow') {
                     result.push(...preStageChange);
                 } else {
@@ -1415,9 +1415,11 @@ module.exports = app => {
             result.forEach(r => { r.end_qty = helper.add(r.pre_qty, r.qty); });
             return result;
         }
-        async _gatherCustomZoneStageChange(sTender, completeData, timeType, gatherType) {
+        async _gatherCustomZoneStageChange(sTender, completeData, zone, timeType, gatherType) {
+            const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
             const [stages, preStage, endStage] = await this._getCustomZoneStages(tender, zone, timeType);
-            await this._gatherStagesChange(completeData, tender, stages, preStage, gatherType);
+            const result = await this._gatherStagesChange(completeData, tender, stages, preStage, gatherType);
+            this.resultStageChange.push(...result);
         }
         async _gatherStageChange(completeData, tender, stage, hasPre, gatherType = 'flow'){
             if (!stage) return [];
@@ -1452,29 +1454,32 @@ module.exports = app => {
             const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
             const stages = await this._getValidStages(tender.id);
             const stage = this.ctx.helper._.find(stages, {s_time: month});
-            await this._gatherStageChange(completeData, tender, stage, hasPre, gatherType);
+            const result = await this._gatherStageChange(completeData, tender, stage, hasPre, gatherType);
+            this.resultStageChange.push(...result);
         }
         async _gatherOrderStageChange(sTender, completeData, order, hasPre, gatherType) {
             const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
             const stages = await this._getValidStages(tender.id);
             const stage = this.ctx.helper._.find(stages, {order: order});
-            await this._gatherStageChange(completeData, tender, stage, hasPre, gatherType);
+            const result = await this._gatherStageChange(completeData, tender, stage, hasPre, gatherType);
+            this.resultStageChange.push(...result);
         }
         async _gatherFinalStageChange(sTender, completeData, hasPre, gatherType) {
             const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
             const stages = await this._getValidStages(tender.id);
-            await this._gatherStageChange(completeData, tender, stages[0], hasPre, gatherType);
+            const result = await this._gatherStageChange(completeData, tender, stages[0], hasPre, gatherType);
+            this.resultStageChange.push(...result);
         }
         async _gatherCheckedFinalStageChange(sTender, completeData, hasPre, gatherType) {
             const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
             const stages = await this._getCheckedStages(tender.id);
-            await this._gatherStageChange(completeData, tender, stages[0], hasPre, gatherType);
+            const result = await this._gatherStageChange(completeData, tender, stages[0], hasPre, gatherType);
+            this.resultStageChange.push(...result);
         }
         async getGatherStageChange(memFieldKeys, gsDefine, gsCustom) {
             if (!gsDefine || !gsDefine.enable) return [];
             if (!gsCustom || !gsCustom.tenders || gsCustom.tenders.length === 0) return [];
             const gsSetting = JSON.parse(gsDefine.setting);
-            if (gsSetting.type !== 'stage') return [];
 
             this.resultStageChange = [];
             let commonIndex = 0;