Status: Max Semester

This commit is contained in:
cgfhtw
2024-08-01 12:57:06 +02:00
parent f2180257c5
commit 6f0e46ac57
5 changed files with 113 additions and 9 deletions
@@ -235,7 +235,8 @@ export default{
statusData: {},
statusId: {},
dataMeldestichtag: null,
statusNew: true
statusNew: true,
maxSem: 0
};
},
watch: {
@@ -246,9 +247,20 @@ export default{
else
this.data.tabulatorOptions.ajaxURL = 'api/frontend/v1/stv/Status/getHistoryPrestudent/' + this.modelValue.prestudent_id;
}
this.getMaxSem();
}
},
methods: {
getMaxSem() {
const studiengang_kzs = this.modelValue.studiengang_kz
? [this.modelValue.studiengang_kz]
: this.modelValue.map(prestudent => prestudent.studiengang_kz);
this.maxSem = 0;
this.$fhcApi
.post('api/frontend/v1/stv/status/getMaxSemester/', {studiengang_kzs})
.then(result => this.maxSem = result.data)
.catch(this.$fhcAlert.handleSystemError);
},
actionNewStatus() {
this.$refs.test.open(this.modelValue);
},
@@ -317,6 +329,8 @@ export default{
}
},
created() {
this.getMaxSem();
this.$fhcApi
.get('api/frontend/v1/stv/status/getLastBismeldestichtag/')
.then(result => {
@@ -327,9 +341,9 @@ export default{
.catch(this.$fhcAlert.handleSystemError);
},
template: `
<div class="stv-list h-100 pt-3">
<div class="stv-multistatus h-100 pt-3">
<status-modal ref="test" :meldestichtag="new Date(dataMeldestichtag)" @saved="reload"></status-modal>
<status-modal ref="test" :meldestichtag="new Date(dataMeldestichtag)" :max-sem="maxSem" @saved="reload"></status-modal>
<core-filter-cmpt
v-if="!this.modelValue.length"
@@ -37,6 +37,10 @@ export default{
meldestichtag: {
type: Date,
required: true
},
maxSem: {
type: Number,
required: true
}
},
data() {
@@ -58,12 +62,13 @@ export default{
'Unterbrecher',
'Diplomand',
'Incoming'
],
// TODO(chris): IMPLEMENT!
maxSem: Array.from({ length: 11 }, (_, index) => index),
]
};
},
computed: {
semester() {
return Array.from({length: this.maxSem}, (_, index) => index);
},
bisLocked() {
if (this.statusNew || this.hasPermissionToSkipStatusCheck)
return false;
@@ -207,7 +212,7 @@ export default{
</template>
<core-form ref="form">
<form-validation></form-validation>
<p v-if="bisLocked && !isStatusBeforeStudent">
@@ -249,7 +254,6 @@ export default{
{{ sem.studiensemester_kurzbz }}
</option>
</form-input>
<!-- TODO(manu) if(defined('VORRUECKUNG_STATUS_MAX_SEMESTER') && VORRUECKUNG_STATUS_MAX_SEMESTER==false) 100 Semester-->
<form-input
container-class="mb-3"
type="select"
@@ -259,7 +263,7 @@ export default{
:disabled="bisLocked && !isStatusBeforeStudent"
>
<option
v-for="number in maxSem"
v-for="number in semester"
:key="number"
:value="number"
>