mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
pagination for admin booking table
This commit is contained in:
@@ -47,6 +47,15 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-row>
|
||||
<div align="right">
|
||||
<el-button type="primary" size="mini" @click="fetchPaginateBooking(pagination.prev_page_url)" :disabled="!pagination.prev_page_url">
|
||||
Previous
|
||||
</el-button>
|
||||
<span>Page {{pagination.current_page}} of {{pagination.last_page}}</span>
|
||||
<el-button type="primary" size="mini" @click="fetchPaginateBooking(pagination.next_page_url)" :disabled="!pagination.next_page_url">
|
||||
Next
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- Booking Table-end -->
|
||||
</div>
|
||||
</template>
|
||||
@@ -59,9 +68,10 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
status: null,
|
||||
pagination: [],
|
||||
bookingTable: [
|
||||
],
|
||||
url: 'api/admin/booking',
|
||||
url: 'api/admin/booking',
|
||||
loading_btn: false,
|
||||
}
|
||||
},
|
||||
@@ -80,7 +90,7 @@ export default {
|
||||
this.loading_btn = true
|
||||
axios.get(this.url).then(response => {
|
||||
this.loading_btn = false;
|
||||
this.bookingTable = response.data
|
||||
this.bookingTable = response.data.data
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Booking is updated',
|
||||
@@ -89,6 +99,20 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
makePagination(data){
|
||||
let pagination ={
|
||||
current_page: data.current_page,
|
||||
last_page: data.last_page,
|
||||
next_page_url: data.next_page_url,
|
||||
prev_page_url: data.prev_page_url
|
||||
}
|
||||
this.pagination = pagination
|
||||
console.log(this.pagination)
|
||||
},
|
||||
fetchPaginateBooking(url) {
|
||||
this.url = url
|
||||
this.getBooking()
|
||||
},
|
||||
filterHandlerStatus (value, row, column) {
|
||||
const status = row.track_status;
|
||||
if(value ==="Success")
|
||||
|
||||
Reference in New Issue
Block a user