|
@@ -4,10 +4,19 @@ const state = {
|
|
|
currencies: false,
|
|
|
customers: false,
|
|
|
products: false,
|
|
|
- }
|
|
|
+ },
|
|
|
+ messages: [
|
|
|
+ 'Cargando compañía',
|
|
|
+ 'Cargando monedas',
|
|
|
+ 'Cargando clientes',
|
|
|
+ 'Cargando productos'
|
|
|
+ ]
|
|
|
}
|
|
|
|
|
|
const getters = {
|
|
|
+ getMessages(state) {
|
|
|
+ return state.messages
|
|
|
+ },
|
|
|
isLoaded(state) {
|
|
|
return state.loaded.company && state.loaded.currencies && state.loaded.customers && state.loaded.products
|
|
|
}
|
|
@@ -16,12 +25,20 @@ const getters = {
|
|
|
const mutations = {
|
|
|
setLoaded(state, payload) {
|
|
|
state.loaded[payload.module] = true
|
|
|
+ },
|
|
|
+ setUnloaded(state) {
|
|
|
+ for (let module in state.loaded) {
|
|
|
+ state.loaded[module] = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const actions = {
|
|
|
loaded({ commit }, payload) {
|
|
|
commit('setLoaded', payload)
|
|
|
+ },
|
|
|
+ clear({ commit }) {
|
|
|
+ commit('setUnloaded')
|
|
|
}
|
|
|
}
|
|
|
|