|
@@ -75,10 +75,10 @@ module.exports = app => {
|
|
|
where: { stage_id: preStage.id },
|
|
where: { stage_id: preStage.id },
|
|
|
columns: costFields.editQueryFields
|
|
columns: costFields.editQueryFields
|
|
|
});
|
|
});
|
|
|
- if (stage.rela_stage) throw '财务账面关联的成本报审数据错误';
|
|
|
|
|
|
|
+ if (!stage.rela_stage) throw '财务账面关联的成本报审数据错误';
|
|
|
const relaStage = JSON.parse(stage.rela_stage);
|
|
const relaStage = JSON.parse(stage.rela_stage);
|
|
|
const curLedger = await this.ctx.service.costStageLedger.getAllDataByCondition({
|
|
const curLedger = await this.ctx.service.costStageLedger.getAllDataByCondition({
|
|
|
- where: { stage_id: relaStage.id },
|
|
|
|
|
|
|
+ where: { stage_id: relaStage.sid },
|
|
|
columns: ['id', 'cost_id'],
|
|
columns: ['id', 'cost_id'],
|
|
|
});
|
|
});
|
|
|
const insertData = [];
|
|
const insertData = [];
|
|
@@ -87,7 +87,7 @@ module.exports = app => {
|
|
|
b.stage_id = stage.id;
|
|
b.stage_id = stage.id;
|
|
|
delete b.postil;
|
|
delete b.postil;
|
|
|
const cl = curLedger.find(x => { return x.cost_id === b.cost_id });
|
|
const cl = curLedger.find(x => { return x.cost_id === b.cost_id });
|
|
|
- if (!cl) throw '财务账面关联的成本报审数据错误';
|
|
|
|
|
|
|
+ if (!cl) throw '财务账面关联的成本报审节点错误';
|
|
|
b.ledger_id = cl.id;
|
|
b.ledger_id = cl.id;
|
|
|
for(const prop of costFields.curFields) {
|
|
for(const prop of costFields.curFields) {
|
|
|
b['pre_' + prop] = this.ctx.helper.add(b['pre_' + prop], b[prop]);
|
|
b['pre_' + prop] = this.ctx.helper.add(b['pre_' + prop], b[prop]);
|