38 lines
1.1 KiB
Vue
38 lines
1.1 KiB
Vue
<template>
|
|
<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 finie</h1>
|
|
</div>
|
|
|
|
<UiDataTable
|
|
:columns="columns"
|
|
url="receptions"
|
|
:query="{ isValid: true }"
|
|
@row-click="goToReception"
|
|
/>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
|
|
import {formatWeights} from "~/utils/datatable-formatters";
|
|
|
|
type ReceptionRow = {
|
|
id?: number | string
|
|
}
|
|
|
|
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}
|
|
]
|
|
const goToReception = (row: ReceptionRow) => {
|
|
const id = Number(row?.id)
|
|
if (!Number.isFinite(id)) return
|
|
router.push(`/reception/update/${id}`)
|
|
}
|
|
</script>
|