瀏覽代碼

多期计量决策大屏调整

ellisran 1 年之前
父節點
當前提交
1196885825
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7 4
      app/service/stage.js

+ 7 - 4
app/service/stage.js

@@ -921,14 +921,17 @@ module.exports = app => {
         }
 
         async getStageByDataCollect(tenderId, stage_tp) {
-            const stages = await this.db.select(this.tableName, {
+            const allStages = await this.db.select(this.tableName, {
                 columns: ['id', 'user_id', 'times', 'status', 's_time', 'contract_tp', 'qc_tp', 'pc_tp', 'pre_contract_tp', 'pre_qc_tp', 'tp_history'],
                 where: { tid: tenderId },
                 orders: [['order', 'desc']],
             });
-            if (stages.length > 0 && stages[0].status === auditConst.stage.status.uncheck) {
-                stages.splice(0, 1);
-            }
+            const stages = this._.filter(allStages, function(s) {
+                return s.status !== auditConst.stage.status.uncheck;
+            });
+            // if (stages.length > 0 && stages[0].status === auditConst.stage.status.uncheck) {
+            //     stages.splice(0, 1);
+            // }
             // 最新一期计量(未审批完成),取上一个人的期详细数据,应实时计算
             const stage = stages[0];
             if (stages.length === 0) return stages;