diff --git a/src/api/crm/business/index.ts b/src/api/crm/business/index.ts index 41ec35d8..810ec6e9 100644 --- a/src/api/crm/business/index.ts +++ b/src/api/crm/business/index.ts @@ -1,10 +1,3 @@ -/* - * @Author: zyna - * @Date: 2023-12-02 13:08:56 - * @LastEditTime: 2023-12-17 16:28:20 - * @FilePath: \yudao-ui-admin-vue3\src\api\crm\business\index.ts - * @Description: - */ import request from '@/config/axios' export interface BusinessVO { @@ -43,6 +36,11 @@ export const getBusiness = async (id: number) => { return await request.get({ url: `/crm/business/get?id=` + id }) } +// 获得 CRM 商机列表(精简) +export const getSimpleBusinessList = async () => { + return await request.get({ url: `/crm/business/simple-all-list` }) +} + // 新增 CRM 商机 export const createBusiness = async (data: BusinessVO) => { return await request.post({ url: `/crm/business/create`, data }) @@ -63,7 +61,12 @@ export const exportBusiness = async (params) => { return await request.download({ url: `/crm/business/export-excel`, params }) } -//联系人关联商机列表 +// 联系人关联商机列表 export const getBusinessPageByContact = async (params) => { return await request.get({ url: `/crm/business/page-by-contact`, params }) } + +// 获得 CRM 商机列表 +export const getBusinessListByIds = async (val: number[]) => { + return await request.get({ url: '/crm/business/list-by-ids', params: { ids: val.join(',') } }) +} diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 44eebe80..4144c931 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -71,6 +71,11 @@ export const getSimpleContactList = async () => { return await request.get({ url: `/crm/contact/simple-all-list` }) } +// 获得 CRM 联系人列表 +export const getContactListByIds = async (val: number[]) => { + return await request.get({ url: '/crm/contact/list-by-ids', params: { ids: val.join(',') } }) +} + // 批量新增联系人商机关联 export const createContactBusinessList = async (data: ContactBusinessReqVO) => { return await request.post({ url: `/crm/contact/create-business-list`, data }) @@ -84,4 +89,4 @@ export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => { // 查询联系人操作日志 export const getOperateLogPage = async (params: any) => { return await request.get({ url: '/crm/contact/operate-log-page', params }) -} \ No newline at end of file +} diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index 5ec8a3ea..4542c86a 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -64,8 +64,8 @@ export const exportCustomer = async (params: any) => { } // 客户列表 -export const queryAllList = async () => { - return await request.get({ url: `/crm/customer/query-all-list` }) +export const getSimpleCustomerList = async () => { + return await request.get({ url: `/crm/customer/list-all-simple` }) } // 查询客户操作日志 @@ -75,18 +75,28 @@ export const getOperateLogPage = async (id: number) => { // ======================= 业务操作 ======================= +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 } }) } -// TODO @puhui999:方法名,改成和后端一致哈 // 领取公海客户 -export const receive = async (ids: any[]) => { +export const receiveCustomer = async (ids: any[]) => { return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } }) } // 客户放入公海 -export const putPool = async (id: number) => { +export const putCustomerPool = async (id: number) => { return await request.put({ url: `/crm/customer/put-pool?id=${id}` }) } diff --git a/src/api/crm/followup/index.ts b/src/api/crm/followup/index.ts new file mode 100644 index 00000000..f6b66105 --- /dev/null +++ b/src/api/crm/followup/index.ts @@ -0,0 +1,46 @@ +import request from '@/config/axios' + +// 跟进记录 VO +export interface FollowUpRecordVO { + id: number // 编号 + bizType: number // 数据类型 + bizId: number // 数据编号 + type: number // 跟进类型 + content: string // 跟进内容 + nextTime: Date // 下次联系时间 + businessIds: number[] // 关联的商机编号数组 + contactIds: number[] // 关联的联系人编号数组 +} + +// 跟进记录 API +export const FollowUpRecordApi = { + // 查询跟进记录分页 + getFollowUpRecordPage: async (params: any) => { + return await request.get({ url: `/crm/follow-up-record/page`, params }) + }, + + // 查询跟进记录详情 + getFollowUpRecord: async (id: number) => { + return await request.get({ url: `/crm/follow-up-record/get?id=` + id }) + }, + + // 新增跟进记录 + createFollowUpRecord: async (data: FollowUpRecordVO) => { + return await request.post({ url: `/crm/follow-up-record/create`, data }) + }, + + // 修改跟进记录 + updateFollowUpRecord: async (data: FollowUpRecordVO) => { + return await request.put({ url: `/crm/follow-up-record/update`, data }) + }, + + // 删除跟进记录 + deleteFollowUpRecord: async (id: number) => { + return await request.delete({ url: `/crm/follow-up-record/delete?id=` + id }) + }, + + // 导出跟进记录 Excel + exportFollowUpRecord: async (params) => { + return await request.download({ url: `/crm/follow-up-record/export-excel`, params }) + } +} diff --git a/src/api/crm/message/index.ts b/src/api/crm/message/index.ts index fcd5fbd7..098729eb 100644 --- a/src/api/crm/message/index.ts +++ b/src/api/crm/message/index.ts @@ -34,6 +34,7 @@ export interface CustomerVO { } // 查询客户列表 +// TODO @芋艿:看看是不是后续融合到 getCustomerPage 里; export const getTodayCustomerPage = async (params) => { return await request.get({ url: `/crm/message/todayCustomer`, params }) } diff --git a/src/components/OperateLogV2/src/OperateLogV2.vue b/src/components/OperateLogV2/src/OperateLogV2.vue index ae8aad40..b766fb44 100644 --- a/src/components/OperateLogV2/src/OperateLogV2.vue +++ b/src/components/OperateLogV2/src/OperateLogV2.vue @@ -1,6 +1,6 @@ +