diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0b94447..f111e8d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,9 +4,10 @@ - @@ -574,7 +582,8 @@ - diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue index 51c97a7..d2c35fb 100644 --- a/frontend/pages/index.vue +++ b/frontend/pages/index.vue @@ -1,11 +1,32 @@ @@ -14,6 +35,19 @@ import type {ReceptionData} from "~/services/dto/reception-data"; import {getReceptionList} from "~/services/reception"; const receptionList = ref() +const router = useRouter() + +const goToReception = (id: number) => { + router.push(`/reception/${id}`) +} + +const formatWeighing = (reception: ReceptionData, type: 'gross' | 'tare') => { + const entry = reception.weights?.find((weight) => weight.type === type) + if (!entry || entry.weight == null || entry.dsd == null) { + return '—' + } + return `${entry.weight} kg / ${entry.dsd} dsd` +} onMounted(async () => { receptionList.value = await getReceptionList()