|
@@ -1,8 +1,13 @@
|
|
|
+
|
|
|
/* 建设其他费表格相关 */
|
|
|
const budgetSummaryObj = (() => {
|
|
|
|
|
|
const { isEmptyVal, isDef, isNumber } = window.commonUtil;
|
|
|
- const { fixedFlag, BudgetArea } = window.commonConstants;
|
|
|
+ const { fixedFlag, BudgetArea, BudgetType } = window.commonConstants;
|
|
|
+
|
|
|
+ let budgetSummaryTreeSetting;
|
|
|
+
|
|
|
+ let curBudgetType = BudgetType.BUILDING;
|
|
|
|
|
|
// 原始数据
|
|
|
let rawData = [];
|
|
@@ -231,7 +236,9 @@ const budgetSummaryObj = (() => {
|
|
|
fees.push({ fieldName: 'other', totalFee: commonFeeItem && commonFeeItem.totalFee || 0 });
|
|
|
}
|
|
|
}
|
|
|
- bulkData.push({ type: 'update', data: { ID, ...data } });
|
|
|
+ const actualID = node.data.area === BudgetArea.CONSTRUCTION_FEE ? node.data.orgProjectID : ID;
|
|
|
+ const updateType = node.data.area === BudgetArea.CONSTRUCTION_FEE ? 'updateProject' : 'update';
|
|
|
+ bulkData.push({ type: updateType, data: { ...data, ID: actualID } });
|
|
|
});
|
|
|
await bulkOperation(bulkData);
|
|
|
Object
|
|
@@ -369,6 +376,19 @@ const budgetSummaryObj = (() => {
|
|
|
}
|
|
|
const endIndex = constructionFeeNode.posterityCount() + 1;
|
|
|
sheet.getRange(0, 0, endIndex, budgetSummaryTreeSetting.cols.length, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|
|
|
+ // 除第一行,章编号 节编号可编辑
|
|
|
+ if (curBudgetType === BudgetType.RAIL) {
|
|
|
+ const chapterCodeCol = budgetSummaryTreeSetting.cols.findIndex(item => item.data.field === 'chapterCode');
|
|
|
+ const sectionCodeCol = budgetSummaryTreeSetting.cols.findIndex(item => item.data.field === 'sectionCode');
|
|
|
+ for (let row = 1; row < endIndex; row++) {
|
|
|
+ if (chapterCodeCol > -1) {
|
|
|
+ sheet.getCell(row, chapterCodeCol).locked(false);
|
|
|
+ }
|
|
|
+ if (sectionCodeCol > -1) {
|
|
|
+ sheet.getCell(row, sectionCodeCol).locked(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return endIndex;
|
|
|
}
|
|
|
if (isMass) {
|
|
@@ -689,7 +709,9 @@ const budgetSummaryObj = (() => {
|
|
|
$.bootstrapLoading.start();
|
|
|
// 得先计算费用汇总(概算汇总计算基于费用汇总算出来的总金额)
|
|
|
await projectObj.project.calcProgram.getGatherFeeData();
|
|
|
- const { treeData, costGrowthRate, growthPeriod } = await ajaxPost('/bills/initialBudgetSummary', { constructionID });
|
|
|
+ const { budgetType, treeData, costGrowthRate, growthPeriod } = await ajaxPost('/bills/initialBudgetSummary', { constructionID });
|
|
|
+ budgetSummaryTreeSetting = budgetType === BudgetType.BUILDING ? budgetInstallationSetting : budgetRailSetting;
|
|
|
+ curBudgetType = budgetType;
|
|
|
calcSetting.costGrowthRate = costGrowthRate;
|
|
|
calcSetting.growthPeriod = growthPeriod;
|
|
|
$('#costGrowthRate').val(costGrowthRate);
|