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-col>
<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 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-btn>
</v-col>

View File

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