|
@@ -314,11 +314,17 @@ let gljUtil = {
|
|
|
let price_hasM_decimal = decimalObj.glj.unitPriceHasMix ? decimalObj.glj.unitPriceHasMix : decimalObj.glj.unitPrice;
|
|
let price_hasM_decimal = decimalObj.glj.unitPriceHasMix ? decimalObj.glj.unitPriceHasMix : decimalObj.glj.unitPrice;
|
|
|
let quantity_decimal = decimalObj.glj.quantity;
|
|
let quantity_decimal = decimalObj.glj.quantity;
|
|
|
let process_decimal = this.isDef(decimalObj.marketPriceProcess) ? decimalObj.marketPriceProcess : decimalObj.process; //20200722 旧的项目还是默认6位,新的用两位
|
|
let process_decimal = this.isDef(decimalObj.marketPriceProcess) ? decimalObj.marketPriceProcess : decimalObj.process; //20200722 旧的项目还是默认6位,新的用两位
|
|
|
|
|
+ let feeRate_decimal = decimalObj.feeRate;
|
|
|
let priceCoe = this.isDef(tenderCoe) ? tenderCoe : 1;
|
|
let priceCoe = this.isDef(tenderCoe) ? tenderCoe : 1;
|
|
|
if (priceCoe == '0' || priceCoe == 0) priceCoe = 1; // 这里加个保护
|
|
if (priceCoe == '0' || priceCoe == 0) priceCoe = 1; // 这里加个保护
|
|
|
if (['GLF', 'LR', 'FXF'].includes(glj.code)) priceCoe = 1; // 类型是“企业管理费”、“利润”、“一般风险费”的,不应调整单价。
|
|
if (['GLF', 'LR', 'FXF'].includes(glj.code)) priceCoe = 1; // 类型是“企业管理费”、“利润”、“一般风险费”的,不应调整单价。
|
|
|
if (!this.isConcreteType(glj.unit_price.type) && this.notEditType.indexOf(glj.unit_price.type) != -1 && glj.ratio_data.length > 0) { //对于机械台班等有组成物的材料,价格需根据组成物计算得出(排除混凝土、配合比、砂浆这几个类型直接为0)。
|
|
if (!this.isConcreteType(glj.unit_price.type) && this.notEditType.indexOf(glj.unit_price.type) != -1 && glj.ratio_data.length > 0) { //对于机械台班等有组成物的材料,价格需根据组成物计算得出(排除混凝土、配合比、砂浆这几个类型直接为0)。
|
|
|
let p = 0;
|
|
let p = 0;
|
|
|
|
|
+ let consSum = 0; //不变费用总和
|
|
|
|
|
+ let temSum = 0;//可变费用总和
|
|
|
|
|
+ //不变费用组成物包括:折旧费、检修费、维护费、安拆辅助费,这几个材料只能通过名称判断了,类型没有细分。
|
|
|
|
|
+ let constNames = ['折旧费','检修费','维护费','安拆辅助费'];
|
|
|
|
|
+ let constCoe = scMathUtil.roundForObj(projectGLJDatas.constData.machineConstCoe,feeRate_decimal);
|
|
|
for (let ratio of glj.ratio_data) {
|
|
for (let ratio of glj.ratio_data) {
|
|
|
let rIndex = gljUtil.getIndex(ratio);
|
|
let rIndex = gljUtil.getIndex(ratio);
|
|
|
let tem = _.find(projectGLJDatas.gljList, function (item) {
|
|
let tem = _.find(projectGLJDatas.gljList, function (item) {
|
|
@@ -329,15 +335,18 @@ let gljUtil = {
|
|
|
if (ext && ext[tem.id] && this.isDef(ext[tem.id].marketPrice)) { //在修改组成物的价格或消耗量时,影响了父工料机的价格,这时以父工料机的价格应当用组成物的新值来记算
|
|
if (ext && ext[tem.id] && this.isDef(ext[tem.id].marketPrice)) { //在修改组成物的价格或消耗量时,影响了父工料机的价格,这时以父工料机的价格应当用组成物的新值来记算
|
|
|
tem_marketPrice = ext[tem.id].marketPrice;
|
|
tem_marketPrice = ext[tem.id].marketPrice;
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
let temP = scMathUtil.roundForObj(tem_marketPrice * priceCoe, price_decimal) * scMathUtil.roundForObj(ratio.consumption, quantity_decimal);
|
|
let temP = scMathUtil.roundForObj(tem_marketPrice * priceCoe, price_decimal) * scMathUtil.roundForObj(ratio.consumption, quantity_decimal);
|
|
|
if(decimalObj.temProcess) temP = scMathUtil.roundForObj(temP, decimalObj.temProcess);//取两次防止中间过程使用两位导致 4舍5入后少0.01的情况
|
|
if(decimalObj.temProcess) temP = scMathUtil.roundForObj(temP, decimalObj.temProcess);//取两次防止中间过程使用两位导致 4舍5入后少0.01的情况
|
|
|
temP = scMathUtil.roundForObj(temP,process_decimal);
|
|
temP = scMathUtil.roundForObj(temP,process_decimal);
|
|
|
- p = scMathUtil.roundForObj(temP + p, process_decimal);
|
|
|
|
|
|
|
+ if(constNames.includes(tem.name) && constCoe !== 1){//不等于1的时候才要另外计算
|
|
|
|
|
+ temP = scMathUtil.roundForObj(temP*constCoe,process_decimal);
|
|
|
|
|
+ consSum = scMathUtil.roundForObj(temP + consSum,process_decimal);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ temSum = scMathUtil.roundForObj(temP + temSum, process_decimal);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return scMathUtil.roundForObj(p, price_hasM_decimal);
|
|
|
|
|
|
|
+ return scMathUtil.roundForObj(temSum + consSum, price_hasM_decimal);
|
|
|
} else {
|
|
} else {
|
|
|
let tem_decimal = price_decimal; //isRadio==true?process_decimal:price_decimal;
|
|
let tem_decimal = price_decimal; //isRadio==true?process_decimal:price_decimal;
|
|
|
let tem_price = scMathUtil.roundForObj(glj.unit_price.market_price, price_decimal);
|
|
let tem_price = scMathUtil.roundForObj(glj.unit_price.market_price, price_decimal);
|