From 1afc9e8af8704bb54e1410331057d906f901506f Mon Sep 17 00:00:00 2001 From: cl Date: Thu, 20 May 2021 15:52:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E8=A7=84=E6=A0=BC=E6=96=B0?= =?UTF-8?q?=E5=A2=9Ebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mall4v/src/views/modules/prod/spec-add-or-update.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mall4v/src/views/modules/prod/spec-add-or-update.vue b/mall4v/src/views/modules/prod/spec-add-or-update.vue index 334551b..57ec96b 100644 --- a/mall4v/src/views/modules/prod/spec-add-or-update.vue +++ b/mall4v/src/views/modules/prod/spec-add-or-update.vue @@ -52,7 +52,7 @@ export default { dataList: [{ propId: 0, propName: '', prodPropValues: [{ valueId: 0 }] }], dataRule: { propName: [ - { required: true, message: '菜单名称不能为空', trigger: 'blur' } + { required: true, message: '属性名称不能为空', trigger: 'blur' } ] }, page: { @@ -87,6 +87,11 @@ export default { } this.dataList[0].prodPropValues = temp } + if (this.dataList[0].prodPropValues.length < 1) { + this.dataList[0].prodPropValues = [{ valueId: 0 }] + this.$message.error('规格项不能为空') + return + } this.$http({ url: this.$http.adornUrl(`/prod/spec`), method: this.dataList[0].propId ? 'put' : 'post', @@ -126,4 +131,4 @@ export default { } } } - \ No newline at end of file +