feat : finalisation de affichage et update reception terminee suite

This commit is contained in:
2026-02-11 11:45:35 +01:00
parent 358133e4f5
commit 9afafb316b
5 changed files with 481 additions and 13 deletions

View File

@@ -1,40 +1,47 @@
<template>
<form @submit.prevent="validate">
<div class="grid grid-cols-2 gap-x-40 gap-y-8 mb-16">
<UiNumberInput
label="Pesée à vide"
v-model="form.weights[0].weight"
:disabled="!auth.isAdmin"
:min="0"
/>
<UiNumberInput
label="Pesée à plein"
v-model="form.weights[1].weight"
:disabled="!auth.isAdmin"
:min="0"
/>
</div>
<button
type="submit"
class="bg-primary-500 text-white px-6 py-3 rounded-md"
>
Enregistrer
</button>
<div class="flex justify-center">
<button
type="submit"
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
:disabled="!auth.isAdmin"
>
Valider
</button>
</div>
</form>
</template>
<script setup lang="ts">
import type {ReceptionFormWeight, ReceptionUpdatePayload} from '~/services/dto/reception-data'
import type {ReceptionFormWeight} from '~/services/dto/reception-data'
import { getReception } from '~/services/reception'
import { useReceptionStore } from '~/stores/reception'
import {updateWeight} from "~/services/weight";
import {useAuthStore} from "~/stores/auth";
const props = defineProps<{
idReception: number
}>()
const receptionStore = useReceptionStore()
const router = useRouter()
const idReception = props.idReception
const auth = useAuthStore()
const form = reactive({
weights: [
@@ -52,7 +59,7 @@ const hydrateFromReception = (reception: ReceptionFormWeight) => {
}
onMounted(async () => {
const reception = await getReception(props.idReception)
const reception = await getReception(idReception)
hydrateFromReception(reception)
})