Skip to content

Commit e067d50

Browse files
committed
feat: CRM/backlog 提醒数量
1 parent 42b8df4 commit e067d50

File tree

2 files changed

+65
-26
lines changed

2 files changed

+65
-26
lines changed

src/api/crm/backlog/index.ts

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,41 @@
11
import request from '@/config/axios'
22

3-
import { type CustomerVO } from '../customer'
4-
import { type ClueVO } from '../clue'
3+
// 1. 获得今日需联系客户数量
4+
export const getTodayCustomerCount = async () => {
5+
return await request.get({ url: '/crm/customer/today-customer-count' })
6+
}
7+
8+
// 2. 获得分配给我的线索数量
9+
export const getFollowLeadsCount = async () => {
10+
return await request.get({ url: '/crm/clue/follow-leads-count' })
11+
}
12+
13+
// 3. 获得分配给我的客户数量
14+
export const getFollowCustomerCount = async () => {
15+
return await request.get({ url: '/crm/customer/follow-customer-count' })
16+
}
517

6-
// 查询客户列表
7-
// TODO @芋艿:看看是不是后续融合到 getCustomerPage 里;
8-
export const getTodayCustomerPage = async (params) => {
9-
return await request.get({ url: `/crm/backlog/today-customer-page`, params })
18+
// 4. 获得待进入公海的客户数量
19+
export const getPutInPoolCustomerRemindCount = async () => {
20+
return await request.get({ url: '/crm/customer/put-in-pool-remind-count' })
1021
}
1122

12-
// 查询线索列表
13-
export const getFollowLeadsPage = async (params) => {
14-
return await request.get({ url: `/crm/backlog/page`, params })
23+
// 5. 获得待审核合同数量
24+
export const getCheckContractCount = async () => {
25+
return await request.get({ url: '/crm/contract/check-contract-count' })
1526
}
1627

17-
export { type CustomerVO, type ClueVO }
28+
// 6. 获得待审核回款数量
29+
export const getCheckReceivablesCount = async () => {
30+
return await request.get({ url: '/crm/receivable/check-receivables-count' })
31+
}
32+
33+
// 7. 获得待回款提醒数量
34+
export const getRemindReceivablePlanCount = async () => {
35+
return await request.get({ url: '/crm/receivable-plan/remind-receivable-plan-count' })
36+
}
37+
38+
// 8. 获得即将到期的合同数量
39+
export const getEndContractCount = async () => {
40+
return await request.get({ url: '/crm/contract/end-contract-count' })
41+
}

src/views/crm/backlog/index.vue

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
</template>
3030

3131
<script lang="ts" setup>
32+
import * as BacklogApi from '@/api/crm/backlog'
3233
import CheckContract from './tables/CheckContract.vue'
3334
import CheckReceivables from './tables/CheckReceivables.vue'
3435
import EndContract from './tables/EndContract.vue'
@@ -39,54 +40,56 @@ import RemindReceivables from './tables/RemindReceivables.vue'
3940
import TodayCustomer from './tables/TodayCustomer.vue'
4041
4142
const leftType = ref('todayCustomer')
43+
44+
const todayCustomerCountRef = ref(0)
45+
const followLeadsCountRef = ref(0)
46+
const followCustomerCountRef = ref(0)
47+
const putInPoolCustomerRemindCountRef = ref(0)
48+
const checkContractCountRef = ref(0)
49+
const checkReceivablesCountRef = ref(0)
50+
const remindReceivablesCountRef = ref(0)
51+
const endContractCountRef = ref(0)
52+
4253
const leftSides = ref([
4354
{
4455
name: '今日需联系客户',
4556
infoType: 'todayCustomer',
46-
msgCount: 1,
47-
tips: '下次跟进时间为今日的客户'
57+
msgCount: todayCustomerCountRef
4858
},
4959
{
5060
name: '分配给我的线索',
5161
infoType: 'followLeads',
52-
msgCount: 0,
53-
tips: '转移之后未跟进的线索'
62+
msgCount: followLeadsCountRef
5463
},
5564
{
5665
name: '分配给我的客户',
5766
infoType: 'followCustomer',
58-
msgCount: 0,
59-
tips: '转移、领取、分配之后未跟进的客户,默认显示自己负责的客户'
67+
msgCount: followCustomerCountRef
6068
},
6169
{
6270
name: '待进入公海的客户',
6371
infoType: 'putInPoolRemind',
64-
msgCount: 0,
65-
tips: ''
72+
msgCount: putInPoolCustomerRemindCountRef
6673
},
6774
{
6875
name: '待审核合同',
6976
infoType: 'checkContract',
70-
msgCount: 0,
71-
tips: ''
77+
msgCount: checkContractCountRef
7278
},
7379
{
7480
name: '待审核回款',
7581
infoType: 'checkReceivables',
76-
msgCount: 0,
77-
tips: ''
82+
msgCount: checkReceivablesCountRef
7883
},
7984
{
8085
name: '待回款提醒',
8186
infoType: 'remindReceivables',
82-
msgCount: 4,
83-
tips: ''
87+
msgCount: remindReceivablesCountRef
8488
},
8589
{
8690
name: '即将到期的合同',
8791
infoType: 'endContract',
88-
msgCount: 20,
89-
tips: '根据“合同到期时间”及设置的“提前提醒天数”提醒'
92+
msgCount: endContractCountRef
9093
}
9194
])
9295
@@ -96,6 +99,18 @@ const leftSides = ref([
9699
const sideClick = (item) => {
97100
leftType.value = item.infoType
98101
}
102+
103+
/** 加载时读取待办数量 */
104+
onMounted(async () => {
105+
BacklogApi.getTodayCustomerCount().then(count => todayCustomerCountRef.value = count)
106+
BacklogApi.getFollowLeadsCount().then(count => followLeadsCountRef.value = count)
107+
BacklogApi.getFollowCustomerCount().then(count => followCustomerCountRef.value = count)
108+
BacklogApi.getPutInPoolCustomerRemindCount().then(count => putInPoolCustomerRemindCountRef.value = count)
109+
BacklogApi.getCheckContractCount().then(count => checkContractCountRef.value = count)
110+
BacklogApi.getCheckReceivablesCount().then(count => checkReceivablesCountRef.value = count)
111+
BacklogApi.getRemindReceivablePlanCount().then(count => remindReceivablesCountRef.value = count)
112+
BacklogApi.getEndContractCount().then(count => endContractCountRef.value = count)
113+
})
99114
</script>
100115

101116
<style lang="scss" scoped>

0 commit comments

Comments
 (0)