mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-21 13:24:27 +00:00
Merge branch 'frontend/error-handling-for-axios-in-admin-booking-vues' into 'master'
Frontend/error handling for axios in booking vues See merge request CIEFWorldwideSdnBhd/exchange!52
This commit is contained in:
@@ -353,11 +353,16 @@
|
||||
console.log(error)
|
||||
|
||||
// TODO : Show error message
|
||||
|
||||
})
|
||||
|
||||
} else {
|
||||
this.loading_btn = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please fill the supplier form',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -358,23 +358,26 @@
|
||||
})
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
this.loading_btn = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please upload your bankin slip first.',
|
||||
type: 'warning',
|
||||
duration: 10000
|
||||
})
|
||||
console.log(error)
|
||||
this.loading_btn = false
|
||||
})
|
||||
|
||||
} else {
|
||||
this.loading_btn = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please upload your bankin slip first.',
|
||||
type: 'warning',
|
||||
duration: 10000
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>BankinSlip</span>
|
||||
<span>Banking Slip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
|
||||
@@ -478,45 +478,51 @@ export default {
|
||||
console.log(error)
|
||||
})
|
||||
} else {
|
||||
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please fill the booking form in full.',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
createBooking: function () {
|
||||
this.loading = true,
|
||||
this.dialogFormVisible1 = true
|
||||
let newBooking = {
|
||||
account_name: this.bookingForm.account_name,
|
||||
account_num: this.bookingForm.account_num,
|
||||
bank_name: this.bookingForm.bank_name,
|
||||
bank_branch: this.bookingForm.bank_branch,
|
||||
amount: this.booking.amount,
|
||||
term: this.term
|
||||
}
|
||||
|
||||
let newBooking = {
|
||||
account_name: this.bookingForm.account_name,
|
||||
account_num: this.bookingForm.account_num,
|
||||
bank_name: this.bookingForm.bank_name,
|
||||
bank_branch: this.bookingForm.bank_branch,
|
||||
amount: this.booking.amount,
|
||||
term: this.term
|
||||
}
|
||||
console.log(newBooking)
|
||||
axios.post('api/booking', newBooking)
|
||||
.then((response) => {
|
||||
this.loading = false
|
||||
// push with return id
|
||||
this.$router.push({
|
||||
name: 'booking.user.upload',
|
||||
params: {id: response.data.id }
|
||||
})
|
||||
|
||||
console.log(newBooking)
|
||||
axios.post('api/booking', newBooking)
|
||||
.then((response) => {
|
||||
this.loading = false
|
||||
// push with return id
|
||||
this.$router.push({
|
||||
name: 'booking.user.upload',
|
||||
params: {id: response.data.id }
|
||||
})
|
||||
|
||||
// pass variable to another router
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Internal server issues. Please contact support',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
})
|
||||
console.log(error)
|
||||
})
|
||||
// pass variable to another router
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Internal server issues. Please contact support',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
BookingStatus (status, booking_id) {
|
||||
console.log(status)
|
||||
|
||||
Reference in New Issue
Block a user