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>
<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-img src="@/assets/logo-big.png" contain height="40"></v-img>
</v-btn>

View File

@ -73,15 +73,27 @@ export default {
},
created() {
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)
this.date = new Date(this.date.getFullYear(), this.date.getMonth(), 0)
}
this.createMonth(this.date)
this.getAllUsers()
this.getTransactJobs({
year: this.date.getFullYear(),
month: this.date.getMonth() + 1,
day: 1
})
},
methods: {
...mapActions({
getTransactJobs: 'requestJobs/getTransactJobs',
createMonth: 'jobs/createMonth',
getAllUsers: 'jobs/getAllUsers'
}),

View File

@ -116,16 +116,9 @@ export default {
month: this.day.date.getMonth() + 1,
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: {
...mapActions({
getTransactJobs: 'requestJobs/getTransactJobs',
getUser: 'jobs/getUser',
setLoading: 'jobs/setDayLoading',
setNotLoading: 'jobs/setDayNotLoading',

View File

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

View File

@ -176,6 +176,8 @@ router.beforeEach((to, from, next) => {
next('/main/bar/geruecht')
} else if (store.state.login.user.group.includes('user')) {
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 }) {
commit('setAllUsersLoading', true)
try {
const response = await axios.post(
const response = await axios.get(
url.searchUser,
{ searchString: '' },
{ headers: { Token: rootState.login.user.accessToken } }
)
commit('setAllUsers', response.data)

View File

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

View File

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

View File

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

View File

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

View File

@ -10,6 +10,14 @@
overflow
>
<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-icon>
<v-icon>{{person}}</v-icon>
@ -98,6 +106,7 @@ export default {
isGastro: 'isGastro',
isManagement: 'isManagement',
isLoggedIn: 'isLoggedIn',
isExtern: 'isExtern',
user: 'user'
})
}