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,9 +1,25 @@
<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"
>Transaktion ist länger als 1 Minute her!</v-card-title >Transaktion ist länger als 1 Minute her!</v-card-title
> >
<v-card-text> <v-card-text>
Da die Transaktion länger als 1 Minuter her ist, kann eine Stornierung Da die Transaktion länger als 1 Minuter her ist, kann eine Stornierung
@ -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,14 +316,25 @@ 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.commitStorno({ this.checkValidate = true
username: message.user.username, this.stornoMessage = message
amount: message.amount,
date: message.date
})
} }
} }
}, },
acceptStorno() {
this.commitStorno({
username: this.stornoMessage.user.username,
amount: this.stornoMessage.amount,
date: this.stornoMessage.date
})
setTimeout(() => {
this.cancelStorno()
}, 300)
},
cancelStorno() {
this.stornoMessage = null
this.checkValidate = null
},
createMessage(message) { createMessage(message) {
var text = '' var text = ''
if (message.error) { if (message.error) {

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,13 +256,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.commitStorno({ this.checkValidate = true
amount: message.amount, this.stornoMessage = message
date: message.date
})
} }
} }
}, },
acceptStorno() {
this.commitStorno({
amount: this.stornoMessage.amount,
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))
setTimeout(() => { setTimeout(() => {