[pricelist] no change of cost_per_volume if volumes has ingredients

This commit is contained in:
Tim Gröger 2021-04-14 19:43:32 +02:00
parent 0df2677b1b
commit 86bb722623
1 changed files with 6 additions and 3 deletions

View File

@ -112,9 +112,9 @@
<q-input <q-input
v-model="cost_per_volume" v-model="cost_per_volume"
class="col-xs-12 col-sm-6 q-pa-sm q-pb-lg" class="col-xs-12 col-sm-6 q-pa-sm q-pb-lg"
:outlined="auto_cost_per_volume" :outlined="auto_cost_per_volume || hasIngredients"
:filled="!auto_cost_per_volume" :filled="!auto_cost_per_volume && !hasIngredients"
:readonly="auto_cost_per_volume" :readonly="auto_cost_per_volume || hasIngredients"
label="Preis pro L" label="Preis pro L"
hint="Inkl. 19% Mehrwertsteuer" hint="Inkl. 19% Mehrwertsteuer"
suffix="€" suffix="€"
@ -315,6 +315,8 @@ export default defineComponent({
set: (val: number) => ((<Drink>edit_drink.value).cost_per_volume = val), set: (val: number) => ((<Drink>edit_drink.value).cost_per_volume = val),
}); });
const hasIngredients = computed(() => edit_volumes.value?.some(a => a.ingredients.length > 0))
return { return {
edit_drink, edit_drink,
save, save,
@ -338,6 +340,7 @@ export default defineComponent({
cost_per_volume, cost_per_volume,
edit_volumes, edit_volumes,
key, key,
hasIngredients,
}; };
}, },
}); });