Browse Source

变更令计算问题

MaiXinRong 5 năm trước cách đây
mục cha
commit
57b50ac703
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      app/service/change.js

+ 3 - 1
app/service/change.js

@@ -279,6 +279,7 @@ module.exports = app => {
          * @return {void}
          */
         async save(postData, tenderId) {
+            const tenderInfo  = await this.ctx.service.tenderInfo.getTenderInfo(tenderId);
             // 初始化事务
             this.transaction = await this.db.beginTransaction();
             let result = false;
@@ -369,7 +370,8 @@ module.exports = app => {
                             spamount: clInfo[6],
                         };
                         insertCL.push(clArray);
-                        total_price = this.ctx.helper.accAdd(total_price, this.ctx.helper.accMul(clArray.unit_price, clArray.spamount));
+                        total_price = this.ctx.helper.accAdd(total_price,
+                            this.ctx.helper.mul(clArray.unit_price, clArray.spamount, tenderInfo.decimal.tp));
                     }
                     await this.transaction.insert(this.ctx.service.changeAuditList.tableName, insertCL);
                 }