70 lines
1.2 KiB
JavaScript
70 lines
1.2 KiB
JavaScript
import request from '@/utils/request'
|
|
|
|
export function getProductList(params) {
|
|
return request({
|
|
url: '/backend/erp/product/list',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function getProductDetail(id) {
|
|
return request({
|
|
url: `/backend/erp/product/${id}`,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
export function createProduct(data) {
|
|
return request({
|
|
url: '/backend/erp/product',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function updateProduct(id, data) {
|
|
return request({
|
|
url: `/backend/erp/product/${id}`,
|
|
method: 'put',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function deleteProduct(id) {
|
|
return request({
|
|
url: `/backend/erp/product/${id}`,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
export function toggleProductStatus(id, status) {
|
|
return request({
|
|
url: `/backend/erp/product/${id}/status`,
|
|
method: 'post',
|
|
data: { status }
|
|
})
|
|
}
|
|
|
|
export function getCategoryList() {
|
|
return request({
|
|
url: '/backend/erp/product/category/list',
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
export function saveCategory(data) {
|
|
return request({
|
|
url: '/backend/erp/product/category',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function deleteCategory(id) {
|
|
return request({
|
|
url: `/backend/erp/product/category/${id}`,
|
|
method: 'delete'
|
|
})
|
|
}
|