diff --git a/src/api/crm/bi/rank.ts b/src/api/crm/bi/rank.ts new file mode 100644 index 00000000..8c7f36e0 --- /dev/null +++ b/src/api/crm/bi/rank.ts @@ -0,0 +1,25 @@ +import request from '@/config/axios' + +export interface BiRankRespVO { + count: number + nickname: string + deptName: string +} + +// 排行 API +export const RankApi = { + // 获得合同排行榜 + getContractPriceRank: (params: any) => { + return request.get({ + url: '/crm/bi-rank/get-contract-price-rank', + params + }) + }, + // 获得回款排行榜 + getReceivablePriceRank: (params: any) => { + return request.get({ + url: '/crm/bi-rank/get-receivable-price-rank', + params + }) + } +} diff --git a/src/api/crm/business/index.ts b/src/api/crm/business/index.ts index 810ec6e9..37304f5a 100644 --- a/src/api/crm/business/index.ts +++ b/src/api/crm/business/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import { TransferReqVO } from '@/api/crm/customer' export interface BusinessVO { id: number @@ -70,3 +71,8 @@ export const getBusinessPageByContact = async (params) => { export const getBusinessListByIds = async (val: number[]) => { return await request.get({ url: '/crm/business/list-by-ids', params: { ids: val.join(',') } }) } + +// 商机转移 +export const transferBusiness = async (data: TransferReqVO) => { + return await request.put({ url: '/crm/business/transfer', data }) +} diff --git a/src/api/crm/clue/index.ts b/src/api/crm/clue/index.ts index 39da03d3..4268c420 100644 --- a/src/api/crm/clue/index.ts +++ b/src/api/crm/clue/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import { TransferReqVO } from '@/api/crm/customer' export interface ClueVO { id: number @@ -44,3 +45,8 @@ export const deleteClue = async (id: number) => { export const exportClue = async (params) => { return await request.download({ url: `/crm/clue/export-excel`, params }) } + +// 线索转移 +export const transferClue = async (data: TransferReqVO) => { + return await request.put({ url: '/crm/clue/transfer', data }) +} diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 4144c931..2dab70bc 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import { TransferReqVO } from '@/api/crm/customer' export interface ContactVO { name: string @@ -86,7 +87,7 @@ export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => { return await request.delete({ url: `/crm/contact/delete-business-list`, data }) } -// 查询联系人操作日志 -export const getOperateLogPage = async (params: any) => { - return await request.get({ url: '/crm/contact/operate-log-page', params }) +// 联系人转移 +export const transferContact = async (data: TransferReqVO) => { + return await request.put({ url: '/crm/contact/transfer', data }) } diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 3498e843..9d718c23 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -1,10 +1,13 @@ import request from '@/config/axios' +import { ProductExpandVO } from '@/api/crm/product' +import { TransferReqVO } from '@/api/crm/customer' export interface ContractVO { id: number name: string customerId: number businessId: number + businessName: string processInstanceId: number orderDate: Date ownerUserId: number @@ -14,12 +17,19 @@ export interface ContractVO { price: number discountPercent: number productPrice: number - roUserIds: string - rwUserIds: string contactId: number signUserId: number + signUserName: string contactLastTime: Date + auditStatus: number remark: string + productItems: ProductExpandVO[] + creatorName: string + updateTime?: Date + createTime?: Date + customerName: string + contactName: string + ownerUserName: string } // 查询 CRM 合同列表 @@ -56,3 +66,13 @@ export const deleteContract = async (id: number) => { export const exportContract = async (params) => { return await request.download({ url: `/crm/contract/export-excel`, params }) } + +// 提交审核 +export const submitContract = async (id: number) => { + return await request.put({ url: `/crm/contract/submit?id=${id}` }) +} + +// 合同转移 +export const transferContract = async (data: TransferReqVO) => { + return await request.put({ url: '/crm/contract/transfer', data }) +} diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index 4542c86a..2940934e 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -63,16 +63,16 @@ export const exportCustomer = async (params: any) => { return await request.download({ url: `/crm/customer/export-excel`, params }) } +// 下载客户导入模板 +export const importCustomerTemplate = () => { + return request.download({ url: '/crm/customer/get-import-template' }) +} + // 客户列表 export const getSimpleCustomerList = async () => { return await request.get({ url: `/crm/customer/list-all-simple` }) } -// 查询客户操作日志 -export const getOperateLogPage = async (id: number) => { - return await request.get({ url: '/crm/customer/operate-log-page?id=' + id }) -} - // ======================= 业务操作 ======================= export interface TransferReqVO { @@ -82,7 +82,7 @@ export interface TransferReqVO { } // 客户转移 -export const transfer = async (data: TransferReqVO) => { +export const transferCustomer = async (data: TransferReqVO) => { return await request.put({ url: '/crm/customer/transfer', data }) } @@ -100,3 +100,8 @@ export const receiveCustomer = async (ids: any[]) => { export const putCustomerPool = async (id: number) => { return await request.put({ url: `/crm/customer/put-pool?id=${id}` }) } + +// 进入公海客户提醒 +export const getPutInPoolRemindCustomerPage = async (params) => { + return await request.get({ url: `/crm/customer/put-in-pool-remind-page`, params }) +} diff --git a/src/api/crm/operateLog/index.ts b/src/api/crm/operateLog/index.ts new file mode 100644 index 00000000..d0f25b6b --- /dev/null +++ b/src/api/crm/operateLog/index.ts @@ -0,0 +1,11 @@ +import request from '@/config/axios' + +export interface OperateLogVO extends PageParam { + bizType: number + bizId: number +} + +// 获得操作日志 +export const getOperateLogPage = async (params: OperateLogVO) => { + return await request.get({ url: `/crm/operate-log/page`, params }) +} diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts index e616a404..5c829b6a 100644 --- a/src/api/crm/permission/index.ts +++ b/src/api/crm/permission/index.ts @@ -22,8 +22,11 @@ export enum BizTypeEnum { CRM_LEADS = 1, // 线索 CRM_CUSTOMER = 2, // 客户 CRM_CONTACT = 3, // 联系人 - CRM_BUSINESS = 5, // 商机 - CRM_CONTRACT = 6 // 合同 + CRM_BUSINESS = 4, // 商机 + CRM_CONTRACT = 5, // 合同 + CRM_PRODUCT = 6, // 产品 + CRM_RECEIVABLE = 7, // 回款 + CRM_RECEIVABLE_PLAN = 8 // 回款计划 } /** diff --git a/src/api/crm/product/index.ts b/src/api/crm/product/index.ts index 2d88cb09..e6508fb4 100644 --- a/src/api/crm/product/index.ts +++ b/src/api/crm/product/index.ts @@ -12,6 +12,12 @@ export interface ProductVO { ownerUserId: number } +export interface ProductExpandVO extends ProductVO { + count: number + discountPercent: number + totalPrice: number +} + // 查询产品列表 export const getProductPage = async (params) => { return await request.get({ url: `/crm/product/page`, params }) @@ -41,8 +47,3 @@ export const deleteProduct = async (id: number) => { export const exportProduct = async (params) => { return await request.download({ url: `/crm/product/export-excel`, params }) } - -// 查询产品操作日志 -export const getOperateLogPage = async (params: any) => { - return await request.get({ url: '/crm/product/operate-log-page', params }) -} diff --git a/src/components/Table/index.ts b/src/components/Table/index.ts index 689f64a8..9f893171 100644 --- a/src/components/Table/index.ts +++ b/src/components/Table/index.ts @@ -1,6 +1,7 @@ import Table from './src/Table.vue' import { ElTable } from 'element-plus' import { TableSetPropsType } from '@/types/table' +import TableSelectForm from './src/TableSelectForm.vue' export interface TableExpose { setProps: (props: Recordable) => void @@ -9,4 +10,4 @@ export interface TableExpose { elTableRef: ComponentRef } -export { Table } +export { Table, TableSelectForm } diff --git a/src/components/Table/src/TableSelectForm.vue b/src/components/Table/src/TableSelectForm.vue new file mode 100644 index 00000000..7fece2d2 --- /dev/null +++ b/src/components/Table/src/TableSelectForm.vue @@ -0,0 +1,91 @@ + + + + diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 7bcd81d2..edda3820 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -507,6 +507,17 @@ const remainingRouter: AppRouteRecordRaw[] = [ }, component: () => import('@/views/crm/customer/detail/index.vue') }, + { + path: 'contract/detail/:id', + name: 'CrmContractDetail', + meta: { + title: '合同详情', + noCache: true, + hidden: true, + activeMenu: '/crm/contract' + }, + component: () => import('@/views/crm/contract/detail/index.vue') + }, { path: 'contact/detail/:id', name: 'CrmContactDetail', diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 1f801fef..226860ed 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -10,7 +10,9 @@ interface UserVO { id: number avatar: string nickname: string + deptId: number } + interface UserInfoVO { permissions: string[] roles: string[] @@ -26,7 +28,8 @@ export const useUserStore = defineStore('admin-user', { user: { id: 0, avatar: '', - nickname: '' + nickname: '', + deptId: 0 } }), getters: { @@ -73,7 +76,8 @@ export const useUserStore = defineStore('admin-user', { this.user = { id: 0, avatar: '', - nickname: '' + nickname: '', + deptId: 0 } } } diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 2c8e47ff..4c490f59 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -203,5 +203,8 @@ export enum DICT_TYPE { CRM_PRODUCT_STATUS = 'crm_product_status', CRM_PERMISSION_LEVEL = 'crm_permission_level', // CRM 数据权限的级别 CRM_PRODUCT_UNIT = 'crm_product_unit', // 产品单位 - CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type' // 跟进方式 + CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type', // 跟进方式 + + // ========== BI - 商业智能模块 ========== + BI_ANALYZE_TYPE = 'bi_analyze_type' // 分析类型 } diff --git a/src/views/Login/Login.vue b/src/views/Login/Login.vue index e8b03a93..5d349ce3 100644 --- a/src/views/Login/Login.vue +++ b/src/views/Login/Login.vue @@ -1,7 +1,7 @@