feat : ajout plus d'information sur la liste des réceptions côté front sur la page d'accueil

This commit is contained in:
tristan
2026-01-22 17:21:17 +01:00
parent 80d6d72e37
commit 66e9c52914
2 changed files with 55 additions and 12 deletions
+15 -6
View File
@@ -4,9 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="fix : gitea workflow"> <list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="fix : script de déploiement">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/deploy-release.sh" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/deploy-release.sh" afterDir="false" /> <change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/frontend/pages/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/pages/index.vue" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -265,7 +266,7 @@
<workItem from="1768374298711" duration="12403000" /> <workItem from="1768374298711" duration="12403000" />
<workItem from="1768460547451" duration="26946000" /> <workItem from="1768460547451" duration="26946000" />
<workItem from="1768547023783" duration="11371000" /> <workItem from="1768547023783" duration="11371000" />
<workItem from="1768894030675" duration="53243000" /> <workItem from="1768894030675" duration="53874000" />
</task> </task>
<task id="LOCAL-00001" summary="feat : Ajout de pinia, création de la table weight et reception mise en place du système de step pour les receptions (WIP)"> <task id="LOCAL-00001" summary="feat : Ajout de pinia, création de la table weight et reception mise en place du système de step pour les receptions (WIP)">
<option name="closed" value="true" /> <option name="closed" value="true" />
@@ -499,7 +500,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1769097476629</updated> <updated>1769097476629</updated>
</task> </task>
<option name="localTasksCounter" value="30" /> <task id="LOCAL-00030" summary="fix : script de déploiement">
<option name="closed" value="true" />
<created>1769098182184</created>
<option name="number" value="00030" />
<option name="presentableId" value="LOCAL-00030" />
<option name="project" value="LOCAL" />
<updated>1769098182184</updated>
</task>
<option name="localTasksCounter" value="31" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -549,7 +558,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="feat : Ajout d'un composable pour la pesée qui sera réutilisable pour l'expédition, ajout de contrainte sur les entity de reception et weight pour plus de robustesse et correction de la class active des liens dans la nav" />
<MESSAGE value="feat : update du fichier AGENTS.md" /> <MESSAGE value="feat : update du fichier AGENTS.md" />
<MESSAGE value="feat : update du fichier README.md et CHANGELOG.md" /> <MESSAGE value="feat : update du fichier README.md et CHANGELOG.md" />
<MESSAGE value="fix : correction du useApi pour qu'il n'y ait plus de retry lors d'une erreur 500 par exemple" /> <MESSAGE value="fix : correction du useApi pour qu'il n'y ait plus de retry lors d'une erreur 500 par exemple" />
@@ -574,7 +582,8 @@
<MESSAGE value="fix : doc de déploiement" /> <MESSAGE value="fix : doc de déploiement" />
<MESSAGE value="fix : doc et script de déploiement" /> <MESSAGE value="fix : doc et script de déploiement" />
<MESSAGE value="fix : gitea workflow" /> <MESSAGE value="fix : gitea workflow" />
<option name="LAST_COMMIT_MESSAGE" value="fix : gitea workflow" /> <MESSAGE value="fix : script de déploiement" />
<option name="LAST_COMMIT_MESSAGE" value="fix : script de déploiement" />
</component> </component>
<component name="XSLT-Support.FileAssociations.UIState"> <component name="XSLT-Support.FileAssociations.UIState">
<expand /> <expand />
+40 -6
View File
@@ -1,11 +1,32 @@
<template> <template>
<div class=""> <div>
<h1 class="text-3xl font-bold">Liste des receptions</h1> <h1 class="text-3xl font-bold">Liste des receptions</h1>
<ul> <div class="mt-6 border border-slate-200">
<li v-for="reception in receptionList" :key="reception.id"> <div class="grid grid-cols-6 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
<NuxtLink :to="`/reception/${reception.id}`">Réception numéro {{ reception.id}}</NuxtLink> <div>ID</div>
</li> <div>Immatriculation</div>
</ul> <div>Pesée plein</div>
<div>Pesée vide</div>
<div>Etape</div>
<div>Date</div>
</div>
<div
v-for="reception in receptionList"
:key="reception.id"
class="grid grid-cols-6 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200"
role="button"
tabindex="0"
@click="goToReception(reception.id)"
@keydown.enter="goToReception(reception.id)"
>
<div>{{ reception.id }}</div>
<div>{{ reception.licensePlate }}</div>
<div>{{ formatWeighing(reception, 'gross') }}</div>
<div>{{ formatWeighing(reception, 'tare') }}</div>
<div>{{ reception.currentStep }}</div>
<div>{{ reception.receptionDate }}</div>
</div>
</div>
</div> </div>
</template> </template>
@@ -14,6 +35,19 @@ import type {ReceptionData} from "~/services/dto/reception-data";
import {getReceptionList} from "~/services/reception"; import {getReceptionList} from "~/services/reception";
const receptionList = ref<ReceptionData[]>() const receptionList = ref<ReceptionData[]>()
const router = useRouter()
const goToReception = (id: number) => {
router.push(`/reception/${id}`)
}
const formatWeighing = (reception: ReceptionData, type: 'gross' | 'tare') => {
const entry = reception.weights?.find((weight) => weight.type === type)
if (!entry || entry.weight == null || entry.dsd == null) {
return '—'
}
return `${entry.weight} kg / ${entry.dsd} dsd`
}
onMounted(async () => { onMounted(async () => {
receptionList.value = await getReceptionList() receptionList.value = await getReceptionList()