|
@@ -221,7 +221,7 @@ module.exports = app => {
|
|
|
data.stage_flow_pre_uid = preAuditorIds.join(',');
|
|
|
const info = await this.ctx.service.projectAccount.getAccountCacheDatas(preAuditorIds,
|
|
|
{ order: stage.order, status: preAuditors[0].status, audit_type:preAuditors[0].audit_type, audit_order: preAuditors[0].audit_order, time: new Date() });
|
|
|
- data.stage_flow_pre_info = JSON.stringify(info);
|
|
|
+ data.stage_flow_pre_info = info.length > 0 ? JSON.stringify(info) : '';
|
|
|
} else {
|
|
|
data.stage_flow_pre_uid = orgCache.stage_flow_cur_uid;
|
|
|
data.stage_flow_pre_info = orgCache.stage_flow_cur_info;
|
|
@@ -232,7 +232,7 @@ module.exports = app => {
|
|
|
const auditorIds = auditors.map(x => { return x.aid; });
|
|
|
data.stage_flow_cur_uid = auditorIds.join(',');
|
|
|
const info = await this.ctx.service.projectAccount.getAccountCacheDatas(auditorIds, { order: stage.order, audit_type: auditors[0].audit_type, status, audit_order: auditors[0].audit_order });
|
|
|
- data.stage_flow_cur_info = JSON.stringify(info);
|
|
|
+ data.stage_flow_cur_info = info.length > 0 ? JSON.stringify(info) : '';
|
|
|
}
|
|
|
if (status === auditConst.stage.status.checked && (!auditors || auditors.length === 0)) data.stage_complete_count = stage.order;
|
|
|
data.stage_flow_cur_tp = JSON.stringify(tp);
|
|
@@ -368,10 +368,10 @@ module.exports = app => {
|
|
|
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 {
|
|
|
+ data.stage_flow_pre_info = preAuditors.length > 0 ? 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,10 +393,10 @@ module.exports = app => {
|
|
|
lastStage.curOrder = preAuditors[0].order;
|
|
|
await this._calcTp(lastStage, tp);
|
|
|
data.stage_flow_pre_uid = preAuditorIds.join(',');
|
|
|
- data.stage_flow_pre_info = JSON.stringify(preAuditors.map(preAuditor => { return {
|
|
|
+ data.stage_flow_pre_info = preAuditors.length > 0 ? JSON.stringify(preAuditors.map(preAuditor => { return {
|
|
|
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);
|
|
|
data.stage_flow_pre_tp = JSON.stringify(tp);
|
|
|
} else if (lastStage.status === auditConst.stage.status.checkNo) {
|
|
@@ -410,10 +410,10 @@ module.exports = app => {
|
|
|
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 {
|
|
|
+ data.stage_flow_pre_info = preAuditors.length > 0 ? JSON.stringify(preAuditors.map(preAuditor => { return {
|
|
|
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; });
|
|
|
if (his) {
|
|
|
tp.contract_tp = his.contract_tp;
|