diff --git a/public/index.html b/public/index.html index 7e96d1c..ec4c4c7 100644 --- a/public/index.html +++ b/public/index.html @@ -1,5 +1,5 @@ - + diff --git a/src/components/user/JobRequests.vue b/src/components/user/JobRequests.vue new file mode 100644 index 0000000..1260bb8 --- /dev/null +++ b/src/components/user/JobRequests.vue @@ -0,0 +1,250 @@ + + + + + diff --git a/src/components/user/Jobs.vue b/src/components/user/Jobs.vue index 642b1d4..77e322d 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 @@ -73,10 +73,12 @@ export default { }, created() { this.createMonth(this.date) + this.getAllUsers() }, methods: { ...mapActions({ - createMonth: 'jobs/createMonth' + createMonth: 'jobs/createMonth', + getAllUsers: 'jobs/getAllUsers' }), changeMonth(value) { if (value === -1) { diff --git a/src/components/user/Jobs/Day.vue b/src/components/user/Jobs/Day.vue index a7c8138..7c14f9c 100644 --- a/src/components/user/Jobs/Day.vue +++ b/src/components/user/Jobs/Day.vue @@ -14,41 +14,80 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ worker.firstname }} {{ worker.lastname }} +
+ {{ worker.firstname }} {{ worker.lastname }} + +
+
+ + + + + + + + senden + +
+ +
+
+ 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.
+
+ + Eintragen + +
@@ -64,25 +103,49 @@ export default { data() { return { account_add: mdiAccountPlus, - searchInput: null + searchInput: null, + requestUser: null } }, created() { this.setLoading(this.day.date) this.getUser({ date: this.day.date.getTime() / 1000, - startdatetime: this.day.date + startdatetime: this.day.date, + year: this.day.date.getFullYear(), + month: this.day.date.getMonth() + 1, + day: this.day.date.getDate() + }) + this.getTransactJobs({}) + this.getTransactJobs({ + year: this.day.date.getFullYear(), + month: this.day.date.getMonth() + 1, + day: this.day.date.getDate() }) }, methods: { ...mapActions({ + getTransactJobs: 'requestJobs/getTransactJobs', getUser: 'jobs/getUser', setLoading: 'jobs/setDayLoading', - setNotLoading: 'jobs/setDayNotLoading' + setNotLoading: 'jobs/setDayNotLoading', + addJob: 'jobs/addJob', + deleteJob: 'jobs/deleteJob', + transactJob: 'jobs/transactJob' }), test(event) { console.log('blur', event) }, + send() { + this.transactJob({ + user: this.requestUser.username, + year: this.day.date.getFullYear(), + month: this.day.date.getMonth() + 1, + day: this.day.date.getDate() + }) + this.requestUser = null + this.searchInput = null + }, color: day => { if (day) { if (day.date.getDay() === 0 || day.date.getDay() === 1) { @@ -97,18 +160,56 @@ export default { } else { return 'grey lighten-4' } + }, + user(worker) { + return worker.username === this.activeUser.username } }, computed: { ...mapGetters({ - disabled: 'jobs/disabled' - }) + disabled: 'jobs/disabled', + activeUser: 'user', + allUsers: 'jobs/allUsers', + transactJobs: 'requestJobs/transactJobs' + }), + userInWorker() { + return this.day.worker.find(a => { + return a.username === this.activeUser.username + }) + }, + specifiedUsers() { + var users = [...this.allUsers] + for (var i in this.day.worker) { + var worker = users.find(a => { + return a.username === this.day.worker[i].username + }) + var index = users.indexOf(worker) + if (worker) users.splice(index, 1) + } + return users + }, + canDelete() { + console.log(this.day.date) + console.log(this.transactJobs) + var transactJob = this.transactJobs.filter(a => { + return a.date - this.day.date === 0 + }) + console.log('filter', transactJob) + var test = transactJob.find(a => { + return a.accepted && a.answerd + }) + console.log('find', test) + return test + } }, watch: { day() { this.getUser({ date: this.day.date.getTime() / 1000, - startdatetime: this.day.date + startdatetime: this.day.date, + year: this.day.date.getFullYear(), + month: this.day.date.getMonth() + 1, + day: this.day.date.getDate() }) }, worker() { diff --git a/src/components/user/UserNavigation.vue b/src/components/user/UserNavigation.vue index ade5ca4..a9aa1b0 100644 --- a/src/components/user/UserNavigation.vue +++ b/src/components/user/UserNavigation.vue @@ -2,7 +2,7 @@ - {{account}} + {{ account }} Home @@ -10,21 +10,29 @@ - {{bank}} + {{ bank }} Finanzübersicht - {{briefcase}} + {{ briefcase }} Dienstübersicht + + + + {{ switchAccount }} + + + Dienstanfragen + - {{account_card_details}} + {{ account_card_details }} Einstellung @@ -32,15 +40,22 @@