|
@@ -212,6 +212,17 @@ let calcTools = {
|
|
|
treeNode.changed = true;
|
|
|
};
|
|
|
},
|
|
|
+ setFieldValue: function (treeNode, fieldName, value){
|
|
|
+ if (fieldName.includes('feesIndex')){
|
|
|
+ let arr = fieldName.split('.');
|
|
|
+ this.initFeeField(treeNode, arr[1]);
|
|
|
+ treeNode.data.feesIndex[arr[1]][arr[2]] = value;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ treeNode.data[fieldName] = value;
|
|
|
+ };
|
|
|
+ treeNode.changed = true;
|
|
|
+ },
|
|
|
initSummaryFee: function (treeNode){
|
|
|
if (!treeNode.data.summaryFees){
|
|
|
treeNode.data.summaryFees = {
|
|
@@ -1505,13 +1516,25 @@ class CalcProgram {
|
|
|
if (treeNode.data.programID) {
|
|
|
treeNode.data.programID = null;
|
|
|
treeNode.changed = true;
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
- if (treeNode.data.fees && treeNode.data.fees.length > 0){
|
|
|
- treeNode.data.fees = null;
|
|
|
- treeNode.data.feesIndex = null;
|
|
|
- treeNode.changed = true;
|
|
|
+ // 第1、2部分以外的叶子清单在没有公式的情况下可以手工修改综合单价并参与计算。
|
|
|
+ if(!calcTools.isInheritFrom(treeNode, [fixedFlag.SUB_ENGINERRING, fixedFlag.MEASURE])){
|
|
|
+ let ftObj = {};
|
|
|
+ ftObj.fieldName = 'common';
|
|
|
+ ftObj.unitFee = parseFloatPlus(treeNode.data.feesIndex.common.unitFee);
|
|
|
+ let q = parseFloatPlus(treeNode.data.quantity);
|
|
|
+ ftObj.totalFee = (ftObj.unitFee * q).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ calcTools.checkFeeField(treeNode, ftObj);
|
|
|
}
|
|
|
+ else{
|
|
|
+ if (treeNode.data.fees && treeNode.data.fees.length > 0){
|
|
|
+ treeNode.data.fees = null;
|
|
|
+ treeNode.data.feesIndex = null;
|
|
|
+ treeNode.changed = true;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
treeNode.data.calcTemplate = {"calcItems": []};
|
|
|
}
|
|
|
// 叶子清单公式计算
|