|
@@ -948,6 +948,8 @@ module.exports = app => {
|
|
// 清单数据更新
|
|
// 清单数据更新
|
|
const bills_list = await this.ctx.service.changeAuditList.getList(changeData.cid, changeData.order_by);
|
|
const bills_list = await this.ctx.service.changeAuditList.getList(changeData.cid, changeData.order_by);
|
|
let total_price = 0;
|
|
let total_price = 0;
|
|
|
|
+ let valuation_tp = 0;
|
|
|
|
+ let unvaluation_tp = 0;
|
|
const tp_decimal = changeData.tp_decimal ? changeData.tp_decimal : this.ctx.tender.info.decimal.tp;
|
|
const tp_decimal = changeData.tp_decimal ? changeData.tp_decimal : this.ctx.tender.info.decimal.tp;
|
|
const updateList = [];
|
|
const updateList = [];
|
|
for (const bl of bills_list) {
|
|
for (const bl of bills_list) {
|
|
@@ -962,6 +964,9 @@ module.exports = app => {
|
|
list_update.samount = bl.spamount;
|
|
list_update.samount = bl.spamount;
|
|
list_update.checked_amount = bl.spamount;
|
|
list_update.checked_amount = bl.spamount;
|
|
list_update.checked_price = this.ctx.helper.mul(bl.unit_price, list_update.checked_amount, tp_decimal);
|
|
list_update.checked_price = this.ctx.helper.mul(bl.unit_price, list_update.checked_amount, tp_decimal);
|
|
|
|
+ // 统计计价和不计价金额
|
|
|
|
+ valuation_tp = bl.is_valuation ? this.ctx.helper.add(valuation_tp, list_update.checked_price) : valuation_tp;
|
|
|
|
+ unvaluation_tp = !bl.is_valuation ? this.ctx.helper.add(unvaluation_tp, list_update.checked_price) : unvaluation_tp;
|
|
}
|
|
}
|
|
updateList.push(list_update);
|
|
updateList.push(list_update);
|
|
}
|
|
}
|
|
@@ -1040,9 +1045,11 @@ module.exports = app => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
change_update.total_price = total_price;
|
|
change_update.total_price = total_price;
|
|
|
|
+ change_update.valuation_tp = valuation_tp;
|
|
|
|
+ change_update.unvaluation_tp = unvaluation_tp;
|
|
const options = {
|
|
const options = {
|
|
where: {
|
|
where: {
|
|
- cid: postData.change_id,
|
|
|
|
|
|
+ cid: changeData.cid,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
await this.transaction.update(this.tableName, change_update, options);
|
|
await this.transaction.update(this.tableName, change_update, options);
|
|
@@ -1631,6 +1638,8 @@ module.exports = app => {
|
|
up_decimal: null,
|
|
up_decimal: null,
|
|
is_revise: 1,
|
|
is_revise: 1,
|
|
final_auditor_str: '',
|
|
final_auditor_str: '',
|
|
|
|
+ valuation_tp: 0,
|
|
|
|
+ unvaluation_tp: 0,
|
|
};
|
|
};
|
|
const options = {
|
|
const options = {
|
|
where: {
|
|
where: {
|
|
@@ -1799,6 +1808,8 @@ module.exports = app => {
|
|
sin_time: null,
|
|
sin_time: null,
|
|
total_price,
|
|
total_price,
|
|
final_auditor_str: '',
|
|
final_auditor_str: '',
|
|
|
|
+ valuation_tp: 0,
|
|
|
|
+ unvaluation_tp: 0,
|
|
};
|
|
};
|
|
const options = {
|
|
const options = {
|
|
where: {
|
|
where: {
|