diff --git a/src/plugins/pricelist/components/CalculationTable.vue b/src/plugins/pricelist/components/CalculationTable.vue index fd52724..d6e0a58 100644 --- a/src/plugins/pricelist/components/CalculationTable.vue +++ b/src/plugins/pricelist/components/CalculationTable.vue @@ -1,16 +1,14 @@ + @@ -46,6 +44,7 @@ option-value="name" options-cover /> + @@ -357,25 +356,41 @@ @deleteStep="deleteStep($event, drinks_props.row)" @addStep="addStep($event, drinks_props.row)" /> - + + + + + + + {{ props.row.name }} + + + {{ props.row.type.name }} + + + + + + {{ tag.name }} + + + + + @@ -383,7 +398,7 @@ import { defineComponent, onBeforeMount, ComputedRef, computed, ref } from 'vue'; import DrinkPriceVolumesTable from 'src/plugins/pricelist/components/CalculationTable/DrinkPriceVolumesTable.vue'; import { useMainStore } from 'src/stores'; -import { Drink, usePricelistStore } from 'src/plugins/pricelist/store'; +import { Drink, usePricelistStore, DrinkPriceVolume } from 'src/plugins/pricelist/store'; import MinPriceSetting from 'src/plugins/pricelist/components/MinPriceSetting.vue'; import NewDrink from 'src/plugins/pricelist/components/CalculationTable/NewDrink.vue'; import BuildManual from 'src/plugins/pricelist/components/CalculationTable/BuildManual.vue'; @@ -394,17 +409,17 @@ import { sort } from '../utils/sort'; export default defineComponent({ name: 'CalculationTable', - components: { SearchInput, BuildManual, MinPriceSetting, DrinkPriceVolumesTable, NewDrink }, + components: { SearchInput, MinPriceSetting, NewDrink, BuildManual, DrinkPriceVolumesTable }, setup() { const mainStore = useMainStore(); const store = usePricelistStore(); onBeforeMount(() => { - void store.getDrinkTypes(true); - void store.getTags(); - void store.getExtraIngredients(); - void store.get_min_prices(); - store.getPriceCalcColumn(user); + // void store.getDrinkTypes(true); + // void store.getTags(); + //void store.getDrinks(); + //void store.get_min_prices(); + void store.getPriceCalcColumn(user); }); const user = mainStore.currentUser.userid; @@ -490,12 +505,34 @@ export default defineComponent({ name: 'volumes', label: 'Preiskalkulation', field: 'volumes', + format: (val: Array) => { + let retVal = ''; + val.forEach((val, index) => { + if (index > 0) { + retVal += ', '; + } + retVal += val.id; + }); + return retVal; + }, + sortable: false, }, { name: 'receipt', label: 'Bauanleitung', field: 'receipt', + format: (val: Array) => { + let retVal = ''; + val.forEach((value, index) => { + if (index > 0) { + retVal += ', '; + } + retVal += value; + }); + return retVal; + }, filterable: true, + sortable: false, }, ]; const column_calc = [ @@ -542,9 +579,10 @@ export default defineComponent({ const search_keys = computed(() => columns.filter((column) => column.filterable)); - // eslint-disable-next-line vue/return-in-computed-property - const pagination = computed(() => { - rowsPerPage: store.drinks.length; + const pagination = ref({ + sortBy: 'name', + descending: false, + rowsPerPage: store.drinks.length, }); const drinkTypes = computed(() => store.drinkTypes); @@ -605,6 +643,7 @@ export default defineComponent({ key: '', label: '', }); + const grid = ref(false); return { drinks: computed(() => store.drinks), pagination, @@ -625,6 +664,7 @@ export default defineComponent({ search, filter, search_keys, + grid, tags: computed(() => store.tags), }; }, diff --git a/src/plugins/pricelist/pages/Settings.vue b/src/plugins/pricelist/pages/Settings.vue index 4ef3fd3..bbc12a8 100644 --- a/src/plugins/pricelist/pages/Settings.vue +++ b/src/plugins/pricelist/pages/Settings.vue @@ -59,7 +59,7 @@ import { usePricelistStore } from 'src/plugins/pricelist/store'; export default defineComponent({ name: 'Settings', - components: { ExtraIngredients, DrinkTypes, CalculationTable, Tags }, + components: { ExtraIngredients, DrinkTypes, Tags, CalculationTable }, setup() { interface Tab { name: string; @@ -73,6 +73,7 @@ export default defineComponent({ console.log(store.extraIngredients); }) .catch((err) => console.log(err)); + void store.getTags(); void store.getDrinkTypes(); void store.getDrinks(); void store.get_min_prices();