laiguoran před 2 roky
rodič
revize
116906d6e7
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      app/service/stage.js

+ 1 - 1
app/service/stage.js

@@ -767,12 +767,12 @@ module.exports = app => {
                 where: { tid: tenderId },
                 orders: [['order', 'desc']],
             });
-            if (stages.length === 0) return stages;
             if (stages.length > 0 && stages[0].status === auditConst.status.uncheck) {
                 stages.splice(0, 1);
             }
             // 最新一期计量(未审批完成),取上一个人的期详细数据,应实时计算
             const stage = stages[0];
+            if (stages.length === 0) return stages;
             await this.checkStageGatherDataByDataCollect(stage);
             for (const s of stages) {
                 s.tp = this.ctx.helper.sum([s.contract_tp, s.qc_tp, s.pc_tp]);