Commit 579b81ab authored by dragondean@qq.com's avatar dragondean@qq.com

海运价格包装费价格单位不同步的bug

parent bd8dc59a
......@@ -93,16 +93,46 @@
</el-col>
</el-row>
</template>
<template v-else>
<sea-price
ref="seaPrice"
:price-type="form.priceType"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</template>
<template v-else-if="form.priceType === 1">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="all"
:price-name="$t('全包价')"
packaging-field="fullPricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</template>
<template v-else>
<el-row :gutter="20">
<el-col :span="12">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="transport"
:price-name="$t('运费')"
packaging-field="freightPricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</el-col>
<el-col :span="12">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="clearance"
:price-name="$t('清关费')"
packaging-field="clearancePricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</el-col>
</el-row>
</template>
</el-card>
......@@ -450,17 +480,37 @@ export default {
},
// 非阶梯价格更新单位
handleFormUnitChange(data){
console.log("handleFormUnitChange", {...data})
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value
}
console.log("handleFormUnitChange", {...data})
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value
}
if(this.form.specialList?.length){
this.form.specialList.forEach(p => {
p[data.field] = data.value
})
if(this.form.specialList?.length){
this.form.specialList.forEach(p => {
p[data.field] = data.value
})
}
// 同步包装的单位
let packingField = {
transportVolumeUnit: 'freightPricePackagingList',
clearanceVolumeUnit: 'clearancePricePackagingList',
allVolumeUnit: 'fullPricePackagingList',
transportPriceUnit: 'freightPricePackagingList',
clearancePriceUnit: 'clearancePricePackagingList'
}[data.field]
if(!this.form[packingField]?.length){
return false
}
this.form[packingField].forEach(item => {
if(data.field.indexOf("PriceUnit") > -1){
item['packagingPriceUnit'] = data.value
}
if(data.field.indexOf("VolumeUnit") > -1){
item['packagingVolumeUnit'] = data.value
}
})
},
initStepPrice(){
if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){
......
......@@ -687,7 +687,9 @@ export default {
let packingField = {
transportVolumeUnit: 'freightPricePackagingList',
clearanceVolumeUnit: 'clearancePricePackagingList',
allVolumeUnit: 'fullPricePackagingList'
allVolumeUnit: 'fullPricePackagingList',
transportPriceUnit: 'freightPricePackagingList',
clearancePriceUnit: 'clearancePricePackagingList'
}[data.field]
if(!this.form[packingField]?.length){
return false
......
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