diff --git a/package.json b/package.json index 9bcd5c65..bafdf048 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "postcss-html": "^1.5.0", "postcss-scss": "^4.0.9", "prettier": "^3.1.0", + "prettier-eslint": "^16.3.0", "rimraf": "^5.0.5", "rollup": "^4.4.1", "sass": "^1.69.5", diff --git a/src/api/crm/business/index.ts b/src/api/crm/business/index.ts index b6661765..24204255 100644 --- a/src/api/crm/business/index.ts +++ b/src/api/crm/business/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/customer' +import { TransferReqVO } from '@/api/crm/permission' export interface BusinessVO { id: number diff --git a/src/api/crm/clue/index.ts b/src/api/crm/clue/index.ts index 170f244d..9736514d 100644 --- a/src/api/crm/clue/index.ts +++ b/src/api/crm/clue/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/customer' +import { TransferReqVO } from '@/api/crm/permission' export interface ClueVO { id: number // 编号 diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 67036194..7c24dfa9 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/customer' +import { TransferReqVO } from '@/api/crm/permission' export interface ContactVO { id: number // 编号 diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index faee9495..7028b774 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/customer' +import { TransferReqVO } from '@/api/crm/permission' export interface ContractVO { id: number diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index c684e98d..d149d4e7 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import { TransferReqVO } from '@/api/crm/permission' export interface CustomerVO { id: number // 编号 @@ -102,12 +103,6 @@ export const getCustomerSimpleList = async () => { // ======================= 业务操作 ======================= -export interface TransferReqVO { - id: number | undefined // 客户编号 - newOwnerUserId: number | undefined // 新负责人的用户编号 - oldOwnerPermissionLevel: number | undefined // 老负责人加入团队后的权限级别 -} - // 客户转移 export const transferCustomer = async (data: TransferReqVO) => { return await request.put({ url: '/crm/customer/transfer', data }) diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts index 31f9e18d..4f88b14f 100644 --- a/src/api/crm/permission/index.ts +++ b/src/api/crm/permission/index.ts @@ -6,6 +6,7 @@ export interface PermissionVO { bizType: number // Crm 类型 bizId: number // Crm 类型数据编号 level: number // 权限级别 + toBizTypes?: number[] // 同时添加至 deptName?: string // 部门名称 nickname?: string // 用户昵称 postNames?: string[] // 岗位名称数组 @@ -13,6 +14,13 @@ export interface PermissionVO { ids?: number[] } +export interface TransferReqVO { + id: number // 模块编号 + newOwnerUserId: number // 新负责人的用户编号 + oldOwnerPermissionLevel?: number // 老负责人加入团队后的权限级别 + toBizTypes?: number[] // 转移客户时,需要额外有【联系人】【商机】【合同】的 checkbox 选择 +} + /** * CRM 业务类型枚举 * diff --git a/src/api/crm/receivable/index.ts b/src/api/crm/receivable/index.ts index 069d6c4a..32ecd25a 100644 --- a/src/api/crm/receivable/index.ts +++ b/src/api/crm/receivable/index.ts @@ -3,18 +3,20 @@ import request from '@/config/axios' export interface ReceivableVO { id: number no: string - planId: number - customerId: number + planId?: number + customerId?: number customerName?: string - contractId: number + contractId?: number contract?: { + id?: number + name?: string no: string totalPrice: number } auditStatus: number processInstanceId: number returnTime: Date - returnType: string + returnType: number price: number ownerUserId: number ownerUserName?: string diff --git a/src/api/crm/receivable/plan/index.ts b/src/api/crm/receivable/plan/index.ts index 6e0cab4a..770b3477 100644 --- a/src/api/crm/receivable/plan/index.ts +++ b/src/api/crm/receivable/plan/index.ts @@ -11,7 +11,7 @@ export interface ReceivablePlanVO { remindTime: Date customerId: number customerName?: string - contractId: number + contractId?: number contractNo?: string ownerUserId: number ownerUserName?: string diff --git a/src/api/crm/statistics/customer.ts b/src/api/crm/statistics/customer.ts new file mode 100644 index 00000000..4358db77 --- /dev/null +++ b/src/api/crm/statistics/customer.ts @@ -0,0 +1,116 @@ +import request from '@/config/axios' + +export interface CrmStatisticsCustomerSummaryByDateRespVO { + time: string + customerCreateCount: number + customerDealCount: number +} + +export interface CrmStatisticsCustomerSummaryByUserRespVO { + ownerUserName: string + customerCreateCount: number + customerDealCount: number + contractPrice: number + receivablePrice: number +} + +export interface CrmStatisticsFollowupSummaryByDateRespVO { + time: string + followupRecordCount: number + followupCustomerCount: number +} + +export interface CrmStatisticsFollowupSummaryByUserRespVO { + ownerUserName: string + followupRecordCount: number + followupCustomerCount: number +} + +export interface CrmStatisticsFollowupSummaryByTypeRespVO { + followupType: string + followupRecordCount: number +} + +export interface CrmStatisticsCustomerContractSummaryRespVO { + customerName: string + contractName: string + totalPrice: number + receivablePrice: number + customerType: string + customerSource: string + ownerUserName: string + creatorUserName: string + createTime: Date + orderDate: Date +} + +export interface CrmStatisticsCustomerDealCycleByDateRespVO { + time: string + customerDealCycle: number +} + +export interface CrmStatisticsCustomerDealCycleByUserRespVO { + ownerUserName: string + customerDealCycle: number + customerDealCount: number +} + +// 客户分析 API +export const StatisticsCustomerApi = { + // 1.1 客户总量分析(按日期) + getCustomerSummaryByDate: (params: any) => { + return request.get({ + url: '/crm/statistics-customer/get-customer-summary-by-date', + params + }) + }, + // 1.2 客户总量分析(按用户) + getCustomerSummaryByUser: (params: any) => { + return request.get({ + url: '/crm/statistics-customer/get-customer-summary-by-user', + params + }) + }, + // 2.1 客户跟进次数分析(按日期) + getFollowupSummaryByDate: (params: any) => { + return request.get({ + url: '/crm/statistics-customer/get-followup-summary-by-date', + params + }) + }, + // 2.2 客户跟进次数分析(按用户) + getFollowupSummaryByUser: (params: any) => { + return request.get({ + url: '/crm/statistics-customer/get-followup-summary-by-user', + params + }) + }, + // 3.1 获取客户跟进方式统计数 + getFollowupSummaryByType: (params: any) => { + return request.get({ + url: '/crm/statistics-customer/get-followup-summary-by-type', + params + }) + }, + // 4.1 合同摘要信息(客户转化率页面) + getContractSummary: (params: any) => { + return request.get({ + url: '/crm/statistics-customer/get-contract-summary', + params + }) + }, + // 5.1 获取客户成交周期(按日期) + getCustomerDealCycleByDate: (params: any) => { + return request.get({ + url: '/crm/statistics-customer/get-customer-deal-cycle-by-date', + params + }) + }, + // 5.2 获取客户成交周期(按用户) + getCustomerDealCycleByUser: (params: any) => { + return request.get({ + url: '/crm/statistics-customer/get-customer-deal-cycle-by-user', + params + }) + } +} diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index ef212505..e8e618dd 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -291,10 +291,16 @@ const doSocialLogin = async (type: number) => { await getTenantId() // 如果获取不到,则需要弹出提示,进行处理 if (!authUtil.getTenantId()) { - await message.prompt('请输入租户名称', t('common.reminder')).then(async ({ value }) => { - const res = await LoginApi.getTenantIdByName(value) + try { + const data = await message.prompt('请输入租户名称', t('common.reminder')) + if (data?.action !== 'confirm') throw 'cancel' + const res = await LoginApi.getTenantIdByName(data.value) authUtil.setTenantId(res) - }) + } catch (error) { + if (error === 'cancel') return + } finally { + loginLoading.value = false + } } } // 计算 redirectUri diff --git a/src/views/crm/business/detail/index.vue b/src/views/crm/business/detail/index.vue index 6b86a41e..0c280734 100644 --- a/src/views/crm/business/detail/index.vue +++ b/src/views/crm/business/detail/index.vue @@ -4,8 +4,8 @@ 编辑 @@ -53,13 +53,12 @@ - - - + + + diff --git a/src/views/crm/clue/detail/index.vue b/src/views/crm/clue/detail/index.vue index f9074c14..8f005e1c 100644 --- a/src/views/crm/clue/detail/index.vue +++ b/src/views/crm/clue/detail/index.vue @@ -18,7 +18,7 @@ > 转化为客户 - 已转化客户 + 已转化客户 @@ -45,7 +45,7 @@ - + diff --git a/src/views/crm/contract/detail/index.vue b/src/views/crm/contract/detail/index.vue index bd30489a..f3b038ed 100644 --- a/src/views/crm/contract/detail/index.vue +++ b/src/views/crm/contract/detail/index.vue @@ -48,7 +48,7 @@ - + diff --git a/src/views/crm/statistics/customer/components/CustomerDealCycle.vue b/src/views/crm/statistics/customer/components/CustomerDealCycle.vue new file mode 100644 index 00000000..9243e6a3 --- /dev/null +++ b/src/views/crm/statistics/customer/components/CustomerDealCycle.vue @@ -0,0 +1,127 @@ + + + diff --git a/src/views/crm/statistics/customer/components/CustomerFollowupSummary.vue b/src/views/crm/statistics/customer/components/CustomerFollowupSummary.vue new file mode 100644 index 00000000..cfb025f5 --- /dev/null +++ b/src/views/crm/statistics/customer/components/CustomerFollowupSummary.vue @@ -0,0 +1,124 @@ + + + diff --git a/src/views/crm/statistics/customer/components/CustomerFollowupType.vue b/src/views/crm/statistics/customer/components/CustomerFollowupType.vue new file mode 100644 index 00000000..87510054 --- /dev/null +++ b/src/views/crm/statistics/customer/components/CustomerFollowupType.vue @@ -0,0 +1,105 @@ + + + diff --git a/src/views/crm/statistics/customer/components/CustomerSummary.vue b/src/views/crm/statistics/customer/components/CustomerSummary.vue new file mode 100644 index 00000000..14f0b9b8 --- /dev/null +++ b/src/views/crm/statistics/customer/components/CustomerSummary.vue @@ -0,0 +1,151 @@ + + + diff --git a/src/views/crm/statistics/customer/index.vue b/src/views/crm/statistics/customer/index.vue new file mode 100644 index 00000000..9d804e31 --- /dev/null +++ b/src/views/crm/statistics/customer/index.vue @@ -0,0 +1,166 @@ + + + + diff --git a/src/views/infra/demo/demo03/erp/components/Demo03CourseList.vue b/src/views/infra/demo/demo03/erp/components/Demo03CourseList.vue index 9d5e2705..3dce77e9 100644 --- a/src/views/infra/demo/demo03/erp/components/Demo03CourseList.vue +++ b/src/views/infra/demo/demo03/erp/components/Demo03CourseList.vue @@ -2,39 +2,40 @@ - 新增 + + 新增 - - - - + + + + - + -