ipms-sjy-ui/src/api/crm/customer/index.ts

108 lines
2.9 KiB
TypeScript
Raw Normal View History

2023-10-25 00:24:20 +08:00
import request from '@/config/axios'
export interface CustomerVO {
2023-11-04 03:21:01 +08:00
id?: number
2023-10-25 00:24:20 +08:00
name: string
2023-10-29 00:03:11 +08:00
industryId: number
level: number
source: number
2023-11-04 03:21:01 +08:00
followUpStatus?: boolean
lockStatus?: boolean
dealStatus?: boolean
2023-10-25 00:24:20 +08:00
mobile: string
telephone: string
website: string
2023-10-28 19:50:42 +08:00
qq: string
wechat: string
email: string
description: string
2023-10-25 00:24:20 +08:00
remark: string
2023-11-04 03:21:01 +08:00
ownerUserId?: number
ownerUserName?: string
ownerUserDept?: string
roUserIds?: string
rwUserIds?: string
areaId?: number
areaName?: string
2023-10-25 00:24:20 +08:00
detailAddress: string
2023-11-04 03:21:01 +08:00
contactLastTime?: Date
2023-10-25 00:24:20 +08:00
contactNextTime: Date
2023-11-04 03:21:01 +08:00
createTime?: Date
updateTime?: Date
creator?: string
creatorName?: string
2023-10-25 00:24:20 +08:00
}
// 查询客户列表
export const getCustomerPage = async (params) => {
return await request.get({ url: `/crm/customer/page`, params })
}
// 查询客户详情
export const getCustomer = async (id: number) => {
return await request.get({ url: `/crm/customer/get?id=` + id })
}
// 新增客户
export const createCustomer = async (data: CustomerVO) => {
return await request.post({ url: `/crm/customer/create`, data })
}
// 修改客户
export const updateCustomer = async (data: CustomerVO) => {
return await request.put({ url: `/crm/customer/update`, data })
}
// 删除客户
export const deleteCustomer = async (id: number) => {
return await request.delete({ url: `/crm/customer/delete?id=` + id })
}
// 导出客户 Excel
export const exportCustomer = async (params: any) => {
2023-10-25 00:24:20 +08:00
return await request.download({ url: `/crm/customer/export-excel`, params })
}
2023-11-27 20:33:53 +08:00
2024-01-27 15:02:25 +08:00
// 下载客户导入模板
export const importCustomerTemplate = () => {
return request.download({ url: '/crm/customer/get-import-template' })
}
2023-11-27 20:33:53 +08:00
// 客户列表
export const getSimpleCustomerList = async () => {
return await request.get({ url: `/crm/customer/list-all-simple` })
2023-11-27 20:33:53 +08:00
}
// ======================= 业务操作 =======================
2024-01-06 12:29:35 +08:00
export interface TransferReqVO {
id: number | undefined // 客户编号
newOwnerUserId: number | undefined // 新负责人的用户编号
oldOwnerPermissionLevel: number | undefined // 老负责人加入团队后的权限级别
}
// 客户转移
export const transfer = async (data: TransferReqVO) => {
return await request.put({ url: '/crm/customer/transfer', data })
}
// 锁定/解锁客户
export const lockCustomer = async (id: number, lockStatus: boolean) => {
return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } })
}
2024-01-06 12:29:35 +08:00
// 领取公海客户
export const receiveCustomer = async (ids: any[]) => {
2024-01-06 12:29:35 +08:00
return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } })
}
// 客户放入公海
export const putCustomerPool = async (id: number) => {
2024-01-06 12:29:35 +08:00
return await request.put({ url: `/crm/customer/put-pool?id=${id}` })
}
// 进入公海客户提醒
export const getPutInPoolRemindCustomerPage = async (params) => {
return await request.get({ url: `/crm/customer/put-in-pool-remind-page`, params })
}