|
@@ -47,24 +47,30 @@ module.exports = options => {
|
|
change.sp_group = group ? group.id : 0;
|
|
change.sp_group = group ? group.id : 0;
|
|
yield this.service.changeProject.defaultUpdate({ id: change.id, sp_group: change.sp_group });
|
|
yield this.service.changeProject.defaultUpdate({ id: change.id, sp_group: change.sp_group });
|
|
}
|
|
}
|
|
- const condition = { tid: this.tender.id, sp_type: shenpiConst.sp_type.change, sp_status: shenpi_status, sp_group: change.sp_group };
|
|
|
|
- const shenpiList = yield this.service.shenpiAudit.getAllDataByCondition({ where: condition, orders: [['audit_order', 'asc']] });
|
|
|
|
- yield this.service.shenpiAudit.noYbShenpiList(change.uid, shenpiList);
|
|
|
|
- // 判断2个id数组是否相同,不同则删除原审批流,切换成固定的审批流
|
|
|
|
- let sameAudit = auditList.length === shenpiList.length;
|
|
|
|
- if (sameAudit) {
|
|
|
|
- for (const audit of auditList) {
|
|
|
|
- const shenpi = shenpiList.find(x => { return x.audit_id === audit.aid; });
|
|
|
|
- if (!shenpi || shenpi.audit_order !== audit.audit_order || shenpi.audit_type !== audit.audit_type) {
|
|
|
|
- sameAudit = false;
|
|
|
|
- break;
|
|
|
|
|
|
+ if (change.sp_group === 0) {
|
|
|
|
+ this.tender.info.shenpi.change = shenpiConst.sp_status.sqspr;
|
|
|
|
+ } else {
|
|
|
|
+ const condition = { tid: this.tender.id, sp_type: shenpiConst.sp_type.change, sp_status: shenpi_status, sp_group: change.sp_group };
|
|
|
|
+ const shenpiList = yield this.service.shenpiAudit.getAllDataByCondition({ where: condition, orders: [['audit_order', 'asc']] });
|
|
|
|
+ yield this.service.shenpiAudit.noYbShenpiList(change.uid, shenpiList);
|
|
|
|
+ // 判断2个id数组是否相同,不同则删除原审批流,切换成固定的审批流
|
|
|
|
+ let sameAudit = auditList.length === shenpiList.length;
|
|
|
|
+ if (sameAudit) {
|
|
|
|
+ for (const audit of auditList) {
|
|
|
|
+ const shenpi = shenpiList.find(x => {
|
|
|
|
+ return x.audit_id === audit.aid;
|
|
|
|
+ });
|
|
|
|
+ if (!shenpi || shenpi.audit_order !== audit.audit_order || shenpi.audit_type !== audit.audit_type) {
|
|
|
|
+ sameAudit = false;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (!sameAudit) {
|
|
|
|
- yield this.service.changeProjectAudit.updateNewAuditList(change, shenpiList);
|
|
|
|
- yield this.service.changeProject.loadChangeUser(change);
|
|
|
|
- yield this.service.changeProject.doCheckChangeCanCancel(change);
|
|
|
|
|
|
+ if (!sameAudit) {
|
|
|
|
+ yield this.service.changeProjectAudit.updateNewAuditList(change, shenpiList);
|
|
|
|
+ yield this.service.changeProject.loadChangeUser(change);
|
|
|
|
+ yield this.service.changeProject.doCheckChangeCanCancel(change);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else if (shenpi_status === shenpiConst.sp_status.gdzs) {
|
|
} else if (shenpi_status === shenpiConst.sp_status.gdzs) {
|
|
const shenpiInfo = yield this.service.shenpiAudit.getDataByCondition({ tid: this.tender.id, sp_type: shenpiConst.sp_type.change, sp_status: shenpi_status });
|
|
const shenpiInfo = yield this.service.shenpiAudit.getDataByCondition({ tid: this.tender.id, sp_type: shenpiConst.sp_type.change, sp_status: shenpi_status });
|