|
@@ -49,10 +49,18 @@ module.exports = app => {
|
|
|
};
|
|
|
renderData.stages = await ctx.service.stage.getValidStages(ctx.tender.id, this.ctx.session.sessionUser.is_admin);
|
|
|
for (const s of renderData.stages) {
|
|
|
- // 根据期状态返回展示用户
|
|
|
- s.curAuditors = await ctx.service.stageAudit.getAuditorsByStatus(s.id, s.status, s.times);
|
|
|
- if (s.status === auditConst.status.checkNoPre) {
|
|
|
- s.curAuditors2 = await ctx.service.stageAudit.getAuditorsByStatus(s.id, auditConst.status.checking, s.times);
|
|
|
+ if (!s.final_auditor_str || s.status !== auditConst.status.checked) {
|
|
|
+ // 根据期状态返回展示用户
|
|
|
+ s.curAuditors = await ctx.service.stageAudit.getAuditorsByStatus(s.id, s.status, s.times);
|
|
|
+ if (s.status === auditConst.status.checkNoPre) {
|
|
|
+ s.curAuditors2 = await ctx.service.stageAudit.getAuditorsByStatus(s.id, auditConst.status.checking, s.times);
|
|
|
+ }
|
|
|
+ if (s.status === auditConst.status.checked) {
|
|
|
+ const final_auditor_str = (s.curAuditors[0].audit_type === auditType.key.common)
|
|
|
+ ? `${s.curAuditors[0].name}${(s.curAuditors[0].role ? '-' + s.curAuditors[0].role : '')}`
|
|
|
+ : ctx.helper.transFormToChinese(s.curAuditors[0].audit_order) + '审';
|
|
|
+ await ctx.service.stage.defaultUpdate({ id: s.id, final_auditor_str});
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
renderData.unCompleteStageCount = renderData.stages.filter(s => { return s.status !== auditConst.status.checked; }).length;
|