Compare commits
17 Commits
develop
...
7e2f23c6b6
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e2f23c6b6 | |||
| 886b90215a | |||
| 265e85b8f4 | |||
| b4e024590e | |||
| 74af5d30ba | |||
| b905cb66aa | |||
| 5f4139fde3 | |||
| 0181d72144 | |||
| bffdc88701 | |||
| 42c5a3b2d2 | |||
| 28d5bc7599 | |||
| 69d047fca0 | |||
| ba4375f609 | |||
| e249d44e78 | |||
| e8189a4d04 | |||
| 081c2ef403 | |||
| 5fd2ab8470 |
@@ -41,6 +41,7 @@ Ajouter dans le fichier .env du frontend
|
||||
* [#256] Créer une nouvelle réception (étape 3 - bovin)
|
||||
* [#314] Création d'une page d'administration : listing des utilisateurs
|
||||
* [#313] Admin modification creation fournisseur
|
||||
* [#276] Lister les expéditions terminées
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<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="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" />
|
||||
</div>
|
||||
</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 {TruckData} from '~/services/dto/truck-data'
|
||||
import type {CustomerData} from '~/services/dto/customer-data'
|
||||
import type {AddressData} from "~/services/dto/address-data";
|
||||
|
||||
export interface ShipmentTypeData {
|
||||
id: number
|
||||
@@ -21,6 +22,7 @@ export type ShipmentData = {
|
||||
shipmentDate: string
|
||||
currentStep: number
|
||||
isValid: boolean
|
||||
address?: AddressData | null
|
||||
carrier?: CarrierData | null
|
||||
truck?: TruckData | null
|
||||
customer?: CustomerData | null
|
||||
|
||||
Reference in New Issue
Block a user