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 @@ - + 创建联系人 - + @@ -136,6 +136,7 @@ const openDetail = (id: number) => { push({ name: 'CrmContactDetail', params: { id } }) } +/** 监听打开的 bizId + bizType,从而加载最新的列表 */ watch( () => [props.bizId, props.bizType], () => { diff --git a/src/views/crm/contact/detail/index.vue b/src/views/crm/contact/detail/index.vue index ae8ec5dc..6a6e71bf 100644 --- a/src/views/crm/contact/detail/index.vue +++ b/src/views/crm/contact/detail/index.vue @@ -90,10 +90,10 @@ import ContactBasicInfo from '@/views/crm/contact/detail/ContactBasicInfo.vue' import ContactDetails from '@/views/crm/contact/detail/ContactDetails.vue' import ContactForm from '@/views/crm/contact/ContactForm.vue' import { formatDate } from '@/utils/formatTime' -import * as CustomerApi from '@/api/crm/customer' // TODO 芋艿:后面在 review 么? -defineOptions({ name: 'ContactDetail' }) +defineOptions({ name: 'CrmContactDetail' }) + const { delView } = useTagsViewStore() // 视图操作 const route = useRoute() const { currentRoute } = useRouter() // 路由 diff --git a/src/views/crm/contact/index.vue b/src/views/crm/contact/index.vue index ccfbcadd..70ba4b8c 100644 --- a/src/views/crm/contact/index.vue +++ b/src/views/crm/contact/index.vue @@ -1,54 +1,98 @@ - + - + v-model="queryParams.customerId" + placeholder="请选择客户" + value-key="id" + lable-key="name" + @keyup.enter="handleQuery" + clearable + > + - + + v-model="queryParams.mobile" + placeholder="请输入手机号" + clearable + @keyup.enter="handleQuery" + class="!w-240px" + /> + v-model="queryParams.telephone" + placeholder="请输入电话" + clearable + @keyup.enter="handleQuery" + class="!w-240px" + /> - + + v-model="queryParams.wechat" + placeholder="请输入微信" + clearable + @keyup.enter="handleQuery" + class="!w-240px" + /> + v-model="queryParams.email" + placeholder="请输入电子邮箱" + clearable + @keyup.enter="handleQuery" + class="!w-240px" + /> - - 搜索 - - - 重置 - + 搜索 + 重置 新增 + type="success" + plain + @click="handleExport" + :loading="exportLoading" + v-hasPermi="['crm:contact:export']" + > 导出 @@ -60,9 +104,9 @@ type="success" plain @click="handleExport" :loading="exportLoading" - {{ - scope.row.name - }} + + {{ scope.row.name }} + @@ -84,17 +128,41 @@ type="success" plain @click="handleExport" :loading="exportLoading" - + - + {{ scope.row.ownerUserName }} - - + + - + 编辑 - + 删除 @@ -119,8 +197,11 @@ type="success" plain @click="handleExport" :loading="exportLoading" + :total="total" + v-model:page="queryParams.pageNo" + v-model:limit="queryParams.pageSize" + @pagination="getList" + /> @@ -208,7 +289,7 @@ const handleDelete = async (id: number) => { message.success(t('common.delSuccess')) // 刷新列表 await getList() - } catch { } + } catch {} } /** 导出按钮操作 */ @@ -232,7 +313,6 @@ const openDetail = (id: number) => { push({ name: 'CrmContactDetail', params: { id } }) } - /** 初始化 **/ onMounted(async () => { await getList() diff --git a/src/views/crm/customer/detail/CustomerBasicInfo.vue b/src/views/crm/customer/detail/CustomerBasicInfo.vue deleted file mode 100644 index 2542b006..00000000 --- a/src/views/crm/customer/detail/CustomerBasicInfo.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - - {{ customer.name }} - - - - - - - - diff --git a/src/views/crm/customer/detail/CustomerDetailsHeader.vue b/src/views/crm/customer/detail/CustomerDetailsHeader.vue index bb9f8d03..09200a09 100644 --- a/src/views/crm/customer/detail/CustomerDetailsHeader.vue +++ b/src/views/crm/customer/detail/CustomerDetailsHeader.vue @@ -3,7 +3,11 @@ - + + + {{ customer.name }} + + @@ -15,29 +19,13 @@ + 创建任务 + 发送邮件 + 创建商机 + 创建合同 + 创建回款 - - 创建任务 - - - - 发送邮件 - - - - 创建商机 - - - - 创建合同 - - - - 创建回款 - - - - 添加团队成员 + 添加团队成员 @@ -49,15 +37,11 @@ {{ customer.dealStatus ? '已成交' : '未成交' }} - - {{ customer.ownerUserName }} - + {{ customer.ownerUserName }} - - {{ customer.mobile }} - + {{ customer.mobile }} @@ -65,15 +49,13 @@ diff --git a/src/views/crm/customer/detail/index.vue b/src/views/crm/customer/detail/index.vue index 13d33972..4a115a7f 100644 --- a/src/views/crm/customer/detail/index.vue +++ b/src/views/crm/customer/detail/index.vue @@ -1,16 +1,16 @@ - + - + TODO 待开发 - + 商机 TODO 待开发 @@ -20,31 +20,24 @@ - diff --git a/src/views/crm/customer/index.vue b/src/views/crm/customer/index.vue index 210691b9..edad31b1 100644 --- a/src/views/crm/customer/index.vue +++ b/src/views/crm/customer/index.vue @@ -72,17 +72,10 @@ - - - 搜索 - - - - 重置 - + 搜索 + 重置 - - 新增 + 新增 - - 导出 + 导出 @@ -102,7 +94,13 @@ - + + + + {{ scope.row.name }} + + + @@ -157,7 +155,6 @@ - 详情 - + {{ dict.label }} + 确 定 @@ -39,8 +40,8 @@