[pricelist] delete visibleColumns
This commit is contained in:
parent
dc948e6f11
commit
cee6eda585
|
@ -4,7 +4,6 @@
|
||||||
title="Preistabelle"
|
title="Preistabelle"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="drinks"
|
:rows="drinks"
|
||||||
:visible-columns="visibleColumn"
|
|
||||||
dense
|
dense
|
||||||
:filter="search"
|
:filter="search"
|
||||||
:filter-method="filter"
|
:filter-method="filter"
|
||||||
|
@ -19,19 +18,6 @@
|
||||||
<min-price-setting />
|
<min-price-setting />
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<!--<q-select
|
|
||||||
v-model="visibleColumn"
|
|
||||||
multiple
|
|
||||||
filled
|
|
||||||
dense
|
|
||||||
options-dense
|
|
||||||
display-value="Sichtbarkeit"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
:options="[...columns, ...column_calc, ...column_prices]"
|
|
||||||
option-value="name"
|
|
||||||
options-cover
|
|
||||||
/>-->
|
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="!public && !nodetails && editable"
|
v-if="!public && !nodetails && editable"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -39,9 +25,6 @@
|
||||||
icon="mdi-plus"
|
icon="mdi-plus"
|
||||||
@click="newDrink"
|
@click="newDrink"
|
||||||
>
|
>
|
||||||
<!--<q-menu v-model="showNewDrink" anchor="center middle" self="center middle" persistent>
|
|
||||||
<new-drink @close="showNewDrink = false" />
|
|
||||||
</q-menu>-->
|
|
||||||
<q-tooltip> Neues Getränk </q-tooltip>
|
<q-tooltip> Neues Getränk </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,7 +35,7 @@
|
||||||
<q-img
|
<q-img
|
||||||
style="max-height: 256px"
|
style="max-height: 256px"
|
||||||
:src="
|
:src="
|
||||||
props.row.uuid ? `/api/pricelist/picture/${props.row.uuid}?size=256` : 'no-image.svg'
|
props.row.uuid ? `/api/pricelist/picture/${props.row.uuid}?size=400` : 'no-image.svg'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
@ -163,7 +146,6 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, onBeforeMount, ComputedRef, computed, ref } from 'vue';
|
import { defineComponent, onBeforeMount, ComputedRef, computed, ref } from 'vue';
|
||||||
import { useMainStore } from 'src/stores';
|
|
||||||
import { Drink, usePricelistStore, DrinkPriceVolume } from 'src/plugins/pricelist/store';
|
import { Drink, usePricelistStore, DrinkPriceVolume } from 'src/plugins/pricelist/store';
|
||||||
import MinPriceSetting from 'src/plugins/pricelist/components/MinPriceSetting.vue';
|
import MinPriceSetting from 'src/plugins/pricelist/components/MinPriceSetting.vue';
|
||||||
import SearchInput from './SearchInput.vue';
|
import SearchInput from './SearchInput.vue';
|
||||||
|
@ -197,23 +179,12 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const mainStore = useMainStore();
|
|
||||||
const store = usePricelistStore();
|
const store = usePricelistStore();
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
void store.getDrinks();
|
void store.getDrinks();
|
||||||
try {
|
|
||||||
user.value = mainStore.currentUser.userid;
|
|
||||||
} catch {
|
|
||||||
user.value = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.value) {
|
|
||||||
store.getPriceCalcColumn(user.value);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const user = ref<string>();
|
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -369,12 +340,6 @@ export default defineComponent({
|
||||||
field: 'public',
|
field: 'public',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const visibleColumn = computed({
|
|
||||||
get: () => store.pricecalc_columns,
|
|
||||||
set: (val) => {
|
|
||||||
store.updatePriceCalcColumn(<string>user.value, val);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const search_keys = computed(() =>
|
const search_keys = computed(() =>
|
||||||
columns.filter(
|
columns.filter(
|
||||||
|
@ -515,7 +480,6 @@ export default defineComponent({
|
||||||
columns,
|
columns,
|
||||||
column_calc,
|
column_calc,
|
||||||
column_prices,
|
column_prices,
|
||||||
visibleColumn,
|
|
||||||
drinkTypes,
|
drinkTypes,
|
||||||
updateDrink,
|
updateDrink,
|
||||||
deleteDrink,
|
deleteDrink,
|
||||||
|
|
|
@ -32,6 +32,7 @@ export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
steps: {
|
steps: {
|
||||||
type: Array as PropType<Array<string>>,
|
type: Array as PropType<Array<string>>,
|
||||||
|
default: undefined
|
||||||
},
|
},
|
||||||
editable: {
|
editable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="q-pa-sm">
|
<div class="q-pa-sm">
|
||||||
<ingredients
|
<ingredients
|
||||||
v-if="!public && !cost_per_volume"
|
v-if="!public && !costPerVolume"
|
||||||
v-model="volume.ingredients"
|
v-model="volume.ingredients"
|
||||||
:editable="editable"
|
:editable="editable"
|
||||||
@update="updateVolume(volume)"
|
@update="updateVolume(volume)"
|
||||||
|
@ -136,8 +136,9 @@ export default defineComponent({
|
||||||
type: Array as PropType<Array<DrinkPriceVolume>>,
|
type: Array as PropType<Array<DrinkPriceVolume>>,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
cost_per_volume: {
|
costPerVolume: {
|
||||||
type: undefined,
|
type: undefined,
|
||||||
|
default: undefined
|
||||||
},
|
},
|
||||||
editable: {
|
editable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
|
@ -125,7 +125,7 @@
|
||||||
<q-card-section :key="key">
|
<q-card-section :key="key">
|
||||||
<drink-price-volumes
|
<drink-price-volumes
|
||||||
v-model="edit_volumes"
|
v-model="edit_volumes"
|
||||||
:cost_per_volume="cost_per_volume"
|
:cost-per-volume="cost_per_volume"
|
||||||
editable
|
editable
|
||||||
@update="updateVolume"
|
@update="updateVolume"
|
||||||
@delete-volume="deleteVolume"
|
@delete-volume="deleteVolume"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { api } from 'src/boot/axios';
|
import { api } from 'src/boot/axios';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { AxiosResponse } from 'axios';
|
|
||||||
import {
|
import {
|
||||||
calc_volume,
|
calc_volume,
|
||||||
calc_cost_per_volume,
|
calc_cost_per_volume,
|
||||||
|
@ -66,7 +65,6 @@ export const usePricelistStore = defineStore({
|
||||||
drinkTypes: [] as Array<FG.DrinkType>,
|
drinkTypes: [] as Array<FG.DrinkType>,
|
||||||
drinks: [] as Array<Drink>,
|
drinks: [] as Array<Drink>,
|
||||||
extraIngredients: [] as Array<FG.ExtraIngredient>,
|
extraIngredients: [] as Array<FG.ExtraIngredient>,
|
||||||
pricecalc_columns: [] as Array<string>,
|
|
||||||
min_prices: [] as Array<number>,
|
min_prices: [] as Array<number>,
|
||||||
tags: [] as Array<FG.Tag>,
|
tags: [] as Array<FG.Tag>,
|
||||||
}),
|
}),
|
||||||
|
@ -199,24 +197,6 @@ export const usePricelistStore = defineStore({
|
||||||
})
|
})
|
||||||
.catch((err) => console.warn(err));
|
.catch((err) => console.warn(err));
|
||||||
},
|
},
|
||||||
getPriceCalcColumn(userid: string) {
|
|
||||||
api
|
|
||||||
.get(`pricelist/users/${userid}/pricecalc_columns`)
|
|
||||||
.then(({ data }: AxiosResponse<Array<string>>) => {
|
|
||||||
if (data.length > 0) {
|
|
||||||
this.pricecalc_columns = data;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((err) => console.log(err));
|
|
||||||
},
|
|
||||||
updatePriceCalcColumn(userid: string, data: Array<string>) {
|
|
||||||
api
|
|
||||||
.put(`pricelist/users/${userid}/pricecalc_columns`, data)
|
|
||||||
.then(() => {
|
|
||||||
this.pricecalc_columns = data;
|
|
||||||
})
|
|
||||||
.catch((err) => console.log(err));
|
|
||||||
},
|
|
||||||
async get_min_prices() {
|
async get_min_prices() {
|
||||||
const { data } = await api.get<Array<number>>('pricelist/settings/min_prices');
|
const { data } = await api.get<Array<number>>('pricelist/settings/min_prices');
|
||||||
this.min_prices = data;
|
this.min_prices = data;
|
||||||
|
|
Loading…
Reference in New Issue