diff --git a/src/views/commodity/commoditySystem/addCommodity.vue b/src/views/commodity/commoditySystem/addCommodity.vue index a35cea9..13fb226 100644 --- a/src/views/commodity/commoditySystem/addCommodity.vue +++ b/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: '税率不能为空',