2019-11-16 10:21:14 +03:00
|
|
|
/**
|
|
|
|
* First we will load all of this project's JavaScript dependencies which
|
|
|
|
* includes Vue and other libraries. It is a great starting point when
|
|
|
|
* building robust, powerful web applications using Vue and Laravel.
|
|
|
|
*/
|
|
|
|
|
|
|
|
require('./../../bootstrap');
|
|
|
|
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
2020-01-03 12:10:07 +03:00
|
|
|
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
import Global from './../../mixins/global';
|
|
|
|
|
2020-02-21 21:43:40 +03:00
|
|
|
import Form from './../../plugins/form';
|
2021-01-20 12:35:34 +03:00
|
|
|
import BulkAction from './../../plugins/bulk-action';
|
2020-02-21 21:43:40 +03:00
|
|
|
|
2020-01-03 12:10:07 +03:00
|
|
|
// plugin setup
|
|
|
|
Vue.use(DashboardPlugin);
|
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
const app = new Vue({
|
2021-08-18 14:17:28 +03:00
|
|
|
el: '#main-body',
|
2019-12-31 17:36:07 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
mixins: [
|
|
|
|
Global
|
|
|
|
],
|
2020-02-21 15:09:43 +03:00
|
|
|
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
form: new Form('transaction'),
|
2022-06-01 10:15:55 +03:00
|
|
|
bulk_action: new BulkAction('transactions'),
|
2020-02-21 15:09:43 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2022-06-01 10:15:55 +03:00
|
|
|
methods: {
|
|
|
|
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({
|
2022-10-10 18:27:55 +03:00
|
|
|
template: '<div id="dynamic-email-component"><akaunting-modal-add-new modal-dialog-class="max-w-md" :show="email.modal" @submit="onSubmit" @cancel="onCancel" :buttons="email.buttons" :title="email.title" :is_component=true :message="email.html"></akaunting-modal-add-new></div>',
|
2022-06-01 10:15:55 +03:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2022-06-15 17:41:10 +03:00
|
|
|
documentClasses.remove('overflow-y-hidden', 'overflow-overlay', '-ml-4');
|
2022-06-01 10:15:55 +03:00
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
})
|
|
|
|
.finally(function () {
|
|
|
|
// always executed
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
2019-11-16 10:21:14 +03:00
|
|
|
});
|