|  | @@ -54,13 +54,9 @@ let calcTools = {
 | 
	
		
			
				|  |  |    isBill_BX: function (treeNode) {
 | 
	
		
			
				|  |  |      return this.isBill(treeNode) && treeNode.data.type == billType.BX;
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  | -  isNullBill: function (treeNode) {
 | 
	
		
			
				|  |  | -    return (
 | 
	
		
			
				|  |  | -      this.isLeafBill(treeNode) &&
 | 
	
		
			
				|  |  | -      treeNode.children.length === 0 &&
 | 
	
		
			
				|  |  | -      !treeNode.data.calcBase &&
 | 
	
		
			
				|  |  | -      !treeNode.data.lockUnitPrice
 | 
	
		
			
				|  |  | -    );
 | 
	
		
			
				|  |  | +  // 用户手工输入单价或金额的清单。叶子清单(且无定额无公式 或 有锁定单价)
 | 
	
		
			
				|  |  | +  isCustomBill: function (treeNode) {
 | 
	
		
			
				|  |  | +    return this.isLeafBill(treeNode) && ((treeNode.children.length === 0 && !treeNode.data.calcBase) || treeNode.data.lockUnitPrice);
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    isInvalidNode: function (treeNode) {
 | 
	
		
			
				|  |  |      // 无效的、影响正常计算的行(无意义的空行、没有金额的行等)
 | 
	
	
		
			
				|  | @@ -978,8 +974,8 @@ let calcTools = {
 | 
	
		
			
				|  |  |    getCalcType: function (treeNode) {
 | 
	
		
			
				|  |  |      if (this.isRationCategory(treeNode)) {
 | 
	
		
			
				|  |  |        return treeNodeCalcType.ctRationCalcProgram;
 | 
	
		
			
				|  |  | -    } else if (this.isNullBill(treeNode)) {
 | 
	
		
			
				|  |  | -      return treeNodeCalcType.ctNull;
 | 
	
		
			
				|  |  | +    } else if (this.isCustomBill(treeNode)) {
 | 
	
		
			
				|  |  | +      return treeNodeCalcType.ctCustom;
 | 
	
		
			
				|  |  |      } else if (this.isLeafBill(treeNode)) {
 | 
	
		
			
				|  |  |        if (treeNode.data.lockUnitPrice)  // 叶子清单锁定单价(有定额或无定额)
 | 
	
		
			
				|  |  |          return treeNodeCalcType.ctLockUnitPrice
 | 
	
	
		
			
				|  | @@ -2137,8 +2133,8 @@ class CalcProgram {
 | 
	
		
			
				|  |  |      // 叶子清单:公式计算
 | 
	
		
			
				|  |  |      else if (treeNode.calcType == treeNodeCalcType.ctCalcBaseValue)
 | 
	
		
			
				|  |  |        me.innerCalcBillExpr(treeNode)
 | 
	
		
			
				|  |  | -    // 叶子清单:手工修改单价或金额(无定额、无公式计算,什么都没有时)。
 | 
	
		
			
				|  |  | -    else if (treeNode.calcType == treeNodeCalcType.ctNull)
 | 
	
		
			
				|  |  | +    // 叶子清单:手工修改单价或金额。
 | 
	
		
			
				|  |  | +    else if (treeNode.calcType == treeNodeCalcType.ctCustom)
 | 
	
		
			
				|  |  |        me.innerCalcBillCustom(treeNode);
 | 
	
		
			
				|  |  |      // 定额:计算程序
 | 
	
		
			
				|  |  |      else me.innerCalcRation(treeNode, tenderType);
 | 
	
	
		
			
				|  | @@ -2151,7 +2147,9 @@ class CalcProgram {
 | 
	
		
			
				|  |  |        changedArr.push(treeNode);
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  // 清单部分抽取出来,供分摊清单公用。commonCalcType:1 叶子清单汇总定额的费用类别; 2 父清单汇总子清单的费用类别。3: 分摊:叶子清单汇总定额的费用类别。
 | 
	
		
			
				|  |  | +  // 清单部分抽取出来,供分摊清单公用。
 | 
	
		
			
				|  |  | +    // commonCalcType:1 叶子清单汇总定额的费用类别; 2 父清单汇总子清单的费用类别。
 | 
	
		
			
				|  |  | +    // 3: 分摊:叶子清单汇总定额的费用类别。4: 清单单价锁定。
 | 
	
		
			
				|  |  |    innerCalcBill(treeNode, commonCalcType, tender = tenderTypes.ttCalc) {
 | 
	
		
			
				|  |  |      let me = this;
 | 
	
		
			
				|  |  |      treeNode.data.programID = null;
 | 
	
	
		
			
				|  | @@ -2355,22 +2353,17 @@ class CalcProgram {
 | 
	
		
			
				|  |  |      me.deleteUselessFees(treeNode, ["rationCommon"]);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      // 2017-09-27 需求改了,除了第 1 、 2.2部分以外,都可以手工修改综合单价、综合合价并参与计算
 | 
	
		
			
				|  |  | -    // 在没有公式的情况下可以手工修改综合单价并参与计算
 | 
	
		
			
				|  |  | -    if (calcTools.canCalcToTalFeeByOwn(treeNode)) {
 | 
	
		
			
				|  |  | -      if (treeNode.data.feesIndex && treeNode.data.feesIndex.common) {
 | 
	
		
			
				|  |  | -        let ftObj = { fieldName: "common" };
 | 
	
		
			
				|  |  | -        let nQ = calcTools.uiNodeQty(treeNode);
 | 
	
		
			
				|  |  | -        let nTQ = calcTools.uiNodeTenderQty(treeNode);
 | 
	
		
			
				|  |  | -        ftObj.unitFee = parseFloatPlus(treeNode.data.feesIndex.common.unitFee);
 | 
	
		
			
				|  |  | -        ftObj.totalFee = (ftObj.unitFee * nQ).toDecimal(
 | 
	
		
			
				|  |  | -          decimalObj.bills.totalPrice
 | 
	
		
			
				|  |  | -        );
 | 
	
		
			
				|  |  | -        ftObj.tenderUnitFee = ftObj.unitFee;
 | 
	
		
			
				|  |  | -        ftObj.tenderTotalFee = (ftObj.tenderUnitFee * nTQ).toDecimal(
 | 
	
		
			
				|  |  | -          decimalObj.bills.totalPrice
 | 
	
		
			
				|  |  | -        );
 | 
	
		
			
				|  |  | -        calcTools.checkFeeField(treeNode, ftObj);
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | +    // 2021-09-14 增加强制修改综合单价功能,所以“除了第 1 、 2.2部分以外,...” 这里的业务取消。
 | 
	
		
			
				|  |  | +    // if (calcTools.canCalcToTalFeeByOwn(treeNode)) {
 | 
	
		
			
				|  |  | +    if (treeNode.data.feesIndex && treeNode.data.feesIndex.common) {
 | 
	
		
			
				|  |  | +      let ftObj = { fieldName: "common" };
 | 
	
		
			
				|  |  | +      let nQ = calcTools.uiNodeQty(treeNode);
 | 
	
		
			
				|  |  | +      let nTQ = calcTools.uiNodeTenderQty(treeNode);
 | 
	
		
			
				|  |  | +      ftObj.unitFee = parseFloatPlus(treeNode.data.feesIndex.common.unitFee); // 以单价为基础数据。金额从单价计算获得。
 | 
	
		
			
				|  |  | +      ftObj.totalFee = (ftObj.unitFee * nQ).toDecimal(decimalObj.bills.totalPrice);
 | 
	
		
			
				|  |  | +      ftObj.tenderUnitFee = ftObj.unitFee;
 | 
	
		
			
				|  |  | +      ftObj.tenderTotalFee = (ftObj.tenderUnitFee * nTQ).toDecimal(decimalObj.bills.totalPrice);
 | 
	
		
			
				|  |  | +      calcTools.checkFeeField(treeNode, ftObj);
 | 
	
		
			
				|  |  |      } else {
 | 
	
		
			
				|  |  |        if (treeNode.data.fees && treeNode.data.fees.length > 0) {
 | 
	
		
			
				|  |  |          treeNode.data.fees = null;
 | 
	
	
		
			
				|  | @@ -2378,7 +2371,6 @@ class CalcProgram {
 | 
	
		
			
				|  |  |          treeNode.changed = true;
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      treeNode.data.calcTemplate = { calcItems: [] };
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 |