Commit c1e66daf authored by 邓春圆's avatar 邓春圆

阶梯价格必填项

parent fe71b581
...@@ -595,14 +595,27 @@ export default { ...@@ -595,14 +595,27 @@ export default {
}) })
}); });
}, },
verify(row){
return (row.startNum !== '' && row.endNum !== '' && row.clearancePrice !== '' && row.clearancePriceUnit !== '' && row.clearanceVolumeUnit !== '')
},
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
console.log(this.form);
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (!valid) { if (!valid) {
return; return;
} }
if(!this.form.airWeightLimit){
return this.$message.warning('请输入空运订单重量上限')
}
if(this.form.priceStepClearanceList.length === 0){
return this.$message.warning('阶梯定价输入不完整!')
}else {
let bol = this.form.priceStepClearanceList.every(this.verify)
if(!bol){
return this.$message.warning('阶梯定价输入不完整!')
}
}
//商品特性转字符串 //商品特性转字符串
this.form.attrId = this.form.attrArray.join(','); this.form.attrId = this.form.attrArray.join(',');
// 修改的提交 // 修改的提交
......
...@@ -219,25 +219,38 @@ export default { ...@@ -219,25 +219,38 @@ export default {
this.attrIds = [] this.attrIds = []
this.resetForm("form"); this.resetForm("form");
}, },
verify(row){
return (row.startNum !== '' && row.endNum !== '' && row.clearancePrice !== '' && row.clearancePriceUnit !== '' && row.clearanceVolumeUnit !== '')
},
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
let data = Object.assign({}, this.form)
if(!data.isAllProduct && !data.idList.length){
return this.$message(this.$t('请选择商品或勾选全部'))
}
if(!this.form.airWeightLimit){
return this.$message.warning('请输入空运订单重量上限')
}
if(this.form.priceStepClearanceList.length === 0){
return this.$message.warning('阶梯定价输入不完整!')
}else {
let bol = this.form.priceStepClearanceList.every(this.verify)
if(!bol){
return this.$message.warning('阶梯定价输入不完整!')
}
}
batchUpdateProduct(data).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.reset() this.reset()
console.log(this.form.priceStepClearanceList,'priceStepClearanceList') this.$forceUpdate()
// this.$refs["form"].validate((valid) => { // this.$store.dispatch('tagsView/delCurrentView')
// if (!valid) { });
// return; });
// }
// let data = Object.assign({}, this.form)
// if(!data.isAllProduct && !data.idList.length){
// return this.$message(this.$t('请选择商品或勾选全部'))
// }
// batchUpdateProduct(data).then((response) => {
// this.$modal.msgSuccess(this.$t("修改成功"));
// this.$forceUpdate()
// // this.$store.dispatch('tagsView/delCurrentView')
// });
// });
}, },
}, },
}; };
......
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