From 2792df38c0cdc1504d9bef713509e9707ac00cf7 Mon Sep 17 00:00:00 2001 From: paulGao Date: Wed, 7 Sep 2022 17:58:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BA=97=E9=93=BA=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=8F=AF=E8=83=BD=E4=B8=BAundefined=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seller/src/views/goods/goods-manage/category.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seller/src/views/goods/goods-manage/category.vue b/seller/src/views/goods/goods-manage/category.vue index 52c961ff..9aaf7db0 100644 --- a/seller/src/views/goods/goods-manage/category.vue +++ b/seller/src/views/goods/goods-manage/category.vue @@ -152,7 +152,7 @@ export default { this.formAdd.labelName = ""; this.showParent = true; delete this.formAdd.id; - this.formAdd.parentId = v.id; + this.formAdd.parentId = v.id || 0; this.modalVisible = true; }, // 编辑分类 @@ -162,7 +162,7 @@ export default { this.formAdd.id = v.id; this.formAdd.labelName = v.labelName; this.formAdd.level = v.level; - this.formAdd.parentId = v.parentId; + this.formAdd.parentId = v.parentId || 0; this.formAdd.sortOrder = v.sortOrder; this.showParent = false; this.modalVisible = true; @@ -176,7 +176,8 @@ export default { this.showParent = true; delete this.formAdd.id; this.formAdd.parentId = 0; - this.formAdd.sortOrder = 1 + this.formAdd.sortOrder = 1; + this.formAdd.level = 0; this.modalVisible = true; }, @@ -185,7 +186,6 @@ export default { this.$refs.formAdd.validate(valid => { if (valid) { this.submitLoading = true; - console.log(this.formAdd); if (this.modalType === 0) { // 添加 避免编辑后传入id等数据 记得删除 delete this.formAdd.id;