From 546ff5ac7039c250adb05628e3222abab05d1b8b Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Sat, 11 May 2024 14:57:19 +0800 Subject: [PATCH 1/2] add --- src/views/goods/goods/detail.vue | 97 +++++-- src/views/goods/goods/details.vue | 355 ----------------------- src/views/goods/goods/edit.vue | 29 +- src/views/goods/goods/index.vue | 15 +- src/views/retail/cashierclass/detail.vue | 39 ++- src/views/retail/cashierclass/index.vue | 5 +- src/views/retail/cashierinfo/details.vue | 20 +- 7 files changed, 162 insertions(+), 398 deletions(-) delete mode 100644 src/views/goods/goods/details.vue diff --git a/src/views/goods/goods/detail.vue b/src/views/goods/goods/detail.vue index ae25e2e..d2b8274 100644 --- a/src/views/goods/goods/detail.vue +++ b/src/views/goods/goods/detail.vue @@ -1,18 +1,57 @@ @@ -144,7 +154,7 @@ import { apiGoodsclassLists } from "@/api/goodsclass"; import { apiBrandLists } from "@/api/brand"; import { apiUnitLists } from "@/api/unit"; import { apiWarehouseLists } from "@/api/warehouse"; -import { timeFormat } from "@/utils/util"; +import { goods_label } from "@/components/dialogTable/dialogTableConfig" import type { PropType } from "vue"; defineProps({ dictData: { @@ -156,6 +166,7 @@ const emit = defineEmits(["success", "close"]); const formRef = shallowRef(); const popupRef = shallowRef>(); const mode = ref("add"); +const showDialog = ref(false) // 弹窗标题 const popupTitle = computed(() => { @@ -182,6 +193,8 @@ const formData = reactive({ location: "", stocktip: "", retail_name: "", + sys_labels_text: "", + sys_labels: "", imgs: "", details: "", data: "", @@ -189,6 +202,20 @@ const formData = reactive({ sort: "", }); + +const customEvent = (e) => { + formData.sys_labels = [] + let text = [] + e.forEach(item => { + formData.sys_labels.push(item.id) + text.push(item.name) + }); + formData.sys_labels_text = text.join(',') + formData.sys_labels = formData.sys_labels.join(',') + showDialog.value = false +} + + // 表单验证 const formRules = reactive({ name: [ diff --git a/src/views/goods/goods/index.vue b/src/views/goods/goods/index.vue index e551f40..99c5516 100644 --- a/src/views/goods/goods/index.vue +++ b/src/views/goods/goods/index.vue @@ -52,7 +52,7 @@ - + @@ -61,6 +61,7 @@ + @@ -73,12 +74,12 @@ 编辑 - - 详情 - 删除 + + 详情 + @@ -99,7 +100,7 @@ import { apiGoodsLists, apiGoodsDelete } from '@/api/goods' import { timeFormat } from '@/utils/util' import feedback from '@/utils/feedback' import EditPopup from './edit.vue' -import DetailPopup from './details.vue' +import DetailPopup from './detail.vue' const editRef = shallowRef>() const detailRef = shallowRef>() @@ -156,8 +157,8 @@ const handleEdit = async (data: any) => { const handleDetail = async (data: any) => { showDetail.value = true await nextTick() - detailRef.value?.open() - detailRef.value?.getDetail(data) + detailRef.value?.open('edit') + detailRef.value?.setFormData(data) } // 删除 diff --git a/src/views/retail/cashierclass/detail.vue b/src/views/retail/cashierclass/detail.vue index 8163fc0..db41f47 100644 --- a/src/views/retail/cashierclass/detail.vue +++ b/src/views/retail/cashierclass/detail.vue @@ -39,6 +39,28 @@ {{ formData.auditingtime }} + +
+ + + + + + + + + + + + + + + +
+
+ +
+ @@ -46,6 +68,8 @@