|
@@ -63,7 +63,6 @@ module.exports = app => {
|
|
|
status_class: auditConst.stage.tiStatusStringClass[cache.stage_status],
|
|
|
};
|
|
|
} catch (err) {
|
|
|
- console.log(tender.id);
|
|
|
tender.progress = {
|
|
|
title: `第${tender.stage_count}期`,
|
|
|
status: auditConst.stage.tiStatusString[cache.stage_status],
|
|
@@ -85,7 +84,6 @@ module.exports = app => {
|
|
|
status_class: auditConst.stage.tiStatusStringClass[auditConst.stage.status.checked],
|
|
|
};
|
|
|
} catch(err) {
|
|
|
- console.log(tender.id);
|
|
|
tender.progress = {
|
|
|
title: `第${tender.stage_count}期`,
|
|
|
status: auditConst.stage.tiStatusString[auditConst.stage.status.checked],
|
|
@@ -299,6 +297,40 @@ module.exports = app => {
|
|
|
await transaction.update(this.tableName, data);
|
|
|
}
|
|
|
|
|
|
+ async updateStageCache4MultiChecked(transaction, stage, auditors, ledgerTp, stageTp, nextStage, nextStageTp) {
|
|
|
+ if (!stage.isCheckFirst) return;
|
|
|
+
|
|
|
+ const orgCache = await this.getDataById(stage.tid);
|
|
|
+
|
|
|
+ const data = { id: stage.tid, stage_status: auditConst.stage.status.uncheck, stage_complete_count: stage.order };
|
|
|
+ if (ledgerTp) data.ledger_tp = JSON.stringify(ledgerTp);
|
|
|
+ const tp = orgCache.stage_flow_cur_tp ? JSON.parse(orgCache.stage_flow_cur_tp) : (orgCache.stage_flow_pre_tp ? JSON.parse(orgCache.stage_flow_pre_tp) : {});
|
|
|
+ if (stageTp) this._.assign(tp, stageTp);
|
|
|
+
|
|
|
+ if (auditors && auditors.length > 0) {
|
|
|
+ const auditorIds = auditors.map(x => { return x.aid; });
|
|
|
+ data.stage_flow_pre_uid = auditorIds.join(',');
|
|
|
+ const info = await this.ctx.service.projectAccount.getAccountCacheDatas(auditorIds, { order: stage.order,
|
|
|
+ audit_type: auditors[0].audit_type, status: auditConst.stage.status.checked, audit_order: auditors[0].audit_order });
|
|
|
+ data.stage_flow_pre_info = info.length > 0 ? JSON.stringify(info) : '';
|
|
|
+ }
|
|
|
+ data.stage_flow_pre_tp = JSON.stringify(tp);
|
|
|
+
|
|
|
+ data.stage_flow_cur_uid = nextStage.user_id;
|
|
|
+ const cur_flow_info = await this.ctx.service.projectAccount.getAccountCacheData(nextStage.user_id);
|
|
|
+ cur_flow_info.order = nextStage.order;
|
|
|
+ cur_flow_info.status = auditConst.stage.status.uncheck;
|
|
|
+ data.stage_flow_cur_info = JSON.stringify(cur_flow_info);
|
|
|
+ const cur_flow_tp = {
|
|
|
+ contract_tp: 0, qc_tp: 0,
|
|
|
+ positive_qc_tp: 0, negative_qc_tp: 0,
|
|
|
+ yf_tp: 0, sf_tp: 0,
|
|
|
+ ...nextStageTp,
|
|
|
+ };
|
|
|
+ data.stage_flow_cur_tp = JSON.stringify(cur_flow_tp);
|
|
|
+ await transaction.update(this.tableName, data);
|
|
|
+ }
|
|
|
+
|
|
|
async updateStageCache4Revise(transaction, tid, ledgerTp, pcTp) {
|
|
|
const orgCache = await this.getDataById(tid);
|
|
|
const data = { id: tid };
|