From 5f26c4afe9b4cc0617856d3d04598d896e324a34 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 30 Nov 2023 13:42:49 +0800 Subject: [PATCH] =?UTF-8?q?crm=EF=BC=9A=E5=AE=8C=E5=96=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9D=83=E9=99=90=E7=9A=84=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/contact/index.ts | 5 +- src/api/crm/permission/index.ts | 30 +++- src/utils/dict.ts | 4 +- src/views/crm/components/index.ts | 16 -- src/views/crm/contact/ContactForm.vue | 2 +- .../crm/contact/components/ContactList.vue | 5 +- src/views/crm/contact/detail/index.vue | 4 +- src/views/crm/contact/index.vue | 150 ++++++++++++++---- .../crm/customer/detail/CustomerBasicInfo.vue | 18 --- .../customer/detail/CustomerDetailsHeader.vue | 52 ++---- ...merDetails.vue => CustomerDetailsInfo.vue} | 53 ++----- src/views/crm/customer/detail/index.vue | 37 ++--- src/views/crm/customer/index.vue | 25 ++- .../components/PermissionForm.vue} | 9 +- .../components/PermissionList.vue} | 99 ++++++------ 15 files changed, 264 insertions(+), 245 deletions(-) delete mode 100644 src/views/crm/components/index.ts delete mode 100644 src/views/crm/customer/detail/CustomerBasicInfo.vue rename src/views/crm/customer/detail/{CustomerDetails.vue => CustomerDetailsInfo.vue} (60%) rename src/views/crm/{components/CrmPermissionForm.vue => permission/components/PermissionForm.vue} (93%) rename src/views/crm/{components/CrmPermissionList.vue => permission/components/PermissionList.vue} (60%) diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index cba935d1..f983cb12 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -61,8 +61,7 @@ export const exportContact = async (params) => { return await request.download({ url: `/crm/contact/export-excel`, params }) } -export const simpleAllList = async () => { +// 获得 CRM 联系人列表(精简) +export const getSimpleContactList = async () => { return await request.get({ url: `/crm/contact/simple-all-list` }) } - -// diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts index dadf47a8..a54fb025 100644 --- a/src/api/crm/permission/index.ts +++ b/src/api/crm/permission/index.ts @@ -12,6 +12,11 @@ export interface PermissionVO { createTime?: Date } +/** + * CRM 业务类型枚举 + * + * @author HUIHUI + */ export enum BizTypeEnum { CRM_LEADS = 1, // 线索 CRM_CUSTOMER = 2, // 客户 @@ -20,36 +25,47 @@ export enum BizTypeEnum { CRM_CONTRACT = 6 // 合同 } -// 查询团队成员列表 +/** + * CRM 数据权限级别枚举 + */ +export enum PermissionLevelEnum { + OWNER = 1, // 负责人 + READ = 2, // 只读 + WRITE = 3 // 读写 +} + +// 获得数据权限列表(查询团队成员列表) export const getPermissionList = async (params) => { return await request.get({ url: `/crm/permission/list`, params }) } -// 新增团队成员 +// 创建数据权限(新增团队成员) export const createPermission = async (data: PermissionVO) => { return await request.post({ url: `/crm/permission/create`, data }) } -// 修改团队成员权限级别 +// 编辑数据权限(修改团队成员权限级别) export const updatePermission = async (data) => { return await request.put({ url: `/crm/permission/update`, data }) } -// 删除团队成员 -export const deletePermission = async (params) => { +// 删除数据权限(删除团队成员) +export const deletePermissionBatch = async (params) => { return await request.delete({ url: '/crm/permission/delete', params }) } -// 退出团队 -export const quitTeam = async (id) => { +// 删除自己的数据权限(退出团队) +export const deleteSelfPermission = async (id) => { return await request.delete({ url: '/crm/permission/quit-team?id=' + id }) } +// TODO @puhui999:调整下位置 // 领取公海数据 export const receive = async (data: { bizType: number; bizId: number }) => { return await request.put({ url: `/crm/permission/receive`, data }) } +// TODO @puhui999:调整下位置 // 数据放入公海 export const putPool = async (data: { bizType: number; bizId: number }) => { return await request.put({ url: `/crm/permission/put-pool`, data }) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index ac4b52e3..22bb3f88 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -198,6 +198,6 @@ export enum DICT_TYPE { CRM_PRODUCT_STATUS = 'crm_product_status', // ========== CRM - 数据权限模块 ========== - CRM_BIZ_TYPE = 'crm_biz_type', // 数据模块类型 - CRM_PERMISSION_LEVEL = 'crm_permission_level' // 用户数据权限类型 + CRM_BIZ_TYPE = 'crm_biz_type', // CRM 业务类型 + CRM_PERMISSION_LEVEL = 'crm_permission_level' // CRM 数据权限的级别 } diff --git a/src/views/crm/components/index.ts b/src/views/crm/components/index.ts deleted file mode 100644 index d5c701d7..00000000 --- a/src/views/crm/components/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import CrmPermissionList from './CrmPermissionList.vue' - -// TODO @puhui999:迁移到 api/permission/index.ts 里;我已经迁移了一部分哈 -enum CrmBizTypeEnum { - CRM_LEADS = 1, // 线索 - CRM_CUSTOMER = 2, // 客户 - CRM_CONTACTS = 3, // 联系人 - CRM_BUSINESS = 5, // 商机 - CRM_CONTRACT = 6 // 合同 -} - -enum CrmPermissionLevelEnum { - OWNER = 1 // 负责人 -} - -export { CrmPermissionList, CrmBizTypeEnum, CrmPermissionLevelEnum } diff --git a/src/views/crm/contact/ContactForm.vue b/src/views/crm/contact/ContactForm.vue index a71c44ae..055cf5be 100644 --- a/src/views/crm/contact/ContactForm.vue +++ b/src/views/crm/contact/ContactForm.vue @@ -235,7 +235,7 @@ const open = async (type: string, id?: number) => { dialogTitle.value = t('action.' + type) formType.value = type resetForm() - allContactList.value = await ContactApi.simpleAllList() + allContactList.value = await ContactApi.getSimpleContactList() userList.value = await UserApi.getSimpleUserList() customerList.value = await CustomerApi.queryAllList() areaList.value = await AreaApi.getAreaTree() diff --git a/src/views/crm/contact/components/ContactList.vue b/src/views/crm/contact/components/ContactList.vue index c61cc3f3..f83b3bc0 100644 --- a/src/views/crm/contact/components/ContactList.vue +++ b/src/views/crm/contact/components/ContactList.vue @@ -1,14 +1,14 @@