update supplierbooking frontend

This commit is contained in:
Jack Goh
2018-06-26 17:56:51 +08:00
parent fd03f5b248
commit 21338401c4
@@ -213,18 +213,18 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="bank_name">
<el-form-item prop="amount">
<el-input v-model="supplierBookingForm.amount" type="text" placeholder="Amount" style="width: 80%" />
</el-form-item>
<el-form-item prop="bank_branch">
<el-form-item prop="rate">
<el-input v-model="supplierBookingForm.rate" type="text" placeholder="Rate" style="width: 80%" />
</el-form-item>
<el-form-item prop="account_num">
<el-form-item prop="transfer_amount">
<el-input v-model="supplierBookingForm.transfer_amount" type="text" placeholder="Transfer Amount" style="width: 80%"
/>
</el-form-item>
<el-form-item>
<el-button :loading="loading_btn" type="primary" @click="getCalculationValue('bookingForm')">Generate Report</el-button>
<el-button :loading="loading_btn" type="primary" @click="generateReport('supplierBookingForm')">Generate Report</el-button>
</el-form-item>
</div>
</el-form>
@@ -331,63 +331,42 @@
},
methods: {
approveUserSlip() {
generateReport (formName) {
this.loading_btn = true
let newApprove = {
estimated_arrival_time: this.estimated_arrival_time
}
this.$refs[formName].validate((valid) => {
if (valid) {
let newConfirmation = {
amount: this.booking.amount,
term: this.term
}
axios.post('/api/booking/' + this.$route.params.id + '/approve-bank-slip', newApprove)
.then((response) => {
// axios.post('api/booking/calculation', newConfirmation)
// .then((response) => {
// this.loading = false
// console.log(response)
// this.bookingConfirmTable.date = response.data.date
// this.bookingConfirmTable.marking = response.data.marking
// this.bookingConfirmTable.payment_method = response.data.payment_method
// this.bookingConfirmTable.amount = response.data.amount
// this.bookingConfirmTable.service_charge = response.data.service_charge
// this.bookingConfirmTable.rate = response.data.rate
// this.bookingConfirmTable.bankin_amount = response.data.bankin_amount
// this.bookingConfirmTable.account_name = this.bookingForm.account_name
// this.dialogFormVisible = false
// this.dialogFormVisible1 = true
// })
// .catch((error) => {
// this.loading = false
// console.log(error)
// })
}
else{
this.loading_btn = false
}
})
this.$message({
showClose: true,
message: 'User bankinslip accepted. Proceed with book with supplier.',
type: 'success',
duration: 5000
})
this.$router.push({
name: 'booking.admin.supplier'
})
// pass variable to another router
})
.catch((error) => {
this.loading_btn = false
console.log(error)
})
},
rejectUserSlip() {
this.loading_btn = true
let newApprove = {
estimated_arrival_time: this.estimated_arrival_time
}
axios.post('/api/booking/' + this.$route.params.id + '/reject-bank-slip', newApprove)
.then((response) => {
this.loading_btn = false
this.$message({
showClose: true,
message: 'User bankinslip rejected. Waiting user to reupload their user bankslip.',
type: 'warning',
duration: 5000
})
this.$router.push({
name: 'admin.home'
})
// pass variable to another router
})
.catch((error) => {
this.loading_btn = false
console.log(error)
})
},
}
}