基础信息展示以及搜索逻辑进行修复

This commit is contained in:
dxc
2026-02-11 13:12:05 +08:00
parent d0a237625c
commit 5532c87684
9 changed files with 285 additions and 395 deletions

View File

@ -35,29 +35,29 @@ export function deleteBuyInbound(id: number) {
})
}
// 5. 搜索基础物料
export function searchMaterialBase(keyword: string) {
// 5. 搜索基础物料 (修改:支持分页参数)
export function searchMaterialBase(keyword: string, page: number = 1) {
return request({
url: '/inbound/buy/search-base',
method: 'get',
params: { keyword }
params: { keyword, page }
})
}
// 6. 文件上传 (用于图片/拍照)
export function uploadFile(data: FormData) {
return request({
url: '/common/upload', // 对应后端 /api/v1/common/upload
url: '/common/upload',
method: 'post',
data,
headers: { 'Content-Type': 'multipart/form-data' }
})
}
// 7. [新增] 文件删除
// 7. 文件删除
export function deleteFile(filename: string) {
return request({
url: `/common/files/${filename}`, // 对应后端 /api/v1/common/files/<filename>
url: `/common/files/${filename}`,
method: 'delete'
})
}
@ -89,7 +89,7 @@ export function getLinkSuggestions(params: any) {
})
}
// 11. [新增] 库位建议
// 11. 库位建议
export function getLocationSuggestions(params: any) {
return request({
url: '/inbound/buy/suggestions/locations',

View File

@ -9,6 +9,16 @@ export function listMaterialBase(params: any) {
})
}
// ==========================================
// 1.1 获取基础信息筛选选项 (所有类别/类型) [新增]
// ==========================================
export function getMaterialBaseOptions() {
return request({
url: '/inbound/base/options',
method: 'get'
})
}
// 2. 新增基础信息
export function addMaterialBase(data: any) {
return request({
@ -19,7 +29,6 @@ export function addMaterialBase(data: any) {
}
// 3. 修改基础信息 (包含状态启用/禁用)
// 【修复点】: 必须在 URL 中拼接 data.id否则后端会报 405 Method Not Allowed
export function updateMaterialBase(data: any) {
return request({
url: `/inbound/base/${data.id}`,