finished ##213

This commit is contained in:
Tim Gröger 2020-03-04 21:12:08 +01:00
parent c1d058f8c5
commit 586e1fdf64
11 changed files with 44 additions and 22 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<v-app-bar app clipped-left clipped-right hide-on-scroll color="blue accent-4" class="elevation-4" dark> <v-app-bar app clipped-left clipped-right color="blue accent-4" class="elevation-4" dark dense>
<v-btn icon to="/"> <v-btn icon to="/">
<v-img src="@/assets/logo-big.png" contain height="40"></v-img> <v-img src="@/assets/logo-big.png" contain height="40"></v-img>
</v-btn> </v-btn>

View File

@ -73,15 +73,27 @@ export default {
}, },
created() { created() {
for (let intDate = 1; intDate < 7; intDate++) { for (let intDate = 1; intDate < 7; intDate++) {
if (new Date(this.date.getFullYear(), this.date.getMonth(), intDate).getDay() === 3) if (
new Date(
this.date.getFullYear(),
this.date.getMonth(),
intDate
).getDay() === 3
)
if (this.date.getDate() < intDate) if (this.date.getDate() < intDate)
this.date = new Date(this.date.getFullYear(), this.date.getMonth(), 0) this.date = new Date(this.date.getFullYear(), this.date.getMonth(), 0)
} }
this.createMonth(this.date) this.createMonth(this.date)
this.getAllUsers() this.getAllUsers()
this.getTransactJobs({
year: this.date.getFullYear(),
month: this.date.getMonth() + 1,
day: 1
})
}, },
methods: { methods: {
...mapActions({ ...mapActions({
getTransactJobs: 'requestJobs/getTransactJobs',
createMonth: 'jobs/createMonth', createMonth: 'jobs/createMonth',
getAllUsers: 'jobs/getAllUsers' getAllUsers: 'jobs/getAllUsers'
}), }),

View File

@ -116,16 +116,9 @@ export default {
month: this.day.date.getMonth() + 1, month: this.day.date.getMonth() + 1,
day: this.day.date.getDate() day: this.day.date.getDate()
}) })
this.getTransactJobs({})
this.getTransactJobs({
year: this.day.date.getFullYear(),
month: this.day.date.getMonth() + 1,
day: this.day.date.getDate()
})
}, },
methods: { methods: {
...mapActions({ ...mapActions({
getTransactJobs: 'requestJobs/getTransactJobs',
getUser: 'jobs/getUser', getUser: 'jobs/getUser',
setLoading: 'jobs/setDayLoading', setLoading: 'jobs/setDayLoading',
setNotLoading: 'jobs/setDayNotLoading', setNotLoading: 'jobs/setDayNotLoading',

View File

@ -1,6 +1,6 @@
//const main = 'https://192.168.5.128:5000/' //const main = 'https://192.168.5.128:5000/'
//const main = 'http://localhost:5000/' const main = 'http://localhost:5000/'
const main = 'http://192.168.5.118:5000/' //const main = 'http://192.168.5.118:5000/'
//const main = 'https://groeger-clan.duckdns.org:5000/' //const main = 'https://groeger-clan.duckdns.org:5000/'
const url = { const url = {
@ -28,7 +28,8 @@ const url = {
addUser: main + 'sm/addUser', addUser: main + 'sm/addUser',
deleteUser: main + 'sm/deleteUser', deleteUser: main + 'sm/deleteUser',
getUser: main + 'sm/getUser', getUser: main + 'sm/getUser',
lockDay: main + 'sm/lockDay' lockDay: main + 'sm/lockDay',
searchUser: main + 'sm/searchWithExtern'
}, },
um: { um: {
setStatus: main + 'um/setStatus', setStatus: main + 'um/setStatus',

View File

@ -176,6 +176,8 @@ router.beforeEach((to, from, next) => {
next('/main/bar/geruecht') next('/main/bar/geruecht')
} else if (store.state.login.user.group.includes('user')) { } else if (store.state.login.user.group.includes('user')) {
next('/main/user/add') next('/main/user/add')
} else if (store.state.login.user.group.includes('extern')) {
next('/main')
} }
} }
} }

View File

@ -194,9 +194,8 @@ const actions = {
async getAllUsers({ commit, rootState, dispatch }) { async getAllUsers({ commit, rootState, dispatch }) {
commit('setAllUsersLoading', true) commit('setAllUsersLoading', true)
try { try {
const response = await axios.post( const response = await axios.get(
url.searchUser, url.searchUser,
{ searchString: '' },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
commit('setAllUsers', response.data) commit('setAllUsers', response.data)

View File

@ -243,9 +243,8 @@ const actions = {
async getAllUsers({ commit, rootState, dispatch }) { async getAllUsers({ commit, rootState, dispatch }) {
commit('setAllUsersLoading', true) commit('setAllUsersLoading', true)
try { try {
const response = await axios.post( const response = await axios.get(
url.searchUser, url.searchUser,
{ searchString: '' },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
commit('setAllUsers', response.data) commit('setAllUsers', response.data)

View File

@ -204,9 +204,8 @@ const mutations = {
const actions = { const actions = {
async getAllUsers({ commit, rootState, dispatch }) { async getAllUsers({ commit, rootState, dispatch }) {
try { try {
const response = await axios.post( const response = await axios.get(
url.searchUser, url.searchUser,
{ searchString: '' },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
commit('setAllUsers', { commit('setAllUsers', {

View File

@ -69,6 +69,8 @@ const actions = {
router.push('/main/bar/geruecht') router.push('/main/bar/geruecht')
} else if (state.user.group.includes('user')) { } else if (state.user.group.includes('user')) {
router.push('/main/user/add') router.push('/main/user/add')
} else if (state.user.group.includes('extern')) {
router.push('/main')
} }
} catch (err) { } catch (err) {
commit('loginStop', err.response.data.error) commit('loginStop', err.response.data.error)
@ -141,9 +143,16 @@ const getters = {
return false return false
} }
}, },
isExtern: state => {
try {
return state.user.group.includes('extern')
} catch (e) {
return false
}
},
isManagement: state => { isManagement: state => {
try { try {
return state.user.group.includes('management') || state.user.group.includes('gastro') || state.user.group.includes('moneymaster') return state.user.group.includes('vorstand') || state.user.group.includes('gastro') || state.user.group.includes('moneymaster')
} catch (e) { } catch (e) {
return false return false
} }

View File

@ -200,9 +200,8 @@ const actions = {
}, },
async getAllUsers({ commit, rootState, dispatch }) { async getAllUsers({ commit, rootState, dispatch }) {
try { try {
const response = await axios.post( const response = await axios.get(
url.searchUser, url.vorstand.sm.searchUser,
{ searchString: '' },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
commit('setAllUsers', response.data) commit('setAllUsers', response.data)

View File

@ -10,6 +10,14 @@
overflow overflow
> >
<v-list> <v-list>
<v-list-item v-if="isExtern" class="title">
<v-list-item-icon>
<v-icon>{{person}}</v-icon>
</v-list-item-icon>
<v-list-item-title>
{{user.firstname}} {{user.lastname}}
</v-list-item-title>
</v-list-item>
<v-list-item v-if="isUser" class="title" link to="/main/user/add"> <v-list-item v-if="isUser" class="title" link to="/main/user/add">
<v-list-item-icon> <v-list-item-icon>
<v-icon>{{person}}</v-icon> <v-icon>{{person}}</v-icon>
@ -98,6 +106,7 @@ export default {
isGastro: 'isGastro', isGastro: 'isGastro',
isManagement: 'isManagement', isManagement: 'isManagement',
isLoggedIn: 'isLoggedIn', isLoggedIn: 'isLoggedIn',
isExtern: 'isExtern',
user: 'user' user: 'user'
}) })
} }