flaschengeist-frontend/src/plugins/pricelist/pages/Receipts.vue

48 lines
1.5 KiB
Vue
Raw Normal View History

2021-03-29 10:50:50 +00:00
<template>
<div class="q-pa-sm full-width full-height row q-gutter-sm">
2021-03-30 13:40:02 +00:00
<q-card v-for="drink in drinks" :key="drink.id" style="max-width: 400px; width: 400px">
2021-03-29 10:50:50 +00:00
<q-img
2021-03-30 13:40:02 +00:00
style="max-height: 256px"
2021-03-29 10:50:50 +00:00
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>
2021-03-30 13:40:02 +00:00
<build-manual-volume :volumes="drink.volumes" />
2021-03-29 10:50:50 +00:00
<q-card-section>
<div class="text-h6">Anleitung</div>
<build-manual :steps="drink.receipt" :editable="false" />
</q-card-section>
2021-03-29 10:50:50 +00:00
</q-card>
</div>
</template>
<script lang="ts">
import { computed, defineComponent, onBeforeMount } from 'vue';
import { usePricelistStore } from 'src/plugins/pricelist/store';
import BuildManual from 'src/plugins/pricelist/components/CalculationTable/BuildManual.vue';
2021-03-30 13:40:02 +00:00
import BuildManualVolume from '../components/BuildManual/BuildManualVolume.vue';
2021-03-29 10:50:50 +00:00
export default defineComponent({
name: 'Reciepts',
2021-03-30 13:40:02 +00:00
components: { BuildManual, BuildManualVolume },
2021-03-29 10:50:50 +00:00
setup() {
const store = usePricelistStore();
onBeforeMount(() => {
void store.getDrinks();
});
const drinks = computed(() =>
store.drinks.filter((drink) => {
return drink.volumes.some((volume) => volume.ingredients.length > 0);
})
);
2021-03-29 19:29:04 +00:00
2021-03-30 13:40:02 +00:00
return { drinks };
2021-03-29 10:50:50 +00:00
},
});
</script>
<style scoped></style>