diff --git a/.env.base b/.env.base index fdb26d85..cf433822 100644 --- a/.env.base +++ b/.env.base @@ -4,10 +4,10 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://127.0.0.1:48080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://127.0.0.1:48080/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH=/dev-api diff --git a/src/api/crm/business/index.ts b/src/api/crm/business/index.ts new file mode 100644 index 00000000..8af2a697 --- /dev/null +++ b/src/api/crm/business/index.ts @@ -0,0 +1,57 @@ +import request from '@/config/axios' + +export interface BusinessVO { + id: number + name: string + statusTypeId: number + statusId: number + contactNextTime: Date + customerId: number + dealTime: Date + price: number + discountPercent: number + productPrice: number + remark: string + ownerUserId: number + roUserIds: string + rwUserIds: string + endStatus: number + endRemark: string + contactLastTime: Date + followUpStatus: number +} + +// 查询 CRM 商机列表 +export const getBusinessPage = async (params) => { + return await request.get({ url: `/crm/business/page`, params }) +} + +// 查询 CRM 商机列表,基于指定客户 +export const getBusinessPageByCustomer = async (params) => { + return await request.get({ url: `/crm/business/page-by-customer`, params }) +} + +// 查询 CRM 商机详情 +export const getBusiness = async (id: number) => { + return await request.get({ url: `/crm/business/get?id=` + id }) +} + +// 新增 CRM 商机 +export const createBusiness = async (data: BusinessVO) => { + return await request.post({ url: `/crm/business/create`, data }) +} + +// 修改 CRM 商机 +export const updateBusiness = async (data: BusinessVO) => { + return await request.put({ url: `/crm/business/update`, data }) +} + +// 删除 CRM 商机 +export const deleteBusiness = async (id: number) => { + return await request.delete({ url: `/crm/business/delete?id=` + id }) +} + +// 导出 CRM 商机 Excel +export const exportBusiness = async (params) => { + return await request.download({ url: `/crm/business/export-excel`, params }) +} diff --git a/src/api/crm/businessStatusType/index.ts b/src/api/crm/businessStatusType/index.ts new file mode 100644 index 00000000..cc4b46aa --- /dev/null +++ b/src/api/crm/businessStatusType/index.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +export interface BusinessStatusTypeVO { + id: number + name: string + deptIds: number[] + status: boolean +} + +// 查询商机状态类型列表 +export const getBusinessStatusTypePage = async (params) => { + return await request.get({ url: `/crm/business-status-type/page`, params }) +} + +// 查询商机状态类型详情 +export const getBusinessStatusType = async (id: number) => { + return await request.get({ url: `/crm/business-status-type/get?id=` + id }) +} + +// 新增商机状态类型 +export const createBusinessStatusType = async (data: BusinessStatusTypeVO) => { + return await request.post({ url: `/crm/business-status-type/create`, data }) +} + +// 修改商机状态类型 +export const updateBusinessStatusType = async (data: BusinessStatusTypeVO) => { + return await request.put({ url: `/crm/business-status-type/update`, data }) +} + +// 删除商机状态类型 +export const deleteBusinessStatusType = async (id: number) => { + return await request.delete({ url: `/crm/business-status-type/delete?id=` + id }) +} + +// 导出商机状态类型 Excel +export const exportBusinessStatusType = async (params) => { + return await request.download({ url: `/crm/business-status-type/export-excel`, params }) +} + +// 获取商机状态类型信息列表 +export const getBusinessStatusTypeList = async () => { + return await request.get({ url: `/crm/business-status-type/get-simple-list` }) +} + +// 根据类型ID获取商机状态信息列表 +export const getBusinessStatusListByTypeId = async (typeId: number) => { + return await request.get({ url: `/crm/business-status-type/get-status-list?typeId=` + typeId }) +} diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 6ac5a01d..f983cb12 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -1,10 +1,3 @@ -/* - * @Author: zyna - * @Date: 2023-11-05 13:34:41 - * @LastEditTime: 2023-11-11 16:20:19 - * @FilePath: \yudao-ui-admin-vue3\src\api\crm\contact\index.ts - * @Description: - */ import request from '@/config/axios' export interface ContactVO { @@ -22,44 +15,53 @@ export interface ContactVO { id: number parentId: number qq: number - webchat: string + wechat: string sex: number - policyMakers: boolean + master: boolean creatorName: string updateTime?: Date createTime?: Date customerName: string + areaName: string + ownerUserName: string } -// 查询crm联系人列表 +// 查询 CRM 联系人列表 export const getContactPage = async (params) => { return await request.get({ url: `/crm/contact/page`, params }) } -// 查询crm联系人详情 +// 查询 CRM 联系人列表,基于指定客户 +export const getContactPageByCustomer = async (params: any) => { + return await request.get({ url: `/crm/contact/page-by-customer`, params }) +} + +// 查询 CRM 联系人详情 export const getContact = async (id: number) => { return await request.get({ url: `/crm/contact/get?id=` + id }) } -// 新增crm联系人 +// 新增 CRM 联系人 export const createContact = async (data: ContactVO) => { return await request.post({ url: `/crm/contact/create`, data }) } -// 修改crm联系人 +// 修改 CRM 联系人 export const updateContact = async (data: ContactVO) => { return await request.put({ url: `/crm/contact/update`, data }) } -// 删除crm联系人 +// 删除 CRM 联系人 export const deleteContact = async (id: number) => { return await request.delete({ url: `/crm/contact/delete?id=` + id }) } -// 导出crm联系人 Excel +// 导出 CRM 联系人 Excel export const exportContact = async (params) => { return await request.download({ url: `/crm/contact/export-excel`, params }) } -export const simpleAlllist = async () => { - return await request.get({ url: `/crm/contact/simpleAlllist` }) + +// 获得 CRM 联系人列表(精简) +export const getSimpleContactList = async () => { + return await request.get({ url: `/crm/contact/simple-all-list` }) } diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index bf438323..3498e843 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -22,32 +22,37 @@ export interface ContractVO { remark: string } -// 查询合同列表 +// 查询 CRM 合同列表 export const getContractPage = async (params) => { return await request.get({ url: `/crm/contract/page`, params }) } -// 查询合同详情 +// 查询 CRM 联系人列表,基于指定客户 +export const getContractPageByCustomer = async (params: any) => { + return await request.get({ url: `/crm/contract/page-by-customer`, params }) +} + +// 查询 CRM 合同详情 export const getContract = async (id: number) => { return await request.get({ url: `/crm/contract/get?id=` + id }) } -// 新增合同 +// 新增 CRM 合同 export const createContract = async (data: ContractVO) => { return await request.post({ url: `/crm/contract/create`, data }) } -// 修改合同 +// 修改 CRM 合同 export const updateContract = async (data: ContractVO) => { return await request.put({ url: `/crm/contract/update`, data }) } -// 删除合同 +// 删除 CRM 合同 export const deleteContract = async (id: number) => { return await request.delete({ url: `/crm/contract/delete?id=` + id }) } -// 导出合同 Excel +// 导出 CRM 合同 Excel export const exportContract = async (params) => { return await request.download({ url: `/crm/contract/export-excel`, params }) } diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index 59260cbc..5ef43950 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -62,3 +62,8 @@ export const deleteCustomer = async (id: number) => { export const exportCustomer = async (params) => { return await request.download({ url: `/crm/customer/export-excel`, params }) } + +// 客户列表 +export const queryAllList = async () => { + return await request.get({ url: `/crm/customer/query-all-list` }) +} diff --git a/src/api/crm/customerLimitConfig/index.ts b/src/api/crm/customerLimitConfig/index.ts index 22fde3ea..86776326 100644 --- a/src/api/crm/customerLimitConfig/index.ts +++ b/src/api/crm/customerLimitConfig/index.ts @@ -9,6 +9,20 @@ export interface CustomerLimitConfigVO { dealCountEnabled?: boolean } +/** + * 客户限制配置类型 + */ +export enum LimitConfType { + /** + * 拥有客户数限制 + */ + CUSTOMER_QUANTITY_LIMIT = 1, + /** + * 锁定客户数限制 + */ + CUSTOMER_LOCK_LIMIT = 2 +} + // 查询客户限制配置列表 export const getCustomerLimitConfigPage = async (params) => { return await request.get({ url: `/crm/customer-limit-config/page`, params }) diff --git a/src/api/crm/customerPoolConf/index.ts b/src/api/crm/customerPoolConfig/index.ts similarity index 67% rename from src/api/crm/customerPoolConf/index.ts rename to src/api/crm/customerPoolConfig/index.ts index 8234ba36..3cd8ef28 100644 --- a/src/api/crm/customerPoolConf/index.ts +++ b/src/api/crm/customerPoolConfig/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import { ConfigVO } from '@/api/infra/config' export interface CustomerPoolConfigVO { enabled?: boolean @@ -14,6 +15,6 @@ export const getCustomerPoolConfig = async () => { } // 更新客户公海规则设置 -export const updateCustomerPoolConfig = async (data: ConfigVO) => { - return await request.put({ url: `/crm/customer-pool-config/update`, data }) +export const saveCustomerPoolConfig = async (data: ConfigVO) => { + return await request.put({ url: `/crm/customer-pool-config/save`, data }) } diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts index 1292f29a..c221b089 100644 --- a/src/api/crm/permission/index.ts +++ b/src/api/crm/permission/index.ts @@ -6,42 +6,66 @@ export interface PermissionVO { bizType: number | undefined // Crm 类型 bizId: number | undefined // Crm 类型数据编号 level: number | undefined // 权限级别 - deptName?: string // 部门名称 // 岗位名称数组 TODO @puhui999:数组? + deptName?: string // 部门名称 nickname?: string // 用户昵称 - postNames?: string // 岗位名称数组 TODO @puhui999:数组? + postNames?: string[] // 岗位名称数组 createTime?: Date } -// 查询团队成员列表 +/** + * CRM 业务类型枚举 + * + * @author HUIHUI + */ +export enum BizTypeEnum { + CRM_LEADS = 1, // 线索 + CRM_CUSTOMER = 2, // 客户 + CRM_CONTACT = 3, // 联系人 + CRM_BUSINESS = 5, // 商机 + 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/add`, data }) + 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/api/mall/product/favorite.ts b/src/api/mall/product/favorite.ts new file mode 100644 index 00000000..3834eed0 --- /dev/null +++ b/src/api/mall/product/favorite.ts @@ -0,0 +1,12 @@ +import request from '@/config/axios' + +export interface Favorite { + id?: number + userId?: string // 用户编号 + spuId?: number | null // 商品 SPU 编号 +} + +// 获得 ProductFavorite 列表 +export const getFavoritePage = (params: PageParam) => { + return request.get({ url: '/product/favorite/page', params }) +} diff --git a/src/api/mp/user/index.ts b/src/api/mp/user/index.ts index d954e9eb..b89acc7d 100644 --- a/src/api/mp/user/index.ts +++ b/src/api/mp/user/index.ts @@ -26,6 +26,6 @@ export const getUserPage = (query) => { // 同步公众号粉丝 export const syncUser = (accountId) => { return request.post({ - url: '/mp/tag/sync?accountId=' + accountId + url: '/mp/user/sync?accountId=' + accountId }) } diff --git a/src/api/system/notice/index.ts b/src/api/system/notice/index.ts index 62bf5259..f6434697 100644 --- a/src/api/system/notice/index.ts +++ b/src/api/system/notice/index.ts @@ -35,3 +35,8 @@ export const updateNotice = (data: NoticeVO) => { export const deleteNotice = (id: number) => { return request.delete({ url: '/system/notice/delete?id=' + id }) } + +// 推送公告 +export const pushNotice = (id: number) => { + return request.post({ url: '/system/notice/push?id=' + id }) +} diff --git a/src/api/system/sms/smsLog/index.ts b/src/api/system/sms/smsLog/index.ts index 3d54fac1..f9891716 100644 --- a/src/api/system/sms/smsLog/index.ts +++ b/src/api/system/sms/smsLog/index.ts @@ -15,8 +15,6 @@ export interface SmsLogVO { userType: number | null sendStatus: number | null sendTime: Date | null - sendCode: number | null - sendMsg: string apiSendCode: string apiSendMsg: string apiRequestId: string diff --git a/src/components/RouterSearch/index.vue b/src/components/RouterSearch/index.vue index c12385af..2499dafe 100644 --- a/src/components/RouterSearch/index.vue +++ b/src/components/RouterSearch/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/crm/business/components/BusinessList.vue b/src/views/crm/business/components/BusinessList.vue new file mode 100644 index 00000000..31411e84 --- /dev/null +++ b/src/views/crm/business/components/BusinessList.vue @@ -0,0 +1,107 @@ + + diff --git a/src/views/crm/business/index.vue b/src/views/crm/business/index.vue new file mode 100644 index 00000000..c1c63fa1 --- /dev/null +++ b/src/views/crm/business/index.vue @@ -0,0 +1,207 @@ + + + diff --git a/src/views/crm/businessStatusType/BusinessStatusTypeForm.vue b/src/views/crm/businessStatusType/BusinessStatusTypeForm.vue new file mode 100644 index 00000000..edf41966 --- /dev/null +++ b/src/views/crm/businessStatusType/BusinessStatusTypeForm.vue @@ -0,0 +1,167 @@ + + diff --git a/src/views/crm/businessStatusType/index.vue b/src/views/crm/businessStatusType/index.vue new file mode 100644 index 00000000..7b2725f3 --- /dev/null +++ b/src/views/crm/businessStatusType/index.vue @@ -0,0 +1,171 @@ + + + diff --git a/src/views/crm/clue/ClueForm.vue b/src/views/crm/clue/ClueForm.vue index 4321f952..1b2637c9 100644 --- a/src/views/crm/clue/ClueForm.vue +++ b/src/views/crm/clue/ClueForm.vue @@ -10,9 +10,16 @@ - + - + + + diff --git a/src/views/crm/components/index.ts b/src/views/crm/components/index.ts deleted file mode 100644 index c25feef3..00000000 --- a/src/views/crm/components/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -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/customerLimitConfig/CustomerLimitConfigForm.vue b/src/views/crm/config/customerLimitConfig/CustomerLimitConfigForm.vue similarity index 98% rename from src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue rename to src/views/crm/config/customerLimitConfig/CustomerLimitConfigForm.vue index 880106f0..e7dee69f 100644 --- a/src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue +++ b/src/views/crm/config/customerLimitConfig/CustomerLimitConfigForm.vue @@ -57,11 +57,11 @@ diff --git a/src/views/crm/customerPoolConf/index.vue b/src/views/crm/config/customerPoolConfig/index.vue similarity index 70% rename from src/views/crm/customerPoolConf/index.vue rename to src/views/crm/config/customerPoolConfig/index.vue index 5fa98711..c7db3301 100644 --- a/src/views/crm/customerPoolConf/index.vue +++ b/src/views/crm/config/customerPoolConfig/index.vue @@ -23,7 +23,7 @@ - + 不启用 启用 @@ -36,7 +36,11 @@ 天未成交 - + 不提醒 提醒 @@ -52,11 +56,10 @@ diff --git a/src/views/crm/contact/components/ContactList.vue b/src/views/crm/contact/components/ContactList.vue new file mode 100644 index 00000000..8aa40960 --- /dev/null +++ b/src/views/crm/contact/components/ContactList.vue @@ -0,0 +1,111 @@ + + diff --git a/src/views/crm/contact/detail/ContactDetails.vue b/src/views/crm/contact/detail/ContactDetails.vue index 9cf586b2..6b31a30c 100644 --- a/src/views/crm/contact/detail/ContactDetails.vue +++ b/src/views/crm/contact/detail/ContactDetails.vue @@ -8,7 +8,7 @@ {{ contact.name }} - + {{ contact.customerName }} @@ -24,14 +24,17 @@ {{ contact.qq }} - {{ contact.webchat }} - - - {{ contact.address }} + {{ contact.wechat }} {{ contact.nextTime ? formatDate(contact.nextTime) : '空' }} + + {{ contact.areaName }} + + + {{ contact.address }} + @@ -46,7 +49,7 @@ - {{ gotOwnerUser(contact.ownerUserId) }} + {{ contact.ownerUserName }} {{ contact.creatorName }} @@ -66,29 +69,9 @@ import * as ContactApi from '@/api/crm/contact' import { DICT_TYPE } from '@/utils/dict' import { formatDate } from '@/utils/formatTime' -import * as UserApi from '@/api/system/user' const { contact } = defineProps<{ contact: ContactApi.ContactVO }>() // 展示的折叠面板 const activeNames = ref(['basicInfo', 'systemInfo']) -const gotOwnerUser = (owerUserId: string) => { - let ownerName = '' - if (owerUserId !== null && owerUserId != undefined) { - owerUserId.split(',').forEach((item: string, index: number) => { - if (index != 0) { - ownerName = - ownerName + ',' + userList.value.find((user: { id: any }) => user.id == item)?.nickname - } else { - ownerName = userList.value.find((user: { id: any }) => user.id == item)?.nickname || '' - } - }) - } - return ownerName -} -const userList = ref([]) // 用户列表 -/** 初始化 **/ -onMounted(async () => { - userList.value = await UserApi.getSimpleUserList() -}) diff --git a/src/views/crm/contact/detail/index.vue b/src/views/crm/contact/detail/index.vue index 03bbb4e6..6a6e71bf 100644 --- a/src/views/crm/contact/detail/index.vue +++ b/src/views/crm/contact/detail/index.vue @@ -46,7 +46,7 @@ - + {{ contact.customerName }} @@ -63,33 +63,18 @@ - + - 活动 - 邮件 - 工商信息 - - - - 客户 - - - - 团队成员 - + 跟进记录 商机 - - - 合同 + 附件 + + + + 操作记录 - - - 回款 - - 回访 - 发票 @@ -105,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 d81b0449..70ba4b8c 100644 --- a/src/views/crm/contact/index.vue +++ b/src/views/crm/contact/index.vue @@ -1,7 +1,6 @@ - - {{ customer.ownerUserName }} - - - {{ customer.creatorName }} - + {{ customer.ownerUserName }} + {{ customer.creatorName }} {{ customer.createTime ? formatDate(customer.createTime) : '空' }} @@ -87,9 +65,10 @@ import * as CustomerApi from '@/api/crm/customer' import { DICT_TYPE } from '@/utils/dict' import { formatDate } from '@/utils/formatTime' -const { customer } = defineProps<{ customer: CustomerApi.CustomerVO }>() +const { customer } = defineProps<{ + customer: CustomerApi.CustomerVO // 客户明细 +}>() -// 展示的折叠面板 -const activeNames = ref(['basicInfo', 'systemInfo']) +const activeNames = ref(['basicInfo', 'systemInfo']) // 展示的折叠面板 diff --git a/src/views/crm/customer/detail/index.vue b/src/views/crm/customer/detail/index.vue index 392a5d35..6de6f170 100644 --- a/src/views/crm/customer/detail/index.vue +++ b/src/views/crm/customer/detail/index.vue @@ -1,129 +1,48 @@ - - diff --git a/src/views/crm/customer/index.vue b/src/views/crm/customer/index.vue index dea7e617..edad31b1 100644 --- a/src/views/crm/customer/index.vue +++ b/src/views/crm/customer/index.vue @@ -72,17 +72,10 @@ - - - 搜索 - - - - 重置 - + 搜索 + 重置 - - 新增 + 新增 - - 导出 + 导出 @@ -102,7 +94,13 @@ - + + +