From 7ae41ac965fcb13e6c47c83cbfc9024f039c49ef Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 22 Feb 2023 10:27:39 +0100 Subject: [PATCH] pass config to gueltigkeit in formheader --- public/js/apps/vbform/presets.js | 4 ++-- public/js/components/vbform/dvaenderung.js | 6 ++++-- public/js/components/vbform/dvneuanlage.js | 3 ++- public/js/mixins/vbform/configurable.js | 9 +++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/public/js/apps/vbform/presets.js b/public/js/apps/vbform/presets.js index d134cf5b1..1aab6b9c7 100644 --- a/public/js/apps/vbform/presets.js +++ b/public/js/apps/vbform/presets.js @@ -162,8 +162,8 @@ export default [ "sharedstatemode": "set" }, "data": { - "gueltig_ab": "01.06.2023", - "gueltig_bis": "31.12.2023" + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" } } }, diff --git a/public/js/components/vbform/dvaenderung.js b/public/js/components/vbform/dvaenderung.js index cfc782077..180149887 100644 --- a/public/js/components/vbform/dvaenderung.js +++ b/public/js/components/vbform/dvaenderung.js @@ -4,7 +4,7 @@ import configurable from '../../mixins/vbform/configurable.js'; export default { template: `
Aenderung
- +
 
`, components: { @@ -16,8 +16,10 @@ export default { methods: { getPayload: function() { return { + dienstverhaeltnisid: this.config.dienstverhaeltnisid, gueltigkeit: this.$refs.gueltigkeit.getPayload() } - } + }, + } } diff --git a/public/js/components/vbform/dvneuanlage.js b/public/js/components/vbform/dvneuanlage.js index 0b3ca2e91..a309acec0 100644 --- a/public/js/components/vbform/dvneuanlage.js +++ b/public/js/components/vbform/dvneuanlage.js @@ -21,7 +21,7 @@ export default {
 
- +
 
`, data: function() { @@ -57,6 +57,7 @@ export default { }, getPayload: function() { return { + dienstverhaeltnisid: null, unternehmen: this.unternehmen, vertragsart_kurzbz: this.vertragsart_kurzbz, gueltigkeit: this.$refs.gueltigkeit.getPayload() diff --git a/public/js/mixins/vbform/configurable.js b/public/js/mixins/vbform/configurable.js index 5918c6521..228d105c8 100644 --- a/public/js/mixins/vbform/configurable.js +++ b/public/js/mixins/vbform/configurable.js @@ -11,8 +11,13 @@ export default { return (this.config?.gbs !== undefined) ? this.config.gbs : []; }, getgueltigkeit: function() { - return (this.config?.data?.gueltigkeit !== undefined) - ? this.config.data.gueltigkeit : {}; + if( this.config?.gueltigkeit !== undefined ) { + return this.config.gueltigkeit; + } else if ( this.config?.data?.gueltigkeit !== undefined ) { + return this.config.data.gueltigkeit; + } else { + return {}; + } } } }