diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts new file mode 100644 index 00000000..e790c334 --- /dev/null +++ b/src/api/crm/permission/index.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +export interface PermissionVO { + id?: number // 数据权限编号 + userId: number | undefined // 用户编号 + bizType: number | undefined // Crm 类型 + bizId: number | undefined // Crm 类型数据编号 + level: number | undefined // 权限级别 + deptName?: string // 部门名称 + nickname?: string // 用户昵称 + postNames?: string // 岗位名称数组 + createTime?: Date +} + +// 查询团队成员列表 +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/add`, data }) +} + +// 修改团队成员权限级别 +export const updatePermission = async (data) => { + return await request.put({ url: `/crm/permission/update`, data }) +} + +// 删除团队成员 +export const deletePermission = async (params) => { + return await request.delete({ url: '/crm/permission/delete', params }) +} + +// 退出团队 +export const quitTeam = async (id) => { + return await request.delete({ url: '/crm/permission/quit-team?id=' + id }) +} + +// 领取公海数据 +export const receive = async (data: { bizType: number; bizId: number }) => { + return await request.put({ url: `/crm/permission/receive`, data }) +} + +// 数据放入公海 +export const putPool = async (data: { bizType: number; bizId: number }) => { + return await request.put({ url: `/crm/permission/put-pool`, data }) +} diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 1a4741b6..6413e945 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -217,6 +217,10 @@ const refreshToken = async () => { const handleAuthorized = () => { const { t } = useI18n() if (!isRelogin.show) { + // 如果已经到重新登录页面则不进行弹窗提示 + if (window.location.href.includes('login?redirect=')) { + return + } isRelogin.show = true ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), { showCancelButton: false, diff --git a/src/views/crm/components/CrmPermissionForm.vue b/src/views/crm/components/CrmPermissionForm.vue new file mode 100644 index 00000000..9754637b --- /dev/null +++ b/src/views/crm/components/CrmPermissionForm.vue @@ -0,0 +1,112 @@ + + diff --git a/src/views/crm/components/CrmTeamList.vue b/src/views/crm/components/CrmTeamList.vue new file mode 100644 index 00000000..f7591f6a --- /dev/null +++ b/src/views/crm/components/CrmTeamList.vue @@ -0,0 +1,147 @@ + + diff --git a/src/views/crm/components/index.ts b/src/views/crm/components/index.ts new file mode 100644 index 00000000..c25feef3 --- /dev/null +++ b/src/views/crm/components/index.ts @@ -0,0 +1,17 @@ +import CrmTeam from './CrmTeamList.vue' + +enum CrmBizTypeEnum { + CRM_LEADS = 1, // 线索 + CRM_CUSTOMER = 2, // 客户 + CRM_CONTACTS = 3, // 联系人 + CRM_BUSINESS = 5, // 商机 + CRM_CONTRACT = 6 // 合同 +} + +enum CrmPermissionLevelEnum { + OWNER = 1, // 负责人 + READ = 2, // 读 + WRITE = 3 // 写 +} + +export { CrmTeam, CrmBizTypeEnum, CrmPermissionLevelEnum } diff --git a/src/views/crm/customer/index.vue b/src/views/crm/customer/index.vue index 073bf8cb..b214d7c1 100644 --- a/src/views/crm/customer/index.vue +++ b/src/views/crm/customer/index.vue @@ -2,36 +2,36 @@ - 搜索 - 重置 - - 新增 + + + 搜索 + + + + 重置 + + + + 新增 - 导出 + + 导出 @@ -92,77 +100,77 @@ - - - - + + + + - + - + - - - - - + + + + + - + - + - + -