From 4b93c100b02b58aa61fd9e672bcec444f19dc5bf Mon Sep 17 00:00:00 2001 From: sroy Date: Thu, 26 Feb 2026 14:19:12 +0100 Subject: [PATCH 1/3] =?UTF-8?q?feat=20:=20affichage=20et=20modification=20?= =?UTF-8?q?exp=C3=A9dition=20et=20modification=20bouton=20valider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{reception => commun}/update-weight.vue | 4 +- .../components/shipment/shipment-form.vue | 12 +- frontend/pages/admin/bovin/[[id]].vue | 2 +- frontend/pages/admin/carrier/[[id]].vue | 1 - frontend/pages/admin/customer/[[id]].vue | 2 +- frontend/pages/admin/supplier/[[id]].vue | 2 +- frontend/pages/admin/user/[[id]].vue | 2 +- frontend/pages/reception/update/[[id]].vue | 4 +- frontend/pages/shipment/update/[[id]].vue | 633 ++++++++++++++++++ frontend/services/dto/shipment-data.ts | 6 + frontend/services/dto/weight-data.ts | 8 + 11 files changed, 662 insertions(+), 14 deletions(-) rename frontend/components/{reception => commun}/update-weight.vue (93%) create mode 100644 frontend/pages/shipment/update/[[id]].vue diff --git a/frontend/components/reception/update-weight.vue b/frontend/components/commun/update-weight.vue similarity index 93% rename from frontend/components/reception/update-weight.vue rename to frontend/components/commun/update-weight.vue index a37a9e3..c0abab9 100644 --- a/frontend/components/reception/update-weight.vue +++ b/frontend/components/commun/update-weight.vue @@ -13,7 +13,7 @@ /> @@ -31,7 +31,7 @@ diff --git a/frontend/services/dto/shipment-data.ts b/frontend/services/dto/shipment-data.ts index ad72819..fe36006 100644 --- a/frontend/services/dto/shipment-data.ts +++ b/frontend/services/dto/shipment-data.ts @@ -2,6 +2,9 @@ import type {CarrierData} from '~/services/dto/carrier-data' import type {TruckData} from '~/services/dto/truck-data' import type {CustomerData} from '~/services/dto/customer-data' import type {AddressData} from "~/services/dto/address-data"; +import type {UserData} from '~/services/dto/user-data' +import type {DriverData} from '~/services/dto/driver-data' +import type {VehicleData} from '~/services/dto/vehicle-data' export interface ShipmentTypeData { id: number @@ -20,6 +23,9 @@ export type ShipmentData = { carrier?: CarrierData | null truck?: TruckData | null customer?: CustomerData | null + user?: UserData | null + driver?: DriverData | null + vehicle?: VehicleData | null shipmentType?: ShipmentTypeData | null nbBovinSend?: number | null weights?: WeightShipmentEntryData[] | null diff --git a/frontend/services/dto/weight-data.ts b/frontend/services/dto/weight-data.ts index 2349a1d..293e01d 100644 --- a/frontend/services/dto/weight-data.ts +++ b/frontend/services/dto/weight-data.ts @@ -4,3 +4,11 @@ export interface WeightData { weighedAt: string | null type : string | null } + +export interface WeightEntryData { + id?: number + type: 'gross' | 'tare' + dsd: number | null + weight: number | null + weighedAt: string | null +} -- 2.39.5 From 09db30af72482f0cad1c796c5edd3f02bccda5af Mon Sep 17 00:00:00 2001 From: sroy Date: Thu, 26 Feb 2026 14:32:06 +0100 Subject: [PATCH 2/3] fix : erreur customer adress et bouton valider oublie --- frontend/components/address.vue | 2 +- frontend/pages/reception/update/[[id]].vue | 1 - frontend/pages/shipment/update/[[id]].vue | 14 ++++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/components/address.vue b/frontend/components/address.vue index cd8abb6..cb6e64b 100644 --- a/frontend/components/address.vue +++ b/frontend/components/address.vue @@ -12,7 +12,7 @@ type="submit" :disabled="isLoading" > - + {{ props.address? "Valider" : "Ajouter" }} diff --git a/frontend/pages/reception/update/[[id]].vue b/frontend/pages/reception/update/[[id]].vue index 62dfd11..8c564a1 100644 --- a/frontend/pages/reception/update/[[id]].vue +++ b/frontend/pages/reception/update/[[id]].vue @@ -190,7 +190,6 @@ type="submit" class="inline-flex mb-16 items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2 justify-self-end" > - Valider diff --git a/frontend/pages/shipment/update/[[id]].vue b/frontend/pages/shipment/update/[[id]].vue index d34c003..556d697 100644 --- a/frontend/pages/shipment/update/[[id]].vue +++ b/frontend/pages/shipment/update/[[id]].vue @@ -256,13 +256,19 @@ const selectedCarrier = computed(() => carriers.value.find((carrier) => String(carrier.id) === form.carrierId) ?? null ) const isLiotCarrier = computed(() => selectedCarrier.value?.code === SUPPLIER_CODE.LIOT) +const isAddressData = (value: unknown): value is AddressData => + typeof value === 'object' && + value !== null && + 'id' in value && + 'fullAddress' in value const customerAddresses = computed(() => { + if (!form.customerId) return [] const customerId = Number(form.customerId) - if (!Number.isFinite(customerId)) { - return [] - } - return customers.value.find((customer) => customer.id === customerId)?.addresses ?? [] + if (!Number.isFinite(customerId) || customerId <= 0) return [] + + const addresses = customers.value.find((c) => c.id === customerId)?.addresses ?? [] + return addresses.filter(isAddressData) }) const customerAddressOptions = computed(() => -- 2.39.5 From 56b723c194d0eef01e5dec3a7492c05b2c9d6ad4 Mon Sep 17 00:00:00 2001 From: sroy Date: Thu, 26 Feb 2026 14:33:31 +0100 Subject: [PATCH 3/3] feat : changelog update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd0be1a..07c5efc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ Ajouter dans le fichier .env du frontend * [#278] Plan du site * [#334] Correctifs * [#332] Refonte écran réception terminée +* [#327] afficher/modifier écran expédition terminée ### Changed -- 2.39.5