|
@@ -151,7 +151,26 @@ module.exports={
|
|
|
const constructionFeeBills = await this.getConstructionFeeData(constructionID, sortedOtherFeeBills[0].ID);
|
|
|
// 汇算工程费用
|
|
|
await this.summarizeData(constructionFeeBills);
|
|
|
- return [...constructionFeeBills, ...sortedOtherFeeBills];
|
|
|
+ const rst = [...constructionFeeBills, ...sortedOtherFeeBills];
|
|
|
+ // 方便报表取数据,规范数据
|
|
|
+ rst.forEach(item => {
|
|
|
+ item.code = item.code || '';
|
|
|
+ item.name = item.name || '';
|
|
|
+ item.unit = item.unit || '';
|
|
|
+ item.quantity = item.quantity || '';
|
|
|
+ const buildingFeeItem = item.fees && item.fees.find(f => f.fieldName === 'building');
|
|
|
+ const installFeeItem = item.fees && item.fees.find(f => f.fieldName === 'installation');
|
|
|
+ const equipmentFeeItem = item.fees && item.fees.find(f => f.fieldName === 'equipment');
|
|
|
+ const otherFeeItem = item.fees && item.fees.find(f => f.fieldName === 'other');
|
|
|
+ const totalFeeItem = item.fees && item.fees.find(f => f.fieldName === 'common');
|
|
|
+ item.buildingFee = buildingFeeItem ? buildingFeeItem.totalFee : 0;
|
|
|
+ item.installationFee = installFeeItem ? installFeeItem.totalFee : 0;
|
|
|
+ item.equipmentFee = equipmentFeeItem ? equipmentFeeItem.totalFee : 0;
|
|
|
+ item.otherFee = otherFeeItem ? otherFeeItem.totalFee : 0;
|
|
|
+ item.totalFee = totalFeeItem ? totalFeeItem.totalFee : 0;
|
|
|
+ item.rate = '0';
|
|
|
+ });
|
|
|
+ return rst;
|
|
|
},
|
|
|
// 获取工程费用数据,作为概算汇总数据的拼接树数据
|
|
|
getConstructionFeeData: async function (constructionID, nextID) {
|