Files
KCGL/inventory-web/src/api/inbound/buy.ts
yueli 424df231d5 feat(bom): 前端 BOM API——候选版本、独立启停、物料搜索支持公司
- bom.ts 新增 getChildBomVersions(候选版本) 与 updateBomStatus(独立启停)
- inbound/buy.ts searchMaterialBase 增加可选 company 参数(跨域按公司过滤)
2026-09-08 10:14:47 +08:00

109 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '@/utils/request'
// 1. 获取列表
export function getBuyList(params: any) {
return request({
url: '/inbound/buy/list',
method: 'get',
params
})
}
// 2. 新增入库
export function createBuyInbound(data: any) {
return request({
url: '/inbound/buy/submit',
method: 'post',
data
})
}
// 3. 更新入库
export function updateBuyInbound(id: number, data: any) {
return request({
url: `/inbound/buy/${id}`,
method: 'put',
data
})
}
// 4. 删除入库
export function deleteBuyInbound(id: number) {
return request({
url: `/inbound/buy/${id}`,
method: 'delete'
})
}
// 5. [新增] 获取筛选下拉选项(类别、类型)
export function getFilterOptions() {
return request({
url: '/inbound/buy/options',
method: 'get'
})
}
// 6. 搜索基础物料(company 可选:跨域下按公司过滤;不传则由后端按当前用户公司隔离)
export function searchMaterialBase(keyword: string, page: number = 1, company?: string) {
const params: any = { keyword, page }
if (company) params.company_name = company
return request({
url: '/inbound/buy/search-base',
method: 'get',
params
})
}
// 7. 文件上传
export function uploadFile(data: FormData) {
return request({
url: '/common/upload',
method: 'post',
data,
headers: { 'Content-Type': 'multipart/form-data' }
})
}
// 8. 文件删除
export function deleteFile(filename: string) {
return request({
url: `/common/files/${filename}`,
method: 'delete'
})
}
// 9. 供应商建议
export function getSupplierSuggestions(params: any) {
return request({
url: '/inbound/buy/suggestions/suppliers',
method: 'get',
params
})
}
// 10. 用户建议
export function getUserSuggestions(params: any) {
return request({
url: '/inbound/buy/suggestions/users',
method: 'get',
params
})
}
// 11. 链接建议
export function getLinkSuggestions(params: any) {
return request({
url: '/inbound/buy/suggestions/links',
method: 'get',
params
})
}
// 12. 库位建议
export function getLocationSuggestions(params: any) {
return request({
url: '/inbound/buy/suggestions/locations',
method: 'get',
params
})
}