From dbc9e9dd712e457ef2ef241b53d9007f2ce31787 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Sun, 5 May 2024 19:13:36 -0300 Subject: [PATCH 1/9] Sales monitor base --- src/i18n/locale/en.yml | 4 + src/i18n/locale/es.yml | 4 + src/pages/Monitor/MonitorMain.vue | 18 ++ src/pages/Monitor/SalesMonitor.vue | 270 +++++++++++++++++++++++++++++ src/router/modules/index.js | 2 + src/router/modules/monitor.js | 42 +++++ src/router/routes.js | 2 + src/stores/useNavigationStore.js | 2 +- 8 files changed, 343 insertions(+), 1 deletion(-) create mode 100644 src/pages/Monitor/MonitorMain.vue create mode 100644 src/pages/Monitor/SalesMonitor.vue create mode 100644 src/router/modules/monitor.js diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 0e27eeade..7acc2043d 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1235,6 +1235,10 @@ zone: zonesList: Zones deliveryList: Delivery days upcomingList: Upcoming deliveries +monitor: + pageTitles: + monitors: Monitors + salesMonitor: Sales monitor components: topbar: {} itemsFilterPanel: diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index bc246a6cb..6e466f483 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -1234,6 +1234,10 @@ zone: zonesList: Zonas deliveryList: Días de entrega upcomingList: Próximos repartos +monitors: + pageTitles: + monitors: Monitores + salesMonitor: Monitor de ventas components: topbar: {} itemsFilterPanel: diff --git a/src/pages/Monitor/MonitorMain.vue b/src/pages/Monitor/MonitorMain.vue new file mode 100644 index 000000000..c1f2a31db --- /dev/null +++ b/src/pages/Monitor/MonitorMain.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/pages/Monitor/SalesMonitor.vue b/src/pages/Monitor/SalesMonitor.vue new file mode 100644 index 000000000..842474545 --- /dev/null +++ b/src/pages/Monitor/SalesMonitor.vue @@ -0,0 +1,270 @@ + + + diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 7fff2f2e5..38bcd54d5 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -18,6 +18,7 @@ import Parking from './parking'; import Agency from './agency'; import ItemType from './itemType'; import Zone from './zone'; +import Monitor from './monitor'; export default [ Item, @@ -40,4 +41,5 @@ export default [ Agency, ItemType, Zone, + Monitor, ]; diff --git a/src/router/modules/monitor.js b/src/router/modules/monitor.js new file mode 100644 index 000000000..0ce6e153b --- /dev/null +++ b/src/router/modules/monitor.js @@ -0,0 +1,42 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/monitor', + name: 'Monitor', + meta: { + title: 'monitors', + icon: 'vn:grid', + moduleName: 'Monitor', + }, + component: RouterView, + redirect: { name: 'MonitorMain' }, + menus: { + main: ['SalesMonitor'], + card: [], + }, + children: [ + { + path: '', + name: 'MonitorMain', + component: () => import('src/pages/Monitor/MonitorMain.vue'), + redirect: { name: 'SalesMonitor' }, + children: [ + { + path: 'index', + name: 'SalesMonitor', + meta: { + title: 'salesMonitor', + icon: 'vn:grid', + }, + component: () => import('src/pages/Monitor/SalesMonitor.vue'), + }, + ], + }, + // { + // name: 'ItemCard', + // path: ':id', + // component: () => import('src/pages/Item/Card/ItemCard.vue'), + // children: [], + // }, + ], +}; diff --git a/src/router/routes.js b/src/router/routes.js index 04780ee17..6a0430d51 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -18,6 +18,7 @@ import roadmap from 'src/router/modules/roadmap'; import parking from 'src/router/modules/parking'; import agency from 'src/router/modules/agency'; import zone from 'src/router/modules/zone'; +import monitor from 'src/router/modules/monitor'; const routes = [ { @@ -65,6 +66,7 @@ const routes = [ shelving, invoiceOut, invoiceIn, + monitor, wagon, order, route, diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index ee1e04e9b..263a9dec8 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -15,6 +15,7 @@ export const useNavigationStore = defineStore('navigationStore', () => { 'travel', 'invoiceOut', 'invoiceIn', + 'monitor', 'supplier', 'claim', 'route', @@ -31,7 +32,6 @@ export const useNavigationStore = defineStore('navigationStore', () => { for (const module of modules) { const moduleDef = routes.find((route) => toLowerCamel(route.name) === module); if (!moduleDef) continue; - const item = addMenuItem(module, moduleDef, modulesRoutes.value); if (!item) continue; From 5bdbbf426a8cf0d2537245ecf325df03de7b31ea Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 8 May 2024 10:43:18 -0300 Subject: [PATCH 2/9] Tables development --- src/components/ui/CardSummary.vue | 9 +- src/i18n/locale/en.yml | 5 +- src/i18n/locale/es.yml | 5 +- src/pages/Monitor/MonitorList.vue | 69 +++ src/pages/Monitor/SalesClientsTable.vue | 219 +++++++++ src/pages/Monitor/SalesMonitor.vue | 270 ---------- src/pages/Monitor/SalesOrdersTable.vue | 198 ++++++++ src/pages/Monitor/SalesTicketsTable.vue | 622 ++++++++++++++++++++++++ src/pages/Monitor/locale/en.yml | 40 ++ src/pages/Monitor/locale/es.yml | 40 ++ src/pages/Ticket/Card/TicketSale.vue | 1 + src/router/modules/monitor.js | 22 +- src/router/modules/ticket.js | 11 +- 13 files changed, 1221 insertions(+), 290 deletions(-) create mode 100644 src/pages/Monitor/MonitorList.vue create mode 100644 src/pages/Monitor/SalesClientsTable.vue delete mode 100644 src/pages/Monitor/SalesMonitor.vue create mode 100644 src/pages/Monitor/SalesOrdersTable.vue create mode 100644 src/pages/Monitor/SalesTicketsTable.vue create mode 100644 src/pages/Monitor/locale/en.yml create mode 100644 src/pages/Monitor/locale/es.yml create mode 100644 src/pages/Ticket/Card/TicketSale.vue diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index 1a4514ef5..e52be753f 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -54,6 +54,13 @@ async function fetch() { emit('onFetch', Array.isArray(data) ? data[0] : data); isLoading.value = false; } + +const showRedirectToSummaryIcon = computed(() => { + const routeExists = route.matched.some( + (route) => route.name === `${route.meta.moduleName}Summary` + ); + return !isSummary.value && route.meta.moduleName && routeExists; +}); + + diff --git a/src/pages/Monitor/SalesClientsTable.vue b/src/pages/Monitor/SalesClientsTable.vue new file mode 100644 index 000000000..84cccf91b --- /dev/null +++ b/src/pages/Monitor/SalesClientsTable.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/pages/Monitor/SalesMonitor.vue b/src/pages/Monitor/SalesMonitor.vue deleted file mode 100644 index 842474545..000000000 --- a/src/pages/Monitor/SalesMonitor.vue +++ /dev/null @@ -1,270 +0,0 @@ - - - diff --git a/src/pages/Monitor/SalesOrdersTable.vue b/src/pages/Monitor/SalesOrdersTable.vue new file mode 100644 index 000000000..2e1d3aaed --- /dev/null +++ b/src/pages/Monitor/SalesOrdersTable.vue @@ -0,0 +1,198 @@ + + + diff --git a/src/pages/Monitor/SalesTicketsTable.vue b/src/pages/Monitor/SalesTicketsTable.vue new file mode 100644 index 000000000..d82a5f2ca --- /dev/null +++ b/src/pages/Monitor/SalesTicketsTable.vue @@ -0,0 +1,622 @@ + + + diff --git a/src/pages/Monitor/locale/en.yml b/src/pages/Monitor/locale/en.yml new file mode 100644 index 000000000..a449225ed --- /dev/null +++ b/src/pages/Monitor/locale/en.yml @@ -0,0 +1,40 @@ +salesMonitor: + clientsOnWebsite: Clients on website + recentOrderActions: Recent order actions +salesClientsTable: + from: From + to: To + date: Date + hour: Hour + salesPerson: Salesperson + client: Client +salesOrdersTable: + delete: Delete + date: Date + client: Client + salesPerson: Salesperson + deleteConfirmTitle: Delete selected elements + deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue? +salesTicketsTable: + problems: Problems + noVerifiedData: No verified data + notVisible: Not visible + purchaseRequest: Purchase request + clientFrozen: Client frozen + risk: Risk + componentLack: Component lack + tooLittle: Ticket too little + identifier: Identifier + client: Client + salesPerson: Salesperson + date: Date + theoretical: Theoretical + practical: Practical + province: Province + state: State + isFragile: Is fragile + zone: Zone + goToLines: Go to lines + preview: Preview + total: Total + preparation: Preparation diff --git a/src/pages/Monitor/locale/es.yml b/src/pages/Monitor/locale/es.yml new file mode 100644 index 000000000..6ed6604be --- /dev/null +++ b/src/pages/Monitor/locale/es.yml @@ -0,0 +1,40 @@ +salesMonitor: + clientsOnWebsite: Clientes activos en la web + recentOrderActions: Acciones recientes en pedidos +salesClientsTable: + from: Desde + to: Hasta + date: Fecha + hour: Hora + salesPerson: Comercial + client: Cliente +salesOrdersTable: + delete: Eliminar + date: Fecha + client: Cliente + salesPerson: Comercial + deleteConfirmTitle: Eliminar los elementos seleccionados + deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar? +salesTicketsTable: + problems: Problemas + noVerifiedData: Sin datos comprobados + notVisible: No visible + purchaseRequest: Petición de compra + clientFrozen: Cliente congelado + risk: Riesgo + componentLack: Faltan componentes + tooLittle: Ticket demasiado pequeño + identifier: Identificador + client: Cliente + salesPerson: Comercial + date: Fecha + theoretical: Teórica + practical: Práctica + province: Provincia + state: Estado + isFragile: Es frágil + zone: Zona + goToLines: Ir a líneas + preview: Vista previa + total: Total + preparation: Preparación diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue new file mode 100644 index 000000000..02cccaff2 --- /dev/null +++ b/src/pages/Ticket/Card/TicketSale.vue @@ -0,0 +1 @@ + diff --git a/src/router/modules/monitor.js b/src/router/modules/monitor.js index 0ce6e153b..6c388a474 100644 --- a/src/router/modules/monitor.js +++ b/src/router/modules/monitor.js @@ -5,13 +5,13 @@ export default { name: 'Monitor', meta: { title: 'monitors', - icon: 'vn:grid', + icon: 'grid_view', moduleName: 'Monitor', }, component: RouterView, redirect: { name: 'MonitorMain' }, menus: { - main: ['SalesMonitor'], + main: ['MonitorList'], card: [], }, children: [ @@ -19,24 +19,18 @@ export default { path: '', name: 'MonitorMain', component: () => import('src/pages/Monitor/MonitorMain.vue'), - redirect: { name: 'SalesMonitor' }, + redirect: { name: 'MonitorList' }, children: [ { - path: 'index', - name: 'SalesMonitor', + path: 'list', + name: 'MonitorList', meta: { - title: 'salesMonitor', - icon: 'vn:grid', + title: 'list', + icon: 'grid_view', }, - component: () => import('src/pages/Monitor/SalesMonitor.vue'), + component: () => import('src/pages/Monitor/MonitorList.vue'), }, ], }, - // { - // name: 'ItemCard', - // path: ':id', - // component: () => import('src/pages/Item/Card/ItemCard.vue'), - // children: [], - // }, ], }; diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index eb6c1b6d2..6cb7291dc 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'TicketMain' }, menus: { main: ['TicketList'], - card: ['TicketBoxing', 'TicketSms'], + card: ['TicketBoxing', 'TicketSms', 'TicketSale'], }, children: [ { @@ -66,6 +66,15 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketBasicData.vue'), }, + { + name: 'TicketSale', + path: 'sale', + meta: { + title: 'sale', + icon: 'vn:lines', + }, + component: () => import('src/pages/Ticket/Card/TicketSale.vue'), + }, { path: 'boxing', name: 'TicketBoxing', From 399c2723a945ff21249ab5dc99fe5aec35429152 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 8 May 2024 10:58:27 -0300 Subject: [PATCH 3/9] change monitor list layout --- src/pages/Monitor/MonitorList.vue | 59 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/pages/Monitor/MonitorList.vue b/src/pages/Monitor/MonitorList.vue index c7db282c1..a084f0c99 100644 --- a/src/pages/Monitor/MonitorList.vue +++ b/src/pages/Monitor/MonitorList.vue @@ -21,46 +21,45 @@ onUnmounted(() => (stateStore.rightDrawer = false)); From 7cc5c0bdbd51e2dcb7e2c1ef4a83fae7e894dbf2 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 9 May 2024 08:40:09 -0300 Subject: [PATCH 7/9] 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 8/9] 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));