feat(物料管理): 添加物料表导出功能并更新相关接口路径

- 新增物料表导出API接口
- 更新导入模板和导入数据的接口路径
- 替换用户导出功能为物料表导出功能
This commit is contained in:
Tom
2026-01-06 17:27:14 +08:00
parent 29cd517f0a
commit b6ceca11c9
2 changed files with 17 additions and 4 deletions

View File

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

View File

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