From c73b3f741441f184730f341b7c8cee13eef411d9 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Fri, 21 Jun 2024 16:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=A4=96=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail/src/Detail.vue | 41 +++++++++---- .../unplannedreceiptRequestMain/index.vue | 59 +++++++++++++++++-- 2 files changed, 85 insertions(+), 15 deletions(-) diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 3fa0c33b6..45ab2b064 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -696,7 +696,6 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: const updateList = ()=>{ getList() } -defineExpose({ openDetail, formRef ,updateList}) // 提供 open 方法,用于打开弹窗 // 获取备注列表 const getRemarkList = async () => { @@ -859,21 +858,39 @@ const submitForm = async (formType, data) => { const rs = (await props.detailValidate) ? await props.detailValidate(data) : true if (!rs) return if (formType === 'create') { - await props.apiCreate(data) - message.success(t('common.createSuccess')) + if(props.apiCreate){ + await props.apiCreate(data) + message.success(t('common.createSuccess')) + }else{ + emit('handleSubmitForm',formType, data) + } } else { - await props.apiUpdate(data) - message.success(t('common.updateSuccess')) + if(props.apiUpdate){ + await props.apiUpdate(data) + message.success(t('common.updateSuccess')) + }else{ + emit('handleSubmitForm',formType, data) + } + + } + if (formType === 'create'&&props.apiCreate||formType === 'update'&&props.apiUpdate) { + emit('handleMainFefresh') + formRef.value.dialogVisible = false + // 刷新当前列表 + await getList() + updateKey.value += 1 } - emit('handleMainFefresh') - formRef.value.dialogVisible = false - // 刷新当前列表 - await getList() - updateKey.value += 1 } finally { formRef.value.formLoading = false } } +//明细--新增,编辑,页面单独处理--用此方法刷新 +const submitUpdateList = async ()=>{ + formRef.value.dialogVisible = false + // 刷新当前列表 + await getList() + updateKey.value += 1 +} const searchTableSuccess1 = (formField, searchField, val, formRef) => { @@ -904,6 +921,8 @@ const emit = defineEmits([ 'detailBasicFormOnChange', 'formFormDateChange', 'buttonBaseClick', + 'handleMainFefresh', + 'handleSubmitForm' ]) /** 删除按钮操作 */ const handleDelete = async (id: number) => { @@ -997,6 +1016,8 @@ watch( getList() } ) +defineExpose({ openDetail, formRef ,updateList,submitUpdateList}) // 提供 open 方法,用于打开弹窗 +