168d8c78eb
| 312 | Création d'une page d'administration listing des fournisseurs| |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: https://gitea.malio.fr/MALIO-DEV/Ferme/pulls/16 Reviewed-by: Autin <tristan@yuno.malio.fr> Co-authored-by: Matteo <matteo@yuno.malio.fr> Co-committed-by: Matteo <matteo@yuno.malio.fr>
52 lines
1.6 KiB
Vue
52 lines
1.6 KiB
Vue
<template>
|
|
|
|
<div class="flex items-center justify-between ">
|
|
<h1 class="text-3xl font-bold uppercase">listes des transporteurs</h1>
|
|
<button
|
|
@Click="goToCarrier()"
|
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px] "
|
|
>Ajouter
|
|
</button>
|
|
</div>
|
|
|
|
<div class="mt-6 border border-slate-200 mb-16 ">
|
|
<div class="grid grid-cols-2 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
|
|
<div>Label</div>
|
|
<div>Code</div>
|
|
</div>
|
|
<div
|
|
v-for="carrier in carrierList"
|
|
:key="carrier.id"
|
|
class="grid grid-cols-2 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200"
|
|
role="button"
|
|
tabindex="0"
|
|
@click="goToCarrier(carrier.id)"
|
|
@keydown.enter="goToCarrier(carrier.id)"
|
|
>
|
|
<div>{{ carrier.name}}</div>
|
|
<div>{{ carrier.code }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import type {CarrierData} from "~/services/dto/carrier-data";
|
|
import {getCarrierList} from "~/services/carrier";
|
|
|
|
const carrierList = ref<CarrierData[]>()
|
|
const router = useRouter()
|
|
|
|
const goToCarrier = (id: number|null = null) => {
|
|
id !== null ? router.push(`/admin/carrier/${id}`) : router.push(`/admin/carrier`)
|
|
}
|
|
|
|
definePageMeta({
|
|
layout: 'admin'
|
|
})
|
|
|
|
onMounted(async () => {
|
|
carrierList.value = await getCarrierList(false)
|
|
})
|
|
</script>
|