From dc24336da2db889f448f801f0e33a0ab1373607c Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Sat, 11 May 2024 18:14:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opurchaseclass/component/goodsOffer.vue | 4 ++ .../opurchaseclass/component/subOrder.vue | 18 +++-- src/views/opurchase/opurchaseclass/detail.vue | 1 + src/views/retail/cashierclass/detail.vue | 69 ++++++------------- src/views/retail/cashierclass/index.vue | 6 +- 5 files changed, 41 insertions(+), 57 deletions(-) diff --git a/src/views/opurchase/opurchaseclass/component/goodsOffer.vue b/src/views/opurchase/opurchaseclass/component/goodsOffer.vue index 38a715c..06a933c 100644 --- a/src/views/opurchase/opurchaseclass/component/goodsOffer.vue +++ b/src/views/opurchase/opurchaseclass/component/goodsOffer.vue @@ -170,6 +170,7 @@ const offerGood = (row: any, type: number) => { dialogVisible.value = true; }; + const goodsOfferUpdate = () => { apiOpurchaseclassGoodsOfferUpdate({ id: updateInfo.value.id, @@ -181,4 +182,7 @@ const goodsOfferUpdate = () => { dialogVisible.value = false; }); }; + + + diff --git a/src/views/opurchase/opurchaseclass/component/subOrder.vue b/src/views/opurchase/opurchaseclass/component/subOrder.vue index 4ac6cd5..d054804 100644 --- a/src/views/opurchase/opurchaseclass/component/subOrder.vue +++ b/src/views/opurchase/opurchaseclass/component/subOrder.vue @@ -25,15 +25,17 @@
- + diff --git a/src/views/opurchase/opurchaseclass/detail.vue b/src/views/opurchase/opurchaseclass/detail.vue index b9bb1ea..b30938b 100644 --- a/src/views/opurchase/opurchaseclass/detail.vue +++ b/src/views/opurchase/opurchaseclass/detail.vue @@ -77,6 +77,7 @@ const activeMap = ref( ); console.log(activeMap.value); + const getDetail = async () => { const data = await apiOpurchaseclassDetail({ id: route.query.id, diff --git a/src/views/retail/cashierclass/detail.vue b/src/views/retail/cashierclass/detail.vue index 7d8fca6..7956f5e 100644 --- a/src/views/retail/cashierclass/detail.vue +++ b/src/views/retail/cashierclass/detail.vue @@ -3,10 +3,10 @@ - + - - {{ formData.user_name }} + + {{ formData.real_name }} {{ formData.create_time }} @@ -70,6 +70,7 @@ import Popup from '@/components/popup/index.vue' import type { PropType } from 'vue' import { usePaging } from '@/hooks/usePaging' import { apiCashierinfoLists } from '@/api/cashierinfo' +import { apiCashierclassDetail } from '@/api/cashierclass' defineProps({ dictData: { type: Object as PropType>, @@ -79,12 +80,14 @@ defineProps({ const emit = defineEmits(['success', 'close']) const popupRef = shallowRef>() const mode = ref('add') -let pid; +const queryParams = reactive({ + pid: '' +}) // 分页相关 const { pager, getLists, resetParams, resetPage } = usePaging({ fetchFun: apiCashierinfoLists, - params: { pid: pid } + params: queryParams }) // 弹窗标题 @@ -93,27 +96,7 @@ const popupTitle = computed(() => { }) // 表单数据 -const formData = reactive({ - id: '', - merchant: '', - user_name: "", - create_time: "", - store_id: '', - customer: '', - time: '', - number: '', - total: '', - deduction_price: '', - actual: '', - money: '', - pay_type: '', - data: '', - type: '', - auditinguser: '', - auditinguser_name: "", - auditingtime: '', - more: '', -}) +const formData = ref({}) // 表单验证 const formRules = reactive({ @@ -127,34 +110,21 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { - - console.log(data.id, 'pid') - return - for (const key in formData) { - if (data[key] != null && data[key] != undefined) { - //@ts-ignore - formData[key] = data[key] - } - } - pid = data.id - console.log(pid, 'pid') - // let res = await apiCashierinfoLists({ pid: data.id }) - getLists() + formData.value = data } +const getDetail = (data:any)=>{ + apiCashierclassDetail({ + id: data.id + }).then(res=>{ + setFormData(res); + }) + queryParams.pid = data.id + getLists() +} -// 提交按钮 -// const handleSubmit = async () => { -// await formRef.value?.validate() -// const data = { ...formData, } -// mode.value == 'edit' -// ? await apiBrandEdit(data) -// : await apiBrandAdd(data) -// popupRef.value?.close() -// emit('success') -// } //打开弹窗 const open = (type = 'add') => { @@ -172,5 +142,6 @@ const handleClose = () => { defineExpose({ open, setFormData, + getDetail }) diff --git a/src/views/retail/cashierclass/index.vue b/src/views/retail/cashierclass/index.vue index 1c846fd..6153935 100644 --- a/src/views/retail/cashierclass/index.vue +++ b/src/views/retail/cashierclass/index.vue @@ -172,12 +172,12 @@ const handleEdit = async (data: any) => { } // 详情 -const handleDetail = async (data) => { - let res = await apiCashierclassDetail({ id: data.id }) +const handleDetail = async (data: any) => { + // let res = await apiCashierclassDetail({ id: data.id }) showDetail.value = true await nextTick() detailRef.value?.open('edit') - detailRef.value?.setFormData(res) + detailRef.value?.getDetail(data) } // 删除