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,