Skip to content

Commit c804ec5

Browse files
YunaiVgitee-org
authored andcommitted
!387 feat: CRM/backlog 提醒数量
Merge pull request !387 from dhb52/crm-msg
2 parents f01bb2d + e067d50 commit c804ec5

File tree

4 files changed

+75
-104
lines changed

4 files changed

+75
-104
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: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
</template>
2929

3030
<script lang="ts" setup>
31+
import * as BacklogApi from '@/api/crm/backlog'
3132
import CheckContract from './tables/CheckContract.vue'
3233
import CheckReceivables from './tables/CheckReceivables.vue'
3334
import EndContract from './tables/EndContract.vue'
@@ -38,72 +39,86 @@ import RemindReceivables from './tables/RemindReceivables.vue'
3839
import TodayCustomer from './tables/TodayCustomer.vue'
3940
4041
const leftType = ref('todayCustomer')
42+
43+
const todayCustomerCountRef = ref(0)
44+
const followLeadsCountRef = ref(0)
45+
const followCustomerCountRef = ref(0)
46+
const putInPoolCustomerRemindCountRef = ref(0)
47+
const checkContractCountRef = ref(0)
48+
const checkReceivablesCountRef = ref(0)
49+
const remindReceivablesCountRef = ref(0)
50+
const endContractCountRef = ref(0)
51+
4152
const leftSides = ref([
4253
{
4354
name: '今日需联系客户',
4455
infoType: 'todayCustomer',
45-
msgCount: 1,
46-
tips: '下次跟进时间为今日的客户'
56+
msgCount: todayCustomerCountRef
4757
},
4858
{
4959
name: '分配给我的线索',
5060
infoType: 'followLeads',
51-
msgCount: 0,
52-
tips: '转移之后未跟进的线索'
61+
msgCount: followLeadsCountRef
5362
},
5463
{
5564
name: '分配给我的客户',
5665
infoType: 'followCustomer',
57-
msgCount: 0,
58-
tips: '转移、领取、分配之后未跟进的客户,默认显示自己负责的客户'
66+
msgCount: followCustomerCountRef
5967
},
6068
{
6169
name: '待进入公海的客户',
6270
infoType: 'putInPoolRemind',
63-
msgCount: 0,
64-
tips: ''
71+
msgCount: putInPoolCustomerRemindCountRef
6572
},
6673
{
6774
name: '待审核合同',
6875
infoType: 'checkContract',
69-
msgCount: 0,
70-
tips: ''
76+
msgCount: checkContractCountRef
7177
},
7278
{
7379
name: '待审核回款',
7480
infoType: 'checkReceivables',
75-
msgCount: 0,
76-
tips: ''
81+
msgCount: checkReceivablesCountRef
7782
},
7883
{
7984
name: '待回款提醒',
8085
infoType: 'remindReceivables',
81-
msgCount: 4,
82-
tips: ''
86+
msgCount: remindReceivablesCountRef
8387
},
8488
{
8589
name: '即将到期的合同',
8690
infoType: 'endContract',
87-
msgCount: 20,
88-
tips: '根据“合同到期时间”及设置的“提前提醒天数”提醒'
91+
msgCount: endContractCountRef
8992
}
9093
])
9194
9295
/** 侧边点击 */
9396
const sideClick = (item: any) => {
9497
leftType.value = item.infoType
9598
}
96-
// TODO @dhb52: 侧边栏样式,在黑暗模式下,颜色会不对。是不是可以读取主题色哈;
99+
100+
/** 加载时读取待办数量 */
101+
onMounted(async () => {
102+
BacklogApi.getTodayCustomerCount().then(count => todayCustomerCountRef.value = count)
103+
BacklogApi.getFollowLeadsCount().then(count => followLeadsCountRef.value = count)
104+
BacklogApi.getFollowCustomerCount().then(count => followCustomerCountRef.value = count)
105+
BacklogApi.getPutInPoolCustomerRemindCount().then(count => putInPoolCustomerRemindCountRef.value = count)
106+
BacklogApi.getCheckContractCount().then(count => checkContractCountRef.value = count)
107+
BacklogApi.getCheckReceivablesCount().then(count => checkReceivablesCountRef.value = count)
108+
BacklogApi.getRemindReceivablePlanCount().then(count => remindReceivablesCountRef.value = count)
109+
BacklogApi.getEndContractCount().then(count => endContractCountRef.value = count)
110+
})
97111
</script>
112+
98113
<style lang="scss" scoped>
99114
.side-item-list {
100115
top: 0;
101116
bottom: 0;
102117
left: 0;
103118
z-index: 1;
104119
font-size: 14px;
105-
background-color: white;
106-
border: 1px solid #e6e6e6;
120+
background-color: var(--el-bg-color);
121+
border: 1px solid var(--el-border-color);
107122
border-radius: 5px;
108123
109124
.side-item {
@@ -112,21 +127,17 @@ const sideClick = (item: any) => {
112127
padding: 0 20px;
113128
line-height: 50px;
114129
cursor: pointer;
115-
116-
i {
117-
color: #999;
118-
}
119130
}
120131
}
121132
122133
.side-item-default {
123-
color: #333;
134+
color: var(--el-text-color-primary);
124135
border-right: 2px solid transparent;
125136
}
126137
127138
.side-item-select {
128-
color: #409eff;
129-
background-color: #ecf5ff;
139+
color: var(--el-color-primary);
140+
background-color: var(--el-color-primary-light-9);
130141
border-right: 2px solid var(--el-color-primary);
131142
}
132143

src/views/crm/backlog/tables/RemindReceivables.vue

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,6 @@
6868
:formatter="dateFormatter"
6969
width="180px"
7070
/>
71-
<el-table-column label="操作" align="center" width="130px">
72-
<template #default="scope">
73-
<el-button
74-
link
75-
type="primary"
76-
@click="openForm('update', scope.row.id)"
77-
v-hasPermi="['crm:receivable-plan:update']"
78-
>
79-
编辑
80-
</el-button>
81-
<el-button
82-
link
83-
type="danger"
84-
@click="handleDelete(scope.row.id)"
85-
v-hasPermi="['crm:receivable-plan:delete']"
86-
>
87-
删除
88-
</el-button>
89-
</template>
90-
</el-table-column>
9171
</el-table>
9272
<!-- 分页 -->
9373
<Pagination
@@ -102,16 +82,12 @@
10282
<script setup lang="ts" name="RemindReceivables">
10383
import { DICT_TYPE } from '@/utils/dict'
10484
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
105-
import download from '@/utils/download'
10685
import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
10786
import * as UserApi from '@/api/system/user'
10887
import { RECEIVABLE_REMIND_TYPE } from './common'
10988
11089
defineOptions({ name: 'ReceivablePlan' })
11190
112-
const message = useMessage() // 消息弹窗
113-
const { t } = useI18n() // 国际化
114-
11591
const loading = ref(true) // 列表的加载中
11692
const total = ref(0) // 列表的总页数
11793
const list = ref([]) // 列表的数据
@@ -122,7 +98,6 @@ const queryParams = reactive({
12298
remindType: 1
12399
})
124100
const queryFormRef = ref() // 搜索的表单
125-
const exportLoading = ref(false) // 导出的加载中
126101
127102
/** 查询列表 */
128103
const getList = async () => {
@@ -142,46 +117,6 @@ const handleQuery = () => {
142117
getList()
143118
}
144119
145-
/** 重置按钮操作 */
146-
const resetQuery = () => {
147-
queryFormRef.value.resetFields()
148-
handleQuery()
149-
}
150-
151-
/** 添加/修改操作 */
152-
const formRef = ref()
153-
const openForm = (type: string, id?: number) => {
154-
formRef.value.open(type, id)
155-
}
156-
157-
/** 删除按钮操作 */
158-
const handleDelete = async (id: number) => {
159-
try {
160-
// 删除的二次确认
161-
await message.delConfirm()
162-
// 发起删除
163-
await ReceivablePlanApi.deleteReceivablePlan(id)
164-
message.success(t('common.delSuccess'))
165-
// 刷新列表
166-
await getList()
167-
} catch {}
168-
}
169-
170-
/** 导出按钮操作 */
171-
const handleExport = async () => {
172-
try {
173-
// 导出的二次确认
174-
await message.exportConfirm()
175-
// 发起导出
176-
exportLoading.value = true
177-
const data = await ReceivablePlanApi.exportReceivablePlan(queryParams)
178-
download.excel(data, '回款计划.xls')
179-
} catch {
180-
} finally {
181-
exportLoading.value = false
182-
}
183-
}
184-
185120
/** 初始化 **/
186121
onMounted(async () => {
187122
await getList()

src/views/crm/backlog/tables/TodayCustomer.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
</template>
120120

121121
<script lang="ts" setup name="TodayCustomer">
122-
import * as BacklogApi from '@/api/crm/backlog'
122+
import * as CustomerApi from '@/api/crm/customer'
123123
import { DICT_TYPE } from '@/utils/dict'
124124
import { dateFormatter } from '@/utils/formatTime'
125125
import { CONTACT_STATUS, SCENE_TYPES } from './common'
@@ -135,15 +135,16 @@ const queryParams = ref({
135135
pageNo: 1,
136136
pageSize: 10,
137137
contactStatus: 1,
138-
sceneType: 1
138+
sceneType: 1,
139+
pool: null // 是否公海数据
139140
})
140141
const queryFormRef = ref() // 搜索的表单
141142
142143
/** 查询列表 */
143144
const getList = async () => {
144145
loading.value = true
145146
try {
146-
const data = await BacklogApi.getTodayCustomerPage(queryParams.value)
147+
const data = await CustomerApi.getCustomerPage(queryParams.value)
147148
list.value = data.list
148149
total.value = data.total
149150
} finally {

0 commit comments

Comments
 (0)