|  | @@ -711,11 +711,11 @@ class CalcProgram {
 | 
	
		
			
				|  |  |                          sum_rttf = (sum_rttf + rttf).toDecimal(decimalObj.process);
 | 
	
		
			
				|  |  |                      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    if (me.project.projSetting.billsCalcMode === leafBillGetFeeType.rationPrice || me.project.projSetting.billsCalcMode === leafBillGetFeeType.rationPriceConverse) {
 | 
	
		
			
				|  |  | +                    if (me.project.projSetting.billsCalcMode === leafBillGetFeeType.rationPriceConverse || me.project.projSetting.billsCalcMode === leafBillGetFeeType.rationPrice) {
 | 
	
		
			
				|  |  |                          buf = (sum_rtf / bq).toDecimal(decimalObj.process);
 | 
	
		
			
				|  |  |                          btuf = (sum_rttf / bq).toDecimal(decimalObj.process);
 | 
	
		
			
				|  |  |                      };
 | 
	
		
			
				|  |  | -                    if (isBaseFeeType(ft.type) || (me.project.projSetting.billsCalcMode === leafBillGetFeeType.rationPriceConverse && ft.type == "common")){
 | 
	
		
			
				|  |  | +                    if (isBaseFeeType(ft.type) || (me.project.projSetting.billsCalcMode === leafBillGetFeeType.rationPrice && ft.type == "common")){
 | 
	
		
			
				|  |  |                          btf = sum_rtf;
 | 
	
		
			
				|  |  |                          bttf = sum_rttf;
 | 
	
		
			
				|  |  |                      }
 | 
	
	
		
			
				|  | @@ -735,6 +735,7 @@ class CalcProgram {
 | 
	
		
			
				|  |  |              };
 | 
	
		
			
				|  |  |              treeNode.data.calcTemplate = {"calcItems": rst};
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        // 叶子清单的手工综合单价计算
 | 
	
		
			
				|  |  |          else if (treeNode.calcType == treeNodeCalcType.ctCommonUnitFee){
 | 
	
		
			
				|  |  |              delete treeNode.data.gljList;
 | 
	
		
			
				|  |  |              if (treeNode.data.calcBase) treeNode.data.calcBase = null;  // 不能直接删除该属性,否则无法冲掉库中已存储的值
 | 
	
	
		
			
				|  | @@ -743,8 +744,31 @@ class CalcProgram {
 | 
	
		
			
				|  |  |              let uf = (treeNode.data.feesIndex && treeNode.data.feesIndex.common && treeNode.data.feesIndex.common.unitFee) ? treeNode.data.feesIndex.common.unitFee : 0;
 | 
	
		
			
				|  |  |              let tuf = (treeNode.data.feesIndex && treeNode.data.feesIndex.common && treeNode.data.feesIndex.common.tenderUnitFee) ? treeNode.data.feesIndex.common.tenderUnitFee : 0;
 | 
	
		
			
				|  |  |              let q = treeNode.data.quantity ? treeNode.data.quantity : 0;
 | 
	
		
			
				|  |  | -            let tf = (uf * q).toDecimal(decimalObj.decimal('totalPrice', treeNode));
 | 
	
		
			
				|  |  | -            let ttf = (tuf * q).toDecimal(decimalObj.decimal('totalPrice', treeNode));
 | 
	
		
			
				|  |  | +            let tf = (uf * q).toDecimal(decimalObj.bills.totalPrice);
 | 
	
		
			
				|  |  | +            let ttf = (tuf * q).toDecimal(decimalObj.bills.totalPrice);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            delete treeNode.data.fees;    // 直接删掉再新增,不用一个个费判断更新,效率更高。
 | 
	
		
			
				|  |  | +            delete treeNode.data.feesIndex;
 | 
	
		
			
				|  |  | +            me.initFeeField(treeNode, 'common');
 | 
	
		
			
				|  |  | +            treeNode.data.feesIndex.common.unitFee = uf.toDecimal(decimalObj.bills.unitPrice);
 | 
	
		
			
				|  |  | +            treeNode.data.feesIndex.common.totalFee = tf.toDecimal(decimalObj.bills.totalPrice);
 | 
	
		
			
				|  |  | +            treeNode.data.feesIndex.common.tenderUnitFee = tuf.toDecimal(decimalObj.bills.unitPrice);
 | 
	
		
			
				|  |  | +            treeNode.data.feesIndex.common.tenderTotalFee = ttf.toDecimal(decimalObj.bills.totalPrice);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            treeNode.data.calcTemplate = {"calcItems": []};
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        // 叶子清单的计算基数计算
 | 
	
		
			
				|  |  | +        else if (treeNode.calcType == treeNodeCalcType.ctCalcBaseValue){
 | 
	
		
			
				|  |  | +            delete treeNode.data.gljList;
 | 
	
		
			
				|  |  | +            if (treeNode.data.programID) treeNode.data.programID = null;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            let f = treeNode.data.feeRate ? treeNode.data.feeRate : 100;
 | 
	
		
			
				|  |  | +            let q = treeNode.data.quantity ? treeNode.data.quantity : 0;
 | 
	
		
			
				|  |  | +            let b = treeNode.data.calcBase;
 | 
	
		
			
				|  |  | +            let uf = (b * f * q / 100).toDecimal(decimalObj.bills.unitPrice);
 | 
	
		
			
				|  |  | +            let tuf = uf;
 | 
	
		
			
				|  |  | +            let tf = (me.project.projSetting.billsCalcMode === leafBillGetFeeType.rationPrice) ? (b * f / 100).toDecimal(decimalObj.bills.totalPrice) : (uf * q).toDecimal(decimalObj.bills.totalPrice);
 | 
	
		
			
				|  |  | +            let ttf = tf;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              delete treeNode.data.fees;    // 直接删掉再新增,不用一个个费判断更新,效率更高。
 | 
	
		
			
				|  |  |              delete treeNode.data.feesIndex;
 | 
	
	
		
			
				|  | @@ -756,16 +780,9 @@ class CalcProgram {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              treeNode.data.calcTemplate = {"calcItems": []};
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        // 定额或清单自己的计算程序计算
 | 
	
		
			
				|  |  |          else{
 | 
	
		
			
				|  |  | -            // 叶子清单的公式计算:使用缺省清单计算程序。需要提供总金额作为计算基数(不需要工料机),然后每条按比例(费率)计算,不需要工料机明细。
 | 
	
		
			
				|  |  | -            if (treeNode.calcType == treeNodeCalcType.ctCalcBaseValue){
 | 
	
		
			
				|  |  | -                delete treeNode.data.gljList;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -/*                if (treeNode.data.programID == undefined){
 | 
	
		
			
				|  |  | -                    treeNode.data.programID = defaultBillTemplate.ID;
 | 
	
		
			
				|  |  | -                };*/
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            else if (treeNode.calcType == treeNodeCalcType.ctRationCalcProgram) {
 | 
	
		
			
				|  |  | +            if (treeNode.calcType == treeNodeCalcType.ctRationCalcProgram) {
 | 
	
		
			
				|  |  |                  if (treeNode.data.type == rationType.volumePrice){
 | 
	
		
			
				|  |  |                      delete treeNode.data.gljList;
 | 
	
		
			
				|  |  |                      let muf = treeNode.data.marketUnitFee ? treeNode.data.marketUnitFee : 0;
 |