feat : creation du composant datatable (WIP)

This commit is contained in:
2026-02-18 14:54:18 +01:00
parent c229d0ab62
commit 32fe51caaa
20 changed files with 287 additions and 64 deletions

View File

@@ -7,6 +7,7 @@
<UiDataTable
:columns="columns"
url="receptions"
class="ps-20"
:query="{ isValid: true }"
@row-click="goToReception"
/>
@@ -22,13 +23,14 @@ type ReceptionRow = {
const router = useRouter()
const columns = [
{key: 'identificationNumber', label: 'Numero'},
{key: 'receptionDate', label: 'Date de livraison'},
{key: 'supplier', label: 'Fournisseur'},
{key: 'address.fullAddress', label: 'Adresse'},
{key: 'receptionType', label: 'Type'},
{key: 'weights', label: 'Poids', format: formatWeights}
{ key: 'identificationNumber', label: 'Numero', isSearchable:true },
{ key: 'receptionDate', label: 'Date de livraison', isSearchable: true, type: 'date' },
{ key: 'supplier.name', label: 'Fournisseur', isSearchable: true },
{ key: 'address.fullAddress', label: 'Adresse', isSearchable: true },
{ key: 'receptionType.label', label: 'Type', isSearchable: true, type:'selectTypeReception' },
{ key: 'weights', label: 'Poids', format: formatWeights }
]
const goToReception = (row: ReceptionRow) => {
const id = Number(row?.id)
if (!Number.isFinite(id)) return

View File

@@ -1,9 +1,7 @@
<template>
<div class="flex items-center justify-between">
<div class="flex items-center gap-10">
<div class="flex items-center justify-start gap-10">
<Icon @click="router.push('/')" name="gg:arrow-left-o" size="44" class="cursor-pointer text-primary-500"/>
<h1 class="text-3xl font-bold uppercase text-primary-500">listes des réceptions en attente</h1>
</div>
</div>
<UiDataTable
:columns="columns"
@@ -19,11 +17,11 @@ const router = useRouter()
const columns = [
{key: 'supplier', label: 'Fournisseur'},
{key: 'address.fullAddress', label: 'Adresse'},
{key: 'receptionType', label: 'Type'},
{key: 'carrier', label: 'Transporteur'},
{key: 'licensePlate', label: 'Immatriculation'},
{key: 'supplier.name', label: 'Fournisseur', isSearchable:true},
{ key: 'address.fullAddress', label: 'Adresse', isSearchable: true },
{key: 'carrier.name', label: 'Transporteur', isSearchable:true},
{key: 'receptionType.label', label: 'Type', isSearchable:true, type:'selectTypeReception'},
{key: 'licensePlate', label: 'Immatriculation', isSearchable:true, type:'licensePlate'},
]