mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
Merge branch 'bug/bookinglist-timeout-countdown' into 'master'
Bug/bookinglist timeout countdown See merge request CIEFWorldwideSdnBhd/exchange!25
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
/.vscode
|
||||
/.vagrant
|
||||
/data
|
||||
vendor/composer
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
|
||||
@@ -18,7 +18,7 @@ class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function index(){
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'amount', 'bia', 'verification_status')
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id',Auth::user()->id)
|
||||
->get();
|
||||
|
||||
@@ -39,23 +39,29 @@ class BookingController extends Controller
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
$booking->track_status = "(". $booking->status ."/6)";
|
||||
|
||||
switch ($booking->status) {
|
||||
case 1:
|
||||
$booking->status_desc = "Order in progress";
|
||||
$status_desc = "Order in progress";
|
||||
break;
|
||||
case 2:
|
||||
$booking->status_desc = "Waiting for payment";
|
||||
$status_desc = "Waiting for payment";
|
||||
break;
|
||||
case 3:
|
||||
$booking->status_desc = "Waiting verification";
|
||||
$status_desc = "Waiting verification";
|
||||
break;
|
||||
case 4:
|
||||
$booking->status_desc = "Processing transfer";
|
||||
$status_desc = "Processing transfer";
|
||||
break;
|
||||
case 5:
|
||||
$booking->status_desc = "Transfer Complete, please upload your PO";
|
||||
$status_desc = "Transfer Complete, please upload your PO";
|
||||
break;
|
||||
case 6:
|
||||
$booking->status_desc = "Processing invoice";
|
||||
$status_desc = "Processing invoice";
|
||||
break;
|
||||
default:
|
||||
$booking->status_desc = "";
|
||||
$biastatus_desc = "";
|
||||
}
|
||||
$booking->status_desc = $status_desc;
|
||||
}
|
||||
|
||||
return $bookings;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
<vue-countdown :time="booking.timeout">
|
||||
<vue-countdown countdownend="handleCoutdownend" :time="booking.timeout">
|
||||
<template slot-scope="props">Time Remaining:<br>{{ props.days }} days, {{ props.hours }} hours, {{ props.minutes }} minutes, {{ props.seconds }} seconds.</template>
|
||||
</vue-countdown>
|
||||
<!-- <button v-on:click="startTimer">Start timer</button> -->
|
||||
@@ -140,6 +140,19 @@
|
||||
this.booking.timeout = response.data.timeout * 1000
|
||||
this.start = true;
|
||||
loading.close()
|
||||
|
||||
if(this.booking.timeout < 0 ){
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Booking timeout, please make another booking.',
|
||||
type: 'error',
|
||||
duration: 30000,
|
||||
});
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
@@ -150,6 +163,17 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleCoutdownend(){
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Booking timeout, please make another booking.',
|
||||
type: 'error',
|
||||
duration: 30000,
|
||||
});
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
},
|
||||
|
||||
@@ -239,17 +239,17 @@
|
||||
<el-row :gutter="20">
|
||||
<div>
|
||||
<el-table :data="bookingTable">
|
||||
<el-table-column label="No." width="50">
|
||||
<el-table-column label="No." width="100">
|
||||
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">Update</el-button>
|
||||
<el-button type="text" slot-scope="scope" @click="(event) => { BookingStatus(scope.row.status, scope.row.id) }"> {{scope.row.id}}</el-button>
|
||||
</el-table-column>
|
||||
<el-table-column label="DateTime" prop="created_at" width="180" sortable/>
|
||||
<!-- <el-table-column label="Term" :filters="[{text: 'X1', value: 'X1'}, {text: 'X2', value: 'X2'}]" :filter-method="filterHandler">
|
||||
<el-table-column label="Term" prop="term" :filters="[{text: 'X1', value: 'X1'}, {text: 'X2', value: 'X2'}]" width="100" :filter-method="filterHandler">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="Rate" width="74" prop="rate" />
|
||||
<el-table-column label="Amount" prop="amount" justify="center" width="110" />
|
||||
<el-table-column :filters="[{text: 'RMB', value: 'RMB'}, {text: 'USD', value: 'USD'}]" :filter-method="filterHandler" label="Transfer Amount"
|
||||
prop="transfer_amount" width="150" />
|
||||
prop="transfer_amount" width="170" />
|
||||
<!-- <el-table-column label="ETA" sortable width="100"/> -->
|
||||
<!-- <el-table-column label="Payment Method" :filters="[{text: 'Cash', value: 'Cash'}, {text: 'Cheque', value: 'Cheque'}, {text: 'BA', value: 'BA'}]" :filter-method="filterHandler">
|
||||
</el-table-column> -->
|
||||
@@ -265,13 +265,14 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="Balance" prop="transfer_amount" sortable width="100"/> -->
|
||||
<el-table-column prop="timeout" label="Bankin Timeout" />
|
||||
<!-- <el-table-column prop="timeout" label="Bankin Timeout" /> -->
|
||||
<el-table-column :filters="[{ text: 'Success', value: 'Success' }, { text: 'Pending', value: 'Pending' }]" :filter-method="filterTag"
|
||||
label="" width="180" filter-placement="bottom-end">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">Update</el-button>
|
||||
<el-button type="text" slot-scope="scope" @click="(event) => { BookingStatus(scope.row.status, scope.row.id) }"> View Status </el-button>
|
||||
<!-- <template slot-scope="scope">
|
||||
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">View Status</el-button>
|
||||
<el-button size="mini" type="danger" @click="BookingStatus(scope.$index, scope.row)">Cancel</el-button>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
@@ -353,72 +354,7 @@
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
formLabelWidth: '0px',
|
||||
bookingTable: [{
|
||||
created_at: '12/1/2018',
|
||||
id: '12',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
track_status: '(1/6)',
|
||||
status_desc: 'Waiting for payment',
|
||||
timeout: '56:00:00',
|
||||
status: 2
|
||||
},
|
||||
{
|
||||
created_at: '12/1/2018',
|
||||
id: '13',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
track_status: '(2/6)',
|
||||
status_desc: 'Waiting verification',
|
||||
timeout: '56:00:00',
|
||||
status: 3
|
||||
},
|
||||
{
|
||||
created_at: '12/1/2018',
|
||||
id: '14',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
track_status: '(3/6)',
|
||||
status_desc: 'Processing transfer',
|
||||
timeout: '56:00:00',
|
||||
status: 4
|
||||
},
|
||||
{
|
||||
created_at: '12/1/2018',
|
||||
id: '15',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
track_status: '(4/6)',
|
||||
status_desc: 'Transfer Complete, please upload your PO',
|
||||
timeout: '56:00:00',
|
||||
status: 5
|
||||
},
|
||||
{
|
||||
created_at: '12/1/2018',
|
||||
id: '16',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
track_status: '(5/6)',
|
||||
status_desc: 'Processing invoice',
|
||||
timeout: '56:00:00',
|
||||
status: 6
|
||||
},
|
||||
{
|
||||
created_at: '12/1/2018',
|
||||
id: '17',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
track_status: '(6/6)',
|
||||
status_desc: 'Order Completed',
|
||||
timeout: '56:00:00',
|
||||
status: 6
|
||||
}
|
||||
bookingTable: [
|
||||
],
|
||||
bookingConfirmTable: {
|
||||
date: 'undefined',
|
||||
@@ -439,11 +375,7 @@
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.bookingTable = response.data
|
||||
|
||||
// this.booking.amount = response.data.amount
|
||||
// this.booking.bankin_amount = response.data.bia
|
||||
// this.booking.timeout = response.data.timeout * 1000
|
||||
// this.start = true;
|
||||
|
||||
//loading.close()
|
||||
}).catch((error) => {
|
||||
// console.log(error)
|
||||
@@ -548,7 +480,7 @@
|
||||
return
|
||||
})
|
||||
},
|
||||
BookingStatus(status, row) {
|
||||
BookingStatus(status, booking_id) {
|
||||
console.log(status)
|
||||
// TODO : Get booking status from server
|
||||
this.status = status
|
||||
@@ -557,46 +489,45 @@
|
||||
case 1:
|
||||
this.$router.push({
|
||||
name: 'booking.user.upload',
|
||||
params: {id: "12" }
|
||||
params: {id: booking_id }
|
||||
})
|
||||
|
||||
case 2:
|
||||
this.$router.push({
|
||||
name: 'booking.user.upload',
|
||||
params: {id: "12" }
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
case 3:
|
||||
this.$router.push({
|
||||
name: 'booking.confirmation',
|
||||
params: {id: "1" }
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
case 4:
|
||||
this.$router.push({
|
||||
name: 'booking.transfer',
|
||||
params: {id: "1" }
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
|
||||
case 5:
|
||||
this.$router.push({
|
||||
name: 'booking.user.uploadpo',
|
||||
params: {id: "1" }
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
|
||||
case 6:
|
||||
this.$router.push({
|
||||
name: 'booking.complete',
|
||||
params: {id: "1" }
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
-4329
File diff suppressed because it is too large
Load Diff
Vendored
-4769
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user