refs #1480 Invoice/Bill payment show error issue solved

This commit is contained in:
Cüneyt Şentürk
2020-06-10 11:35:39 +03:00
parent 57cc191ba5
commit b79d9e4df7
4 changed files with 20 additions and 6 deletions

View File

@ -336,7 +336,7 @@ const app = new Vue({
this.component = Vue.component('add-new-component', (resolve, reject) => {
resolve({
template: '<div id="dynamic-component"><akaunting-modal-add-new :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>',
template: '<div id="dynamic-component"><akaunting-modal-add-new modal-dialog-class="modal-md" :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>',
mixins: [
Global
@ -352,6 +352,7 @@ const app = new Vue({
methods: {
onSubmit(event) {
this.form = event;
this.form.response = {};
this.loading = true;
@ -396,6 +397,12 @@ const app = new Vue({
window.location.href = response.data.redirect;
}
}
if (response.data.error) {
this.form.loading = false;
this.form.response = response.data;
}
})
.catch(error => {
this.form.loading = false;

View File

@ -337,7 +337,7 @@ const app = new Vue({
this.component = Vue.component('add-new-component', (resolve, reject) => {
resolve({
template: '<div id="dynamic-component"><akaunting-modal-add-new :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>',
template: '<div id="dynamic-component"><akaunting-modal-add-new modal-dialog-class="modal-md" :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>',
mixins: [
Global
@ -353,6 +353,7 @@ const app = new Vue({
methods: {
onSubmit(event) {
this.form = event;
this.form.response = {};
this.loading = true;
@ -397,6 +398,12 @@ const app = new Vue({
window.location.href = response.data.redirect;
}
}
if (response.data.error) {
this.form.loading = false;
this.form.response = response.data;
}
})
.catch(error => {
this.form.loading = false;