Explorar el Código

彩民管理,彩种管理列表完成

傅行帆 hace 4 años
padre
commit
778b8ca93e

+ 20
- 0
src/api/lottery/customer-api.js Ver fichero

@@ -0,0 +1,20 @@
1
+import request from '@/utils/request'
2
+
3
+const customerApi = {
4
+
5
+}
6
+
7
+/**
8
+ * 获取系统用户分页列表
9
+ * @param data
10
+ * @returns {AxiosPromise}
11
+ */
12
+customerApi.getPageList = data => {
13
+  return request({
14
+    url: '/taCustomer/getPageList',
15
+    method: 'post',
16
+    data
17
+  })
18
+}
19
+
20
+export default customerApi

+ 20
- 0
src/api/lottery/lottery-api.js Ver fichero

@@ -0,0 +1,20 @@
1
+import request from '@/utils/request'
2
+
3
+const lotteryApi = {
4
+
5
+}
6
+
7
+/**
8
+ * 获取系统用户分页列表
9
+ * @param data
10
+ * @returns {AxiosPromise}
11
+ */
12
+lotteryApi.getPageList = data => {
13
+  return request({
14
+    url: '/tdLottery/getPageList',
15
+    method: 'post',
16
+    data
17
+  })
18
+}
19
+
20
+export default lotteryApi

+ 14
- 14
src/router/index.js Ver fichero

@@ -156,23 +156,23 @@ export const asyncRoutes = [
156 156
     },
157 157
     children: [
158 158
       {
159
-        path: 'manage-lottery-list',
159
+        path: 'shop-lottery-list',
160 160
         component: () => import('@/views/lottery/shop/shop-lottery-list'),
161 161
         name: 'shopLotteryList',
162 162
         meta: { title: '彩票站管理', icon: 'edit' }
163
-      }
164
-      // {
165
-      //   path: 'manage-lottery-list',
166
-      //   component: () => import('@/views/lottery/manage/manage-lottery-list'),
167
-      //   name: 'manageLotteryList',
168
-      //   meta: { title: '彩种管理', icon: 'edit' }
169
-      // },
170
-      // {
171
-      //   path: 'manage-lottery-list2',
172
-      //   component: () => import('@/views/lottery/manage/manage-lottery-list'),
173
-      //   name: 'manageLotteryList2',
174
-      //   meta: { title: '彩票站彩种管理', icon: 'edit' }
175
-      // },
163
+      },
164
+      {
165
+        path: 'manage-lottery-list',
166
+        component: () => import('@/views/lottery/manage/manage-lottery-list'),
167
+        name: 'manageLotteryList',
168
+        meta: { title: '彩种管理', icon: 'edit' }
169
+      },
170
+      {
171
+        path: 'customer-lottery-list',
172
+        component: () => import('@/views/lottery/customer/customer-lottery-list'),
173
+        name: 'customerLotteryList2',
174
+        meta: { title: '彩民管理', icon: 'edit' }
175
+      },
176 176
     ]
177 177
   },
178 178
   // 404 page must be placed at the end !!!

+ 206
- 0
src/views/lottery/customer/customer-lottery-list.vue Ver fichero

@@ -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>

+ 192
- 0
src/views/lottery/manage/manage-lottery-list.vue Ver fichero

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

+ 1
- 1
src/views/lottery/shop/shop-lottery-list.vue Ver fichero

@@ -73,7 +73,7 @@
73 73
   ]
74 74
 
75 75
   export default {
76
-    name: 'SysUserList',
76
+    name: 'shopLotteryList',
77 77
     components: { Pagination },
78 78
     directives: { waves },
79 79
     filters: {