|
|
@@ -51,12 +51,7 @@ let calcTools = {
|
|
|
},
|
|
|
// 无效的、影响正常计算的行(无意义的空行、没有金额的行等)
|
|
|
isInvalidNode: function (treeNode) {
|
|
|
- return !(
|
|
|
- treeNode.data &&
|
|
|
- treeNode.data.feesIndex &&
|
|
|
- treeNode.data.feesIndex.common &&
|
|
|
- treeNode.data.feesIndex.common.totalFee
|
|
|
- );
|
|
|
+ return !(treeNode.data && treeNode.data.feesIndex && treeNode.data.feesIndex.common && treeNode.data.feesIndex.common.totalFee);
|
|
|
},
|
|
|
isCalcBaseBill: function (treeNode) {
|
|
|
return this.isLeafBill(treeNode) && treeNode.children.length === 0 && treeNode.data.calcBase;
|
|
|
@@ -78,9 +73,7 @@ let calcTools = {
|
|
|
isCalcManageRation: function (treeNode) {
|
|
|
return (
|
|
|
this.isRationCategory(treeNode) &&
|
|
|
- (treeNode.data.type === rationType.ration ||
|
|
|
- treeNode.data.type === rationType.install ||
|
|
|
- treeNode.data.type === rationType.itemIncrease)
|
|
|
+ (treeNode.data.type === rationType.ration || treeNode.data.type === rationType.install || treeNode.data.type === rationType.itemIncrease)
|
|
|
);
|
|
|
},
|
|
|
isVolumePrice: function (treeNode) {
|
|
|
@@ -91,10 +84,7 @@ let calcTools = {
|
|
|
},
|
|
|
isVP_or_GLJR: function (treeNode) {
|
|
|
// 是量价或工料机类型的定额
|
|
|
- return (
|
|
|
- this.isRationCategory(treeNode) &&
|
|
|
- (treeNode.data.type == rationType.volumePrice || treeNode.data.type == rationType.gljRation)
|
|
|
- );
|
|
|
+ return this.isRationCategory(treeNode) && (treeNode.data.type == rationType.volumePrice || treeNode.data.type == rationType.gljRation);
|
|
|
},
|
|
|
isSameTypeNode: function (node1, node2) {
|
|
|
if (
|
|
|
@@ -117,8 +107,7 @@ let calcTools = {
|
|
|
}
|
|
|
|
|
|
let flag = -1;
|
|
|
- if (cur.data.flagsIndex && cur.data.flagsIndex.fixed && cur.data.flagsIndex.fixed.flag)
|
|
|
- flag = cur.data.flagsIndex.fixed.flag;
|
|
|
+ if (cur.data.flagsIndex && cur.data.flagsIndex.fixed && cur.data.flagsIndex.fixed.flag) flag = cur.data.flagsIndex.fixed.flag;
|
|
|
|
|
|
return flagsArr.includes(flag);
|
|
|
},
|
|
|
@@ -230,8 +219,7 @@ let calcTools = {
|
|
|
|
|
|
// 初始化前,先拦截属性未定义、又要给该属性赋0的情况
|
|
|
if (!treeNode.data.feesIndex || !treeNode.data.feesIndex[feeObj.fieldName]) {
|
|
|
- if (feeObj.unitFee == 0 && feeObj.totalFee == 0 && feeObj.tenderUnitFee == 0 && feeObj.tenderTotalFee == 0)
|
|
|
- return;
|
|
|
+ if (feeObj.unitFee == 0 && feeObj.totalFee == 0 && feeObj.tenderUnitFee == 0 && feeObj.tenderTotalFee == 0) return;
|
|
|
}
|
|
|
|
|
|
this.initFeeField(treeNode, feeObj.fieldName);
|
|
|
@@ -247,10 +235,8 @@ let calcTools = {
|
|
|
}
|
|
|
|
|
|
// 不知在何种情况下,tenderUnitFee、tenderTotalFee的值会变成NaN,这里提前处理一下
|
|
|
- if (isNaN(treeNode.data.feesIndex[feeObj.fieldName].tenderUnitFee))
|
|
|
- treeNode.data.feesIndex[feeObj.fieldName].tenderUnitFee = undefined;
|
|
|
- if (isNaN(treeNode.data.feesIndex[feeObj.fieldName].tenderTotalFee))
|
|
|
- treeNode.data.feesIndex[feeObj.fieldName].tenderTotalFee = undefined;
|
|
|
+ if (isNaN(treeNode.data.feesIndex[feeObj.fieldName].tenderUnitFee)) treeNode.data.feesIndex[feeObj.fieldName].tenderUnitFee = undefined;
|
|
|
+ if (isNaN(treeNode.data.feesIndex[feeObj.fieldName].tenderTotalFee)) treeNode.data.feesIndex[feeObj.fieldName].tenderTotalFee = undefined;
|
|
|
|
|
|
if (treeNode.data.feesIndex[feeObj.fieldName].tenderUnitFee != feeObj.tenderUnitFee) {
|
|
|
treeNode.data.feesIndex[feeObj.fieldName].tenderUnitFee = feeObj.tenderUnitFee;
|
|
|
@@ -289,8 +275,7 @@ let calcTools = {
|
|
|
},
|
|
|
hasAdjustPrice: function () {
|
|
|
// 编办是否有材料的调整价发文
|
|
|
- if (projectObj.project.projSetting.glj_col && projectObj.project.projSetting.glj_col.showAdjustPrice == true)
|
|
|
- return true;
|
|
|
+ if (projectObj.project.projSetting.glj_col && projectObj.project.projSetting.glj_col.showAdjustPrice == true) return true;
|
|
|
else return false;
|
|
|
},
|
|
|
// 参数fieldName值: 'common.totalFee'、'equipment.unitFee'
|
|
|
@@ -311,10 +296,7 @@ let calcTools = {
|
|
|
temp2 = 0;
|
|
|
|
|
|
// 机械组成物价差: 机上人工、动力燃料
|
|
|
- if (
|
|
|
- priceType == priceTypes.ptDiffPrice &&
|
|
|
- (gljTypes.includes(gljType.MACHINE_LABOUR) || gljTypes.includes(gljType.FUEL_POWER_FEE))
|
|
|
- ) {
|
|
|
+ if (priceType == priceTypes.ptDiffPrice && (gljTypes.includes(gljType.MACHINE_LABOUR) || gljTypes.includes(gljType.FUEL_POWER_FEE))) {
|
|
|
for (let glj of treeNode.data.gljList) {
|
|
|
if ([gljType.GENERAL_MACHINE, gljType.INSTRUMENT].includes(glj.type)) {
|
|
|
let mds = projectObj.project.composition.getCompositionByGLJ(glj);
|
|
|
@@ -383,10 +365,7 @@ let calcTools = {
|
|
|
result = result.toDecimal(decimalObj.ration.unitPrice); // 重庆2018所有都是先汇总相减后再取舍
|
|
|
} else {
|
|
|
if (gljTypes == baseMaterialTypes) result = (temp - temp2).toDecimal(decimalObj.ration.unitPrice);
|
|
|
- else
|
|
|
- result = (
|
|
|
- temp.toDecimal(decimalObj.ration.unitPrice) - temp2.toDecimal(decimalObj.ration.unitPrice)
|
|
|
- ).toDecimal(decimalObj.ration.unitPrice);
|
|
|
+ else result = (temp.toDecimal(decimalObj.ration.unitPrice) - temp2.toDecimal(decimalObj.ration.unitPrice)).toDecimal(decimalObj.ration.unitPrice);
|
|
|
}
|
|
|
} else {
|
|
|
result = result.toDecimal(decimalObj.ration.unitPrice);
|
|
|
@@ -418,12 +397,8 @@ let calcTools = {
|
|
|
mdSum = mdSum.toDecimal(decimalObj.glj.unitPriceHasMix);
|
|
|
}
|
|
|
}
|
|
|
- if (typeof isCQ2018 != "undefined")
|
|
|
- result = (result + (gljQ * mdSum).toDecimal(decimalObj.process)).toDecimal(decimalObj.process);
|
|
|
- else
|
|
|
- result = (result + (gljQ * mdSum).toDecimal(decimalObj.ration.unitPrice)).toDecimal(
|
|
|
- decimalObj.ration.unitPrice
|
|
|
- );
|
|
|
+ if (typeof isCQ2018 != "undefined") result = (result + (gljQ * mdSum).toDecimal(decimalObj.process)).toDecimal(decimalObj.process);
|
|
|
+ else result = (result + (gljQ * mdSum).toDecimal(decimalObj.ration.unitPrice)).toDecimal(decimalObj.ration.unitPrice);
|
|
|
}
|
|
|
}
|
|
|
result = result.toDecimal(decimalObj.ration.unitPrice);
|
|
|
@@ -503,14 +478,10 @@ let calcTools = {
|
|
|
}
|
|
|
|
|
|
for (let obj of GLJObjs) {
|
|
|
- let t = (me.uiGLJQty(obj.quantity) * me.uiGLJPrice(obj.marketPrice, obj)).toDecimal(
|
|
|
- decimalObj.bills.totalPrice
|
|
|
- );
|
|
|
+ let t = (me.uiGLJQty(obj.quantity) * me.uiGLJPrice(obj.marketPrice, obj)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
rst.eT = (rst.eT + t).toDecimal(decimalObj.bills.totalPrice);
|
|
|
|
|
|
- let tt = (me.uiGLJQty(obj.tenderQuantity) * me.uiGLJPrice(obj.tenderPrice, obj)).toDecimal(
|
|
|
- decimalObj.bills.totalPrice
|
|
|
- );
|
|
|
+ let tt = (me.uiGLJQty(obj.tenderQuantity) * me.uiGLJPrice(obj.tenderPrice, obj)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
rst.eTT = (rst.eTT + tt).toDecimal(decimalObj.bills.totalPrice);
|
|
|
}
|
|
|
return rst;
|
|
|
@@ -521,9 +492,7 @@ let calcTools = {
|
|
|
for (let node of treeNode.children) {
|
|
|
if (node.data.feesIndex && node.data.feesIndex["estimate"]) {
|
|
|
rst.eT = (rst.eT + parseFloatPlus(node.data.feesIndex["estimate"].totalFee)).toDecimal(decimalObj.process);
|
|
|
- rst.eTT = (rst.eTT + parseFloatPlus(node.data.feesIndex["estimate"].tenderTotalFee)).toDecimal(
|
|
|
- decimalObj.process
|
|
|
- );
|
|
|
+ rst.eTT = (rst.eTT + parseFloatPlus(node.data.feesIndex["estimate"].tenderTotalFee)).toDecimal(decimalObj.process);
|
|
|
}
|
|
|
}
|
|
|
rst.eT = rst.eT.toDecimal(decimalObj.bills.totalPrice);
|
|
|
@@ -537,8 +506,7 @@ let calcTools = {
|
|
|
for (let glj of treeNode.data.gljList) {
|
|
|
if (!allMaterialTypes.includes(glj.type)) continue;
|
|
|
if (glj.isEstimate) {
|
|
|
- rst.eU =
|
|
|
- rst.eU + (me.uiGLJQty(glj.quantity) * me.uiGLJPrice(glj.marketPrice, glj)).toDecimal(decimalObj.process);
|
|
|
+ rst.eU = rst.eU + (me.uiGLJQty(glj.quantity) * me.uiGLJPrice(glj.marketPrice, glj)).toDecimal(decimalObj.process);
|
|
|
rst.eU = rst.eU.toDecimal(decimalObj.process);
|
|
|
// 不能直接用glj.tenderPrice,这个值不可靠。当调价界面删除单价系数后,tenderPrice没有实时计算,取得的值为0
|
|
|
rst.eTU = rst.eTU + (me.uiGLJQty(glj.tenderQuantity) * glj.tenderPrice).toDecimal(decimalObj.process);
|
|
|
@@ -665,8 +633,7 @@ let calcTools = {
|
|
|
(treeNode.data.subType === gljType.LABOUR && baseName.includes("人工")) || // 人工费、市场人工费
|
|
|
(baseMaterialTypes.includes(treeNode.data.subType) && baseName.includes("材料")) ||
|
|
|
// (treeNode.data.subType === gljType.GENERAL_MACHINE && (baseName.includes('机械') || baseName.includes('机具'))) ||
|
|
|
- (baseMachineTypes.includes(treeNode.data.subType) &&
|
|
|
- (baseName.includes("机械") || baseName.includes("机具"))) ||
|
|
|
+ (baseMachineTypes.includes(treeNode.data.subType) && (baseName.includes("机械") || baseName.includes("机具"))) ||
|
|
|
(treeNode.data.subType === gljType.MAIN_MATERIAL && baseName.includes("主材")) ||
|
|
|
(treeNode.data.subType === gljType.EQUIPMENT && baseName.includes("设备"));
|
|
|
return rst;
|
|
|
@@ -699,13 +666,9 @@ let calcTools = {
|
|
|
if (calcTools.isVolumePrice(treeNode)) {
|
|
|
if (isTender) {
|
|
|
let coe = this.tenderCoe_GLJPrice();
|
|
|
- if (treeNode.data.marketUnitFee)
|
|
|
- result = (parseFloat(treeNode.data.marketUnitFee) * coe).toDecimal(decimalObj.ration.unitPrice);
|
|
|
+ if (treeNode.data.marketUnitFee) result = (parseFloat(treeNode.data.marketUnitFee) * coe).toDecimal(decimalObj.ration.unitPrice);
|
|
|
else result = 0;
|
|
|
- } else
|
|
|
- result = treeNode.data.marketUnitFee
|
|
|
- ? parseFloat(treeNode.data.marketUnitFee).toDecimal(decimalObj.ration.unitPrice)
|
|
|
- : 0;
|
|
|
+ } else result = treeNode.data.marketUnitFee ? parseFloat(treeNode.data.marketUnitFee).toDecimal(decimalObj.ration.unitPrice) : 0;
|
|
|
} else if (calcTools.isGljRation(treeNode)) {
|
|
|
// result = treeNode.data.basePrice ? parseFloat(treeNode.data.basePrice).toDecimal(decimalObj.ration.unitPrice) : 0;
|
|
|
// 这里要取基价或市场价,但不能直接取basePrice,受限于项目属性的三个选项。
|
|
|
@@ -791,11 +754,7 @@ let calcTools = {
|
|
|
Q = Q ? Q : 1;
|
|
|
X = tempSGLJ.supply_quantity / Q;
|
|
|
}
|
|
|
- let gljP = isRationPirce
|
|
|
- ? glj.basePrice
|
|
|
- : isTender
|
|
|
- ? projectGLJ.getTenderMarketPrice(calcTools.getProjectGLJ(glj))
|
|
|
- : glj.marketPrice;
|
|
|
+ let gljP = isRationPirce ? glj.basePrice : isTender ? projectGLJ.getTenderMarketPrice(calcTools.getProjectGLJ(glj)) : glj.marketPrice;
|
|
|
sum = (sum + gljP * gljQ * X).toDecimal(decimalObj.process);
|
|
|
} else {
|
|
|
// 当前材料不是甲供材料
|
|
|
@@ -810,11 +769,7 @@ let calcTools = {
|
|
|
if (baseName.includes("甲供") && c.supply == supplyType.BFJG) {
|
|
|
X = c.supplyX;
|
|
|
}
|
|
|
- let cP = isRationPirce
|
|
|
- ? c.basePrice
|
|
|
- : isTender
|
|
|
- ? projectGLJ.getTenderMarketPrice(calcTools.getProjectGLJ(c))
|
|
|
- : c.marketPrice;
|
|
|
+ let cP = isRationPirce ? c.basePrice : isTender ? projectGLJ.getTenderMarketPrice(calcTools.getProjectGLJ(c)) : c.marketPrice;
|
|
|
sum = (sum + cP * c.consumption * gljQ * X).toDecimal(decimalObj.process);
|
|
|
}
|
|
|
}
|
|
|
@@ -833,8 +788,7 @@ let calcTools = {
|
|
|
} else if (this.isLeafBill(treeNode)) {
|
|
|
if (treeNode.children && treeNode.children.length > 0) {
|
|
|
// 清单单价计算模式下的叶子清单:取自己的计算程序ID,找到自己的计算程序计算。(汇总清单所有定额的工料机)
|
|
|
- if (projectObj.project.property.billsCalcMode === leafBillGetFeeType.billsPrice)
|
|
|
- return treeNodeCalcType.ctBillCalcProgram;
|
|
|
+ if (projectObj.project.property.billsCalcMode === leafBillGetFeeType.billsPrice) return treeNodeCalcType.ctBillCalcProgram;
|
|
|
// 前三种计算模式下的叶子清单:汇总定额的计算程序的费用类别
|
|
|
else return treeNodeCalcType.ctGatherRationsFees;
|
|
|
} else {
|
|
|
@@ -968,9 +922,7 @@ let calcTools = {
|
|
|
if (treeNode.data.rationQuantityCoe) qCoe = treeNode.data.rationQuantityCoe;
|
|
|
// };
|
|
|
if (qCoe == "0" || qCoe == 0) qCoe = 1;
|
|
|
- treeNode.data.tenderQuantity = (this.uiNodeQty(treeNode) * qCoe).toDecimal(
|
|
|
- decimalObj.decimal("quantity", treeNode)
|
|
|
- );
|
|
|
+ treeNode.data.tenderQuantity = (this.uiNodeQty(treeNode) * qCoe).toDecimal(decimalObj.decimal("quantity", treeNode));
|
|
|
return treeNode.data.tenderQuantity;
|
|
|
}
|
|
|
},
|
|
|
@@ -1088,8 +1040,7 @@ let calcTools = {
|
|
|
let r = projectObj.project.FeeRate.getFeeRateByID(node.data.feeRateID);
|
|
|
if (r) return scMathUtil.roundForObj(r.rate, decimal);
|
|
|
}
|
|
|
- if (node.data.feeRate || node.data.feeRate === 0 || node.data.feeRate === "0")
|
|
|
- return scMathUtil.roundForObj(node.data.feeRate, decimal);
|
|
|
+ if (node.data.feeRate || node.data.feeRate === 0 || node.data.feeRate === "0") return scMathUtil.roundForObj(node.data.feeRate, decimal);
|
|
|
|
|
|
return 100;
|
|
|
},
|
|
|
@@ -1141,11 +1092,7 @@ let calcTools = {
|
|
|
// 取树结点的调价系数。
|
|
|
getCoe: function (node, tender) {
|
|
|
if (tender == tenderTypes.ttReverseGLJ)
|
|
|
- return calcTools.isVP_or_GLJR(node)
|
|
|
- ? node.data.rationQuantityCoe
|
|
|
- : node.data.quantityCoe
|
|
|
- ? node.data.quantityCoe.labour
|
|
|
- : 0;
|
|
|
+ return calcTools.isVP_or_GLJR(node) ? node.data.rationQuantityCoe : node.data.quantityCoe ? node.data.quantityCoe.labour : 0;
|
|
|
else if (tender == tenderTypes.ttReverseRation) return node.data.rationQuantityCoe;
|
|
|
},
|
|
|
getUsedTemplates: function () {
|
|
|
@@ -1240,28 +1187,23 @@ let rationCalcBases = {
|
|
|
return calcTools.estimateFee(node, true, isTender);
|
|
|
},
|
|
|
分包定额基价人工费: function (node, isTender) {
|
|
|
- if (node.data.isSubcontract)
|
|
|
- return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
|
|
|
+ if (node.data.isSubcontract) return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
|
|
|
else return 0;
|
|
|
},
|
|
|
分包定额基价材料费: function (node, isTender) {
|
|
|
- if (node.data.isSubcontract)
|
|
|
- return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
|
|
|
+ if (node.data.isSubcontract) return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
|
|
|
else return 0;
|
|
|
},
|
|
|
分包定额基价机械费: function (node, isTender) {
|
|
|
- if (node.data.isSubcontract)
|
|
|
- return calcTools.rationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptBasePrice, isTender);
|
|
|
+ if (node.data.isSubcontract) return calcTools.rationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptBasePrice, isTender);
|
|
|
else return 0;
|
|
|
},
|
|
|
分包主材费: function (node, isTender) {
|
|
|
- if (node.data.isSubcontract)
|
|
|
- return calcTools.rationBaseFee(node, [gljType.MAIN_MATERIAL], priceTypes.ptBasePrice, isTender);
|
|
|
+ if (node.data.isSubcontract) return calcTools.rationBaseFee(node, [gljType.MAIN_MATERIAL], priceTypes.ptBasePrice, isTender);
|
|
|
else return 0;
|
|
|
},
|
|
|
分包设备费: function (node, isTender) {
|
|
|
- if (node.data.isSubcontract)
|
|
|
- return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
|
|
|
+ if (node.data.isSubcontract) return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
|
|
|
else return 0;
|
|
|
},
|
|
|
分包人工工日: function (node, isTender) {
|
|
|
@@ -1549,8 +1491,7 @@ let analyzer = {
|
|
|
|
|
|
calcItemLabourCoe: function (calcItem) {
|
|
|
let lc = 0;
|
|
|
- if (calcItem.labourCoeID)
|
|
|
- lc = projectObj.project.calcProgram.compiledLabourCoes[calcItem.labourCoeID].coe.toString();
|
|
|
+ if (calcItem.labourCoeID) lc = projectObj.project.calcProgram.compiledLabourCoes[calcItem.labourCoeID].coe.toString();
|
|
|
return lc;
|
|
|
},
|
|
|
templateRefresh: function (template) {
|
|
|
@@ -1618,11 +1559,7 @@ let executeObj = {
|
|
|
if (calcTools.isVP_or_GLJR(me.treeNode)) return calcTools.marketPriceToBase(me.treeNode, baseName, isTender);
|
|
|
else {
|
|
|
if (!rationCalcBases[baseName]) {
|
|
|
- hintBox.infoBox(
|
|
|
- "系统提示",
|
|
|
- "定额基数“" + baseName + "”未定义,计算错误。 (模板 " + me.template.ID + ",规则 " + me.tempCalcItem.ID + ")",
|
|
|
- 1
|
|
|
- );
|
|
|
+ hintBox.infoBox("系统提示", "定额基数“" + baseName + "”未定义,计算错误。 (模板 " + me.template.ID + ",规则 " + me.tempCalcItem.ID + ")", 1);
|
|
|
return 0;
|
|
|
} else return rationCalcBases[baseName](me.treeNode, isTender);
|
|
|
}
|
|
|
@@ -1637,14 +1574,7 @@ let executeObj = {
|
|
|
};
|
|
|
|
|
|
// 概算版本,定额计算不走计算程序,只用以下五大项简单的相加
|
|
|
-let budgetFields = [
|
|
|
- "rationLabour",
|
|
|
- "rationMaterial",
|
|
|
- "rationMachine",
|
|
|
- "rationMainMaterial",
|
|
|
- "rationEquipment",
|
|
|
- "common",
|
|
|
-];
|
|
|
+let budgetFields = ["rationLabour", "rationMaterial", "rationMachine", "rationMainMaterial", "rationEquipment", "common"];
|
|
|
let budgetBaseNames = ["定额人工费", "定额材料费", "定额施工机具使用费", "定额主材费", "定额设备费"];
|
|
|
|
|
|
class CalcProgram {
|
|
|
@@ -1891,6 +1821,7 @@ class CalcProgram {
|
|
|
|
|
|
// 清单部分抽取出来,供分摊清单公用。commonCalcType:1 叶子清单汇总定额的费用类别; 2 父清单汇总子清单的费用类别。3: 分摊:叶子清单汇总定额的费用类别。
|
|
|
innerCalcBill(treeNode, commonCalcType, tender = tenderTypes.ttCalc) {
|
|
|
+ debugger;
|
|
|
let me = this;
|
|
|
treeNode.data.programID = null;
|
|
|
calcTools.initFees(treeNode);
|
|
|
@@ -1932,14 +1863,12 @@ class CalcProgram {
|
|
|
btf = (btf + parseFloatPlus(node.data.feesIndex[ft.type].totalFee)).toDecimal(decimalObj.process);
|
|
|
bttf = (bttf + parseFloatPlus(node.data.feesIndex[ft.type].tenderTotalFee)).toDecimal(decimalObj.process);
|
|
|
// TASK #3834 (概算)造价书界面,新增“指标”列,指标=定额建安费(分部的合价)/ 分部的工程量,取两位小数。针对分部。
|
|
|
- if (isFB){
|
|
|
- if (nQ)
|
|
|
- buf = (btf / nQ).toDecimal(-2);
|
|
|
+ if (isFB) {
|
|
|
+ if (nQ) buf = (btf / nQ).toDecimal(-2);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (commonCalcType == 1 || commonCalcType == 3) {
|
|
|
+ } else if (commonCalcType == 1 || commonCalcType == 3) {
|
|
|
if (treeNode.data.lockUnitPrice == true) {
|
|
|
// 清单单价锁定
|
|
|
if (treeNode.data.feesIndex && treeNode.data.feesIndex[ft.type]) {
|
|
|
@@ -1948,8 +1877,7 @@ class CalcProgram {
|
|
|
btf = (bq * buf).toDecimal(decimalObj.bills.totalPrice);
|
|
|
bttf = (btq * btuf).toDecimal(decimalObj.bills.totalPrice);
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
let sum_rtf = 0,
|
|
|
sum_rttf = 0;
|
|
|
for (let node of nodes) {
|
|
|
@@ -1965,13 +1893,9 @@ class CalcProgram {
|
|
|
}
|
|
|
// 取费方式为子目含量,清单行/列的XX单价应 =ROUND( ∑ROUND(定额XX单价*含量,清单单价精度),清单单价精度)
|
|
|
if (me.project.property.billsCalcMode === leafBillGetFeeType.rationContent) {
|
|
|
- buf = (buf + (ruf * parseFloatPlus(node.data.contain)).toDecimal(decimalObj.bills.unitPrice)).toDecimal(
|
|
|
- decimalObj.process
|
|
|
- );
|
|
|
+ buf = (buf + (ruf * parseFloatPlus(node.data.contain)).toDecimal(decimalObj.bills.unitPrice)).toDecimal(decimalObj.process);
|
|
|
node.data.tenderContaion = (node.data.tenderQuantity / bq).toDecimal(decimalObj.process);
|
|
|
- btuf = (
|
|
|
- btuf + (rtuf * parseFloatPlus(node.data.tenderContaion)).toDecimal(decimalObj.bills.unitPrice)
|
|
|
- ).toDecimal(decimalObj.process);
|
|
|
+ btuf = (btuf + (rtuf * parseFloatPlus(node.data.tenderContaion)).toDecimal(decimalObj.bills.unitPrice)).toDecimal(decimalObj.process);
|
|
|
}
|
|
|
sum_rtf = (sum_rtf + rtf).toDecimal(decimalObj.process);
|
|
|
sum_rttf = (sum_rttf + rttf).toDecimal(decimalObj.process);
|
|
|
@@ -1984,10 +1908,7 @@ class CalcProgram {
|
|
|
buf = (sum_rtf / bq).toDecimal(decimalObj.process);
|
|
|
btuf = (sum_rttf / btq).toDecimal(decimalObj.process);
|
|
|
}
|
|
|
- if (
|
|
|
- isBaseFeeType(ft.type) ||
|
|
|
- (me.project.property.billsCalcMode === leafBillGetFeeType.rationPrice && ft.type == "common")
|
|
|
- ) {
|
|
|
+ if (isBaseFeeType(ft.type) || (me.project.property.billsCalcMode === leafBillGetFeeType.rationPrice && ft.type == "common")) {
|
|
|
btf = sum_rtf;
|
|
|
bttf = sum_rttf;
|
|
|
} else {
|
|
|
@@ -2045,14 +1966,8 @@ class CalcProgram {
|
|
|
calcTools.initSummaryFee(treeNode);
|
|
|
treeNode.data.summaryFees.totalFee = tf;
|
|
|
treeNode.data.summaryFees.estimateFee = calcTools.getFee(treeNode, "estimate.totalFee");
|
|
|
- treeNode.data.summaryFees.safetyFee = calcTools.getFee(
|
|
|
- calcTools.getNodeByFlag(fixedFlag.SAFETY_CONSTRUCTION),
|
|
|
- "common.totalFee"
|
|
|
- );
|
|
|
- treeNode.data.summaryFees.chargeFee = calcTools.getFee(
|
|
|
- calcTools.getNodeByFlag(fixedFlag.CHARGE),
|
|
|
- "common.totalFee"
|
|
|
- );
|
|
|
+ treeNode.data.summaryFees.safetyFee = calcTools.getFee(calcTools.getNodeByFlag(fixedFlag.SAFETY_CONSTRUCTION), "common.totalFee");
|
|
|
+ treeNode.data.summaryFees.chargeFee = calcTools.getFee(calcTools.getNodeByFlag(fixedFlag.CHARGE), "common.totalFee");
|
|
|
}
|
|
|
|
|
|
treeNode.data.calcTemplate = { calcItems: [] };
|
|
|
@@ -2099,12 +2014,7 @@ class CalcProgram {
|
|
|
if (calcTools.isVP_or_GLJR(treeNode)) {
|
|
|
let u = treeNode.data.marketUnitFee ? treeNode.data.marketUnitFee : 0;
|
|
|
let t = (u * nQ).toDecimal(decimalObj.ration.totalPrice);
|
|
|
- if (
|
|
|
- treeNode.data.marketTotalFee != t ||
|
|
|
- !treeNode.data.feesIndex ||
|
|
|
- !treeNode.data.feesIndex.common ||
|
|
|
- treeNode.data.feesIndex.common.totalFee != t
|
|
|
- ) {
|
|
|
+ if (treeNode.data.marketTotalFee != t || !treeNode.data.feesIndex || !treeNode.data.feesIndex.common || treeNode.data.feesIndex.common.totalFee != t) {
|
|
|
treeNode.data.marketTotalFee = t;
|
|
|
let obj = {};
|
|
|
obj.fieldName = "common";
|
|
|
@@ -2164,12 +2074,7 @@ class CalcProgram {
|
|
|
if (calcTools.isVP_or_GLJR(treeNode)) {
|
|
|
let u = treeNode.data.marketUnitFee ? treeNode.data.marketUnitFee : 0;
|
|
|
let t = (u * nQ).toDecimal(decimalObj.ration.totalPrice);
|
|
|
- if (
|
|
|
- treeNode.data.marketTotalFee != t ||
|
|
|
- !treeNode.data.feesIndex ||
|
|
|
- !treeNode.data.feesIndex.common ||
|
|
|
- treeNode.data.feesIndex.common.totalFee != t
|
|
|
- ) {
|
|
|
+ if (treeNode.data.marketTotalFee != t || !treeNode.data.feesIndex || !treeNode.data.feesIndex.common || treeNode.data.feesIndex.common.totalFee != t) {
|
|
|
treeNode.data.marketTotalFee = t;
|
|
|
let obj = {};
|
|
|
obj.fieldName = "common";
|
|
|
@@ -2205,9 +2110,7 @@ class CalcProgram {
|
|
|
}
|
|
|
let obj = {};
|
|
|
obj.fieldName = budgetFields[i];
|
|
|
- obj.unitFee = rationCalcBases[budgetBaseNames[i]](treeNode).toDecimal(
|
|
|
- decimalObj.decimal("unitPrice", treeNode)
|
|
|
- );
|
|
|
+ obj.unitFee = rationCalcBases[budgetBaseNames[i]](treeNode).toDecimal(decimalObj.decimal("unitPrice", treeNode));
|
|
|
obj.totalFee = (obj.unitFee * nQ).toDecimal(decimalObj.decimal("totalPrice", treeNode));
|
|
|
obj.tenderUnitFee = obj.unitFee;
|
|
|
obj.tenderTotalFee = obj.totalFee;
|
|
|
@@ -2231,9 +2134,7 @@ class CalcProgram {
|
|
|
let feeRate = 100; // 100%
|
|
|
if (calcItem.feeRate != undefined) feeRate = parseFloat(calcItem.feeRate).toDecimal(decimalObj.feeRate);
|
|
|
|
|
|
- calcItem.unitFee = (eval(calcItem.compiledExpr) * feeRate * 0.01).toDecimal(
|
|
|
- decimalObj.decimal("unitPrice", treeNode)
|
|
|
- );
|
|
|
+ calcItem.unitFee = (eval(calcItem.compiledExpr) * feeRate * 0.01).toDecimal(decimalObj.decimal("unitPrice", treeNode));
|
|
|
calcItem.totalFee = (calcItem.unitFee * nQ).toDecimal(decimalObj.decimal("totalPrice", treeNode));
|
|
|
|
|
|
let tExpr = analyzer.getCompiledTenderExpr(calcItem.compiledExpr);
|
|
|
@@ -2541,10 +2442,7 @@ class CalcProgram {
|
|
|
// ⑵执行此方法的前提:已在其它地方把总的目标金额分摊好了,此结点已获取目标金额。
|
|
|
reverseTenderCalc(treeNode, tender) {
|
|
|
if (tender == tenderTypes.ttReverseRation) {
|
|
|
- if (
|
|
|
- treeNode.data.feesIndex.common &&
|
|
|
- treeNode.data.feesIndex.common.tenderUnitFee != treeNode.data.feesIndex.common.unitFee
|
|
|
- ) {
|
|
|
+ if (treeNode.data.feesIndex.common && treeNode.data.feesIndex.common.tenderUnitFee != treeNode.data.feesIndex.common.unitFee) {
|
|
|
treeNode.data.feesIndex.common.tenderUnitFee = treeNode.data.feesIndex.common.unitFee;
|
|
|
treeNode.changed = true;
|
|
|
}
|
|
|
@@ -2553,23 +2451,15 @@ class CalcProgram {
|
|
|
if (!treeNode.data.targetTotalFee) {
|
|
|
// 没有目标金额、但有输入目标单价的:根据目标单价算出目标金额。
|
|
|
if (treeNode.data.targetUnitFee) {
|
|
|
- treeNode.data.targetTotalFee = (treeNode.data.targetUnitFee * treeNode.data.quantity).toDecimal(
|
|
|
- decimalObj.decimal("totalPrice", treeNode)
|
|
|
- );
|
|
|
+ treeNode.data.targetTotalFee = (treeNode.data.targetUnitFee * treeNode.data.quantity).toDecimal(decimalObj.decimal("totalPrice", treeNode));
|
|
|
treeNode.changed = true;
|
|
|
} else {
|
|
|
// 既没有目标金额也没有目标单价,此时要初始化使调价合价=原始综合合价,调价单价=原始综合单价。
|
|
|
- if (
|
|
|
- treeNode.data.feesIndex.common &&
|
|
|
- treeNode.data.feesIndex.common.tenderUnitFee != treeNode.data.feesIndex.common.unitFee
|
|
|
- ) {
|
|
|
+ if (treeNode.data.feesIndex.common && treeNode.data.feesIndex.common.tenderUnitFee != treeNode.data.feesIndex.common.unitFee) {
|
|
|
treeNode.data.feesIndex.common.tenderUnitFee = treeNode.data.feesIndex.common.unitFee;
|
|
|
treeNode.changed = true;
|
|
|
}
|
|
|
- if (
|
|
|
- treeNode.data.feesIndex.common &&
|
|
|
- treeNode.data.feesIndex.common.tenderTotalFee != treeNode.data.feesIndex.common.totalFee
|
|
|
- ) {
|
|
|
+ if (treeNode.data.feesIndex.common && treeNode.data.feesIndex.common.tenderTotalFee != treeNode.data.feesIndex.common.totalFee) {
|
|
|
treeNode.data.feesIndex.common.tenderTotalFee = treeNode.data.feesIndex.common.totalFee;
|
|
|
treeNode.changed = true;
|
|
|
}
|
|
|
@@ -2580,9 +2470,7 @@ class CalcProgram {
|
|
|
// 经过前面的一通折腾还是没有目标单价的话,那么就要通过目标金额算出来。
|
|
|
if (!treeNode.data.targetUnitFee || parseFloat(treeNode.data.targetUnitFee) == 0) {
|
|
|
if (calcTools.hasQuantity(treeNode))
|
|
|
- treeNode.data.targetUnitFee = (treeNode.data.targetTotalFee / treeNode.data.quantity).toDecimal(
|
|
|
- decimalObj.decimal("unitPrice", treeNode)
|
|
|
- );
|
|
|
+ treeNode.data.targetUnitFee = (treeNode.data.targetTotalFee / treeNode.data.quantity).toDecimal(decimalObj.decimal("unitPrice", treeNode));
|
|
|
}
|
|
|
|
|
|
// 系数=调后单价/调前单价
|
|
|
@@ -2611,9 +2499,7 @@ class CalcProgram {
|
|
|
treeNode.changed = true;
|
|
|
}
|
|
|
|
|
|
- let ttf = (treeNode.data.tenderQuantity * treeNode.data.feesIndex.common.tenderUnitFee).toDecimal(
|
|
|
- decimalObj.decimal("totalPrice", treeNode)
|
|
|
- );
|
|
|
+ let ttf = (treeNode.data.tenderQuantity * treeNode.data.feesIndex.common.tenderUnitFee).toDecimal(decimalObj.decimal("totalPrice", treeNode));
|
|
|
if (treeNode.data.feesIndex.common.tenderTotalFee != ttf) {
|
|
|
treeNode.data.feesIndex.common.tenderTotalFee = ttf;
|
|
|
treeNode.changed = true;
|
|
|
@@ -2711,10 +2597,7 @@ class CalcProgram {
|
|
|
treeNode.data.tender_activeTotal = treeNode.data.feesIndex["common"].totalFee;
|
|
|
|
|
|
// 开始分摊:只分摊自有目标金额、从父结点分摊到的金额(不分摊子结点汇总上来的金额)
|
|
|
- if (
|
|
|
- calcTools.hasTargetTotalFee(treeNode) &&
|
|
|
- !(treeNode.data.tender_distribute && treeNode.data.tender_distribute == 2)
|
|
|
- ) {
|
|
|
+ if (calcTools.hasTargetTotalFee(treeNode) && !(treeNode.data.tender_distribute && treeNode.data.tender_distribute == 2)) {
|
|
|
treeNode.data.tender_activeTarget = treeNode.data.targetTotalFee;
|
|
|
|
|
|
// 先把会破坏金额比例关系的孩子排除:1.有目标金额的 2.满载的(孙子全满,没有分摊空间,所以实质上该孩子的金额已被锁死无法分摊)
|
|
|
@@ -2734,17 +2617,13 @@ class CalcProgram {
|
|
|
}
|
|
|
|
|
|
if (treeNode.data.tender_activeTotal != 0) {
|
|
|
- let coe = (treeNode.data.tender_activeTarget / treeNode.data.tender_activeTotal).toDecimal(
|
|
|
- decimalObj.process
|
|
|
- );
|
|
|
+ let coe = (treeNode.data.tender_activeTarget / treeNode.data.tender_activeTotal).toDecimal(decimalObj.process);
|
|
|
|
|
|
for (let i = 0; i < treeNode.children.length; i++) {
|
|
|
let child = treeNode.children[i];
|
|
|
if (!child.data.feesIndex || !child.data.feesIndex["common"]) continue; // 空白行清单、定额
|
|
|
if (!calcTools.hasTargetTotalFee(child)) {
|
|
|
- child.data.tender_activeTarget = (coe * child.data.tender_activeTotal).toDecimal(
|
|
|
- decimalObj.decimal("totalPrice", treeNode)
|
|
|
- );
|
|
|
+ child.data.tender_activeTarget = (coe * child.data.tender_activeTotal).toDecimal(decimalObj.decimal("totalPrice", treeNode));
|
|
|
child.data.targetTotalFee = child.data.tender_activeTarget;
|
|
|
child.data.tender_distribute = 1; // 1表示分摊金额来自父结点。2表示分摊金额来自孩子结点。
|
|
|
}
|
|
|
@@ -2860,9 +2739,7 @@ class CalcProgram {
|
|
|
closeNode.data.quantityCoe.material = (closeNode.data.quantityCoe.material + d).toDecimal(decimalObj.process);
|
|
|
closeNode.data.quantityCoe.machine = (closeNode.data.quantityCoe.machine + d).toDecimal(decimalObj.process);
|
|
|
closeNode.data.quantityCoe.main = (closeNode.data.quantityCoe.main + d).toDecimal(decimalObj.process);
|
|
|
- closeNode.data.quantityCoe.equipment = (closeNode.data.quantityCoe.equipment + d).toDecimal(
|
|
|
- decimalObj.process
|
|
|
- );
|
|
|
+ closeNode.data.quantityCoe.equipment = (closeNode.data.quantityCoe.equipment + d).toDecimal(decimalObj.process);
|
|
|
}
|
|
|
}
|
|
|
|