Browse Source

agent display

bucket 6 years ago
parent
commit
17df7d9c52
1 changed files with 25 additions and 19 deletions
  1. 25 19
      src/views/agnetManagement/index.vue

+ 25 - 19
src/views/agnetManagement/index.vue

@@ -46,9 +46,9 @@
46 46
       </el-table>
47 47
 
48 48
       <div v-show="!listLoading" class="pagination-container">
49
-        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
49
+        <!-- <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
50 50
           :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
51
-        </el-pagination>
51
+        </el-pagination> -->
52 52
       </div>
53 53
 
54 54
       <el-dialog title="創建代理商" :visible.sync="dialogCreateFormVisible" :before-close="handleDialogClose" center>
@@ -91,7 +91,7 @@ export default {
91 91
       downloadLoading: false,
92 92
       listQuery: {
93 93
         page: 1,
94
-        limit: 20,
94
+        limit: 9999999,
95 95
         // startAt: moment.utc(moment().day('sunday').hour(12).minute(0).second(0).subtract(1, 'weeks').day(7).hour(16).minute(0).second(0)).format(),
96 96
         // endAt: moment.utc(moment().day('sunday').hour(12).minute(0).second(0).day(7).hour(11).minute(59).second(59)).format()
97 97
       },
@@ -126,14 +126,14 @@ export default {
126 126
       'SetVisible',
127 127
       'SetData',
128 128
     ]),
129
-    getList() {
129
+    async getList() {
130 130
       this.listLoading = true
131
-      fetchList(this.listQuery).then(response => {
131
+      await fetchList(this.listQuery).then(response => {
132 132
 
133 133
         response.data.rows.map(agent => {
134 134
           let combine = []
135 135
           this.list = []   
136
-          this.visible.firstLayer === true ?  fetchGroupAll(agent, this.listQuery).then(response => {
136
+          this.visible.firstLayer === true ? fetchGroupAll(agent, this.listQuery).then(response => {
137 137
             console.log('response' , response.data.all)
138 138
             this.list.push({
139 139
               // id: agent.GambleMember.id,
@@ -143,6 +143,7 @@ export default {
143 143
               // },
144 144
               id: agent.GambleMember.id,
145 145
               name: agent.GambleMember.name.slice(19),
146
+              createdAt: agent.GambleMember.createdAt,
146 147
               feeRatio: response.data.feeRatio,
147 148
               all: response.data.all,
148 149
               all70: response.data.all70
@@ -215,7 +216,12 @@ export default {
215 216
           //   this.listLoading = false
216 217
           // })
217 218
         })
218
-        this.total = response.data.count
219
+        this.list.sort(function compare(a, b) {
220
+          const dateA = new Date(a.createdAt);
221
+          const dateB = new Date(b.createdAt);
222
+          return  dateB - dateA;
223
+        })
224
+        // this.total = response.data.count
219 225
         this.listLoading = false
220 226
       })
221 227
     },
@@ -272,18 +278,18 @@ export default {
272 278
         }
273 279
       }))
274 280
     },
275
-    handleFilter() {
276
-      this.listQuery.page = 1
277
-      this.getList()
278
-    },
279
-    handleSizeChange(val) {
280
-      this.listQuery.limit = val
281
-      this.getList()
282
-    },
283
-    handleCurrentChange(val) {
284
-      this.listQuery.page = val
285
-      this.getList()
286
-    },
281
+    // handleFilter() {
282
+    //   this.listQuery.page = 1
283
+    //   this.getList()
284
+    // },
285
+    // handleSizeChange(val) {
286
+    //   this.listQuery.limit = val
287
+    //   this.getList()
288
+    // },
289
+    // handleCurrentChange(val) {
290
+    //   this.listQuery.page = val
291
+    //   this.getList()
292
+    // },
287 293
     handleDialogClose() {
288 294
       this.dialogCreateFormVisible = false;
289 295
     },