add customfield for user to addAmount of a custom value

fix that customfields in user and baruser are disabled if user ist locked
This commit is contained in:
Tim Gröger 2020-03-03 23:33:55 +01:00
parent 4316e1b791
commit 50da6c74f0
2 changed files with 25 additions and 11 deletions

View File

@ -161,10 +161,10 @@
</v-btn> </v-btn>
</v-col> </v-col>
<v-col cols="8"> <v-col cols="8">
<v-text-field outlined type="number" v-model="user.value" label="Benutzerdefinierter Betrag"></v-text-field> <v-text-field outlined type="number" v-model="user.value" label="Benutzerdefinierter Betrag" :disabled="user.locked"></v-text-field>
</v-col> </v-col>
<v-col cols="4"> <v-col cols="4">
<v-btn fab :color="color" @click="addAmountMore(user)"> <v-btn fab :color="color" @click="addAmountMore(user)" :disabled="user.locked">
<v-icon>{{plus}}</v-icon> <v-icon>{{plus}}</v-icon>
</v-btn> </v-btn>
</v-col> </v-col>

View File

@ -60,7 +60,7 @@
<v-row> <v-row>
<v-col cols="10"> <v-col cols="10">
<v-row> <v-row>
<v-col> <v-col cols="6" sm="4">
<v-btn <v-btn
class="creditBtn" class="creditBtn"
block block
@ -70,7 +70,7 @@
>2 </v-btn >2 </v-btn
> >
</v-col> </v-col>
<v-col> <v-col cols="6" sm="4">
<v-btn <v-btn
class="creditBtn" class="creditBtn"
block block
@ -80,7 +80,7 @@
>1 </v-btn >1 </v-btn
> >
</v-col> </v-col>
<v-col> <v-col cols="6" sm="4">
<v-btn <v-btn
class="creditBtn" class="creditBtn"
block block
@ -90,9 +90,7 @@
>0,50 </v-btn >0,50 </v-btn
> >
</v-col> </v-col>
</v-row> <v-col cols="6" sm="4">
<v-row>
<v-col>
<v-btn <v-btn
class="creditBtn" class="creditBtn"
block block
@ -102,7 +100,7 @@
>0,40 </v-btn >0,40 </v-btn
> >
</v-col> </v-col>
<v-col> <v-col cols="6" sm="4">
<v-btn <v-btn
class="creditBtn" class="creditBtn"
block block
@ -112,7 +110,7 @@
>0,20 </v-btn >0,20 </v-btn
> >
</v-col> </v-col>
<v-col> <v-col cols="6" sm="4">
<v-btn <v-btn
class="creditBtn" class="creditBtn"
block block
@ -122,6 +120,14 @@
>0,10 </v-btn >0,10 </v-btn
> >
</v-col> </v-col>
<v-col cols="8">
<v-text-field outlined type="number" v-model="value" label="Benutzerdefinierter Betrag" :disabled="user.locked"></v-text-field>
</v-col>
<v-col cols="4">
<v-btn fab :color="color" @click="addAmountMore()" :disabled="user.locked">
<v-icon>{{plus}}</v-icon>
</v-btn>
</v-col>
</v-row> </v-row>
</v-col> </v-col>
<v-col align-self="center"> <v-col align-self="center">
@ -160,7 +166,7 @@
<script> <script>
import { mapGetters, mapActions } from 'vuex' import { mapGetters, mapActions } from 'vuex'
import { mdiMenu } from '@mdi/js' import { mdiMenu, mdiPlus } from '@mdi/js'
import AddAmountSkeleton from './Skeleton/AddAmountSkeleton' import AddAmountSkeleton from './Skeleton/AddAmountSkeleton'
export default { export default {
name: 'AddAmount', name: 'AddAmount',
@ -168,6 +174,8 @@ export default {
data() { data() {
return { return {
color: 'green accent-4', color: 'green accent-4',
value: null,
plus: mdiPlus,
menu: false, menu: false,
dialog: false, dialog: false,
componentRenderer: 0, componentRenderer: 0,
@ -209,6 +217,12 @@ export default {
}) })
} }
} }
},
addAmountMore() {
this.addAmount(this.value * 100)
setTimeout(() => {
this.value = null
}, 300)
} }
}, },
computed: { computed: {