2023-11-11 23:35:18 +08:00
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
export interface ContactVO {
|
|
|
|
name: string
|
|
|
|
nextTime: Date
|
|
|
|
mobile: string
|
|
|
|
telephone: string
|
|
|
|
email: string
|
|
|
|
post: string
|
|
|
|
customerId: number
|
|
|
|
address: string
|
|
|
|
remark: string
|
|
|
|
ownerUserId: string
|
|
|
|
lastTime: Date
|
|
|
|
id: number
|
|
|
|
parentId: number
|
|
|
|
qq: number
|
2023-11-26 21:54:50 +08:00
|
|
|
wechat: string
|
2023-11-11 23:35:18 +08:00
|
|
|
sex: number
|
2023-11-26 21:54:50 +08:00
|
|
|
master: boolean
|
2023-11-11 23:35:18 +08:00
|
|
|
creatorName: string
|
|
|
|
updateTime?: Date
|
|
|
|
createTime?: Date
|
2023-11-27 20:33:53 +08:00
|
|
|
customerName: string
|
|
|
|
areaName: string
|
2023-11-26 21:54:50 +08:00
|
|
|
ownerUserName: string
|
2023-11-11 23:35:18 +08:00
|
|
|
}
|
2024-01-02 18:48:47 +08:00
|
|
|
|
|
|
|
export interface ContactBusinessReqVO {
|
2023-12-17 17:34:32 +08:00
|
|
|
contactId: number
|
2024-01-02 18:48:47 +08:00
|
|
|
businessIds: number[]
|
2023-12-17 17:34:32 +08:00
|
|
|
}
|
2024-01-02 18:48:47 +08:00
|
|
|
|
2023-11-29 21:42:10 +08:00
|
|
|
// 查询 CRM 联系人列表
|
2023-11-11 23:35:18 +08:00
|
|
|
export const getContactPage = async (params) => {
|
|
|
|
return await request.get({ url: `/crm/contact/page`, params })
|
|
|
|
}
|
|
|
|
|
2023-11-29 21:42:10 +08:00
|
|
|
// 查询 CRM 联系人列表,基于指定客户
|
|
|
|
export const getContactPageByCustomer = async (params: any) => {
|
|
|
|
return await request.get({ url: `/crm/contact/page-by-customer`, params })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询 CRM 联系人详情
|
2023-11-11 23:35:18 +08:00
|
|
|
export const getContact = async (id: number) => {
|
|
|
|
return await request.get({ url: `/crm/contact/get?id=` + id })
|
|
|
|
}
|
|
|
|
|
2023-11-29 21:42:10 +08:00
|
|
|
// 新增 CRM 联系人
|
2023-11-11 23:35:18 +08:00
|
|
|
export const createContact = async (data: ContactVO) => {
|
|
|
|
return await request.post({ url: `/crm/contact/create`, data })
|
|
|
|
}
|
|
|
|
|
2023-11-29 21:42:10 +08:00
|
|
|
// 修改 CRM 联系人
|
2023-11-11 23:35:18 +08:00
|
|
|
export const updateContact = async (data: ContactVO) => {
|
|
|
|
return await request.put({ url: `/crm/contact/update`, data })
|
|
|
|
}
|
|
|
|
|
2023-11-29 21:42:10 +08:00
|
|
|
// 删除 CRM 联系人
|
2023-11-11 23:35:18 +08:00
|
|
|
export const deleteContact = async (id: number) => {
|
|
|
|
return await request.delete({ url: `/crm/contact/delete?id=` + id })
|
|
|
|
}
|
|
|
|
|
2023-11-29 21:42:10 +08:00
|
|
|
// 导出 CRM 联系人 Excel
|
2023-11-11 23:35:18 +08:00
|
|
|
export const exportContact = async (params) => {
|
|
|
|
return await request.download({ url: `/crm/contact/export-excel`, params })
|
|
|
|
}
|
2023-11-27 20:33:53 +08:00
|
|
|
|
2023-11-30 13:42:49 +08:00
|
|
|
// 获得 CRM 联系人列表(精简)
|
|
|
|
export const getSimpleContactList = async () => {
|
2023-11-26 21:54:50 +08:00
|
|
|
return await request.get({ url: `/crm/contact/simple-all-list` })
|
2023-11-11 23:35:18 +08:00
|
|
|
}
|
2023-12-17 17:34:32 +08:00
|
|
|
|
2024-01-02 18:48:47 +08:00
|
|
|
// 批量新增联系人商机关联
|
|
|
|
export const createContactBusinessList = async (data: ContactBusinessReqVO) => {
|
|
|
|
return await request.post({ url: `/crm/contact/create-business-list`, data })
|
2023-12-17 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
2024-01-02 18:48:47 +08:00
|
|
|
// 解除联系人商机关联
|
|
|
|
export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => {
|
|
|
|
return await request.delete({ url: `/crm/contact/delete-business-list`, data })
|
|
|
|
}
|