reset newTermin object when switching projektarbeit so they are assigned to the correct student

This commit is contained in:
Johann Hoffmann
2026-02-13 13:45:12 +01:00
parent 043b1bcf11
commit 632866c8c4
2 changed files with 18 additions and 1 deletions
@@ -643,6 +643,24 @@ export const AbgabeMitarbeiterDetail = {
'projektarbeit'(newVal) {
// set invertedFixtermin field for UI/UX purposes -> avoid double negation in text
// reset newTermin object
const typ = this.abgabeTypeOptions.find(opt => opt.paabgabetyp_kurzbz === 'zwischen')
this.newTermin = {
'paabgabe_id': -1,
'projektarbeit_id': newVal.projektarbeit_id,
'fixtermin': false,
'invertedFixtermin': true,
'kurzbz': '',
'datum': new Date().toISOString().split('T')[0],
'note': this.allowedNotenOptions.find(opt => opt.note == 9),
'beurteilungsnotiz': '',
'upload_allowed': typ.upload_allowed_default,
'paabgabetyp_kurzbz': '',
'bezeichnung': typ,
'abgabedatum': null,
'insertvon': this.viewData?.uid ?? ''
}
newVal?.abgabetermine?.forEach(termin => termin.invertedFixtermin = !termin.fixtermin)
// default select german if projektarbeit sprache was null
@@ -333,7 +333,6 @@ export const AbgabetoolMitarbeiter = {
pa.student = `${pa.vorname} ${pa.nachname}`
this.selectedProjektarbeit = pa
this.$refs.modalContainerAbgabeDetail.show()
}).finally(()=>{this.loading = false})