|
@@ -1719,7 +1719,15 @@ module.exports = app => {
|
|
|
const changes = await ctx.service.changeProject.getListByStatus(tender.id, status, 1, sorts, orders);
|
|
|
const total = await ctx.service.changeProject.getCountByStatus(tender.id, status);
|
|
|
for (const c of changes) {
|
|
|
- c.curAuditors = await ctx.service.changeProjectAudit.getAuditorsByStatus(c.id, c.status, c.times);
|
|
|
+ if (c.status !== audit.change.status.checked || !c.final_auditor_str) {
|
|
|
+ c.curAuditors = await ctx.service.changeProjectAudit.getAuditorsByStatus(c.id, c.status, c.times);
|
|
|
+ if (c.status === audit.change.status.checked && c.curAuditors.length > 0) {
|
|
|
+ const final_auditor_str = c.curAuditors[0].audit_type === auditType.key.common
|
|
|
+ ? c.curAuditors[0].name + (c.curAuditors[0].role ? '-' + c.curAuditors[0].role : '')
|
|
|
+ : ctx.helper.transFormToChinese(c.curAuditors[0].audit_order) + '审';
|
|
|
+ await ctx.service.changeProject.defaultUpdate({ final_auditor_str }, { where: { id: c.id } });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
const accountInfo = await this.ctx.service.projectAccount.getDataById(this.ctx.session.sessionUser.accountId);
|
|
|
const userPermission = accountInfo !== undefined && accountInfo.permission !== ''
|
|
@@ -2548,7 +2556,15 @@ module.exports = app => {
|
|
|
let page_total = 0;
|
|
|
const tp = await ctx.service.changeApply.getTp(tender.id, status);
|
|
|
for (const c of changes) {
|
|
|
- c.curAuditors = await ctx.service.changeApplyAudit.getAuditorsByStatus(c.id, c.status, c.times);
|
|
|
+ if (c.status !== audit.change.status.checked || !c.final_auditor_str) {
|
|
|
+ c.curAuditors = await ctx.service.changeApplyAudit.getAuditorsByStatus(c.id, c.status, c.times);
|
|
|
+ if (c.status === audit.change.status.checked && c.curAuditors.length > 0) {
|
|
|
+ const final_auditor_str = c.curAuditors[0].audit_type === auditType.key.common
|
|
|
+ ? c.curAuditors[0].name + (c.curAuditors[0].role ? '-' + c.curAuditors[0].role : '')
|
|
|
+ : ctx.helper.transFormToChinese(c.curAuditors[0].audit_order) + '审';
|
|
|
+ await ctx.service.changeApply.defaultUpdate({ final_auditor_str }, { where: { id: c.id } });
|
|
|
+ }
|
|
|
+ }
|
|
|
page_total = ctx.helper.add(page_total, c.total_price);
|
|
|
}
|
|
|
const tender_userInfo = await ctx.service.projectAccount.getDataById(ctx.tender.data.user_id);
|
|
@@ -3378,10 +3394,18 @@ module.exports = app => {
|
|
|
let page_total = 0;
|
|
|
const tp = await ctx.service.changePlan.getTp(tender.id, status);
|
|
|
for (const c of changes) {
|
|
|
- c.curAuditors = await ctx.service.changePlanAudit.getAuditorsByStatus(c.id, c.status, c.times);
|
|
|
- // if (c.status === audit.changePlan.status.checkNoPre) {
|
|
|
- // c.curAuditors2 = await ctx.service.changePlanAudit.getAuditorsByStatus(c.id, audit.changePlan.status.checking, c.times);
|
|
|
- // }
|
|
|
+ if (c.status !== audit.change.status.checked || !c.final_auditor_str) {
|
|
|
+ c.curAuditors = await ctx.service.changePlanAudit.getAuditorsByStatus(c.id, c.status, c.times);
|
|
|
+ // if (c.status === audit.changePlan.status.checkNoPre) {
|
|
|
+ // c.curAuditors2 = await ctx.service.changePlanAudit.getAuditorsByStatus(c.id, audit.changePlan.status.checking, c.times);
|
|
|
+ // }
|
|
|
+ if (c.status === audit.change.status.checked && c.curAuditors.length > 0) {
|
|
|
+ const final_auditor_str = c.curAuditors[0].audit_type === auditType.key.common
|
|
|
+ ? c.curAuditors[0].name + (c.curAuditors[0].role ? '-' + c.curAuditors[0].role : '')
|
|
|
+ : ctx.helper.transFormToChinese(c.curAuditors[0].audit_order) + '审';
|
|
|
+ await ctx.service.changePlan.defaultUpdate({ final_auditor_str }, { where: { id: c.id } });
|
|
|
+ }
|
|
|
+ }
|
|
|
page_total = ctx.helper.add(page_total, c.total_price);
|
|
|
}
|
|
|
const tender_userInfo = await ctx.service.projectAccount.getDataById(ctx.tender.data.user_id);
|