flaschengeist-frontend/src/components/vorstand/ServiceManagement.vue

101 lines
2.5 KiB
Vue
Raw Normal View History

2020-01-18 11:49:49 +00:00
<template>
<div>
<v-content>
<v-toolbar>
<v-toolbar-title>
Dienstverwaltung
</v-toolbar-title>
<v-spacer />
<v-toolbar-items>
<v-btn text icon @click="changeMonth(-1)">
<v-icon>keyboard_arrow_left</v-icon>
</v-btn>
<v-list-item>
2020-01-19 20:31:48 +00:00
<v-list-item-title class="title"
>{{ monthArray[date.getMonth()] }}
{{ date.getFullYear() }}</v-list-item-title
>
2020-01-18 11:49:49 +00:00
</v-list-item>
<v-btn text icon @click="changeMonth(1)">
<v-icon>keyboard_arrow_right</v-icon>
</v-btn>
</v-toolbar-items>
<v-spacer />
</v-toolbar>
<v-card v-for="week in month" :key="month.indexOf(week)">
2020-01-19 20:31:48 +00:00
<v-card-title class="subtitle-1 font-weight-bold">
2020-01-18 11:49:49 +00:00
Woche vom {{ week.startDate.getDate() }}.{{
2020-01-19 20:31:48 +00:00
week.startDate.getMonth() + 1
}}.{{ week.startDate.getFullYear() }} bis
{{ week.endDate.getDate() }}.{{ week.endDate.getMonth() + 1 }}.{{
week.endDate.getFullYear()
}}
2020-01-18 11:49:49 +00:00
</v-card-title>
<v-card-text>
2020-01-19 20:31:48 +00:00
<v-row justify="start" align="start">
<div v-for="day in week.days" :key="day.id">
<v-col>
<Day v-bind:day="day"/>
</v-col>
</div>
</v-row>
2020-01-18 11:49:49 +00:00
</v-card-text>
</v-card>
</v-content>
</div>
</template>
<script>
import { mapGetters, mapActions } from 'vuex'
import Day from './ServiceManagementComponents/Day'
export default {
name: 'ServiceManagement',
components: { Day },
data() {
return {
id: 0,
date: new Date(),
monthArray: [
2020-01-19 20:31:48 +00:00
'Januar',
'Februar',
'März',
'April',
'Mai',
'Juni',
'Juli',
'August',
'September',
'Oktober',
'November',
'Dezember'
2020-01-18 11:49:49 +00:00
]
}
},
created() {
this.createMonth(this.date)
this.getAllUsers()
},
methods: {
...mapActions({
createMonth: 'sm/createMonth',
getAllUsers: 'sm/getAllUsers'
}),
changeMonth(value) {
if (value === -1) {
2020-01-19 20:31:48 +00:00
this.date = new Date(this.date.getFullYear(), this.date.getMonth() - 1)
2020-01-18 11:49:49 +00:00
} else {
2020-01-19 20:31:48 +00:00
this.date = new Date(this.date.getFullYear(), this.date.getMonth() + 1)
2020-01-18 11:49:49 +00:00
}
this.createMonth(this.date)
}
},
computed: {
...mapGetters({
month: 'sm/month',
2020-01-18 11:49:49 +00:00
})
}
}
</script>
<style scoped></style>