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

修复海运批量改价包装类型字段错误

parent f0293a39
......@@ -33,7 +33,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<quick-set :unit-list="unitList" :currency-list="currencyList" :value="form"></quick-set>
<quick-set :unit-list="unitList" :currency-list="currencyList" :value="form" type="sea"></quick-set>
</el-col>
</el-row>
......@@ -486,6 +486,15 @@ export default {
return !!item[`${prefix}Price`]
})
},
// 格式化包装类型费用
getPackingPrice(packging){
if(!packging?.length) return
packging = JSON.parse(JSON.stringify(packging))
return packging.filter(item => !!item.packagingTypes).map(item => {
item.packagingTypes = item.packagingTypes?.join(",") || ""
return item
})
},
// 非阶梯价格更新单位
handleFormUnitChange(data){
console.log("handleFormUnitChange", {...data})
......@@ -548,7 +557,15 @@ export default {
let data = Object.assign({}, this.form, {
// lineChannelList: this.selectedRoutes,
// specialList: this.specialProducts,
isAllProduct: this.isAllProduct ? 1:0
isAllProduct: this.isAllProduct ? 1:0,
// 阶梯价
freightPriceStepList: [],
clearancePriceStepList: [],
fullPriceStepList: [],
// 非阶梯价包装类型
freightPricePackagingList: [],
clearancePricePackagingList: [],
fullPricePackagingList: []
})
// 如果是勾選了全部篩選商品,則獲取商品ID
......@@ -571,17 +588,25 @@ export default {
}
if(!isValid)return
} */
if(data.stepPrice){
// 全包价
if(this.form.priceType == 1) {
data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList, 'all')
delete data.clearancePriceStepList
delete data.freightPriceStepList
}else{
data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList, 'clearance')
data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList, 'transport')
delete data.fullPriceStepList
}
}
// 非阶梯价则需要提交包装类型
else{
if(this.form.priceType == 1){
data.fullPricePackagingList = this.getPackingPrice(this.form.fullPricePackagingList)
}else{
data.freightPricePackagingList = this.getPackingPrice(this.form.freightPricePackagingList)
data.clearancePricePackagingList = this.getPackingPrice(this.form.clearancePricePackagingList)
}
}
data.lineChannelList = this.selectedRoutes
......
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