finanzer: leute mit schulden werden als erstes angezeigt

This commit is contained in:
Tim Gröger 2020-06-04 21:45:50 +02:00
parent e7eb37c7bc
commit a074ea0dd3
2 changed files with 13 additions and 1 deletions

View File

@ -70,7 +70,9 @@
style="margin-top: 3px" style="margin-top: 3px"
:loading="user.loading" :loading="user.loading"
> >
<v-card-title>{{ user.lastname }}, {{ user.firstname }}</v-card-title> <v-card-title>
{{ user.lastname }}, {{ user.firstname }}
</v-card-title>
<Table v-bind:user="user" v-bind:year="year" /> <Table v-bind:user="user" v-bind:year="year" />
<v-container fluid> <v-container fluid>
<v-row align="start" align-content="start"> <v-row align="start" align-content="start">

View File

@ -180,7 +180,17 @@ const mutations = {
return sum return sum
}, },
sortUsers: state => { sortUsers: state => {
console.log(state.users)
state.users = state.users.sort((a, b) => { state.users = state.users.sort((a, b) => {
if (a.locked && b.locked) {
if (a.lastname > b.lastname) return 1
if (a.lastname < b.lastname) return -1
if (a.firstname > b.firstname) return 1
if (a.firstname < b.firstname) return -1
return 0
}
if (a.locked) return -1
if (b.locked) return 1
if (a.lastname > b.lastname) return 1 if (a.lastname > b.lastname) return 1
if (a.lastname < b.lastname) return -1 if (a.lastname < b.lastname) return -1
if (a.firstname > b.firstname) return 1 if (a.firstname > b.firstname) return 1