edit pending creation, fill the form and extrapolate the range and the creation[index]

This commit is contained in:
ogerly 2021-11-28 17:02:43 +01:00
parent 7d7277d475
commit babb504824
2 changed files with 26 additions and 29 deletions

View File

@ -1,21 +1,6 @@
<template>
<div class="component-creation-formular">
<div>
<h3>
{{
this.type === 'singleCreation'
? 'Einzelschöpfung für ' + item.firstName + ' ' + item.lastName + ''
: 'Mehrfachschöpfung für ' + Object.keys(this.itemsMassCreation).length + ' Mitglieder'
}}
</h3>
<div v-show="this.type === 'massCreation' && Object.keys(this.itemsMassCreation).length <= 0">
Bitte wähle ein oder Mehrere Mitglieder aus für die du Schöpfen möchtest
</div>
</div>
<div
v-show="this.type === 'singleCreation' || Object.keys(this.itemsMassCreation).length > 0"
class="shadow p-3 mb-5 bg-white rounded"
>
<div class="shadow p-3 mb-5 bg-white rounded">
<b-form ref="creationForm">
<b-row class="m-4">
<label>Monat Auswählen</label>
@ -140,25 +125,34 @@ export default {
item: {
type: Object,
required: false,
default() {
return {}
},
},
items: {
type: Array,
required: false,
default() {
return []
},
},
creationUserData: {
type: Object,
required: false,
default() {
return {}
},
},
creation: {
type: Array,
required: true,
},
itemsMassCreation: {
type: Object,
required: false,
},
},
data() {
return {
radioSelected: '',
text: !this.creationUserData.note ? '' : this.creationUserData.note,
value: 0,
value: !this.creationUserData.amount ? 0 : this.creationUserData.amount / 10000,
rangeMin: 0,
rangeMax: 1000,
currentMonth: {
@ -194,6 +188,12 @@ export default {
// Der maximale offene Betrag an GDD die für ein User noch geschöpft werden kann
this.rangeMax = openCreation
}
// Wenn Einzelschöpfung
if (this.pagetype === 'PageCreationConfirm') {
this.rangeMin = 0
this.rangeMax = openCreation + ( this.creationUserData.amount / 10000 )
this.creation[index] = this.creation[index] + ( this.creationUserData.amount / 10000 )
}
},
/*
checkFormForUpdate(input) {
@ -229,6 +229,7 @@ export default {
if (this.text.length < 10) {
return alert('Bitte gib einen Text ein der länger als 10 Zeichen ist!')
}
/*
if (this.type === 'massCreation') {
// Die anzahl der Mitglieder aus der Mehrfachschöpfung
const i = Object.keys(this.itemsMassCreation).length
@ -252,7 +253,7 @@ export default {
// lösche alle Mitglieder aus der MehrfachSchöpfungsListe nach dem alle Mehrfachschpfungen zum bestätigen gesendet wurden.
this.$emit('remove-all-bookmark')
}
*/
if (this.type === 'singleCreation') {
this.submitObj = {
email: this.item.email,

View File

@ -60,7 +60,7 @@
<b-row class="mb-2">
<b-col></b-col>
</b-row>
{{type}}
<creation-formular
type="singleCreation"
:pagetype="type"
@ -225,6 +225,8 @@ export default {
// this.item = rowItem
this.creationUserData = rowItem
console.log('editCreationUserTable creationUserData', this.creationUserData)
} else {
this.creationUserData = {}
}
row.toggleDetails()
},
@ -237,12 +239,6 @@ export default {
rowItem.creation = newCreation
},
},
watch: {
creationUserData: function () {
alert('yolo')
console.log(this.creationUserData)
},
},
}
</script>
<style>