From ef5c80a0c09802082b5dc23ba81b5a455bee405a Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Sun, 18 Aug 2024 14:55:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=BA=E9=99=B7=EF=BC=9AHL-5048=EF=BC=8CHL-5?= =?UTF-8?q?049.=E8=A1=A5=E5=85=85=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=A3=85?= =?UTF-8?q?=E9=85=8D=E5=AE=8C=E5=B7=A5=E6=94=B6=E8=B4=A7=E7=9A=84=E5=8E=9F?= =?UTF-8?q?=E6=96=99=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesRawMaterialConsumptionInfo/index.ts | 15 +++++++++++ .../wms/rawMaterialConsumptionInfo/index.ts | 11 ++++++++ .../mesRawMaterialConsumptionInfo/index.vue | 20 ++++++++++++-- .../rawMaterialConsumptionInfo/index.vue | 26 +++++++++++++++---- 4 files changed, 65 insertions(+), 7 deletions(-) diff --git a/src/api/wms/mesRawMaterialConsumptionInfo/index.ts b/src/api/wms/mesRawMaterialConsumptionInfo/index.ts index fbfaf7290..dac92362b 100644 --- a/src/api/wms/mesRawMaterialConsumptionInfo/index.ts +++ b/src/api/wms/mesRawMaterialConsumptionInfo/index.ts @@ -44,3 +44,18 @@ export const getMesRawMaterialConsumptionInfoPage = async (params) => { } + +export const exportAssemblyMaterialUsageMes = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/productreceipt-detailb/getAssemblyMaterialUsageMesSeniorExport`, data }) + }else{ + return await request.download({ url: `/wms/productreceipt-detailb/assemblyMaterialUsageMesExport`, params }) + } +} + + + + + + diff --git a/src/api/wms/rawMaterialConsumptionInfo/index.ts b/src/api/wms/rawMaterialConsumptionInfo/index.ts index 38b62d2a9..477158e1f 100644 --- a/src/api/wms/rawMaterialConsumptionInfo/index.ts +++ b/src/api/wms/rawMaterialConsumptionInfo/index.ts @@ -44,3 +44,14 @@ export const getRawMaterialConsumptionInfoPage = async (params) => { } +export const exportAssemblyMaterialUsage = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/backflush-record-detailb/getAssemblyMaterialUsageSeniorExport`, data }) + }else{ + return await request.download({ url: `/wms/backflush-record-detailb/assemblyMaterialUsageExport`, params }) + } +} + + + diff --git a/src/views/wms/productionManage/productreceiptAssemble/mesRawMaterialConsumptionInfo/index.vue b/src/views/wms/productionManage/productreceiptAssemble/mesRawMaterialConsumptionInfo/index.vue index c0f82ff6a..d3116835b 100644 --- a/src/views/wms/productionManage/productreceiptAssemble/mesRawMaterialConsumptionInfo/index.vue +++ b/src/views/wms/productionManage/productreceiptAssemble/mesRawMaterialConsumptionInfo/index.vue @@ -56,6 +56,8 @@ const routeName = ref() routeName.value = route.name const tableColumns = ref([...MesRawMaterialConsumptionInfo.allSchemas.tableColumns]) +/** 列表导出按钮操作 */ +const exportLoading = ref(false) // 导出的加载中 const mesModelVisible = ref(false) const { tableObject: tableObject, tableMethods: tableMethods } =useTable({ getListApi: MesRawMaterialConsumptionInfoApi.getMesRawMaterialConsumptionInfoPage @@ -70,7 +72,7 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - // defaultButtons.defaultExportBtn({hasPermi:'wms:productreceipt-record-main:export'}), // 导出 + defaultButtons.defaultExportBtn(null), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -79,7 +81,7 @@ const HeadButttondata = [ // 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'export') { // 导出 - // handleExport() + handleExport() } else if (val == 'refresh') { // 刷新 if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { searchFormClick({ @@ -95,6 +97,20 @@ const buttonBaseClick = (val, item) => { } +const handleExport = async () => { + try { + // 导出的二次确认 + await message.exportConfirm() + // 发起导出 + exportLoading.value = true + const data = await MesRawMaterialConsumptionInfoApi.exportAssemblyMaterialUsageMes(tableObject.params) + download.excel(data, '装配完工原料信息.xlsx') + } catch { + } finally { + exportLoading.value = false + } +} + // 筛选提交 const searchFormClick = (searchData) => { tableObject.params = { diff --git a/src/views/wms/productionManage/productreceiptAssemble/rawMaterialConsumptionInfo/index.vue b/src/views/wms/productionManage/productreceiptAssemble/rawMaterialConsumptionInfo/index.vue index ede928449..c938e8da9 100644 --- a/src/views/wms/productionManage/productreceiptAssemble/rawMaterialConsumptionInfo/index.vue +++ b/src/views/wms/productionManage/productreceiptAssemble/rawMaterialConsumptionInfo/index.vue @@ -50,12 +50,14 @@ defineOptions({ name: 'RawMaterialConsumptionInfo' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 - + + const route = useRoute() // 路由信息 const routeName = ref() routeName.value = route.name const tableColumns = ref([...RawMaterialConsumptionInfo.allSchemas.tableColumns]) - +/** 列表导出按钮操作 */ +const exportLoading = ref(false) // 导出的加载中 const mesModelVisible = ref(false) const { tableObject: tableObject, tableMethods: tableMethods } =useTable({ getListApi: RawMaterialConsumptionInfoApi.getRawMaterialConsumptionInfoPage @@ -70,7 +72,7 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - // defaultButtons.defaultExportBtn({hasPermi:'wms:productreceipt-record-main:export'}), // 导出 + defaultButtons.defaultExportBtn(null), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -80,7 +82,7 @@ const HeadButttondata = [ // 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'export') { // 导出 - // handleExport() + handleExport() } else if (val == 'refresh') { // 刷新 if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { searchFormClick({ @@ -89,7 +91,7 @@ const buttonBaseClick = (val, item) => { } else { getList() } - } else if (val == 'filtrate') { // 筛选 + }else if (val == 'filtrate') { // 筛选 } else { // 其他按钮 console.log('其他按钮', item) } @@ -104,6 +106,20 @@ const searchFormClick = (searchData) => { getList() // 刷新当前列表 } +const handleExport = async () => { + try { + // 导出的二次确认 + await message.exportConfirm() + // 发起导出 + exportLoading.value = true + const data = await RawMaterialConsumptionInfoApi.exportAssemblyMaterialUsage(tableObject.params) + download.excel(data, '装配完工原料信息.xlsx') + } catch { + } finally { + exportLoading.value = false + } +} + /** 初始化 **/ onMounted(async () => { getList()