From 9ca0a7511bb1503e9cf1cbd6a470f0f9e2e1228a Mon Sep 17 00:00:00 2001 From: sroy Date: Tue, 10 Feb 2026 11:05:07 +0000 Subject: [PATCH] =?UTF-8?q?[#318]=20Affichage=20d'une=20reception=20termin?= =?UTF-8?q?=C3=A9e=20(!19)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit | Numéro du ticket | Titre du ticket | |------------------|-----------------| | #318 | Affichage d'une reception terminée | ## Description de la PR ## Modification du .env ## Check list - [x] Pas de régression - [ ] TU/TI/TF rédigée - [x] TU/TI/TF OK - [x] CHANGELOG modifié Reviewed-on: https://gitea.malio.fr/MALIO-DEV/Ferme/pulls/19 Reviewed-by: Autin Co-authored-by: sroy Co-committed-by: sroy --- CHANGELOG.md | 1 + .../components/reception/reception-form.vue | 14 +- frontend/pages/reception/finish-reception.vue | 5 + frontend/pages/reception/update/[[id]].vue | 518 ++++++++++++++++++ frontend/services/dto/reception-data.ts | 13 + src/Entity/Carrier.php | 2 + 6 files changed, 540 insertions(+), 13 deletions(-) create mode 100644 frontend/pages/reception/update/[[id]].vue diff --git a/CHANGELOG.md b/CHANGELOG.md index 5902764..308b37e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Ajouter dans le fichier .env du frontend * [#312] Creation administration listing fournisseurs * [#315] Creation page admin utilisateur * [#317] Admin modification creation transporteur +* [#318] Affichage modification reception terminée ### Changed diff --git a/frontend/components/reception/reception-form.vue b/frontend/components/reception/reception-form.vue index 393de8f..063a363 100644 --- a/frontend/components/reception/reception-form.vue +++ b/frontend/components/reception/reception-form.vue @@ -144,19 +144,7 @@ import type {VehicleData} from '~/services/dto/vehicle-data' import {getVehicleList} from '~/services/vehicle' import {RECEPTION_TYPE_CODES, SUPLLIER_CODE} from "~/utils/constants"; import {deleteReceptionBovine, getReceptionBovineList} from "~/services/reception-bovine"; - -type ReceptionFormData = { - licensePlate: string - receptionDate: string - receptionTypeId: string - userId: string - supplierId: string - addressId: string - truckId: string - carrierId: string - driverId: string - vehicleId: string -} +import type {ReceptionFormData} from "~/services/dto/reception-data"; const router = useRouter() const receptionStore = useReceptionStore() diff --git a/frontend/pages/reception/finish-reception.vue b/frontend/pages/reception/finish-reception.vue index 63fbc20..ef1be1c 100644 --- a/frontend/pages/reception/finish-reception.vue +++ b/frontend/pages/reception/finish-reception.vue @@ -20,6 +20,7 @@ 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)" >
{{ reception.identificationNumber}}
{{ reception.receptionDate}}
@@ -47,6 +48,10 @@ const formatWeighing = (reception: ReceptionData, type: 'gross' | 'tare') => { return `${entry.weight} kg` } +const goToReception = (id: number) => { + router.push(`/reception/update/${id}`) +} + onMounted(async () => { receptionList.value = await getReceptionList(true) }) diff --git a/frontend/pages/reception/update/[[id]].vue b/frontend/pages/reception/update/[[id]].vue new file mode 100644 index 0000000..e5b28a7 --- /dev/null +++ b/frontend/pages/reception/update/[[id]].vue @@ -0,0 +1,518 @@ + + + diff --git a/frontend/services/dto/reception-data.ts b/frontend/services/dto/reception-data.ts index f1fe901..2ed9a77 100644 --- a/frontend/services/dto/reception-data.ts +++ b/frontend/services/dto/reception-data.ts @@ -59,3 +59,16 @@ export type ReceptionPayload = { carrier?: string | null driver?: string | null } + +export type ReceptionFormData = { + licensePlate: string + receptionDate: string + receptionTypeId: string + userId: string + supplierId: string + addressId: string + truckId: string + carrierId: string + driverId: string + vehicleId: string +} diff --git a/src/Entity/Carrier.php b/src/Entity/Carrier.php index b0fa17f..048fd51 100644 --- a/src/Entity/Carrier.php +++ b/src/Entity/Carrier.php @@ -26,11 +26,13 @@ use Symfony\Component\Serializer\Attribute\Groups; new Post( normalizationContext: ['groups' => ['carrier:read']], denormalizationContext: ['groups' => ['carrier:write']], + security: "is_granted('ROLE_ADMIN')" ), new Patch( requirements: ['id' => '\d+'], normalizationContext: ['groups' => ['carrier:read']], denormalizationContext: ['groups' => ['carrier:write']], + security: "is_granted('ROLE_ADMIN')" ), ], security: "is_granted('ROLE_USER')",