Merge branch 'feature/booking-refresh-button' into 'master'

added the refresh button

See merge request CIEFWorldwideSdnBhd/exchange!53
This commit is contained in:
Jack Goh
2018-07-03 08:17:02 +00:00
2 changed files with 22 additions and 15 deletions
+13 -15
View File
@@ -1,4 +1,7 @@
<template>
<div>
<div align="right">
<el-button icon="el-icon-refresh" type="primary" size="mini" @click="RefreshBooking()">Refresh</el-button></div>
<!-- Booking Table -->
<el-row :gutter="20">
<div>
@@ -41,6 +44,7 @@
</div>
</el-row>
<!-- Booking Table-end -->
</div>
</template>
<script>
@@ -52,26 +56,20 @@ export default {
return {
status: null,
bookingTable: [
]
],
url: 'api/admin/booking',
}
},
mounted () {
axios
.get('/api/admin/booking')
.then((response) => {
console.log(response.data)
this.bookingTable = response.data
// loading.close()
}).catch((error) => {
// console.log(error)
// loading.close()
// this.$router.push({
// name: 'notfound'
// })
})
this.RefreshBooking()
},
methods: {
RefreshBooking() {
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data
})
},
filterTag (value, row) {
return row.tag === value
},
+9
View File
@@ -234,6 +234,8 @@
<br>
<br>
<hr>
<div align="right">
<el-button icon="el-icon-refresh" type="primary" size="mini" @click="RefreshBooking()">Refresh</el-button></div>
<!-- Booking Table -->
<el-row :gutter="20">
<div>
@@ -379,6 +381,7 @@ export default {
},
mounted () {
this.getBooking()
this.RefreshBooking()
},
methods: {
getBooking() {
@@ -389,6 +392,12 @@ export default {
$this.makePagination(response.data)
})
},
RefreshBooking() {
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data.data
})
},
makePagination(data){
let pagination = {
current_page: data.current_page,