monitor.vue
5.18 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
204
205
206
207
208
<template>
<Card>
<div class="search">
<el-form
class="count-form"
ref="ruleForm"
size="mini"
inline
:model="ruleForm"
>
<el-form-item label="营销员姓名" prop="username">
<el-input
v-model.trim="ruleForm.username"
placeholder="请输入营销员姓名"
maxlength="21"
>
<i slot="prefix" class="el-icon-search"></i
></el-input>
</el-form-item>
<el-form-item label="营销员工号" prop="userId">
<el-input
v-model.trim="ruleForm.userId"
placeholder="请输入营销员工号"
maxlength="21"
>
<i slot="prefix" class="el-icon-search"></i
></el-input>
</el-form-item>
<el-form-item label="展业开始时间" prop="times">
<el-date-picker
v-model="ruleForm.times"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
</el-form>
</div>
<div class="flex-end mb10">
<el-button type="primary" size="mini" @click="handleQueryOrderList"
>查询</el-button
>
<el-button size="mini" @click="onReset">重置</el-button>
</div>
<el-table
class="mb10"
:data="tableData"
border
style="width: 100%"
v-loading="loading"
>
<el-table-column
type="index"
label="序号"
fixed
:index="pagination && (pagination.page - 1) * pagination.size + 1"
>
</el-table-column>
<el-table-column
align="center"
prop="custName"
label="客户姓名"
width="160"
>
</el-table-column>
<el-table-column
align="center"
prop="custTel"
label="客户手机号"
width="160"
>
</el-table-column>
<el-table-column align="center" prop="userName" label="营销员姓名">
</el-table-column>
<el-table-column align="center" prop="userId" label="营销员工号">
</el-table-column>
<el-table-column align="center" label="展业时长" width="160">
<template v-slot="scope">
{{ parseTimeSecond(scope.row.communicationTime * 1000 - 0) }}
</template>
</el-table-column>
<el-table-column align="center" label="展业开始时间">
<template v-slot="scope">
{{ parseTime(scope.row.startTime) }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right">
<template v-slot="scope">
<div>
<el-button type="text" size="small" @click="handleDetail(scope.row)"
>查看</el-button
>
</div>
</template>
</el-table-column>
</el-table>
<FooterPaginationfrom
@pager="handleGetPager"
:total="total"
></FooterPaginationfrom>
</Card>
</template>
<script>
import FooterPaginationfrom from './components/FooterPagination'
import { parseTime, parseTimeSecond } from '@/utils/util'
import { getResourceMonitorList } from '@/api/monitor'
export default {
components: {
FooterPaginationfrom
},
data() {
return {
parseTime,
parseTimeSecond,
ruleForm: {
username: '',
userId: '',
times: ['', '']
},
tableData: [],
pagination: null,
loading: false,
total: 0
}
},
methods: {
async handleGetResourceMonitorList() {
try {
const {
result: { list, total }
} = await getResourceMonitorList({
username: this.ruleForm.username,
userId: this.ruleForm.userId,
startTime: this.ruleForm.times ? this.ruleForm.times[0] : '',
endTime: this.ruleForm.times ? this.ruleForm.times[1] : '',
pageNo: this.pagination.page,
row: this.pagination.size
})
this.tableData = list
this.total = total
} catch (error) {
console.log(error)
}
},
onReset() {
this.ruleForm = {
username: '',
userId: '',
times: ['', '']
}
this.handleQueryOrderList()
},
handleGetPager(data) {
this.pagination = data
this.handleQueryOrderList()
},
async handleQueryOrderList() {
try {
this.loading = true
await this.handleGetResourceMonitorList()
} catch (error) {
console.log(error)
} finally {
this.loading = false
}
},
handleDetail(row) {
this.$router.push({
path: 'monitor-details',
query: { ...row }
})
}
}
}
</script>
<style lang="scss" scoped>
.search {
.count-form {
margin-top: 20px;
margin-left: 20px;
}
}
.status {
display: flex;
justify-content: center;
align-items: center;
.dot {
margin-right: 6px;
display: inline-block;
width: 4px;
height: 4px;
border-radius: 50%;
background-color: #34c780;
}
.yellow {
background-color: #ffaa00;
}
}
.flex-end {
display: flex;
justify-content: flex-end;
}
</style>