add new branch for booking flow for x2_chequeand x2_ba

This commit is contained in:
weiweitoo
2018-07-14 17:31:21 +08:00
parent 1c9a9aca20
commit b21eaf4522
9 changed files with 64 additions and 27 deletions
+21 -6
View File
@@ -97,7 +97,15 @@ class BookingController extends Controller
// TODO : transfer_amount change name to bia
$booking->transfer_amount = $booking->bia;
$booking->track_status = "(". $booking->admin_status ."/7)";
$term = $booking->term;
if($term == "x1_ba" || $term == "x2_cheque"){
$status = $booking->admin_status > 2 ? $booking->admin_status - 2 : $booking->admin_status;
$booking->track_status = "(". $status ."/5)";
}
else{
$booking->track_status = "(". $booking->admin_status ."/7)";
}
switch ($booking->admin_status) {
case 1:
$status_desc = "Waiting customer upload bank slip";
@@ -106,11 +114,15 @@ class BookingController extends Controller
$status_desc = "Verify user bank slip";
break;
case 3:
$status_desc = "Generate supplier booking report";
break;
if($term !== "x1_ba" || $term !== "x2_cheque"){
$status_desc = "Generate supplier booking report";
break;
}
case 4:
$status_desc = "Supplier booking report. Please confirm with your booking.";
break;
if($term !== "x1_ba" || $term !== "x2_cheque"){
$status_desc = "Supplier booking report. Please confirm with your booking.";
break;
}
case 5:
$status_desc = "Please, upload China Bankslip";
break;
@@ -619,7 +631,10 @@ class BookingController extends Controller
// update booking status
$booking->status = 4;
$booking->admin_status = 3;
if($booking->term !== "x1_ba" || $booking->term !== "x2_cheque")
$booking->admin_status = 3;
else
$booking->admin_status = 5;
$booking->save();
return response()->json(['message'=>'Success'],200);
@@ -1,10 +1,10 @@
<template>
<el-row>
<el-steps :value="value" :active="value" :align-center="true" process-status="wait" finish-status="success">
<el-steps :value="(value.term === 'x1_ba' || value.term === 'x2_cheque') && value.status > 2 ? value.status - 2 : value.status" :active="(value.term === 'x1_ba' || value.term === 'x2_cheque') && value.status > 2 ? value.status - 2 : value.status" :align-center="true" process-status="wait" finish-status="success">
<el-step title="Booking"/>
<el-step title="Verification"/>
<el-step title="Supplier Booking"/>
<el-step title="Supplier Report"/>
<el-step title="Supplier Booking" v-if="!(value.term === 'x1_ba' || value.term === 'x2_cheque')"/>
<el-step title="Supplier Report" v-if="!(value.term === 'x1_ba' || value.term === 'x2_cheque')"/>
<el-step title="Upload China Bankslip To Booking"/>
<el-step title="Purchase Order/Invoice"/>
<el-step title="Completed"/>
@@ -40,7 +40,6 @@
export default {
props: ['value'],
data: () => ({
status: 1
})
}
</script>
@@ -1,6 +1,6 @@
<template>
<el-main>
<progress-track v-model="status"/>
<progress-track v-model="trackerConfig"/>
<div align="center">
<h4 style="margin-top:5%;">Order Completed</h4>
@@ -300,7 +300,10 @@ export default {
},
data () {
return {
status: 8,
trackerConfig :{
status: 8,
term: null
},
loading_btn: false,
booking_details:{
id: null,
@@ -322,8 +325,8 @@ export default {
.get('/api/admin/booking/' + this.$route.params.id)
.then((response) => {
this.booking_details = response.data
this.trackerConfig.term = response.data.term;
loading.close()
}).catch((error) => {
console.log(error)
loading.close()
@@ -1,6 +1,6 @@
<template>
<el-main>
<progress-track v-model="status" />
<progress-track v-model="trackerConfig" />
<div align="center">
<h4 style="margin-top:5%;"></h4>
@@ -247,7 +247,10 @@
},
data() {
return {
status: 3,
trackerConfig :{
status: 3,
term: null
},
loading_btn: false,
booking_details: {
id: null,
@@ -301,6 +304,7 @@
.get('/api/admin/booking/' + this.$route.params.id)
.then((response) => {
this.booking_details = response.data
this.trackerConfig.term = response.data.term;
}).catch((error) => {
console.log(error)
this.$router.push({
@@ -1,6 +1,6 @@
<template>
<el-main>
<progress-track v-model="status" />
<progress-track v-model="trackerConfig" />
<div align="center">
<h4 style="margin-top:5%;"></h4>
@@ -260,7 +260,10 @@
},
data() {
return {
status: 4,
trackerConfig :{
status: 4,
term: null
},
loading_btn: false,
booking_details: {
id: null,
@@ -298,6 +301,7 @@
.get('/api/admin/booking/' + this.$route.params.id)
.then((response) => {
this.booking_details = response.data
this.trackerConfig.term = response.data.term;
}).catch((error) => {
console.log(error)
this.$router.push({
@@ -1,6 +1,6 @@
<template>
<el-main>
<progress-track v-model="status" />
<progress-track v-model="trackerConfig" />
<div align="center">
<h4 style="margin-top:5%;"></h4>
@@ -250,7 +250,10 @@
},
data() {
return {
status: 5,
trackerConfig :{
status: 5,
term: null
},
loading_btn: false,
booking_id: this.$route.params.id,
booking_details: {
@@ -321,8 +324,9 @@
axios
.get('/api/admin/booking/' + this.$route.params.id)
.then((response) => {
loading.close()
this.booking_details = response.data
this.trackerConfig.term = response.data.term;
loading.close()
}).catch((error) => {
loading.close()
console.log(error)
@@ -1,6 +1,6 @@
<template>
<el-main>
<progress-track v-model="status" />
<progress-track v-model="trackerConfig" />
<div align="center">
<h4 style="margin-top:5%;"></h4>
@@ -255,7 +255,10 @@
},
data() {
return {
status: 6,
trackerConfig :{
status: 6,
term: null
},
loading_btn: false,
booking_id: this.$route.params.id,
booking_details: {
@@ -328,7 +331,7 @@
.then((response) => {
loading.close()
this.booking_details = response.data
console.log(this.booking_details)
this.trackerConfig.term = response.data.term;
}).catch((error) => {
console.log(error)
loading.close()
@@ -1,6 +1,6 @@
<template>
<el-main>
<progress-track v-model="status" />
<progress-track v-model="trackerConfig" />
<div align="center">
<h4 style="margin-top:5%;"></h4>
@@ -265,7 +265,10 @@
},
data() {
return {
status: 2,
trackerConfig :{
status: 2,
term: null
},
loading_btn: false,
rejectDialogVisible: false,
reject_reason: null,
@@ -289,7 +292,8 @@
axios
.get('/api/admin/booking/' + this.$route.params.id)
.then((response) => {
this.booking_details = response.data
this.booking_details = response.data;
this.trackerConfig.term = response.data.term;
loading.close()
}).catch((error) => {
@@ -320,7 +324,7 @@
})
this.$router.push({
name: 'booking.admin.supplier'
name: this.booking_details.term === 'x1_ba' || this.booking_details.term === 'x2_cheque' ? 'booking.admin.cnslip' : 'booking.admin.supplier'
})
// pass variable to another router
+1
View File
@@ -69,6 +69,7 @@ export default {
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data
console.log(this.bookingTable);
})
},
filterTag (value, row) {