Browse Source

修复bug

ellisran 13 hours ago
parent
commit
6b1892690e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      app/controller/cost_controller.js

+ 4 - 4
app/controller/cost_controller.js

@@ -706,9 +706,9 @@ module.exports = app => {
 
 
                 const auditorInfo = await this.ctx.service.projectAccount.getDataById(id);
                 const auditorInfo = await this.ctx.service.projectAccount.getDataById(id);
                 if (!auditorInfo) throw '添加的审批人不存在';
                 if (!auditorInfo) throw '添加的审批人不存在';
-
-                const shenpiInfo = await ctx.service.shenpiAudit.getDataByCondition({ tid: ctx.tender.id, sp_type: shenpiConst.sp_type.safe_payment, sp_status: shenpiConst.sp_status.gdzs });
-                const is_gdzs = shenpiInfo && ctx.tender.info.shenpi.safe_payment === shenpiConst.sp_status.gdzs ? 1 : 0;
+                const typeInfo = ctx.service.costStage.stageType[ctx.costStage.stage_type];
+                const shenpiInfo = await ctx.service.shenpiAudit.getDataByCondition({ tid: ctx.costStage.tid, sp_type: shenpiConst.cost_sp_type[typeInfo.shenpi_status], sp_status: shenpiConst.sp_status.gdzs });
+                const is_gdzs = shenpiInfo && ctx.tender.info.shenpi[typeInfo.shenpi_status] === shenpiConst.sp_status.gdzs ? 1 : 0;
                 const result = await ctx.service.costStageAudit.addAuditor(ctx.costStage.id, auditorInfo, ctx.costStage.audit_times, is_gdzs);
                 const result = await ctx.service.costStageAudit.addAuditor(ctx.costStage.id, auditorInfo, ctx.costStage.audit_times, is_gdzs);
                 if (!result) throw '添加审核人失败';
                 if (!result) throw '添加审核人失败';
 
 
@@ -834,4 +834,4 @@ module.exports = app => {
     }
     }
 
 
     return CostController;
     return CostController;
-};
+};