|
@@ -410,7 +410,9 @@ module.exports = app => {
|
|
|
]);
|
|
|
if (this._checkFieldsExist(fields, billsFields.final1)) {
|
|
|
const preMinusChange = await this.ctx.service.stageChangeFinal.getPreMinusChange(this.ctx.stage.tid, this.ctx.stage.order);
|
|
|
- const changeData = await this._getStageChangeData(this.ctx);
|
|
|
+ const changeData = this.ctx.stage.readOnly
|
|
|
+ ? await this.ctx.service.stageChange.getAuditorAllStageData(this.ctx.tender.id, this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder)
|
|
|
+ : await this.ctx.service.stageChange.getLastestAllStageData(this.ctx.tender.id, this.ctx.stage.id);
|
|
|
const minusChange = changeData.filter(x => { return x.minus });
|
|
|
this.ctx.helper.assignSumRelaData(billsData, 'id', [
|
|
|
{data: preMinusChange, fields: [{source: 'qty', target: 'pre_minus_qc_qty'}], relaField: 'lid'},
|
|
@@ -432,7 +434,8 @@ module.exports = app => {
|
|
|
|
|
|
return billsTree.getDefaultDatas();
|
|
|
} catch(err) {
|
|
|
- return []
|
|
|
+ this.ctx.log(err);
|
|
|
+ return [];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -485,7 +488,9 @@ module.exports = app => {
|
|
|
]);
|
|
|
if (this._checkFieldsExist(fields, posFields.final1)) {
|
|
|
const preMinusChange = await this.ctx.service.stageChangeFinal.getPreMinusChange(this.ctx.stage.tid, this.ctx.stage.order);
|
|
|
- const changeData = await this._getStageChangeData(this.ctx);
|
|
|
+ const changeData = this.ctx.stage.readOnly
|
|
|
+ ? await this.ctx.service.stageChange.getAuditorAllStageData(this.ctx.tender.id, this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder)
|
|
|
+ : await this.ctx.service.stageChange.getLastestAllStageData(this.ctx.tender.id, this.ctx.stage.id);
|
|
|
const minusChange = changeData.filter(x => { return x.minus });
|
|
|
this.ctx.helper.assignSumRelaData(posData, 'id', [
|
|
|
{data: preMinusChange, fields: [{source: 'qty', target: 'pre_minus_qc_qty'}], relaField: 'pid'},
|