Commit 64a5dc81 authored by 我在何方's avatar 我在何方

订单异常单证异常优化

parents d0e2e24e 27149936
...@@ -159,16 +159,20 @@ export default { ...@@ -159,16 +159,20 @@ export default {
return s ? '' + s + '' : '' return s ? '' + s + '' : ''
} }
}, },
costPrice(){ // 最初的运费
initialPrice(){
return Decimal(this.form.orgSeaFreight || 0) return Decimal(this.form.orgSeaFreight || 0)
.minus(this.form.orgShadeCommissionAmount || 0) // .minus(this.form.orgShadeCommissionAmount || 0)
.minus(this.form.orgLightCommissionAmount || 0) .minus(this.form.orgLightCommissionAmount || 0)
.minus(this.form.shadeCommissionAmount || 0)
},
// 新的成本价
costPrice(){
return this.initialPrice.minus(this.form.shadeCommissionAmount || 0)
}, },
// 新的销售价
salePrice(){ salePrice(){
return Decimal(this.form.orgSeaFreight || 0) return this.initialPrice.plus(this.form.lightCommissionAmount || 0)
.minus(this.form.orgLightCommissionAmount || 0)
.plus(this.form.lightCommissionAmount || 0)
}, },
currencyMap(){ currencyMap(){
let map = {} let map = {}
......
...@@ -142,14 +142,17 @@ export default { ...@@ -142,14 +142,17 @@ export default {
/* costPrice(){ /* costPrice(){
return Decimal(this.form.seaFreight || 0).minus(this.form.lightCommissionAmount || 0).minus(this.form.shadeCommissionAmount || 0) return Decimal(this.form.seaFreight || 0).minus(this.form.lightCommissionAmount || 0).minus(this.form.shadeCommissionAmount || 0)
} */ } */
costPrice(){ // 最初的运费
initialPrice(){
return Decimal(this.form.orgSeaFreight || 0) return Decimal(this.form.orgSeaFreight || 0)
.minus(this.form.orgShadeCommissionAmount || 0) // .minus(this.form.orgShadeCommissionAmount || 0)
.minus(this.form.orgLightCommissionAmount || 0) .minus(this.form.orgLightCommissionAmount || 0)
.minus(this.form.shadeCommissionAmount || 0) },
costPrice(){
return this.initialPrice.minus(this.form.shadeCommissionAmount || 0)
}, },
salePrice(){ salePrice(){
return Decimal(this.form.orgSeaFreight || 0).minus(this.form.orgLightCommissionAmount || 0).plus(this.form.lightCommissionAmount || 0) return this.initialPrice.plus(this.form.lightCommissionAmount || 0)
}, },
}, },
methods: { methods: {
......
...@@ -67,10 +67,10 @@ ...@@ -67,10 +67,10 @@
{{$t('原运费')}}{{detail.orgFreight}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}} {{$t('原运费')}}{{detail.orgFreight}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
</div> </div>
<div> <div>
{{$t('新运费')}}{{Decimal(detail.freight).plus(detail.lightCommissionAmount)}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}} {{$t('新运费')}}{{Decimal(detail.orgFreight || 0).minus(detail.lightCommissionAmount || 0).plus(detail.lightCommissionAmount || 0)}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
</div> </div>
<div> <div>
{{$t('成本价')}}{{Decimal(detail.freight).minus(detail.shadeCommissionAmount)}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }} {{$t('成本价')}}{{Decimal(detail.orgFreight || 0).minus(detail.lightCommissionAmount || 0).minus(detail.shadeCommissionAmount || 0)}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
</div> </div>
<div> <div>
{{$t('明佣')}}{{ detail.lightCommissionAmount}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}} {{$t('明佣')}}{{ detail.lightCommissionAmount}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
......
...@@ -187,19 +187,15 @@ export default { ...@@ -187,19 +187,15 @@ export default {
}, },
// 原价 // 原价
originPrice(){ originPrice(){
if(!this.form.orgFreight) return 0 return Decimal(this.form.orgFreight || 0).minus(this.form.orgLightCommissionAmount || 0)
return Decimal(this.form.orgFreight).minus(parseFloat(this.form.orgLightCommissionAmount) || 0)
}, },
// 成本价 // 成本价
costPrice(){ costPrice(){
return this.originPrice.minus(this.form.shadeCommissionAmount || 0)
if(!this.originPrice) return 0
return Decimal(this.originPrice).minus(parseFloat(this.form.shadeCommissionAmount) || 0)
}, },
// 销售价 // 销售价
salePrice(){ salePrice(){
if(!this.originPrice) return 0 return this.originPrice.plus(this.form.lightCommissionAmount || 0)
return Decimal(this.originPrice).plus(parseFloat(this.form.lightCommissionAmount) || 0)
}, },
totalCommision(){ totalCommision(){
return Decimal(this.form.lightCommissionAmount || 0).plus(this.form.shadeCommissionAmount || 0) return Decimal(this.form.lightCommissionAmount || 0).plus(this.form.shadeCommissionAmount || 0)
......
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