From abbb7fe35e460f80b3d836df45fd39c9f611b1ba Mon Sep 17 00:00:00 2001 From: Jerome Villiseck Date: Tue, 20 Aug 2024 14:08:17 +0200 Subject: [PATCH 1/2] =?UTF-8?q?-=20Gestion=20de=20l'=C3=A9v=C3=A9nement=20?= =?UTF-8?q?mettant=20=C3=A0=20jour=20de=20demande=20en=20back=20avec=20le?= =?UTF-8?q?=20type=20de=20fichier=20-=20Gestion=20des=20libell=C3=A9s=20da?= =?UTF-8?q?ns=20les=20input=20de=20chargement=20des=20fichiers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SelectFile.vue | 15 ++++++++++++--- src/components/Supp/TypeFile.vue | 8 +++++--- src/service/DemandesService.js | 3 +++ src/views/Suppression/SuppSteps.vue | 8 ++++++-- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/components/SelectFile.vue b/src/components/SelectFile.vue index 00e43cc..609ebaf 100644 --- a/src/components/SelectFile.vue +++ b/src/components/SelectFile.vue @@ -18,20 +18,29 @@ aria-label="Dépôt du fichier" v-model="fileCharged" ref="fileInput" - label="Cliquez pour charger votre fichier complété (format .txt ou .csv obligatoire)" + :label="label" > diff --git a/src/service/DemandesService.js b/src/service/DemandesService.js index 7f5f16d..18dc30e 100644 --- a/src/service/DemandesService.js +++ b/src/service/DemandesService.js @@ -100,6 +100,9 @@ export class DemandesService { modifierCommentaireDemande(id, commentaire, typeDemande){ return this.client.patch(`demandes/${typeDemande}/${id}?commentaire=${commentaire}`); } + modifierTypeFileDemande(id, typeFileDemande){ + return this.client.patch(`demandes/SUPP/${id}?typeSupp=${typeFileDemande}`); + } uploadDemande(id, file, typeDemande){ const config = { headers: { diff --git a/src/views/Suppression/SuppSteps.vue b/src/views/Suppression/SuppSteps.vue index d728b00..b167ac7 100644 --- a/src/views/Suppression/SuppSteps.vue +++ b/src/views/Suppression/SuppSteps.vue @@ -56,8 +56,8 @@ - - Selection du fichier {{typeFileSelected}} + + Selection du fichier {{typeFileSelected}} Téléchargement du fichier PPN/RCR/EPN Date: Wed, 21 Aug 2024 09:52:22 +0200 Subject: [PATCH 2/2] Ajout gestion change ETAPE +gestion typeSupp --- src/views/Suppression/SuppSteps.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/views/Suppression/SuppSteps.vue b/src/views/Suppression/SuppSteps.vue index b167ac7..a12c453 100644 --- a/src/views/Suppression/SuppSteps.vue +++ b/src/views/Suppression/SuppSteps.vue @@ -187,11 +187,29 @@ function setTypeSelected(){ demandesService.modifierTypeFileDemande(demande.value.id, typeFileSelected.value) } +function changeEtape() { + if (((currentStep.value + 1) === 1) || ((currentStep.value + 1) === 2 && !typeFileSelected.value)) { + demandesService.choixEtape(demande.value.id, 1, 'SUPP') + .then(response => { + demande.value = response.data; + }); + typeFileSelected.value = null; + } + if ((currentStep.value + 1) === 2 && typeFileSelected.value) { //Changement d'etat pour le chargement du fichier car le back est perdu sinon + demandesService.choixEtape(demande.value.id, 2, 'SUPP') + .then(response => { + demande.value = response.data; + }); + } +} + function prevSelectTypeFile(){ typeFileSelected.value = null; + changeEtape() raz(); } function prevSelectFile(){ + changeEtape() raz(); } function next() { @@ -201,6 +219,7 @@ function next() { function prev() { currentStep.value--; + changeEtape() raz(); }