+
+
+ Transaktion ist länger als 5 Minuten her!
+
+ Da die Transaktion länger als 5 Minutern her ist, kann eine
+ Stornierung nicht durchgeführt werden. Wende dich bitte an den
+ Finanzer.
+
+
+
+
+ Verstanden
+
+
+
+
+
+
+
+
+
+ {{ now(message.date) }}
+ {{ message.message }}
+ STORNIERT!!!
+ Klicken um zu Stornieren
+
+
+
+
+
+
@@ -22,7 +60,11 @@
class="creditBtn"
block
@click="
- addAmount({ username: user.username, amount: 200 })
+ addAmount({
+ username: user.username,
+ amount: 200,
+ user: user
+ })
"
:color="color"
:disabled="user.locked"
@@ -34,7 +76,11 @@
class="creditBtn"
block
@click="
- addAmount({ username: user.username, amount: 100 })
+ addAmount({
+ username: user.username,
+ amount: 100,
+ user: user
+ })
"
:color="color"
:disabled="user.locked"
@@ -46,7 +92,11 @@
class="creditBtn"
block
@click="
- addAmount({ username: user.username, amount: 50 })
+ addAmount({
+ username: user.username,
+ amount: 50,
+ user: user
+ })
"
:color="color"
:disabled="user.locked"
@@ -60,7 +110,11 @@
class="creditBtn"
block
@click="
- addAmount({ username: user.username, amount: 40 })
+ addAmount({
+ username: user.username,
+ amount: 40,
+ user: user
+ })
"
:color="color"
:disabled="user.locked"
@@ -72,7 +126,11 @@
class="creditBtn"
block
@click="
- addAmount({ username: user.username, amount: 20 })
+ addAmount({
+ username: user.username,
+ amount: 20,
+ user: user
+ })
"
:color="color"
:disabled="user.locked"
@@ -84,7 +142,11 @@
class="creditBtn"
block
@click="
- addAmount({ username: user.username, amount: 10 })
+ addAmount({
+ username: user.username,
+ amount: 10,
+ user: user
+ })
"
:color="color"
:disabled="user.locked"
@@ -113,6 +175,17 @@
>
+
+ {{ message.message }}
+
@@ -129,16 +202,21 @@ export default {
props: {},
data() {
return {
- color: 'green accent-4'
+ color: 'green accent-4',
+ menu: true,
+ dialog: false
}
},
created() {
+ this.menu = this.menu_from_store
this.getUsers()
},
methods: {
...mapActions({
addAmount: 'barUsers/addAmount',
- getUsers: 'barUsers/getUsers'
+ getUsers: 'barUsers/getUsers',
+ deactivate: 'barUsers/deactivateMenu',
+ commitStorno: 'barUsers/storno'
}),
getColor(type) {
return type === 'credit' ? 'title green--text' : 'title red--text'
@@ -152,14 +230,84 @@ export default {
} catch (e) {
return true
}
+ },
+ storno(message) {
+ if (!message.error) {
+ if (!this.under5minutes(message.date)) this.dialog = true
+ else {
+ this.commitStorno({username: message.user.username, amount: message.amount, date: message.date})
+ }
+ }
}
},
computed: {
...mapGetters({
users: 'barUsers/users',
filter: 'barUsers/filter',
- loading: 'barUsers/usersLoading'
- })
+ loading: 'barUsers/usersLoading',
+ messages: 'barUsers/messages',
+ menu_from_store: 'barUsers/menu'
+ }),
+ under5minutes() {
+ return now => {
+ var actual = new Date()
+ var zero = new Date(0)
+ var date = new Date(actual - now)
+ if (
+ date.getFullYear() === zero.getFullYear() &&
+ date.getMonth() === zero.getMonth() &&
+ date.getDate() === zero.getDate()
+ ) {
+ if (date.getMinutes() < 6) {
+ return true
+ }
+ }
+ return false
+ }
+ },
+ now() {
+ return now => {
+ var actual = new Date()
+ var zero = new Date(0)
+ var date = new Date(actual - now)
+ if (date.getFullYear() === zero.getFullYear()) {
+ if (date.getMonth() === zero.getMonth()) {
+ if (date.getDate() === zero.getDate()) {
+ if (date.getHours() === zero.getDate()) {
+ if (date.getMinutes() < 1) {
+ return 'vor ' + date.getSeconds() + ' Sekunden'
+ } else if (date.getMinutes() < 10) {
+ return 'vor ' + date.getMinutes() + ' Minuten'
+ } else {
+ return now.getHours() + ':' + now.getMinutes()
+ }
+ } else {
+ return now.getHours() + ':' + now.getMinutes()
+ }
+ }
+ }
+ }
+ return (
+ now.getDate() +
+ '.' +
+ now.getMonth() +
+ '.' +
+ now.getFullYear() +
+ ' ' +
+ now.getHours() +
+ ':' +
+ now.getMinutes()
+ )
+ }
+ }
+ },
+ watch: {
+ menu(newValue) {
+ if (!newValue) this.deactivate()
+ },
+ menu_from_store(newValue) {
+ if (newValue) this.menu = this.menu_from_store
+ }
}
}
diff --git a/src/components/baruser/SearchBar.vue b/src/components/baruser/SearchBar.vue
index 20bacee..b37ece2 100644
--- a/src/components/baruser/SearchBar.vue
+++ b/src/components/baruser/SearchBar.vue
@@ -16,10 +16,13 @@
:search-input.sync="filter"
>
- {{search_person}}
+ {{ search_person }}
Hinzufügen
+
+ {{ menuIcon }}
+
@@ -27,7 +30,7 @@