bug fixes

This commit is contained in:
Peter Papp
2021-05-14 10:29:46 +02:00
parent b4e6561134
commit 722eceb0c1
23 changed files with 172 additions and 137 deletions
+21 -8
View File
@@ -2,10 +2,23 @@ import i18n from '@/i18n/index'
import {debounce} from 'lodash'
import {events} from './bus'
import store from "./store";
import router from "./router";
const OasisHelpers = {
install(Vue) {
Vue.prototype.$goToInvoice = function () {
router.push({name: 'InvoicesList'})
store.commit('STORE_CURRENT_FOLDER', {
name: 'Invoices',
id: undefined,
location: 'regular-invoice',
})
store.dispatch('getRegularInvoices')
}
Vue.prototype.$getInvoiceDataByLocation = function () {
let currentLocation = store.getters.currentFolder && store.getters.currentFolder.location
@@ -18,7 +31,7 @@ const OasisHelpers = {
'clients': 'getClients',
}
this.$store.dispatch(actions[currentLocation])
store.dispatch(actions[currentLocation])
}
Vue.prototype.$shareInvoice = function (entry) {
@@ -29,7 +42,7 @@ const OasisHelpers = {
}
Vue.prototype.$editInvoice = function (entry) {
this.$router.push({name: 'EditInvoice', params: {id: entry.id}})
router.push({name: 'EditInvoice', params: {id: entry.id}})
events.$emit('file-preview:hide')
}
@@ -62,7 +75,7 @@ const OasisHelpers = {
}
Vue.prototype.$goToCompany = function (entry) {
this.$router.push({name: 'ClientDetail', params: {id: entry.client_id ?? entry.id}})
router.push({name: 'ClientDetail', params: {id: entry.client_id ?? entry.id}})
events.$emit('file-preview:hide')
}
@@ -71,10 +84,10 @@ const OasisHelpers = {
if (value !== '' && typeof value !== 'undefined') {
if (['regular-invoice', 'advance-invoice'].includes(this.$store.getters.currentFolder.location)) {
this.$store.dispatch('getSearchResultForInvoices', value)
if (['regular-invoice', 'advance-invoice'].includes(store.getters.currentFolder.location)) {
store.dispatch('getSearchResultForInvoices', value)
} else {
this.$store.dispatch('getSearchResultForClients', value)
store.dispatch('getSearchResultForClients', value)
}
} else if (typeof value !== 'undefined') {
@@ -84,9 +97,9 @@ const OasisHelpers = {
'clients': 'getClients',
}
this.$store.dispatch(locations[this.$store.getters.currentFolder.location])
store.dispatch(locations[store.getters.currentFolder.location])
this.$store.commit('CHANGE_SEARCHING_STATE', false)
store.commit('CHANGE_SEARCHING_STATE', false)
}
}, 300)
}