Browse Source

商品新增编辑规格必填校验业务功能添加

master
dy-hu 1 year ago
parent
commit
5ba8e9fd35
  1. 16
      src/views/commodity/commoditySystem/addCommodity.vue

16
src/views/commodity/commoditySystem/addCommodity.vue

@ -636,6 +636,15 @@ export default {
return objClone
},
async doSave() {
if (this.form.skus.length === 1) {
if (this.form.skus[0].skuAttrCodeDTOList.length === 0) {
this.$message({
message: '请编辑规格',
type: 'warning'
})
return false
}
}
this.form.skus.forEach(element => {
//--
element.style = this.form.attrStyle
@ -645,6 +654,13 @@ export default {
})
for (let i = 0; i < this.form.skus.length; i++) {
let skuItem = this.form.skus[i];
if (skuItem.skuAttrCodeDTOList[0].code === '') {
this.$message({
message: '请编辑规格',
type: 'warning'
})
return false
}
if (skuItem.rate === '' || skuItem.rate === null || skuItem.rate === undefined) {
this.$message({
message: '税率不能为空',

Loading…
Cancel
Save