Commit 2cee3819 authored by youjie's avatar youjie

no message

parent b3a570e5
...@@ -5,12 +5,18 @@ var commonUtils = { ...@@ -5,12 +5,18 @@ var commonUtils = {
arr.forEach(item => { arr.forEach(item => {
if (item.hasOwnProperty(filed)) { if (item.hasOwnProperty(filed)) {
sum += Number(item[filed]); sum += Number(item[filed]);
}else{
sum += Number(item);
} }
}); });
return sum.toFixed(num); return sum.toFixed(num);
}, },
CaluJsonArraySum2: function (arr, num) {
var sum = 0;
arr.forEach(item => {
sum += Number(item);
});
return sum.toFixed(num);
},
//截取阿里返回文件路径 //截取阿里返回文件路径
GetALiFileUrl: function (str) { GetALiFileUrl: function (str) {
var newStr = str; var newStr = str;
......
...@@ -642,9 +642,8 @@ ...@@ -642,9 +642,8 @@
}, },
//计算总成本 //计算总成本
CalculatePrice(arr1,num) { CalculatePrice(arr1,num) {
var CoastPrice = this.$commonUtils.CaluJsonArraySum( var CoastPrice = this.$commonUtils.CaluJsonArraySum2(
arr1, arr1,
"",
num num
); );
return CoastPrice 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