浏览代码

计量台账,清单,删除表达式后,原表达式计算结果未删除

MaiXinRong 5 年之前
父节点
当前提交
f8818390b3
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 4 1
      app/public/js/revise.js
  2. 1 1
      app/public/js/stage.js

+ 4 - 1
app/public/js/revise.js

@@ -404,6 +404,7 @@ $(document).ready(() => {
                     }
                 }
                 // 获取更新数据
+                const exprInfo = getExprInfo(col.field);
                 if (info.editingText) {
                     const text = newValue;
                     if (node.used && (col.field === 'code' || col.field ==='b_code') && orgValue !== '' && text === '') {
@@ -413,7 +414,6 @@ $(document).ready(() => {
                     }
                     if (col.type === 'Number') {
                         const num = _.toNumber(text);
-                        const exprInfo = getExprInfo(col.field);
                         if (_.isFinite(num)) {
                             data[col.field] = num;
                             if (exprInfo) {
@@ -441,6 +441,9 @@ $(document).ready(() => {
                         return;
                     }
                     data[col.field] = null;
+                    if (exprInfo) {
+                        data[exprInfo.expr] = '';
+                    }
                 }
                 // 更新至服务器
                 postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) {

+ 1 - 1
app/public/js/stage.js

@@ -1004,7 +1004,7 @@ $(document).ready(() => {
             let newValue = expr.val();
 
             const num = _.toNumber(newValue);
-            if (num) {
+            if (_.isFinite(num)) {
                 newValue = num;
             } else {
                 try {