81 lines
2.2 KiB
TypeScript
Raw Normal View History

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
}
2023-12-17 17:34:32 +08:00
export interface ContactBusinessLinkVO {
id: number
contactId: number
businessId: number
}
// 查询 CRM 联系人列表
2023-11-11 23:35:18 +08:00
export const getContactPage = async (params) => {
return await request.get({ url: `/crm/contact/page`, params })
}
// 查询 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 })
}
// 新增 CRM 联系人
2023-11-11 23:35:18 +08:00
export const createContact = async (data: ContactVO) => {
return await request.post({ url: `/crm/contact/create`, data })
}
// 修改 CRM 联系人
2023-11-11 23:35:18 +08:00
export const updateContact = async (data: ContactVO) => {
return await request.put({ url: `/crm/contact/update`, data })
}
// 删除 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 })
}
// 导出 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
//批量新增联系人商机关联
export const createContactBusinessLinkBatch = async (data: ContactBusinessLinkVO[]) => {
return await request.post({ url: `/crm/contact/create-batch-business`, data })
}
//解除联系人商机关联
export const deleteContactBusinessLink = async (data: ContactBusinessLinkVO) => {
return await request.delete({ url: `/crm/contact/delete-batch-business`, data })
}