From 7cc5c0bdbd51e2dcb7e2c1ef4a83fae7e894dbf2 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 9 May 2024 08:40:09 -0300 Subject: [PATCH 1/2] Fix client table initial request --- src/pages/Monitor/SalesClientsTable.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Monitor/SalesClientsTable.vue b/src/pages/Monitor/SalesClientsTable.vue index 84cccf91b..3f2389471 100644 --- a/src/pages/Monitor/SalesClientsTable.vue +++ b/src/pages/Monitor/SalesClientsTable.vue @@ -32,7 +32,7 @@ const dateRange = computed(() => { const filter = reactive({ where: { 'v.stamp': { - between: [from.value, to.value], + between: dateRange.value, }, }, }); @@ -148,7 +148,7 @@ const columns = computed(() => [ ref="paginateRef" data-key="SalesMonitorClients" url="SalesMonitors/clientsFilter" - order="dated DESC, hour DESC" + :order="['dated DESC', 'hour DESC']" :limit="6" :expr-builder="exprBuilder" :user-params="params" From b4f983b9462d168cc4670c678fbc0ce6d253b593 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 9 May 2024 09:15:52 -0300 Subject: [PATCH 2/2] Add searchbar --- src/components/ui/VnSearchbar.vue | 4 ++-- src/pages/Monitor/MonitorList.vue | 12 ++++++++++++ src/pages/Monitor/locale/en.yml | 3 +++ src/pages/Monitor/locale/es.yml | 3 +++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 344267ef7..aaf197d74 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -81,14 +81,14 @@ async function search() { const staticParams = Object.entries(store.userParams).filter( ([key, value]) => value && (props.staticParams || []).includes(key) ); - // const filter =props?.where? { where: JSON.parse(props.where) }: {} + store.skip = 0; await arrayData.applyFilter({ params: { - // filter , ...Object.fromEntries(staticParams), search: searchText.value, }, }); + if (!props.redirect) return; if (props.customRouteRedirectName) diff --git a/src/pages/Monitor/MonitorList.vue b/src/pages/Monitor/MonitorList.vue index a084f0c99..03b6eb920 100644 --- a/src/pages/Monitor/MonitorList.vue +++ b/src/pages/Monitor/MonitorList.vue @@ -6,6 +6,7 @@ import { useStateStore } from 'stores/useStateStore'; import SalesClientTable from './SalesClientsTable.vue'; import SalesOrdersTable from './SalesOrdersTable.vue'; import SalesTicketsTable from './SalesTicketsTable.vue'; +import VnSearchbar from 'components/ui/VnSearchbar.vue'; const { t } = useI18n(); const stateStore = useStateStore(); @@ -20,6 +21,17 @@ onUnmounted(() => (stateStore.rightDrawer = false));