瀏覽代碼

fix: 限价空值标红bug

vian 5 年之前
父節點
當前提交
83b17da163
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 2
      web/building_saas/main/js/models/calc_program.js
  2. 2 0
      web/building_saas/main/js/views/project_view.js

+ 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);