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 @@