Просмотр исходного кода

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

MaiXinRong 1 год назад
Родитель
Сommit
790d0e4bff
3 измененных файлов с 14 добавлено и 12 удалено
  1. 2 2
      app/public/js/path_tree.js
  2. 7 5
      app/public/js/schedule_plan.js
  3. 5 5
      app/public/js/schedule_stage_gcl.js

+ 2 - 2
app/public/js/path_tree.js

@@ -2067,10 +2067,10 @@ const treeCalc = {
             }
         }
     },
-    calculateParent: function (tree, node) {
+    calculateParent: function (tree, node, converse = -1) {
         const setting = tree.setting;
         const nodes = tree.getFullPathNodes(node[setting.fullPath]);
-        tree.sortByLevel(nodes);
+        converse === -1 ? tree.sortByLevel(nodes) : tree.sortByLevelConverse(nodes);
         for (const n of nodes) {
             this.calculateNode(tree, n);
         }

+ 7 - 5
app/public/js/schedule_plan.js

@@ -257,12 +257,14 @@ $(function () {
                     } else {
                         select[yearmonth + '_tp'] = plan_tp;
                     }
-                    const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
+                    const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select, 1);
+                    console.log(nodes, select);
                     const refreshNode = ledgerTree.loadPostData({update: nodes});
+                    console.log(refreshNode);
                     ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
                 },function () {
                     select[col.field] = orgValue;
-                    const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
+                    const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select, 1);
                     const refreshNode = ledgerTree.loadPostData({update: nodes});
                     ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
                 })
@@ -303,7 +305,7 @@ $(function () {
                 if (datas.length > 0) {
                     postData(window.location.pathname + '/save', {type: 'ledger_paste', postData: datas}, function (result) {
                         for (const uul of filterNodes) {
-                            const nodes = treeCalc.calculateParent(sheet.zh_tree, uul);
+                            const nodes = treeCalc.calculateParent(sheet.zh_tree, uul, 1);
                             const refreshNode = ledgerTree.loadPostData({update: nodes});
                             ledgerSpreadObj.refreshTree(sheet, refreshNode);
                         }
@@ -381,7 +383,7 @@ $(function () {
             if (datas.length > 0) {
                 postData(window.location.pathname + '/save', {type: 'ledger_paste', postData: datas}, function (result) {
                     for (const uul of filterNodes) {
-                        const nodes = treeCalc.calculateParent(info.sheet.zh_tree, uul);
+                        const nodes = treeCalc.calculateParent(info.sheet.zh_tree, uul, 1);
                         const refreshNode = ledgerTree.loadPostData({update: nodes});
                         ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
                     }
@@ -449,7 +451,7 @@ $(function () {
             schedule.mode = this_mode;
             if (update_nodes.length > 0) {
                 for (const uul of update_nodes) {
-                    const nodes = treeCalc.calculateParent(ledgerSpread.getActiveSheet().zh_tree, uul);
+                    const nodes = treeCalc.calculateParent(ledgerSpread.getActiveSheet().zh_tree, uul, 1);
                     const refreshNode = ledgerTree.loadPostData({update: nodes});
                     ledgerSpreadObj.refreshTree(ledgerSpread.getActiveSheet(), refreshNode);
                 }

+ 5 - 5
app/public/js/schedule_stage_gcl.js

@@ -226,7 +226,7 @@ $(function () {
                 huizongSelect.end_sj_gcl = huizongSelect.end_sj_gcl ? ZhCalc.add(ZhCalc.sub(huizongSelect.end_sj_gcl, orgValue), validText) : validText;
                 huizongSelect.end_sj_tp = huizongSelect.dgn_price && huizongSelect.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(huizongSelect.end_sj_gcl, huizongSelect.dgn_price), 0) : 0;
             }
-            const nodes = treeCalc.calculateParent(huizongSpread.getActiveSheet().zh_tree, huizongSelect);
+            const nodes = treeCalc.calculateParent(huizongSpread.getActiveSheet().zh_tree, huizongSelect, 1);
             const refreshNode = huizongTree.loadPostData({update: nodes});
             huizongObj.refreshTree(huizongSpread.getActiveSheet(), refreshNode);
         },
@@ -266,13 +266,13 @@ $(function () {
                 console.log(updateData);
                 postData(window.location.pathname + '/save', {type: 'ledger_edit', postData: updateData}, function (result) {
                     select[yearmonth + '_sj_tp'] = sj_tp;
-                    const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
+                    const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select, 1);
                     const refreshNode = ledgerTree.loadPostData({update: nodes});
                     ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
                     ledgerSpreadObj.reCalcHuizong(info.row, yearmonth, orgValue, validText);
                 },function () {
                     select[col.field] = orgValue;
-                    const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
+                    const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select, 1);
                     const refreshNode = ledgerTree.loadPostData({update: nodes});
                     ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
                 })
@@ -313,7 +313,7 @@ $(function () {
                 if (datas.length > 0) {
                     postData(window.location.pathname + '/save', {type: 'ledger_paste', postData: datas}, function (result) {
                         for (const uul of filterNodes) {
-                            const nodes = treeCalc.calculateParent(sheet.zh_tree, uul);
+                            const nodes = treeCalc.calculateParent(sheet.zh_tree, uul, 1);
                             const refreshNode = ledgerTree.loadPostData({update: nodes});
                             ledgerSpreadObj.refreshTree(sheet, refreshNode);
                         }
@@ -382,7 +382,7 @@ $(function () {
             if (datas.length > 0) {
                 postData(window.location.pathname + '/save', {type: 'ledger_paste', postData: datas}, function (result) {
                     for (const uul of filterNodes) {
-                        const nodes = treeCalc.calculateParent(info.sheet.zh_tree, uul);
+                        const nodes = treeCalc.calculateParent(info.sheet.zh_tree, uul, 1);
                         const refreshNode = ledgerTree.loadPostData({update: nodes});
                         ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
                     }