diff --git a/resources/assets/js/pages/admin/booking/supplierBooking.vue b/resources/assets/js/pages/admin/booking/supplierBooking.vue index f2feaa71..095440a9 100644 --- a/resources/assets/js/pages/admin/booking/supplierBooking.vue +++ b/resources/assets/js/pages/admin/booking/supplierBooking.vue @@ -213,18 +213,18 @@ - + - + - + - Generate Report + Generate Report @@ -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) - }) }, } }