diff --git a/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue b/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue index 2fa43c6a2..2f42c17d9 100644 --- a/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue +++ b/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue @@ -64,7 +64,18 @@ :detailButtonIsShowEdit="false" :detailButtonIsShowDelete="false" :buttondataTable="buttondataTable" - :otherHeadButttonData = "[]" + :otherHeadButttonData = "[ + { + label: t('ts.导出明细'), + name: 'export-detail', + hide: false, + type: 'primary', + // icon: 'ep:operation', + color: '', + float: 'left', + hasPermi: '' + } + ]" @buttonBaseClick="detailButtonBaseClick" @tableFormButton="tableFormButton" @@ -260,7 +271,7 @@ const buttonBaseClick = (val, item) => { } } - + const clicKRowId = ref() // 点击详情列表列按钮回调事件 const tableFormButton = async (val , row) => { if (val == 'close') { // 点击关闭 @@ -281,6 +292,7 @@ const buttonBaseClick = (val, item) => { value: row.number }] detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerStatementMain') + clicKRowId.value = row.id; } @@ -369,8 +381,30 @@ const importSuccess = () => { if (val == 'export') { // 子表导出明细 handleExportDetail(detailTableObject) + } else if (val === 'export-detail') { + console.log('导出明细:', clicKRowId.value) + handleDetailExport(clicKRowId.value) + } + } + /** 导出明细按钮操作 */ +const exportLoadingDetail = ref(false) // 导出的加载中 +const handleDetailExport = async (masterId) => { + try { + // 导出的二次确认 + await message.exportConfirm() + // 发起导出导出明细 + exportLoadingDetail.value = true + let params = { + masterId: masterId } + const excelTitle = ref(route.meta.title) + const data = await SuppliperMoldCostDetailApi.exportSupplierMoldCostDetail(params) + download.excel(data, `【${excelTitle.value}明细】【${formatDate(new Date())}】.xlsx`) + } catch { + } finally { + exportLoadingDetail.value = false } +} /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 // 子表导出明细