diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 3ec30b186..79bba88d8 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -56,11 +56,12 @@ @success="getList" :rules="detailAllSchemasRules" :formAllSchemas="detailAllSchemas" - :isBusiness="false" + :isBusiness="true" :apiUpdate="apiUpdate" :apiCreate="apiCreate" @searchTableSuccess="searchTableSuccess" :detailData="detailData" + @submitForm="submitForm" /> @@ -257,7 +258,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 动态显示操作列按钮 buttondata.value = [ defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), // 编辑 - defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), // 删除 + // defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), // 删除 ] } finally { detailLoading.value = false @@ -337,6 +338,24 @@ const formRef = ref() const openForm = async (type: string, row?: number) => { formRef.value.open(type, row, masterParmas.value) } +// form 提交 +const submitForm = async (formType, data) => { + try { + if (formType === 'create') { + await props.apiCreate(data) + message.success(t('common.createSuccess')) + } else { + await props.apiUpdate(data) + message.success(t('common.updateSuccess')) + } + formRef.value.dialogVisible = false + // 刷新当前列表 + getList() + } finally { + formRef.value.formLoading = false + } +} + // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { emit('searchTableSuccessDetail', formField, searchField, val, formRef)