|
@@ -25,10 +25,7 @@
|
25
|
25
|
</el-form-item>
|
26
|
26
|
<el-form-item label="客户来源">
|
27
|
27
|
<el-select v-model="formInline.customerSource " clearable placeholder="请选择">
|
28
|
|
- <el-option label="自然" value="109" />
|
29
|
|
- <el-option label="自拓" value="110"/>
|
30
|
|
- <el-option label="自渠" value="111"/>
|
31
|
|
- <el-option label="老客" value="112"/>
|
|
28
|
+ <el-option :label="item.label" :value="item.id" v-for="item in sysDict['customerSourceDict']" :key="item.id" />
|
32
|
29
|
</el-select>
|
33
|
30
|
</el-form-item>
|
34
|
31
|
<el-form-item label="姓名">
|
|
@@ -40,15 +37,14 @@
|
40
|
37
|
<el-form-item label="接待人">
|
41
|
38
|
<el-input v-model="formInline.receiver" placeholder="输入接待人"></el-input>
|
42
|
39
|
</el-form-item>
|
43
|
|
- </el-form-item>
|
|
40
|
+ <el-form-item>
|
44
|
41
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
45
|
42
|
<el-button type="info" @click="clear">重置</el-button>
|
46
|
43
|
</el-form-item>
|
|
44
|
+ <el-form-item style="float: right; margin-right: 50px;">
|
|
45
|
+ <a style="text-decoration: none" :href="exportExcelUrl">导出</a>
|
|
46
|
+ </el-form-item>
|
47
|
47
|
</el-form>
|
48
|
|
- <div style="height:70px;line-height:70px">
|
49
|
|
- <a href="excel/usherListExcel">导出</a>
|
50
|
|
- <el-button type="primary" @click="outPut" style="float:right"></el-button>
|
51
|
|
- </div>
|
52
|
48
|
<el-table
|
53
|
49
|
:data="dailyList.records"
|
54
|
50
|
border>
|
|
@@ -57,7 +53,7 @@
|
57
|
53
|
label="客户类型"
|
58
|
54
|
align='center'>
|
59
|
55
|
<template slot-scope="scope">
|
60
|
|
- <!-- <span>{{ scope.row.customerType =='channel'? '渠道客户':'自销客户' }}</span> -->
|
|
56
|
+ <span>{{ scope.row.customerType =='channel'? '渠道客户':'自销客户' }}</span>
|
61
|
57
|
</template>
|
62
|
58
|
</el-table-column>
|
63
|
59
|
<el-table-column
|
|
@@ -69,11 +65,17 @@
|
69
|
65
|
prop="phone"
|
70
|
66
|
label="手机号"
|
71
|
67
|
align='center'>
|
|
68
|
+ <template slot-scope="scope">
|
|
69
|
+ <span>{{ mixinPhone(scope.row.phone) }}</span>
|
|
70
|
+ </template>
|
72
|
71
|
</el-table-column>
|
73
|
72
|
<el-table-column
|
74
|
73
|
prop="personNum"
|
75
|
74
|
label="来访人数"
|
76
|
75
|
align='center'>
|
|
76
|
+ <template slot-scope="scope">
|
|
77
|
+ <span>{{ filterPersonNum(scope.row.personNum) }}</span>
|
|
78
|
+ </template>
|
77
|
79
|
</el-table-column>
|
78
|
80
|
<el-table-column
|
79
|
81
|
align='center'
|
|
@@ -89,7 +91,7 @@
|
89
|
91
|
label="客户来源"
|
90
|
92
|
align='center'>
|
91
|
93
|
<template slot-scope="scope">
|
92
|
|
- <span>{{ scope.row.customerSource |filterCustomerSource }}</span>
|
|
94
|
+ <span>{{ filterCustomerSource(scope.row.customerSource) }}</span>
|
93
|
95
|
</template>
|
94
|
96
|
</el-table-column>
|
95
|
97
|
<el-table-column
|
|
@@ -109,20 +111,23 @@
|
109
|
111
|
</el-table-column>
|
110
|
112
|
</el-table>
|
111
|
113
|
<el-pagination
|
112
|
|
- style="margin-top:50px;float:right"
|
113
|
|
- @size-change="handleSizeChange"
|
114
|
|
- @current-change="handleCurrentChange"
|
115
|
|
- :current-page="formInline.pageNum"
|
116
|
|
- :page-sizes="[1,10, 20, 30, 40]"
|
117
|
|
- :page-size="formInline.pageSize"
|
118
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
119
|
|
- :total="dailyList.total || 0">
|
|
114
|
+ style="margin-top:50px;float:right"
|
|
115
|
+ @size-change="handleSizeChange"
|
|
116
|
+ @current-change="handleCurrentChange"
|
|
117
|
+ :current-page="formInline.pageNum"
|
|
118
|
+ :page-sizes="[1,10, 20, 30, 40]"
|
|
119
|
+ :page-size="formInline.pageSize"
|
|
120
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
121
|
+ :total="dailyList.total || 0">
|
120
|
122
|
</el-pagination>
|
121
|
123
|
</div>
|
122
|
124
|
</template>
|
123
|
125
|
|
124
|
126
|
<script>
|
|
127
|
+import dayjs from 'dayjs'
|
125
|
128
|
import { createNamespacedHelpers } from 'vuex'
|
|
129
|
+import { mixinPhone } from '../../utils'
|
|
130
|
+
|
126
|
131
|
const {mapState: mapDailyRegistrationState, mapActions: mapDailyRegistrationActions } = createNamespacedHelpers('dailyRegistration')
|
127
|
132
|
|
128
|
133
|
export default {
|
|
@@ -130,8 +135,8 @@ export default {
|
130
|
135
|
data() {
|
131
|
136
|
return {
|
132
|
137
|
formInline: {
|
133
|
|
- startTime :'',
|
134
|
|
- endTime :'',
|
|
138
|
+ startTime : dayjs().hour(0).minute(0).second(0).toDate(),
|
|
139
|
+ endTime : new Date(),
|
135
|
140
|
personName: '',
|
136
|
141
|
phone: '',
|
137
|
142
|
customerType: '',
|
|
@@ -146,29 +151,29 @@ export default {
|
146
|
151
|
...mapDailyRegistrationState({
|
147
|
152
|
dailyList: x => x.dailyList,
|
148
|
153
|
excelList: x => x.excelList
|
149
|
|
- })
|
|
154
|
+ }),
|
|
155
|
+ sysDict () {
|
|
156
|
+ return this.$store.state.sysDict
|
|
157
|
+ },
|
|
158
|
+ queryFitlers () {
|
|
159
|
+ return {
|
|
160
|
+ ...this.formInline,
|
|
161
|
+ startTime: dayjs(this.formInline.startTime).format('YYYY-MM-DDT00:00:00Z'),
|
|
162
|
+ endTime: dayjs(this.formInline.endTime).format('YYYY-MM-DDT23:59:59Z'),
|
|
163
|
+ }
|
|
164
|
+ },
|
|
165
|
+ exportExcelUrl() {
|
|
166
|
+ const queryString = Object.keys(this.queryFitlers).map((k) => {
|
|
167
|
+ return `${k}=${encodeURIComponent(this.queryFitlers[k])}`
|
|
168
|
+ }).join('&')
|
|
169
|
+
|
|
170
|
+ return `${window.location.origin}/api/excel/usherListExcel?${queryString}`
|
|
171
|
+ // return `http://127.0.0.1:8080/excel/usherListExcel?${queryString}`
|
|
172
|
+ },
|
150
|
173
|
},
|
151
|
174
|
created() {
|
152
|
175
|
this.getPage()
|
153
|
176
|
},
|
154
|
|
- filters:{
|
155
|
|
- filterCustomerSource(val){
|
156
|
|
- if(val=='109'){
|
157
|
|
- return '自然'
|
158
|
|
- }
|
159
|
|
- else if(val=='110'){
|
160
|
|
- return '自拓'
|
161
|
|
- }
|
162
|
|
- else if(val=='111'){
|
163
|
|
- return '自渠'
|
164
|
|
- }
|
165
|
|
- else if(val=='112'){
|
166
|
|
- return '老客'
|
167
|
|
- }else{
|
168
|
|
- return
|
169
|
|
- }
|
170
|
|
- }
|
171
|
|
- },
|
172
|
177
|
methods: {
|
173
|
178
|
...mapDailyRegistrationActions([
|
174
|
179
|
'getDailyRegistration',
|
|
@@ -179,12 +184,8 @@ export default {
|
179
|
184
|
this.formInline.pageSize = 10
|
180
|
185
|
this.getPage()
|
181
|
186
|
},
|
182
|
|
- outPut(){
|
183
|
|
- this.getUsherListExcel(this.formInline)
|
184
|
|
- },
|
185
|
187
|
getPage() {
|
186
|
|
- this.getDailyRegistration(this.formInline)
|
187
|
|
-
|
|
188
|
+ this.getDailyRegistration(this.queryFitlers)
|
188
|
189
|
},
|
189
|
190
|
handleSizeChange(val) {
|
190
|
191
|
// console.log(`每页 ${val} 条`)
|
|
@@ -203,6 +204,15 @@ export default {
|
203
|
204
|
return ''
|
204
|
205
|
}
|
205
|
206
|
},
|
|
207
|
+ mixinPhone (phone) {
|
|
208
|
+ return mixinPhone(phone)
|
|
209
|
+ },
|
|
210
|
+ filterCustomerSource(val){
|
|
211
|
+ return (this.sysDict['customerSourceDict'].filter(x => x.id == val)[0] || {}).label
|
|
212
|
+ },
|
|
213
|
+ filterPersonNum(val) {
|
|
214
|
+ return (this.sysDict['NUMBER_OF_VISITORS'].filter(x => x.id == val)[0] || {}).label
|
|
215
|
+ },
|
206
|
216
|
clear(){
|
207
|
217
|
this.formInline.personName = ''
|
208
|
218
|
this.formInline.phone = ''
|