From b6ceca11c97c9ace65cd36b612bdaf2028d813ad Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 6 Jan 2026 17:27:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=89=A9=E6=96=99=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=A9=E6=96=99=E8=A1=A8=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=B9=B6=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增物料表导出API接口 - 更新导入模板和导入数据的接口路径 - 替换用户导出功能为物料表导出功能 --- .../productionMaterial/mmmaterial.js | 13 +++++++++++++ .../productionMaterial/MmMaterial.vue | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/api/materialManagement/productionMaterial/mmmaterial.js b/src/api/materialManagement/productionMaterial/mmmaterial.js index c96a960..39c9e93 100644 --- a/src/api/materialManagement/productionMaterial/mmmaterial.js +++ b/src/api/materialManagement/productionMaterial/mmmaterial.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { downFile } from '@/utils/request' /** * 物料表分页查询 @@ -66,3 +67,15 @@ export function getMmMaterialCategoryOptions(query) { data: query }) } + +/** + * 导出物料表 + */ +export async function exportMmMaterial(query) { + // return request({ + // url: '/system/User/export', + // method: 'get', + // params: query + // }) + await downFile('/mes/productionMaterial/MmMaterial/export', { ...query }) +} diff --git a/src/views/materialManagement/productionMaterial/MmMaterial.vue b/src/views/materialManagement/productionMaterial/MmMaterial.vue index 60fea5f..bcd2837 100644 --- a/src/views/materialManagement/productionMaterial/MmMaterial.vue +++ b/src/views/materialManagement/productionMaterial/MmMaterial.vue @@ -244,7 +244,7 @@ import { getMmMaterial, getMmMaterialCategoryOptions } from '@/api/materialManagement/productionMaterial/mmmaterial.js' -import { exportUser } from '@/api/system/user' +import { exportMmMaterial } from '@/api/materialManagement/productionMaterial/mmmaterial.js' import { getToken } from '@/utils/auth' const { proxy } = getCurrentInstance() const ids = ref([]) @@ -295,7 +295,7 @@ const upload = reactive({ // 设置上传的请求头部 headers: { Authorization: 'Bearer ' + getToken() }, // 上传的地址 - url: import.meta.env.VITE_APP_BASE_API + '/system/user/importData' + url: import.meta.env.VITE_APP_BASE_API + '/mes/productionMaterial/MmMaterial/importData' }) var dictParams = [] @@ -518,7 +518,7 @@ function handleImport() { /** 下载模板操作 */ function importTemplate() { - proxy.download('/system/user/importTemplate', '物料表数据导入模板') + proxy.download('/mes/productionMaterial/MmMaterial/importTemplate', '物料表数据导入模板') } /**文件上传中处理 */ const handleFileUploadProgress = (event, file, fileList) => { @@ -549,7 +549,7 @@ function handleExport() { type: 'warning' }) .then(async () => { - await exportUser(queryParams.value) + await exportMmMaterial(queryParams.value) }) }