@@ -17,7 +17,8 @@
|
||||
<div
|
||||
v-for="reception in receptionList"
|
||||
:key="reception.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"
|
||||
class="grid grid-cols-6 gap-4 px-4 py-3 text-sm border-t border-slate-200"
|
||||
:class="auth.canUseWorkflow ? 'hover:bg-slate-50 cursor-pointer' : ''"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="goToReception(reception.id)"
|
||||
@@ -36,10 +37,11 @@
|
||||
<script setup lang="ts">
|
||||
import type {ReceptionData} from "~/services/dto/reception-data";
|
||||
import {getReceptionList} from "~/services/reception";
|
||||
import type {ShipmentData} from "~/services/dto/shipment-data";
|
||||
import { useAuthStore } from '~/stores/auth'
|
||||
|
||||
const receptionList = ref<ReceptionData[]>()
|
||||
const router = useRouter()
|
||||
const auth = useAuthStore()
|
||||
|
||||
const formatDate = (date: string | null) => {
|
||||
if (!date) return '—'
|
||||
@@ -66,6 +68,7 @@ const formatWeighing = (reception: ReceptionData) => {
|
||||
}
|
||||
|
||||
const goToReception = (id: number) => {
|
||||
if (!auth.canUseWorkflow) return
|
||||
router.push(`/reception/update/${id}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
:columns="columns"
|
||||
:items="receptionList ?? []"
|
||||
route-prefix="/reception"
|
||||
show-actions
|
||||
:show-actions="auth.canUseWorkflow"
|
||||
:can-open-items="auth.canUseWorkflow"
|
||||
>
|
||||
<template #cell-receptionDate="{ item }">
|
||||
{{ formatDate(item.receptionDate) }}
|
||||
@@ -23,6 +24,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { ReceptionData } from '~/services/dto/reception-data'
|
||||
import { getReceptionList, deleteReception } from '~/services/reception'
|
||||
import { useAuthStore } from '~/stores/auth'
|
||||
|
||||
const auth = useAuthStore()
|
||||
|
||||
const columns = [
|
||||
{ key: 'receptionDate', label: 'Date et heure' },
|
||||
|
||||
Reference in New Issue
Block a user