Jelajahi Sumber

fix: 限价空值标红bug

vian 5 tahun lalu
induk
melakukan
83b17da163

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

@@ -1054,7 +1054,7 @@
      const totalFee = this.getFee(node, feeField);
      const maxPrice = node.data.maxPrice;
      // 最高限价有值才对比
-     if (!commonUtil.isDef(maxPrice)) {
+     if (!commonUtil.isNumber(maxPrice)) {
        return false;
      }
      return totalFee > maxPrice;
@@ -1067,7 +1067,7 @@
      const totalFee = this.getFee(node, feeField);
      const minPrice = node.data.minPrice;
      // 最低限价有值才对比
-     if (!commonUtil.isDef(minPrice)) {
+     if (!commonUtil.isNumber(minPrice)) {
        return false;
      }
      return totalFee < minPrice;

+ 2 - 0
web/building_saas/main/js/views/project_view.js

@@ -811,6 +811,8 @@ var projectObj = {
         //提前处理
         if (fieldName === 'code' || fieldName === 'name' || fieldName === 'unit') {
             info.editingText = info.editingText ? info.editingText.toString().replace(new RegExp(/[\r,\n]/g), '') : info.editingText;
+        } else if (info.editingText === null && (fieldName === 'maxPrice' || fieldName === 'minPrice')) {
+            info.editingText = '';
         }
         // 检查输入类型等
         let value = projectObj.checkSpreadEditingText(info.editingText, colSetting);