diff --git a/components/MainNav.vue b/components/MainNav.vue index e80b47c..9bc263a 100644 --- a/components/MainNav.vue +++ b/components/MainNav.vue @@ -149,11 +149,15 @@ const links = computed(() => { icon: "i-heroicons-clipboard-document", children: [ { - label: "Artikelstamm", + label: "Artikel", to: "/products", icon: "i-heroicons-puzzle-piece" },{ - label: "Leistungsstamm", + label: "Artikelkategorien", + to: "/productcategories", + icon: "i-heroicons-puzzle-piece" + },{ + label: "Leistungen", to: "/services", icon: "i-heroicons-puzzle-piece" }, diff --git a/pages/productcategories/[mode]/[[id]].vue b/pages/productcategories/[mode]/[[id]].vue new file mode 100644 index 0000000..b56c291 --- /dev/null +++ b/pages/productcategories/[mode]/[[id]].vue @@ -0,0 +1,179 @@ + + + + + \ No newline at end of file diff --git a/pages/productcategories/index.vue b/pages/productcategories/index.vue new file mode 100644 index 0000000..fa50efc --- /dev/null +++ b/pages/productcategories/index.vue @@ -0,0 +1,139 @@ + + + + + \ No newline at end of file diff --git a/pages/products/[mode]/[[id]].vue b/pages/products/[mode]/[[id]].vue index a8ffbea..f3ae0f3 100644 --- a/pages/products/[mode]/[[id]].vue +++ b/pages/products/[mode]/[[id]].vue @@ -25,6 +25,7 @@ defineShortcuts({ }) const dataStore = useDataStore() +const supabase = useSupabaseClient() const route = useRoute() const router = useRouter() const toast = useToast() @@ -34,16 +35,23 @@ const id = ref(route.params.id ? route.params.id : null ) const mode = ref(route.params.mode || "show") const itemInfo = ref({ unit: 1, - tags: [] + tags: [], + productcategories: [] }) const openTab = ref(0) +const productcategories = ref([]) +const units = ref([]) + //Functions const setupPage = async () => { if(mode.value === "show" || mode.value === "edit"){ itemInfo.value = await useSupabaseSelectSingle("products",route.params.id,"*") } + productcategories.value = await useSupabaseSelect("productcategories","*") + units.value = (await supabase.from("units").select()).data + console.log(units.value[0]) } @@ -118,64 +126,100 @@ setupPage() + + + + + @@ -269,5 +328,10 @@ setupPage() \ No newline at end of file diff --git a/pages/products/index.vue b/pages/products/index.vue index aa0b5b6..a36a8c8 100644 --- a/pages/products/index.vue +++ b/pages/products/index.vue @@ -68,8 +68,8 @@ - @@ -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)