From 800ab1d4322b101146b1283fb52c200368f9067f Mon Sep 17 00:00:00 2001 From: sroy Date: Thu, 12 Feb 2026 07:06:49 +0000 Subject: [PATCH] =?UTF-8?q?[#320]=20Modification=20r=C3=A9ception=20termin?= =?UTF-8?q?=C3=A9=20=C3=A9tape=202=20(!21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit | Numéro du ticket | Titre du ticket | |------------------|-----------------| | #320 | Modification réception terminé étape 2 | ## 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/21 Reviewed-by: Autin Co-authored-by: sroy Co-committed-by: sroy --- CHANGELOG.md | 1 + .../components/reception/reception-form.vue | 1 + .../components/reception/update-bovin.vue | 183 +++++++++++++ .../reception/update-merchandise.vue | 257 ++++++++++++++++++ .../components/reception/update-weight.vue | 74 +++++ frontend/i18n/locales/fr.json | 8 +- frontend/pages/admin/carrier/[[id]].vue | 1 - frontend/pages/reception/update/[[id]].vue | 28 ++ frontend/services/dto/reception-data.ts | 19 ++ frontend/services/weight.ts | 5 +- 10 files changed, 574 insertions(+), 3 deletions(-) create mode 100644 frontend/components/reception/update-bovin.vue create mode 100644 frontend/components/reception/update-merchandise.vue create mode 100644 frontend/components/reception/update-weight.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index 308b37e..4016f64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ Ajouter dans le fichier .env du frontend * [#315] Creation page admin utilisateur * [#317] Admin modification creation transporteur * [#318] Affichage modification reception terminée +* [#320] Affichage modification reception terminée suite ### Changed diff --git a/frontend/components/reception/reception-form.vue b/frontend/components/reception/reception-form.vue index 063a363..d5bee42 100644 --- a/frontend/components/reception/reception-form.vue +++ b/frontend/components/reception/reception-form.vue @@ -123,6 +123,7 @@ + diff --git a/frontend/components/reception/update-merchandise.vue b/frontend/components/reception/update-merchandise.vue new file mode 100644 index 0000000..e3c72a6 --- /dev/null +++ b/frontend/components/reception/update-merchandise.vue @@ -0,0 +1,257 @@ + + + diff --git a/frontend/components/reception/update-weight.vue b/frontend/components/reception/update-weight.vue new file mode 100644 index 0000000..2f97c5c --- /dev/null +++ b/frontend/components/reception/update-weight.vue @@ -0,0 +1,74 @@ + + + diff --git a/frontend/i18n/locales/fr.json b/frontend/i18n/locales/fr.json index 4ea1b99..2150e3e 100644 --- a/frontend/i18n/locales/fr.json +++ b/frontend/i18n/locales/fr.json @@ -12,7 +12,10 @@ "fetch": "Impossible de récupérer la réception.", "create": "Impossible de créer la réception.", "update": "Impossible de mettre à jour la réception.", - "weigh": "Impossible de récupérer la pesée." + "weight": "Impossible de récupérer la pesée." + }, + "weight": { + "update": "Impossible de mettre à jour la pesée" }, "receptionType": { "list": "Impossible de récupérer la liste des types de réception." @@ -79,6 +82,9 @@ "carrier": { "update": "Transporteur mis à jour", "create": "Transporteur créé" + }, + "weight": { + "update": "Pesée mis à jour" } } } diff --git a/frontend/pages/admin/carrier/[[id]].vue b/frontend/pages/admin/carrier/[[id]].vue index 702a3f7..350c627 100644 --- a/frontend/pages/admin/carrier/[[id]].vue +++ b/frontend/pages/admin/carrier/[[id]].vue @@ -14,7 +14,6 @@
- Enregistrer
@@ -119,6 +120,28 @@ wrapper-class="col-start-2 row-start-4" /> +
+

pesées

+

{{isMerchandise ? "Marchandises" : "Bovins"}}

+
+ + + + + + @@ -141,6 +164,9 @@ import {SUPLLIER_CODE} from "~/utils/constants"; import {deleteReceptionBovine, getReceptionBovineList} from "~/services/reception-bovine"; import type {ReceptionData, ReceptionFormData} from "~/services/dto/reception-data"; import {getReception} from "~/services/reception"; +import UpdateWeight from "~/components/reception/update-weight.vue"; +import UpdateMerchandise from "~/components/reception/update-merchandise.vue"; +import UpdateBovin from "~/components/reception/update-bovin.vue"; const router = useRouter() const receptionStore = useReceptionStore() @@ -179,6 +205,8 @@ const idReception = Number(route.params.id) const receptionLoad = await getReception(idReception) const receptionType = receptionLoad.receptionType const auth = useAuthStore() +const isBtWeight = ref(true) +const isMerchandise = ref(receptionType.code === 'MARCHANDISES') // Transporteur sélectionné dans le formulaire const selectedCarrier = computed(() => diff --git a/frontend/services/dto/reception-data.ts b/frontend/services/dto/reception-data.ts index 2ed9a77..b81bfe9 100644 --- a/frontend/services/dto/reception-data.ts +++ b/frontend/services/dto/reception-data.ts @@ -41,6 +41,14 @@ export interface WeightEntryData { weighedAt: string | null } +export interface WeightFormData { + id: number + weight: number + type: 'gross' | 'tare' +} + + + export type ReceptionPayload = { licensePlate?: string | null receptionDate?: string @@ -72,3 +80,14 @@ export type ReceptionFormData = { driverId: string vehicleId: string } + +export type ReceptionFormWeight = { + weights: WeightFormData[] +} + +export interface ReceptionUpdatePayload { + weights: { + id: number + weight: number + }[] +} diff --git a/frontend/services/weight.ts b/frontend/services/weight.ts index b8ba1f7..7d5414a 100644 --- a/frontend/services/weight.ts +++ b/frontend/services/weight.ts @@ -16,5 +16,8 @@ export async function createWeight(payload: WeightPayload) { export async function updateWeight(id: number, payload: Partial) { const api = useApi() - return api.patch(`weights/${id}`, payload) + return api.patch(`weights/${id}`, payload,{ + toastErrorKey: 'errors.weight.update', + toastSuccessKey: 'success.weight.update' + }) }