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 4112afe2..1c37dc7d 100644 --- a/src/views/crm/contact/ContactForm.vue +++ b/src/views/crm/contact/ContactForm.vue @@ -225,7 +225,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 @@