Skip to content

Commit

Permalink
Merge branch 'develop' into ITEM-141
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/views/Suppression/SuppSteps.vue
  • Loading branch information
jvk88511334 committed Aug 27, 2024
2 parents d93739a + 3befdbc commit 1891f71
Show file tree
Hide file tree
Showing 14 changed files with 635 additions and 151 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>
6 changes: 3 additions & 3 deletions src/components/MenuDownloadFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
<v-menu bottom left activator="parent">
<!-- FICHIERS MODIF -->
<v-list>
<v-list-item @click="downloadFile('fichier_initial', '.txt')" v-if="demande.type === 'MODIF' && idEtatCurrentDemande >= 3">
<v-list-item @click="downloadFile('fichier_initial', '.txt')" v-if="(demande.type === 'MODIF' && idEtatCurrentDemande >= 3) || (demande.type === 'SUPP' && idEtatCurrentDemande >= 3)">
<v-list-item-title>Télécharger le fichier initial des PPN</v-list-item-title>
</v-list-item>
<v-list-item @click="downloadFile('fichier_prepare', '.csv')" v-if="demande.type === 'MODIF' && idEtatCurrentDemande >= 3">
<v-list-item @click="downloadFile('fichier_prepare', '.csv')" v-if="(demande.type === 'MODIF' && idEtatCurrentDemande >= 3) || (demande.type === 'SUPP' && idEtatCurrentDemande >= 3)">
<v-list-item-title>Télécharger le fichier de correspondance PPN/EPN</v-list-item-title>
</v-list-item>
<v-list-item @click="downloadFile('fichier_enrichi', '.csv')" v-if="demande.type === 'MODIF' && idEtatCurrentDemande >= 4">
<v-list-item-title>Télécharger le fichier enrichi</v-list-item-title>
</v-list-item>

<v-list-item @click="downloadFile('fichier_enrichi', '.csv')"
v-if="(demande.type === 'RECOUV' && idEtatCurrentDemande >= 3) || (demande.type === 'EXEMP' && idEtatCurrentDemande >= 3)">
v-if="(demande.type === 'RECOUV' && idEtatCurrentDemande >= 3) || (demande.type === 'EXEMP' && idEtatCurrentDemande >= 3) ||(demande.type === 'SUPP' && idEtatCurrentDemande >= 5)">
<v-list-item-title>Télécharger le fichier déposé</v-list-item-title>
</v-list-item>

