فهرست منبع

台账分解,检查项目节、工程量清单同层

MaiXinRong 4 سال پیش
والد
کامیت
5e21c3e617
1فایلهای تغییر یافته به همراه22 افزوده شده و 0 حذف شده
  1. 22 0
      app/public/js/ledger.js

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

@@ -1440,7 +1440,29 @@ $(document).ready(function() {
                 return !readOnly;
             }
         };
+        billsContextMenuOptions.items.sprImport = '-----------';
     }
+    billsContextMenuOptions.items.checkLeafXmj = {
+        name: '检查项目节、工程量清单同层',
+        icon: 'fa-search-plus',
+        callback: function (key, opt) {
+            const error = [];
+            for (const node of ledgerTree.nodes) {
+                if (!node.children || node.children.length === 0) continue;
+                let hasXmj, hasGcl;
+                for (const child of node.children) {
+                    if (child.b_code) hasXmj = true;
+                    if (!child.b_code) hasGcl = true;
+                }
+                if (hasXmj && hasGcl) error.push(node);
+            }
+            if (error.length === 0) toastr.success('不存在项目节、工程量清单同层');
+            if (error.length > 0) {
+                toastr.warning('第' + (ledgerTree.nodes.indexOf(error[0]) + 1) + '行节点,子项中存在项目节与工程量清单同层,请检查。');
+                SpreadJsObj.locateTreeNode(ledgerSpread.getActiveSheet(), error[0].ledger_id);
+            }
+        },
+    };
     $.contextMenu(billsContextMenuOptions);
 
     const posSearch = $.posSearch({selector: '#pos-search', searchSpread: posSpread});