Skip to content

Commit b0d4c87

Browse files
committed
feat: [CRM-客户分析]增加[时间间隔]选项
1 parent 1a0f0a1 commit b0d4c87

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/api/crm/statistics/customer.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ export interface CrmStatisticsCustomerDealCycleByUserRespVO {
5555
customerDealCount: number
5656
}
5757

58+
export const DATE_INTERVAL_OPTIONS = [
59+
{ value: 1, name: '今天' },
60+
{ value: 2, name: '昨天' },
61+
{ value: 3, name: '本周' },
62+
{ value: 4, name: '上周' },
63+
{ value: 5, name: '本月' },
64+
{ value: 6, name: '上月' },
65+
{ value: 7, name: '本季度' },
66+
{ value: 8, name: '上季度' },
67+
{ value: 9, name: '本年' },
68+
{ value: 10, name: '去年' },
69+
{ value: 11, name: '自定义' }
70+
]
71+
72+
export const CUSTOMER_INTERVAL = 11
73+
5874
// 客户分析 API
5975
export const StatisticsCustomerApi = {
6076
// 1.1 客户总量分析(按日期)

src/views/crm/statistics/customer/index.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@
99
:inline="true"
1010
label-width="68px"
1111
>
12-
<el-form-item label="时间范围" prop="orderDate">
12+
<el-form-item label="间隔类型" prop="intervalType">
13+
<el-select v-model="queryParams.intervalType" class="!w-240px" placeholder="间隔类型">
14+
<el-option
15+
v-for="(intervalType, index) in DATE_INTERVAL_OPTIONS"
16+
:label="intervalType.name"
17+
:value="intervalType.value"
18+
:key="index"
19+
/>
20+
</el-select>
21+
</el-form-item>
22+
<el-form-item label="时间范围" prop="orderDate" v-show="queryParams.intervalType === CUSTOMER_INTERVAL">
1323
<el-date-picker
1424
v-model="queryParams.times"
1525
:shortcuts="defaultShortcuts"
@@ -88,10 +98,12 @@ import CustomerFollowupSummary from './components/CustomerFollowupSummary.vue'
8898
import CustomerFollowupType from './components/CustomerFollowupType.vue'
8999
import CustomerConversionStat from './components/CustomerConversionStat.vue'
90100
import CustomerDealCycle from './components/CustomerDealCycle.vue'
101+
import { DATE_INTERVAL_OPTIONS, CUSTOMER_INTERVAL } from '@/api/crm/statistics/customer'
91102
92103
defineOptions({ name: 'CrmStatisticsCustomer' })
93104
94105
const queryParams = reactive({
106+
intervalType: CUSTOMER_INTERVAL,
95107
deptId: useUserStore().getUser.deptId,
96108
userId: undefined,
97109
times: [

0 commit comments

Comments
 (0)