소스 검색

费用类别查重

MaiXinRong 2 년 전
부모
커밋
3ffa49e15c
2개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      app/public/js/ledger.js
  2. 8 0
      app/public/js/revise.js

+ 9 - 0
app/public/js/ledger.js

@@ -560,6 +560,14 @@ $(document).ready(function() {
                         }
                         }
                     }
                     }
                 }
                 }
+                if (col.field === 'node_type') {
+                    const sameNodeType = sortData.find(x => { return x.node_type == newValue; });
+                    if (sameNodeType) {
+                        toastr.error('已存在该费用类别,请勿重复选择');
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
+                    }
+                }
                 // 获取更新数据
                 // 获取更新数据
                 if (col.type === 'Number') {
                 if (col.type === 'Number') {
                     const exprInfo = getExprInfo(col.field);
                     const exprInfo = getExprInfo(col.field);
@@ -588,6 +596,7 @@ $(document).ready(function() {
                 } else {
                 } else {
                     data[col.field] = newValue;
                     data[col.field] = newValue;
                 }
                 }
+                if(col.field === 'node_type') console.log(data);
                 // 更新至服务器
                 // 更新至服务器
                 postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) {
                 postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) {
                     const refreshNode = ledgerTree.loadPostData(result);
                     const refreshNode = ledgerTree.loadPostData(result);

+ 8 - 0
app/public/js/revise.js

@@ -516,6 +516,14 @@ $(document).ready(() => {
                         }
                         }
                     }
                     }
                 }
                 }
+                if (col.field === 'node_type') {
+                    const sameNodeType = sortData.find(x => { return x.node_type == newValue; });
+                    if (sameNodeType) {
+                        toastr.error('已存在该费用类别,请勿重复选择');
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
+                    }
+                }
                 // 获取更新数据
                 // 获取更新数据
                 const exprInfo = getExprInfo(col.field);
                 const exprInfo = getExprInfo(col.field);
                 if (info.editingText) {
                 if (info.editingText) {