|
@@ -0,0 +1,206 @@
|
|
1
|
+<template>
|
|
2
|
+ <div id="sys-user-list" class="app-container">
|
|
3
|
+ <div class="filter-container">
|
|
4
|
+ <el-input v-model="listQuery.name" placeholder="请输入昵称" clearable style="width: 160px" />
|
|
5
|
+ <el-input v-model="listQuery.phone" placeholder="请输入手机号" clearable style="width: 160px" />
|
|
6
|
+ <el-input v-model="listQuery.idCard" placeholder="请输入身份证号" clearable style="width: 160px" />
|
|
7
|
+ <el-button v-waves type="primary" icon="el-icon-search" style="width: 115px;" @click="handleFilter">搜索</el-button>
|
|
8
|
+ </div>
|
|
9
|
+
|
|
10
|
+ <el-table
|
|
11
|
+ :key="tableKey"
|
|
12
|
+ v-loading="listLoading"
|
|
13
|
+ :data="list"
|
|
14
|
+ border
|
|
15
|
+ fit
|
|
16
|
+ highlight-current-row
|
|
17
|
+ style="width: 100%;"
|
|
18
|
+ @sort-change="sortChange"
|
|
19
|
+ >
|
|
20
|
+ <el-table-column label="客户编号" min-width="100px" align="center">
|
|
21
|
+ <template slot-scope="{row}">
|
|
22
|
+ <span>{{ row.customerId }}</span>
|
|
23
|
+ </template>
|
|
24
|
+ </el-table-column>
|
|
25
|
+ <el-table-column label="昵称" min-width="100px" align="center">
|
|
26
|
+ <template slot-scope="{row}">
|
|
27
|
+ <span>{{ row.name }}</span>
|
|
28
|
+ </template>
|
|
29
|
+ </el-table-column>
|
|
30
|
+ <el-table-column label="头像" width="80px" align="center">
|
|
31
|
+ <template slot-scope="{row}">
|
|
32
|
+ <img :src="row.avatar" alt="" style="width: 34px; max-height: 34px; vertical-align: middle;">
|
|
33
|
+ </template>
|
|
34
|
+ </el-table-column>
|
|
35
|
+ <el-table-column label="手机" min-width="110px" align="center">
|
|
36
|
+ <template slot-scope="{row}">
|
|
37
|
+ <span>{{ row.phone }}</span>
|
|
38
|
+ </template>
|
|
39
|
+ </el-table-column>
|
|
40
|
+ <el-table-column label="身份证" min-width="110px" align="center">
|
|
41
|
+ <template slot-scope="{row}">
|
|
42
|
+ <span>{{ row.idCard }}</span>
|
|
43
|
+ </template>
|
|
44
|
+ </el-table-column>
|
|
45
|
+ <el-table-column label="推荐店铺" min-width="110px" align="center">
|
|
46
|
+ <template slot-scope="{row}">
|
|
47
|
+ <span>{{ row.recShopName }}</span>
|
|
48
|
+ </template>
|
|
49
|
+ </el-table-column>
|
|
50
|
+ <el-table-column label="创建时间" prop="createTime" min-width="160px" align="center">
|
|
51
|
+ <template slot-scope="{row}">
|
|
52
|
+ <span>{{ row.createDate }}</span>
|
|
53
|
+ </template>
|
|
54
|
+ </el-table-column>
|
|
55
|
+ </el-table>
|
|
56
|
+
|
|
57
|
+ <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageIndex" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
58
|
+
|
|
59
|
+ </div>
|
|
60
|
+</template>
|
|
61
|
+
|
|
62
|
+<script>
|
|
63
|
+ import waves from '@/directive/waves'
|
|
64
|
+ import Pagination from '@/components/Pagination'
|
|
65
|
+ import customerApi from '@/api/lottery/customer-api'
|
|
66
|
+
|
|
67
|
+ const stateEnum = { 0: '待审核', 1: '已审核', 2: '审核不通过' }
|
|
68
|
+ const statusOptions = [
|
|
69
|
+ { label: '已审核', value: 1 },
|
|
70
|
+ { label: '待审核', value: 0 },
|
|
71
|
+ { label: '审核不通过', value: 2 }
|
|
72
|
+ ]
|
|
73
|
+
|
|
74
|
+ export default {
|
|
75
|
+ name: 'shopLotteryList',
|
|
76
|
+ components: { Pagination },
|
|
77
|
+ directives: { waves },
|
|
78
|
+ filters: {
|
|
79
|
+ statusFilter(state) {
|
|
80
|
+ return stateEnum[state];
|
|
81
|
+ }
|
|
82
|
+ },
|
|
83
|
+ data() {
|
|
84
|
+ return {
|
|
85
|
+ tableKey: 0,
|
|
86
|
+ list: null,
|
|
87
|
+ total: 0,
|
|
88
|
+ listLoading: true,
|
|
89
|
+ sortColumn: 'customer_id',
|
|
90
|
+ sortAsc: false,
|
|
91
|
+ listQuery: {
|
|
92
|
+ pageIndex: 1,
|
|
93
|
+ pageSize: 10,
|
|
94
|
+ phone: null,
|
|
95
|
+ idCard: null,
|
|
96
|
+ name: null,
|
|
97
|
+ pageSorts: []
|
|
98
|
+ },
|
|
99
|
+ statusOptions,
|
|
100
|
+ tableColumnChecked: null
|
|
101
|
+ }
|
|
102
|
+ },
|
|
103
|
+ created() {
|
|
104
|
+ this.setDefaultSort()
|
|
105
|
+ this.getList()
|
|
106
|
+ },
|
|
107
|
+ methods: {
|
|
108
|
+ getList() {
|
|
109
|
+ this.listLoading = true
|
|
110
|
+ customerApi.getPageList(this.listQuery).then(response => {
|
|
111
|
+ this.list = response.data.records
|
|
112
|
+ this.total = response.data.total
|
|
113
|
+ this.listLoading = false
|
|
114
|
+ });
|
|
115
|
+ },
|
|
116
|
+
|
|
117
|
+ handleFilter() {
|
|
118
|
+ this.listQuery.pageIndex = 1
|
|
119
|
+ this.getList()
|
|
120
|
+ },
|
|
121
|
+ setDefaultSort() {
|
|
122
|
+ // 设置默认排序
|
|
123
|
+ this.listQuery.pageSorts = [{
|
|
124
|
+ column: this.sortColumn,
|
|
125
|
+ asc: this.sortAsc
|
|
126
|
+ }]
|
|
127
|
+ },
|
|
128
|
+ sortChange(data) {
|
|
129
|
+ const { prop, order } = data
|
|
130
|
+ if (prop === 'createTime') {
|
|
131
|
+ this.sortColumn = 'create_time'
|
|
132
|
+ } else {
|
|
133
|
+ this.sortColumn = prop
|
|
134
|
+ }
|
|
135
|
+ this.sortAsc = order === 'ascending'
|
|
136
|
+ this.listQuery.pageSorts = [{
|
|
137
|
+ column: this.sortColumn,
|
|
138
|
+ asc: this.sortAsc
|
|
139
|
+ }]
|
|
140
|
+ this.handleFilter()
|
|
141
|
+ },
|
|
142
|
+ getSortClass: function(key) {
|
|
143
|
+ if (this.sortColumn === key) {
|
|
144
|
+ return this.sortAsc ? 'ascending' : 'descending'
|
|
145
|
+ } else {
|
|
146
|
+ return ''
|
|
147
|
+ }
|
|
148
|
+ },
|
|
149
|
+ handUpdate(id, username) {
|
|
150
|
+ this.$confirm('您确定要删除 ' + username + ' ?', '删除提示', {
|
|
151
|
+ confirmButtonText: '确定',
|
|
152
|
+ cancelButtonText: '取消',
|
|
153
|
+ type: 'warning'
|
|
154
|
+ }).then(() => {
|
|
155
|
+ sysUserApi.delete(id).then(response => {
|
|
156
|
+ this.$message({
|
|
157
|
+ type: 'success',
|
|
158
|
+ message: '删除成功!'
|
|
159
|
+ });
|
|
160
|
+ this.handleFilter();
|
|
161
|
+ })
|
|
162
|
+ });
|
|
163
|
+ }
|
|
164
|
+ }
|
|
165
|
+ }
|
|
166
|
+</script>
|
|
167
|
+
|
|
168
|
+<style lang="scss">
|
|
169
|
+ #sys-user-list .el-table th, .el-table td{
|
|
170
|
+ padding: 6px 0px;
|
|
171
|
+ }
|
|
172
|
+
|
|
173
|
+ #sys-user-list .filter-container {
|
|
174
|
+ padding-bottom: 10px;
|
|
175
|
+ }
|
|
176
|
+
|
|
177
|
+ #sys-user-list .filter-container .tree-select-item{
|
|
178
|
+ width: 120px;
|
|
179
|
+ display: inline-block;
|
|
180
|
+ vertical-align: top;
|
|
181
|
+ margin-right: 4px;
|
|
182
|
+ }
|
|
183
|
+
|
|
184
|
+ #sys-user-list .input-with-select {
|
|
185
|
+ vertical-align: top;
|
|
186
|
+ width: 505px;
|
|
187
|
+ margin-right: 4px;
|
|
188
|
+ }
|
|
189
|
+
|
|
190
|
+ #sys-user-list .input-with-select .el-select .el-input {
|
|
191
|
+ width: 120px;
|
|
192
|
+ }
|
|
193
|
+
|
|
194
|
+ #sys-user-list .input-with-select .el-input-group__prepend {
|
|
195
|
+ background-color: #fff;
|
|
196
|
+ }
|
|
197
|
+
|
|
198
|
+ #sys-user-list .filter-item {
|
|
199
|
+ margin-right: 4px;
|
|
200
|
+ }
|
|
201
|
+
|
|
202
|
+ #sys-user-list .el-table__body .operation .cell {
|
|
203
|
+ text-align: center;
|
|
204
|
+ }
|
|
205
|
+
|
|
206
|
+</style>
|