From bd584812fed59751f32f2cee2096fae96177f72f Mon Sep 17 00:00:00 2001 From: SamuelQuetin Date: Fri, 28 Jun 2024 15:51:18 +0200 Subject: [PATCH 1/4] Ajout MODIF premier jet --- src/App.vue | 6 +- src/components/DownloadFile.vue | 18 ++ src/components/{ => Structure}/Footer.vue | 0 src/components/{ => Structure}/Header.vue | 8 +- src/components/{ => Structure}/Navbar.vue | 6 +- src/router/index.js | 28 +-- src/views/Accueil.vue | 2 +- src/views/Exemplarisation/ExempSteps.vue | 4 +- src/views/Modification/ModifSteps.vue | 229 ++++++++++++++++------ 9 files changed, 206 insertions(+), 95 deletions(-) create mode 100644 src/components/DownloadFile.vue rename src/components/{ => Structure}/Footer.vue (100%) rename src/components/{ => Structure}/Header.vue (88%) rename src/components/{ => Structure}/Navbar.vue (96%) diff --git a/src/App.vue b/src/App.vue index 8bf5492..40fa0a2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,9 +19,9 @@ diff --git a/src/components/Footer.vue b/src/components/Structure/Footer.vue similarity index 100% rename from src/components/Footer.vue rename to src/components/Structure/Footer.vue diff --git a/src/components/Header.vue b/src/components/Structure/Header.vue similarity index 88% rename from src/components/Header.vue rename to src/components/Structure/Header.vue index 2fc5696..8ffe76b 100644 --- a/src/components/Header.vue +++ b/src/components/Structure/Header.vue @@ -7,7 +7,7 @@ mdi-menu - icone assistance + icone assistance Item
@@ -19,7 +19,7 @@ alt="icone assistance" height="41px" href="https://stp.abes.fr/node/3?origine=sudocpro" - src="../assets/item_assistance.svg" + src="../../assets/item_assistance.svg" target="_blank" width="41px" style="transform: translateY(-3px)" /> icone déconnexionicone déconnexion diff --git a/src/components/Navbar.vue b/src/components/Structure/Navbar.vue similarity index 96% rename from src/components/Navbar.vue rename to src/components/Structure/Navbar.vue index 3268f7b..2d6dbd3 100644 --- a/src/components/Navbar.vue +++ b/src/components/Structure/Navbar.vue @@ -43,7 +43,7 @@ Recouvrement - + @@ -66,7 +66,7 @@ Creations - + @@ -89,7 +89,7 @@ Modifications - + diff --git a/src/router/index.js b/src/router/index.js index 211d911..7537780 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -67,35 +67,11 @@ const routes = [ meta: {requiresAuth: true} }, { - path: '/modification-etape-1-selection-rcr', - name: 'modification-etape-1-selection-rcr', + path: '/modification', + name: 'modification', component: ModifSteps, meta: {requiresAuth: true} }, - { - path: '/modification-etape-2-chargement-liste-ppn', - name: 'modification-etape-2-chargement-liste-ppn', - component: Accueil, - meta: {requiresAuth: true} - }, - { - path: '/modification-etape-3-choix-de-traitement', - name: 'modification-etape-3-choix-de-traitement', - component: Accueil, - meta: {requiresAuth: true} - }, - { - path: '/modification-etape-4-chargement-fichier-complete', - name: 'modification-etape-4-chargement-fichier-complete', - component: Accueil, - meta: {requiresAuth: true} - }, - { - path: '/modification-etape-5-simulation-avant-envoi', - name: 'modification-etape-5-simulation-avant-envoi', - component: Accueil, - meta: {requiresAuth: true} - }, { path: '/exemplarisation', name: 'exemplarisation', diff --git a/src/views/Accueil.vue b/src/views/Accueil.vue index d1ecff5..cd15e3f 100644 --- a/src/views/Accueil.vue +++ b/src/views/Accueil.vue @@ -24,7 +24,7 @@ - + Modifier des exemplaires diff --git a/src/views/Exemplarisation/ExempSteps.vue b/src/views/Exemplarisation/ExempSteps.vue index 50a0b7c..dfd30fa 100644 --- a/src/views/Exemplarisation/ExempSteps.vue +++ b/src/views/Exemplarisation/ExempSteps.vue @@ -42,7 +42,6 @@ - supprimer @@ -182,8 +181,7 @@ function createDemande() { next(); }).catch(err => { emits('backendError',err); - }) - .finally(() => { + }).finally(() => { isLoading.value = false; }); } diff --git a/src/views/Modification/ModifSteps.vue b/src/views/Modification/ModifSteps.vue index 83f54e0..fcbba8d 100644 --- a/src/views/Modification/ModifSteps.vue +++ b/src/views/Modification/ModifSteps.vue @@ -1,63 +1,182 @@ From 956fc7293a5341eb13d66d09315d28f33fb5d4f0 Mon Sep 17 00:00:00 2001 From: SamuelQuetin Date: Mon, 1 Jul 2024 13:30:01 +0200 Subject: [PATCH 2/4] finition upload / download creation typeTraitement --- src/components/DownloadFile.vue | 18 ----- src/components/{ => Exemp}/TypeExemp.vue | 21 ++--- src/components/Modif/DownloadFile.vue | 56 ++++++++++++++ src/components/Modif/TypeTraitement.vue | 63 +++++++++++++++ .../{UploadFile.vue => SelectFile.vue} | 0 src/service/DemandesService.js | 12 +++ src/views/Exemplarisation/ExempSteps.vue | 6 +- src/views/Modification/ModifSteps.vue | 76 +++++++++++++++++-- src/views/Recouvrement/RecouvSteps.vue | 4 +- 9 files changed, 215 insertions(+), 41 deletions(-) delete mode 100644 src/components/DownloadFile.vue rename src/components/{ => Exemp}/TypeExemp.vue (65%) create mode 100644 src/components/Modif/DownloadFile.vue create mode 100644 src/components/Modif/TypeTraitement.vue rename src/components/{UploadFile.vue => SelectFile.vue} (100%) diff --git a/src/components/DownloadFile.vue b/src/components/DownloadFile.vue deleted file mode 100644 index e3b0abf..0000000 --- a/src/components/DownloadFile.vue +++ /dev/null @@ -1,18 +0,0 @@ - - diff --git a/src/components/TypeExemp.vue b/src/components/Exemp/TypeExemp.vue similarity index 65% rename from src/components/TypeExemp.vue rename to src/components/Exemp/TypeExemp.vue index c96ffef..4f5b77b 100644 --- a/src/components/TypeExemp.vue +++ b/src/components/Exemp/TypeExemp.vue @@ -1,19 +1,20 @@ diff --git a/src/components/Modif/DownloadFile.vue b/src/components/Modif/DownloadFile.vue new file mode 100644 index 0000000..c860328 --- /dev/null +++ b/src/components/Modif/DownloadFile.vue @@ -0,0 +1,56 @@ + + + diff --git a/src/components/Modif/TypeTraitement.vue b/src/components/Modif/TypeTraitement.vue new file mode 100644 index 0000000..9c1302c --- /dev/null +++ b/src/components/Modif/TypeTraitement.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/src/components/UploadFile.vue b/src/components/SelectFile.vue similarity index 100% rename from src/components/UploadFile.vue rename to src/components/SelectFile.vue diff --git a/src/service/DemandesService.js b/src/service/DemandesService.js index a77915f..cf8094d 100644 --- a/src/service/DemandesService.js +++ b/src/service/DemandesService.js @@ -142,6 +142,10 @@ export class DemandesService { return this.client.patch(`demandes/EXEMP/${id}?typeExemp=${typeExemp}`); } + modifierTypeTraitementModifDemande(id, typeTraitement){ + return this.client.patch(`demandes/MODIF/${id}?traitement=${typeTraitement}`); + } + uploadDemande(id, file, typeDemande){ const config = { headers: { 'Content-Type': 'multipart/form-data', @@ -180,6 +184,14 @@ export class DemandesService { deleteDemande(id, typeDemande) { return this.client.delete(`demandes/${typeDemande}/${id}`); } + + getFilePreparer(id, typeDemande){ + return this.client.get(`/files/${typeDemande}/${id}/fichier_prepare_${id}.csv`); + } + + getTypeTraitement(){ + return this.client.get('traitements'); + } } export default new DemandesService() diff --git a/src/views/Exemplarisation/ExempSteps.vue b/src/views/Exemplarisation/ExempSteps.vue index dfd30fa..3fea121 100644 --- a/src/views/Exemplarisation/ExempSteps.vue +++ b/src/views/Exemplarisation/ExempSteps.vue @@ -62,7 +62,7 @@ - Charger le fichier des exemplaires à traiter + Charger le fichier des exemplaires à traiter - + @@ -65,11 +65,12 @@ - test - + + Récupération du fichier de correspondances PPN / EPN @@ -80,13 +81,26 @@ + Envoyé + + - Lancer le traitement en simulation + Suivant - + + + + précédent + + @@ -106,8 +120,10 @@ import { ref } from 'vue'; import router from '@/router'; import demandesService from '@/service/DemandesService'; import Rcr from '@/components/Rcr.vue'; -import UploadFile from '@/components/UploadFile.vue'; -import DownloadFile from '@/components/DownloadFile.vue'; +import SelectFile from '@/components/SelectFile.vue'; +import DownloadFile from '@/components/Modif/DownloadFile.vue'; +import TypeTraitement from '@/components/Modif/TypeTraitement.vue'; + const currentStep = ref(0); const demande = ref(); @@ -117,6 +133,11 @@ const alertMessage = ref(); const alertType = ref(); const isLoaded = ref(false); const isLoading = ref(false); +const isDownloaded = ref(false); +const fileLink = ref(''); +const fileName = ref(''); +const typeTraitementSelected = ref(); + const emits = defineEmits(['backendError']) function createDemande() { @@ -155,6 +176,12 @@ function uploadFile() { .then(() => { alertMessage.value = "Fichier envoyé"; isLoaded.value = true; + demandesService.getFilePreparer(demande.value.id, 'MODIF') + .then(response => { + let blob = new Blob([response.data], { type: 'application/csv' }); + fileLink.value = window.URL.createObjectURL(blob); + fileName.value = `fichier_demande_${demande.value.id}.csv`; + }) }) .catch(err => { alertMessage.value = err.response.data.message; @@ -164,6 +191,22 @@ function uploadFile() { isLoading.value = false; }); } + +function modifierTypeTraitementModifDemande(){ + isLoading.value = true; + demandesService.modifierTypeTraitementModifDemande(demande.value.id, typeTraitementSelected.value.id) + .then(response => { + demande.value = response.data; + next() + }).catch(err => { + emits('backendError', err); + }).finally(() => { + isLoading.value = false; + }); +} +function downloaded(){ + isDownloaded.value = true; +} function deleteDemande(){ demandesService.deleteDemande(demande.value.id, 'MODIF') .then(()=>{ @@ -172,11 +215,28 @@ function deleteDemande(){ emits('backendError', err); }) } + +function razBeforeNext(){ + isLoaded.value = false; + isLoading.value = false; + isDownloaded.value = false; + next(); +} function next(){ currentStep.value++; } function prev(){ currentStep.value--; + changeEtape(); +} + +function changeEtape() { + if((currentStep.value + 1) <= 2) { //Changement d'etat pour le chargement du fichier car le back est perdu sinon + demandesService.choixEtape(demande.value.id, 2, 'MODIF') + .then(response => { + demande.value = response.data; + }); + } } diff --git a/src/views/Recouvrement/RecouvSteps.vue b/src/views/Recouvrement/RecouvSteps.vue index 54e1e98..375fbc2 100644 --- a/src/views/Recouvrement/RecouvSteps.vue +++ b/src/views/Recouvrement/RecouvSteps.vue @@ -38,7 +38,7 @@ - Charger le fichier du taux de recouvrement + Charger le fichier du taux de recouvrement import Rcr from '@/components/Rcr.vue'; -import UploadFile from '@/components/UploadFile.vue'; +import SelectFile from '@/components/SelectFile.vue'; import { onMounted, ref } from 'vue'; import DemandesService from '@/service/DemandesService'; import router from '@/router'; From 27073dc6a659c923413095ba32f204e69b22c3e7 Mon Sep 17 00:00:00 2001 From: SamuelQuetin Date: Tue, 2 Jul 2024 15:38:04 +0200 Subject: [PATCH 3/4] Ajout label before et after dans simu ajout route modif/:id Ajout step selectfile Ajout step simu --- src/components/Exemp/TypeExemp.vue | 2 - src/components/Modif/TypeTraitement.vue | 4 + src/components/RecapDemande.vue | 9 +- src/components/Simulation.vue | 42 ++--- src/router/index.js | 7 + src/views/Exemplarisation/ExempSteps.vue | 3 +- src/views/Modification/ModifSteps.vue | 189 ++++++++++++++++++----- src/views/Modification/ModifTable.vue | 9 +- 8 files changed, 200 insertions(+), 65 deletions(-) diff --git a/src/components/Exemp/TypeExemp.vue b/src/components/Exemp/TypeExemp.vue index 4f5b77b..9fb6c50 100644 --- a/src/components/Exemp/TypeExemp.vue +++ b/src/components/Exemp/TypeExemp.vue @@ -54,8 +54,6 @@ function deleted() { diff --git a/src/router/index.js b/src/router/index.js index 7537780..d329048 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -72,6 +72,13 @@ const routes = [ component: ModifSteps, meta: {requiresAuth: true} }, + { + path: '/modification/:id', + name: 'modificationWithId', + component: ModifSteps, + props: true, + meta: {requiresAuth: true} + }, { path: '/exemplarisation', name: 'exemplarisation', diff --git a/src/views/Exemplarisation/ExempSteps.vue b/src/views/Exemplarisation/ExempSteps.vue index 3fea121..0c7ca7a 100644 --- a/src/views/Exemplarisation/ExempSteps.vue +++ b/src/views/Exemplarisation/ExempSteps.vue @@ -82,7 +82,7 @@ - + précédent @@ -125,7 +125,6 @@ const isLoading = ref(false); const dialog = ref(false); onMounted(()=>{ - console.log(props.id); if(props.id){ DemandesService.getDemande(props.id, "EXEMP") .then(response => { diff --git a/src/views/Modification/ModifSteps.vue b/src/views/Modification/ModifSteps.vue index e8f046a..14c96f9 100644 --- a/src/views/Modification/ModifSteps.vue +++ b/src/views/Modification/ModifSteps.vue @@ -1,7 +1,7 @@ diff --git a/src/views/Modification/ModifTable.vue b/src/views/Modification/ModifTable.vue index 358165e..5cfa6b1 100644 --- a/src/views/Modification/ModifTable.vue +++ b/src/views/Modification/ModifTable.vue @@ -70,7 +70,7 @@