Skip to content

Commit

Permalink
- Mise en place de l'écran de chargement du fichier enrichi et gestio…
Browse files Browse the repository at this point in the history
…n de la popup de validation
  • Loading branch information
jvk88511334 committed Aug 21, 2024
1 parent 9ce8378 commit 813c399
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/components/Dialog/DialogLancerTraitement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<v-card-actions class="justify-space-between">
<v-btn v-if="!isFinished" color="primary" @click="dialog = false" aria-label="Annuler">Annuler</v-btn>
<v-spacer v-else></v-spacer>
<v-btn v-if="!isFinished" color="primary" @click="confirm()" aria-label="Valider">Valider</v-btn>
<v-btn v-if="!isFinished && !isSuppDemande" color="primary" @click="confirm()" aria-label="Valider">Valider</v-btn>
<v-btn v-else color="primary" @click="router.push(route)" aria-label="OK">OK</v-btn>
</v-card-actions>
</v-card>
Expand All @@ -36,6 +36,10 @@ const props = defineProps({
type: Boolean,
default: false
},
rubrique: {
required: true,
type: String,
},
route: {
required: true,
type: String,
Expand All @@ -47,7 +51,7 @@ const isFinished = ref(false);
function confirm() {
emits('launch');
title.value = "Traitement validé";
body.value = "Votre demande est en cours de traitement.<br/>Un mail vous sera envoyé quand celui-ci sera terminé.<br/>Vous pouvez retrouver l'ensemble de vos demandes sur votre tableau de bord ITEM. Rubrique \"Gérer mes créations\".";
body.value = `Votre demande est en cours de traitement.<br/>Un mail vous sera envoyé quand celui-ci sera terminé.<br/>Vous pouvez retrouver l'ensemble de vos demandes sur votre tableau de bord ITEM. Rubrique ${props.rubrique}.`;
isFinished.value = true;
}
</script>
2 changes: 1 addition & 1 deletion src/views/Exemplarisation/ExempSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</v-col>
</v-row>
</v-container>
<dialog-lancer-traitement v-model="dialog" :is-loading="isLoading" route="/exemplarisation-tableau" @launch="launchDemande()"></dialog-lancer-traitement>
<dialog-lancer-traitement v-model="dialog" :is-loading="isLoading" rubrique="Gérer mes créations" route="/exemplarisation-tableau" @launch="launchDemande()"></dialog-lancer-traitement>
<dialog-suppression v-model="suppDialog" :demande="demande" return-to-accueil></dialog-suppression>
</template>

Expand Down
2 changes: 1 addition & 1 deletion src/views/Modification/ModifSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
</v-col>
</v-row>
</v-container>
<dialog-lancer-traitement v-model="dialog" :is-loading="isLoading" route="/modification-tableau" @launch="launchDemande()"></dialog-lancer-traitement>
<dialog-lancer-traitement v-model="dialog" :is-loading="isLoading" rubrique="Gérer mes modifications" route="/modification-tableau" @launch="launchDemande()"></dialog-lancer-traitement>
<dialog-suppression v-model="suppDialog" :demande="demande" return-to-accueil></dialog-suppression>
</template>

Expand Down
2 changes: 1 addition & 1 deletion src/views/Recouvrement/RecouvSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" @click="router.replace('recouvrement-tableau')" aria-label="OK">OK</v-btn>
<v-btn color="primary" @click="router.push('recouvrement-tableau')" aria-label="OK">OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
Expand Down
60 changes: 60 additions & 0 deletions src/views/Suppression/SuppSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,50 @@
</v-container>
</v-stepper-window-item>
<v-stepper-window-item>
<select-file v-model="fileFinalSelected" :is-loading="isLoading" @deleted="deleteDemande()">Charger le
fichier des exemplaires à supprimer
</select-file>
<v-alert
v-if="alertMessage"
:type="alertType"
>
<span v-html="alertMessage"></span>
</v-alert>
<v-container class="d-flex justify-space-between">
<v-btn @click="prev">
précédent
</v-btn>
<v-btn
:disabled="!fileFinalSelected"
@click="uploadFileFinal()"
>
Lancer le traitement en production
</v-btn>
</v-container>
</v-stepper-window-item>
<v-stepper-window-item>

</v-stepper-window-item>
</v-stepper-window>
</v-stepper>
<v-dialog
v-model="dialog"
width="500"
>
<v-card>
<v-card-title class="headline" primary-title>Traitement validé</v-card-title>
<v-card-text>Votre demande est en cours de traitement.<br/>Un mail vous sera envoyé quand celui-ci sera
terminé.
<br>Vous pouvez retrouver l'ensemble de vos demandes sur votre tableau de bord ITEM. Rubrique "Gérer mes
suppressions".
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" @click="router.push('suppression-tableau')" aria-label="OK">OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-col>
</v-row>
</v-container>
Expand All @@ -110,6 +148,8 @@ import SelectFile from '@/components/SelectFile.vue';
import demandesService from '@/service/DemandesService';
import {tr} from "vuetify/locale";
import DownloadFile from "@/components/Modif/DownloadFile.vue";
import router from '@/router'
import DialogLancerTraitement from '@/components/Dialog/DialogLancerTraitement.vue'
Expand All @@ -122,6 +162,7 @@ const props = defineProps({id: {type: String}});
const rcrSelected = ref();
const typeFileSelected = ref();
const fileFinalSelected = ref();
const fileSelected = ref();
const fileLink = ref('');
const fileName = ref('');
Expand All @@ -130,6 +171,7 @@ const isDownloaded = ref(false);
const isLoading = ref(false);
const alertMessage = ref('');
const alertType = ref('success');
const dialog = ref(false);
function createDemande() {
Expand Down Expand Up @@ -203,6 +245,24 @@ function changeEtape() {
}
}
function uploadFileFinal() {
alertMessage.value = '';
alertType.value = 'success';
isLoading.value = true;
demandesService.uploadDemande(demande.value.id, fileFinalSelected.value, 'SUPP')
.then(() => {
alertMessage.value = "Fichier envoyé";
dialog.value = true;
})
.catch(err => {
alertMessage.value = err.response.data.message;
alertType.value = 'error';
})
.finally(() => {
isLoading.value = false;
});
}
function prevSelectTypeFile(){
typeFileSelected.value = null;
changeEtape()
Expand Down

0 comments on commit 813c399

Please sign in to comment.