From 6c5c67f45b03a5c077dbe7432e17482302dca3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Mon, 24 Aug 2020 14:04:21 +0200 Subject: [PATCH] =?UTF-8?q?Freigetr=C3=A4nke=20Listen=20f=C3=BCr=20Dienst,?= =?UTF-8?q?=20AG=20und=20Band?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Der Vorstand kann nun die Freigetränkelisten von Diensten, AG's und Bands anschauen. --- src/components/vorstand/FreeDrinkList.vue | 8 +- .../FreeDrinkList/FreeDrinkListBand.vue | 123 ++++++++++++++++++ .../FreeDrinkList/FreeDrinkListConfig.vue | 5 +- .../FreeDrinkListConfigConfigItem.vue | 12 +- .../FreeDrinkList/FreeDrinkListJob.vue | 27 +++- .../FreeDrinkList/FreeDrinkListWorkgroup.vue | 112 ++++++++++++++++ src/router/index.js | 12 ++ 7 files changed, 283 insertions(+), 16 deletions(-) create mode 100644 src/components/vorstand/FreeDrinkList/FreeDrinkListBand.vue create mode 100644 src/components/vorstand/FreeDrinkList/FreeDrinkListWorkgroup.vue diff --git a/src/components/vorstand/FreeDrinkList.vue b/src/components/vorstand/FreeDrinkList.vue index 7335494..546be23 100644 --- a/src/components/vorstand/FreeDrinkList.vue +++ b/src/components/vorstand/FreeDrinkList.vue @@ -7,11 +7,11 @@ Dienstgetränke - - Liste 2 + + AG-Getränke - - Liste 3 + + Bandgetränke Einstellungen diff --git a/src/components/vorstand/FreeDrinkList/FreeDrinkListBand.vue b/src/components/vorstand/FreeDrinkList/FreeDrinkListBand.vue new file mode 100644 index 0000000..98848c1 --- /dev/null +++ b/src/components/vorstand/FreeDrinkList/FreeDrinkListBand.vue @@ -0,0 +1,123 @@ + + + + + \ No newline at end of file diff --git a/src/components/vorstand/FreeDrinkList/FreeDrinkListConfig.vue b/src/components/vorstand/FreeDrinkList/FreeDrinkListConfig.vue index 326e95a..e7b4951 100644 --- a/src/components/vorstand/FreeDrinkList/FreeDrinkListConfig.vue +++ b/src/components/vorstand/FreeDrinkList/FreeDrinkListConfig.vue @@ -10,6 +10,7 @@ v-for="(free_drink_config, index) in free_drink_list_config"> @@ -27,9 +28,9 @@ - + - + mdi-plus diff --git a/src/components/vorstand/FreeDrinkList/FreeDrinkListConfigComponents/FreeDrinkListConfigConfigItem.vue b/src/components/vorstand/FreeDrinkList/FreeDrinkListConfigComponents/FreeDrinkListConfigConfigItem.vue index 8f8bd70..ea797f5 100644 --- a/src/components/vorstand/FreeDrinkList/FreeDrinkListConfigComponents/FreeDrinkListConfigConfigItem.vue +++ b/src/components/vorstand/FreeDrinkList/FreeDrinkListConfigComponents/FreeDrinkListConfigConfigItem.vue @@ -2,15 +2,16 @@
- + - + - + - + diff --git a/src/components/vorstand/FreeDrinkList/FreeDrinkListJob.vue b/src/components/vorstand/FreeDrinkList/FreeDrinkListJob.vue index ba66a1f..7d35878 100644 --- a/src/components/vorstand/FreeDrinkList/FreeDrinkListJob.vue +++ b/src/components/vorstand/FreeDrinkList/FreeDrinkListJob.vue @@ -46,6 +46,10 @@ data() { text: 'Anzahl', value: 'count' }, + { + text: 'User', + value: 'user' + }, { text: 'Preis pro Getränk', value: 'pricepro' @@ -62,9 +66,7 @@ computed: { sum() { let sum = 0 this.free_drink_list_history_job_without_canceled.forEach(item => { - if (item.canceled) { - sum += item.free_drink_config.price - } + sum += item.free_drink_config.price }) return sum }, @@ -85,16 +87,29 @@ computed: { let history_of_config = history_of_date.filter(item => { return item.free_drink_config_id == drink_config.id }) - if (history_of_config.length > 0) { + // eslint-disable-next-line no-unused-vars + let users = [] + history_of_config.forEach(history_config => { + if (!users.find(user_id => { return user_id == history_config.user_id})) { + users.push(history_config.user_id) + } + }) + users.forEach(user_id => { + let history_of_user = history_of_config.filter(item => { + return item.user_id == user_id + }) + if (history_of_user.length > 0) { retVal.push({ date: `${from.getDate()}.${from.getMonth() + 1}.${from.getFullYear()}`, label: drink_config.label, name: drink_config.drink.name, - count: history_of_config.length, + user: `${history_of_user[0].user.firstname} ${history_of_user[0].user.lastname}`, + count: history_of_user.length, pricepro: (drink_config.price / 100).toFixed(2), - sum: (drink_config.price / 100 * history_of_config.length).toFixed(2) + sum: (drink_config.price / 100 * history_of_user.length).toFixed(2) }) } + }) }) } return retVal diff --git a/src/components/vorstand/FreeDrinkList/FreeDrinkListWorkgroup.vue b/src/components/vorstand/FreeDrinkList/FreeDrinkListWorkgroup.vue new file mode 100644 index 0000000..71e2d94 --- /dev/null +++ b/src/components/vorstand/FreeDrinkList/FreeDrinkListWorkgroup.vue @@ -0,0 +1,112 @@ + + + + + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 55690e2..4a4a7cb 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -32,6 +32,8 @@ import FreeDrinkList from '@/components/vorstand/FreeDrinkList' import FreeDrinkListMain from '@/components/vorstand/FreeDrinkList/FreeDrinkListMain' import FreeDrinkListConfig from '@/components/vorstand/FreeDrinkList/FreeDrinkListConfig' import FreeDrinkListJob from '@/components/vorstand/FreeDrinkList/FreeDrinkListJob' +import FreeDrinkListWorkgroup from '@/components/vorstand/FreeDrinkList/FreeDrinkListWorkgroup' +import FreeDrinkListBand from '@/components/vorstand/FreeDrinkList/FreeDrinkListBand' Vue.use(VueRouter) @@ -106,6 +108,16 @@ const routes = [ path: 'freeDrinkListJob', name: 'freeDrinkListJob', component: FreeDrinkListJob + }, + { + path: 'freeDrinkListWorkgroup', + name: 'freeDrinkListWorkgroup', + component: FreeDrinkListWorkgroup + }, + { + path: 'freeDrinkListBand', + name: 'freeDrinkListBand', + component: FreeDrinkListBand } ] }