Explorar el Código

fix: price readOnly

vian hace 5 años
padre
commit
bd9b0f1f14

+ 2 - 2
web/building_saas/main/js/models/calc_program.js

@@ -1057,7 +1057,7 @@
      if (!commonUtil.isNumber(maxPrice)) {
        return false;
      }
-     return totalFee > maxPrice;
+     return totalFee > +maxPrice;
    },
    // 清单价格是否小于最低限价
    unitFeeLTMinPrice: function (node, feeField) {
@@ -1070,7 +1070,7 @@
      if (!commonUtil.isNumber(minPrice)) {
        return false;
      }
-     return totalFee < minPrice;
+     return totalFee < +minPrice;
    },
    // 概预算项目
    isBudgetProject() {

+ 5 - 3
web/building_saas/main/js/views/main_tree_col.js

@@ -295,11 +295,13 @@ let MainTreeCol = {
       return true;
     },
     maxPrice: function (node) {
-
-      return projectObj.project.projectInfo.importedByInterface || node.data.outPutMaxPrice === false || node.data.outPutLimitPrice === false;
+      const hasOutPutMaxPriceCol = !!projectObj.project.projSetting.main_tree_col.cols.find(item => item.data.field === 'outPutMaxPrice');
+      const hasOutPutLitmitPriceCol = !!projectObj.project.projSetting.main_tree_col.cols.find(item => item.data.field === 'outPutLitmitPrice');
+      return projectObj.project.projectInfo.importedByInterface || (hasOutPutMaxPriceCol && (node.data.outPutMaxPrice === undefined || node.data.outPutMaxPrice === false)) || (hasOutPutLitmitPriceCol && (node.data.outPutLimitPrice === undefined || node.data.outPutLimitPrice === false));
     },
     minPrice: function (node) {
-      return projectObj.project.projectInfo.importedByInterface || node.data.outPutLimitPrice === false;
+      const hasOutPutLitmitPriceCol = !!projectObj.project.projSetting.main_tree_col.cols.find(item => item.data.field === 'outPutLitmitPrice');
+      return projectObj.project.projectInfo.importedByInterface || (hasOutPutLitmitPriceCol && (node.data.outPutLimitPrice === undefined || node.data.outPutLimitPrice === false));
     },
   },
   cellType: {