|
@@ -191,17 +191,12 @@ module.exports = app => {
|
|
|
const userInfo = await this.ctx.service.projectAccount.getDataById(userId);
|
|
|
const changeaudit = [
|
|
|
{
|
|
|
- tid: tenderId,
|
|
|
- cid,
|
|
|
- uid: userId,
|
|
|
- name: userInfo.name,
|
|
|
- jobs: userInfo.role,
|
|
|
- company: userInfo.company,
|
|
|
- times: 1,
|
|
|
- usite: 0,
|
|
|
- usort: 0,
|
|
|
+ tid: tenderId, cid, uid: userId,
|
|
|
+ name: userInfo.name, jobs: userInfo.role, company: userInfo.company,
|
|
|
+ times: 1, usite: 0, usort: 0,
|
|
|
begin_time: new Date(),
|
|
|
- status: 2,
|
|
|
+ status: audit.change.status.checking,
|
|
|
+ audit_type: auditType.key.common, audit_order: 0,
|
|
|
},
|
|
|
];
|
|
|
// 并把之前存在的变更令审批人添加到zh_change_audit
|
|
@@ -209,23 +204,15 @@ module.exports = app => {
|
|
|
const changeInfo = await this.ctx.service.change.getHaveAuditLastInfo(tenderId);
|
|
|
if (changeInfo) {
|
|
|
// 再获取非原报审批人
|
|
|
- const auditList = await this.ctx.service.changeAudit.getListGroupByTimes(changeInfo.cid, changeInfo.times);
|
|
|
- let sort = 1;
|
|
|
- for (const audit of auditList) {
|
|
|
- if (audit.usite !== 0) {
|
|
|
- const oneaudit = {
|
|
|
- tid: tenderId,
|
|
|
- cid,
|
|
|
- uid: audit.uid,
|
|
|
- name: audit.name,
|
|
|
- jobs: audit.jobs,
|
|
|
- company: audit.company,
|
|
|
- times: 1,
|
|
|
- usite: audit.usite,
|
|
|
- usort: sort++,
|
|
|
- status: 1,
|
|
|
- };
|
|
|
- changeaudit.push(oneaudit);
|
|
|
+ const auditList = await this.ctx.service.changeAudit.getUniqAuditor(changeInfo.cid, changeInfo.times); // 全部参与的审批人
|
|
|
+ for (const x of auditList) {
|
|
|
+ if (x.audit_order !== 0) {
|
|
|
+ changeaudit.push({
|
|
|
+ tid: tenderId, cid, uid: x.uid,
|
|
|
+ name: x.name, jobs: x.jobs, company: x.company,
|
|
|
+ times: 1, usite: x.usite, usort: x.audit_order, status: audit.change.status.uncheck,
|
|
|
+ audit_type: x.audit_type, audit_order: x.audit_order,
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|