Browse Source

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang 1 year ago
parent
commit
9131510861
1 changed files with 7 additions and 0 deletions
  1. 7 0
      app/service/change.js

+ 7 - 0
app/service/change.js

@@ -1163,9 +1163,16 @@ module.exports = app => {
                 await this.ctx.service.changeHistory.saveHistory(this.transaction, changeData, changeList);
                 let total_price = 0;
                 const tp_decimal = changeData.tp_decimal ? changeData.tp_decimal : this.ctx.tender.info.decimal.tp;
+                const updateChangeList = [];
                 for (const cl of changeList) {
+                    updateChangeList.push({
+                        id: cl.id,
+                        audit_amount: null,
+                        spamount: cl.camount,
+                    });
                     total_price = this.ctx.helper.add(total_price, this.ctx.helper.mul(cl.unit_price, cl.camount, tp_decimal));
                 }
+                if (updateChangeList.length > 0) await this.transaction.updateRows(this.ctx.service.changeAuditList.tableName, updateChangeList);
                 // 设置变更令退回
                 const change_update = {
                     w_code: postData.w_code,