Files
KCGL/inventory-web/src/api/material_base.ts

45 lines
1.0 KiB
TypeScript
Raw Normal View History

import request from '@/utils/request'
// 1. 获取基础信息列表
export function listMaterialBase(params: any) {
return request({
url: '/inbound/base/list',
method: 'get',
params
})
}
// 2. 新增基础信息
export function addMaterialBase(data: any) {
return request({
url: '/inbound/base/',
method: 'post',
data
})
}
// 3. 修改基础信息 (包含状态启用/禁用)
// 【修复点】: 必须在 URL 中拼接 data.id,否则后端会报 405 Method Not Allowed
export function updateMaterialBase(data: any) {
return request({
url: `/inbound/base/${data.id}`,
method: 'put',
data
})
}
// 4. 删除基础信息
export function delMaterialBase(id: number) {
return request({
url: `/inbound/base/${id}`,
method: 'delete'
})
}
// 5. 获取详情 (可选,用于编辑回显)
export function getMaterialBase(id: number) {
return request({
url: `/inbound/base/${id}`,
method: 'get'
})
}