problem with switching presets and problem with vanishing gehaltsbestandteile solved

This commit is contained in:
Harald Bamberger
2023-03-10 08:21:59 +01:00
parent c62d89d25c
commit cca82d2961
7 changed files with 28 additions and 18 deletions
+1 -3
View File
@@ -59,9 +59,7 @@ export default [
data: {
dienstverhaeltnisid: null
},
vbs: {
}
vbs: {}
},
{
type: 'preset',
+9 -5
View File
@@ -62,15 +62,19 @@ Vue.createApp({
'vbformhelper': vbformhelper
},
created: function() {
var vbs = JSON.parse(JSON.stringify(this.preset.vbs));
for( var key in vbs ) {
this.store.addVB(key, vbs[key]);
}
this.store.setDV(JSON.parse(JSON.stringify(this.preset.data)));
this.presettostore();
},
methods: {
presetselected: function(preset) {
this.preset = preset;
this.presettostore();
},
presettostore: function() {
var vbs = JSON.parse(JSON.stringify(this.preset.vbs));
for( var key in vbs ) {
this.store.addVB(key, vbs[key]);
}
this.store.setDV(JSON.parse(JSON.stringify(this.preset.data)));
},
processJSON: function(payload) {
this.vbhjson = payload;
@@ -62,17 +62,13 @@ export default {
},
methods: {
setDataFromConfig: function() {
if( typeof this.config.data === 'undefined' ) {
return;
}
if( typeof this.config.data.gehaltstyp !== 'undefined' ) {
if( typeof this.config?.data?.gehaltstyp !== 'undefined' ) {
this.gehaltstyp = this.config.data.gehaltstyp;
}
if( typeof this.config.data.betrag !== 'undefined' ) {
if( typeof this.config?.data?.betrag !== 'undefined' ) {
this.betrag = this.config.data.betrag;
}
if( typeof this.config.data.valorisierung !== 'undefined' ) {
if( typeof this.config?.data?.valorisierung !== 'undefined' ) {
this.valorisierung = this.config.data.valorisierung;
}
},
@@ -82,7 +78,7 @@ export default {
getPayload: function() {
return {
type: this.config.type,
guioptions: this.config.guioptions,
guioptions: JSON.parse(JSON.stringify(this.config.guioptions)),
data: {
gehaltstyp: this.gehaltstyp,
betrag: this.betrag,
@@ -1,3 +1,5 @@
import store from './vbsharedstate.js';
export default {
template: `
<div class="row g-2 py-2">
@@ -20,6 +22,7 @@ export default {
],
data: function() {
return {
store: store,
selectedpresetidx: 1
}
},
@@ -29,6 +32,7 @@ export default {
methods: {
selectpreset: function() {
var preset = this.presets[this.selectedpresetidx];
this.store.reset();
this.$emit("presetselected", preset);
}
}
@@ -29,5 +29,13 @@ export default Vue.reactive({
},
getVBsPayload: function() {
return JSON.parse(JSON.stringify(this.vbs));
},
reset: function() {
this.gueltigkeit = {
gueltig_ab: '',
gueltig_bis: ''
};
this.dv = {};
this.vbs = {};
}
});
@@ -77,7 +77,7 @@ export default {
this.$emit('removeVB', {id: this.config.guioptions.id});
},
getGehaltsbestandteilePayload: function() {
return (!this.$refs?.gbh === undefined) ? this.$refs.gbh.getPayload() : [];
return (this.$refs?.gbh !== undefined) ? this.$refs.gbh.getPayload() : [];
},
getPayload: function() {
return {
@@ -53,7 +53,7 @@ export default {
this.$emit('removeVB', {id: this.config.guioptions.id});
},
getGehaltsbestandteilePayload: function() {
return (!this.$refs?.gbh === undefined) ? this.$refs.gbh.getPayload() : [];
return (this.$refs?.gbh !== undefined) ? this.$refs.gbh.getPayload() : [];
},
getPayload: function() {
return {