MaiXinRong 3 лет назад
Родитель
Сommit
48c0ddeec0
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      app/lib/budget_final.js

+ 7 - 0
app/lib/budget_final.js

@@ -203,6 +203,13 @@ class BudgetFinal {
                 : (node.grow_dgn_qty2 ? '/' + node.grow_dgn_qty2 : '');
             node.grow_tp = helper.mul(helper.div(helper.sub(node.final_tp, node.gai_tp), node.gai_tp, 4), 100);
         });
+        this.finalTree.resortChildrenByCustom(function (x, y) {
+            const iCode = helper.compareCode(x.code, y.code);
+            if (iCode) return iCode;
+            if (!x.name) return -1;
+            if (!y.name) return 1;
+            return x.name.localeCompare(y.name);
+        });
     }
 
     getFinalData() {