|
@@ -730,7 +730,10 @@ class CalcProgram {
|
|
|
|
|
|
// 存储、刷新零散的多个结点。
|
|
|
saveNodes(treeNodes){
|
|
|
- if (treeNodes.length < 1) return;
|
|
|
+ if (treeNodes.length < 1) {
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
let me = this;
|
|
|
|
|
@@ -978,9 +981,23 @@ class CalcProgram {
|
|
|
// 叶子清单无子结点、无公式计算(啥都没有时)
|
|
|
else if (treeNode.calcType == treeNodeCalcType.ctNull){
|
|
|
delete treeNode.data.gljList;
|
|
|
- if (treeNode.data.calcBase) treeNode.data.calcBase = null; // 不能直接删除该属性,否则无法冲掉库中已存储的值
|
|
|
- if (treeNode.data.calcBaseValue) treeNode.data.calcBaseValue = null; // 不能直接删除该属性,否则无法冲掉库中已存储的值
|
|
|
- if (treeNode.data.programID) treeNode.data.programID = null;
|
|
|
+
|
|
|
+ // 不能直接删除该属性,否则无法冲掉库中已存储的值。下同。
|
|
|
+ if (treeNode.data.calcBase){
|
|
|
+ treeNode.data.calcBase = null;
|
|
|
+ treeNode.changed = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (treeNode.data.calcBaseValue){
|
|
|
+ treeNode.data.calcBaseValue = null;
|
|
|
+ treeNode.changed = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (treeNode.data.programID) {
|
|
|
+ treeNode.data.programID = null;
|
|
|
+ treeNode.changed = true;
|
|
|
+ }
|
|
|
+
|
|
|
if (treeNode.data.fees && treeNode.data.fees.length > 0){
|
|
|
treeNode.data.fees = null;
|
|
|
treeNode.data.feesIndex = null;
|
|
@@ -991,7 +1008,11 @@ class CalcProgram {
|
|
|
// 叶子清单公式计算
|
|
|
else if (treeNode.calcType == treeNodeCalcType.ctCalcBaseValue){
|
|
|
delete treeNode.data.gljList;
|
|
|
- if (treeNode.data.programID) treeNode.data.programID = null;
|
|
|
+
|
|
|
+ if (treeNode.data.programID) {
|
|
|
+ treeNode.data.programID = null;
|
|
|
+ treeNode.changed = true;
|
|
|
+ }
|
|
|
|
|
|
let f = treeNode.data.feeRate ? treeNode.data.feeRate : 100;
|
|
|
if (!treeNode.data.quantity) treeNode.data.quantity = 1;
|
|
@@ -1220,5 +1241,8 @@ class CalcProgram {
|
|
|
let changedNodes = this.calculate(treeNode);
|
|
|
this.saveNodes(changedNodes);
|
|
|
};
|
|
|
-
|
|
|
+ calcAllNodesAndSave(calcType = calcAllType.catAll){
|
|
|
+ let changedNodes = this.calcAllNodes(calcType);
|
|
|
+ this.saveNodes(changedNodes);
|
|
|
+ };
|
|
|
}
|