fordert bestätigung zur stornierung an

This commit is contained in:
Tim Gröger 2020-06-06 13:39:31 +02:00
parent df707f28bb
commit 37649abbbf
2 changed files with 70 additions and 12 deletions

View File

@ -1,5 +1,21 @@
<template> <template>
<div> <div>
<v-dialog v-model="checkValidate" max-width="290">
<v-card>
<v-card-title>
Willst du wirklich??
</v-card-title>
<v-card-text v-if="stornoMessage">
Willst du wirklich den Betrag {{(stornoMessage.amount/100).toFixed(2)}} von {{stornoMessage.user.firstname}}
{{stornoMessage.user.lastname}} stornieren?
</v-card-text>
<v-card-actions>
<v-spacer/>
<v-btn text @click="cancelStorno">Abbrechen</v-btn>
<v-btn text @click="acceptStorno">Stornieren</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialog" max-width="290"> <v-dialog v-model="dialog" max-width="290">
<v-card> <v-card>
<v-card-title class="headline" <v-card-title class="headline"
@ -240,7 +256,9 @@ export default {
menu: true, menu: true,
dialog: false, dialog: false,
componentRenderer: 0, componentRenderer: 0,
timer: '' timer: '',
stornoMessage: null,
checkValidate: false
} }
}, },
created() { created() {
@ -298,13 +316,24 @@ export default {
if (!message.error) { if (!message.error) {
if (!this.under5minutes(message.date)) this.dialog = true if (!this.under5minutes(message.date)) this.dialog = true
else { else {
this.checkValidate = true
this.stornoMessage = message
}
}
},
acceptStorno() {
this.commitStorno({ this.commitStorno({
username: message.user.username, username: this.stornoMessage.user.username,
amount: message.amount, amount: this.stornoMessage.amount,
date: message.date date: this.stornoMessage.date
}) })
} setTimeout(() => {
} this.cancelStorno()
}, 300)
},
cancelStorno() {
this.stornoMessage = null
this.checkValidate = null
}, },
createMessage(message) { createMessage(message) {
var text = '' var text = ''

View File

@ -1,5 +1,21 @@
<template> <template>
<v-container> <v-container>
<v-dialog v-model="checkValidate" max-width="290">
<v-card>
<v-card-title>
Willst du wirklich??
</v-card-title>
<v-card-text v-if="stornoMessage">
Willst du wirklich den Betrag {{(stornoMessage.amount/100).toFixed(2)}} von {{stornoMessage.user.firstname}}
{{stornoMessage.user.lastname}} stornieren?
</v-card-text>
<v-card-actions>
<v-spacer/>
<v-btn text @click="cancelStorno">Abbrechen</v-btn>
<v-btn text @click="acceptStorno">Stornieren</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialog" max-width="290"> <v-dialog v-model="dialog" max-width="290">
<v-card> <v-card>
<v-card-title class="headline" <v-card-title class="headline"
@ -209,7 +225,9 @@ export default {
componentRenderer: 0, componentRenderer: 0,
timer: '', timer: '',
menuIcon: mdiMenu, menuIcon: mdiMenu,
close: mdiClose close: mdiClose,
checkValidate: false,
stornoMessage: null,
} }
}, },
created() { created() {
@ -238,12 +256,23 @@ export default {
if (!message.error) { if (!message.error) {
if (!this.under5minutes(message.date)) this.dialog = true if (!this.under5minutes(message.date)) this.dialog = true
else { else {
this.checkValidate = true
this.stornoMessage = message
}
}
},
acceptStorno() {
this.commitStorno({ this.commitStorno({
amount: message.amount, amount: this.stornoMessage.amount,
date: message.date date: this.stornoMessage.date
}) })
} setTimeout(() => {
} this.cancelStorno()
}, 300)
},
cancelStorno() {
this.stornoMessage = null
this.checkValidate = null
}, },
addAmountMore() { addAmountMore() {
this.addAmount(Math.abs(this.value * 100)) this.addAmount(Math.abs(this.value * 100))