|
@@ -487,6 +487,7 @@ module.exports = app => {
|
|
|
charge: postData.charge,
|
|
|
w_code: postData.w_code,
|
|
|
total_price,
|
|
|
+ tp_decimal: this.ctx.tender.info.decimal.tp,
|
|
|
};
|
|
|
const options = {
|
|
|
where: {
|
|
@@ -579,13 +580,14 @@ module.exports = app => {
|
|
|
// 清单数据更新
|
|
|
const bills_list = postData.bills_list.split(',');
|
|
|
let total_price = 0;
|
|
|
+ const tp_decimal = changeData.tp_decimal ? changeData.tp_decimal : this.ctx.tender.info.decimal.tp;
|
|
|
for (const bl of bills_list) {
|
|
|
const listInfo = bl.split('_');
|
|
|
const lid = listInfo[0];
|
|
|
const amount = listInfo[1];
|
|
|
const changeListInfo = await this.ctx.service.changeAuditList.getDataById(lid);
|
|
|
if (changeListInfo !== undefined) {
|
|
|
- total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(changeListInfo.unit_price, amount, this.ctx.tender.info.decimal.tp));
|
|
|
+ total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(changeListInfo.unit_price, amount, tp_decimal));
|
|
|
const audit_amount = changeListInfo.audit_amount !== null && changeListInfo.audit_amount !== '' ? changeListInfo.audit_amount.split(',') : [];
|
|
|
audit_amount.push(amount);
|
|
|
const list_update = {
|
|
@@ -780,8 +782,9 @@ module.exports = app => {
|
|
|
where: { cid: changeInfo.cid },
|
|
|
});
|
|
|
let total_price = 0;
|
|
|
+ const tp_decimal = changeData.tp_decimal ? changeData.tp_decimal : this.ctx.tender.info.decimal.tp;
|
|
|
for (const cl of changeList) {
|
|
|
- total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(cl.unit_price, cl.camount, this.ctx.tender.info.decimal.tp));
|
|
|
+ total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(cl.unit_price, cl.camount, tp_decimal));
|
|
|
}
|
|
|
// 设置变更令退回
|
|
|
const change_update = {
|
|
@@ -790,6 +793,7 @@ module.exports = app => {
|
|
|
times: newTimes,
|
|
|
cin_time: Date.parse(new Date()) / 1000,
|
|
|
total_price,
|
|
|
+ tp_decimal: null,
|
|
|
};
|
|
|
const options = {
|
|
|
where: {
|
|
@@ -919,6 +923,7 @@ module.exports = app => {
|
|
|
where: { cid: changeInfo.cid },
|
|
|
});
|
|
|
let total_price = 0;
|
|
|
+ const tp_decimal = changeData.tp_decimal ? changeData.tp_decimal : this.ctx.tender.info.decimal.tp;
|
|
|
for (const cl of changeList) {
|
|
|
const audit_amount = cl.audit_amount.split(',');
|
|
|
const last_amount = audit_amount[audit_amount.length - 1];
|
|
@@ -928,7 +933,7 @@ module.exports = app => {
|
|
|
audit_amount: audit_amount.join(','),
|
|
|
spamount: parseFloat(last_amount),
|
|
|
};
|
|
|
- total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(cl.unit_price, parseFloat(last_amount), this.ctx.tender.info.decimal.tp));
|
|
|
+ total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(cl.unit_price, parseFloat(last_amount), tp_decimal));
|
|
|
await this.transaction.update(this.ctx.service.changeAuditList.tableName, list_update);
|
|
|
}
|
|
|
|
|
@@ -1231,6 +1236,7 @@ module.exports = app => {
|
|
|
|
|
|
// 审批列表数据也要回退
|
|
|
let total_price = 0;
|
|
|
+ const tp_decimal = changeInfo.tp_decimal ? changeInfo.tp_decimal : this.ctx.tender.info.decimal.tp;
|
|
|
const changeList = await this.ctx.service.changeAuditList.getAllDataByCondition({
|
|
|
where: { cid: changeInfo.cid },
|
|
|
});
|
|
@@ -1243,7 +1249,7 @@ module.exports = app => {
|
|
|
audit_amount: audit_amount.join(','),
|
|
|
samount: '',
|
|
|
};
|
|
|
- total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(cl.unit_price, parseFloat(last_amount), this.ctx.tender.info.decimal.tp));
|
|
|
+ total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(cl.unit_price, parseFloat(last_amount), tp_decimal));
|
|
|
await this.transaction.update(this.ctx.service.changeAuditList.tableName, list_update);
|
|
|
}
|
|
|
|