From 899b9536b6923db42e792a98118751dc4c1e88b6 Mon Sep 17 00:00:00 2001 From: carlosfonseca Date: Fri, 22 Dec 2023 07:41:54 -0500 Subject: [PATCH] Se crea tabla de notificaciones, tarjeta por identificador y filtros --- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + .../Customer/CustomerExtendedListFilter.vue | 2 +- src/pages/Customer/CustomerNotifications.vue | 163 ++++++++++++++++++ .../Customer/CustomerNotificationsFilter.vue | 144 ++++++++++++++++ src/router/modules/customer.js | 17 +- 6 files changed, 326 insertions(+), 2 deletions(-) create mode 100644 src/pages/Customer/CustomerNotifications.vue create mode 100644 src/pages/Customer/CustomerNotificationsFilter.vue diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 4a1eea8f4..132d8b0d4 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -112,6 +112,7 @@ export default { list: 'List', webPayments: 'Web Payments', extendedList: 'Extended list', + notifications: 'Notifications', createCustomer: 'Create customer', summary: 'Summary', basicData: 'Basic Data', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 3f4ac1c27..47963c070 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -112,6 +112,7 @@ export default { list: 'Listado', webPayments: 'Pagos Web', extendedList: 'Listado extendido', + notifications: 'Notificaciones', createCustomer: 'Crear cliente', basicData: 'Datos básicos', summary: 'Resumen', diff --git a/src/pages/Customer/CustomerExtendedListFilter.vue b/src/pages/Customer/CustomerExtendedListFilter.vue index eff0d20aa..ba1c966dc 100644 --- a/src/pages/Customer/CustomerExtendedListFilter.vue +++ b/src/pages/Customer/CustomerExtendedListFilter.vue @@ -80,7 +80,7 @@ const workers = ref(); +import { ref, computed, onBeforeMount } from 'vue'; +import { useI18n } from 'vue-i18n'; + +import { QBtn } from 'quasar'; + +import { useArrayData } from 'composables/useArrayData'; +import { useStateStore } from 'stores/useStateStore'; + +import CustomerNotificationsFilter from './CustomerNotificationsFilter.vue'; +import CustomerDescriptorProxy from './Card/CustomerDescriptorProxy.vue'; + +const { t } = useI18n(); +const stateStore = useStateStore(); + +const arrayData = ref(null); + +onBeforeMount(async () => { + arrayData.value = useArrayData('CustomerNotifications', { + url: 'Clients', + limit: 0, + }); + await arrayData.value.fetch({ append: false }); + stateStore.rightDrawer = true; +}); + +const rows = computed(() => arrayData.value.store.data); + +const selected = ref([]); +const selectedCustomerId = ref(0); + +const tableColumnComponents = { + id: { + component: QBtn, + props: () => ({ flat: true, color: 'blue' }), + event: (prop) => selectCustomerId(prop.row.id), + }, + socialName: { + component: 'span', + props: () => {}, + event: () => {}, + }, + city: { + component: 'span', + props: () => {}, + event: () => {}, + }, + phone: { + component: 'span', + props: () => {}, + event: () => {}, + }, + email: { + component: 'span', + props: () => {}, + event: () => {}, + }, +}; + +const columns = computed(() => { + return [ + { + align: 'left', + field: 'id', + label: t('Identifier'), + name: 'id', + }, + { + align: 'left', + field: 'socialName', + label: t('Social name'), + name: 'socialName', + }, + { + align: 'left', + field: 'city', + label: t('City'), + name: 'city', + }, + { + align: 'left', + field: 'phone', + label: t('Phone'), + name: 'phone', + }, + { + align: 'left', + field: 'email', + label: t('Email'), + name: 'email', + }, + ]; +}); + +const selectCustomerId = (id) => { + selectedCustomerId.value = id; +}; + + + + + + + +es: + Identifier: Identificador + Social name: Razón social + Salesperson: Comercial + Phone: Teléfono + City: Población + Email: Email + diff --git a/src/pages/Customer/CustomerNotificationsFilter.vue b/src/pages/Customer/CustomerNotificationsFilter.vue new file mode 100644 index 000000000..1c4c8f3e2 --- /dev/null +++ b/src/pages/Customer/CustomerNotificationsFilter.vue @@ -0,0 +1,144 @@ + + + + + + + +en: + params: + identifier: Identifier + socialName: Social name + city: City + phone: Phone + email: Email +es: + params: + identifier: Identificador + socialName: Razón social + city: Población + phone: Teléfono + email: Email + Identifier: Identificador + Social name: Razón social + City: Población + Phone: Teléfono + Email: Email + diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js index ec81a9c77..04cbf42b3 100644 --- a/src/router/modules/customer.js +++ b/src/router/modules/customer.js @@ -10,7 +10,12 @@ export default { component: RouterView, redirect: { name: 'CustomerMain' }, menus: { - main: ['CustomerList', 'CustomerPayments', 'CustomerExtendedList'], + main: [ + 'CustomerList', + 'CustomerPayments', + 'CustomerExtendedList', + 'CustomerNotifications', + ], card: ['CustomerBasicData'], }, children: [ @@ -56,6 +61,16 @@ export default { component: () => import('src/pages/Customer/CustomerExtendedList.vue'), }, + { + path: 'notifications', + name: 'CustomerNotifications', + meta: { + title: 'notifications', + icon: 'notifications', + }, + component: () => + import('src/pages/Customer/CustomerNotifications.vue'), + }, ], }, {