Browse Source

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

laiguoran 3 years ago
parent
commit
93f656c5d6
2 changed files with 20 additions and 8 deletions
  1. 9 4
      app/public/js/stage.js
  2. 11 4
      app/view/report/index.ejs

+ 9 - 4
app/public/js/stage.js

@@ -2183,7 +2183,7 @@ $(document).ready(() => {
                 name: '按比例计量',
                 visible: function (key, opt) {
                     const data = spSpread.getActiveSheet().zh_data;
-                    return data && data.length > 0;
+                    return checkTzMeasureType() && data && data.length > 0;
                 },
                 disabled: function (key, opt) {
                     const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
@@ -2226,7 +2226,7 @@ $(document).ready(() => {
 
                         const qty = ZhCalc.sub(curPos.quantity, curPos.pre_contract_qty);
                         const differ = ZhCalc.sub(curPos.quantity, curPos.end_contract_qty);
-                        if (differ) data.updateData.push({ pid: curPos.id, lid: curPos.lid, contract_qty: qty });
+                        if (differ) data.updateData.push({ pid: curPos.id, lid: curPos.lid, contract_qty: qty, contract_expr: '' });
                     }
                     if (data.updateData.length > 0) {
                         postData(window.location.pathname + '/update', {pos: data}, function (result) {
@@ -2245,6 +2245,9 @@ $(document).ready(() => {
                         });
                     }
                 },
+                visible: function(key, opt) {
+                    return checkTzMeasureType();
+                },
             },
             'remainAll': {
                 name: '填剩余量(全部行)',
@@ -2261,7 +2264,7 @@ $(document).ready(() => {
                     for (const curPos of sheet.zh_data) {
                         const qty = ZhCalc.sub(curPos.quantity, curPos.pre_contract_qty);
                         const differ = ZhCalc.sub(curPos.quantity, curPos.end_contract_qty);
-                        if (differ) data.updateData.push({ pid: curPos.id, lid: curPos.lid, contract_qty: qty });
+                        if (differ) data.updateData.push({ pid: curPos.id, lid: curPos.lid, contract_qty: qty, contract_expr: '' });
                     }
                     if (data.updateData.length > 0) {
                         postData(window.location.pathname + '/update', {pos: data}, function (result) {
@@ -2279,7 +2282,9 @@ $(document).ready(() => {
                             }
                         });
                     }
-
+                },
+                visible: function(key, opt) {
+                    return checkTzMeasureType();
                 },
             },
             'shoufangdan': {

+ 11 - 4
app/view/report/index.ejs

@@ -321,7 +321,7 @@
 
 <script type="text/javascript">
     let TOP_TREE_NODES = <%- rpt_tpl_data %>;
-    const PAGE_SHOW = {closeWatermark: 0, closeExportPdf: 0, closeExportExcel: 0, showArchive: 0, dftShowAllCustomized: 0};
+    const PAGE_SHOW = {closeWatermark: 0, closeExportPdf: 0, closeExportExcel: 0, showArchive: 0, closeShowAllCustomized: 0};
     <% if (pageShow !== null) { %>
         <% if (parseInt(pageShow.closeWatermark) === 1) { %>
             PAGE_SHOW['closeWatermark'] = 1;
@@ -335,8 +335,8 @@
         <% if (parseInt(pageShow.showArchive) === 1) { %>
             PAGE_SHOW['showArchive'] = 1;
         <% } %>
-        <% if (parseInt(pageShow.dftShowAllCustomized) === 1) { %>
-        PAGE_SHOW['dftShowAllCustomized'] = 1;
+        <% if (parseInt(pageShow.closeShowAllCustomized) === 1) { %>
+        PAGE_SHOW['closeShowAllCustomized'] = 1;
         <% } %>
     <% } %>
 
@@ -519,8 +519,15 @@
             filterUnchkTplTreeNode(TOP_TREE_NODES[0], CUST_TREE_NODES.common);
             TOP_TREE_NODES.unshift(individualNode); //定制在前
             // PAGE_SHOW['dftShowAllCustimed']
-            if (!(CUST_TREE_NODES.customize && CUST_TREE_NODES.customize.length === 0 && PAGE_SHOW['dftShowAllCustomized'] === 1)) {
+//            if (!(CUST_TREE_NODES.customize && CUST_TREE_NODES.customize.length === 0 && PAGE_SHOW['dftShowAllCustomized'] === 1)) {
+//                filterUnchkTplTreeNode(TOP_TREE_NODES[0], CUST_TREE_NODES.customize);
+//            }
+            if (CUST_TREE_NODES.customize && CUST_TREE_NODES.customize.length > 0) {
+                // 优先过滤用户选择
                 filterUnchkTplTreeNode(TOP_TREE_NODES[0], CUST_TREE_NODES.customize);
+            } else if (PAGE_SHOW['closeShowAllCustomized'] === 1) {
+                // 如果没有用户选择 且 关闭显示所有定制表
+                filterUnchkTplTreeNode(TOP_TREE_NODES[0], []);
             }
             //2. 原始的模板树(恢复用)
             const individualNodeOrg = {id: 99999, name: '定制报表', pid: -1, rpt_type: 0, items: [], isParent: true};