Added Productcategories
This commit is contained in:
@@ -68,8 +68,8 @@
|
||||
<template #stock-data="{row}">
|
||||
{{`${dataStore.getStockByProductId(row.id)} ${(dataStore.units.find(unit => unit.id === row.unit) ? dataStore.units.find(unit => unit.id === row.unit).name : "")}`}}
|
||||
</template>
|
||||
<template #purchasePrice-data="{row}">
|
||||
{{row.purchasePrice ? Number(row.purchasePrice).toFixed(2) + " €" : ""}}
|
||||
<template #sellingPrice-data="{row}">
|
||||
{{row.sellingPrice ? (Number(row.sellingPrice).toFixed(2) + " €").replace(".",",") : ""}}
|
||||
</template>
|
||||
<template #tags-data="{row}">
|
||||
<UBadge
|
||||
@@ -84,6 +84,9 @@
|
||||
<template #unit-data="{row}">
|
||||
{{dataStore.units.find(unit => unit.id === row.unit) ? dataStore.units.find(unit => unit.id === row.unit).name : row.unit}}
|
||||
</template>
|
||||
<template #productcategories-data="{row}">
|
||||
{{row.productcategories.map(i => productcategories.find(x => x.id === i).name).join(", ")}}
|
||||
</template>
|
||||
</UTable>
|
||||
|
||||
</template>
|
||||
@@ -129,10 +132,12 @@ const dataStore = useDataStore()
|
||||
const router = useRouter()
|
||||
|
||||
const items = ref([])
|
||||
const productcategories = ref([])
|
||||
const selectedItem = ref(0)
|
||||
|
||||
const setupPage = async () => {
|
||||
items.value = await useSupabaseSelect("products","*")
|
||||
productcategories.value = await useSupabaseSelect("productcategories", "*")
|
||||
}
|
||||
|
||||
setupPage()
|
||||
@@ -164,14 +169,19 @@ const templateColumns = [
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: "purchasePrice",
|
||||
label: "Einkaufspreis",
|
||||
key: "sellingPrice",
|
||||
label: "Verkaufpreispreis",
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: "tags",
|
||||
label: "Tags",
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: "productcategories",
|
||||
label: "Artikelkategorien",
|
||||
sortable: true
|
||||
}
|
||||
]
|
||||
const selectedColumns = ref(templateColumns)
|
||||
|
||||
Reference in New Issue
Block a user