fixed bug ##290
in der SearchBar.vue werden nun auch die schulden der user angezeigt. Sollte ein User gelocked sein, wird ein Hinweiszeichen gegeben.
This commit is contained in:
parent
22b4e83c8d
commit
c86f1afd4c
|
@ -187,7 +187,7 @@
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="hidden-sm-and-down" cols="8">
|
<v-col class="hidden-sm-and-down" cols="80">
|
||||||
<v-alert v-if="user.locked" type="error"
|
<v-alert v-if="user.locked" type="error"
|
||||||
>{{ user.firstname }} darf nicht mehr anschreiben.
|
>{{ user.firstname }} darf nicht mehr anschreiben.
|
||||||
{{ user.firstname }} sollte sich lieber mal beim Finanzer
|
{{ user.firstname }} sollte sich lieber mal beim Finanzer
|
||||||
|
|
|
@ -19,6 +19,16 @@
|
||||||
<template v-slot:prepend-inner>
|
<template v-slot:prepend-inner>
|
||||||
<v-icon>{{ search_person }}</v-icon>
|
<v-icon>{{ search_person }}</v-icon>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-slot:item="data">
|
||||||
|
<v-list-item-icon v-if="getLocked(data.item)">
|
||||||
|
<v-icon>mdi-alert</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-content>
|
||||||
|
{{data.item.fullName}}
|
||||||
|
<v-spacer/>
|
||||||
|
{{(getCredit(data.item)/100).toFixed(2)}} €
|
||||||
|
</v-list-item-content>
|
||||||
|
</template>
|
||||||
</v-autocomplete>
|
</v-autocomplete>
|
||||||
<v-btn text @click="addUser">Hinzufügen</v-btn>
|
<v-btn text @click="addUser">Hinzufügen</v-btn>
|
||||||
<v-btn v-if="!locked" text @click="lock">Sperren</v-btn>
|
<v-btn v-if="!locked" text @click="lock">Sperren</v-btn>
|
||||||
|
@ -46,7 +56,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapActions } from 'vuex'
|
import { mapGetters, mapActions } from 'vuex'
|
||||||
import { mdiAccountSearch, mdiMenu } from '@mdi/js'
|
import { mdiAccountSearch, mdiMenu, mdiAlert } from '@mdi/js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SearchBar',
|
name: 'SearchBar',
|
||||||
|
@ -57,6 +67,7 @@ export default {
|
||||||
filter: '',
|
filter: '',
|
||||||
search_person: mdiAccountSearch,
|
search_person: mdiAccountSearch,
|
||||||
menuIcon: mdiMenu,
|
menuIcon: mdiMenu,
|
||||||
|
alert: mdiAlert,
|
||||||
overlay: false,
|
overlay: false,
|
||||||
password: ''
|
password: ''
|
||||||
}
|
}
|
||||||
|
@ -87,11 +98,24 @@ export default {
|
||||||
this.unlock(this.password)
|
this.unlock(this.password)
|
||||||
this.password = ''
|
this.password = ''
|
||||||
this.overlay = false
|
this.overlay = false
|
||||||
|
},
|
||||||
|
getCredit(user) {
|
||||||
|
let retUser = this.users.find(item => {
|
||||||
|
return item.username === user.username
|
||||||
|
})
|
||||||
|
return retUser ? retUser.amount : 0
|
||||||
|
},
|
||||||
|
getLocked(user) {
|
||||||
|
let retUser = this.users.find(item => {
|
||||||
|
return item.username === user.username
|
||||||
|
})
|
||||||
|
return retUser ? retUser.locked : false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
allUsers: 'barUsers/allUsers',
|
allUsers: 'barUsers/allUsers',
|
||||||
|
users: 'barUsers/users',
|
||||||
loading: 'barUsers/allUsersLoading',
|
loading: 'barUsers/allUsersLoading',
|
||||||
menu: 'barUsers/menu',
|
menu: 'barUsers/menu',
|
||||||
locked: 'barUsers/locked'
|
locked: 'barUsers/locked'
|
||||||
|
|
Loading…
Reference in New Issue