浏览代码

fix: 信息价为空,单位转换后小数位数问题

zhangweicheng 4 年之前
父节点
当前提交
54ce639ed4

+ 1 - 1
web/building_saas/main/js/models/project_glj.js

@@ -321,7 +321,7 @@ ProjectGLJ.prototype.updatePrice = function (recode, updateField, newval,from,td
     let pgljID = from=="rg"?recode.projectGLJID:recode.id;//和定额工料机统一接口,项目工料机ID取值不一样
     let glj = _.find(projectGljs, {'id': pgljID});
     let udoc = tdoc?tdoc:{};//20200728 新增价格来源,默认为空
-    if(updateField == 'market_price') udoc = {"priceFrom":"",infoPrice:null};
+    if(updateField == 'market_price') udoc = {"priceFrom":"",infoPrice:null,...udoc};
     if (glj) {
         if(glj.unit_price[updateField] == newval){
             return;

+ 1 - 1
web/building_saas/main/js/views/project_glj_view.js

@@ -1827,7 +1827,7 @@ let projectGljObject = {
   },
   applyInfoPrice: function (projectGLJData, price, coe) {
     let priceFrom = this.getPriceFrom();
-    let infoPrice = price * coe;
+    let infoPrice =  scMathUtil.roundForObj(price * coe,getDecimal("glj.unitPrice")) ;
     let marketPrice =  gljUtil.calcMarketPriceByInfoPrice(infoPrice,projectGLJData.purchaseFeeRate,getDecimal("glj.unitPrice"));
     projectObj.project.projectGLJ.updatePrice(projectGLJData, "market_price", marketPrice, 'pg', {
      priceFrom,infoPrice