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>
<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-card>
<v-card-title class="headline"
@ -240,7 +256,9 @@ export default {
menu: true,
dialog: false,
componentRenderer: 0,
timer: ''
timer: '',
stornoMessage: null,
checkValidate: false
}
},
created() {
@ -298,13 +316,24 @@ export default {
if (!message.error) {
if (!this.under5minutes(message.date)) this.dialog = true
else {
this.checkValidate = true
this.stornoMessage = message
}
}
},
acceptStorno() {
this.commitStorno({
username: message.user.username,
amount: message.amount,
date: message.date
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) {
var text = ''

View File

@ -1,5 +1,21 @@
<template>
<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-card>
<v-card-title class="headline"
@ -209,7 +225,9 @@ export default {
componentRenderer: 0,
timer: '',
menuIcon: mdiMenu,
close: mdiClose
close: mdiClose,
checkValidate: false,
stornoMessage: null,
}
},
created() {
@ -238,12 +256,23 @@ export default {
if (!message.error) {
if (!this.under5minutes(message.date)) this.dialog = true
else {
this.checkValidate = true
this.stornoMessage = message
}
}
},
acceptStorno() {
this.commitStorno({
amount: message.amount,
date: message.date
amount: this.stornoMessage.amount,
date: this.stornoMessage.date
})
}
}
setTimeout(() => {
this.cancelStorno()
}, 300)
},
cancelStorno() {
this.stornoMessage = null
this.checkValidate = null
},
addAmountMore() {
this.addAmount(Math.abs(this.value * 100))