diff --git a/src/api/basicdata/TripartiteMaterial.js b/src/api/basicdata/TripartiteMaterial.js index 1613b33c..5c7a8eec 100644 --- a/src/api/basicdata/TripartiteMaterial.js +++ b/src/api/basicdata/TripartiteMaterial.js @@ -61,6 +61,18 @@ export const getDownTemplate = () => { }); }; +/** + * 导出 + */ +export const getExportList = data => { + return request({ + url: '/api/logpm-basicdata/factoryCategory/exportList', + method: 'post', + data, + responseType: 'blob', + }); +}; + /** * 获取详情列表 */ diff --git a/src/views/basicdata/TripartiteMaterial/list.vue b/src/views/basicdata/TripartiteMaterial/list.vue index 26bd0e16..ee4a6db9 100644 --- a/src/views/basicdata/TripartiteMaterial/list.vue +++ b/src/views/basicdata/TripartiteMaterial/list.vue @@ -33,7 +33,7 @@ " >导 入 - + 导出
@@ -252,6 +252,7 @@ import { postLazyTree, postBrandLists, getDownTemplate, + getExportList, } from '@/api/basicdata/TripartiteMaterial'; import { useStore } from 'vuex'; @@ -644,6 +645,29 @@ const handleDownloadTemplate = async () => { } }; +/** 导出 */ +const handleExport = async () => { + try { + details.loadingObj.pageLoading = true; + + const submitData = { ...details.query }; + + const res = await getExportList(submitData); + + const { status, data } = res; + + if (status !== 200) return; + + downloadXls(data, '三方物料 - ' + new Date().getTime() + '.xlsx'); + + console.log('res :>> ', res); + } catch (error) { + console.log('error :>> ', error); + } finally { + details.loadingObj.pageLoading = false; + } +}; + /** 导出表格数据 */ const handleExportData = () => { exportExcel(details.columnList, details.data, '三方物料 - ' + new Date().getTime());