Commit 8b15b3f2 authored by 邓春圆's avatar 邓春圆

添加必填

parent 811db4bf
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
渠道包装列表 渠道包装列表
</h1> </h1>
<div> <div>
<el-button type="primary" @click="addPackaging" >添加包装类型</el-button> <el-button type="primary" @click="addPackaging" >添加包装类型</el-button>
<el-button type="text" @click="dialogVisible = true;">选择渠道包装模板</el-button> <el-button type="text" @click="dialogVisible = true;">选择渠道包装模板</el-button>
</div> </div>
</div> </div>
...@@ -242,6 +242,8 @@ export default { ...@@ -242,6 +242,8 @@ export default {
this.warehouseIdsArr = this.form.warehouseIds.split(',')?.filter(item => !!item) this.warehouseIdsArr = this.form.warehouseIds.split(',')?.filter(item => !!item)
} }
}); });
}else {
this.addPackaging()
} }
}, },
...@@ -316,11 +318,14 @@ export default { ...@@ -316,11 +318,14 @@ export default {
//添加包装类型 //添加包装类型
addPackaging(){ addPackaging(){
let p = { let p = {
airWeightLimit:undefined, airWeightLimit:'',
packagingTypes:[], packagingTypes:[],
channelPriceStepClearanceList:[], channelPriceStepClearanceList:[],
} }
this.form.channelPackagingList.push(p) this.form.channelPackagingList.push(p)
},
verify(row){
return (row.startNum !== '' && row.endNum !== '' && row.clearancePrice !== '' && row.clearancePriceUnit !== '' && row.clearanceVolumeUnit !== '')
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
...@@ -328,6 +333,22 @@ export default { ...@@ -328,6 +333,22 @@ export default {
if (!valid) { if (!valid) {
return; return;
} }
let derail = false
this.form.channelPackagingList.forEach(item =>{
if(item.airWeightLimit === '' || item.airWeightLimit === 0){
derail = true
return this.$message.warning('请输入空运订单重量上限')
}
if(!item.packagingTypes.length){
derail = true
return this.$message.warning('请输入包装类型')
}
if(!item.channelPriceStepClearanceList.every(this.verify)){
derail = true
return this.$message.warning('请输入阶梯价格')
}
})
if (derail) return;
this.form.warehouseIds = this.warehouseIdsArr.join(',') this.form.warehouseIds = this.warehouseIdsArr.join(',')
let form = JSON.parse(JSON.stringify(this.form)) let form = JSON.parse(JSON.stringify(this.form))
let attrId = this.form.attrId let attrId = this.form.attrId
......
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