|
@@ -365,12 +365,13 @@ module.exports = app => {
|
|
|
const preStage = lastStage.order > 1 ? await this.ctx.service.stage.getDataByCondition({ tid: lastStage.tid, order: lastStage.order - 1}) : null;
|
|
|
if (lastStage.status === auditConst.stage.status.uncheck) {
|
|
|
if (preStage) {
|
|
|
- const preAuditor = await this.ctx.service.stageAudit.getLastestAuditor(preStage.id, preStage.times, preStage.status);
|
|
|
- data.stage_flow_pre_uid = preAuditor.aid;
|
|
|
- data.stage_flow_pre_info = JSON.stringify({
|
|
|
- order: preAuditor.order, status: preAuditor.status, time: preAuditor.end_time,
|
|
|
+ const preAuditors = await this.ctx.service.stageAudit.getLastestAuditors(preStage.id, preStage.times, preStage.status);
|
|
|
+ const preAuditorIds = preAuditors.map(x => { return x.aid; });
|
|
|
+ data.stage_flow_pre_uid = preAuditorIds.join(',');
|
|
|
+ data.stage_flow_pre_info = JSON.stringify(preAuditors.map(preAuditor => { return {
|
|
|
+ order: preAuditor.order, audit_type: preAuditor.audit_type, audit_order: preAuditor.order, status: preAuditor.status, time: preAuditor.end_time,
|
|
|
name: preAuditor.name, company: preAuditor.company, role: preAuditor.role, mobile: preAuditor.mobile, telephone: preAuditor.telephone,
|
|
|
- });
|
|
|
+ }}));
|
|
|
data.stage_flow_pre_tp = JSON.stringify({
|
|
|
contract_tp: preStage.contract_tp || 0, qc_tp: preStage.qc_tp || 0, contract_pc_tp: preStage.contract_pc_tp, qc_pc_tp: preStage.qc_pc_tp, pc_tp: preStage.pc_tp,
|
|
|
positive_qc_tp: preStage.positive_qc_tp, positive_qc_pc_tp: preStage.positive_qc_pc_tp, negative_qc_tp: preStage.negative_qc_pc_tp, negative_qc_pc_tp: preStage.negative_qc_pc_tp,
|
|
@@ -393,7 +394,7 @@ module.exports = app => {
|
|
|
await this._calcTp(lastStage, tp);
|
|
|
data.stage_flow_pre_uid = preAuditorIds.join(',');
|
|
|
data.stage_flow_pre_info = JSON.stringify(preAuditors.map(preAuditor => { return {
|
|
|
- order: lastStage.order, audit_order: preAuditor.order, status: preAuditor.status, time: preAuditor.end_time,
|
|
|
+ order: lastStage.order, audit_type: preAuditor.audit_type, audit_order: preAuditor.order, status: preAuditor.status, time: preAuditor.end_time,
|
|
|
name: preAuditor.name, company: preAuditor.company, role: preAuditor.role, mobile: preAuditor.mobile, telephone: preAuditor.telephone,
|
|
|
}}));
|
|
|
data.stage_flow_cur_tp = JSON.stringify(tp);
|
|
@@ -402,14 +403,15 @@ module.exports = app => {
|
|
|
lastStage.curOrder = 0;
|
|
|
await this._calcTp(lastStage, tp);
|
|
|
data.stage_flow_cur_uid = lastStage.user_id;
|
|
|
- const curInfo = await this.ctx.service.projectAccount.getAccountCacheData(lastStage.user_id, { order: lastStage.order, audit_order: 0, audit_type: auditConst.auditType.key.common, status: auditConst.stage.status.uncheck });
|
|
|
+ const curInfo = await this.ctx.service.projectAccount.getAccountCacheData(lastStage.user_id,
|
|
|
+ { order: lastStage.order, audit_order: 0, audit_type: auditConst.auditType.key.common, status: auditConst.stage.status.uncheck });
|
|
|
data.stage_flow_cur_info = JSON.stringify(curInfo);
|
|
|
data.stage_flow_cur_tp = JSON.stringify(tp);
|
|
|
const preAuditors = await this.ctx.service.stageAudit.getLastestAuditors(lastStage.id, lastStage.times - 1, lastStage.status);
|
|
|
const preAuditorIds = preAuditors.map(x => { return x.aid; });
|
|
|
data.stage_flow_pre_uid = preAuditorIds.join(',');
|
|
|
data.stage_flow_pre_info = JSON.stringify(preAuditors.map(preAuditor => { return {
|
|
|
- order: lastStage.order, audit_order: preAuditor.order, status: preAuditor.status, time: preAuditor.end_time,
|
|
|
+ order: lastStage.order, audit_type: preAuditor.audit_type, audit_order: preAuditor.order, status: preAuditor.status, time: preAuditor.end_time,
|
|
|
name: preAuditor.name, company: preAuditor.company, role: preAuditor.role, mobile: preAuditor.mobile, telephone: preAuditor.telephone,
|
|
|
}}));
|
|
|
const his = lastStage.tp_history.find(x => { return x.times === preAuditors[0].times && x.order === preAuditors[0].order; });
|
|
@@ -438,12 +440,13 @@ module.exports = app => {
|
|
|
const preAuditorIds = preAuditors.map(x => { return x.aid; });
|
|
|
data.stage_flow_pre_uid = preAuditorIds.join(',');
|
|
|
data.stage_flow_pre_info = JSON.stringify(preAuditors.map(preAuditor => { return {
|
|
|
- order: lastStage.order, audit_order: preAuditor.audit_order, status: preAuditor.status, time: preAuditor.end_time,
|
|
|
+ order: lastStage.order, audit_type: preAuditor.audit_type, audit_order: preAuditor.audit_order, status: preAuditor.status, time: preAuditor.end_time,
|
|
|
name: preAuditor.name, company: preAuditor.company, role: preAuditor.role, mobile: preAuditor.mobile, telephone: preAuditor.telephone,
|
|
|
}}));
|
|
|
} else {
|
|
|
data.stage_flow_pre_uid = lastStage.user_id;
|
|
|
- const preInfo = await this.ctx.service.projectAccount.getAccountCacheData(lastStage.user_id, { order: 0, status: auditConst.stage.status.uncheck, time: curAuditors[0].begin_time });
|
|
|
+ const preInfo = await this.ctx.service.projectAccount.getAccountCacheData(lastStage.user_id,
|
|
|
+ { order: lastStage.order, audit_order: 0, audit_type: 1, status: auditConst.stage.status.uncheck, time: curAuditors[0].begin_time });
|
|
|
data.stage_flow_pre_info = JSON.stringify(preInfo);
|
|
|
}
|
|
|
const his = preAuditors.length > 0
|