From b467fcd4db04cd45c67cec73a7d8e1e62010b976 Mon Sep 17 00:00:00 2001
From: zjf <1799650030@qq.com>
Date: Thu, 24 Sep 2026 16:24:14 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AF=8F=E6=97=A5=E8=8F=9C?=
=?UTF-8?q?=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../canteenDailyMenu/importConfirmDialog.vue | 11 ++++++---
src/views/canteen/canteenDailyMenu/index.vue | 23 +++++++++++++++++++
.../canteen/canteenDailyMenu/rowDialog.vue | 14 +++++++++++
src/views/canteen/canteenSpu/form.vue | 8 -------
4 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/src/views/canteen/canteenDailyMenu/importConfirmDialog.vue b/src/views/canteen/canteenDailyMenu/importConfirmDialog.vue
index 2cf59e56..9a29c48e 100644
--- a/src/views/canteen/canteenDailyMenu/importConfirmDialog.vue
+++ b/src/views/canteen/canteenDailyMenu/importConfirmDialog.vue
@@ -450,6 +450,10 @@ const open = (payload: {
bizDate,
mealNames: mealNames.length ? mealNames : [],
mealName: mealNames.join(",") || r.mealName,
+ id: r.id != null && r.id !== "" ? String(r.id) : r.id,
+ spuId: r.spuId != null && r.spuId !== "" ? String(r.spuId) : r.spuId,
+ childSpuId:
+ r.childSpuId != null && r.childSpuId !== "" ? String(r.childSpuId) : r.childSpuId,
}
})
mealFilters.value = [...ALL_MEALS]
@@ -517,9 +521,10 @@ const submitConfirm = async () => {
onlineStock: toNumberOrUndef(r.onlineStock),
offlineStock: toNumberOrUndef(r.offlineStock),
ingredients: r.ingredients,
- id: r.id,
- spuId: r.spuId,
- childSpuId: r.childSpuId,
+ // 雪花 ID 必须始终以字符串回传,避免 JSON Number 丢末位精度
+ id: r.id != null && r.id !== "" ? String(r.id) : undefined,
+ spuId: r.spuId != null && r.spuId !== "" ? String(r.spuId) : undefined,
+ childSpuId: r.childSpuId != null && r.childSpuId !== "" ? String(r.childSpuId) : undefined,
}
}),
}
diff --git a/src/views/canteen/canteenDailyMenu/index.vue b/src/views/canteen/canteenDailyMenu/index.vue
index e0fcb8cf..d7e3571d 100644
--- a/src/views/canteen/canteenDailyMenu/index.vue
+++ b/src/views/canteen/canteenDailyMenu/index.vue
@@ -90,6 +90,10 @@
|
{{ getCategoryName(item.categoryId) }}
+
+ {{ displayComboName(item) }}
+
含:{{ formatComboItems(item.comboItems) }}
@@ -113,6 +117,10 @@
|
{{ getCategoryName(item.categoryId) }}
+
+ {{ displayComboName(item) }}
+
含:{{ formatComboItems(item.comboItems) }}
@@ -137,6 +145,10 @@
|
{{ getCategoryName(item.categoryId) }}
+
+ {{ displayComboName(item) }}
+
含:{{ formatComboItems(item.comboItems) }}
@@ -223,6 +235,11 @@
:max-height="listTableMaxHeight"
:default-sort="{ prop: 'sort', order: 'ascending' }"
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle">
+
+
+ {{ displayComboName(row) }}
+
+
@@ -571,6 +588,12 @@ const getCategoryName = (categoryId?: number | string) =>
const formatComboItems = (comboItems: any[] = []) =>
comboItems.map((c: any) => c.name || c.childSpuName).filter(Boolean).join("、")
+/** 列表展示套餐名:优先 comboName,其次 introduction;单品显示 - */
+const displayComboName = (row: any) => {
+ if (Number(row?.spuType) !== 2) return "-"
+ return String(row?.comboName || row?.introduction || "").trim() || "-"
+}
+
const hourTypeLabel = (hourType?: number) => HOUR_TYPE_LABEL[hourType || 0] || "-"
const hourTypeTagType = (hourType?: number) => {
diff --git a/src/views/canteen/canteenDailyMenu/rowDialog.vue b/src/views/canteen/canteenDailyMenu/rowDialog.vue
index e373ddc5..ba357736 100644
--- a/src/views/canteen/canteenDailyMenu/rowDialog.vue
+++ b/src/views/canteen/canteenDailyMenu/rowDialog.vue
@@ -33,6 +33,10 @@
日期
{{ formatDate(detail.startTime) }}
+
+ 套餐名
+ {{ detail.comboName || detail.introduction || "-" }}
+
排序
{{ detail.sort ?? "-" }}
@@ -85,6 +89,9 @@
{{ detail.name || "-" }}
套餐
+
+
+
{{ formatDate(detail.startTime) }}
@@ -146,6 +153,7 @@ const form = reactive({
onlineStock: 600,
offlineStock: 600,
priceYuan: 0,
+ comboName: "",
description: "
",
})
@@ -220,6 +228,7 @@ const openDialog = async (row: any, openMode: "view" | "edit" = "view") => {
form.onlineStock = row.onlineStock ?? 600
form.offlineStock = row.offlineStock ?? 600
form.priceYuan = Number(displayPrice(row.price, "")) || 0
+ form.comboName = row.comboName || row.introduction || ""
form.description = row.ingredients || "
"
try {
@@ -227,6 +236,8 @@ const openDialog = async (row: any, openMode: "view" | "edit" = "view") => {
const res: any = await getSpu(row.spuId)
const spu = res.data || {}
detail.ingredients = spu.description || row.ingredients || ""
+ detail.comboName = spu.comboName || spu.introduction || detail.comboName || ""
+ detail.introduction = spu.introduction || detail.introduction || ""
detail.categoryName = row.categoryName || detail.categoryName
if (Array.isArray(spu.comboItems) && spu.comboItems.length) {
detail.comboItems = spu.comboItems
@@ -234,6 +245,7 @@ const openDialog = async (row: any, openMode: "view" | "edit" = "view") => {
if (openMode === "edit") {
form.sort = spu.sort ?? form.sort
form.priceYuan = Number(displayPrice(spu.price, "")) || form.priceYuan
+ form.comboName = spu.comboName || spu.introduction || form.comboName
form.description = spu.description || "
"
}
}
@@ -266,6 +278,8 @@ const onSubmit = async () => {
price: storePrice(form.priceYuan),
marketPrice: storePrice(form.priceYuan),
description: form.description,
+ comboName: Number(detail.spuType) === 2 ? form.comboName || "" : "",
+ introduction: Number(detail.spuType) === 2 ? form.comboName || spu.introduction || "" : spu.introduction,
comboItems: spu.comboItems || [],
})
useMessage().success("保存成功")
diff --git a/src/views/canteen/canteenSpu/form.vue b/src/views/canteen/canteenSpu/form.vue
index 23137df3..97d3d6ae 100644
--- a/src/views/canteen/canteenSpu/form.vue
+++ b/src/views/canteen/canteenSpu/form.vue
@@ -26,11 +26,6 @@
-
-
-
-
-
@@ -219,7 +214,6 @@ const form = reactive({
merchantId: "",
name: "",
nameEn: "",
- comboName: "",
introduction: "",
description: "",
categoryId: "",
@@ -275,7 +269,6 @@ const dataRules = ref({
const onSpuTypeChange = () => {
if (form.spuType !== 2) {
form.comboItems = []
- form.comboName = ""
}
}
@@ -351,7 +344,6 @@ const onSubmit = async () => {
const _pa: any = {
...form,
spuType: isCombo ? 2 : 1,
- comboName: isCombo ? form.comboName : "",
price: storePrice(form.price),
marketPrice: storePrice(form.marketPrice),
comboItems: isCombo