From ef6d72fe330550850628239dd6b2dbecb112c20d Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 4 Mar 2025 11:14:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=85=B7=E8=B4=B9=E7=94=A8=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=85=B3=E9=97=AD=E9=87=8D=E6=96=B0=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail/src/Detail.vue | 49 ++++++++++++++----- .../supplierMoldCostMain/index.vue | 8 ++- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 35cc4c04b..e890a7eec 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -68,7 +68,7 @@ > @@ -95,7 +95,7 @@ @@ -111,7 +111,7 @@ > @@ -544,6 +544,7 @@ const filterPermissionAnnexTable = ()=>{ const isShowDrawer = ref(false) const detailLoading = ref(false) const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) +const buttondataTable = ref(props.buttondataTable) if (props.isBasic == true) { if (tabsList.value && tabsList.value.length > 0) { @@ -772,7 +773,7 @@ const masterParmas = ref({ const HeadButttondata = ref() const HeadButttondataBackups = ref([])// 列表头部按钮备份 // 列表-操作按钮 -const buttondata = ref() +// const buttondata = ref() /** 表格弹窗 */ const initModel = (schema: FormSchema[], formModel: Recordable) => { @@ -875,13 +876,28 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: } HeadButttondata.value = [...HeadButttondata.value,...props.otherHeadButttonData] HeadButttondataBackups.value = [...HeadButttondata.value,...props.otherHeadButttonData] - let detailButtonEdit: any = [] + + // if (props.buttondataTable.length > 0) { + // // console.log(4445,props.buttondataTable) + // buttondataTable.value.forEach(item => { + // item.hide= isShowMainButton(row,item.showStatus) + // }) + // } + // buttondata.value = [...detailButtonEdit,...detailButtonDelete,...buttondataTable.value] + + } finally { + detailLoading.value = false + } + } +} +const buttondata = (row) => { + let detailButtonEdit: any = [] let detailButtonDelete: any = [] if (props.detailButtonIsShowEdit) { // 编辑 detailButtonEdit = [ defaultButtons.mainListEditBtn({ - hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray), + hide: isShowMainButton(detailData.value,props.detailButtonIsShowAddStatusArray), hasPermi: props.editHasPermi }) ] @@ -890,17 +906,26 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 删除 detailButtonDelete = [ defaultButtons.mainListDeleteBtn({ - hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray), + hide: isShowMainButton(detailData.value,props.detailButtonIsShowAddStatusArray), hasPermi: props.deleteHasPermi }) ] } - buttondata.value = [...detailButtonEdit,...detailButtonDelete,...props.buttondataTable] - - } finally { - detailLoading.value = false - } + if (props.buttondataTable.length > 0) { + buttondataTable.value.forEach(item => { + if (item.field) { + item.hide = row[item.field] == '1' ? false : true + } + else { + item.hide = isShowMainButton(row,item.showStatus) + } + }) } + return [ + ...detailButtonEdit, + ...detailButtonDelete, + ...buttondataTable.value + ] } const updateList =async ()=>{ diff --git a/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue b/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue index 1ee730a9f..b2068e9df 100644 --- a/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue +++ b/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue @@ -136,6 +136,8 @@ const buttondataTable =[{ label: '关闭', name: 'close', hide: false, + showStatus: ['0'], + field: 'isClose', type: 'danger', icon: '', color: '', @@ -146,6 +148,8 @@ const buttondataTable =[{ name: 'reOpen', hide: false, type: 'primary', + showStatus: ['2'], + field: 'isOpen', icon: '', color: '', hasPermi: '', @@ -254,10 +258,10 @@ const buttonBaseClick = (val, item) => { const tableFormButton = async (val , row) => { if (val == 'close') { // 点击关闭 await SuppliperMoldCostMainApi.close(row.id) - detailRef.value.getList(); + detailRef.value.updateList(); }else if(val=='reOpen'){ await SuppliperMoldCostMainApi.reOpen(row.id) - detailRef.value.getList(); + detailRef.value.updateList(); } }