Expand Down
15 changes: 12 additions & 3 deletions src/components/SelectFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
</v-file-input>
</v-card-text>
</v-card>
</template>
<script setup>
import { ref } from 'vue';
import {computed, ref} from 'vue'
const fileCharged = defineModel();
const props = defineProps( {isLoading: { type: Boolean}})
const props = defineProps( {isLoading: { type: Boolean}, typeFile: { type: String}})
const emits = defineEmits(['deleted']);
const isValidFile = ref(false)
const label = computed(() => {
if (props.typeFile === 'PPN'){
return 'Cliquez pour charger votre liste de PPN (Fichier PPN sur une colonne, format .txt ou .csv obligatoire)';
} else if (props.typeFile === 'EPN'){
return 'Cliquez pour charger votre liste d’EPN (Fichier EPN sur une colonne, format .txt ou .csv obligatoire)';
} else {
return 'Cliquez pour charger votre fichier complété (format .txt ou .csv obligatoire)';
}
})
const rules = ref([
value => {
if(!value[0]) {
Expand Down
23 changes: 19 additions & 4 deletions src/components/Supp/TypeFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<v-col cols="12" sm="3" class="d-flex justify-center">
<v-icon size="x-large" dark color="primary"> mdi-file-document-outline </v-icon>
</v-col>
<v-col cols="12" sm="9" class="d-flex justify-start"><span class="group">Fichier {{ type }}</span></v-col>
<v-col cols="12" sm="9" class="d-flex justify-start">
<span class="group large-text">Fichier {{ type }}</span>
</v-col>
</v-row>
</div>
</v-hover>
Expand All @@ -20,17 +22,30 @@
</template>
<script setup>
const emits = defineEmits(['clicked','deleted'])
const props = defineProps({
isLoading: {
type: Boolean,
default: false
}
})
const typeFile = defineModel();
const types = ['PPN','EPN']
const model = defineModel();
const types = ['PPN','EPN'];
function onClick(type) {
typeFile.value = type;
model.value = type;
emits('clicked')
}
function deleted() {
emits('deleted');
}
</script>

<style scoped>
.large-text {
font-size: 1.1rem;
font-weight: bold;
}
</style>
7 changes: 7 additions & 0 deletions src/service/ItemService.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ export class ItemService {
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}`);
}

modifierTypeSuppression(id, typeSuppression){
return this.client.patch(`demandes/SUPP/${id}?typeSuppression=${typeSuppression}`);
}

uploadDemande(id, file, typeDemande){
const config = { headers: {
Expand Down
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
28 changes: 11 additions & 17 deletions src/views/Exemplarisation/ExempTable.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
<template>

<v-container fluid>
<v-chip v-if="!archiveFalseActiveTrue" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!archiveFalseActiveTrue)">Créations d'exemplaires
<v-chip :variant="isActiveDemandesDisplayed ? 'plain' : 'tonal'" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Créations d'exemplaires
</v-chip>
<v-chip v-if="archiveFalseActiveTrue" variant="plain" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!archiveFalseActiveTrue)">Créations d'exemplaires
</v-chip>
<v-chip v-if="archiveFalseActiveTrue" @click="switchArchiveActiveDisplay(!archiveFalseActiveTrue)">Créations
<v-chip :variant="!isActiveDemandesDisplayed ? 'plain' : 'tonal'" @click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Créations
d'exemplaires archivées
</v-chip>
<v-chip v-if="!archiveFalseActiveTrue" variant="plain" @click="switchArchiveActiveDisplay(!archiveFalseActiveTrue)">
Créations d'exemplaires archivées
</v-chip>
<v-chip variant="text">
<v-tooltip activator="parent" location="bottom">
<template v-slot:activator="{ props }">
<label>
<input type="checkbox" v-model="extendedAllILN" style="margin-right: 5px"
@change="loadItems('EXEMP', archiveFalseActiveTrue)">
@change="loadItems('EXEMP', isActiveDemandesDisplayed)">
<span v-bind="props">Affichage étendu sur tous les ILN</span>
</label>
</template>
Expand Down Expand Up @@ -127,7 +121,7 @@
</template>
</v-data-table>
<dialog-suppression v-model="suppDialog" :demande="suppDemande"
@supp="loadItems('EXEMP', archiveFalseActiveTrue)"></dialog-suppression>
@supp="loadItems('EXEMP', isActiveDemandesDisplayed)"></dialog-suppression>
</template>

<script setup>
Expand Down Expand Up @@ -254,11 +248,11 @@ const isDialogOpen = computed(() => {
return !!contentsDemandesFrontFiltered.value.find(item => item.expanded === true)
});
//Actives or archives demands displayed
const archiveFalseActiveTrue = ref(false);
const isActiveDemandesDisplayed = ref(false);
//Data initialisation
onMounted(() => {
loadItems('EXEMP', archiveFalseActiveTrue.value);
loadItems('EXEMP', isActiveDemandesDisplayed.value);
contentsDemandesFromServer.value = [...contentsDemandesFromServer.value];
itemService.getTypeExemp()
.then(response => {
Expand All @@ -270,7 +264,7 @@ onMounted(() => {
});
polling = setInterval(() => {
if(!isDialogOpen.value) {
loadItems('EXEMP', archiveFalseActiveTrue.value)
loadItems('EXEMP', isActiveDemandesDisplayed.value)
.then(() => {
filterItems();
});
Expand All @@ -282,8 +276,8 @@ onBeforeUnmount(() => {
clearInterval(polling);
})
function switchArchiveActiveDisplay(value) {
archiveFalseActiveTrue.value = value;
loadItems('EXEMP', archiveFalseActiveTrue.value);
isActiveDemandesDisplayed.value = value;
loadItems('EXEMP', isActiveDemandesDisplayed.value);
}
async function loadItems(type, archive) {
Expand Down Expand Up @@ -358,7 +352,7 @@ function onRowClick(item) {
}
function saveComment(){
loadItems('EXEMP',archiveFalseActiveTrue.value).then(()=>{
loadItems('EXEMP',isActiveDemandesDisplayed.value).then(()=>{
filterItems();
})
}
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
29 changes: 12 additions & 17 deletions src/views/Modification/ModifTable.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
<template>
<v-container fluid>
<v-chip v-if="!archiveFalseActiveTrue" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!archiveFalseActiveTrue)">Modification d'exemplaires
<!--:variant="isActiveDemandesDisplayed ? 'plain' : 'tonal'" -->
<v-chip :variant="isActiveDemandesDisplayed ? 'plain' : 'tonal'" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Modification d'exemplaires
</v-chip>
<v-chip v-if="archiveFalseActiveTrue" variant="plain" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!archiveFalseActiveTrue)">Modification d'exemplaires
</v-chip>
<v-chip v-if="archiveFalseActiveTrue" @click="switchArchiveActiveDisplay(!archiveFalseActiveTrue)">Modification
<v-chip :variant="!isActiveDemandesDisplayed ? 'plain' : 'tonal'" @click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Modification
d'exemplaires archivées
</v-chip>
<v-chip v-if="!archiveFalseActiveTrue" variant="plain" @click="switchArchiveActiveDisplay(!archiveFalseActiveTrue)">
Modification d'exemplaires archivées
</v-chip>
<v-chip variant="text">
<v-tooltip activator="parent" location="bottom">
<template v-slot:activator="{ props }">
<label>
<input type="checkbox" v-model="extendedAllILN" style="margin-right: 5px"
@change="loadItems('MODIF', archiveFalseActiveTrue)">
@change="loadItems('MODIF', isActiveDemandesDisplayed)">
<span v-bind="props">Affichage étendu sur tous les ILN</span>
</label>
</template>
Expand Down Expand Up @@ -124,7 +119,7 @@
</template>
</v-data-table>
<dialog-suppression v-model="suppDialog" :demande="suppDemande"
@supp="loadItems('MODIF', archiveFalseActiveTrue)"></dialog-suppression>
@supp="loadItems('MODIF', isActiveDemandesDisplayed)"></dialog-suppression>
</template>

<script setup>
Expand Down Expand Up @@ -260,11 +255,11 @@ const isDialogOpen = computed(() => {
});
//Actives or archives demands displayed
const archiveFalseActiveTrue = ref(false);
const isActiveDemandesDisplayed = ref(false);
//Data initialisation
onMounted(() => {
loadItems('MODIF', archiveFalseActiveTrue.value);
loadItems('MODIF', isActiveDemandesDisplayed.value);
contentsDemandesFromServer.value = [...contentsDemandesFromServer.value];
itemService.getTypeTraitement()
.then(response => {
Expand All @@ -276,7 +271,7 @@ onMounted(() => {
});
polling = setInterval(() => {
if (!isDialogOpen.value) {
loadItems('MODIF', archiveFalseActiveTrue.value)
loadItems('MODIF', isActiveDemandesDisplayed.value)
.then(() => {
filterItems();
});
Expand All @@ -289,8 +284,8 @@ onBeforeUnmount(() => {
});
function switchArchiveActiveDisplay(value) {
archiveFalseActiveTrue.value = value;
loadItems('MODIF', archiveFalseActiveTrue.value);
isActiveDemandesDisplayed.value = value;
loadItems('MODIF', isActiveDemandesDisplayed.value);
}
async function loadItems(type, archive) {
Expand Down Expand Up @@ -375,7 +370,7 @@ function onRowClick(item) {
}
function saveComment() {
loadItems('MODIF', archiveFalseActiveTrue.value)
loadItems('MODIF', isActiveDemandesDisplayed.value)
.then(() => {
filterItems();
});
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
Loading

0 comments on commit 1891f71

Please sign in to comment.