Kaynağa Gözat

不允许在台账首层应用模板

MaiXinRong 4 ay önce
ebeveyn
işleme
50aff7157e
1 değiştirilmiş dosya ile 6 ekleme ve 2 silme
  1. 6 2
      app/public/js/ledger.js

+ 6 - 2
app/public/js/ledger.js

@@ -1477,6 +1477,10 @@ $(document).ready(function() {
                 toastr.warning('请在协作范围内应用模板');
                 return;
             }
+            if (node.level === 1) {
+                toastr.warning('不可在顶层节点应用模板');
+                return;
+            }
 
             postData(window.location.pathname + '/update', {
                 postType: 'apply-template', postData: { id: ledgerTree.getNodeKey(node), templateId: template.id }
@@ -2184,7 +2188,7 @@ $(document).ready(function() {
             icon: 'fa-file-excel-o',
             disabled: function (key, opt) {
                 const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
-                return readOnly || !node || !node._invalid
+                return readOnly || !node || node._invalid
                     || (node.children && node.children.length > 0)
                     || (!_.isNil(node.b_code) && node.b_code !== '');
             },
@@ -2222,7 +2226,7 @@ $(document).ready(function() {
             icon: 'fa-link',
             disabled: function (key, opt) {
                 const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
-                return readOnly || !node || !node._invalid
+                return readOnly || !node || node._invalid
                     || (node.children && node.children.length > 0)
                     || !ledgerTree.isLeafXmj(node);
             },