akaunting 3.0 (the last dance)
This commit is contained in:
@ -28,8 +28,88 @@ const app = new Vue({
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('transaction'),
|
||||
bulk_action: new BulkAction('transactions')
|
||||
bulk_action: new BulkAction('transactions'),
|
||||
connect: {
|
||||
show: false,
|
||||
currency: {},
|
||||
documents: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onConnect(transaction, currency, documents) {
|
||||
this.connect.show = true;
|
||||
|
||||
this.connect.transaction = transaction;
|
||||
|
||||
this.connect.currency = {
|
||||
decimal_mark: currency.decimal_mark,
|
||||
precision: currency.precision,
|
||||
symbol: currency.symbol,
|
||||
symbol_first: currency.symbol_first,
|
||||
thousands_separator: currency.thousands_separator,
|
||||
};
|
||||
|
||||
this.connect.documents = documents;
|
||||
},
|
||||
|
||||
async onEmail(route) {
|
||||
let email = {
|
||||
modal: false,
|
||||
route: route,
|
||||
title: '',
|
||||
html: '',
|
||||
buttons:{}
|
||||
};
|
||||
|
||||
let email_promise = Promise.resolve(window.axios.get(email.route));
|
||||
|
||||
email_promise.then(response => {
|
||||
email.modal = true;
|
||||
email.title = response.data.data.title;
|
||||
email.html = response.data.html;
|
||||
email.buttons = response.data.data.buttons;
|
||||
|
||||
this.component = Vue.component('add-new-component', (resolve, reject) => {
|
||||
resolve({
|
||||
template: '<div id="dynamic-email-component"><akaunting-modal-add-new modal-dialog-class="max-w-screen-lg" :show="email.modal" @submit="onSubmit" @cancel="onCancel" :buttons="email.buttons" :title="email.title" :is_component=true :message="email.html"></akaunting-modal-add-new></div>',
|
||||
|
||||
mixins: [
|
||||
Global
|
||||
],
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form:{},
|
||||
email: email,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSubmit(event) {
|
||||
this.$emit('submit', event);
|
||||
|
||||
event.submit();
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.email.modal = false;
|
||||
this.email.html = null;
|
||||
|
||||
let documentClasses = document.body.classList;
|
||||
|
||||
documentClasses.remove("modal-open");
|
||||
},
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
})
|
||||
.finally(function () {
|
||||
// always executed
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user