-
- {{ entity[title] ?? $props.title }}
+
+ {{ getValueFromPath(title) ?? $props.title }}
@@ -151,7 +166,7 @@ const emit = defineEmits(['onFetch']);
- #{{ $props.subtitle ?? entity.id }}
+ #{{ getValueFromPath(subtitle) ?? entity.id }}
diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue
index 16217946b..5595d54ba 100644
--- a/src/components/ui/VnFilterPanel.vue
+++ b/src/components/ui/VnFilterPanel.vue
@@ -114,6 +114,7 @@ async function search(evt) {
store.userParamsChanged = true;
store.filter.skip = 0;
store.skip = 0;
+ store.page = 1;
const { params: newParams } = await arrayData.addFilter({ params: userParams.value });
userParams.value = newParams;
@@ -126,7 +127,8 @@ async function search(evt) {
async function reload() {
isLoading.value = true;
const params = Object.values(userParams.value).filter((param) => param);
-
+ store.skip = 0;
+ store.page = 1;
await arrayData.fetch({ append: false });
if (!$props.showAll && !params.length) store.data = [];
isLoading.value = false;
@@ -138,6 +140,7 @@ async function clearFilters() {
store.userParamsChanged = true;
store.filter.skip = 0;
store.skip = 0;
+ store.page = 1;
// Filtrar los params no removibles
const removableFilters = Object.keys(userParams.value).filter((param) =>
$props.unremovableParams.includes(param)
diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue
index 4e048e238..eab04f04c 100644
--- a/src/components/ui/VnSearchbar.vue
+++ b/src/components/ui/VnSearchbar.vue
@@ -104,6 +104,7 @@ async function search() {
([key, value]) => value && (props.staticParams || []).includes(key)
);
store.skip = 0;
+ store.page = 1;
if (props.makeFetch)
await arrayData.applyFilter({
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js
index f6f476f87..b40699bbb 100644
--- a/src/composables/useArrayData.js
+++ b/src/composables/useArrayData.js
@@ -1,4 +1,4 @@
-import { onMounted, ref, computed } from 'vue';
+import { onMounted, computed } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';
import { useArrayDataStore } from 'stores/useArrayDataStore';
@@ -16,8 +16,6 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
const router = useRouter();
let canceller = null;
- const page = ref(1);
-
onMounted(() => {
setOptions();
store.skip = 0;
@@ -87,13 +85,13 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
}
Object.assign(filter, store.userFilter, exprFilter);
- Object.assign(store.filter, { ...filter, skip: store.skip });
- const params = {
- filter: JSON.stringify(store.filter),
- };
+ Object.assign(store.filter, filter);
+ const params = { filter: store.filter };
Object.assign(params, userParams);
+ params.filter.skip = store.skip;
+ params.filter = JSON.stringify(params.filter);
store.currentFilter = params;
store.isLoading = true;
const response = await axios.get(store.url, {
@@ -154,8 +152,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
store.userParams = userParams;
store.skip = 0;
store.filter.skip = 0;
- page.value = 1;
-
+ store.page = 1;
await fetch({ append: false });
return { filter, params };
}
@@ -187,10 +184,11 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
async function loadMore() {
if (!store.hasMoreData) return;
- store.skip = store.limit * page.value;
- page.value += 1;
+ store.skip = store.limit * store.page;
+ store.page += 1;
await fetch({ append: true });
+ updateStateParams();
}
async function refresh() {
diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue
index 5336c4427..ecf16f4c6 100644
--- a/src/pages/Claim/Card/ClaimDescriptor.vue
+++ b/src/pages/Claim/Card/ClaimDescriptor.vue
@@ -56,8 +56,7 @@ onMounted(async () => {
:url="`Claims/${entityId}`"
:filter="filter"
module="Claim"
- :title="data.title"
- :subtitle="data.subtitle"
+ title="client.name"
@on-fetch="setData"
data-key="Claim"
>
diff --git a/src/pages/Item/Card/ItemLastEntries.vue b/src/pages/Item/Card/ItemLastEntries.vue
index 9071cc6eb..a3ae99da6 100644
--- a/src/pages/Item/Card/ItemLastEntries.vue
+++ b/src/pages/Item/Card/ItemLastEntries.vue
@@ -200,16 +200,10 @@ onUnmounted(() => (stateStore.rightDrawer = false));
-
+
diff --git a/src/pages/Item/ItemRequestFilter.vue b/src/pages/Item/ItemRequestFilter.vue
index 2c056acc6..2fbe849d1 100644
--- a/src/pages/Item/ItemRequestFilter.vue
+++ b/src/pages/Item/ItemRequestFilter.vue
@@ -192,7 +192,6 @@ const decrement = (paramsObj, key) => {
v-model="params.from"
@update:model-value="searchFn()"
is-outlined
- emit-date-format
/>
@@ -203,7 +202,6 @@ const decrement = (paramsObj, key) => {
v-model="params.to"
@update:model-value="searchFn()"
is-outlined
- emit-date-format
/>
diff --git a/src/pages/Monitor/SalesClientsTable.vue b/src/pages/Monitor/SalesClientsTable.vue
index 3f2389471..8008b1fda 100644
--- a/src/pages/Monitor/SalesClientsTable.vue
+++ b/src/pages/Monitor/SalesClientsTable.vue
@@ -169,7 +169,6 @@ const columns = computed(() => [
[
diff --git a/src/pages/Order/Card/OrderCard.vue b/src/pages/Order/Card/OrderCard.vue
index 5b6896656..12b61e913 100644
--- a/src/pages/Order/Card/OrderCard.vue
+++ b/src/pages/Order/Card/OrderCard.vue
@@ -2,7 +2,6 @@
import VnCard from 'components/common/VnCard.vue';
import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
import OrderFilter from './OrderFilter.vue';
-import OrderSearchbar from './OrderSearchbar.vue';
-
-
-
-
+ searchbar-label="Search order"
+ searchbar-info="ypu can search by order id or name"
+ />
diff --git a/src/pages/Order/Card/OrderCatalogFilter.vue b/src/pages/Order/Card/OrderCatalogFilter.vue
index 1c6ccfa5a..c354ec94b 100644
--- a/src/pages/Order/Card/OrderCatalogFilter.vue
+++ b/src/pages/Order/Card/OrderCatalogFilter.vue
@@ -37,6 +37,10 @@ const selectedOrder = ref(null);
const selectedOrderField = ref(null);
const moreFields = ref([]);
const moreFieldsOrder = ref([]);
+const selectedTag = ref(null);
+const tagValues = ref([{}]);
+const tagOptions = ref([]);
+
const createValue = (val, done) => {
if (val.length > 2) {
if (!tagOptions.value.includes(val)) {
@@ -95,10 +99,6 @@ function exprBuilder(param, value) {
}
}
-const selectedTag = ref(null);
-const tagValues = ref([{}]);
-const tagOptions = ref([]);
-
const applyTagFilter = (params, search) => {
if (!tagValues.value?.length) {
params.tagGroups = null;
@@ -139,34 +139,22 @@ const onOrderChange = (value, params) => {
};
const onOrderFieldChange = (value, params) => {
- const tagObj = JSON.parse(params.orderBy); // esto donde va
- const fields = {
- Relevancy: (value) => value + ' DESC, name',
- ColorAndPrice: 'showOrder, price',
- Name: 'name',
- Price: 'price',
- };
- let tagField = fields[value];
- if (!tagField) return;
-
- if (typeof tagField === 'function') tagField = tagField(value);
- tagObj.field = tagField;
- params.orderBy = JSON.stringify(tagObj);
+ const tagObj = JSON.parse(params.orderBy);
switch (value) {
case 'Relevancy':
- tagObj.field = value + ' DESC, name';
+ tagObj.name = value + ' DESC, name';
params.orderBy = JSON.stringify(tagObj);
break;
case 'ColorAndPrice':
- tagObj.field = 'showOrder, price';
+ tagObj.name = 'showOrder, price';
params.orderBy = JSON.stringify(tagObj);
break;
case 'Name':
- tagObj.field = 'name';
+ tagObj.name = 'name';
params.orderBy = JSON.stringify(tagObj);
break;
case 'Price':
- tagObj.field = 'price';
+ tagObj.name = 'price';
params.orderBy = JSON.stringify(tagObj);
break;
}
@@ -308,6 +296,7 @@ const useLang = (values) => {
v-model="selectedOrder"
:options="moreFields"
option-label="label"
+ option-value="way"
dense
outlined
rounded
diff --git a/src/pages/Order/Card/OrderCatalogItem.vue b/src/pages/Order/Card/OrderCatalogItem.vue
index 34e22915d..8fa0bb5b9 100644
--- a/src/pages/Order/Card/OrderCatalogItem.vue
+++ b/src/pages/Order/Card/OrderCatalogItem.vue
@@ -27,7 +27,7 @@ const dialog = ref(null);
-
+
+
@@ -81,6 +87,10 @@ const detailsColumns = ref([
/>
+
-
+
{{ entity?.note }}
+
{{ t('order.summary.subtotal') }}
@@ -152,9 +161,7 @@ const detailsColumns = ref([
-
+
@@ -168,7 +175,10 @@ const detailsColumns = ref([
- {{ props.row.item?.id }}
+
+ {{ props.row.item?.id }}
+
+
diff --git a/src/pages/Order/OrderCatalog.vue b/src/pages/Order/OrderCatalog.vue
index 1d97663d0..081a2cd2f 100644
--- a/src/pages/Order/OrderCatalog.vue
+++ b/src/pages/Order/OrderCatalog.vue
@@ -70,6 +70,7 @@ function extractValueTags(items) {
:user-params="catalogParams"
auto-load
@on-fetch="extractTags"
+ :update-router="false"
>
diff --git a/src/pages/Order/OrderList.vue b/src/pages/Order/OrderList.vue
index 247a8e3b2..0e6e11482 100644
--- a/src/pages/Order/OrderList.vue
+++ b/src/pages/Order/OrderList.vue
@@ -9,7 +9,7 @@ import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnPaginate from 'components/ui/VnPaginate.vue';
import VnLv from 'components/ui/VnLv.vue';
-import OrderSearchbar from 'pages/Order/Card/OrderSearchbar.vue';
+import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import OrderFilter from 'pages/Order/Card/OrderFilter.vue';
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
@@ -28,7 +28,11 @@ function navigate(id) {
}
-
+
diff --git a/src/pages/Parking/Card/ParkingDescriptor.vue b/src/pages/Parking/Card/ParkingDescriptor.vue
index b5c8820ed..b57bfb0cc 100644
--- a/src/pages/Parking/Card/ParkingDescriptor.vue
+++ b/src/pages/Parking/Card/ParkingDescriptor.vue
@@ -2,7 +2,6 @@
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
-import { useArrayData } from 'src/composables/useArrayData';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'components/ui/VnLv.vue';
@@ -17,8 +16,7 @@ const props = defineProps({
const { t } = useI18n();
const route = useRoute();
const entityId = computed(() => props.id || route.params.id);
-const { store } = useArrayData('Parking');
-const parking = computed(() => store.data);
+
const filter = {
fields: ['id', 'sectorFk', 'code', 'pickingOrder', 'row', 'column'],
include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
@@ -29,15 +27,13 @@ const filter = {
module="Parking"
data-key="Parking"
:url="`Parkings/${entityId}`"
- :title="parking?.code"
- :subtitle="parking?.id"
+ title="code"
:filter="filter"
- @on-fetch="(data) => (parking = data)"
>
-
-
-
-
+
+
+
+
diff --git a/src/pages/Parking/Card/ParkingSummary.vue b/src/pages/Parking/Card/ParkingSummary.vue
index 7406856b9..95620ebfd 100644
--- a/src/pages/Parking/Card/ParkingSummary.vue
+++ b/src/pages/Parking/Card/ParkingSummary.vue
@@ -1,10 +1,9 @@