5
5
<div
6
6
v-for =" (item, index) in leftSides"
7
7
:key =" index"
8
- :class =" leftType == item.infoType ? 'side-item-select' : 'side-item-default'"
8
+ :class =" leftMenu == item.menu ? 'side-item-select' : 'side-item-default'"
9
9
class =" side-item"
10
10
@click =" sideClick(item)"
11
11
>
12
12
{{ item.name }}
13
- <el-badge v-if =" item.msgCount > 0" :max =" 99" :value =" item.msgCount " />
13
+ <el-badge v-if =" item.count > 0" :max =" 99" :value =" item.count " />
14
14
</div >
15
15
</div >
16
16
</el-col >
17
17
<el-col :span =" 20" :xs =" 24" >
18
- <TodayCustomer v-if =" leftType === 'todayCustomer'" />
19
- <FollowLeads v-if =" leftType === 'followLeads '" />
20
- <CheckContract v-if =" leftType === 'checkContract'" />
21
- <CheckReceivables v-if =" leftType === 'checkReceivables'" />
22
- <EndContract v-if =" leftType === 'endContract'" />
23
- <FollowCustomer v-if =" leftType === 'followCustomer'" />
24
- <PutInPoolRemind v-if =" leftType === 'putInPoolRemind'" />
25
- <RemindReceivables v-if =" leftType === 'remindReceivables'" />
18
+ <TodayCustomer v-if =" leftMenu === 'todayCustomer'" />
19
+ <ClueFollowList v-if =" leftMenu === 'clueFollow '" />
20
+ <CheckContract v-if =" leftMenu === 'checkContract'" />
21
+ <CheckReceivables v-if =" leftMenu === 'checkReceivables'" />
22
+ <EndContract v-if =" leftMenu === 'endContract'" />
23
+ <FollowCustomer v-if =" leftMenu === 'followCustomer'" />
24
+ <PutInPoolRemind v-if =" leftMenu === 'putInPoolRemind'" />
25
+ <RemindReceivables v-if =" leftMenu === 'remindReceivables'" />
26
26
</el-col >
27
27
</el-row >
28
28
</template >
@@ -33,15 +33,18 @@ import CheckContract from './tables/CheckContract.vue'
33
33
import CheckReceivables from ' ./tables/CheckReceivables.vue'
34
34
import EndContract from ' ./tables/EndContract.vue'
35
35
import FollowCustomer from ' ./tables/FollowCustomer.vue'
36
- import FollowLeads from ' ./tables/FollowLeads .vue'
36
+ import ClueFollowList from ' ./components/ClueFollowList .vue'
37
37
import PutInPoolRemind from ' ./tables/PutInPoolRemind.vue'
38
38
import RemindReceivables from ' ./tables/RemindReceivables.vue'
39
39
import TodayCustomer from ' ./tables/TodayCustomer.vue'
40
+ import * as ClueApi from ' @/api/crm/clue'
40
41
41
- const leftType = ref (' todayCustomer' )
42
+ defineOptions ({ name: ' CrmBacklog' })
43
+
44
+ const leftMenu = ref (' todayCustomer' )
42
45
43
46
const todayCustomerCountRef = ref (0 )
44
- const followLeadsCountRef = ref (0 )
47
+ const clueFollowCount = ref (0 )
45
48
const followCustomerCountRef = ref (0 )
46
49
const putInPoolCustomerRemindCountRef = ref (0 )
47
50
const checkContractCountRef = ref (0 )
@@ -52,61 +55,75 @@ const endContractCountRef = ref(0)
52
55
const leftSides = ref ([
53
56
{
54
57
name: ' 今日需联系客户' ,
55
- infoType : ' todayCustomer' ,
56
- msgCount : todayCustomerCountRef
58
+ menu : ' todayCustomer' ,
59
+ count : todayCustomerCountRef
57
60
},
58
61
{
59
62
name: ' 分配给我的线索' ,
60
- infoType : ' followLeads ' ,
61
- msgCount: followLeadsCountRef
63
+ menu : ' clueFollow ' ,
64
+ count: clueFollowCount
62
65
},
63
66
{
64
67
name: ' 分配给我的客户' ,
65
- infoType : ' followCustomer' ,
66
- msgCount : followCustomerCountRef
68
+ menu : ' followCustomer' ,
69
+ count : followCustomerCountRef
67
70
},
68
71
{
69
72
name: ' 待进入公海的客户' ,
70
- infoType : ' putInPoolRemind' ,
71
- msgCount : putInPoolCustomerRemindCountRef
73
+ menu : ' putInPoolRemind' ,
74
+ count : putInPoolCustomerRemindCountRef
72
75
},
73
76
{
74
77
name: ' 待审核合同' ,
75
- infoType : ' checkContract' ,
76
- msgCount : checkContractCountRef
78
+ menu : ' checkContract' ,
79
+ count : checkContractCountRef
77
80
},
78
81
{
79
82
name: ' 待审核回款' ,
80
- infoType : ' checkReceivables' ,
81
- msgCount : checkReceivablesCountRef
83
+ menu : ' checkReceivables' ,
84
+ count : checkReceivablesCountRef
82
85
},
83
86
{
84
87
name: ' 待回款提醒' ,
85
- infoType : ' remindReceivables' ,
86
- msgCount : remindReceivablesCountRef
88
+ menu : ' remindReceivables' ,
89
+ count : remindReceivablesCountRef
87
90
},
88
91
{
89
92
name: ' 即将到期的合同' ,
90
- infoType : ' endContract' ,
91
- msgCount : endContractCountRef
93
+ menu : ' endContract' ,
94
+ count : endContractCountRef
92
95
}
93
96
])
94
97
95
98
/** 侧边点击 */
96
99
const sideClick = (item : any ) => {
97
- leftType .value = item .infoType
100
+ leftMenu .value = item .menu
101
+ }
102
+
103
+ const getCount = () => {
104
+ BacklogApi .getTodayCustomerCount ().then ((count ) => (todayCustomerCountRef .value = count ))
105
+ ClueApi .getFollowClueCount ().then ((count ) => (clueFollowCount .value = count ))
106
+ BacklogApi .getClueFollowListCount ().then ((count ) => (clueFollowCount .value = count ))
107
+ BacklogApi .getFollowCustomerCount ().then ((count ) => (followCustomerCountRef .value = count ))
108
+ BacklogApi .getPutInPoolCustomerRemindCount ().then (
109
+ (count ) => (putInPoolCustomerRemindCountRef .value = count )
110
+ )
111
+ BacklogApi .getCheckContractCount ().then ((count ) => (checkContractCountRef .value = count ))
112
+ BacklogApi .getCheckReceivablesCount ().then ((count ) => (checkReceivablesCountRef .value = count ))
113
+ BacklogApi .getRemindReceivablePlanCount ().then (
114
+ (count ) => (remindReceivablesCountRef .value = count )
115
+ )
116
+ BacklogApi .getEndContractCount ().then ((count ) => (endContractCountRef .value = count ))
98
117
}
99
118
100
- /** 加载时读取待办数量 */
119
+ /** 激活时 */
120
+ onActivated (async () => {
121
+ getCount ()
122
+ })
123
+
124
+ /** 初始化 */
101
125
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 )
126
+ getCount ()
110
127
})
111
128
</script >
112
129
0 commit comments