close loading only when all resource load finish

This commit is contained in:
weiweitoo
2018-07-12 22:59:16 +08:00
parent 19ea22141e
commit 62e8a9b9b6
@@ -297,11 +297,9 @@
axios
.get('/api/admin/booking/' + this.$route.params.id)
.then((response) => {
loading.close()
this.booking_details = response.data
}).catch((error) => {
console.log(error)
loading.close()
this.$router.push({
name: 'notfound'
})
@@ -309,11 +307,9 @@
axios.get('/api/supplier-booking/' + this.$route.params.id)
.then((response) => {
loading.close()
this.supplier_booking = response.data
}).catch((error) => {
console.log(error)
loading.close()
this.$router.push({
name: 'notfound'
})
@@ -323,12 +319,13 @@
.then((response) => {
axios.get('/api/setting-beneficiary/' + response.data.beneficiary_id)
.then((response) => {
loading.close();
this.supplier_booking.china_bank_name = response.data.bank_name;
this.supplier_booking.china_company_name = response.data.company_name;
this.supplier_booking.china_acc_no = response.data.acc_no;
console.log(this.supplier_booking);
})
.catch((error) => {
loading.close();
console.log(error);
this.$message({
showClose: true,
@@ -339,6 +336,7 @@
});
})
.catch((error) => {
loading.close();
console.log(error);
this.$message({
showClose: true,
@@ -347,7 +345,6 @@
duration: 10000
});
});
},
methods: {
downloadReport(){