Commit 476e0265 authored by 黄奎's avatar 黄奎
parents 95e019b3 1cd35d28
var commonUtils = {
//json数组求和
CaluJsonArraySum: function (arr, filed, num,type) {
CaluJsonArraySum: function (arr, filed, num) {
var sum = 0;
arr.forEach(item => {
if(type){
sum += Number(item);
if (item.hasOwnProperty(filed)) {
sum += Number(item[filed]);
}else{
if (item.hasOwnProperty(filed)) {
sum += Number(item[filed]);
}
sum += Number(item);
}
});
return sum.toFixed(num);
......
......@@ -616,8 +616,8 @@
setTimeout(()=>{
let arr1 =[this.CommissionInfor.PeopleMoney,this.CommissionInfor.EuropeMoney]
let arr2 =[this.CommissionInfor.SalesCommission,this.CommissionInfor.JapanCommission,this.CommissionInfor.EuropeCommission,this.GNCommission]
this.CommissionJJ = this.CalculatePrice(arr1)
this.CommissionTC = this.CalculatePrice(arr2)
this.CommissionJJ = this.CalculatePrice(arr1,0)
this.CommissionTC = this.CalculatePrice(arr2,2)
},500)
}
......@@ -646,12 +646,11 @@
},
//计算总成本
CalculatePrice(arr1) {
CalculatePrice(arr1,num) {
var CoastPrice = this.$commonUtils.CaluJsonArraySum(
arr1,
"CostPrice",
2,
1
"",
num
);
return CoastPrice
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment