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

修复海运非阶梯价不能设置包装类型

parent f801a9f9
......@@ -58,7 +58,17 @@ export default {
getDictDatas,
// 包装类型初始化
initPackingPrice(){
if(this.value[this.packagingField]?.length) return
// 已有包装类型则处理字段,没有则初始化一个
if(this.value[this.packagingField]?.length){
this.value[this.packagingField].forEach(item => {
if(!item.packagingTypes){
this.$set(item, 'packagingTypes', [])
}else if(typeof item.packagingTypes == 'string'){
item.packagingTypes = item.packagingTypes.split(',')
}
})
return
}
this.addPackage()
},
// 初始化特需加价
......@@ -110,6 +120,7 @@ export default {
// 检查包装费
if(this.value[this.packagingField]?.length){
this.value[this.packagingField]?.forEach((item, index) => {
if(!item.packagingTypes?.length) return
if(!this.validatePrice(item.packagingPrice)){
valid = false
this.$message.error(this.$t("请设置{name}的包装费{index}", {name: this.priceName, index: index+1}))
......
......@@ -755,9 +755,21 @@ export default {
}
// 格式化
if(this.form.priceType === 1){
data.fullPricePackagingList = this.getPackingPrice(data.fullPricePackagingList)
delete data.freightPricePackagingList
delete data.clearancePricePackagingList
}else{
data.freightPricePackagingList = this.getPackingPrice(data.freightPricePackagingList)
data.clearancePricePackagingList = this.getPackingPrice(data.clearancePricePackagingList)
delete data.fullPricePackagingList
}
// 删除阶梯价字段
delete data.freightPriceStepList
delete data.fullPriceStepList
delete data.clearancePriceStepList
}
// 设置了有效期,且已过期则给提示
......
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