2024-03-08 11:54:10 +01:00
|
|
|
<script setup>
|
2024-03-17 23:19:36 +01:00
|
|
|
import i18n from "@/i18n.js"
|
2024-04-21 18:24:58 +02:00
|
|
|
import {ref, watch} from 'vue'
|
2024-03-17 23:19:36 +01:00
|
|
|
import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js'
|
2024-04-11 21:06:57 +02:00
|
|
|
import AboutRequest from "@/Apps/Inscription/AboutRequest.vue";
|
2024-04-18 14:09:06 +02:00
|
|
|
import {
|
|
|
|
getAllChangeCurrReq,
|
|
|
|
getAllExemptionsRequest,
|
|
|
|
getAllScholarShipsRequest,
|
|
|
|
getAllUnregisters
|
|
|
|
} from "@/rest/requests.js";
|
2024-04-15 16:17:27 +02:00
|
|
|
import AboutScholarship from "@/Apps/Inscription/AboutScholarship.vue";
|
2024-04-17 08:53:28 +02:00
|
|
|
import AboutUnregister from "@/Apps/Inscription/AboutUnregister.vue";
|
2024-04-18 14:09:06 +02:00
|
|
|
import AboutChangeCurriculum from "@/Apps/Inscription/AboutChangeCurriculum.vue";
|
2024-04-19 19:25:28 +02:00
|
|
|
import AboutExemption from "@/Apps/Inscription/AboutExemption.vue";
|
2024-04-20 21:12:17 +02:00
|
|
|
import {getSelf} from "@/rest/Users.js";
|
2024-03-10 20:32:23 +01:00
|
|
|
|
2024-03-18 17:28:14 +01:00
|
|
|
const requests = ref(await getAllRegisters());
|
2024-03-27 14:12:20 +01:00
|
|
|
let targetId = "";
|
2024-04-20 21:12:17 +02:00
|
|
|
const user = await getSelf()
|
2024-04-21 18:24:58 +02:00
|
|
|
const requestType = ref(i18n("inscription"));
|
2024-04-10 14:40:41 +02:00
|
|
|
const filterType = ref("None");
|
|
|
|
|
2024-04-19 19:25:28 +02:00
|
|
|
//0 = liste, 1 = détails, 2 = sure?, 3 = manage scholarship, 4 manage unregister, 5 = manage curriculum change, 6 = manage exemptions
|
|
|
|
const windowsState = ref(0);
|
2024-03-18 17:28:14 +01:00
|
|
|
|
|
|
|
async function upPage(id,review){
|
|
|
|
await validateRegister(id,review);
|
2024-04-08 14:50:37 +02:00
|
|
|
|
2024-03-18 17:28:14 +01:00
|
|
|
requests.value = await getAllRegisters();
|
|
|
|
}
|
2024-04-10 14:40:41 +02:00
|
|
|
|
|
|
|
async function loadRequests(){
|
2024-04-15 20:13:01 +02:00
|
|
|
switch (requestType.value){
|
2024-04-21 03:08:27 +02:00
|
|
|
case i18n("inscription"):
|
2024-04-15 20:13:01 +02:00
|
|
|
requests.value = await getAllRegisters();
|
|
|
|
break;
|
2024-04-21 03:08:27 +02:00
|
|
|
case i18n("scholarship"):
|
2024-04-15 20:13:01 +02:00
|
|
|
requests.value = await getAllScholarShipsRequest();
|
|
|
|
break;
|
2024-04-21 03:08:27 +02:00
|
|
|
case i18n("exemption"):
|
2024-04-15 20:13:01 +02:00
|
|
|
requests.value = await getAllExemptionsRequest();
|
|
|
|
break;
|
2024-04-21 03:08:27 +02:00
|
|
|
case i18n("unregister"):
|
2024-04-15 20:13:01 +02:00
|
|
|
requests.value = await getAllUnregisters();
|
2024-04-18 14:09:06 +02:00
|
|
|
break;
|
2024-04-21 03:08:27 +02:00
|
|
|
case i18n("curriculumch"):
|
2024-04-18 14:09:06 +02:00
|
|
|
requests.value = await getAllChangeCurrReq();
|
2024-04-10 14:40:41 +02:00
|
|
|
}
|
|
|
|
}
|
2024-04-20 21:12:17 +02:00
|
|
|
|
|
|
|
//When we come back to the list we need to reload the list
|
|
|
|
watch(windowsState, () => {
|
|
|
|
if (windowsState.value === 0){
|
|
|
|
loadRequests();
|
|
|
|
}
|
|
|
|
})
|
2024-03-08 11:54:10 +01:00
|
|
|
</script>
|
|
|
|
|
2024-03-17 23:19:36 +01:00
|
|
|
|
|
|
|
|
2024-03-27 14:12:20 +01:00
|
|
|
<template>
|
|
|
|
<div v-if="windowsState === 1">
|
2024-04-19 19:25:28 +02:00
|
|
|
<AboutRequest :target="targetId" v-model:window-state="windowsState"></AboutRequest>
|
2024-03-17 23:19:36 +01:00
|
|
|
</div>
|
2024-03-27 14:12:20 +01:00
|
|
|
<div v-if="windowsState === 0">
|
2024-04-10 14:40:41 +02:00
|
|
|
<div style="margin-top: 2%;margin-left: 2%">
|
2024-04-21 03:08:27 +02:00
|
|
|
<span>{{ i18n("reqtype") }} : </span>
|
2024-04-10 14:40:41 +02:00
|
|
|
<select v-model="requestType" @change="loadRequests()">
|
2024-04-21 03:08:27 +02:00
|
|
|
<option>{{ i18n("inscription") }}</option>
|
|
|
|
<option v-if="user.role === 'Admin' || user.role === 'InscriptionService'">{{ i18n("scholarship") }}</option>
|
|
|
|
<option v-if="user.role === 'Admin' || user.role === 'Teacher'">{{ i18n("exemption") }}</option>
|
|
|
|
<option v-if="user.role === 'Admin' || user.role === 'InscriptionService'">{{ i18n("unregister") }}</option>
|
|
|
|
<option>{{ i18n("curriculumch") }}</option>
|
2024-04-10 14:40:41 +02:00
|
|
|
</select>
|
|
|
|
<span style="margin-left: 5%">
|
2024-04-21 03:08:27 +02:00
|
|
|
{{ i18n("filter") }}
|
2024-04-10 14:40:41 +02:00
|
|
|
<select v-model="filterType">
|
|
|
|
<option>None</option>
|
|
|
|
<option>Pending</option>
|
|
|
|
<option>Accepted</option>
|
|
|
|
<option>Refused</option>
|
|
|
|
</select>
|
|
|
|
</span>
|
2024-03-27 14:12:20 +01:00
|
|
|
</div>
|
2024-04-10 14:40:41 +02:00
|
|
|
<div style='display:flex; justify-content:center; min-width:1140px;' v-for="item of requests">
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="bodu" style="width: 95%" v-if="(filterType == 'None' || filterType == item.state) && requestType !== i18n('exemption')">
|
|
|
|
<div class="container" style="grid-template-columns:11% 15% 20% 10% 10% 9% 9%;grid-template-areas:'date state equivalencestate surname firstname accept refuse infos';" v-if="requestType === i18n('inscription')">
|
2024-04-10 14:40:41 +02:00
|
|
|
<div class="date" v-if="item.submissionDate !== undefined">{{item.submissionDate.slice(0, 10)}}</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="state" style="font-size: 80%">{{ i18n("approval") }} {{item.state}}</div>
|
|
|
|
<div class="equivalencestate" style="font-size: 80%">{{ i18n("teacherapproval") }} {{item.equivalenceState}}</div>
|
2024-04-10 14:40:41 +02:00
|
|
|
<div class="surname">{{item.lastName}}</div>
|
|
|
|
<div class="firstname">{{item.firstName}}</div>
|
2024-04-21 18:24:58 +02:00
|
|
|
<div class="accept" v-if="item.state === 'Pending' && (user.role === 'Admin' || user.role === 'InscriptionService')"><button @click="windowsState=2;targetId=item.id;" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div>
|
|
|
|
<div class="refuse" v-if="item.state === 'Pending' && (user.role === 'Admin' || user.role === 'InscriptionService')"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
|
2024-04-10 14:40:41 +02:00
|
|
|
<div class="infos"><button style="background-color:rgb(105,05,105);" @click="targetId=item.id;windowsState=1;">{{i18n("request.moreInfos")}}</button></div>
|
|
|
|
</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="container" style="grid-template-columns:25% 15% 15% 25% 14.2%;grid-template-areas:'date reqState studentfirstname studentlastname infos';" v-if="requestType === i18n('scholarship')">
|
2024-04-10 14:40:41 +02:00
|
|
|
<div class="date" v-if="item.date !== undefined"> {{item.date.slice(0,10)}}</div>
|
|
|
|
<div class="studentfirstname">{{item.user.firstName}}</div>
|
|
|
|
<div class="studentlastname">{{item.user.lastName}}</div>
|
|
|
|
<div class="reqState">{{item.state}}</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="infos" @click="windowsState = 3; targetId=item.id;"><button>{{ i18n("request.moreInfos") }}</button></div>
|
2024-04-10 14:40:41 +02:00
|
|
|
</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="container" v-if="requestType === i18n('unregister')" style="grid-template-columns:17% 15% 12% 15%;grid-template-areas:'date reqState regno studentfirstname studentlastname infos';">
|
2024-04-15 20:13:01 +02:00
|
|
|
<div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div>
|
|
|
|
<div class="studentfirstname">{{item.firstName}}</div>
|
|
|
|
<div class="studentlastname">{{item.lastName}}</div>
|
|
|
|
<div class="regno">id : {{item.regNo}}</div>
|
|
|
|
<div class="reqState">{{item.state}}</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="infos"><button @click="windowsState=4;targetId=item.id">{{ i18n("request.moreInfos") }}</button></div>
|
2024-04-15 20:13:01 +02:00
|
|
|
</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="container" v-if="requestType === i18n('curriculumch')" style="grid-template-columns:17% 20% 15% 5%;grid-template-areas:'date reqState teacherApproval regno studentfirstname studentlastname infos';">
|
2024-04-18 14:09:06 +02:00
|
|
|
<div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div>
|
|
|
|
<div class="studentfirstname">{{item.user.firstName}}</div>
|
|
|
|
<div class="studentlastname">{{item.user.lastName}}</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="reqState">{{ i18n("approval")}}{{item.state}}</div>
|
|
|
|
<div class="teacherApproval">{{ i18n("teacherapproval") }} : {{item.teacherApprovalState}}</div>
|
|
|
|
<div class="infos"><button @click="windowsState=5;targetId=item.id">{{ i18n("request.moreInfos") }}</button></div>
|
2024-04-18 14:09:06 +02:00
|
|
|
</div>
|
2024-04-10 14:40:41 +02:00
|
|
|
</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="bodu" v-if="(filterType == 'None' || filterType == item.state) && requestType === i18n('exemption') && (item.course.owner.regNo === user.regNo || user.role === 'Admin')">
|
2024-04-20 21:12:17 +02:00
|
|
|
<div class="container" style="grid-template-columns:17% 15% 12% 15% 25%;grid-template-areas:'date reqState studentfirstname studentlastname course infos';">
|
|
|
|
<div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div>
|
|
|
|
<div class="studentfirstname">{{item.user.firstName}}</div>
|
|
|
|
<div class="studentlastname">{{item.user.lastName}}</div>
|
|
|
|
<div class="course">{{item.course.title}}</div>
|
|
|
|
<div class="reqState">{{item.state}}</div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<div class="infos"><button @click="windowsState=6;targetId=item.id">{{ i18n("request.moreInfos") }}</button></div>
|
2024-04-20 21:12:17 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-27 14:12:20 +01:00
|
|
|
</div>
|
2024-03-17 23:19:36 +01:00
|
|
|
</div>
|
2024-04-21 18:24:58 +02:00
|
|
|
<div class="infosContainer" style='margin-left:15%;display:flex; justify-content:center; width: 70%;margin-top: 10%' v-if="windowsState === 2">
|
2024-04-21 03:08:27 +02:00
|
|
|
<p>{{ i18n("surreq") }}</p>
|
2024-04-21 18:24:58 +02:00
|
|
|
<div style="margin-left: 10%; margin-top: 1.5%; width: 30%">
|
|
|
|
<button style="background-color:rgb(105,05,105);margin-right: 2%" @click="upPage(targetId,'Accepted');windowsState=0;">{{ i18n("validate") }}</button>
|
|
|
|
<button style="background-color:rgb(105,05,105);" @click="windowsState=0;">{{ i18n("courses.back")}}</button>
|
|
|
|
</div>
|
2024-03-17 23:19:36 +01:00
|
|
|
</div>
|
2024-04-17 08:53:28 +02:00
|
|
|
<div v-if="windowsState === 3">
|
2024-04-15 16:17:27 +02:00
|
|
|
<AboutScholarship :req-id="targetId"></AboutScholarship>
|
|
|
|
<div>
|
2024-04-21 03:08:27 +02:00
|
|
|
<button style="margin-left: 31%; margin-top: 5%" @click="windowsState=0">{{ i18n("courses.back")}}</button>
|
2024-04-15 16:17:27 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-04-17 08:53:28 +02:00
|
|
|
<div v-if="windowsState === 4">
|
|
|
|
<AboutUnregister :req-id="targetId"></AboutUnregister>
|
2024-04-21 03:08:27 +02:00
|
|
|
<button @click="windowsState=0" style="margin-left: 31%">{{ i18n("courses.back")}}</button>
|
2024-04-17 08:53:28 +02:00
|
|
|
</div>
|
2024-04-18 14:09:06 +02:00
|
|
|
<div v-if="windowsState === 5">
|
2024-04-19 19:25:28 +02:00
|
|
|
<AboutChangeCurriculum :req-id="targetId" v-model:window-state="windowsState"></AboutChangeCurriculum>
|
|
|
|
</div>
|
|
|
|
<div v-if="windowsState === 6">
|
|
|
|
<AboutExemption :req-id="targetId" v-model:window-state="windowsState"></AboutExemption>
|
2024-04-18 14:09:06 +02:00
|
|
|
</div>
|
2024-03-07 15:42:36 +01:00
|
|
|
</template>
|
2024-03-17 23:19:36 +01:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.container{
|
|
|
|
color:white;
|
|
|
|
height:100px;
|
|
|
|
font-size:20px;
|
|
|
|
display:grid;
|
|
|
|
column-gap:10px;
|
|
|
|
}
|
2024-04-10 14:40:41 +02:00
|
|
|
|
2024-04-11 16:45:48 +02:00
|
|
|
.equivalencestate{
|
|
|
|
grid-area: equivalencestate;
|
|
|
|
align-self: center;
|
|
|
|
}
|
2024-04-19 15:53:31 +02:00
|
|
|
|
|
|
|
.teacherApproval{
|
|
|
|
grid-area: teacherApproval;
|
|
|
|
align-self: center;
|
|
|
|
}
|
2024-04-10 14:40:41 +02:00
|
|
|
.studentfirstname{
|
|
|
|
grid-area: studentfirstname;
|
|
|
|
align-self: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.studentlastname{
|
|
|
|
grid-area: studentlastname;
|
|
|
|
align-self: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.course{
|
|
|
|
grid-area: course;
|
|
|
|
align-self: center;
|
|
|
|
}
|
|
|
|
.reqState{
|
|
|
|
grid-area: reqState;
|
|
|
|
align-self: center;
|
|
|
|
}
|
2024-03-17 23:19:36 +01:00
|
|
|
.infos {
|
|
|
|
grid-area:infos;
|
|
|
|
align-self:center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.accept{
|
|
|
|
grid-area:accept;
|
|
|
|
align-self:center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.refuse{
|
|
|
|
grid-area:refuse;
|
|
|
|
align-self:center;
|
|
|
|
}
|
|
|
|
|
2024-03-27 16:04:55 +01:00
|
|
|
.date{
|
|
|
|
grid-area:date;
|
|
|
|
margin-left:40px;
|
|
|
|
align-self:center;
|
|
|
|
}
|
|
|
|
|
2024-04-15 20:13:01 +02:00
|
|
|
.regno{
|
|
|
|
grid-area: regno;
|
|
|
|
align-self: center;
|
|
|
|
}
|
2024-03-27 16:04:55 +01:00
|
|
|
.state{
|
|
|
|
grid-area:state;
|
2024-03-17 23:19:36 +01:00
|
|
|
margin-left:40px;
|
|
|
|
align-self:center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.surname{
|
|
|
|
grid-area:surname;
|
|
|
|
align-self:center;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow:ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
.firstname{
|
|
|
|
grid-area:firstname;
|
|
|
|
align-self:center;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow:ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
button{
|
|
|
|
border:none;
|
2024-04-20 21:12:17 +02:00
|
|
|
background-color:rgb(239, 60, 168);
|
|
|
|
border-radius:10px;
|
|
|
|
height: 35px;
|
|
|
|
margin-top:10px;
|
2024-03-17 23:19:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.bodu {
|
2024-04-01 11:43:42 +02:00
|
|
|
margin-top:2%;
|
|
|
|
width:66%;
|
2024-03-17 23:19:36 +01:00
|
|
|
border:2px solid black;
|
|
|
|
border-radius:9px;
|
|
|
|
background-color:rgb(50,50,50);
|
|
|
|
}
|
|
|
|
|
2024-04-21 18:24:58 +02:00
|
|
|
.infosContainer {
|
|
|
|
padding-bottom:50px;
|
|
|
|
border:2px solid black;
|
|
|
|
font-size:25px;
|
|
|
|
color:white;
|
|
|
|
padding:20px;
|
|
|
|
background-color:rgb(50,50,50);
|
|
|
|
border-radius:20px;
|
|
|
|
}
|
2024-03-17 23:19:36 +01:00
|
|
|
</style>
|
|
|
|
|
|
|
|
|