From 2db730bf46f49e45bab0b5f372c3f05dcfd8c51b Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Thu, 6 Aug 2026 22:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=EF=BC=8C=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/canteen/canteenSpu/form.vue | 21 +++++++++++++++++---- src/views/canteen/canteenSpu/index.vue | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/views/canteen/canteenSpu/form.vue b/src/views/canteen/canteenSpu/form.vue index f93e6bcb..1d8428b2 100644 --- a/src/views/canteen/canteenSpu/form.vue +++ b/src/views/canteen/canteenSpu/form.vue @@ -57,8 +57,13 @@ + + + + + - + {{ item.label }} @@ -71,7 +76,7 @@ 选择组成菜品 - 至少选 2 个单品 + 至少选 1 个单品 @@ -100,6 +105,12 @@ + + + + + + @@ -198,7 +209,7 @@ const form = reactive({ merchantId: "", name: "", introduction: "", - description: "", + description: "", categoryId: "", picUrl: "", sliderPicUrls: "", @@ -226,7 +237,7 @@ const childQuery = reactive({ current: 1, size: 10, name: "" }) const validateCombo = (_: any, __: any, cb: any) => { if (form.spuType !== 2) return cb() - if (!form.comboItems.length || form.comboItems.length < 2) cb(new Error("套餐至少选择 2 个组成菜品")) + if (!form.comboItems.length || form.comboItems.length < 1) cb(new Error("套餐至少选择 1 个组成菜品")) else cb() } @@ -306,6 +317,7 @@ const openDialog = async (id: string) => { form.id = "" form.spuType = 1 form.comboItems = [] + form.description = "" dataFormRef.value?.resetFields() // 获取canteenSpu信息 @@ -359,6 +371,7 @@ const getcanteenSpuData = (id: string) => { marketPrice: Number(displayPrice(d.marketPrice, "")), status: "" + d.status, spuType: Number(d.spuType) === 2 ? 2 : 1, + description: d.description || "", comboItems: (d.comboItems || []).map((item: any) => ({ childSpuId: item.childSpuId, childSpuName: item.childSpuName || item.name, diff --git a/src/views/canteen/canteenSpu/index.vue b/src/views/canteen/canteenSpu/index.vue index a6d88b13..817c9e7d 100644 --- a/src/views/canteen/canteenSpu/index.vue +++ b/src/views/canteen/canteenSpu/index.vue @@ -91,7 +91,7 @@ - +