Commit 98880691 authored by dragondean@qq.com's avatar dragondean@qq.com

创建报价单支持路线设置的保费币种

parent c1f871c8
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
<el-descriptions :column="5" border> <el-descriptions :column="5" border>
<el-descriptions-item :label="$t('保价费')"> <el-descriptions-item :label="$t('保价费')">
{{fee.insuranceFee || 0}} {{$t('美元')}} {{fee.insuranceFee || 0}} {{ selectedRouter ? currencyMap[selectedRouter.currencyUnit || 1] : '' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('总运费')"> <el-descriptions-item :label="$t('总运费')">
<template v-for="item in freightFeeList"> <template v-for="item in freightFeeList">
...@@ -730,8 +730,6 @@ export default { ...@@ -730,8 +730,6 @@ export default {
// 预计费用(原价 - 优惠金额 + 其他费用 + 保价费) // 预计费用(原价 - 优惠金额 + 其他费用 + 保价费)
estimatedCosts(){ estimatedCosts(){
let arr = [] let arr = []
let withInsuranceFee = false
let withOtherFee = false
this.originalFeeList.forEach(item => { this.originalFeeList.forEach(item => {
let it = { let it = {
currencyId: item.currencyId, currencyId: item.currencyId,
...@@ -741,50 +739,31 @@ export default { ...@@ -741,50 +739,31 @@ export default {
if(coupon){ if(coupon){
it.amount = it.amount.minus(coupon.reduceTotalAmount) it.amount = it.amount.minus(coupon.reduceTotalAmount)
} }
if(this.form.otherFee && this.form.otherFeeCurrencyId == item.currencyId){
it.amount = it.amount.plus(this.form.otherFee)
withOtherFee = true
}
// 保价费(美元)
if(item.currencyId == 1 && this.fee && this.fee.insuranceFee){
it.amount = it.amount.plus(this.fee.insuranceFee)
withInsuranceFee = true
}
arr.push(it) arr.push(it)
}) })
// 没有累加保价费(没有美元计价)但是有保价费则需要加上去 // 累加保价费
if(!withInsuranceFee && this.fee && this.fee.insuranceFee){ const insuranceFeeIndex = arr.findIndex(item => item.currencyId == this.insuranceFeeCurrency)
let fee = Decimal(this.fee.insuranceFee) if(insuranceFeeIndex > -1){
// 如果没有美元费用,且保价费和其他费用币种相同(都是美元) arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(this.fee.insuranceFee || 0)
if(this.form.otherFeeCurrencyId == 1 && this.form.otherFee){ }else{
withOtherFee = true
fee = fee.plus(new Decimal(this.form.otherFee || 0))
}
arr.push({ arr.push({
currencyId: 1, currencyId: this.insuranceFeeCurrency,
amount: fee amount: Decimal(this.fee.insuranceFee || 0)
}) })
} }
// 如果没有累加其他费用,则另外增加货币 // 累加其他费用
if(!withOtherFee && this.form.otherFee){ const otherFeeIndex = arr.findIndex(item => item.currencyId == this.form.otherFeeCurrencyId)
let fee = { if(otherFeeIndex > -1){
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(this.form.otherFee || 0)
}else{
arr.push({
currencyId: this.form.otherFeeCurrencyId, currencyId: this.form.otherFeeCurrencyId,
amount: Decimal(this.form.otherFee) amount: Decimal(this.form.otherFee || 0)
} })
// 如果保价费跟其他费用是同一种货币(都是美元)
if(!withInsuranceFee && this.fee && this.fee.insuranceFee && this.form.otherFeeCurrencyId == 1){
fee.amount = fee.amount.plus(this.fee.insuranceFee)
}
arr.push(fee)
} }
return arr return arr
}, },
// 路线开通的服务 // 路线开通的服务
...@@ -792,6 +771,10 @@ export default { ...@@ -792,6 +771,10 @@ export default {
if(!this.selectedRouter || !this.selectedRouter.otherService) return [] if(!this.selectedRouter || !this.selectedRouter.otherService) return []
return this.selectedRouter.otherService.split(',') return this.selectedRouter.otherService.split(',')
}, },
// 保价费单位(路线里设置,默认美元)
insuranceFeeCurrency() {
return this.selectedRouter?.currencyUnit || 1;
},
// 是否可以添加商品 // 是否可以添加商品
canAddProduct(){ canAddProduct(){
if(!this.form.lineId){ if(!this.form.lineId){
......
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