Browse Source

管理员,可以查看所有期

MaiXinRong 2 years atrás
parent
commit
cf5b75ad64

+ 1 - 1
app/controller/report_controller.js

@@ -178,7 +178,7 @@ module.exports = app => {
                     if (t.ledger_status === auditConst.ledger.status.checked) {
                         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
                         // if (t.lastStage) {
-                        //     await this.ctx.service.stage.checkStageGatherData(t.lastStage);
+                        //     await this.ctx.service.stage.checkStageGatherData(t.lastStage, this.ctx.session.sessionUser.is_admin);
                         // }
                     }
                 }

+ 3 - 2
app/controller/tender_controller.js

@@ -140,7 +140,7 @@ module.exports = app => {
                             t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
                             t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
                         }
-                        if (t.lastStage) await this.ctx.service.stage.checkStageGatherData(t.lastStage);
+                        if (t.lastStage) await this.ctx.service.stage.checkStageGatherData(t.lastStage, this.ctx.session.sessionUser.is_admin);
                         t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);
                         if ((!bCalcTp) && t.measure_type === measureType.gcl.value) {
                             bCalcTp = t.lastStage && t.lastStage.status !== auditConst.stage.status.checked && !t.lastStage.readOnly;
@@ -400,7 +400,7 @@ module.exports = app => {
                 const stages = await ctx.service.stage.getValidStages(ctx.tender.id);
                 const lastStage = stages.length > 0 ? stages[0] : null; // await ctx.service.stage.getLastestStage(ctx.tender.id);
                 if (lastStage) {
-                    await this.ctx.service.stage.checkStageGatherData(lastStage);
+                    await this.ctx.service.stage.checkStageGatherData(lastStage, this.ctx.session.sessionUser.is_admin);
 
                     if ((!bCalcTp) && tender.measure_type === measureType.gcl.value) {
                         bCalcTp = lastStage.status !== auditConst.stage.status.checked && !lastStage.readOnly;
@@ -552,6 +552,7 @@ module.exports = app => {
                         map_json.lat = mapInfo.lat;
                     }
                 }
+
                 const renderData = {
                     tenders,
                     categoryData,

+ 1 - 1
app/service/report_memory.js

@@ -304,7 +304,7 @@ module.exports = app => {
             const stages = await this.ctx.service.stage.getValidStages(tender.id);
             const lastStage = stages.length > 0 ? stages[0] : null;
             if (lastStage) {
-                await this.ctx.service.stage.checkStageGatherData(lastStage);
+                await this.ctx.service.stage.checkStageGatherData(lastStage, this.ctx.session.sessionUser.is_admin);
                 tender.gather_tp = helper.add(lastStage.contract_tp, lastStage.qc_tp);
                 tender.end_contract_tp = helper.add(lastStage.contract_tp, lastStage.pre_contract_tp);
                 tender.end_qc_tp = helper.add(lastStage.qc_tp, lastStage.pre_qc_tp);

+ 2 - 2
app/service/rpt_gather_memory.js

@@ -564,7 +564,7 @@ module.exports = app => {
             if (stage) {
                 const helper = this.ctx.helper;
                 await this.ctx.service.stage.doCheckStage(stage);
-                await this.ctx.service.stage.checkStageGatherData(stage);
+                await this.ctx.service.stage.checkStageGatherData(stage, this.ctx.session.sessionUser.is_admin);
 
                 info.pre_contract_tp = stage.pre_contract_tp;
                 info.pre_qc_tp = stage.pre_qc_tp;
@@ -592,7 +592,7 @@ module.exports = app => {
             const helper = this.ctx.helper;
             for (const stage of stages) {
                 await this.ctx.service.stage.doCheckStage(stage);
-                await this.ctx.service.stage.checkStageGatherData(stage);
+                await this.ctx.service.stage.checkStageGatherData(stage, this.ctx.session.sessionUser.is_admin);
 
                 info.contract_tp = helper.add(info.contract_tp, stage.contract_tp);
                 info.qc_tp = helper.add(info.qc_tp, stage.qc_tp);

+ 1 - 1
app/service/stage.js

@@ -276,7 +276,7 @@ module.exports = app => {
             // 最新一期计量(未审批完成),当前操作人的期详细数据,应实时计算
             if (stages.length === 0) return stages;
 
-            await this.checkStageGatherData(stages[0]);
+            await this.checkStageGatherData(stages[0], true);
             for (const s of stages) {
                 if (s.yf_tp && s.sf_tp === 0) {
                     const sf = await this.ctx.service.stagePay.getHistorySf(s);