diff --git a/CHANGELOG.md b/CHANGELOG.md index 816a8d0..7c4a728 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 * [#271] Créer une nouvelle expédition (étape 1) * [#256] Créer une nouvelle réception (étape 3 - bovin) * [#314] Création d'une page d'administration : listing des utilisateurs diff --git a/config/version.yaml b/config/version.yaml index 7878495..35fd9cc 100644 --- a/config/version.yaml +++ b/config/version.yaml @@ -1,2 +1,2 @@ parameters: - app.version: '0.0.37' + app.version: '0.0.38' diff --git a/frontend/components/reception/reception-form.vue b/frontend/components/reception/reception-form.vue index 93d2daf..52ec0d3 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 4ce3287..5341750 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" }, "shipment": { "list": "Impossible de récupérer la liste des éxpeditions.", @@ -97,6 +100,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 {SUPPLIER_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 72d0db0..2e03c1f 100644 --- a/frontend/services/weight.ts +++ b/frontend/services/weight.ts @@ -17,5 +17,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' + }) }