소스 검색

修复bug

laiguoran 3 년 전
부모
커밋
d2b998947e
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      app/controller/change_controller.js
  2. 2 2
      app/public/js/change_information_set.js

+ 2 - 2
app/controller/change_controller.js

@@ -2634,7 +2634,7 @@ module.exports = app => {
                     tpUnit: ctx.change.decimal ? ctx.change.decimal.tp : ctx.tender.info.decimal.tp,
                     upUnit: ctx.change.decimal ? ctx.change.decimal.up : ctx.tender.info.decimal.up,
                     changeUnits: changeConst.units,
-                    precision: ctx.change.decimal ? ctx.change.decimal.precision : ctx.tender.info.precision,
+                    precision: ctx.change.decimal && ctx.change.decimal.precision ? ctx.change.decimal.precision : ctx.tender.info.precision,
                     returnUrl: this.app._.includes(ctx.request.headers.referer, '/tender/' + ctx.tender.id + '/change/apply') && !this.app._.includes(ctx.request.headers.referer, '/tender/' + ctx.tender.id + '/change/apply/' + ctx.change.id + '/information') ? ctx.request.headers.referer : null,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.change.apply_information),
                     preUrl: '/tender/' + ctx.tender.id + '/change/apply/' + ctx.change.id + '/information',
@@ -3255,7 +3255,7 @@ module.exports = app => {
                     tpUnit: ctx.change.decimal ? ctx.change.decimal.tp : ctx.tender.info.decimal.tp,
                     upUnit: ctx.change.decimal ? ctx.change.decimal.up : ctx.tender.info.decimal.up,
                     changeUnits: changeConst.units,
-                    precision: ctx.change.decimal ? ctx.change.decimal.precision : ctx.tender.info.precision,
+                    precision: ctx.change.decimal && ctx.change.decimal.precision ? ctx.change.decimal.precision : ctx.tender.info.precision,
                     returnUrl: this.app._.includes(ctx.request.headers.referer, '/tender/' + ctx.tender.id + '/change/plan') && !this.app._.includes(ctx.request.headers.referer, '/tender/' + ctx.tender.id + '/change/plan/' + ctx.change.id + '/information') ? ctx.request.headers.referer : null,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.change.plan_information),
                     preUrl: '/tender/' + ctx.tender.id + '/change/plan/' + ctx.change.id + '/information',

+ 2 - 2
app/public/js/change_information_set.js

@@ -142,10 +142,10 @@ $(document).ready(() => {
                 return ZhCalc.round(data.unit_price, unitPriceUnit);
             },
             oa_tp: function (data) {
-                return ZhCalc.round(ZhCalc.mul(data.unit_price, data.oamount), totalPriceUnit);
+                return ZhCalc.round(ZhCalc.mul(data.unit_price, ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit);
             },
             ca_tp: function (data) {
-                return ZhCalc.round(ZhCalc.mul(data.unit_price, data.camount), totalPriceUnit);
+                return ZhCalc.round(ZhCalc.mul(data.unit_price, ZhCalc.round(data.camount, findDecimal(data.unit))), totalPriceUnit);
             },
             oamount: function (data) {
                 return ZhCalc.round(data.oamount, findDecimal(data.unit));