diff --git a/src/flaschengeist.d.ts b/src/flaschengeist.d.ts index 216d696..0b0a806 100644 --- a/src/flaschengeist.d.ts +++ b/src/flaschengeist.d.ts @@ -132,5 +132,6 @@ declare namespace FG { interface Tag { id: number; name: string; + color: string; } } diff --git a/src/plugins/pricelist/components/CalculationTable.vue b/src/plugins/pricelist/components/CalculationTable.vue index b172e3a..976efed 100644 --- a/src/plugins/pricelist/components/CalculationTable.vue +++ b/src/plugins/pricelist/components/CalculationTable.vue @@ -123,26 +123,6 @@ /> - - {{ drinks_props.row.article_id || 'o.A.' }} - - - - {{ drinks_props.row.type.name }} + + + {{ tag.name }} + + + + + + + {{ drinks_props.row.article_id || 'o.A.' }} + + + + {{ drinks_props.row.volume ? `${drinks_props.row.volume} L` : 'o.A.' }} { - void store.getDrinkTypes(); + void store.getDrinkTypes(true); + void store.getTags(); void store.getExtraIngredients(); void store.get_min_prices(); store.getPriceCalcColumn(user); @@ -367,13 +421,7 @@ export default defineComponent({ sortable: true, sort, }, - { - name: 'article_id', - label: 'Artikelnummer', - field: 'article_id', - sortable: true, - sort, - }, + { name: 'drink_type', label: 'Kategorie', @@ -382,6 +430,28 @@ export default defineComponent({ sortable: true, sort: (a: FG.DrinkType, b: FG.DrinkType) => sort(a.name, b.name), }, + { + name: 'tags', + label: 'Tags', + field: 'tags', + format: (val: Array) => { + let retVal = ''; + val.forEach((tag, index) => { + if (index > 0) { + retVal += ', '; + } + retVal += tag.name; + }); + return retVal; + }, + }, + { + name: 'article_id', + label: 'Artikelnummer', + field: 'article_id', + sortable: true, + sort, + }, { name: 'volume_package', label: 'Inhalt in l des Gebinde', @@ -547,6 +617,7 @@ export default defineComponent({ console, search, filter, + tags: computed(() => store.tags), }; }, }); diff --git a/src/plugins/pricelist/components/DrinkTypes.vue b/src/plugins/pricelist/components/DrinkTypes.vue index 3071aae..9f51bec 100644 --- a/src/plugins/pricelist/components/DrinkTypes.vue +++ b/src/plugins/pricelist/components/DrinkTypes.vue @@ -60,7 +60,6 @@ export default defineComponent({ const actualDrinkType = ref(emptyDrinkType); onBeforeMount(() => { - console.log(store); void store.getDrinkTypes(); }); const rows = computed(() => store.drinkTypes); diff --git a/src/plugins/pricelist/components/Pricelist.vue b/src/plugins/pricelist/components/Pricelist.vue index 2c539cc..ac0ddde 100644 --- a/src/plugins/pricelist/components/Pricelist.vue +++ b/src/plugins/pricelist/components/Pricelist.vue @@ -31,6 +31,19 @@ /> +