|  | @@ -40,7 +40,10 @@ let nodeCalcObj = {
 | 
	
		
			
				|  |  |      sumTotalFee: function() {
 | 
	
		
			
				|  |  |          let result = 0, child;
 | 
	
		
			
				|  |  |          for (child of this.node.children) {
 | 
	
		
			
				|  |  | -            result += this.getFee(child.data, this.field.totalFee);
 | 
	
		
			
				|  |  | +            let value = this.getFee(child.data, this.field.totalFee);
 | 
	
		
			
				|  |  | +            if (Object.prototype.toString.apply(value) === "[object String]") {
 | 
	
		
			
				|  |  | +                result += parseFloat(this.getFee(child.data, this.field.totalFee));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return result;
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -48,6 +51,9 @@ let nodeCalcObj = {
 | 
	
		
			
				|  |  |          let result = 0, child, qty;
 | 
	
		
			
				|  |  |          result = this.sumTotalFee(this.field);
 | 
	
		
			
				|  |  |          qty = this.getFee(this.node.data, 'quantity');
 | 
	
		
			
				|  |  | +        if (Object.prototype.toString.apply(qty) === "[object String]") {
 | 
	
		
			
				|  |  | +            qty = parseFloat(qty);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          if (qty !== 0) {
 | 
	
		
			
				|  |  |              result = result / qty;
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -58,11 +64,22 @@ let nodeCalcObj = {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      rationContentUnitFee: function () {
 | 
	
		
			
				|  |  |          let result = 0, child, qty = this.getFee(this.node.data, 'quantity');
 | 
	
		
			
				|  |  | +        if (Object.prototype.toString.apply(qty) === "[object String]") {
 | 
	
		
			
				|  |  | +            qty = parseFloat(qty);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          if (qty === 0) {
 | 
	
		
			
				|  |  |              qty = 1;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          for (child of this.node.children) {
 | 
	
		
			
				|  |  | -            result += (this.getFee(child.data, this.field.unitFee) * this.getFee(child.data, 'quantity') / qty).toDecimal(this.digit);
 | 
	
		
			
				|  |  | +            let childUnitFee = this.getFee(child.data, this.field.unitFee);
 | 
	
		
			
				|  |  | +            if (Object.prototype.toString.apply(childUnitFee) === "[object String]") {
 | 
	
		
			
				|  |  | +                childUnitFee = parseFloat(childUnitFee);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            let childQuantity = this.getFee(child.data, 'quantity');
 | 
	
		
			
				|  |  | +            if (Object.prototype.toString.apply(childQuantity) === "[object String]") {
 | 
	
		
			
				|  |  | +                childQuantity = parseFloat(childQuantity);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            result += (childUnitFee * childQuantity / qty).toDecimal(this.digit);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return result;
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -220,21 +237,26 @@ class BillsCalcHelper {
 | 
	
		
			
				|  |  |      constructor (project, CalcFlag) {
 | 
	
		
			
				|  |  |          this.project = project;
 | 
	
		
			
				|  |  |          this.CalcFlag = CalcFlag;
 | 
	
		
			
				|  |  | -        switch (this.CalcFlag) {
 | 
	
		
			
				|  |  | -            case rationContent:
 | 
	
		
			
				|  |  | -                this.calcField = rationContentCalcFields;
 | 
	
		
			
				|  |  | -                break;
 | 
	
		
			
				|  |  | -            case rationPrice:
 | 
	
		
			
				|  |  | -                this.calcField = rationPriceCalcFields;
 | 
	
		
			
				|  |  | -                break;
 | 
	
		
			
				|  |  | -            case rationPriceConverse:
 | 
	
		
			
				|  |  | -                this.calcField = rationPriceConverseCalcFields;
 | 
	
		
			
				|  |  | -                break;
 | 
	
		
			
				|  |  | -            case billsPrice:
 | 
	
		
			
				|  |  | -                this.calcField = billsPriceCalcFields;
 | 
	
		
			
				|  |  | -                break;
 | 
	
		
			
				|  |  | -            default:
 | 
	
		
			
				|  |  | -                this.calcField = [];
 | 
	
		
			
				|  |  | +        this.calcField = JSON.parse(JSON.stringify(feeType));
 | 
	
		
			
				|  |  | +        for (let field of this.calcField) {
 | 
	
		
			
				|  |  | +            // unitFeeCalcFlag
 | 
	
		
			
				|  |  | +            if (this.calcFlag === rationContent) {
 | 
	
		
			
				|  |  | +                field.unitFeeFlag = rationContentUnitFeeFlag;
 | 
	
		
			
				|  |  | +            } else if ( this.calcFlag === billsPrice) {
 | 
	
		
			
				|  |  | +                field.unitFeeFlag = billsPriceUnitFeeFlag;
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                field.unitFeeFlag = averageQtyUnitFeeFlag;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            // totalFeeCalcFlag
 | 
	
		
			
				|  |  | +            if (field.type === 'common') {
 | 
	
		
			
				|  |  | +                if (this.CalcFlag === rationPriceConverse) {
 | 
	
		
			
				|  |  | +                    field.totalFeeFlag = sumTotalFeeFlag;
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    field.totalFeeFlag = totalFeeFlag;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                field.totalFeeFlag = sumTotalFeeFlag;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          this.InitFields(this.calcField);
 | 
	
		
			
				|  |  |      };
 | 
	
	
		
			
				|  | @@ -287,6 +309,7 @@ class BillsCalcHelper {
 | 
	
		
			
				|  |  |                      node.data.feesIndex[field.type].totalFee = 0;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        console.log(node.data);
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |      calcVolumePriceLeaf (node, fields) {
 | 
	
		
			
				|  |  |  
 |