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
       </el-table>
46
       </el-table>
47
 
47
 
48
       <div v-show="!listLoading" class="pagination-container">
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
           :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
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
       </div>
52
       </div>
53
 
53
 
54
       <el-dialog title="創建代理商" :visible.sync="dialogCreateFormVisible" :before-close="handleDialogClose" center>
54
       <el-dialog title="創建代理商" :visible.sync="dialogCreateFormVisible" :before-close="handleDialogClose" center>
91
       downloadLoading: false,
91
       downloadLoading: false,
92
       listQuery: {
92
       listQuery: {
93
         page: 1,
93
         page: 1,
94
-        limit: 20,
94
+        limit: 9999999,
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(),
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
         // endAt: moment.utc(moment().day('sunday').hour(12).minute(0).second(0).day(7).hour(11).minute(59).second(59)).format()
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
       'SetVisible',
126
       'SetVisible',
127
       'SetData',
127
       'SetData',
128
     ]),
128
     ]),
129
-    getList() {
129
+    async getList() {
130
       this.listLoading = true
130
       this.listLoading = true
131
-      fetchList(this.listQuery).then(response => {
131
+      await fetchList(this.listQuery).then(response => {
132
 
132
 
133
         response.data.rows.map(agent => {
133
         response.data.rows.map(agent => {
134
           let combine = []
134
           let combine = []
135
           this.list = []   
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
             console.log('response' , response.data.all)
137
             console.log('response' , response.data.all)
138
             this.list.push({
138
             this.list.push({
139
               // id: agent.GambleMember.id,
139
               // id: agent.GambleMember.id,
143
               // },
143
               // },
144
               id: agent.GambleMember.id,
144
               id: agent.GambleMember.id,
145
               name: agent.GambleMember.name.slice(19),
145
               name: agent.GambleMember.name.slice(19),
146
+              createdAt: agent.GambleMember.createdAt,
146
               feeRatio: response.data.feeRatio,
147
               feeRatio: response.data.feeRatio,
147
               all: response.data.all,
148
               all: response.data.all,
148
               all70: response.data.all70
149
               all70: response.data.all70
215
           //   this.listLoading = false
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
         this.listLoading = false
225
         this.listLoading = false
220
       })
226
       })
221
     },
227
     },
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
     handleDialogClose() {
293
     handleDialogClose() {
288
       this.dialogCreateFormVisible = false;
294
       this.dialogCreateFormVisible = false;
289
     },
295
     },