Small changes
This commit is contained in:
		| @ -8,6 +8,7 @@ import {getExternalCurriculumByInscrReq} from "@/rest/externalCurriculum.js"; | ||||
| import {ref} from "vue"; | ||||
| import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue"; | ||||
| import {editEquivalenceState} from "@/rest/requests.js"; | ||||
| import {downloadPdf} from "@/rest/uploads.js"; | ||||
|  | ||||
| const props = defineProps(['target']); | ||||
| const request = await getRegisters(props.target); | ||||
| @ -56,6 +57,10 @@ async function editEquivalence(id, newstate){ | ||||
|           <div> | ||||
|             Cursus voulu : BAB {{cursus.year}} {{cursus.option}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <a :href="downloadPdf(request.identityCard)">Download identity card</a> | ||||
|             <button v-if="request.admissionDocUrl != null">Download admission document</button> | ||||
|           </div> | ||||
|           <div v-if="cursus.year > 1"> | ||||
|             <button style="background-color:rgb(105,05,105);margin-left: 5%" @click="list=!list" v-if="(user.role == 'Teacher' || user.role == 'Admin')&& request.equivalenceState == 'Pending'">See external curriculums</button> | ||||
|           </div> | ||||
|  | ||||
| @ -54,7 +54,7 @@ async function uploadandrefreshScholarshipRequest(){ | ||||
|             Birthdate : {{user.birthDate.slice(0,10)}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button>Download tax justif document</button> | ||||
|             <button @click="">Download tax justif document</button> | ||||
|             <button style="margin-left: 2%">Download residency justif document</button> | ||||
|           </div> | ||||
|           <div v-if="req.state == 'Pending'"> | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <script setup> | ||||
|   import i18n from "@/i18n.js" | ||||
|   import {getUser} from '../../rest/Users.js' | ||||
|   import {getSelf, getUser} from '../../rest/Users.js' | ||||
|   import {getSomeonesCurriculumList} from "@/rest/curriculum.js"; | ||||
|   import {ref} from "vue"; | ||||
|   import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue"; | ||||
| @ -12,6 +12,7 @@ | ||||
|   const externalcurrlist = await getExternalCurriculumByUser(user.regNo) | ||||
|   const extercurrlist = ref(false) | ||||
|  | ||||
|   const watchingUser = await getSelf() | ||||
|   function getPP(){ | ||||
|     if(user.profilePictureUrl === null){ | ||||
|       return "/Clyde.png" | ||||
| @ -54,6 +55,9 @@ | ||||
|           <div> | ||||
|             Date de naissance : {{user.birthDate}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button v-if="watchingUser.role === 'Admin' || watchingUser.role === 'InscriptionService' || watchingUser.role === 'Secretary' || watchingUser.regNo === user.regNo">Download identity card</button> | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click="extercurrlist=!extercurrlist">See external curriculums</button> | ||||
|           </div> | ||||
|  | ||||
| @ -3,6 +3,7 @@ | ||||
|   import {reactive, ref} from "vue"; | ||||
|   import {getSelf} from "@/rest/Users.js"; | ||||
|   import {createExternalCurriculum, getExternalCurriculumByUser} from "@/rest/externalCurriculum.js"; | ||||
|   import {uploadFile} from "@/rest/uploads.js"; | ||||
|  | ||||
|   //mode 0 = externalcurr related to inscrreq, 1 = externalcurr related to user, 2 inscription procedure | ||||
|   const props = defineProps(["extCurrList", "mode"]) | ||||
| @ -51,7 +52,8 @@ | ||||
|  | ||||
|   async function postExternalCurr(){ | ||||
|     if (props.mode === 1){ | ||||
|       await createExternalCurriculum(externalCurr.inscriptionRequestId, externalCurr.school, externalCurr.formation, externalCurr.completion, externalCurr.startYear, externalCurr.endYear, externalCurr.justifdocUrl, externalCurr.userRegNo); | ||||
|       const temp = await uploadFile(externalCurr.justifdocUrl, "JustificationDocument") | ||||
|       await createExternalCurriculum(externalCurr.inscriptionRequestId, externalCurr.school, externalCurr.formation, externalCurr.completion, externalCurr.startYear, externalCurr.endYear, temp.value.url, externalCurr.userRegNo); | ||||
|       //We refresh the list | ||||
|       extCurrList.value = await getExternalCurriculumByUser(externalCurr.userRegNo); | ||||
|       list.value = !list.value; | ||||
| @ -68,7 +70,6 @@ | ||||
|       }); | ||||
|       extCurrList.value = externalCurrTab.value | ||||
|       list.value = !list.value; | ||||
|       console.log(externalCurrTab.value) | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -118,6 +119,10 @@ | ||||
|         <p>Année de fin</p> | ||||
|         <input type="number" v-model="externalCurr.endYear"> | ||||
|       </div> | ||||
|       <div class="inputBox"> | ||||
|         <p>Veuillez soumettre un document attestant de ce parcours</p> | ||||
|         <input type="file" @change="externalCurr.justifdocUrl = $event.target.files"> | ||||
|       </div> | ||||
|       <div class="inputBox" style="margin-top: 3%; margin-bottom: 3%"> | ||||
|         <input v-if="!editmode" type="submit" value="Upload curriculum" @click="postExternalCurr()"> | ||||
|         <input v-else type="submit" value="Edit curriculum" @click="externalCurrTab[extNum] = {inscriptionRequestId : externalCurr.inscriptionRequestId,school:externalCurr.school,formation :externalCurr.formation,completion : externalCurr.completion,startYear : externalCurr.startYear,endYear: externalCurr.endYear,justifdocUrl : externalCurr.justifdocUrl,userRegNo : externalCurr.userRegNo};editmode=!editmode;list=!list"> | ||||
|  | ||||
| @ -108,13 +108,13 @@ | ||||
|     const val = await register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, ppData, identityCardFile.url, new Date(), outputs.equivalenceState, justif); | ||||
|  | ||||
|     for (let item in externalCurrTab.value){ | ||||
|       await createExternalCurriculum(val.id, externalCurrTab.value[item].school, externalCurrTab.value[item].formation, externalCurrTab.value[item].completion, externalCurrTab.value[item].startYear, externalCurrTab.value[item].endYear, externalCurrTab.value[item].justifdocUrl); | ||||
|       const temp = await uploadFile(externalCurrTab.value[item].justifdocUrl, "JustificationDocument") | ||||
|       await createExternalCurriculum(val.id, externalCurrTab.value[item].school, externalCurrTab.value[item].formation, externalCurrTab.value[item].completion, externalCurrTab.value[item].startYear, externalCurrTab.value[item].endYear, temp.value.url); | ||||
|     } | ||||
|   } | ||||
|  | ||||
| </script> | ||||
|  | ||||
|  | ||||
| <template> | ||||
|     <div class="setup" v-if="page !== 4"> | ||||
|       <div v-if="loginPage"> | ||||
|  | ||||
| @ -13,7 +13,7 @@ export async function uploadProfilePicture(file){ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * More generic version of the upload method | ||||
|  * More generic version of the uploadProfilePicture method | ||||
|  */ | ||||
|  | ||||
| export async function uploadFile(file, type){ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user