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

优化批量设置价格,未设置价格的阶梯不提交

parent 5cfd559d
...@@ -470,7 +470,7 @@ export default { ...@@ -470,7 +470,7 @@ export default {
}, },
// 获得用语提交的阶梯价副本 // 获得用语提交的阶梯价副本
getPriceList(stepList){ getPriceList(stepList, prefix){
if(!stepList?.length) return [] if(!stepList?.length) return []
let stepPriceList = JSON.parse(JSON.stringify(stepList)) let stepPriceList = JSON.parse(JSON.stringify(stepList))
stepPriceList.forEach((item, index) => { stepPriceList.forEach((item, index) => {
...@@ -481,7 +481,10 @@ export default { ...@@ -481,7 +481,10 @@ export default {
return p return p
}) })
}) })
return stepPriceList // 240121应老王要求,未设置价格的不提交
return stepPriceList.filter(item => {
return !!item[`${prefix}Price`]
})
}, },
// 非阶梯价格更新单位 // 非阶梯价格更新单位
handleFormUnitChange(data){ handleFormUnitChange(data){
...@@ -571,12 +574,12 @@ export default { ...@@ -571,12 +574,12 @@ export default {
// 全包价 // 全包价
if(this.form.priceType == 1) { if(this.form.priceType == 1) {
data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList) data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList, 'all')
delete data.clearancePriceStepList delete data.clearancePriceStepList
delete data.freightPriceStepList delete data.freightPriceStepList
}else{ }else{
data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList) data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList, 'clearance')
data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList) data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList, 'transport')
delete data.fullPriceStepList delete data.fullPriceStepList
} }
......
...@@ -336,7 +336,10 @@ export default { ...@@ -336,7 +336,10 @@ export default {
return p return p
}) })
}) })
return stepPriceList // 240121应老王要求,未设置价格的不提交
return stepPriceList.filter(item => {
return !!item[`${prefix}Price`]
})
}, },
submitForm() { submitForm() {
...@@ -376,12 +379,12 @@ export default { ...@@ -376,12 +379,12 @@ export default {
// 全包价 // 全包价
if(this.form.priceType == 1) { if(this.form.priceType == 1) {
data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList) data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList, 'all')
delete data.clearancePriceStepList delete data.clearancePriceStepList
delete data.freightPriceStepList delete data.freightPriceStepList
}else{ }else{
data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList) data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList, 'clearance')
data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList) data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList, 'transport')
delete data.fullPriceStepList delete data.fullPriceStepList
} }
......
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