From b9d9acc7cb93aeee1007192776df99e02cc52d8a Mon Sep 17 00:00:00 2001
From: zjf <1799650030@qq.com>
Date: Mon, 16 Dec 2024 21:41:42 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E5=8E=A2=E5=9F=BA=E7=A1=80=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/message.ts | 4 +-
src/views/canteen/boxesInfo/form.vue | 82 +++++++++++++-------
src/views/canteen/canteenDailyMenu/index.vue | 4 +-
3 files changed, 57 insertions(+), 33 deletions(-)
diff --git a/src/hooks/message.ts b/src/hooks/message.ts
index b3739e7..9a1c379 100644
--- a/src/hooks/message.ts
+++ b/src/hooks/message.ts
@@ -61,8 +61,8 @@ export function useMessage() {
content ? content : t('common.delMessage'),
tip ? tip : t('common.confirmTitle'),
{
- confirmButtonText: t('common.ok'),
- cancelButtonText: t('common.cancel'),
+ confirmButtonText: t('确定'),
+ cancelButtonText: t('取消'),
type: 'warning'
}
)
diff --git a/src/views/canteen/boxesInfo/form.vue b/src/views/canteen/boxesInfo/form.vue
index 21f1d8f..41a5c6a 100644
--- a/src/views/canteen/boxesInfo/form.vue
+++ b/src/views/canteen/boxesInfo/form.vue
@@ -3,35 +3,35 @@
:close-on-click-modal="false" draggable>
+
+
+
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -41,15 +41,16 @@
-
-
-
-
- 0
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -66,12 +67,17 @@ import { useDict } from '/@/hooks/dict';
import { useMessage } from "/@/hooks/message";
import { getObj, addObj, putObj } from '/@/api/canteen/boxesInfo'
import { rule } from '/@/utils/validate';
+import {selectMerchantList} from "/@/api/canteen/merchantInfo";
const emit = defineEmits(['refresh']);
// 定义变量内容
const dataFormRef = ref();
const visible = ref(false)
const loading = ref(false)
+//业务变量
+// const merchantId = ref()
+const merchantStatus = ref(true)
+const merchantInfo = ref([])
// 定义字典
const { boxes_status } = useDict('boxes_status')
@@ -83,7 +89,7 @@ const form = reactive({
description: '',
address: '',
images: '',
- status: '',
+ status: '0',
merchantId: '',
});
@@ -109,6 +115,8 @@ const openDialog = (id: string) => {
form.id = id
getboxesInfoData(id)
}
+ //初始化商户信息
+ merchantInit()
};
// 提交
@@ -140,9 +148,25 @@ const getboxesInfoData = (id: string) => {
loading.value = false
})
};
+const merchantInit = async () => {
+ // 获取下拉框
+ let res = await selectMerchantList("1")
+ merchantInfo.value=res.data
+ //默认选中第一个
+ if (merchantInfo.value) {
+ if (merchantInfo.value.length > 1) {
+ merchantStatus.value = false
+ }else {
+ form.merchantId=merchantInfo.value[0].id
+ }
+
+ }
+}
// 暴露变量
defineExpose({
openDialog
});
-
\ No newline at end of file
+
+
+
diff --git a/src/views/canteen/canteenDailyMenu/index.vue b/src/views/canteen/canteenDailyMenu/index.vue
index dada007..9c48d70 100644
--- a/src/views/canteen/canteenDailyMenu/index.vue
+++ b/src/views/canteen/canteenDailyMenu/index.vue
@@ -170,7 +170,7 @@ const selectTimeFood = async () => {
}
/** 删除数据源按钮 */
const delteData = async (tid: number) => {
- await message.delConfirm('确定删除菜品吗?')
+ await message.delConfirm("确定删除菜品吗?",'今日菜品?')
await delObjs(tid)
message.success(('common.delSuccess'))
selectTimeFood()
@@ -218,12 +218,12 @@ const handleDelete = async (ids: string[]) => {
merchantStatus.value = false
}
// getList()
+ fetchData()
}
}
/** 初始化 **/
onMounted(() => {
- fetchData()
merchantInit()
})