From 9082b005679f49ef0e64fcaf1cb8cd35d7c9b4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Mon, 24 Feb 2020 12:19:13 +0100 Subject: [PATCH] finished ##186 --- src/components/user/Jobs.vue | 2 +- src/components/user/Jobs/Day.vue | 9 +++- src/components/vorstand/ServiceManagement.vue | 17 +++++- .../ServiceManagementComponents/Day.vue | 33 +++++++++--- src/plugins/routes.js | 3 +- src/store/modules/jobs.js | 15 +++--- src/store/modules/serviceManagement.js | 53 ++++++++++++++----- 7 files changed, 97 insertions(+), 35 deletions(-) diff --git a/src/components/user/Jobs.vue b/src/components/user/Jobs.vue index 642b1d4..a50bef1 100644 --- a/src/components/user/Jobs.vue +++ b/src/components/user/Jobs.vue @@ -21,7 +21,7 @@ - + Woche vom {{ week.startDate.getDate() }}.{{ week.startDate.getMonth() + 1 diff --git a/src/components/user/Jobs/Day.vue b/src/components/user/Jobs/Day.vue index d2db7df..29b96f2 100644 --- a/src/components/user/Jobs/Day.vue +++ b/src/components/user/Jobs/Day.vue @@ -23,7 +23,14 @@ - + +
+ Du kannst dich nicht zum Bardienst eintragen, da der Tag gesperrt ist. +
+
+ Du kannst dich nicht Bardienst eintragen, da mehr als 2 Personen schon eingetragen sind. +
+
Hier kannst du dich zum Bardienst eintragen.
+ + Monat sperren + Monat freigeben + - + Woche vom {{ week.startDate.getDate() }}.{{ week.startDate.getMonth() + 1 @@ -81,7 +85,8 @@ export default { methods: { ...mapActions({ createMonth: 'sm/createMonth', - getAllUsers: 'sm/getAllUsers' + getAllUsers: 'sm/getAllUsers', + lockDay: 'sm/lockDay' }), changeMonth(value) { if (value === -1) { @@ -90,6 +95,14 @@ export default { this.date = new Date(this.date.getFullYear(), this.date.getMonth() + 1) } this.createMonth(this.date) + }, + lockDays(value) { + for (var week in this.month) { + for (var dayint in this.month[week].days) { + var day = this.month[week].days[dayint] + this.lockDay({year: day.date.getFullYear(), month: day.date.getMonth() + 1, day: day.date.getDate(), locked: value}) + } + } } }, computed: { diff --git a/src/components/vorstand/ServiceManagementComponents/Day.vue b/src/components/vorstand/ServiceManagementComponents/Day.vue index 264cfaa..5d9440c 100644 --- a/src/components/vorstand/ServiceManagementComponents/Day.vue +++ b/src/components/vorstand/ServiceManagementComponents/Day.vue @@ -24,14 +24,13 @@ label="Dienste" filled color="green" - @input="searchInput=null" + @input="searchInput = null" :search-input.sync="searchInput" - @blur="focused=false" - @focus="focused=true" - + @blur="focused = false" + @focus="focused = true" >