diff --git a/.prettierrc.js b/.prettierrc.js
index 135334e..a6b80c2 100644
--- a/.prettierrc.js
+++ b/.prettierrc.js
@@ -1,4 +1,4 @@
module.exports = {
- singleQuote: true,
- semi: false
-}
\ No newline at end of file
+ singleQuote: true,
+ semi: false
+}
diff --git a/src/components/baruser/CreditLists.vue b/src/components/baruser/CreditLists.vue
index ab7052a..7fdd57f 100644
--- a/src/components/baruser/CreditLists.vue
+++ b/src/components/baruser/CreditLists.vue
@@ -6,9 +6,8 @@
>Transaktion ist länger als 1 Minute her!
- Da die Transaktion länger als 1 Minuter her ist, kann eine
- Stornierung nicht durchgeführt werden. Wende dich bitte an den
- Finanzer.
+ Da die Transaktion länger als 1 Minuter her ist, kann eine Stornierung
+ nicht durchgeführt werden. Wende dich bitte an den Finanzer.
@@ -39,7 +38,9 @@
{{ now(message.date) }}
- {{ createMessage(message) }}
+ {{
+ createMessage(message)
+ }}
STORNIERT!!!
@@ -61,7 +62,8 @@
>
- Nur noch {{ ((user.limit + user.amount)/100).toFixed(2)}} € übrig!!
+ Nur noch {{ ((user.limit + user.amount) / 100).toFixed(2) }} €
+ übrig!!
@@ -262,10 +264,17 @@ export default {
isFiltered(user) {
try {
var filters = this.filter.split(' ')
- for (var filter in filters) {
+ if (filters.length === 1) {
if (
- user.firstname.toLowerCase().includes(filters[filter].toLowerCase()) ||
- user.lastname.toLowerCase().includes(filters[filter].toLowerCase())
+ user.firstname.toLowerCase().includes(filters[0].toLowerCase()) ||
+ user.lastname.toLowerCase().includes(filters[0].toLowerCase())
+ ) {
+ return true
+ }
+ } else if (filters.length > 1) {
+ if (
+ user.firstname.toLowerCase().includes(filters[0].toLowerCase()) &&
+ user.lastname.toLowerCase().includes(filters[1].toLowerCase())
) {
return true
}
@@ -301,22 +310,22 @@ export default {
var text = ''
if (message.error) {
text =
- 'Konnte ' +
- (message.amount / 100).toFixed(2) +
- '€ zu ' +
- message.user.firstname +
- ' ' +
- message.user.lastname +
- ' hinzufügen.'
+ 'Konnte ' +
+ (message.amount / 100).toFixed(2) +
+ '€ zu ' +
+ message.user.firstname +
+ ' ' +
+ message.user.lastname +
+ ' hinzufügen.'
} else {
text =
- '' +
- (message.amount / 100).toFixed(2) +
- '€ wurde zu ' +
- message.user.firstname +
- ' ' +
- message.user.lastname +
- ' hinzugefügt.'
+ '' +
+ (message.amount / 100).toFixed(2) +
+ '€ wurde zu ' +
+ message.user.firstname +
+ ' ' +
+ message.user.lastname +
+ ' hinzugefügt.'
}
return text
}
diff --git a/src/components/baruser/SearchBar.vue b/src/components/baruser/SearchBar.vue
index db5e54c..faa12e2 100644
--- a/src/components/baruser/SearchBar.vue
+++ b/src/components/baruser/SearchBar.vue
@@ -14,6 +14,7 @@
full-width
:loading="loading"
:search-input.sync="filter"
+ clearable
>
{{ search_person }}
@@ -79,7 +80,6 @@ export default {
}),
addUser() {
this.addCreditList(this.user)
- this.user = null
},
clickMenu() {
if (this.menu) this.deactivateMenu()
diff --git a/src/plugins/routes.js b/src/plugins/routes.js
index f0c7d92..0e716ce 100644
--- a/src/plugins/routes.js
+++ b/src/plugins/routes.js
@@ -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 = {
@@ -77,7 +77,8 @@ const url = {
},
barU: {
storno: main + 'bar/storno',
- lock: main + 'bar/lock'
+ lock: main + 'bar/lock',
+ addUser: main + 'bar/addUser'
},
gastro: {
setDrink: main + 'gastro/setDrink',
diff --git a/src/router/index.js b/src/router/index.js
index aee9bd6..a088eda 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -22,9 +22,9 @@ import ManagementNavigation from '@/components/vorstand/ManagementNavigation'
import GastroNavigation from '@/components/gastro/GastroNavigation'
import PriceListView from '@/views/contents/PriceListView'
import UserManager from '@/components/vorstand/UserManager'
-import WorkgroupManagement from "@/components/vorstand/WorkgroupManagement";
-import JobKindManager from "@/components/vorstand/JobKindManager";
-import JobsRequest from "@/components/user/JobsRequest";
+import WorkgroupManagement from '@/components/vorstand/WorkgroupManagement'
+import JobKindManager from '@/components/vorstand/JobKindManager'
+import JobsRequest from '@/components/user/JobsRequest'
Vue.use(VueRouter)
diff --git a/src/store/index.js b/src/store/index.js
index e68ab38..ec94a0b 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -10,8 +10,8 @@ import priceList from '@/store/modules/pricelist'
import usermanager from '@/store/modules/userManager'
import wm from '@/store/modules/workgroupManagement'
import jkm from '@/store/modules/jobkindManager'
-import jobInvites from "@/store/modules/jobInvites";
-import jobRequests from "@/store/modules/jobRequests";
+import jobInvites from '@/store/modules/jobInvites'
+import jobRequests from '@/store/modules/jobRequests'
Vue.use(Vuex)
diff --git a/src/store/modules/barUsers.js b/src/store/modules/barUsers.js
index fe56ad1..92e7788 100644
--- a/src/store/modules/barUsers.js
+++ b/src/store/modules/barUsers.js
@@ -14,12 +14,14 @@ const state = {
const mutations = {
setAllUsers: (state, users) => {
+ console.log(users)
state.allUsers = []
state.allUsers = users
for (let i = 0; i < state.allUsers.length; i++) {
state.allUsers[i].fullName =
state.allUsers[i].firstname + ' ' + state.allUsers[i].lastname
}
+ console.log(state.allUsers)
},
setUsers: (state, users) => {
for (let user in users) {
@@ -86,10 +88,11 @@ const mutations = {
message.amount = message.amount + data.amount
message.visible = true
message.date = new Date()
- message.timeout = setTimeout(() => {message.visible = false}, 5000)
+ message.timeout = setTimeout(() => {
+ message.visible = false
+ }, 5000)
return
- }
- else {
+ } else {
message.visible = false
}
}
@@ -102,7 +105,9 @@ const mutations = {
visible: true,
amount: data.amount,
date: new Date(),
- timeout: setTimeout(() => {message2.visible = false}, 5000)
+ timeout: setTimeout(() => {
+ message2.visible = false
+ }, 5000)
}
state.messages.unshift(message2)
},
diff --git a/src/store/modules/jobInvites.js b/src/store/modules/jobInvites.js
index b5094f8..f1b8f1f 100644
--- a/src/store/modules/jobInvites.js
+++ b/src/store/modules/jobInvites.js
@@ -71,23 +71,24 @@ const mutations = {
})
filteredWorkers.forEach(worker => {
if (
- !item.worker.find(a => {
- return a.id === worker.id
- })
+ !item.worker.find(a => {
+ return a.id === worker.id
+ })
) {
item.worker.push(worker)
}
})
item.worker.forEach(worker => {
if (
- !filteredWorkers.find(a => {
- return a.id === worker.id
- })
+ !filteredWorkers.find(a => {
+ return a.id === worker.id
+ })
) {
item.worker.splice(item.worker.indexOf(worker), 1)
}
})
- })})
+ })
+ })
},
updateMonthLocked: (state, { locked, date, getters, from_me }) => {
let mop
@@ -151,10 +152,11 @@ const mutations = {
return item.id === day.jobkinddate[jobkind].job_kind.id
})
day.jobkinddate[jobkind].worker = worker ? worker.worker : []
- day.jobkinddate[jobkind].backupWorker = worker ? worker.backupWorker : []
+ day.jobkinddate[jobkind].backupWorker = worker
+ ? worker.backupWorker
+ : []
}
})
-
},
setDayLoading: (state, { getters, date, value }) => {
let day = getters.getDayToMe(date)
@@ -162,7 +164,6 @@ const mutations = {
a.day.loading = value
console.log('day', value ? 'loading' : 'not loading', day, a.day.loading)
})
-
},
deleteJobInviteFromMe: (state, jobinvite) => {
var item = state.jobInvitesFromMe.find(item => {
@@ -190,20 +191,35 @@ const actions = {
{ headers: { Token: rootState.login.user.accessToken } }
)
const workers_from_me = await axios.post(
- url.user.getJobOnDates,
- from_me.data,
- { headers: { Token: rootState.login.user.accessToken } }
+ url.user.getJobOnDates,
+ from_me.data,
+ { headers: { Token: rootState.login.user.accessToken } }
)
commit('setJobInvitesFromMe', from_me.data)
workers_from_me.data.forEach(item => {
var date = new Date(
- item.day.date.year,
- item.day.date.month - 1,
- item.day.date.day
+ item.day.date.year,
+ item.day.date.month - 1,
+ item.day.date.day
)
- commit('updateMonthJobkind', { data: item.jobkinddate, date, getters, from_me: true })
- commit('updateMonthWorker', { workers: item.worker, date, getters, from_me: true })
- commit('updateMonthLocked', { locked: item.day.locked, date, getters, from_me: true })
+ commit('updateMonthJobkind', {
+ data: item.jobkinddate,
+ date,
+ getters,
+ from_me: true
+ })
+ commit('updateMonthWorker', {
+ workers: item.worker,
+ date,
+ getters,
+ from_me: true
+ })
+ commit('updateMonthLocked', {
+ locked: item.day.locked,
+ date,
+ getters,
+ from_me: true
+ })
})
const to_me = await axios.post(
url.user.getJobInvites,
@@ -229,9 +245,24 @@ const actions = {
item.day.date.month - 1,
item.day.date.day
)
- commit('updateMonthJobkind', { data: item.jobkinddate, date, getters, from_me: false })
- commit('updateMonthWorker', { workers: item.worker, date, getters, from_me: false })
- commit('updateMonthLocked', { locked: item.day.locked, date, getters, from_me: false })
+ commit('updateMonthJobkind', {
+ data: item.jobkinddate,
+ date,
+ getters,
+ from_me: false
+ })
+ commit('updateMonthWorker', {
+ workers: item.worker,
+ date,
+ getters,
+ from_me: false
+ })
+ commit('updateMonthLocked', {
+ locked: item.day.locked,
+ date,
+ getters,
+ from_me: false
+ })
})
commit('setJobInvitesLoading', false)
dispatch('getLifeTime', null, { root: true })
@@ -269,7 +300,8 @@ const actions = {
commit('updateMonthWorker', {
workers: [...response.data],
date: new Date(data.year, data.month - 1, data.day),
- getters, from_me: false
+ getters,
+ from_me: false
})
commit('setDayLoading', { date, getters, value: false })
dispatch('getLifeTime', null, { root: true })
@@ -281,15 +313,15 @@ const actions = {
},
async deleteJob({ commit, rootState, dispatch, getters }, data) {
var date = new Date(data.year, data.month - 1, data.day)
- commit('setDayLoading', {date, getters, value: true})
+ commit('setDayLoading', { date, getters, value: true })
commit('setJobInvitesLoading', true)
try {
const response = await axios.post(
- url.user.deleteJob,
- { ...data },
- {
- headers: { Token: rootState.login.user.accessToken }
- }
+ url.user.deleteJob,
+ { ...data },
+ {
+ headers: { Token: rootState.login.user.accessToken }
+ }
)
console.log(response.data)
commit('updateMonthWorker', {
@@ -297,7 +329,7 @@ const actions = {
date: new Date(data.year, data.month - 1, data.day),
getters
})
- commit('setDayLoading', {date, getters, value: false})
+ commit('setDayLoading', { date, getters, value: false })
dispatch('getLifeTime', null, { root: true })
commit('setJobInvitesLoading', false)
} catch (e) {
@@ -320,10 +352,12 @@ const actions = {
if (e.response.status === 401) dispatch('logout', null, { root: true })
}
},
- async deleteJobInviteFromMe({ commit, rootState, dispatch}, data) {
+ async deleteJobInviteFromMe({ commit, rootState, dispatch }, data) {
try {
commit('setJobInvitesLoading', true)
- await axios.post(url.user.deletJobInvite, data, {headers: {Token: rootState.login.user.accessToken}})
+ await axios.post(url.user.deletJobInvite, data, {
+ headers: { Token: rootState.login.user.accessToken }
+ })
commit('deleteJobInviteFromMe', data)
commit('setJobInvitesLoading', false)
} catch (e) {
diff --git a/src/store/modules/jobRequests.js b/src/store/modules/jobRequests.js
index 92c8df1..51f9d4f 100644
--- a/src/store/modules/jobRequests.js
+++ b/src/store/modules/jobRequests.js
@@ -296,7 +296,11 @@ const actions = {
const response = await axios.post(url.user.setJobRequests, data, {
headers: { Token: rootState.login.user.accessToken }
})
- response.data.on_date = new Date(response.data.on_date.year, response.data.on_date.month - 1, response.data.on_date.day)
+ response.data.on_date = new Date(
+ response.data.on_date.year,
+ response.data.on_date.month - 1,
+ response.data.on_date.day
+ )
commit('updateJobRequestToMe', response.data)
commit('setJobRequestsLoading', false)
dispatch('getLifeTime', null, { root: true })
diff --git a/src/store/modules/jobs.js b/src/store/modules/jobs.js
index 72ab412..fa3d9e3 100644
--- a/src/store/modules/jobs.js
+++ b/src/store/modules/jobs.js
@@ -174,12 +174,20 @@ const mutations = {
filteredWorkers.push(item.user)
})
filteredWorkers.forEach(worker => {
- if (!item.worker.find(a => {return a.id === worker.id})) {
+ if (
+ !item.worker.find(a => {
+ return a.id === worker.id
+ })
+ ) {
item.worker.push(worker)
}
})
item.worker.forEach(worker => {
- if (!filteredWorkers.find(a => {return a.id === worker.id})) {
+ if (
+ !filteredWorkers.find(a => {
+ return a.id === worker.id
+ })
+ ) {
item.worker.splice(item.worker.indexOf(worker), 1)
}
})
@@ -318,15 +326,15 @@ const actions = {
commit('setAllDayLoading')
try {
const response = await axios.post(
- url.vorstand.sm.getUsers,
- { ...data },
- { headers: { Token: rootState.login.user.accessToken } }
+ url.vorstand.sm.getUsers,
+ { ...data },
+ { headers: { Token: rootState.login.user.accessToken } }
)
for (var day in response.data) {
var date = new Date(
- response.data[day].day.date.year,
- response.data[day].day.date.month - 1,
- response.data[day].day.date.day
+ response.data[day].day.date.year,
+ response.data[day].day.date.month - 1,
+ response.data[day].day.date.day
)
commit('updateMonthJobkind', {
data: [...response.data[day].jobkinddate],
@@ -352,9 +360,8 @@ const actions = {
},
async addJob({ commit, rootState, dispatch, getters }, data) {
var date = new Date(data.year, data.month - 1, data.day)
- commit('setDayLoading', {date, getters})
+ commit('setDayLoading', { date, getters })
try {
-
const response = await axios.post(
url.user.addJob,
{ ...data },
@@ -367,7 +374,7 @@ const actions = {
date: new Date(data.year, data.month - 1, data.day),
getters
})
- commit('setDayNotLoading', {date, getters})
+ commit('setDayNotLoading', { date, getters })
dispatch('getLifeTime', null, { root: true })
} catch (e) {
if (e.response)
@@ -377,14 +384,14 @@ const actions = {
// eslint-disable-next-line no-unused-vars
async deleteJob({ commit, rootState, dispatch, getters }, data) {
var date = new Date(data.year, data.month - 1, data.day)
- commit('setDayLoading', {date, getters})
+ commit('setDayLoading', { date, getters })
try {
const response = await axios.post(
- url.user.deleteJob,
- { ...data },
- {
- headers: { Token: rootState.login.user.accessToken }
- }
+ url.user.deleteJob,
+ { ...data },
+ {
+ headers: { Token: rootState.login.user.accessToken }
+ }
)
console.log(response.data)
commit('updateMonthWorker', {
@@ -392,7 +399,7 @@ const actions = {
date: new Date(data.year, data.month - 1, data.day),
getters
})
- commit('setDayNotLoading', {date, getters})
+ commit('setDayNotLoading', { date, getters })
dispatch('getLifeTime', null, { root: true })
} catch (e) {
console.log(e)
diff --git a/src/store/modules/serviceManagement.js b/src/store/modules/serviceManagement.js
index 79e9e61..f761387 100644
--- a/src/store/modules/serviceManagement.js
+++ b/src/store/modules/serviceManagement.js
@@ -173,13 +173,21 @@ const mutations = {
filteredWorkers.push(item.user)
})
filteredWorkers.forEach(worker => {
- if (!item.worker.find(a => {return a.id === worker.id})) {
+ if (
+ !item.worker.find(a => {
+ return a.id === worker.id
+ })
+ ) {
item.worker.push(worker)
item.backupWorker.push(worker)
}
})
item.worker.forEach(worker => {
- if (!filteredWorkers.find(a => {return a.id === worker.id})) {
+ if (
+ !filteredWorkers.find(a => {
+ return a.id === worker.id
+ })
+ ) {
item.worker.splice(item.worker.indexOf(worker), 1)
}
})
@@ -233,7 +241,6 @@ const mutations = {
day.jobkinddate[jobkind].worker = worker ? worker.worker : []
day.jobkinddate[jobkind].backupWorker = worker ? worker.backupWorker : []
}
-
},
setAllDayLoading: state => {
for (let week = 0; week < state.month.length; week++) {
@@ -351,8 +358,16 @@ const actions = {
{ headers: { Token: rootState.login.user.accessToken } }
)
console.log(response.data)
- let date = new Date(response.data.date.year, response.data.date.month - 1, response.data.date.day)
- commit('updateMonthLocked', { locked: response.data.locked, date, getters })
+ let date = new Date(
+ response.data.date.year,
+ response.data.date.month - 1,
+ response.data.date.day
+ )
+ commit('updateMonthLocked', {
+ locked: response.data.locked,
+ date,
+ getters
+ })
dispatch('getLifeTime', null, { root: true })
} catch (e) {
if (e.response)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 2f1ec2d..d407fce 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -172,10 +172,11 @@ const mutations = {
message.amount = message.amount + data.amount
message.visible = true
message.date = new Date()
- message.timeout = setTimeout(() => {message.visible = false}, 300000)
+ message.timeout = setTimeout(() => {
+ message.visible = false
+ }, 300000)
return
- }
- else {
+ } else {
message.visible = false
}
}
@@ -188,10 +189,11 @@ const mutations = {
visible: true,
amount: data.amount,
date: new Date(),
- timeout: setTimeout(() => {message2.visible = false}, 300000)
+ timeout: setTimeout(() => {
+ message2.visible = false
+ }, 300000)
}
state.messages.unshift(message2)
-
},
updateMessage: (state, data) => {
var message = state.messages.find(msg => {
@@ -324,7 +326,9 @@ const actions = {
},
async getTokens({ commit, rootState, dispatch }) {
try {
- const response = await axios.get(url.user.getAccessTokens, {headers: {Token: rootState.login.user.accessToken}})
+ const response = await axios.get(url.user.getAccessTokens, {
+ headers: { Token: rootState.login.user.accessToken }
+ })
commit('setTokens', response.data)
dispatch('getLifeTime', null, { root: true })
} catch (e) {
@@ -334,7 +338,9 @@ const actions = {
},
async deleteToken({ commit, rootState, dispatch }, token) {
try {
- const response = await axios.post(url.user.getAccessTokens, token,{headers: {Token: rootState.login.user.accessToken}})
+ const response = await axios.post(url.user.getAccessTokens, token, {
+ headers: { Token: rootState.login.user.accessToken }
+ })
commit('setTokens', response.data)
dispatch('getLifeTime', null, { root: true })
} catch (e) {