|
@@ -359,15 +359,18 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal) {
|
|
|
billsTtlAmt:bills.quantity,
|
|
billsTtlAmt:bills.quantity,
|
|
|
billsPrices:[],
|
|
billsPrices:[],
|
|
|
billsUnitPrices:[],
|
|
billsUnitPrices:[],
|
|
|
|
|
+ rationCommons:[],
|
|
|
billsAmounts:[],
|
|
billsAmounts:[],
|
|
|
'技术经济指标':[],
|
|
'技术经济指标':[],
|
|
|
billsLevel:level,
|
|
billsLevel:level,
|
|
|
billsMemos:bills.remark
|
|
billsMemos:bills.remark
|
|
|
};
|
|
};
|
|
|
let total = 0;
|
|
let total = 0;
|
|
|
|
|
+ let rationTotal =0;
|
|
|
for(let n of nameList){
|
|
for(let n of nameList){
|
|
|
let p = 0;//金额
|
|
let p = 0;//金额
|
|
|
let up =0;//单价
|
|
let up =0;//单价
|
|
|
|
|
+ let ra = 0;//定额建安费
|
|
|
if(bills.unitPrices[n]) up = scMathUtil.roundForObj(bills.unitPrices[n],decimal.bills.unitPrice);
|
|
if(bills.unitPrices[n]) up = scMathUtil.roundForObj(bills.unitPrices[n],decimal.bills.unitPrice);
|
|
|
tem.billsUnitPrices.push(up);
|
|
tem.billsUnitPrices.push(up);
|
|
|
if(bills.prices[n]){
|
|
if(bills.prices[n]){
|
|
@@ -375,6 +378,11 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal) {
|
|
|
total = scMathUtil.roundForObj(p+total,decimal.process);
|
|
total = scMathUtil.roundForObj(p+total,decimal.process);
|
|
|
}
|
|
}
|
|
|
tem.billsPrices.push(p);
|
|
tem.billsPrices.push(p);
|
|
|
|
|
+ if(bills.rationCommons[n]){
|
|
|
|
|
+ ra = scMathUtil.roundForObj(bills.rationCommons[n],decimal.bills.totalPrice);
|
|
|
|
|
+ total = scMathUtil.roundForObj(ra+rationTotal,decimal.process);
|
|
|
|
|
+ }
|
|
|
|
|
+ tem.rationCommons.push(ra);
|
|
|
if(bills.quantityMap[n] && parseFloat(bills.quantityMap[n]) !== 0){
|
|
if(bills.quantityMap[n] && parseFloat(bills.quantityMap[n]) !== 0){
|
|
|
tem.billsAmounts.push(bills.quantityMap[n]);
|
|
tem.billsAmounts.push(bills.quantityMap[n]);
|
|
|
tem['技术经济指标'].push(scMathUtil.roundForObj(p/bills.quantityMap[n],2));
|
|
tem['技术经济指标'].push(scMathUtil.roundForObj(p/bills.quantityMap[n],2));
|
|
@@ -384,6 +392,7 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
tem.billsTtlPrice = scMathUtil.roundForObj(total,decimal.bills.totalPrice);
|
|
tem.billsTtlPrice = scMathUtil.roundForObj(total,decimal.bills.totalPrice);
|
|
|
|
|
+ tem.rationTotal = scMathUtil.roundForObj(rationTotal,decimal.bills.totalPrice);//定额总建安费
|
|
|
tem['技术经济综合指标'] = (tem.billsTtlAmt && parseFloat(tem.billsTtlAmt) !== 0)?scMathUtil.roundForObj(tem.billsTtlPrice/tem.billsTtlAmt,2):scMathUtil.roundForObj(tem.billsTtlPrice,2);
|
|
tem['技术经济综合指标'] = (tem.billsTtlAmt && parseFloat(tem.billsTtlAmt) !== 0)?scMathUtil.roundForObj(tem.billsTtlPrice/tem.billsTtlAmt,2):scMathUtil.roundForObj(tem.billsTtlPrice,2);
|
|
|
if(bills.flag == fixedFlag.TOTAL_COST) totalItem = tem;
|
|
if(bills.flag == fixedFlag.TOTAL_COST) totalItem = tem;
|
|
|
return tem
|
|
return tem
|
|
@@ -415,6 +424,7 @@ async function mergeItem(a,b,decimal,project) {
|
|
|
a.quantity = scMathUtil.roundForObj(a.quantity+b.quantity,decimal.process);
|
|
a.quantity = scMathUtil.roundForObj(a.quantity+b.quantity,decimal.process);
|
|
|
for(let name in b.prices){
|
|
for(let name in b.prices){
|
|
|
a.prices[name] = b.prices[name];
|
|
a.prices[name] = b.prices[name];
|
|
|
|
|
+ a.rationCommons[name] = b.rationCommons[name];
|
|
|
a.quantityMap[name] = b.quantityMap[name];
|
|
a.quantityMap[name] = b.quantityMap[name];
|
|
|
a.unitPrices[name]=b.unitPrices[name];
|
|
a.unitPrices[name]=b.unitPrices[name];
|
|
|
}
|
|
}
|
|
@@ -516,11 +526,14 @@ async function getBillsByProjectID(projectID){
|
|
|
let prices = {};
|
|
let prices = {};
|
|
|
let quantityMap={};
|
|
let quantityMap={};
|
|
|
let unitPrices ={};
|
|
let unitPrices ={};
|
|
|
|
|
+ let rationCommons={};
|
|
|
|
|
+ let rationFee = _.find(b._doc.fees,{"fieldName":"rationCommon"});
|
|
|
if(commonFee&&commonFee.totalFee) prices[projectName] = commonFee.totalFee;
|
|
if(commonFee&&commonFee.totalFee) prices[projectName] = commonFee.totalFee;
|
|
|
- if (commonFee&&commonFee.unitFee) unitPrices[projectName] = commonFee.unitFee;
|
|
|
|
|
|
|
+ if(commonFee&&commonFee.unitFee) unitPrices[projectName] = commonFee.unitFee;
|
|
|
|
|
+ if(rationFee&&rationFee.totalFee) rationCommons[projectName] = rationFee.totalFee;
|
|
|
quantityMap[projectName] = b.quantity;
|
|
quantityMap[projectName] = b.quantity;
|
|
|
let flagIndex = _.find(b._doc.flags,{'fieldName':'fixed'});
|
|
let flagIndex = _.find(b._doc.flags,{'fieldName':'fixed'});
|
|
|
- let doc = {ID:b.ID,name:b.name,code:b.code,unit:b.unit,projectID:b.projectID, ParentID:b.ParentID,NextSiblingID:b.NextSiblingID,unitPrices:unitPrices,quantity:b.quantity,prices:prices,quantityMap:quantityMap,flag:flagIndex?flagIndex.flag:-99,remark:b.remark};//选取有用字段
|
|
|
|
|
|
|
+ let doc = {ID:b.ID,name:b.name,code:b.code,unit:b.unit,projectID:b.projectID, ParentID:b.ParentID,NextSiblingID:b.NextSiblingID,unitPrices:unitPrices,quantity:b.quantity,prices:prices,rationCommons:rationCommons,quantityMap:quantityMap,flag:flagIndex?flagIndex.flag:-99,remark:b.remark};//选取有用字段
|
|
|
if(b.ParentID == -1) roots.push(doc);
|
|
if(b.ParentID == -1) roots.push(doc);
|
|
|
parentMap[b.ParentID]?parentMap[b.ParentID].push(doc):parentMap[b.ParentID]=[doc];
|
|
parentMap[b.ParentID]?parentMap[b.ParentID].push(doc):parentMap[b.ParentID]=[doc];
|
|
|
}//设置子节点
|
|
}//设置子节点
|