add contributionDate for contribution list

This commit is contained in:
ogerly 2022-07-20 12:01:45 +02:00
parent 4ff5e74875
commit a87c5f70ee
4 changed files with 13 additions and 11 deletions

View File

@ -74,15 +74,11 @@
</b-col>
<b-col class="text-right">
<b-button class="test-submit" type="submit" variant="primary" :disabled="disabled">
{{ id === null ? $t('contribution.submit') : $t('form.edit') }}
{{ value.id ? $t('form.edit') : $t('contribution.submit') }}
</b-button>
</b-col>
</b-row>
</b-form>
{{ typeof this.$store.state.creation[2] }}, {{ typeof this.form.amount }},
{{ typeof maxGddThisMonth }}({{ maxGddThisMonth }})
<br />
{{ isThisMonth }}
</div>
</template>
<script>
@ -102,10 +98,10 @@ export default {
},
methods: {
submit() {
if (this.id === null) {
this.$emit('set-contribution', this.form)
if (this.value.id) {
this.$emit('update-contribution', this.form)
} else {
this.$emit('edit-contribution', this.value)
this.$emit('set-contribution', this.form)
}
this.reset()
},

View File

@ -18,7 +18,7 @@
@click="
$emit('update-contribution-form', {
id: id,
createdAt: createdAt,
contributionDate: contributionDate,
memo: memo,
amount: amount,
})
@ -54,6 +54,9 @@ export default {
createdAt: {
type: String,
},
contributionDate: {
type: String,
},
deletedAt: {
type: String,
},
@ -83,7 +86,7 @@ export default {
date() {
if (this.deletedAt) return this.deletedAt
if (this.confirmedAt) return this.confirmedAt
return this.createdAt
return this.contributionDate
},
},
methods: {

View File

@ -182,8 +182,10 @@ export const listContributions = gql`
amount
memo
createdAt
contributionDate
confirmedAt
confirmedBy
deletedAt
}
}
}
@ -200,6 +202,7 @@ export const listAllContributions = gql`
amount
memo
createdAt
contributionDate
confirmedAt
confirmedBy
}

View File

@ -179,7 +179,7 @@ export default {
},
updateContributionForm(item) {
this.form.id = item.id
this.form.date = item.createdAt
this.form.date = item.contributionDate
this.form.memo = item.memo
this.form.amount = item.amount
this.tabIndex = 0