This commit is contained in:
dzc committed 2025-01-14 11:34:56 +08:00
commit bac2067c08
3 files changed
+15 -30

No files matched your search

+3 -3
View File
@@ -23,11 +23,11 @@ export function getObj(id?: string) {
})
}
export function delObjs(data?: Object) {
export function delObjs(tid: number[], merchantId: string) {
return request({
url: "/canteen/canteenDailyMenu",
url: `/canteen/canteenDailyMenu?merchantId=${merchantId}`,
method: "delete",
data,
data: tid,
})
}
+1 -1
View File
@@ -47,7 +47,7 @@
<CircleClose />
</el-icon>
<el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" />
<div class="w-full flex justify-around items-center text-black">
<div class="w-full flex justify-around items-center text-black mt-2">
<span>{{ item.name }}</span>
<span class="mx-1">|</span>
<span class="text-sm">
+11 -26
View File
@@ -26,14 +26,9 @@
<tr class="food">
<td @click="addFood(1)">早餐</td>
<div class="food_list">
<td class="food_list_item" v-for="(item, index) in foodData1" :key="index">
<el-image
style="width: 80px; height: 80px"
:src="imageBaseUrl + item.picUrl"
fit="cover"
@click="delteData(item.tid)"
/>
<div class="w-full flex justify-around items-center text-black">
<td class="food_list_item" v-for="(item, index) in foodData1" :key="index" @click="delteData(item.tid)">
<el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" />
<div class="w-full flex justify-around items-center text-black mt-2">
<span>{{ item.name }}</span>
<span class="mx-1">|</span>
<span class="text-sm">{{ canteenCategoryOption.find((v: any) => v.id == item.categoryId)?.name }}</span>
@@ -45,14 +40,9 @@
<tr class="food">
<td @click="addFood(2)">中餐</td>
<div class="food_list">
<td class="food_list_item" v-for="(item, index) in foodData2" :key="index">
<el-image
style="width: 80px; height: 80px"
:src="imageBaseUrl + item.picUrl"
fit="cover"
@click="delteData(item.tid)"
/>
<div class="w-full flex justify-around items-center text-black">
<td class="food_list_item" v-for="(item, index) in foodData2" :key="index" @click="delteData(item.tid)">
<el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" />
<div class="w-full flex justify-around items-center text-black mt-2">
<span>{{ item.name }}</span>
<span class="mx-1">|</span>
<span class="text-sm">{{ canteenCategoryOption.find((v: any) => v.id == item.categoryId)?.name }}</span>
@@ -64,14 +54,9 @@
<tr class="food">
<td @click="addFood(3)">晚餐</td>
<div class="food_list">
<td class="food_list_item" v-for="(item, index) in foodData3" :key="index">
<el-image
style="width: 80px; height: 80px"
:src="imageBaseUrl + item.picUrl"
fit="cover"
@click="delteData(item.tid)"
/>
<div class="w-full flex justify-around items-center text-black">
<td class="food_list_item" v-for="(item, index) in foodData3" :key="index" @click="delteData(item.tid)">
<el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" />
<div class="w-full flex justify-around items-center text-black mt-2">
<span>{{ item.name }}</span>
<span class="mx-1">|</span>
<span class="text-sm">{{ canteenCategoryOption.find((v: any) => v.id == item.categoryId)?.name }}</span>
@@ -115,7 +100,7 @@ const weekParams = reactive({
const weekData = reactive({
data: [],
}) //时间数组
const merchantId = ref()
const merchantId = ref() // 商户id
const merchantInfo = ref<any>([])
const addFood = async (hourType: number) => {
@@ -192,7 +177,7 @@ const selectTimeFood = async () => {
const delteData = async (tid: number) => {
await message.delConfirm("确定删除菜品吗?", "今日菜品?")
try {
await delObjs([tid])
await delObjs([tid], merchantId.value)
message.success("删除成功")
} catch (error) {
message.error("删除失败")