|
@@ -399,6 +399,34 @@ let executeObj = {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+let treeNodeTools = {
|
|
|
+ getFormulaNodes: function () {
|
|
|
+ return [];
|
|
|
+ },
|
|
|
+
|
|
|
+ isRation: function(treeNode){
|
|
|
+ return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.ration;
|
|
|
+ },
|
|
|
+
|
|
|
+ isLeafBill: function(treeNode){
|
|
|
+ return treeNode.sourceType === projectObj.project.Bills.getSourceType() &&
|
|
|
+ treeNode.source.children &&
|
|
|
+ treeNode.source.children.length === 0;
|
|
|
+ },
|
|
|
+
|
|
|
+ isNullBill: function (treeNode) {
|
|
|
+ return this.isLeafBill(treeNode) && (treeNode.children.length === 0) && (!treeNode.data.calcBase);
|
|
|
+ },
|
|
|
+
|
|
|
+ isVolumePrice: function (treeNode) {
|
|
|
+ return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.volumePrice;
|
|
|
+ },
|
|
|
+
|
|
|
+ isGljRation: function (treeNode) {
|
|
|
+ return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.gljRation;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
class CalcProgram {
|
|
|
constructor(project){
|
|
|
let me = this;
|
|
@@ -594,30 +622,6 @@ class CalcProgram {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
- isLeafBill(treeNode){
|
|
|
- let me = this;
|
|
|
- return treeNode.sourceType === me.project.Bills.getSourceType() &&
|
|
|
- treeNode.source.children &&
|
|
|
- treeNode.source.children.length === 0;
|
|
|
- };
|
|
|
-
|
|
|
- isNullBill(treeNode){
|
|
|
- let me = this;
|
|
|
- return me.isLeafBill(treeNode) && (treeNode.children.length ===0) && (!treeNode.data.calcBase);
|
|
|
- };
|
|
|
-
|
|
|
- isRation(treeNode){
|
|
|
- return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.ration;
|
|
|
- };
|
|
|
-
|
|
|
- isVolumePrice(treeNode){
|
|
|
- return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.volumePrice;
|
|
|
- };
|
|
|
-
|
|
|
- isGljRation(treeNode){
|
|
|
- return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.gljRation;
|
|
|
- };
|
|
|
-
|
|
|
initFeeField(treeNode, fieldName){
|
|
|
if (!treeNode.data.fees) {
|
|
|
treeNode.data.fees = [];
|
|
@@ -871,10 +875,10 @@ class CalcProgram {
|
|
|
if (isRation){
|
|
|
treeNode.calcType = treeNodeCalcType.ctRationCalcProgram;
|
|
|
}
|
|
|
- else if (me.isNullBill(treeNode)){
|
|
|
+ else if (treeNodeTools.isNullBill(treeNode)){
|
|
|
treeNode.calcType = treeNodeCalcType.ctCommonUnitFee;
|
|
|
}
|
|
|
- else if (me.isLeafBill(treeNode)) {
|
|
|
+ else if (treeNodeTools.isLeafBill(treeNode)) {
|
|
|
if (treeNode.children && treeNode.children.length > 0){
|
|
|
// 清单单价计算模式下的叶子清单:取自己的计算程序ID,找到自己的计算程序计算。(汇总清单所有定额的工料机)
|
|
|
if (me.project.property.billsCalcMode === leafBillGetFeeType.billsPrice)
|
|
@@ -989,7 +993,7 @@ class CalcProgram {
|
|
|
// 计算叶子清单下的所有子结点(如定额、量价、工料机定额等), 并计算自身和所有父结点。最后打包存储。
|
|
|
calcLeafAndSave(treeNode){
|
|
|
let me = this;
|
|
|
- if(!me.isLeafBill(treeNode)) return;
|
|
|
+ if(!treeNodeTools.isLeafBill(treeNode)) return;
|
|
|
if (treeNode.children && treeNode.children.length > 0) {
|
|
|
let changedNodes = [];
|
|
|
for (let child of treeNode.children){
|