From 6dd5f75d2e4e180743a745cbcfe75a028486bc30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Sun, 24 May 2020 23:24:58 +0200 Subject: [PATCH] =?UTF-8?q?fixed,=20dass=20wenn=20die=20dienst=C3=BCbersic?= =?UTF-8?q?ht=20neu=20geladen=20wird,=20man=20bei=20dem=20gleichen=20Monat?= =?UTF-8?q?=20bleibt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user/Jobs.vue | 45 +++++++--- src/components/user/Jobs/Day.vue | 86 +++++++++++-------- src/components/user/UserNavigation.vue | 2 +- .../vorstand/ManagementNavigation.vue | 3 +- src/components/vorstand/ServiceManagement.vue | 38 +++++--- src/plugins/routes.js | 4 +- src/router/index.js | 5 +- 7 files changed, 111 insertions(+), 72 deletions(-) diff --git a/src/components/user/Jobs.vue b/src/components/user/Jobs.vue index 64ad1e5..21d465b 100644 --- a/src/components/user/Jobs.vue +++ b/src/components/user/Jobs.vue @@ -4,7 +4,7 @@ Dienstübersicht - + {{ keyboard_arrow_left }} @@ -13,7 +13,7 @@ {{ date.getFullYear() }} - + {{ keyboard_arrow_right }} @@ -52,7 +52,7 @@ export default { return { keyboard_arrow_left: mdiChevronLeft, keyboard_arrow_right: mdiChevronRight, - date: new Date(), + date: new Date(this.$route.params.year, this.$route.params.month -1, 1), monthArray: [ 'Januar', 'Februar', @@ -71,17 +71,6 @@ export default { }, created() { this.getActiveUser() - for (let intDate = 1; intDate < 7; intDate++) { - 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.getAllJobKinds() this.createMonth(this.date) this.getAllUsers() @@ -140,6 +129,34 @@ export default { startDate: 'jobs/getStartDate', endDate: 'jobs/getEndDate' }) + }, + watch: { + $route() { + this.getActiveUser() + console.log(this.$route.params) + console.log(this.date) + this.date = new Date(this.$route.params.year, this.$route.params.month - 1, 1) + this.getAllJobKinds() + 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() + } + }) + this.getTransactJobs({ + year: this.date.getFullYear(), + month: this.date.getMonth() + 1, + day: 1 + }) + } } } diff --git a/src/components/user/Jobs/Day.vue b/src/components/user/Jobs/Day.vue index bed17f9..05a8bd3 100644 --- a/src/components/user/Jobs/Day.vue +++ b/src/components/user/Jobs/Day.vue @@ -73,42 +73,47 @@ senden - -
+ +
Hier kannst du dich zum Bardienst eintragen.
- - - - - - {{ jobkinddateitem.job_kind.name }} - - - - +
+ + + + + + {{ jobkinddateitem.job_kind.name }} + + + + +
+
+ + +
+ Einladen + Abgeben
@@ -188,7 +193,6 @@ export default { setTimeout(() => { this.update += 1 }, 200) - console.log('after adding Job', this.day.jobkinddate) }, userInWorker() { var jobkinddate = this.day.jobkinddate.find(item => { @@ -196,7 +200,6 @@ export default { return workeritem.id === this.activeUser.id }) }) - console.log('userin', !!jobkinddate, !jobkinddate) return !!jobkinddate } }, @@ -227,6 +230,16 @@ export default { }) return test }, + jobkindWithSpace() { + var retVal = this.day.jobkinddate.filter(item => { + if (item.maxpersons <= item.worker.length) + return false + else + return true + }) + return retVal + } + , filterAddJob() { var retVal = this.day.jobkinddate.filter(item => { if (item.maxpersons <= item.worker.length) { @@ -242,7 +255,6 @@ export default { } } }) - console.log('filterAddJob', retVal, retVal.length > 0, this.user.workgroups) return retVal } } diff --git a/src/components/user/UserNavigation.vue b/src/components/user/UserNavigation.vue index a9aa1b0..2ea94ca 100644 --- a/src/components/user/UserNavigation.vue +++ b/src/components/user/UserNavigation.vue @@ -14,7 +14,7 @@ Finanzübersicht - + {{ briefcase }} diff --git a/src/components/vorstand/ManagementNavigation.vue b/src/components/vorstand/ManagementNavigation.vue index 46ffe61..026e900 100644 --- a/src/components/vorstand/ManagementNavigation.vue +++ b/src/components/vorstand/ManagementNavigation.vue @@ -1,7 +1,6 @@