|
@@ -150,6 +150,27 @@ let rationCalcBase = [
|
|
|
}
|
|
|
];
|
|
|
|
|
|
+let cpFeeTypes = [
|
|
|
+ {type: 'direct', name: '直接费'},
|
|
|
+ {type: 'labour', name: '人工费'},
|
|
|
+ {type: 'material', name: '材料费'},
|
|
|
+ {type: 'machine', name: '机械费'},
|
|
|
+ {type: 'mainMaterial', name: '主材费'},
|
|
|
+ {type: 'equipment', name: '设备费'},
|
|
|
+ {type: 'manage', name: '企业管理费'},
|
|
|
+ {type: 'profit', name: '利润'},
|
|
|
+ {type: 'risk', name: '风险费'},
|
|
|
+ {type: 'labourDiff', name: '人工价差'},
|
|
|
+ {type: 'materialDiff', name: '材料价差'},
|
|
|
+ {type: 'machineDiff', name: '机械价差'},
|
|
|
+ {type: 'adjustLabour', name: '调整人工费'},
|
|
|
+ {type: 'adjustMachineLabour', name: '调整机上人工费'},
|
|
|
+ {type: 'zangu', name: '暂估'},
|
|
|
+ {type: 'fee1', name: '甲供材料费'},
|
|
|
+ // 模拟用户新增
|
|
|
+ {type: 'common', name: '工程造价'}
|
|
|
+];
|
|
|
+
|
|
|
let analyzer = {
|
|
|
calcTemplate: null,
|
|
|
success: true,
|
|
@@ -363,7 +384,7 @@ let executeObj = {
|
|
|
};
|
|
|
return result;
|
|
|
};
|
|
|
- // 量价没有具体的工料机类型,但仍然要用定额的计算程序,所以要给计算基数直接指定。
|
|
|
+ // 量价。没有具体的工料机类型,但仍然要用定额的计算程序,所以要给计算基数直接指定。
|
|
|
function volumePriceFee() {
|
|
|
let result = 0;
|
|
|
if (
|
|
@@ -400,10 +421,11 @@ let executeObj = {
|
|
|
};
|
|
|
|
|
|
let treeNodeTools = {
|
|
|
+ // 获取全部有公式的树节点清单
|
|
|
getFormulaNodes: function () {
|
|
|
let nodes = [];
|
|
|
- for (let item of projectObj.project.mainTree.items){
|
|
|
- if (item.data.calcBase && item.data.calcBase != '') nodes.push(item);
|
|
|
+ for (let node of projectObj.project.mainTree.items){
|
|
|
+ if (node.sourceType == ModuleNames.bills && node.data.calcBase && node.data.calcBase != '') nodes.push(node);
|
|
|
};
|
|
|
return nodes;
|
|
|
},
|
|
@@ -469,7 +491,7 @@ class CalcProgram {
|
|
|
|
|
|
me.feeRates = this.project.FeeRate.datas.rates;
|
|
|
me.labourCoes = this.project.labourCoe.datas.coes;
|
|
|
- me.feeTypes = feeType;
|
|
|
+ me.feeTypes = cpFeeTypes;
|
|
|
me.calcBases = rationCalcBase;
|
|
|
me.templates = this.project.calcProgram.datas.templates;
|
|
|
|
|
@@ -696,7 +718,7 @@ class CalcProgram {
|
|
|
|
|
|
let objsArr = (treeNode.calcType == treeNodeCalcType.ctGatherRationsFees) ? project.Ration.getRationsByNode(treeNode) : treeNode.children;
|
|
|
let rst = [];
|
|
|
- for (let ft of feeType) {
|
|
|
+ for (let ft of cpFeeTypes) {
|
|
|
let ftObj = {};
|
|
|
ftObj.fieldName = ft.type;
|
|
|
ftObj.name = ft.name;
|
|
@@ -994,6 +1016,20 @@ class CalcProgram {
|
|
|
return changedNodes;
|
|
|
};
|
|
|
|
|
|
+ // 计算全部公式项
|
|
|
+ calcFormulaNodes(){
|
|
|
+ let nodes = treeNodeTools.getFormulaNodes();
|
|
|
+ if (nodes.length == 0) return;
|
|
|
+ for (let node of nodes){
|
|
|
+ this.calcFormulaNode(node);
|
|
|
+ };
|
|
|
+ };
|
|
|
+
|
|
|
+ // 计算公式项。(它一定是叶子结点,它的父结点一定没有公式)
|
|
|
+ calcFormulaNode(treeNode){
|
|
|
+ // do
|
|
|
+ };
|
|
|
+
|
|
|
// 计算叶子清单下的所有子结点(如定额、量价、工料机定额等), 并计算自身和所有父结点。最后打包存储。
|
|
|
calcLeafAndSave(treeNode){
|
|
|
let me = this;
|