From 7e01ffc507592219f7373b96a5181855432c062c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Tue, 16 Mar 2021 18:10:37 +0100 Subject: [PATCH] [pricelist] fixed some computed values, new interfaces --- src/flaschengeist.d.ts | 2 + .../pricelist/components/CalculationTable.vue | 60 ++++-- .../CalculationTable/PriceTable.vue | 8 +- src/plugins/pricelist/store/altStore.ts | 193 ++++++++++++++---- 4 files changed, 197 insertions(+), 66 deletions(-) diff --git a/src/flaschengeist.d.ts b/src/flaschengeist.d.ts index a69c5f1..3fe8aaa 100644 --- a/src/flaschengeist.d.ts +++ b/src/flaschengeist.d.ts @@ -61,11 +61,13 @@ declare namespace FG { } interface DrinkMinPrice { percentage: number; + //price: ComputedRef; price: number; } interface DrinkPriceVolume { id: number; volume: number; + //computed_volume: ComputedRef; min_prices: DrinkMinPrice[]; prices: Array; ingredients: Array; diff --git a/src/plugins/pricelist/components/CalculationTable.vue b/src/plugins/pricelist/components/CalculationTable.vue index 99e196e..108c8ea 100644 --- a/src/plugins/pricelist/components/CalculationTable.vue +++ b/src/plugins/pricelist/components/CalculationTable.vue @@ -55,20 +55,32 @@ :icon="props.expand ? 'mdi-chevron-up' : 'mdi-chevron-down'" v-if="volumes.row.cost_price_pro_volume == null" /> + - {{ props.row.volume }}L + {{ parseFloat(props.row.volume.value).toFixed(3) }}L + @@ -84,7 +96,8 @@ {{ min_price.percentage }}%
- {{ parseFloat(min_price.price).toFixed(3) }}€ + + {{ min_price.price.value.toFixed(3) }}€
@@ -116,7 +129,6 @@ :options="drinks" option-label="name" v-model="ingredient.drink_ingredient" - @input="calc_min_prices(props.row)" /> @@ -141,7 +152,6 @@ color="positive" label="Zutat hinzufügen" @click="addIngredient(props.row.ingredients, props.row.id)" - @change="calc_min_prices(props.row)" /> @@ -180,9 +190,15 @@