From 28853ee80e6f44f8f16aa12bbf7e2b1777776b58 Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Thu, 15 May 2025 15:13:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=9F=E5=A0=82=E8=BF=9B=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/canteen/canteenSpu.ts | 9 + src/views/canteen/canteenErpSpu/form.vue | 187 ++++++++++++++++++ src/views/canteen/canteenErpSpu/index.vue | 123 ++++++++++++ .../canteen/canteenProductionRecord/form.vue | 15 +- 4 files changed, 324 insertions(+), 10 deletions(-) create mode 100644 src/views/canteen/canteenErpSpu/form.vue create mode 100644 src/views/canteen/canteenErpSpu/index.vue diff --git a/src/api/canteen/canteenSpu.ts b/src/api/canteen/canteenSpu.ts index 24403d3..ee1d288 100644 --- a/src/api/canteen/canteenSpu.ts +++ b/src/api/canteen/canteenSpu.ts @@ -8,6 +8,15 @@ export function fetchList(query?: Object) { }) } +export function fetchErpList(query?: Object) { + return request({ + url: '/canteen/canteenSpu/erp/page', + method: 'get', + params: query + }) +} + + export function fetchSimpleList(query?: Object) { return request({ url: '/canteen/canteenSpu/getCanteenSpuSimplePage', diff --git a/src/views/canteen/canteenErpSpu/form.vue b/src/views/canteen/canteenErpSpu/form.vue new file mode 100644 index 0000000..b4bd583 --- /dev/null +++ b/src/views/canteen/canteenErpSpu/form.vue @@ -0,0 +1,187 @@ + + + diff --git a/src/views/canteen/canteenErpSpu/index.vue b/src/views/canteen/canteenErpSpu/index.vue new file mode 100644 index 0000000..1445df0 --- /dev/null +++ b/src/views/canteen/canteenErpSpu/index.vue @@ -0,0 +1,123 @@ + + + diff --git a/src/views/canteen/canteenProductionRecord/form.vue b/src/views/canteen/canteenProductionRecord/form.vue index 0145b44..1e3ed47 100644 --- a/src/views/canteen/canteenProductionRecord/form.vue +++ b/src/views/canteen/canteenProductionRecord/form.vue @@ -347,7 +347,6 @@ const confirmTemplateSelection = () => { newSelectedTemplates.forEach(template => { const details = template.canteenProductionTemplateDetailList.map((item: any) => ({ ...item, - dishId: template.dishId, dishName: template.dishName, materialUnit: item.unit, produceQuantity: 1, @@ -490,18 +489,14 @@ const submitForm = async () => { // 格式化生产详情列表,将食材按菜品分组 const formatProductionDetails = (details: any[]) => { - // 使用dishId作为键来分组,如果没有dishId,则使用dishName作为备选 const dishMap = new Map() - // 按菜品分组 + // 按菜品名称分组 details.forEach(item => { - // 使用dishId作为键,如果没有则使用dishName - const key = item.dishId ? item.dishId.toString() : item.dishName - - if (!dishMap.has(key)) { + if (!dishMap.has(item.dishName)) { // 创建新的菜品组 - dishMap.set(key, { - dishId: item.dishId || null, // 确保有dishId,即使是null + dishMap.set(item.dishName, { + dishId: item.dishId, dishName: item.dishName, produceQuantity: item.produceQuantity, // 创建食材列表 @@ -510,7 +505,7 @@ const formatProductionDetails = (details: any[]) => { } // 将食材添加到对应菜品组的食材列表中 - const dish = dishMap.get(key) + const dish = dishMap.get(item.dishName) dish.materialDetailList.push({ materialId: item.materialId, materialName: item.materialName,