Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange into fix/bug

# Conflicts:
#	app/Http/Controllers/BookingController.php
#	resources/assets/js/pages/home.vue
This commit is contained in:
Jack Goh
2018-07-26 15:50:49 +08:00
12 changed files with 479 additions and 86 deletions
+78 -28
View File
@@ -12,30 +12,34 @@
<div id="navbarToggler" class="collapse navbar-collapse">
<ul class="navbar-nav ml-auto">
<locale-dropdown/>
<!-- <li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li> -->
</ul>
<ul class="navbar-nav ml-auto">
<!-- Authenticated -->
<template v-if="user">
<!-- <el-badge :value="12" class="item">
<el-button size="share-button"><i class="el-icon-bell"></i></el-button>
</el-badge> -->
<!-- <el-dropdown trigger="click">
<el-badge :value="12" class="item">
<el-dropdown trigger="click">
<el-badge :value="bellBadge > 0 ? bellBadge : ''" class="item">
<el-button icon="el-icon-bell" circle></el-button>
</el-badge>
<el-dropdown-menu slot="dropdown" style="max-width: 30%" id="notification">
<a v-for="item in notification" :href="item.link">
<el-dropdown-item>
{{item.message}}
</el-dropdown-item>
</a>
<el-dropdown-menu slot="dropdown" id="notification">
<div v-for="(item,index) in notification.message">
<a v-on:click.prevent='readNotification(item.id);navigateTo(item.link)'>
<el-dropdown-item>
<b v-if="item.is_read == 0">
{{item.detail}}
</b>
<span v-else >
{{item.detail}}
</span>
<br/>
<span class="opacity80">
{{item.time_interval}}
</span>
</el-dropdown-item>
</a>
</div>
</el-dropdown-menu>
</el-dropdown> -->
</el-dropdown>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-dark"
@@ -79,6 +83,7 @@
<script>
import { mapGetters } from 'vuex'
import LocaleDropdown from './LocaleDropdown'
import axios from 'axios'
export default {
components: {
@@ -87,28 +92,58 @@ export default {
data: () => ({
appName: window.config.appName,
notification:[{
message : "You have an unread message",
link : "http://www.google.com"
},
{
message : "There are 10 booking for your approval",
link : "http://www.yahoo.com"
}]
notification:[],
loadingNotification:false,
bellBadge : 0,
unread_message_length:0,
}),
computed: mapGetters({
user: 'auth/user'
}),
mounted(){
this.getNotification();
},
methods: {
async logout () {
async logout(){
// Log out the user.
await this.$store.dispatch('auth/logout')
await this.$store.dispatch('auth/logout');
// Redirect to login.
this.$router.push({ name: 'login' })
this.$router.push({ name: 'login' });
},
getNotification(){
this.notification = [];
this.loadingNotification=true;
axios
.get('/api/notification/user/')
.then((response) => {
this.loadingNotification=false;
this.notification = response.data;
this.bellBadge = this.notification.unread_message.length;
console.log(response.data);
}).catch((error) => {
console.log(error)
this.$router.push({
name: 'notfound'
})
})
},
readNotification(notification_id){
axios
.post('/api/notification/read-notification/'+notification_id)
.then((response) => {
this.getNotification();
}).catch((error) => {
console.log(error)
this.$router.push({
name: 'notfound'
})
})
},
navigateTo(nav) {
window.location.href = nav;
}
}
}
@@ -120,4 +155,19 @@ export default {
height: 2rem;
margin: -.375rem 0;
}
.el-dropdown-menu{
max-height: 50%;
overflow-y: scroll;
overflow-x: hidden;
}
.el-dropdown-menu__item {
line-height: 26px;
}
.opacity80{
opacity: 0.8 ;
}
::-webkit-scrollbar {
width: 0px;
background: transparent; /* make scrollbar transparent */
}
</style>
+31 -8
View File
@@ -4,8 +4,6 @@
<el-button :loading="loading_btn" type="primary" size="mini" @click="RefreshBooking()">Refresh</el-button>
</div>
<!-- Booking Table -->
<el-row :gutter="20">
<div>
@@ -47,6 +45,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 +66,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 +76,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(this.bookingTable);
console.log(response.data.data);
})
},
RefreshBooking() {
@@ -80,7 +89,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 +98,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")
@@ -267,8 +267,10 @@ export default {
let newUserSlip = {
transfer_amount: this.user_slip_form.transfer_amount
}
axios.patch('/api/booking/' + this.booking_id + '/bankslip-amount', newUserSlip)
axios.patch('/api/booking/' + this.booking_id + '/bankslip-amount/', newUserSlip)
.then((response) => {
console.log(response);
this.$message({
showClose: true,
message: 'Your bankinslip has been submitted, please wait admin to approve.',
@@ -279,6 +281,7 @@ export default {
this.$router.push({
name: 'home'
})
})
.catch((error) => {
this.loading = false
+37 -15
View File
@@ -209,13 +209,13 @@
<tr>
<td>CNY/RMB :</td>
<td>
<b> RM {{ bookingConfirmTable.amount }}</b>
<b> CNY {{ bookingConfirmTable.amount }}</b>
</td>
</tr>
<tr>
<td>+ Service Charges :</td>
<td>
RM {{ bookingConfirmTable.service_charge }}
CNY {{ bookingConfirmTable.service_charge }}
</td>
</tr>
<tr>
@@ -227,19 +227,37 @@
<tr>
<td></td>
<td>
<b> RM {{ bookingConfirmTable.subtotal }}</b>
MYR {{ bookingConfirmTable.subtotal }}
</td>
</tr>
<tr>
<td>+ Tax :</td>
<td>
RM {{ bookingConfirmTable.taxAmount }}
MYR {{ bookingConfirmTable.taxAmount }}
</td>
</tr>
<tr>
<td>+ Billing Charge :</td>
<td>
RM {{ bookingConfirmTable.billingChargeAmount }}
MYR {{ bookingConfirmTable.billingChargeAmount }}
</td>
</tr>
<tr>
<td>Bank In Amount :</td>
<td>
<b> MYR {{ bookingConfirmTable.bankin_amount }}</b>
</td>
</tr>
<tr>
<td>China Beneficiary Acc :</td>
<td></td>
</tr>
<tr>
<td>
Name : {{ bookingConfirmTable.acc_name }} <br>
Account No. : {{ bookingConfirmTable.acc_no }}
</td>
<td>
</td>
</tr>
<tr>
@@ -250,6 +268,13 @@
<td></td>
<td></td>
</tr>
<tr>
<td align="center" colspan="2">
<b>CIEF WORLDWIDE SDN. BHD.(1134596-M)</b>
<br/>
<b>MBB 568603010762</b>
</td>
</tr>
</tbody>
</table>
<span slot="footer" class="dialog-footer">
@@ -354,12 +379,10 @@ export default {
rate: ''
},
bookingForm: {
account_name: '',
bank_name: '',
bank_branch: '',
account_num: '',
order_no: null,
payment_for: 'Full Payment'
account_name: '',
bank_name: '',
bank_branch: '',
account_num: ''
},
rules: {
order_no: [{
@@ -443,7 +466,6 @@ export default {
axios.get(this.url).then(response => {
this.bookingTable = response.data.data
$this.makePagination(response.data)
console.log(response)
})
},
getRate() {
@@ -492,7 +514,6 @@ export default {
prev_page_url: data.prev_page_url
}
this.pagination = pagination
console.log(this.pagination)
},
fetchPaginateBooking(url) {
this.url = url
@@ -529,12 +550,13 @@ export default {
amount: this.booking.amount,
term: this.term,
order_no: this.bookingForm.order_no,
payment_for: this.bookingForm.payment_for
payment_for: this.bookingForm.payment_for,
acc_name: this.bookingForm.account_name,
acc_no: this.bookingForm.account_num
}
axios.post('api/booking/calculation', newConfirmation)
.then((response) => {
this.loading = false
console.log(response)
this.bookingConfirmTable = response.data;
this.dialogFormVisible = false
this.dialogFormVisible1 = true