mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add emit and props for update formular
This commit is contained in:
parent
1a7d08f66a
commit
64430f6b28
@ -12,7 +12,7 @@
|
|||||||
+ New Automatic Creations
|
+ New Automatic Creations
|
||||||
</b-button>
|
</b-button>
|
||||||
|
|
||||||
<b-collapse id="newContribution" class="mt-2">
|
<b-collapse v-model="visible" id="newContribution" class="mt-2">
|
||||||
<b-card>
|
<b-card>
|
||||||
<p class="h2 ml-5">Automatic Creations</p>
|
<p class="h2 ml-5">Automatic Creations</p>
|
||||||
<automatic-creation-form :automaticContributionData="automaticContributionData" />
|
<automatic-creation-form :automaticContributionData="automaticContributionData" />
|
||||||
@ -31,11 +31,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import AutomaticCreationForm from './AutomaticCreationForm.vue'
|
import AutomaticCreationForm, { updateForm } from './AutomaticCreationForm.vue'
|
||||||
import AutomaticCreationList from './AutomaticCreationList.vue'
|
import AutomaticCreationList from './AutomaticCreationList.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AutomaticCreation',
|
name: 'AutomaticCreation',
|
||||||
|
components: {
|
||||||
|
AutomaticCreationForm,
|
||||||
|
AutomaticCreationList,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
items: {
|
items: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@ -44,17 +48,16 @@ export default {
|
|||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
|
visible: false,
|
||||||
automaticContributionData: {},
|
automaticContributionData: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
|
||||||
AutomaticCreationForm,
|
|
||||||
AutomaticCreationList,
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
editAutomaticContributionData(data) {
|
editAutomaticContributionData(data) {
|
||||||
console.log('start methodes editAutomaticContributionData')
|
console.log('start methodes editAutomaticContributionData')
|
||||||
console.log(typeof(data))
|
console.log(typeof data)
|
||||||
|
if (!this.visible) this.$root.$emit('bv::toggle::collapse', 'newContribution')
|
||||||
this.automaticContributionData = data
|
this.automaticContributionData = data
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
{{ this.automaticContributionData }}
|
<div v-if="updateData" class="text-light bg-info p-3">
|
||||||
<b-form class="m-5" @submit="onSubmit">
|
{{ updateData }}
|
||||||
|
</div>
|
||||||
|
<b-form class="m-5" @submit="onSubmit" @reset="onReset">
|
||||||
<!-- Date -->
|
<!-- Date -->
|
||||||
<b-row>
|
<b-row>
|
||||||
<b-col>
|
<b-col>
|
||||||
@ -109,14 +111,15 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
automaticContributionData: {
|
automaticContributionData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
name:
|
name: null,
|
||||||
this.automaticContributionData.Name === '' ? null : this.automaticContributionData.Name,
|
|
||||||
text: null,
|
text: null,
|
||||||
amount: null,
|
amount: null,
|
||||||
startDate: null,
|
startDate: null,
|
||||||
@ -150,6 +153,26 @@ export default {
|
|||||||
if (this.form.endDate === null) return this.toastError('No end Date')
|
if (this.form.endDate === null) return this.toastError('No end Date')
|
||||||
alert(JSON.stringify(this.form))
|
alert(JSON.stringify(this.form))
|
||||||
},
|
},
|
||||||
|
onReset(event) {
|
||||||
|
event.preventDefault()
|
||||||
|
this.form.name = null
|
||||||
|
this.form.text = null
|
||||||
|
this.form.amount = null
|
||||||
|
this.form.startDate = null
|
||||||
|
this.form.endDate = null
|
||||||
|
this.form.cycle = null
|
||||||
|
this.form.repetition = null
|
||||||
|
this.form.maxAmount = null
|
||||||
|
this.updateData = {}
|
||||||
|
},
|
||||||
|
updateForm() {
|
||||||
|
alert('updateForm')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
updateData() {
|
||||||
|
return this.automaticContributionData
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -81,7 +81,7 @@ export default {
|
|||||||
},
|
},
|
||||||
editAutomaticCreations(row) {
|
editAutomaticCreations(row) {
|
||||||
this.$emit('editAutomaticContributionData', row.item)
|
this.$emit('editAutomaticContributionData', row.item)
|
||||||
this.$root.$emit('bv::toggle::collapse', 'newContribution')
|
|
||||||
},
|
},
|
||||||
|
|
||||||
showAutomaticCreations(row) {
|
showAutomaticCreations(row) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user