0
0
Fork 0
This commit is contained in:
Javier Segarra 2024-07-23 15:09:42 +02:00
parent ce6a94bab8
commit 1ac0a85969
3 changed files with 23 additions and 15 deletions

View File

@ -95,8 +95,8 @@ watch(
);
watch(
() => arrayData.store.userParams,
(val) => setUserParams(val)
() => [store.userParams, store.userFilter],
([userParams, userFilter]) => setUserParams({ ...userParams, filter: userFilter })
);
watch(

View File

@ -54,17 +54,17 @@ function extractValueTags(items) {
<template>
<!-- TODO Sobreescribir la barra de búsqueda -->
<Teleport to="#searchbar">
<VnSearchbar
data-key="OrderCatalogList"
:user-params="catalogParams"
:static-params="['orderFk', 'orderBy']"
:redirect="false"
url="Orders/CatalogFilter"
:label="t('Search items')"
:info="t('You can search orders by reference')"
/>
</Teleport>
<!-- <Teleport to="#searchbar"> -->
<VnSearchbar
data-key="OrderCatalogList"
:user-params="catalogParams"
:static-params="['orderFk', 'orderBy']"
:redirect="false"
url="Orders/CatalogFilter"
:label="t('Search items')"
:info="t('You can search orders by reference')"
/>
<!-- </Teleport> -->
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8">
<OrderCatalogFilter

View File

@ -29,7 +29,7 @@ const props = defineProps({
});
const categoryList = ref(null);
const selectedCategoryFk = ref(null);
const typeList = ref(null);
const typeList = ref([]);
const selectedTypeFk = ref(null);
const validationsStore = useValidator();
const selectedOrder = ref(null);
@ -165,7 +165,8 @@ const onOrderFieldChange = (value, params) => {
break;
}
};
const getCategory = (fk) =>
(categoryList.value || []).find((category) => category?.id === fk);
const _moreFields = ['ASC', 'DESC'];
const _moreFieldsTypes = ['Relevancy', 'ColorAndPrice', 'Name', 'Price'];
const setCategoryList = (data) => {
@ -177,6 +178,13 @@ const setCategoryList = (data) => {
}));
moreFields.value = useLang(_moreFields);
moreFieldsOrder.value = useLang(_moreFieldsTypes);
const { categoryFk } = JSON.parse(JSON.parse(route.query.params).filter).where;
if (!selectedCategoryFk.value) {
selectedCategoryFk.value = categoryFk;
selectedCategory.value = getCategory(categoryFk);
loadTypes(categoryFk);
}
};
const getCategoryClass = (category, params) => {