2026-01-29 09:27:56 +08:00
|
|
|
import request from '@/utils/request'
|
|
|
|
|
|
|
|
|
|
// 注意 URL 已变为 /inbound/product/...
|
|
|
|
|
|
|
|
|
|
export function getProductList(params: any) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/inbound/product/list',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function createProductInbound(data: any) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/inbound/product/submit',
|
|
|
|
|
method: 'post',
|
|
|
|
|
data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function updateProductInbound(id: number, data: any) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/inbound/product/${id}`,
|
|
|
|
|
method: 'put',
|
|
|
|
|
data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function deleteProductInbound(id: number) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/inbound/product/${id}`,
|
|
|
|
|
method: 'delete'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-28 17:08:35 +08:00
|
|
|
// 搜索基础物料 (已增加 page 参数)
|
|
|
|
|
export function searchMaterialBase(keyword: string, page: number = 1) {
|
2026-01-29 09:27:56 +08:00
|
|
|
return request({
|
2026-02-05 15:04:06 +08:00
|
|
|
url: '/inbound/product/search-base',
|
2026-01-29 09:27:56 +08:00
|
|
|
method: 'get',
|
2026-02-28 17:08:35 +08:00
|
|
|
params: { keyword, page }
|
2026-01-29 09:27:56 +08:00
|
|
|
})
|
2026-02-10 14:38:15 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-02 13:39:52 +08:00
|
|
|
// 搜索BOM
|
2026-06-04 16:01:48 +08:00
|
|
|
export function searchBom(keyword: string, parent_spec?: string) {
|
2026-02-12 17:16:24 +08:00
|
|
|
return request({
|
|
|
|
|
url: '/inbound/product/search-bom',
|
|
|
|
|
method: 'get',
|
2026-06-04 16:01:48 +08:00
|
|
|
params: { keyword, parent_spec }
|
2026-02-12 17:16:24 +08:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-10 14:38:15 +08:00
|
|
|
// 用户建议
|
|
|
|
|
export function getUserSuggestions(params: any) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/inbound/product/suggestions/users',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params
|
|
|
|
|
})
|
|
|
|
|
}
|
2026-02-11 14:42:16 +08:00
|
|
|
|
|
|
|
|
// 筛选选项
|
|
|
|
|
export function getFilterOptions() {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/inbound/product/options',
|
|
|
|
|
method: 'get'
|
|
|
|
|
})
|
2026-02-28 17:08:35 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-02 13:39:52 +08:00
|
|
|
// [新增] 负责人历史记录全局查询
|
2026-02-28 17:08:35 +08:00
|
|
|
export function getManagerHistory(params: any) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/inbound/product/suggestions/managers',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params
|
|
|
|
|
})
|
2026-03-02 13:39:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// [新增] BOM 成本自动计算
|
|
|
|
|
export function calculateBomCost(params: {bom_code: string, bom_version: string}) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/inbound/product/calculate-bom-cost',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params
|
|
|
|
|
})
|
2026-02-12 17:16:24 +08:00
|
|
|
}
|