|
@@ -503,6 +503,12 @@ async function getShareInfoAfterChangePermission(permissionType, receiver, proje
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
+// 拷贝概算汇总清单
|
|
|
+async function copyBudgetSummaryBills(orgConstructionID, newConstructionID) {
|
|
|
+ const billsMap = await createIDsAndReturn(orgConstructionID,billsModel);
|
|
|
+ await copyBills(newConstructionID, billsMap);
|
|
|
+}
|
|
|
+
|
|
|
//拷贝例题项目
|
|
|
//@param {String}userID {Array}projIDs拷贝的例题项目ID(建设项目、文件夹)@return {Boolean}
|
|
|
async function copyExample(userID, compilation, projIDs,nameMap){
|
|
@@ -558,6 +564,10 @@ async function copyExample(userID, compilation, projIDs,nameMap){
|
|
|
data.compilation = compilation;
|
|
|
data.shareInfo = [];
|
|
|
if (data.projType !== projectType.tender) {
|
|
|
+ if (data.projType === projectType.project) {
|
|
|
+ // 拷贝概算汇总清单
|
|
|
+ await copyBudgetSummaryBills(orgID, data.ID);
|
|
|
+ }
|
|
|
let newData = _.cloneDeep(data);
|
|
|
delete newData._id;
|
|
|
// await projectModel.create(newData);
|
|
@@ -1430,7 +1440,7 @@ async function getSummaryInfo(projectIDs, summaryField = defaultSummaryField){
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- IDMapping[project.ID] = { engineeringCost: summaryMap[project.ID].totalFee || 0, rate: summaryMap[project.ID].rate || 0, buildingArea: grossArea, perCost: ''};
|
|
|
+ IDMapping[project.ID] = { engineeringCost: +summaryMap[project.ID].totalFee || 0, rate: summaryMap[project.ID].rate || 0, buildingArea: grossArea, perCost: ''};
|
|
|
}
|
|
|
|
|
|
//单项工程
|
|
@@ -1440,7 +1450,7 @@ async function getSummaryInfo(projectIDs, summaryField = defaultSummaryField){
|
|
|
|
|
|
for(let eng of engineerings){
|
|
|
engIDs.push(eng.ID);
|
|
|
- IDMapping[eng.ID] = {engineeringCost: summaryMap[eng.ID].totalFee || 0, rate: summaryMap[eng.ID].rate || 0, buildingArea: '', perCost: ''};
|
|
|
+ IDMapping[eng.ID] = {engineeringCost: +summaryMap[eng.ID].totalFee || 0, rate: summaryMap[eng.ID].rate || 0, buildingArea: '', perCost: ''};
|
|
|
}
|
|
|
//单位工程
|
|
|
if(engIDs.length > 0){
|
|
@@ -1450,7 +1460,7 @@ async function getSummaryInfo(projectIDs, summaryField = defaultSummaryField){
|
|
|
if(tenders.length > 0){
|
|
|
for(let tender of tenders){
|
|
|
tenderIDs.push(tender.ID);
|
|
|
- IDMapping[tender.ID] = {engineeringCost: summaryMap[tender.ID].totalFee || 0, rate: summaryMap[tender.ID].rate || 0,buildingArea: '', perCost: '', changeMark:tender.changeMark,property:tender.property};
|
|
|
+ IDMapping[tender.ID] = {engineeringCost: +summaryMap[tender.ID].totalFee || 0, rate: summaryMap[tender.ID].rate || 0,buildingArea: '', perCost: '', changeMark:tender.changeMark,property:tender.property};
|
|
|
let buildingArea = getBuildingArea(tender.property.projectFeature);
|
|
|
if(buildingArea){
|
|
|
IDMapping[tender.ID]['buildingArea'] = buildingArea;
|