浏览代码

修复变更清单bug

laiguoran 3 年之前
父节点
当前提交
3a423fee63
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      app/public/js/change_information_set.js

+ 4 - 3
app/public/js/change_information_set.js

@@ -166,7 +166,8 @@ $(document).ready(() => {
             },
         },
     };
-
+    // 数字只判断几个值(unit_price, oamount, camount)
+    const numField = ['unit_price', 'oamount', 'camount'];
     const changeSpreadObj = {
         makeSjsFooter: function () {
             // 增加汇总行并设为锁定禁止编辑状态
@@ -430,7 +431,7 @@ $(document).ready(() => {
                     return;
                 }
                 // 未改变值则不提交
-                let validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : '');
+                let validText = is_numeric(info.editingText) && _.indexOf(numField, col.field) !== -1 ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : '');
                 const orgValue = select[col.field];
                 if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
@@ -529,7 +530,7 @@ $(document).ready(() => {
                     if (!colSetting) continue;
 
                     let validText = info.sheet.getText(curRow, curCol);
-                    validText = is_numeric(validText) ? parseFloat(validText) : (validText ? trimInvalidChar(validText) : '');
+                    validText = is_numeric(validText) && _.indexOf(numField, colSetting.field) !== -1 ? parseFloat(validText) : (validText ? trimInvalidChar(validText) : '');
                     const orgValue = sortData[curRow][colSetting.field];
                     if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
                         sameCol++;