2019-12-21 07:20:25 +00:00
|
|
|
<template>
|
2019-12-26 09:31:36 +00:00
|
|
|
<div>
|
|
|
|
<div v-for="user in users" :key="users.indexOf(user)">
|
|
|
|
<v-container>
|
|
|
|
<v-card>
|
|
|
|
<v-list-item>
|
2019-12-21 11:22:21 +00:00
|
|
|
<v-list-item-title class="title">{{user.firstname}} {{user.lastname}}</v-list-item-title>
|
2019-12-26 09:31:36 +00:00
|
|
|
</v-list-item>
|
|
|
|
<v-card-text>
|
2019-12-21 11:22:21 +00:00
|
|
|
<v-row>
|
2019-12-26 09:31:36 +00:00
|
|
|
<v-col cols="10">
|
|
|
|
<v-row>
|
|
|
|
<v-col>
|
2020-01-14 18:57:45 +00:00
|
|
|
<v-btn class="creditBtn" block @click="addAmount({username: user.username, amount: 200})"
|
2019-12-29 16:56:50 +00:00
|
|
|
:color="color" :disabled="user.locked">2 €
|
2019-12-26 09:31:36 +00:00
|
|
|
</v-btn>
|
|
|
|
</v-col>
|
|
|
|
<v-col>
|
2020-01-14 18:57:45 +00:00
|
|
|
<v-btn class="creditBtn" block @click="addAmount({username: user.username, amount: 100})"
|
2019-12-29 16:56:50 +00:00
|
|
|
:color="color" :disabled="user.locked">1 €
|
2019-12-26 09:31:36 +00:00
|
|
|
</v-btn>
|
|
|
|
</v-col>
|
|
|
|
<v-col>
|
2020-01-14 18:57:45 +00:00
|
|
|
<v-btn class="creditBtn" block @click="addAmount({username: user.username, amount: 50})"
|
2019-12-29 16:56:50 +00:00
|
|
|
:color="color" :disabled="user.locked">
|
2019-12-26 09:31:36 +00:00
|
|
|
0,50 €
|
|
|
|
</v-btn>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-col>
|
2020-01-14 18:57:45 +00:00
|
|
|
<v-btn class="creditBtn" block @click="addAmount({username:user.username, amount: 40})"
|
2019-12-29 16:56:50 +00:00
|
|
|
:color="color" :disabled="user.locked">
|
2019-12-26 09:31:36 +00:00
|
|
|
0,40 €
|
|
|
|
</v-btn>
|
|
|
|
</v-col>
|
|
|
|
<v-col>
|
2020-01-14 18:57:45 +00:00
|
|
|
<v-btn class="creditBtn" block @click="addAmount({username: user.username, amount: 20})"
|
2019-12-29 16:56:50 +00:00
|
|
|
:color="color" :disabled="user.locked">
|
2019-12-26 09:31:36 +00:00
|
|
|
0,20 €
|
|
|
|
</v-btn>
|
|
|
|
</v-col>
|
|
|
|
<v-col>
|
2020-01-14 18:57:45 +00:00
|
|
|
<v-btn class="creditBtn" block @click="addAmount({username: user.username, amount: 10})"
|
2019-12-29 16:56:50 +00:00
|
|
|
:color="color" :disabled="user.locked">
|
2019-12-26 09:31:36 +00:00
|
|
|
0,10 €
|
|
|
|
</v-btn>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-col>
|
2019-12-21 11:22:21 +00:00
|
|
|
<v-col align-self="center">
|
2019-12-26 09:31:36 +00:00
|
|
|
<v-row>
|
|
|
|
<v-list-item>
|
|
|
|
<v-list-item-action-text :class="getColor(user.type)">
|
|
|
|
{{(user.amount/100).toFixed(2)}} €
|
|
|
|
</v-list-item-action-text>
|
|
|
|
</v-list-item>
|
|
|
|
</v-row>
|
2019-12-21 11:22:21 +00:00
|
|
|
</v-col>
|
|
|
|
</v-row>
|
2019-12-29 20:57:18 +00:00
|
|
|
<v-alert v-if="user.locked" type="error">{{user.firstname}} darf nicht mehr anschreiben. {{user.firstname}} sollte sich lieber mal beim Finanzer melden.</v-alert>
|
2019-12-26 09:31:36 +00:00
|
|
|
</v-card-text>
|
|
|
|
</v-card>
|
|
|
|
</v-container>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-21 07:20:25 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-01-14 18:57:45 +00:00
|
|
|
import { mapGetters, mapActions } from 'vuex';
|
2019-12-21 12:16:37 +00:00
|
|
|
|
2019-12-21 07:20:25 +00:00
|
|
|
export default {
|
2019-12-21 11:22:21 +00:00
|
|
|
name: "CreditLists",
|
|
|
|
props: {
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
2020-01-14 18:57:45 +00:00
|
|
|
color: 'green accent-4',
|
|
|
|
|
2019-12-21 11:22:21 +00:00
|
|
|
}
|
|
|
|
},
|
2019-12-29 16:56:50 +00:00
|
|
|
created() {
|
2020-01-14 18:57:45 +00:00
|
|
|
this.getUsers()
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.log(this.users)
|
2019-12-29 16:56:50 +00:00
|
|
|
},
|
2019-12-21 11:22:21 +00:00
|
|
|
methods: {
|
2020-01-14 18:57:45 +00:00
|
|
|
...mapActions({
|
|
|
|
addAmount: 'barUsers/addAmount',
|
|
|
|
getUsers: 'barUsers/getUsers'
|
|
|
|
}),
|
2019-12-21 12:16:37 +00:00
|
|
|
getColor(type) {
|
|
|
|
return type === 'credit' ? 'title green--text' : 'title red--text'
|
2019-12-21 11:22:21 +00:00
|
|
|
}
|
2019-12-21 12:16:37 +00:00
|
|
|
|
|
|
|
},
|
|
|
|
computed: {
|
2020-01-14 18:57:45 +00:00
|
|
|
...mapGetters({users: 'barUsers/users'})
|
2019-12-21 11:22:21 +00:00
|
|
|
}
|
2019-12-21 07:20:25 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2019-12-26 09:31:36 +00:00
|
|
|
.creditBtn {
|
|
|
|
margin: 2px;
|
|
|
|
}
|
2019-12-21 07:20:25 +00:00
|
|
|
</style>
|