mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
git pull origin master
This commit is contained in:
@@ -80,7 +80,7 @@ class BookingController extends Controller
|
||||
$user = Auth::user();
|
||||
$bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->orderby('updated_at','desc')
|
||||
->get();
|
||||
->paginate(10);
|
||||
|
||||
// reformat to fit frontend structure
|
||||
foreach ($bookings as $booking) {
|
||||
|
||||
@@ -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,9 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
status: null,
|
||||
bookingTable: [
|
||||
],
|
||||
url: 'api/admin/booking',
|
||||
bookingTable: [],
|
||||
url: 'api/admin/booking',
|
||||
pagination: {prev_page_url: null},
|
||||
loading_btn: false,
|
||||
}
|
||||
},
|
||||
@@ -69,10 +78,12 @@ export default {
|
||||
this.getBooking()
|
||||
},
|
||||
methods: {
|
||||
getBooking() {
|
||||
getBooking(){
|
||||
let $this = this
|
||||
axios.get(this.url).then(response => {
|
||||
this.bookingTable = response.data
|
||||
this.bookingTable = response.data.data
|
||||
$this.makePagination(response.data)
|
||||
console.log(response)
|
||||
})
|
||||
},
|
||||
RefreshBooking() {
|
||||
@@ -80,7 +91,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 +100,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")
|
||||
|
||||
@@ -203,31 +203,31 @@
|
||||
<tr>
|
||||
<td>+ Service Charges :</td>
|
||||
<td>
|
||||
<b> RM {{ bookingConfirmTable.service_charge }}</b>
|
||||
RM {{ bookingConfirmTable.service_charge }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>/ Rate :</td>
|
||||
<td>
|
||||
<b> {{ bookingConfirmTable.rate }}</b>
|
||||
{{ bookingConfirmTable.rate }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<b> RM {{ bookingConfirmTable.subtotal }}</b>
|
||||
RM {{ bookingConfirmTable.subtotal }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>+ Tax :</td>
|
||||
<td>
|
||||
<b> RM {{ bookingConfirmTable.taxAmount }}</b>
|
||||
RM {{ bookingConfirmTable.taxAmount }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>+ Billing Charge :</td>
|
||||
<td>
|
||||
<b> RM {{ bookingConfirmTable.billingChargeAmount }}</b>
|
||||
RM {{ bookingConfirmTable.billingChargeAmount }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -330,7 +330,6 @@
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- Booking Table-end -->
|
||||
</div>
|
||||
</el-main>
|
||||
</template>
|
||||
<style>
|
||||
@@ -586,7 +585,7 @@ export default {
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Internal server issues. Please contact support',
|
||||
message: 'Internal server error. Please contact support',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
})
|
||||
|
||||
Vendored
-4710
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user