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) }) }