WorkshopTasker/components/orderView.vue

59 lines
1.4 KiB
Vue
Raw Normal View History

2023-05-24 09:40:45 +02:00
<script setup lang="ts">
import type { useFetch } from '#imports';
type Order = Awaited<ReturnType<typeof useFetch<void, any, "/api/orders/:id", "get">>>["data"]["value"];
2023-05-24 09:40:45 +02:00
const props = defineProps<{
order?: Order | undefined
2023-05-24 09:40:45 +02:00
}>();
</script>
<template>
<!-- <VRow v-if="props.order">
{{ props.order.id }}
</VRow> -->
<VCol>
<div v-if="props.order && props.order.work.length !== 0">
<span class="text-h4">Works</span>
<VTable class="noScroll">
<thead>
<tr>
<th>fulfilled</th>
<th>offer</th>
<th>price</th>
</tr>
</thead>
<tbody>
<tr v-for="i in props.order.work" :key="i.id">
<td>{{ i.fulfilled }}</td>
2023-05-24 09:40:45 +02:00
<td>
{{ i.offer.name }}
</td>
<td>{{ i.price }} PLN</td>
</tr>
</tbody>
</VTable>
</div>
<div v-if="props.order && props.order.imported_products.length !== 0">
<span class="text-h4">Imported products</span>
<VTable>
<thead>
<tr>
<th>Name</th>
<th>link</th>
<th>price</th>
</tr>
</thead>
<tbody>
<tr v-for="i in props.order.imported_products" :key="i.id">
<td>{{ i.name }}</td>
<td>{{ i.link }}</td>
<td>{{ i.price }} PLN</td>
</tr>
</tbody>
</VTable>
</div>
</VCol>
</template>