-
- Dienstverwaltung
-
+ Dienstverwaltung
@@ -11,7 +9,8 @@
- {{ monthArray[date.getMonth()] }} {{ date.getFullYear() }}
+ {{ monthArray[date.getMonth()] }}
+ {{ date.getFullYear() }}
@@ -27,10 +26,10 @@
Woche vom {{ week.startDate.getDate() }}.{{
- week.startDate.getMonth() + 1
+ week.startDate.getMonth() + 1
}}.{{ week.startDate.getFullYear() }} bis
{{ week.endDate.getDate() }}.{{ week.endDate.getMonth() + 1 }}.{{
- week.endDate.getFullYear()
+ week.endDate.getFullYear()
}}
@@ -90,11 +89,24 @@ export default {
this.createMonth(this.date)
this.getAllUsers()
+ this.getUsers({
+ from_date: {
+ year: this.startDate.getFullYear(),
+ month: this.startDate.getMonth() + 1,
+ day: this.startDate.getDate()
+ },
+ to_date: {
+ year: this.endDate.getFullYear(),
+ month: this.endDate.getMonth() + 1,
+ day: this.endDate.getDate()
+ }
+ })
},
methods: {
...mapActions({
createMonth: 'sm/createMonth',
getAllUsers: 'sm/getAllUsers',
+ getUsers: 'sm/getUsers',
lockDay: 'sm/lockDay'
}),
changeMonth(value) {
@@ -104,6 +116,18 @@ export default {
this.date = new Date(this.date.getFullYear(), this.date.getMonth() + 1)
}
this.createMonth(this.date)
+ this.getUsers({
+ from_date: {
+ year: this.startDate.getFullYear(),
+ month: this.startDate.getMonth() + 1,
+ day: this.startDate.getDate()
+ },
+ to_date: {
+ year: this.endDate.getFullYear(),
+ month: this.endDate.getMonth() + 1,
+ day: this.endDate.getDate()
+ }
+ })
},
lockDays(value) {
for (var week in this.month) {
@@ -121,7 +145,9 @@ export default {
},
computed: {
...mapGetters({
- month: 'sm/month'
+ month: 'sm/month',
+ startDate: 'sm/getStartDate',
+ endDate: 'sm/getEndDate'
})
}
}
diff --git a/src/components/vorstand/ServiceManagementComponents/Day.vue b/src/components/vorstand/ServiceManagementComponents/Day.vue
index ef89c2e..c34581e 100644
--- a/src/components/vorstand/ServiceManagementComponents/Day.vue
+++ b/src/components/vorstand/ServiceManagementComponents/Day.vue
@@ -3,7 +3,7 @@
{{ day.name }} den {{ day.date.getDate() }}.{{
- day.date.getMonth() + 1
+ day.date.getMonth() + 1
}}.{{ day.date.getFullYear() }}
@@ -39,14 +39,13 @@
close
@click="data.select"
@click:close="remove(data.item)"
- >
- {{ data.item.firstname }} {{ data.item.lastname }}
-
+ >{{ data.item.firstname }} {{ data.item.lastname }}
- {{ data.item.firstname }} {{ data.item.lastname }}
+ {{ data.item.firstname }}
+ {{ data.item.lastname }}
@@ -57,7 +56,7 @@
{{ lockedText }}
- {{lockedTextBtn}}
+ {{ lockedTextBtn }}
@@ -80,13 +79,13 @@ export default {
},
created() {
this.setLoading(this.day.date)
- this.getUser({
- date: this.day.date.getTime() / 1000,
- startdatetime: this.day.date,
- year: this.day.date.getFullYear(),
- month: this.day.date.getMonth() + 1,
- day: this.day.date.getDate()
- })
+ //this.getUser({
+ // date: this.day.date.getTime() / 1000,
+ // startdatetime: this.day.date,
+ // year: this.day.date.getFullYear(),
+ // month: this.day.date.getMonth() + 1,
+ // day: this.day.date.getDate()
+ //})
},
methods: {
...mapActions({
@@ -129,7 +128,12 @@ export default {
}
},
lock() {
- this.lockDay({year: this.day.date.getFullYear(), month: this.day.date.getMonth() + 1, day: this.day.date.getDate(), locked: !this.day.locked})
+ this.lockDay({
+ year: this.day.date.getFullYear(),
+ month: this.day.date.getMonth() + 1,
+ day: this.day.date.getDate(),
+ locked: !this.day.locked
+ })
}
},
computed: {
@@ -181,16 +185,16 @@ export default {
}
}
}
- },
- day() {
- this.getUser({
- date: this.day.date.getTime() / 1000,
- startdatetime: this.day.date,
- year: this.day.date.getFullYear(),
- month: this.day.date.getMonth() + 1,
- day: this.day.date.getDate()
- })
}
+ //day() {
+ // this.getUser({
+ // date: this.day.date.getTime() / 1000,
+ // startdatetime: this.day.date,
+ // year: this.day.date.getFullYear(),
+ // month: this.day.date.getMonth() + 1,
+ // day: this.day.date.getDate()
+ // })
+ //}
}
}
diff --git a/src/plugins/routes.js b/src/plugins/routes.js
index 547b80f..822bba7 100644
--- a/src/plugins/routes.js
+++ b/src/plugins/routes.js
@@ -31,6 +31,7 @@ const url = {
addUser: main + 'sm/addUser',
deleteUser: main + 'sm/deleteUser',
getUser: main + 'sm/getUser',
+ getUsers: main + 'sm/getUsers',
lockDay: main + 'sm/lockDay',
searchUser: main + 'sm/searchWithExtern'
},
@@ -45,6 +46,7 @@ const url = {
user: {
config: main + 'user/saveConfig',
job: main + 'user/job',
+ jobs: main + 'user/jobs',
addJob: main + 'user/addJob',
deleteJob: main + 'user/deleteJob',
transactJob: main + 'user/transactJob',
diff --git a/src/store/modules/jobs.js b/src/store/modules/jobs.js
index db6c20e..2fd0ca2 100644
--- a/src/store/modules/jobs.js
+++ b/src/store/modules/jobs.js
@@ -155,6 +155,13 @@ const mutations = {
}
}
},
+ setAllDayLoading: state => {
+ for (let week = 0; week < state.month.length; week++) {
+ for (let day in state.month[week].days) {
+ state.month[week].days[day].loading = true
+ }
+ }
+ },
setDayLoading: (state, { date, getters }) => {
let day = getters.getDay(date)
day.loading = true
@@ -228,6 +235,38 @@ const actions = {
setDayNotLoading({ commit, getters }, date) {
commit('setDayNotLoading', { date, getters })
},
+ async getUsers({ commit, rootState, dispatch, getters }, data) {
+ commit('setAllDayLoading')
+ try {
+ const response = await axios.post(
+ url.user.jobs,
+ { ...data },
+ { headers: { Token: rootState.login.user.accessToken } }
+ )
+ for (let day in response.data) {
+ for (let item = 0; item < response.data[day].worker.length; item++) {
+ commit('updateMonth', {
+ ...response.data[day].worker[item],
+ com: 'add',
+ day: response.data[day].day
+ })
+ }
+ commit('updateMonth', {
+ start: response.data[day].day.date,
+ day: response.data[day].day
+ })
+ var date = new Date(
+ response.data[day].day.date.year,
+ response.data[day].day.date.month - 1,
+ response.data[day].day.date.day
+ )
+ commit('setDayNotLoading', { date: date, getters })
+ }
+ } catch (e) {
+ if (e.response)
+ if (e.response.status === 401) dispatch('logout', null, { root: true })
+ }
+ },
async getUser({ commit, rootState, dispatch, getters }, data) {
commit('setDayLoading', { date: data.startdatetime, getters })
try {
@@ -322,6 +361,12 @@ const getters = {
},
allUsers: state => {
return state.allUsers
+ },
+ getStartDate: state => {
+ return state.month[0].startDate
+ },
+ getEndDate: state => {
+ return state.month[state.month.length - 1].endDate
}
}
diff --git a/src/store/modules/serviceManagement.js b/src/store/modules/serviceManagement.js
index 9910bf6..a195db8 100644
--- a/src/store/modules/serviceManagement.js
+++ b/src/store/modules/serviceManagement.js
@@ -120,6 +120,7 @@ const mutations = {
}
}
state.month = month
+ console.log(month)
},
setStartEndDate: week => {
if (week.days.monday) {
@@ -180,6 +181,13 @@ const mutations = {
}
}
},
+ setAllDayLoading: state => {
+ for (let week = 0; week < state.month.length; week++) {
+ for (let day in state.month[week].days) {
+ state.month[week].days[day].loading = true
+ }
+ }
+ },
setDayLoading: (state, { date, getters }) => {
let day = getters.getDay(date)
day.loading = true
@@ -227,6 +235,39 @@ const actions = {
if (e.response.status === 401) dispatch('logout', null, { root: true })
}
},
+ // eslint-disable-next-line no-unused-vars
+ async getUsers({ commit, rootState, dispatch, getters }, data) {
+ commit('setAllDayLoading')
+ try {
+ const response = await axios.post(
+ url.vorstand.sm.getUsers,
+ { ...data },
+ { headers: { Token: rootState.login.user.accessToken } }
+ )
+ for (let day in response.data) {
+ for (let item = 0; item < response.data[day].worker.length; item++) {
+ commit('updateMonth', {
+ ...response.data[day].worker[item],
+ com: 'add',
+ day: response.data[day].day
+ })
+ }
+ commit('updateMonth', {
+ start: response.data[day].day.date,
+ day: response.data[day].day
+ })
+ var date = new Date(
+ response.data[day].day.date.year,
+ response.data[day].day.date.month - 1,
+ response.data[day].day.date.day
+ )
+ commit('setDayNotLoading', { date: date, getters })
+ }
+ } catch (e) {
+ if (e.response)
+ if (e.response.status === 401) dispatch('logout', null, { root: true })
+ }
+ },
async getUser({ commit, rootState, dispatch, getters }, data) {
commit('setDayLoading', { date: data.startdatetime, getters })
try {
@@ -312,6 +353,12 @@ const getters = {
},
disabled: state => {
return state.disabled
+ },
+ getStartDate: state => {
+ return state.month[0].startDate
+ },
+ getEndDate: state => {
+ return state.month[state.month.length - 1].endDate
}
}
diff --git a/vue.config.js b/vue.config.js
index 2bb43cb..573f9db 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -8,5 +8,8 @@ module.exports = {
// key: fs.readFileSync('./cert/server.key'),
// cert: fs.readFileSync('./cert/server.crt')
// }
+ },
+ configureWebpack: {
+ devtool: 'source-map'
}
}