Zwischenstand

This commit is contained in:
2026-03-21 22:13:19 +01:00
parent b009ac845f
commit 68b2cbb0ee
64 changed files with 739 additions and 596 deletions

View File

@@ -12,6 +12,10 @@ const props = defineProps({
const products = ref([])
const units = ref([])
const productSearchInput = {
placeholder: 'Artikel suchen...'
}
const setup = async () => {
products.value = await useEntities("products").select()
units.value = await useEntities("units").selectSpecial()
@@ -80,16 +84,16 @@ const setRowData = (row) => {
>
<td>
<USelectMenu
searchable
:search-attributes="['name']"
:options="products"
value-attribute="id"
option-attribute="name"
:items="products"
label-key="name"
value-key="id"
:search-input="productSearchInput"
:filter-fields="['name']"
v-model="product.product"
:color="product.product ? 'primary' : 'rose'"
:color="product.product ? 'primary' : 'error'"
@change="setRowData(product)"
>
<template #label>
<template #default>
{{products.find(i => i.id === product.product) ? products.find(i => i.id === product.product).name : 'Kein Artikel ausgewählt'}}
</template>
</USelectMenu>
@@ -104,9 +108,9 @@ const setRowData = (row) => {
</td>
<td>
<USelectMenu
:options="units"
value-attribute="id"
option-attribute="name"
:items="units"
label-key="name"
value-key="id"
v-model="product.unit"
></USelectMenu>
</td>
@@ -123,7 +127,7 @@ const setRowData = (row) => {
icon="i-heroicons-x-mark"
@click="removeProductFromMaterialComposition(product.id)"
variant="outline"
color="rose"
color="error"
/>
</td>
</tr>
@@ -135,4 +139,4 @@ const setRowData = (row) => {
td {
margin-bottom: 0.5em;
}
</style>
</style>