feat : ajout de la génération du bon de reception, correction de la base du formulaire multi-etape de reception et ajout d'une gestion d'erreur global

This commit is contained in:
AUTIN Tristan
2026-01-15 18:37:44 +01:00
parent 4a77449a41
commit 94ea49587a
22 changed files with 1153 additions and 220 deletions
+5 -8
View File
@@ -1,14 +1,13 @@
<template>
<div v-if="errorMessage" class="text-red-600">{{ errorMessage }}</div>
<div v-else>
<div>
<div class="flex justify-between h-[52px] mb-[90px]">
<p class="self-center">Indicateur détapes</p>
<NuxtLink to="/" class="flex flex-col justify-center uppercase text-xl bg-black text-white h-[50px] w-[272px] text-center">Mettre en attente</NuxtLink>
</div>
<ReceptionForm v-if="storeReception?.currentStep === 0"/>
<ReceptionForm v-if="!storeReception || storeReception.currentStep === 0"/>
<ReceptionWeight v-if="storeReception?.currentStep === 1" mode="gross"/>
<ReceptionUnloading v-if="storeReception?.currentStep === 2"/>
<ReceptionWeight v-if="storeReception?.currentStep === 3" mode="tare"/>
<ReceptionWeight v-if="storeReception?.currentStep !== null && storeReception?.currentStep >= 3" mode="tare"/>
</div>
</template>
@@ -20,16 +19,14 @@ const route = useRoute()
const router = useRouter()
const receptionStore = useReceptionStore()
const { current: storeReception, errorMessage } = storeToRefs(receptionStore)
const { current: storeReception } = storeToRefs(receptionStore)
onMounted(async () => {
const raw = route.params.id
const idStr = Array.isArray(raw) ? raw[0] : raw
const id = idStr ? Number(idStr) : null
if (id === null) {
await receptionStore.createReception()
} else {
if (id !== null) {
await receptionStore.loadReception(id)
}
})