statistics.vue
5.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<template>
<div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card">
<div class="g-card-title">导入记录</div>
<el-table v-loading="importLoading" :data="importList" max-height="600">
<el-table-column
label="导入表格名称"
align="center"
prop="tableExcelName"
min-width="180px"
show-overflow-tooltip />
<el-table-column label="导入客户总数" align="center" prop="cutomerTotalNum" show-overflow-tooltip />
<el-table-column
label="导入时间"
align="center"
prop="createTime"
show-overflow-tooltip
width="180"></el-table-column>
<el-table-column label="分配员工" align="center" prop="addUserName" show-overflow-tooltip />
<el-table-column label="待添加客户数" align="center" prop="waitAddCustomerNum"></el-table-column>
<el-table-column label="待通过客户数" align="center" prop="waitPassCustomerNum"></el-table-column>
<el-table-column label="已添加客户数" align="center" prop="addCustomerNum" show-overflow-tooltip />
<el-table-column label="添加完成率" align="center" prop="completionRate" show-overflow-tooltip>
<template slot-scope="{ row }">
<span>{{ row.completionRate }}%</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="importTotal > 0"
:total="importTotal"
:page.sync="importPage.pageNum"
:limit.sync="importPage.pageSize"
@pagination="getImportListFn()" />
</div>
<div class="g-card">
<div class="g-card-title">员工添加统计</div>
<el-table v-loading="addLoading" :data="addList" max-height="600">
<el-table-column label="员工名称" align="center" prop="addUserName" show-overflow-tooltip />
<el-table-column label="分配客户总数" align="center" prop="cutomerTotalNum" show-overflow-tooltip />
<el-table-column
label="待添加客户数"
align="center"
prop="waitAddCustomerNum"
show-overflow-tooltip></el-table-column>
<el-table-column label="待通过客户数" align="center" prop="waitPassCustomerNum" width="180"></el-table-column>
<el-table-column label="已添加客户数" align="center" prop="addCustomerNum" show-overflow-tooltip />
<el-table-column label="添加完成率" align="center" show-overflow-tooltip>
<template slot-scope="{ row }">
<span>{{ row.completionRate }}%</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="addTotal > 0"
:total="addTotal"
:page.sync="addPage.pageNum"
:limit.sync="addPage.pageSize"
@pagination="getAddList()" />
</div>
</div>
</template>
<script>
import moment from 'moment'
import { getTotal, getImportAndStaffList } from '@/api/drainageCode/seas'
export default {
components: {},
data() {
return {
loading: false,
importList: [],
importLoading: false,
importPage: {
groupByType: 1,
pageSize: 10,
pageNum: 1,
},
importTotal: 0,
addList: [],
addLoading: false,
addPage: {
groupByType: 2,
pageSize: 10,
pageNum: 1,
},
addTotal: 0,
cardData: [],
}
},
created() {
this.getTotalFn()
this.getImportListFn()
this.getAddList()
// this.$store.dispatch(
// 'app/setBusininessDesc',
// `
// <div>支持单人、批量单人及多人方式新建员工活码,客户可以通过扫描员工活码添加员工为好友,并支持自动给客户打标签和发送欢迎语。</div>
// `
// )
},
mounted() {},
methods: {
getTotalFn() {
getTotal().then(({ data }) => {
this.cardData = [
{
title: '导入客户总数',
value: data.importCustomerTotalNum,
},
{
title: '已添加客户数',
value: data.addCustomerNum,
},
{
title: '添加完成率',
value: data.completionRate + '%',
},
{
title: '待添加客户数',
value: data.waitAddCustomerNum,
},
{
title: '待通过客户数',
value: data.waitPassCustomerNum,
},
]
})
},
getImportListFn() {
this.importLoading = true
getImportAndStaffList(this.importPage)
.then(({ rows, total }) => {
this.importList = rows
this.importList.forEach((ddd) => {
ddd.createTime = moment(ddd.createTime).format('YYYY-MM-DD HH:mm:SS')
})
this.importTotal = +total
this.importLoading = false
})
.catch(() => {
this.importLoading = false
})
},
getAddList() {
this.addLoading = true
getImportAndStaffList(this.addPage)
.then(({ rows, total }) => {
this.addList = rows
this.addTotal = +total
this.addLoading = false
})
.catch(() => {
this.addLoading = false
})
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .el-tabs__header {
margin-bottom: 0;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.sub-des {
font-size: 12px;
font-weight: 400;
color: #999999;
}
.total-item {
// width: 200px;
padding: 20px;
background: linear-gradient(90deg, #3c89f0 0%, #1364f4 100%);
border-radius: 4px;
.name {
font-size: 14px;
font-weight: 400;
color: #ffffff;
}
.value {
margin-top: 5px;
font-size: 18px;
font-weight: 400;
color: #ffffff;
}
}
</style>