From cf16423d4b07fc7adb6e5e32f38481186bc0ac82 Mon Sep 17 00:00:00 2001 From: Jerome Villiseck Date: Fri, 8 Nov 2024 15:19:30 +0100 Subject: [PATCH] - Adaptation des tableaux --- src/views/Exemplarisation/ExempTable.vue | 11 ++++++++++- src/views/Modification/ModifTable.vue | 13 +++++++++++-- src/views/Suppression/SuppTable.vue | 13 +++++++++++-- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/views/Exemplarisation/ExempTable.vue b/src/views/Exemplarisation/ExempTable.vue index 0067d9c..d713c2e 100644 --- a/src/views/Exemplarisation/ExempTable.vue +++ b/src/views/Exemplarisation/ExempTable.vue @@ -155,6 +155,12 @@ const headingsDemandes = [ align: 'center', display: true, }, + { + title: 'Nb d\'exemplaires', + key: 'nbex', + align: 'center', + display: true, + }, { title: 'Crée le', key: 'dateCreation', @@ -264,6 +270,7 @@ const sortBy = ref([{ const isDataLoaded = ref(false); //Search fields columns const numDemandeSearchField = ref(''); +const nbExemplairesSearchField = ref(''); const dateCreationSearchField = ref(''); const dateModificationSearchField = ref(''); const ilnSearchField = ref(''); @@ -331,6 +338,8 @@ function filterItems() { contentsDemandesFrontFiltered.value = contentsDemandesFromServer.value.filter(demande => { const matchesNumDemande = numDemandeSearchField.value === '' || demande.id.toString() .includes(numDemandeSearchField.value); + const matchesNbExemplaires = nbExemplairesSearchField.value === '' || demande.nbex.toString() + .includes(nbExemplairesSearchField.value); const matchesDateCreation = dateCreationSearchField.value === '' || demande.dateCreation.toString() .includes(dateCreationSearchField.value); const matchesDateModification = dateModificationSearchField.value === '' || demande.dateModification.toString() @@ -343,7 +352,7 @@ function filterItems() { const matchesIndexSearch = indexRechercheSearchField.value === '' || demande.indexRecherche && demande.indexRecherche.includes(indexRechercheSearchField.value); const matchesEtatDemande = statutSearchField.value === undefined || statutSearchField.value === null || statutSearchField.value === '' || demande.etatDemande.toString() .includes(statutSearchField.value) || ((statutSearchField.value === 'En saisie') && (demande.etatDemande === 'En simulation' || demande.etatDemande === 'En préparation' || demande.etatDemande === 'A compléter')); - return matchesNumDemande && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesTypeExemp && matchesIndexSearch && matchesEtatDemande; + return matchesNumDemande && matchesNbExemplaires && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesTypeExemp && matchesIndexSearch && matchesEtatDemande; }); } diff --git a/src/views/Modification/ModifTable.vue b/src/views/Modification/ModifTable.vue index 61359a9..f133128 100644 --- a/src/views/Modification/ModifTable.vue +++ b/src/views/Modification/ModifTable.vue @@ -152,7 +152,13 @@ const headingsDemandes = [ key: 'id', align: 'center', display: true, - },z + }, + { + title: 'Nb d\'exemplaires', + key: 'nbex', + align: 'center', + display: true, + }, { title: 'Crée le', key: 'dateCreation', @@ -262,6 +268,7 @@ const isDataLoaded = ref(false); //Search fields columns const numDemandeSearchField = ref(''); +const nbExemplairesSearchField = ref(''); const dateCreationSearchField = ref(''); const dateModificationSearchField = ref(''); const ilnSearchField = ref(''); @@ -330,6 +337,8 @@ function filterItems() { contentsDemandesFrontFiltered.value = contentsDemandesFromServer.value.filter(demande => { const matchesNumDemande = numDemandeSearchField.value === '' || demande.id.toString() .includes(numDemandeSearchField.value); + const matchesNbExemplaires = nbExemplairesSearchField.value === '' || demande.nbex.toString() + .includes(nbExemplairesSearchField.value); const matchesDateCreation = dateCreationSearchField.value === '' || demande.dateCreation.toString() .includes(dateCreationSearchField.value); const matchesDateModification = dateModificationSearchField.value === '' || demande.dateModification.toString() @@ -342,7 +351,7 @@ function filterItems() { const matchesTraitement = traitementSearchField.value === undefined || traitementSearchField.value === null || traitementSearchField.value === '' || (demande.traitement && demande.traitement.includes(traitementSearchField.value)) || (!demande.traitement && traitementSearchField.value === 'Non défini'); const matchesEtatDemande = statutSearchField.value === undefined || statutSearchField.value === null || statutSearchField.value === '' || demande.etatDemande.toString() .includes(statutSearchField.value) || ((statutSearchField.value === 'En saisie') && (demande.etatDemande === 'En simulation' || demande.etatDemande === 'En préparation' || demande.etatDemande === 'Préparée' || demande.etatDemande === 'A compléter')); - return matchesNumDemande && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesZone && matchesTraitement && matchesEtatDemande; + return matchesNumDemande && matchesNbExemplaires && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesZone && matchesTraitement && matchesEtatDemande; }); } diff --git a/src/views/Suppression/SuppTable.vue b/src/views/Suppression/SuppTable.vue index ade3541..c6c82ae 100644 --- a/src/views/Suppression/SuppTable.vue +++ b/src/views/Suppression/SuppTable.vue @@ -140,6 +140,12 @@ const headingsDemandes = [ align: 'center', display: true, }, + { + title: 'Nb d\'exemplaires', + key: 'nbex', + align: 'center', + display: true, + }, { title: 'Crée le', key: 'dateCreation', @@ -237,6 +243,7 @@ const isDataLoaded = ref(false); //Search fields columns const numDemandeSearchField = ref(''); +const nbExemplairesSearchField = ref(''); const dateCreationSearchField = ref(''); const dateModificationSearchField = ref(''); const ilnSearchField = ref(''); @@ -290,7 +297,6 @@ async function loadItems(type, archive) { contentsDemandesFrontFiltered.value = response.data.map((item) => ({ ...item, expanded: false, - })); isDataLoaded.value = true; @@ -305,6 +311,8 @@ function filterItems() { contentsDemandesFrontFiltered.value = contentsDemandesFromServer.value.filter(demande => { const matchesNumDemande = numDemandeSearchField.value === '' || demande.id.toString() .includes(numDemandeSearchField.value); + const matchesNbExemplaires = nbExemplairesSearchField.value === '' || demande.nbex.toString() + .includes(nbExemplairesSearchField.value); const matchesDateCreation = dateCreationSearchField.value === '' || demande.dateCreation.toString() .includes(dateCreationSearchField.value); const matchesDateModification = dateModificationSearchField.value === '' || demande.dateModification.toString() @@ -317,7 +325,7 @@ function filterItems() { const matchesTraitement = traitementSearchField.value === undefined || traitementSearchField.value === null || traitementSearchField.value === '' || (demande.traitement && demande.traitement.includes(traitementSearchField.value)) || (!demande.traitement && traitementSearchField.value === 'Non défini'); const matchesEtatDemande = statutSearchField.value === undefined || statutSearchField.value === null || statutSearchField.value === '' || demande.etatDemande.toString() .includes(statutSearchField.value) || ((statutSearchField.value === 'En saisie') && (demande.etatDemande === 'En simulation' || demande.etatDemande === 'En préparation' || demande.etatDemande === 'Préparée' || demande.etatDemande === 'A compléter')); - return matchesNumDemande && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesZone && matchesTraitement && matchesEtatDemande; + return matchesNumDemande && matchesNbExemplaires && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesZone && matchesTraitement && matchesEtatDemande; }); } @@ -389,6 +397,7 @@ function colorProgressBar(item) {