Browse Source

台账修订,只读列,Delete报错

MaiXinRong 4 năm trước cách đây
mục cha
commit
b7c30a46bf
1 tập tin đã thay đổi với 11 bổ sung5 xóa
  1. 11 5
      app/public/js/revise.js

+ 11 - 5
app/public/js/revise.js

@@ -690,6 +690,7 @@ $(document).ready(() => {
             if (!sheet.zh_setting) return;
             const sel = sheet.getSelections()[0], datas = [];
             for (let iRow = sel.row; iRow < sel.row + sel.rowCount; iRow++) {
+                let bDel = false;
                 const node = sheet.zh_tree.nodes[iRow];
                 if (sheet.zh_tree.checkNodeUsed(node, pos)) {
                     toastr.warning('"' + node.code + node.b_code + ' ' + node.name +'"已计量,请勿修改');
@@ -698,13 +699,18 @@ $(document).ready(() => {
                 const data = sheet.zh_tree.getNodeKeyData(node);
                 for (let iCol = sel.col; iCol < sel.col + sel.colCount; iCol++) {
                     const col = sheet.zh_setting.cols[iCol];
-                    data[col.field] = null;
-                    const exprInfo = getExprInfo(col.field);
-                    if (exprInfo) {
-                        data[exprInfo.expr] = '';
+
+                    const style = sheet.getStyle(iRow, iCol);
+                    if (!style.locked) {
+                        data[col.field] = null;
+                        const exprInfo = getExprInfo(col.field);
+                        if (exprInfo) {
+                            data[exprInfo.expr] = '';
+                        }
+                        bDel = true;
                     }
                 }
-                datas.push(data);
+                if (bDel) datas.push(data);
             }
             if (datas.length > 0) {
                 postData(window.location.pathname + '/update', {postType: 'update', postData: datas}, function (result) {