|
|
@ -572,6 +572,27 @@ export default { |
|
|
|
this.pagination.current = page; |
|
|
|
this.getDatas(this.currentTab); |
|
|
|
}, |
|
|
|
//获取利润率 |
|
|
|
initProfits(item,ext){ |
|
|
|
ext.PlatformPoint = parseFloat(item.RivalPrice * 0.05).toFixed(2); |
|
|
|
ext.Profit = |
|
|
|
item.RivalPrice - |
|
|
|
ext.BuyPrice - |
|
|
|
ext.KDPrice - |
|
|
|
ext.PlatformPoint; |
|
|
|
|
|
|
|
ext.Profit=parseFloat( |
|
|
|
ext.Profit |
|
|
|
).toFixed(2); |
|
|
|
|
|
|
|
if (ext.BuyPrice == 0) { |
|
|
|
ext.Profits = 0; |
|
|
|
} else { |
|
|
|
ext.Profits = parseFloat( |
|
|
|
(ext.Profit / (ext.BuyPrice+ext.KDPrice)) * 100 |
|
|
|
).toFixed(2); |
|
|
|
} |
|
|
|
}, |
|
|
|
openItemInfoWeb(item) { |
|
|
|
if ( |
|
|
|
item == undefined || |
|
|
@ -618,19 +639,7 @@ export default { |
|
|
|
res.Data.forEach((item) => { |
|
|
|
item.isEdit = false; |
|
|
|
item.Extensions.forEach((ext) => { |
|
|
|
ext.PlatformPoint = parseFloat(item.RivalPrice * 0.05).toFixed(2); |
|
|
|
ext.Profit = |
|
|
|
item.RivalPrice - |
|
|
|
ext.BuyPrice - |
|
|
|
ext.KDPrice - |
|
|
|
ext.PlatformPoint; |
|
|
|
if (ext.BuyPrice == 0) { |
|
|
|
ext.Profits = 0; |
|
|
|
} else { |
|
|
|
ext.Profits = parseFloat( |
|
|
|
(ext.Profit / ext.BuyPrice) * 100 |
|
|
|
).toFixed(2); |
|
|
|
} |
|
|
|
this.initProfits(item,ext) |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.datas = res.Data; |
|
|
@ -648,25 +657,15 @@ export default { |
|
|
|
setData(data) { |
|
|
|
var isError = false; |
|
|
|
data.Extensions.forEach((ext) => { |
|
|
|
ext.PlatformPoint = parseFloat(data.RivalPrice * 0.05).toFixed(2); |
|
|
|
ext.Profit = |
|
|
|
data.RivalPrice - ext.BuyPrice - ext.KDPrice - ext.PlatformPoint; |
|
|
|
|
|
|
|
if (ext.BuyUrl == undefined || ext.BuyUrl == "") { |
|
|
|
isError = true; |
|
|
|
} |
|
|
|
|
|
|
|
if (ext.BuyPrice == 0) { |
|
|
|
ext.Profits = 0; |
|
|
|
} else { |
|
|
|
ext.Profits = parseFloat((ext.Profit / ext.BuyPrice) * 100).toFixed( |
|
|
|
2 |
|
|
|
); |
|
|
|
if(ext.BuyUrl==undefined||ext.BuyUrl==''||ext.BuyUrl==null||ext.BuyUrl.length<=0) |
|
|
|
{ |
|
|
|
isError=true |
|
|
|
} |
|
|
|
this.initProfits(data,ext) |
|
|
|
}); |
|
|
|
|
|
|
|
if (isError) { |
|
|
|
this.$message.error("请输入5个供应商来源信息!"); |
|
|
|
this.$message.error("请输入5个完整的供应商来源信息!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|