diff --git a/src/views/canteen/canteenDailyMenu/form.vue b/src/views/canteen/canteenDailyMenu/form.vue index c1e8bf3..43787f4 100644 --- a/src/views/canteen/canteenDailyMenu/form.vue +++ b/src/views/canteen/canteenDailyMenu/form.vue @@ -32,15 +32,29 @@

预览图

-
-
@@ -140,13 +154,14 @@ const dataFormRef = ref() const visible = ref(false) const queryRef = ref() const selectObjs = ref([]) as any // 表格多选的数据 -const selectedList = ref([]) +const selectedFood = ref([]) const loading = ref(false) const selectDialogVisible = ref(false) // 选择菜品对话框开关 const { spu_status } = useDict("spu_status") const categoryOptions = ref([]) // 商品分类选项 const imageBaseUrl = import.meta.env.VITE_IMAGE_BASE_PATH const dataRules = ref({}) // 定义校验规则 +const hoverIndex = ref(-1) // 预览图片hover的索引 // 提交表单数据 const form = reactive({ @@ -157,7 +172,7 @@ const form = reactive({ }) // 选择的菜品的id数组 const spuIds = computed(() => { - return selectedList.value?.map((item: any) => item.id) + return selectedFood.value?.map((item: any) => item.id) }) const state: BasicTableProps = reactive({ @@ -189,7 +204,7 @@ const openDialog = (id: string, time?: string, hourType?: number, merchantId?: n // 重置表单数据 dataFormRef.value?.resetFields() selectObjs.value = [] - selectedList.value = [] + selectedFood.value = [] state.dataList = [] // 获取canteenDailyMenu信息 @@ -233,15 +248,20 @@ const handleClickSelect = async () => { } } +// 移除预览 +const removeSelectedItem = (id: string) => { + selectedFood.value = selectedFood.value.filter((item: any) => item.id !== id) +} + // 选择菜品点击确认 const handleSelectDialogConfirm = () => { selectDialogVisible.value = false - selectedList.value = selectObjs.value + selectedFood.value = selectObjs.value } // 提交 const onSubmit = async () => { - if (selectedList.value.length <= 0) { + if (selectedFood.value.length <= 0) { useMessage().warning("请选择菜品") return } diff --git a/src/views/canteen/canteenDailyMenu/index.vue b/src/views/canteen/canteenDailyMenu/index.vue index e156aee..4572eb5 100644 --- a/src/views/canteen/canteenDailyMenu/index.vue +++ b/src/views/canteen/canteenDailyMenu/index.vue @@ -33,7 +33,12 @@ fit="cover" @click="delteData(item.tid)" /> -
{{ item.name }}
+
+ {{ item.name }} + | + {{ canteenCategoryOption.find((v: any) => v.id == item.categoryId)?.name }} +
+
{{ displayPrice(item.price) }}
@@ -47,12 +52,12 @@ fit="cover" @click="delteData(item.tid)" /> -
+
{{ item.name }} | - {{ "某分类" }} + {{ canteenCategoryOption.find((v: any) => v.id == item.categoryId)?.name }}
-
{{ "¥6.6" }}
+
{{ displayPrice(item.price) }}
@@ -66,7 +71,12 @@ fit="cover" @click="delteData(item.tid)" /> -
{{ item.name }}
+
+ {{ item.name }} + | + {{ canteenCategoryOption.find((v: any) => v.id == item.categoryId)?.name }} +
+
{{ displayPrice(item.price) }}
@@ -80,8 +90,10 @@ @@ -230,6 +254,7 @@ onMounted(() => { margin-left: 20px; &_item { + position: relative; display: flex; flex-direction: column; justify-content: space-between; diff --git a/src/views/supermarket/supermarketBrand/form.vue b/src/views/supermarket/supermarketBrand/form.vue index 3bddb84..41a0de8 100644 --- a/src/views/supermarket/supermarketBrand/form.vue +++ b/src/views/supermarket/supermarketBrand/form.vue @@ -10,7 +10,7 @@ - + @@ -22,20 +22,22 @@ - + - + - {{ item.label }} + {{ item.label }} + @@ -51,87 +53,87 @@ diff --git a/src/views/supermarket/supermarketBrand/index.vue b/src/views/supermarket/supermarketBrand/index.vue index af7a60f..ffdf083 100644 --- a/src/views/supermarket/supermarketBrand/index.vue +++ b/src/views/supermarket/supermarketBrand/index.vue @@ -14,7 +14,13 @@
- + 新 增 编辑 - + 删除 @@ -87,66 +99,71 @@ diff --git a/src/views/supermarket/supermarketCategory/form.vue b/src/views/supermarket/supermarketCategory/form.vue index 609686e..2f27196 100644 --- a/src/views/supermarket/supermarketCategory/form.vue +++ b/src/views/supermarket/supermarketCategory/form.vue @@ -10,7 +10,7 @@ - + @@ -22,14 +22,16 @@ - + - {{ item.label }} + {{ item.label }} + @@ -52,85 +54,85 @@ diff --git a/src/views/supermarket/supermarketCategory/index.vue b/src/views/supermarket/supermarketCategory/index.vue index 95d0ef1..ba764af 100644 --- a/src/views/supermarket/supermarketCategory/index.vue +++ b/src/views/supermarket/supermarketCategory/index.vue @@ -14,7 +14,13 @@
- + 新 增 编辑 - + 删除 @@ -88,67 +100,72 @@ diff --git a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue index 7f7de51..e4e15cd 100644 --- a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue +++ b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue @@ -4,7 +4,7 @@ - + @@ -19,56 +19,56 @@ diff --git a/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue b/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue index b86ee44..8622b09 100644 --- a/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue +++ b/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue @@ -4,19 +4,19 @@ - + - + - + @@ -31,29 +31,29 @@ - + + + + + + - - - - - - - - - - + + + + + - + - + @@ -68,71 +68,71 @@ diff --git a/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue b/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue index 4d30457..341346b 100644 --- a/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue +++ b/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue @@ -31,7 +31,12 @@ -->
- 新 增 @@ -67,17 +77,30 @@ - - + + - - + + @@ -91,11 +114,11 @@ diff --git a/src/views/supermarket/supermarketSpu/form.vue b/src/views/supermarket/supermarketSpu/form.vue index 88760ad..52989b7 100644 --- a/src/views/supermarket/supermarketSpu/form.vue +++ b/src/views/supermarket/supermarketSpu/form.vue @@ -11,31 +11,31 @@ - + - + - + - + - @@ -50,13 +50,18 @@ - - - - - - - + + + + + + + @@ -69,56 +74,63 @@ - + + + + + + - {{ item.label }} + {{ item.label }} + - - - - - + + + + + - + - + - - - - - + + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -149,11 +161,11 @@ - - - - - + + + + + @@ -85,19 +96,30 @@ - @@ -106,84 +128,99 @@
- +
+
+
+ + + -
+
{{ item.name }} | - {{ "某分类" }} + + {{ categoryOptions.find((v: any) => v.id == item.categoryId)?.name ?? "未知" }} +
-
{{ "¥6.6" }}
+
{{ displayPrice(item.price) }}