release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
6 changed files with 99 additions and 77 deletions
Showing only changes of commit 30e101c364 - Show all commits

View File

@ -83,6 +83,7 @@ declare namespace FG {
type?: DrinkType; type?: DrinkType;
volumes: Array<DrinkPriceVolume>; volumes: Array<DrinkPriceVolume>;
uuid: string; uuid: string;
receipt?: string;
} }
interface DrinkIngredient { interface DrinkIngredient {
id: number; id: number;

View File

@ -294,6 +294,25 @@
@updateDrink="updateDrink(drinks_props.row)" @updateDrink="updateDrink(drinks_props.row)"
/> />
</q-td> </q-td>
<q-td key="receipt" :props="drinks_props">
{{drinks_props.row.receipt}}
<q-popup-edit
v-slot="scope"
v-model="drinks_props.row.receipt"
buttons
label-cancel="Abbrechen"
label-set="Speichern"
@update:modelValue="updateDrink(drinks_props.row)"
>
<q-input
type="textarea"
v-model="scope.value"
autofocus
counter
@keyup.enter.stop
/>
</q-popup-edit>
</q-td>
</q-tr> </q-tr>
</template> </template>
</q-table> </q-table>
@ -389,6 +408,11 @@ export default defineComponent({
label: 'Preiskalkulation', label: 'Preiskalkulation',
field: 'volumes', field: 'volumes',
}, },
{
name: 'receipt',
label: 'Bauanleitung',
field: 'receipt',
},
]; ];
const column_calc = [ const column_calc = [
{ {

View File

@ -0,0 +1,63 @@
<template>
<div class="q-pa-sm full-width full-height row q-gutter-sm">
<q-card v-for="drink in drinks" :key="drink.id" style="max-width: 256px; width: 256px">
<q-img
style="max-width: 256px"
loading="lazy"
:src="drink.uuid ? `/api/pricelist/picture/${drink.uuid}?size=256` : 'no-image.svg'"
placeholder-src="no-image.svg"
>
<div class="absolute-bottom-right text-subtitle2">
{{ drink.name }}
</div>
</q-img>
<q-card-section>
<div class="text-h6">Zutaten</div>
<div v-for="ingredient in drink.volumes[0].ingredients" :key="ingredient.id">
{{
name(ingredient.drink_ingredient?.drink_ingredient_id) ||
ingredient.extra_ingredient?.name
}}
{{ ingredient.drink_ingredient?.volume }}
</div>
</q-card-section>
<q-card-section>
<div class="text-h6">Preise</div>
<div class="full-width row q-gutter-sm">
<div v-for="price in drink.volumes[0].prices" :key="price.id">
{{ price.price.toFixed(2) }}
</div>
</div>
</q-card-section>
<q-card-section>
<div class="text-h6">Anleitung</div>
{{drink.receipt}}
</q-card-section>
</q-card>
</div>
</template>
<script lang="ts">
import { computed, defineComponent, onBeforeMount } from 'vue';
import { usePricelistStore } from 'src/plugins/pricelist/store';
export default defineComponent({
name: 'Reciepts',
setup() {
const store = usePricelistStore();
onBeforeMount(() => {
void store.getDrinks();
});
function name(id: number) {
return store.drinks.find((a) => a.id === id)?.name;
}
const drinks = computed(() =>
store.drinks.filter((drink) => {
return drink.volumes.some((volume) => volume.ingredients.length > 0);
})
);
return { drinks, name };
},
});
</script>
<style scoped></style>

View File

@ -1,66 +0,0 @@
<template>
<div class='q-pa-sm full-width full-height row q-gutter-sm'>
<q-card style='max-width: 256px; width: 256px' v-for='drink in drinks' :key='drink.id'>
<q-img
style='max-width: 256px;'
loading="lazy"
:src="
drink.uuid
? `/api/pricelist/picture/${drink.uuid}?size=256`
: 'no-image.svg'
"
placeholder-src="no-image.svg"
>
<div class="absolute-bottom-right text-subtitle2">
{{ drink.name }}
</div>
</q-img>
<q-card-section>
<div class='text-h6'>
Zutaten
</div>
<div v-for='ingredient in drink.volumes[0].ingredients' :key='ingredient.id'>
{{ name(ingredient.drink_ingredient?.drink_ingredient_id) || ingredient.extra_ingredient?.name}} {{ ingredient.drink_ingredient?.volume }}
</div>
</q-card-section>
<q-card-section>
<div class='text-h6'>
Preise
</div>
<div class='full-width row q-gutter-sm'>
<div v-for='price in drink.volumes[0].prices' :key="price.id">
{{price.price.toFixed(2)}}
</div>
</div>
</q-card-section>
<q-card-section>
<div class='text-h6'>
Anleitung
</div>
</q-card-section>
</q-card>
</div>
</template>
<script lang="ts">
import { computed, defineComponent, onBeforeMount } from 'vue';
import { usePricelistStore } from 'src/plugins/pricelist/store';
export default defineComponent({
name: 'Reciepts',
setup() {
const store = usePricelistStore();
onBeforeMount(() => {
void store.getDrinks()
})
function name(id) {
return store.drinks.find(a => a.id === id)?.name
}
const drinks = computed(() => store.drinks.filter(drink => {
return drink.volumes.some(volume => volume.ingredients.length > 0)
}))
return {drinks, name}
}
});
</script>
<style scoped></style>

View File

@ -25,13 +25,13 @@ export const innerRoutes: FG_Plugin.MenuRoute[] = [
{ {
title: 'Rezepte', title: 'Rezepte',
shortcut: false, shortcut: false,
icon: '', icon: 'mdi-receipt',
permissions: ['user'], permissions: ['user'],
route: { route: {
path: 'reciepts', path: 'reciepts',
name: 'reciepts', name: 'reciepts',
component: () => import('../pages/Reciepts.vue') component: () => import('../pages/Receipts.vue'),
} },
}, },
{ {
title: 'Cocktailbuilder', title: 'Cocktailbuilder',
@ -41,8 +41,8 @@ export const innerRoutes: FG_Plugin.MenuRoute[] = [
route: { route: {
path: 'cocktail-builder', path: 'cocktail-builder',
name: 'cocktail-builder', name: 'cocktail-builder',
component: () => import('../pages/CocktailBuilder.vue') component: () => import('../pages/CocktailBuilder.vue'),
} },
}, },
{ {
title: 'Einstellungen', title: 'Einstellungen',
@ -67,7 +67,7 @@ export const outerRoutes: FG_Plugin.MenuRoute[] = [
route: { route: {
path: 'pricelist', path: 'pricelist',
name: 'outter-pricelist', name: 'outter-pricelist',
component: () => import('../pages/OuterPricelist.vue') component: () => import('../pages/OuterPricelist.vue'),
} },
} },
] ];

View File

@ -58,6 +58,7 @@ class Drink {
tags, tags,
type, type,
uuid, uuid,
receipt,
}: FG.Drink) { }: FG.Drink) {
this.id = id; this.id = id;
this.article_id = article_id; this.article_id = article_id;
@ -84,6 +85,7 @@ class Drink {
this.type = type; this.type = type;
this.volumes = []; this.volumes = [];
this.uuid = uuid; this.uuid = uuid;
this.receipt = receipt;
} }
} }
@ -322,6 +324,4 @@ export const usePricelistStore = defineStore({
}, },
}); });
export { DrinkPriceVolume, MinPrice, Drink }; export { DrinkPriceVolume, MinPrice, Drink };