feat : lister les expeditions terminees
This commit is contained in:
@@ -40,6 +40,7 @@ Ajouter dans le fichier .env du frontend
|
|||||||
* [#273] Créer une nouvelle expédition (étape 3)
|
* [#273] Créer une nouvelle expédition (étape 3)
|
||||||
* [#256] Créer une nouvelle réception (étape 3 - bovin)
|
* [#256] Créer une nouvelle réception (étape 3 - bovin)
|
||||||
* [#314] Création d'une page d'administration : listing des utilisateurs
|
* [#314] Création d'une page d'administration : listing des utilisateurs
|
||||||
|
* [#276] Lister les expéditions terminées
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<card-link label="EXPÉDITIONS EN ATTENTE" link="/" iconName="mdi:truck-cargo-container" />
|
<card-link label="EXPÉDITIONS EN ATTENTE" link="/" iconName="mdi:truck-cargo-container" />
|
||||||
<card-link label="CASES" link="/" iconName="mdi:cube-outline" />
|
<card-link label="CASES" link="/" iconName="mdi:cube-outline" />
|
||||||
<card-link label="RÉCEPTIONS FINIES" link="/reception/finish-reception" iconName="mdi:truck-check-outline" />
|
<card-link label="RÉCEPTIONS FINIES" link="/reception/finish-reception" iconName="mdi:truck-check-outline" />
|
||||||
<card-link label="EXPÉDITIONS FINIES" link="/" iconName="mdi:truck-delivery-outline" />
|
<card-link label="EXPÉDITIONS FINIES" link="/shipment/finish-shipment" iconName="mdi:truck-delivery-outline" />
|
||||||
<card-link label="PASSEPORT DU BOVIN" link="/" iconName="mdi:cow" />
|
<card-link label="PASSEPORT DU BOVIN" link="/" iconName="mdi:cow" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
81
frontend/pages/shipment/finish-shipment.vue
Normal file
81
frontend/pages/shipment/finish-shipment.vue
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex items-center justify-start gap-10">
|
||||||
|
<Icon @click="router.push('/')" name="gg:arrow-left-o" style="color: black" size="44"/>
|
||||||
|
<h1 class="text-3xl font-bold uppercase">listes des expéditions finie</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ps-20 ">
|
||||||
|
<div class="mt-6 border border-slate-200 mb-16 ">
|
||||||
|
<div class="grid grid-cols-6 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
|
||||||
|
<div>Numéro</div>
|
||||||
|
<div>Date</div>
|
||||||
|
<div>Client</div>
|
||||||
|
<div>Adresse</div>
|
||||||
|
<div>Type d'expéditon</div>
|
||||||
|
<div>Poids</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="shipment in shipmentList"
|
||||||
|
:key="shipment
|
||||||
|
.id"
|
||||||
|
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="goToshipment(shipment.id)"
|
||||||
|
>
|
||||||
|
<div>{{ shipment.identificationNumber }}</div>
|
||||||
|
<div>{{ shipment.shipmentDate }}</div>
|
||||||
|
<div>{{ shipment.customer?.label }}</div>
|
||||||
|
<div>{{ shipment.address?.fullAddress }}</div>
|
||||||
|
<div>
|
||||||
|
<template v-if="formatBovinShipmentLines(shipment).length">
|
||||||
|
<div
|
||||||
|
v-for="(line, index) in formatBovinShipmentLines(shipment)"
|
||||||
|
:key="index"
|
||||||
|
class="leading-5"
|
||||||
|
>
|
||||||
|
{{ line }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div>{{ formatWeighing(shipment, 'gross') }} | {{ formatWeighing(shipment, 'tare') }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import type {ShipmentData} from "~/services/dto/shipment-data";
|
||||||
|
import {getShipmentList} from "~/services/shipment";
|
||||||
|
|
||||||
|
const shipmentList = ref<ShipmentData[]>()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const formatWeighing = (shipment: ShipmentData, type: 'gross' | 'tare') => {
|
||||||
|
const entry = shipment.weights?.find((weight) => weight.type === type)
|
||||||
|
if (!entry || entry.weight == null || entry.dsd == null) {
|
||||||
|
return '—'
|
||||||
|
}
|
||||||
|
return `${entry.weight} kg`
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatBovinShipmentLines = (shipment: ShipmentData) => {
|
||||||
|
if (!shipment.bovinShipments?.length) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return shipment.bovinShipments.map((entry) => {
|
||||||
|
const label = typeof entry.shipmentType === 'string'
|
||||||
|
? entry.shipmentType
|
||||||
|
: entry.shipmentType?.label
|
||||||
|
return `${label ?? '—'} : ${entry.nbBovinSend ?? '—'}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const goToshipment = (id: number) => {
|
||||||
|
//router.push(`/shipment/update/${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
shipmentList.value = await getShipmentList(true)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import type {CarrierData} from '~/services/dto/carrier-data'
|
import type {CarrierData} from '~/services/dto/carrier-data'
|
||||||
import type {TruckData} from '~/services/dto/truck-data'
|
import type {TruckData} from '~/services/dto/truck-data'
|
||||||
import type {CustomerData} from '~/services/dto/customer-data'
|
import type {CustomerData} from '~/services/dto/customer-data'
|
||||||
|
import type {AddressData} from "~/services/dto/address-data";
|
||||||
|
|
||||||
export interface ShipmentTypeData {
|
export interface ShipmentTypeData {
|
||||||
id: number
|
id: number
|
||||||
@@ -21,6 +22,7 @@ export type ShipmentData = {
|
|||||||
shipmentDate: string
|
shipmentDate: string
|
||||||
currentStep: number
|
currentStep: number
|
||||||
isValid: boolean
|
isValid: boolean
|
||||||
|
address?: AddressData | null
|
||||||
carrier?: CarrierData | null
|
carrier?: CarrierData | null
|
||||||
truck?: TruckData | null
|
truck?: TruckData | null
|
||||||
customer?: CustomerData | null
|
customer?: CustomerData | null
|
||||||
|
|||||||
Reference in New Issue
Block a user