|
@@ -118,98 +118,6 @@ const cpFeeTypes = [
|
|
|
{type: 'fee1', name: '甲供材料费'},
|
|
|
{type: 'common', name: '工程造价'}
|
|
|
];
|
|
|
-function getRationBaseFee(treeNode, gljTypes, priceType){
|
|
|
- if (!treeNode.data.gljList) return 0;
|
|
|
- function uiGLJPrice(price){
|
|
|
- if (price)
|
|
|
- return parseFloat(price).toDecimal(decimalObj.glj.unitPrice)
|
|
|
- else return 0;
|
|
|
- };
|
|
|
- function uiGLJQuantity(quantity){
|
|
|
- if (quantity)
|
|
|
- return parseFloat(quantity).toDecimal(decimalObj.glj.quantity)
|
|
|
- else return 0;
|
|
|
- };
|
|
|
- let result = 0;
|
|
|
- for (let glj of treeNode.data.gljList) {
|
|
|
- let price = 0, temp = 0;
|
|
|
- if (gljTypes.indexOf(glj.type) >= 0) {
|
|
|
- if (priceType == priceTypes.ptDiffPrice){
|
|
|
- let aprice = uiGLJPrice(glj["adjustPrice"]);
|
|
|
- let mprice = uiGLJPrice(glj["marketPrice"]);
|
|
|
- temp = (uiGLJQuantity(glj["quantity"]) * mprice).toDecimal(decimalObj.ration.unitPrice) - (uiGLJQuantity(glj["quantity"]) * aprice).toDecimal(decimalObj.ration.unitPrice);
|
|
|
- temp = temp.toDecimal(decimalObj.ration.unitPrice);
|
|
|
- }
|
|
|
- else {
|
|
|
- if (priceType == priceTypes.ptBasePrice){ price = uiGLJPrice(glj["basePrice"]);}
|
|
|
- else if (priceType == priceTypes.ptAdjustPrice){price = uiGLJPrice(glj["adjustPrice"]);}
|
|
|
- else if (priceType == priceTypes.ptMarketPrice){price = uiGLJPrice(glj["marketPrice"]);}
|
|
|
- temp = (uiGLJQuantity(glj["quantity"]) * price).toDecimal(decimalObj.ration.unitPrice);
|
|
|
- };
|
|
|
-
|
|
|
- result = (result + temp).toDecimal(decimalObj.ration.unitPrice);
|
|
|
- };
|
|
|
- };
|
|
|
- return result;
|
|
|
-};
|
|
|
-
|
|
|
-const rationCalcBaser = {
|
|
|
- '定额基价人工费':
|
|
|
- function (node) {
|
|
|
- return getRationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice);
|
|
|
- },
|
|
|
- '定额基价材料费':
|
|
|
- function (node) {
|
|
|
- return getRationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice);
|
|
|
- },
|
|
|
- '定额基价机械费':
|
|
|
- function (node) {
|
|
|
- return getRationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptBasePrice);
|
|
|
- },
|
|
|
- '定额基价机上人工费':
|
|
|
- function machineLabourFee(node) {
|
|
|
- if (!node.data.gljList) return 0;
|
|
|
- let result = 0, mdSum = 0;
|
|
|
- for (let glj of node.data.gljList) {
|
|
|
- if (glj.type == gljType.GENERAL_MACHINE) {
|
|
|
- // 获取机械组成物
|
|
|
- let mds = projectObj.project.composition.getCompositionByGLJ(glj);
|
|
|
- if (!mds) mds = [];
|
|
|
- for (let md of mds) {
|
|
|
- if (md.type == gljType.MACHINE_LABOUR) {
|
|
|
- let q = md["consumption"] ? md["consumption"] : 0;
|
|
|
- let p = md["basePrice"] ? md["basePrice"] : 0;
|
|
|
- mdSum = mdSum + (q * p).toDecimal(decimalObj.process);
|
|
|
- mdSum = (mdSum).toDecimal(decimalObj.process);
|
|
|
- }
|
|
|
- };
|
|
|
- result = result + (glj["quantity"] * mdSum).toDecimal(decimalObj.process);
|
|
|
- result = (result).toDecimal(decimalObj.process);
|
|
|
- };
|
|
|
- };
|
|
|
- return result;
|
|
|
- },
|
|
|
- '人工费价差':
|
|
|
- function (node) {
|
|
|
- return getRationBaseFee(node, [gljType.LABOUR], priceTypes.ptDiffPrice);
|
|
|
- },
|
|
|
- '材料费价差':
|
|
|
- function (node) {
|
|
|
- return getRationBaseFee(node, baseMaterialTypes, priceTypes.ptDiffPrice);
|
|
|
- },
|
|
|
- '机械费价差':
|
|
|
- function (node) {
|
|
|
- return getRationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptDiffPrice);
|
|
|
- },
|
|
|
- '主材费':
|
|
|
- function (node) {
|
|
|
- return getRationBaseFee(node, [gljType.MAIN_MATERIAL], priceTypes.ptMarketPrice);
|
|
|
- },
|
|
|
- '设备费':
|
|
|
- function (node) {
|
|
|
- return getRationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice);
|
|
|
- }
|
|
|
-};
|
|
|
|
|
|
let nodeTools = {
|
|
|
isBill: function(treeNode){
|
|
@@ -241,14 +149,14 @@ let nodeTools = {
|
|
|
return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.gljRation;
|
|
|
},
|
|
|
|
|
|
- initFees(treeNode){
|
|
|
+ initFees: function (treeNode){
|
|
|
if (!treeNode.data.fees) {
|
|
|
treeNode.data.fees = [];
|
|
|
treeNode.data.feesIndex = {};
|
|
|
treeNode.changed = true;
|
|
|
};
|
|
|
},
|
|
|
- initFeeField(treeNode, fieldName){
|
|
|
+ initFeeField: function (treeNode, fieldName){
|
|
|
this.initFees(treeNode);
|
|
|
if (!treeNode.data.feesIndex[fieldName]) {
|
|
|
let fee = {
|
|
@@ -263,7 +171,7 @@ let nodeTools = {
|
|
|
treeNode.changed = true;
|
|
|
};
|
|
|
},
|
|
|
- checkFeeField(treeNode, feeObj){
|
|
|
+ checkFeeField: function (treeNode, feeObj){
|
|
|
if (!feeObj) return;
|
|
|
if (feeObj.fieldName == '') return;
|
|
|
|
|
@@ -284,7 +192,7 @@ let nodeTools = {
|
|
|
treeNode.changed = true;
|
|
|
};
|
|
|
},
|
|
|
- initSummaryFee(treeNode){
|
|
|
+ initSummaryFee: function (treeNode){
|
|
|
if (!treeNode.data.summaryFees){
|
|
|
treeNode.data.summaryFees = {
|
|
|
totalFee: 0,
|
|
@@ -295,7 +203,7 @@ let nodeTools = {
|
|
|
treeNode.changed = true;
|
|
|
};
|
|
|
},
|
|
|
- getCalcType(treeNode) {
|
|
|
+ getCalcType: function (treeNode) {
|
|
|
if (this.isRationCategory(treeNode)){
|
|
|
return treeNodeCalcType.ctRationCalcProgram;
|
|
|
}
|
|
@@ -321,11 +229,25 @@ let nodeTools = {
|
|
|
return treeNodeCalcType.ctRationCalcProgram;
|
|
|
};
|
|
|
},
|
|
|
- uiQuantity(treeNode){
|
|
|
+ // 界面显示的结点的工程量的数值。
|
|
|
+ uiQuantity: function (treeNode){
|
|
|
return parseFloatPlus(treeNode.data.quantity).toDecimal(decimalObj.decimal("quantity", treeNode));
|
|
|
},
|
|
|
+ // 界面显示的工料机价格,包括定额价、市场价等。参数 price 传入一个普通的价格数值即可。
|
|
|
+ uiGLJPrice: function (price){
|
|
|
+ if (price)
|
|
|
+ return parseFloat(price).toDecimal(decimalObj.glj.unitPrice)
|
|
|
+ else return 0;
|
|
|
+ },
|
|
|
+ // 界面显示的工料机数量。参数 quantity 传入一个普通的数量数值即可。
|
|
|
+ uiGLJQuantity: function (quantity){
|
|
|
+ if (quantity)
|
|
|
+ return parseFloat(quantity).toDecimal(decimalObj.glj.quantity)
|
|
|
+ else return 0;
|
|
|
+ },
|
|
|
|
|
|
- getFee(treeNode, fieldName) { // fieldName: 'common.totalFee'、'equipment.unitFee'
|
|
|
+ // 参数fieldName值: 'common.totalFee'、'equipment.unitFee'
|
|
|
+ getFee: function (treeNode, fieldName) {
|
|
|
let ns = fieldName.split(".");
|
|
|
if (ns.length != 2)
|
|
|
return 0
|
|
@@ -334,13 +256,214 @@ let nodeTools = {
|
|
|
else
|
|
|
return 0;
|
|
|
},
|
|
|
- getNodeByFlag(flag) {
|
|
|
+ getNodeByFlag: function (flag) {
|
|
|
let bill = cbTools.findBill(flag);
|
|
|
if (bill) return this.getNodeByID(bill.ID)
|
|
|
else return null;
|
|
|
},
|
|
|
- getNodeByID(ID){
|
|
|
+ getNodeByID: function (ID){
|
|
|
return cbTools.getNodeByID(ID);
|
|
|
+ },
|
|
|
+ getRationBaseFee: function (treeNode, gljTypes, priceType){
|
|
|
+ if (!treeNode.data.gljList) return 0;
|
|
|
+ let result = 0;
|
|
|
+ let me = this;
|
|
|
+ for (let glj of treeNode.data.gljList) {
|
|
|
+ let price = 0, temp = 0;
|
|
|
+ if (gljTypes.indexOf(glj.type) >= 0) {
|
|
|
+ if (priceType == priceTypes.ptDiffPrice){
|
|
|
+ let aprice = me.uiGLJPrice(glj["adjustPrice"]);
|
|
|
+ let mprice = me.uiGLJPrice(glj["marketPrice"]);
|
|
|
+ temp = (me.uiGLJQuantity(glj["quantity"]) * mprice).toDecimal(decimalObj.ration.unitPrice) - (me.uiGLJQuantity(glj["quantity"]) * aprice).toDecimal(decimalObj.ration.unitPrice);
|
|
|
+ temp = temp.toDecimal(decimalObj.ration.unitPrice);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (priceType == priceTypes.ptBasePrice){ price = me.uiGLJPrice(glj["basePrice"]);}
|
|
|
+ else if (priceType == priceTypes.ptAdjustPrice){price = me.uiGLJPrice(glj["adjustPrice"]);}
|
|
|
+ else if (priceType == priceTypes.ptMarketPrice){price = me.uiGLJPrice(glj["marketPrice"]);}
|
|
|
+ temp = (me.uiGLJQuantity(glj["quantity"]) * price).toDecimal(decimalObj.ration.unitPrice);
|
|
|
+ };
|
|
|
+
|
|
|
+ result = (result + temp).toDecimal(decimalObj.ration.unitPrice);
|
|
|
+ };
|
|
|
+ };
|
|
|
+ return result;
|
|
|
+},
|
|
|
+ calcEstimateFee: function (treeNode, isBase = false){
|
|
|
+ let me = this, sumU = 0, sumT = 0;
|
|
|
+ // 父清单暂估费的汇总计算走计算程序逻辑,不在这里。
|
|
|
+ if (nodeTools.isTotalCostBill(treeNode)){
|
|
|
+ let nodes = projectObj.project.mainTree.roots;
|
|
|
+ for (let node of nodes){
|
|
|
+ if (nodeTools.isTotalCostBill(node)) break;
|
|
|
+ let eU = 0, eT = 0;
|
|
|
+ if (node.data.feesIndex && node.data.feesIndex.estimate){
|
|
|
+ eU = node.data.feesIndex.estimate.unitFee;
|
|
|
+ eT = node.data.feesIndex.estimate.totalFee;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ eU = 0, eT = 0;
|
|
|
+ };
|
|
|
+ sumU = (sumU + parseFloatPlus(eU)).toDecimal(decimalObj.process);
|
|
|
+ sumT = (sumT + parseFloatPlus(eT)).toDecimal(decimalObj.process);
|
|
|
+ };
|
|
|
+ sumU = (sumU).toDecimal(decimalObj.bills.unitPrice);
|
|
|
+ sumT = (sumT).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ if (!treeNode.data.gljList) return;
|
|
|
+ let GLJObjs = [];
|
|
|
+ for (let glj of treeNode.data.gljList) {
|
|
|
+ if (allMaterialTypes.indexOf(glj.type) >= 0) {
|
|
|
+ if (glj.isEstimate){
|
|
|
+ GLJObjs.push({code: glj.code, name: glj.name, specs: glj.specs, unit: glj.unit, type: glj.type,
|
|
|
+ quantity: glj.quantity, marketPrice: glj.marketPrice});
|
|
|
+ }
|
|
|
+ else{ // 组成物
|
|
|
+ if (compositionTypes.indexOf(glj.type) >= 0){
|
|
|
+ let mds = projectObj.project.composition.getCompositionByGLJ(glj);
|
|
|
+ if (!mds) mds = [];
|
|
|
+ for (let md of mds){
|
|
|
+ if (md.isEstimate){
|
|
|
+ let isExist = false;
|
|
|
+ let mdQ = (me.uiGLJQuantity(glj.quantity) * me.uiGLJQuantity(md.consumption)).toDecimal(decimalObj.process);
|
|
|
+
|
|
|
+ for (let obj of GLJObjs){
|
|
|
+ if (gljOprObj.getIndex(md, gljKeyArray) == gljOprObj.getIndex(obj, gljKeyArray)){
|
|
|
+ isExist = true;
|
|
|
+ obj.quantity = (me.uiGLJQuantity(obj.quantity) + mdQ).toDecimal(decimalObj.process);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if (!isExist)
|
|
|
+ GLJObjs.push({code: md.code, name: md.name, specs: md.specs, unit: md.unit, type: md.type,
|
|
|
+ quantity: mdQ, marketPrice: md.marketPrice});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ };
|
|
|
+
|
|
|
+ for (let obj of GLJObjs){
|
|
|
+ sumU = sumU + (me.uiGLJQuantity(obj.quantity) * me.uiGLJPrice(obj.marketPrice)).toDecimal(decimalObj.process);
|
|
|
+ sumU = sumU.toDecimal(decimalObj.process);
|
|
|
+
|
|
|
+ let q = (me.uiGLJQuantity(obj.quantity) * me.uiQuantity(treeNode)).toDecimal(decimalObj.process);
|
|
|
+ sumT = sumT + (q * me.uiGLJPrice(obj.marketPrice)).toDecimal(decimalObj.process);
|
|
|
+ sumT = sumT.toDecimal(decimalObj.process);
|
|
|
+ };
|
|
|
+ sumU = sumU.toDecimal(decimalObj.bills.unitPrice);
|
|
|
+ if (projectObj.project.property.zanguCalcMode == zanguCalcType.common){
|
|
|
+ sumT = (nodeTools.uiQuantity(treeNode) * sumU).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ }
|
|
|
+ else if (projectObj.project.property.zanguCalcMode == zanguCalcType.gatherMaterial){
|
|
|
+ sumT = sumT.toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ };
|
|
|
+ };
|
|
|
+
|
|
|
+ if (isBase)
|
|
|
+ return sumU
|
|
|
+ else
|
|
|
+ nodeTools.checkFeeField(treeNode, {'fieldName': 'estimate', 'unitFee': sumU, 'totalFee': sumT});
|
|
|
+}
|
|
|
+};
|
|
|
+
|
|
|
+const rationCalcBaser = {
|
|
|
+ '定额基价人工费': function (node) {
|
|
|
+ return nodeTools.getRationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice);
|
|
|
+ },
|
|
|
+ '定额基价材料费': function (node) {
|
|
|
+ return nodeTools.getRationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice);
|
|
|
+ },
|
|
|
+ '定额基价机械费': function (node) {
|
|
|
+ return nodeTools.getRationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptBasePrice);
|
|
|
+ },
|
|
|
+ '定额基价机上人工费': function machineLabourFee(node) {
|
|
|
+ if (!node.data.gljList) return 0;
|
|
|
+ let result = 0, mdSum = 0;
|
|
|
+ for (let glj of node.data.gljList) {
|
|
|
+ if (glj.type == gljType.GENERAL_MACHINE) {
|
|
|
+ // 获取机械组成物
|
|
|
+ let mds = projectObj.project.composition.getCompositionByGLJ(glj);
|
|
|
+ if (!mds) mds = [];
|
|
|
+ for (let md of mds) {
|
|
|
+ if (md.type == gljType.MACHINE_LABOUR) {
|
|
|
+ let q = md["consumption"] ? md["consumption"] : 0;
|
|
|
+ let p = md["basePrice"] ? md["basePrice"] : 0;
|
|
|
+ mdSum = mdSum + (q * p).toDecimal(decimalObj.process);
|
|
|
+ mdSum = (mdSum).toDecimal(decimalObj.process);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ;
|
|
|
+ result = result + (glj["quantity"] * mdSum).toDecimal(decimalObj.process);
|
|
|
+ result = (result).toDecimal(decimalObj.process);
|
|
|
+ }
|
|
|
+ ;
|
|
|
+ }
|
|
|
+ ;
|
|
|
+ return result;
|
|
|
+ },
|
|
|
+ '人工费价差': function (node) {
|
|
|
+ return nodeTools.getRationBaseFee(node, [gljType.LABOUR], priceTypes.ptDiffPrice);
|
|
|
+ },
|
|
|
+ '材料费价差': function (node) {
|
|
|
+ return nodeTools.getRationBaseFee(node, baseMaterialTypes, priceTypes.ptDiffPrice);
|
|
|
+ },
|
|
|
+ '机械费价差': function (node) {
|
|
|
+ return nodeTools.getRationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptDiffPrice);
|
|
|
+ },
|
|
|
+ '主材费': function (node) {
|
|
|
+ return nodeTools.getRationBaseFee(node, [gljType.MAIN_MATERIAL], priceTypes.ptMarketPrice);
|
|
|
+ },
|
|
|
+ '设备费': function (node) {
|
|
|
+ return nodeTools.getRationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice);
|
|
|
+ },
|
|
|
+ '人工工日': function (node) {
|
|
|
+ if (!node.data.gljList) return 0;
|
|
|
+ let rst = 0;
|
|
|
+ for (let glj of node.data.gljList) {
|
|
|
+ if (glj.type == gljType.LABOUR) {
|
|
|
+ rst = rst + (me.uiGLJQuantity(glj["quantity"]) * me.uiQuantity(node)).toDecimal(decimalObj.process);
|
|
|
+ rst = rst.toDecimal(decimalObj.process);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return rst.toDecimal(decimalObj.glj.quantity);
|
|
|
+ },
|
|
|
+ '甲供定额基价人工费': function (node) {
|
|
|
+ },
|
|
|
+ '甲供定额基价材料费': function (node) {
|
|
|
+ },
|
|
|
+ '甲供定额基价机械费': function (node) {
|
|
|
+ },
|
|
|
+ '甲供主材费': function (node) {
|
|
|
+ },
|
|
|
+ '甲供设备费': function (node) {
|
|
|
+ },
|
|
|
+ '甲定定额基价人工费': function (node) {
|
|
|
+ },
|
|
|
+ '甲定定额基价材料费': function (node) {
|
|
|
+ },
|
|
|
+ '甲定定额基价机械费': function (node) {
|
|
|
+ },
|
|
|
+ '甲定主材费': function (node) {
|
|
|
+ },
|
|
|
+ '甲定设备费': function (node) {
|
|
|
+ },
|
|
|
+ '暂估材料费': function (node) {
|
|
|
+ return nodeTools.calcEstimateFee(node, true);
|
|
|
+ },
|
|
|
+ '分包定额基价人工费': function (node) {
|
|
|
+ },
|
|
|
+ '分包定额基价材料费': function (node) {
|
|
|
+ },
|
|
|
+ '分包定额基价机械费': function (node) {
|
|
|
+ },
|
|
|
+ '分包主材费': function (node) {
|
|
|
+ },
|
|
|
+ '分包设备费': function (node) {
|
|
|
+ },
|
|
|
+ '分包人工工日': function (node) {
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -796,83 +919,6 @@ class CalcProgram {
|
|
|
return ['labour', 'material', 'machine', 'mainMaterial', 'equipment'].indexOf(type) > -1;
|
|
|
};
|
|
|
|
|
|
- // 计算暂估费用
|
|
|
- function calcEstimateFee(treeNode){
|
|
|
- let sumU = 0, sumT = 0;
|
|
|
-
|
|
|
- if (nodeTools.isTotalCostBill(treeNode)){
|
|
|
- let nodes = projectObj.project.mainTree.roots;
|
|
|
- for (let node of nodes){
|
|
|
- if (nodeTools.isTotalCostBill(node)) break;
|
|
|
- let eU = 0, eT = 0;
|
|
|
- if (node.data.feesIndex && node.data.feesIndex.estimate){
|
|
|
- eU = node.data.feesIndex.estimate.unitFee;
|
|
|
- eT = node.data.feesIndex.estimate.totalFee;
|
|
|
- }
|
|
|
- else {
|
|
|
- eU = 0, eT = 0;
|
|
|
- };
|
|
|
- sumU = (sumU + parseFloatPlus(eU)).toDecimal(decimalObj.process);
|
|
|
- sumT = (sumT + parseFloatPlus(eT)).toDecimal(decimalObj.process);
|
|
|
- };
|
|
|
- sumU = (sumU).toDecimal(decimalObj.bills.unitPrice);
|
|
|
- sumT = (sumT).toDecimal(decimalObj.bills.totalPrice);
|
|
|
- }
|
|
|
- else{
|
|
|
- if (!treeNode.data.gljList) return;
|
|
|
- let GLJObjs = [];
|
|
|
- for (let glj of treeNode.data.gljList) {
|
|
|
- if (allMaterialTypes.indexOf(glj.type) >= 0) {
|
|
|
- if (glj.isEstimate){
|
|
|
- GLJObjs.push({code: glj.code, name: glj.name, specs: glj.specs, unit: glj.unit, type: glj.type,
|
|
|
- quantity: glj.quantity, marketPrice: glj.marketPrice});
|
|
|
- }
|
|
|
- else{ // 组成物
|
|
|
- if (compositionTypes.indexOf(glj.type) >= 0){
|
|
|
- let mds = projectObj.project.composition.getCompositionByGLJ(glj);
|
|
|
- if (!mds) mds = [];
|
|
|
- for (let md of mds){
|
|
|
- if (md.isEstimate){
|
|
|
- let isExist = false;
|
|
|
- let mdQ = (parseFloatPlus(glj.quantity) * parseFloatPlus(md.consumption)).toDecimal(decimalObj.process);
|
|
|
-
|
|
|
- for (let obj of GLJObjs){
|
|
|
- if (gljOprObj.getIndex(md, gljKeyArray) == gljOprObj.getIndex(obj, gljKeyArray)){
|
|
|
- isExist = true;
|
|
|
- obj.quantity = (parseFloatPlus(obj.quantity) + mdQ).toDecimal(decimalObj.process);
|
|
|
- break;
|
|
|
- }
|
|
|
- };
|
|
|
- if (!isExist)
|
|
|
- GLJObjs.push({code: md.code, name: md.name, specs: md.specs, unit: md.unit, type: md.type,
|
|
|
- quantity: mdQ, marketPrice: md.marketPrice});
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- };
|
|
|
-
|
|
|
- for (let obj of GLJObjs){
|
|
|
- sumU = sumU + (parseFloatPlus(obj.quantity) * parseFloatPlus(obj.marketPrice)).toDecimal(decimalObj.process);
|
|
|
- sumU = sumU.toDecimal(decimalObj.process);
|
|
|
-
|
|
|
- let q = (parseFloatPlus(obj.quantity) * parseFloatPlus(treeNode.data.quantity)).toDecimal(decimalObj.process);
|
|
|
- sumT = sumT + (q * parseFloatPlus(obj.marketPrice)).toDecimal(decimalObj.process);
|
|
|
- sumT = sumT.toDecimal(decimalObj.process);
|
|
|
- };
|
|
|
- sumU = sumU.toDecimal(decimalObj.bills.unitPrice);
|
|
|
- if (projectObj.project.property.zanguCalcMode == zanguCalcType.common){
|
|
|
- sumT = (nodeTools.uiQuantity(treeNode) * sumU).toDecimal(decimalObj.bills.totalPrice);
|
|
|
- }
|
|
|
- else if (projectObj.project.property.zanguCalcMode == zanguCalcType.gatherMaterial){
|
|
|
- sumT = sumT.toDecimal(decimalObj.bills.totalPrice);
|
|
|
- };
|
|
|
- };
|
|
|
-
|
|
|
- nodeTools.checkFeeField(treeNode, {'fieldName': 'estimate', 'unitFee': sumU, 'totalFee': sumT});
|
|
|
- };
|
|
|
-
|
|
|
// 删掉多余的费用。例如:从其它计算方式切换到公式计算方式,会多出其它的费(不光是common)
|
|
|
function deleteUselessFees(treeNode, fieldNameArr){
|
|
|
if (fieldNameArr){ // 用于计算程序没有绑定的费用类别,不要同步到清单,而清单因为以前计算过该类别又有值,需删除。如切换取费类别,旧费要清掉。
|
|
@@ -1017,7 +1063,7 @@ class CalcProgram {
|
|
|
// 总造价清单还要做单项工程、建设项目的四大项金额汇总
|
|
|
if (nodeTools.isTotalCostBill(treeNode)){
|
|
|
// 公式叶子清单没有暂估费,但总造价清单除外。
|
|
|
- calcEstimateFee(treeNode);
|
|
|
+ nodeTools.calcEstimateFee(treeNode);
|
|
|
nodeTools.initSummaryFee(treeNode);
|
|
|
treeNode.data.summaryFees.totalFee = tf;
|
|
|
treeNode.data.summaryFees.estimateFee = nodeTools.getFee(treeNode, 'estimate.totalFee');
|
|
@@ -1043,7 +1089,7 @@ class CalcProgram {
|
|
|
else{
|
|
|
treeNode.data.gljList = me.project.ration_glj.getGljArrByRation(treeNode.data.ID);
|
|
|
// 计算程序里没有暂估费的计算规则,会漏掉,所以这里要专门算。
|
|
|
- calcEstimateFee(treeNode);
|
|
|
+ nodeTools.calcEstimateFee(treeNode);
|
|
|
fnArr.push('estimate');
|
|
|
};
|
|
|
|
|
@@ -1060,7 +1106,7 @@ class CalcProgram {
|
|
|
}
|
|
|
|
|
|
// 叶子清单自己的计算程序计算,其暂估费也要汇总算。
|
|
|
- calcEstimateFee(treeNode);
|
|
|
+ nodeTools.calcEstimateFee(treeNode);
|
|
|
fnArr.push('estimate');
|
|
|
};
|
|
|
|