From 0a4023ef004fb184c4bd333332fbac574af98d4e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 2 Jan 2024 18:48:47 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20CRM=EF=BC=9Acode=20review=20?= =?UTF-8?q?=E5=95=86=E6=9C=BA=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/contact/index.ts | 21 +-- src/views/crm/business/BusinessForm.vue | 8 +- .../crm/business/components/BusinessList.vue | 81 +++++++++- .../components/BusinessListByContact.vue | 141 ------------------ ...rContactLink.vue => BusinessListModal.vue} | 27 ++-- .../crm/contact/detail/ContactDetailsInfo.vue | 1 + src/views/crm/contact/detail/index.vue | 10 +- 7 files changed, 107 insertions(+), 182 deletions(-) delete mode 100644 src/views/crm/business/components/BusinessListByContact.vue rename src/views/crm/business/components/{BusinessForContactLink.vue => BusinessListModal.vue} (85%) diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index ac0bb112..43fb9745 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -25,11 +25,12 @@ export interface ContactVO { areaName: string ownerUserName: string } -export interface ContactBusinessLinkVO { - id: number + +export interface ContactBusinessReqVO { contactId: number - businessId: number + businessIds: number[] } + // 查询 CRM 联系人列表 export const getContactPage = async (params) => { return await request.get({ url: `/crm/contact/page`, params }) @@ -70,12 +71,12 @@ export const getSimpleContactList = async () => { return await request.get({ url: `/crm/contact/simple-all-list` }) } -//批量新增联系人商机关联 -export const createContactBusinessLinkBatch = async (data: ContactBusinessLinkVO[]) => { - return await request.post({ url: `/crm/contact/create-batch-business`, data }) +// 批量新增联系人商机关联 +export const createContactBusinessList = async (data: ContactBusinessReqVO) => { + return await request.post({ url: `/crm/contact/create-business-list`, data }) } -//解除联系人商机关联 -export const deleteContactBusinessLink = async (data: ContactBusinessLinkVO) => { - return await request.delete({ url: `/crm/contact/delete-batch-business`, data }) -} \ No newline at end of file +// 解除联系人商机关联 +export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => { + return await request.delete({ url: `/crm/contact/delete-business-list`, data }) +} diff --git a/src/views/crm/business/BusinessForm.vue b/src/views/crm/business/BusinessForm.vue index d2c10b35..31905972 100644 --- a/src/views/crm/business/BusinessForm.vue +++ b/src/views/crm/business/BusinessForm.vue @@ -62,12 +62,12 @@ + - + { queryParams.pageNo = 1 getCustomerList() } + /** 查询客户列表 */ const getCustomerList = async () => { loading.value = true try { const data = await CustomerApi.getCustomerPage(queryParams) - console.log(JSON.stringify(data)) customerList.value = data.list total.value = data.total } finally { diff --git a/src/views/crm/business/components/BusinessList.vue b/src/views/crm/business/components/BusinessList.vue index e51cad20..ca7d02c6 100644 --- a/src/views/crm/business/components/BusinessList.vue +++ b/src/views/crm/business/components/BusinessList.vue @@ -5,11 +5,32 @@ 创建商机 + + 关联 + + + 解除关联 + - + + diff --git a/src/views/crm/business/components/BusinessForContactLink.vue b/src/views/crm/business/components/BusinessListModal.vue similarity index 85% rename from src/views/crm/business/components/BusinessForContactLink.vue rename to src/views/crm/business/components/BusinessListModal.vue index dd66c55a..1abfdc7c 100644 --- a/src/views/crm/business/components/BusinessForContactLink.vue +++ b/src/views/crm/business/components/BusinessListModal.vue @@ -1,5 +1,5 @@