55 lines
1010 B
JavaScript
55 lines
1010 B
JavaScript
import request from '@/utils/request'
|
|
|
|
export function getCustomerList(params) {
|
|
return request({
|
|
url: '/backend/erp/customer/list',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function getCustomerDetail(id) {
|
|
return request({
|
|
url: `/backend/erp/customer/${id}`,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
export function createCustomer(data) {
|
|
return request({
|
|
url: '/backend/erp/customer',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function updateCustomer(id, data) {
|
|
return request({
|
|
url: `/backend/erp/customer/${id}`,
|
|
method: 'put',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function deleteCustomer(id) {
|
|
return request({
|
|
url: `/backend/erp/customer/${id}`,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
export function toggleCustomerStatus(id, status) {
|
|
return request({
|
|
url: `/backend/erp/customer/${id}/status`,
|
|
method: 'post',
|
|
data: { status }
|
|
})
|
|
}
|
|
|
|
export function convertCustomerToSupplier(id) {
|
|
return request({
|
|
url: `/backend/erp/customer/${id}/convert-supplier`,
|
|
method: 'post'
|
|
})
|
|
}
|