mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix update edit a contributions
This commit is contained in:
parent
89bb9e8bef
commit
ec2f06f9f6
@ -1,17 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="contribution-form">
|
<div class="contribution-form">
|
||||||
<!-- <div class="my-3">
|
|
||||||
<h3>{{ $t('contribution.formText.yourContribution') }}</h3>
|
|
||||||
{{ $t('contribution.formText.bringYourTalentsTo') }}
|
|
||||||
<ul class="my-3">
|
|
||||||
<li v-html="textForMonth(new Date(minimalDate), maxGddLastMonth)"></li>
|
|
||||||
<li v-html="textForMonth(new Date(), maxGddThisMonth)"></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="my-3">
|
|
||||||
<b>{{ $t('contribution.formText.describeYourCommunity') }}</b>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<b-form
|
<b-form
|
||||||
ref="form"
|
ref="form"
|
||||||
@submit.prevent="submit"
|
@submit.prevent="submit"
|
||||||
@ -169,7 +157,7 @@ export default {
|
|||||||
this.form.id = null
|
this.form.id = null
|
||||||
this.form.date = ''
|
this.form.date = ''
|
||||||
this.form.memo = ''
|
this.form.memo = ''
|
||||||
this.form.time = 0
|
this.form.hours = 0.0
|
||||||
this.form.amount = ''
|
this.form.amount = ''
|
||||||
},
|
},
|
||||||
// textForMonth(date, availableAmount) {
|
// textForMonth(date, availableAmount) {
|
||||||
@ -201,6 +189,11 @@ export default {
|
|||||||
return Number(this.validMaxGDD / 20)
|
return Number(this.validMaxGDD / 20)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
value() {
|
||||||
|
return (this.form = this.value)
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@ -53,23 +53,9 @@ export default {
|
|||||||
this.$emit('input', this.currentValue)
|
this.$emit('input', this.currentValue)
|
||||||
},
|
},
|
||||||
value() {
|
value() {
|
||||||
// console.log('value', this.value)
|
|
||||||
// console.log('currentValue', this.currentValue)
|
|
||||||
// console.log('value', typeof this.value)
|
|
||||||
// console.log('currentValue', typeof this.currentValue)
|
|
||||||
// console.log('!==', this.value !== this.currentValue)
|
|
||||||
|
|
||||||
if (this.value !== this.currentValue) this.currentValue = this.value
|
if (this.value !== this.currentValue) this.currentValue = this.value
|
||||||
this.$emit('updateAmount', this.currentValue)
|
this.$emit('updateAmount', this.currentValue)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
normalizeTime(isValid) {
|
|
||||||
this.timeFocused = false
|
|
||||||
if (!isValid) return
|
|
||||||
this.timeValue = Number(this.currentValue.replace(',', '.'))
|
|
||||||
this.currentValue = this.timeValue
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export default {
|
|||||||
id: null,
|
id: null,
|
||||||
date: '',
|
date: '',
|
||||||
memo: '',
|
memo: '',
|
||||||
time: 0,
|
hours: 0,
|
||||||
amount: '',
|
amount: '',
|
||||||
},
|
},
|
||||||
updateAmount: '',
|
updateAmount: '',
|
||||||
@ -96,6 +96,17 @@ export default {
|
|||||||
this.hashLink = to.hash
|
this.hashLink = to.hash
|
||||||
this.closeAllOpenCollapse()
|
this.closeAllOpenCollapse()
|
||||||
},
|
},
|
||||||
|
tabIndex(num) {
|
||||||
|
if (num !== 0) {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
date: '',
|
||||||
|
memo: '',
|
||||||
|
hours: 0,
|
||||||
|
amount: '0.0',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
minimalDate() {
|
minimalDate() {
|
||||||
@ -278,6 +289,7 @@ export default {
|
|||||||
this.form.date = item.contributionDate
|
this.form.date = item.contributionDate
|
||||||
this.form.memo = item.memo
|
this.form.memo = item.memo
|
||||||
this.form.amount = item.amount
|
this.form.amount = item.amount
|
||||||
|
this.form.hours = item.amount / 20
|
||||||
this.updateAmount = item.amount
|
this.updateAmount = item.amount
|
||||||
this.$router.push({ path: '#edit' })
|
this.$router.push({ path: '#edit' })
|
||||||
this.tabIndex = 0
|
this.tabIndex = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user