|
@@ -290,21 +290,24 @@ let executeObj = {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}else{
|
|
}else{
|
|
- for (let glj of me.treeNode.data.gljList) {
|
|
|
|
- if (base.gljTypes.indexOf(glj.type) >= 0) {
|
|
|
|
- if (base.calcType == baseCalc){ price = glj["basePrice"];}
|
|
|
|
- else if (base.calcType == adjustCalc){price = glj["adjustPrice"];}
|
|
|
|
- else if (base.calcType == budgetCalc){price = glj["marketPrice"];}
|
|
|
|
- else if (base.calcType == diffCalc){
|
|
|
|
- aprice = glj["adjustPrice"];
|
|
|
|
- if (!aprice) aprice = 0;
|
|
|
|
- mprice = glj["marketPrice"];
|
|
|
|
- if (!mprice) mprice = 0;
|
|
|
|
- price = mprice - aprice;
|
|
|
|
|
|
+ if (!me.treeNode.data.gljList) tmpSum = 0
|
|
|
|
+ else{
|
|
|
|
+ for (let glj of me.treeNode.data.gljList) {
|
|
|
|
+ if (base.gljTypes.indexOf(glj.type) >= 0) {
|
|
|
|
+ if (base.calcType == baseCalc){ price = glj["basePrice"];}
|
|
|
|
+ else if (base.calcType == adjustCalc){price = glj["adjustPrice"];}
|
|
|
|
+ else if (base.calcType == budgetCalc){price = glj["marketPrice"];}
|
|
|
|
+ else if (base.calcType == diffCalc){
|
|
|
|
+ aprice = glj["adjustPrice"];
|
|
|
|
+ if (!aprice) aprice = 0;
|
|
|
|
+ mprice = glj["marketPrice"];
|
|
|
|
+ if (!mprice) mprice = 0;
|
|
|
|
+ price = mprice - aprice;
|
|
|
|
+ };
|
|
|
|
+ if (!price) price = 0;
|
|
|
|
+ tmpSum = tmpSum + (glj["quantity"] * price).toDecimal(me.digitDefault);
|
|
|
|
+ tmpSum = (tmpSum).toDecimal(me.digitDefault);
|
|
};
|
|
};
|
|
- if (!price) price = 0;
|
|
|
|
- tmpSum = tmpSum + (glj["quantity"] * price).toDecimal(me.digitDefault);
|
|
|
|
- tmpSum = (tmpSum).toDecimal(me.digitDefault);
|
|
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
@@ -351,7 +354,9 @@ class CalcProgram {
|
|
me.compiledFeeRates = {};
|
|
me.compiledFeeRates = {};
|
|
me.compiledLabourCoes = {};
|
|
me.compiledLabourCoes = {};
|
|
me.compiledTemplates = {};
|
|
me.compiledTemplates = {};
|
|
- me.compiledFeeTypes = {};
|
|
|
|
|
|
+ me.compiledTemplateMaps = {};
|
|
|
|
+ me.compiledTemplateNames = [];
|
|
|
|
+ me.compiledFeeTypeMaps = {};
|
|
me.compiledFeeTypeNames = [];
|
|
me.compiledFeeTypeNames = [];
|
|
me.compiledCalcBases = {};
|
|
me.compiledCalcBases = {};
|
|
me.saveForReports = [];
|
|
me.saveForReports = [];
|
|
@@ -391,8 +396,8 @@ class CalcProgram {
|
|
}
|
|
}
|
|
|
|
|
|
for (let ft of me.feeTypes) {
|
|
for (let ft of me.feeTypes) {
|
|
- me.compiledFeeTypes[ft.type] = ft.name;
|
|
|
|
- me.compiledFeeTypes[ft.name] = ft.type; // 中文预编译,可靠性有待验证
|
|
|
|
|
|
+ me.compiledFeeTypeMaps[ft.type] = ft.name;
|
|
|
|
+ me.compiledFeeTypeMaps[ft.name] = ft.type; // 中文预编译,可靠性有待验证
|
|
me.compiledFeeTypeNames.push(ft.name);
|
|
me.compiledFeeTypeNames.push(ft.name);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -404,6 +409,9 @@ class CalcProgram {
|
|
compileTemplate(template){
|
|
compileTemplate(template){
|
|
let me = this;
|
|
let me = this;
|
|
me.compiledTemplates[template.ID] = template;
|
|
me.compiledTemplates[template.ID] = template;
|
|
|
|
+ me.compiledTemplateMaps[template.ID] = template.name;
|
|
|
|
+ me.compiledTemplateMaps[template.name] = template.ID;
|
|
|
|
+ me.compiledTemplateNames.push(template.name);
|
|
template.hasCompiled = false;
|
|
template.hasCompiled = false;
|
|
template.errs = [];
|
|
template.errs = [];
|
|
|
|
|
|
@@ -487,7 +495,7 @@ class CalcProgram {
|
|
};
|
|
};
|
|
|
|
|
|
// 字段名映射
|
|
// 字段名映射
|
|
- item.displayFieldName = me.compiledFeeTypes[item.fieldName];
|
|
|
|
|
|
+ item.displayFieldName = me.compiledFeeTypeMaps[item.fieldName];
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -709,6 +717,7 @@ class CalcProgram {
|
|
ID: node.data.ID,
|
|
ID: node.data.ID,
|
|
projectID: me.project.ID(),
|
|
projectID: me.project.ID(),
|
|
quantity: node.data.quantity,
|
|
quantity: node.data.quantity,
|
|
|
|
+ programID: node.data.programID,
|
|
fees: node.data.fees
|
|
fees: node.data.fees
|
|
};
|
|
};
|
|
let newData = {'updateType': 'ut_update', 'updateData': data};
|
|
let newData = {'updateType': 'ut_update', 'updateData': data};
|