60 lines
1.2 KiB
JavaScript
60 lines
1.2 KiB
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'
|
|
})
|
|
}
|