From b8a56391228a063af726c87c4313a28e1aab5909 Mon Sep 17 00:00:00 2001 From: carlosfonseca Date: Thu, 25 Jan 2024 17:29:24 -0500 Subject: [PATCH] Se crea tarjeta de historial --- src/pages/Customer/Card/CustomerBalance.vue | 3 +- src/pages/Customer/Card/CustomerLog.vue | 252 +++++++++++++++++- src/pages/Customer/Card/CustomerNotes.vue | 34 +++ .../Customer/Card/CustomerRecoveries.vue | 33 +++ 4 files changed, 319 insertions(+), 3 deletions(-) diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index 5d296881f..65c260a02 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -146,6 +146,7 @@ onBeforeMount(() => { }); const getData = () => { + stateStore.rightDrawer = true; getReceipts(); getClientRisks(); }; @@ -158,7 +159,6 @@ const getReceipts = async () => { }; const { data } = await axios.get('Receipts/filter', { params }); rows.value = data; - stateStore.rightDrawer = true; }; const getClientRisks = async () => { @@ -170,7 +170,6 @@ const getClientRisks = async () => { params: { filter: JSON.stringify(filter) }, }); clientRisks.value = data; - console.log(clientRisks.value[0].amount); }; const showNewPaymentDialog = () => { diff --git a/src/pages/Customer/Card/CustomerLog.vue b/src/pages/Customer/Card/CustomerLog.vue index fe59bf2dc..4d0a0c838 100644 --- a/src/pages/Customer/Card/CustomerLog.vue +++ b/src/pages/Customer/Card/CustomerLog.vue @@ -1,3 +1,253 @@ + + + + +es: + Search: Buscar + Search by id or concept: xxx + Entity: Entidad + All: Todo + User: Usuario + System: Sistema + Changes: Cambios + Search by changes: xxx + Creates: Crea + Edits: Modifica + Deletes: Elimina + Accesses: Accede + Date: Fecha + To: Hasta + Quit filter: Quitar filtro + diff --git a/src/pages/Customer/Card/CustomerNotes.vue b/src/pages/Customer/Card/CustomerNotes.vue index 0909758f3..95c3befe8 100644 --- a/src/pages/Customer/Card/CustomerNotes.vue +++ b/src/pages/Customer/Card/CustomerNotes.vue @@ -6,6 +6,40 @@ import { date } from 'quasar'; import VnPaginate from 'src/components/ui/VnPaginate.vue'; +const response = { + fields: [ + 'id', + 'originFk', + 'userFk', + 'action', + 'changedModel', + 'oldInstance', + 'newInstance', + 'creationDate', + 'changedModel', + 'changedModelId', + 'changedModelValue', + 'description', + ], + include: [ + { + relation: 'user', + scope: { + fields: ['nickname', 'name', 'image'], + include: { relation: 'worker', scope: { fields: ['id'] } }, + }, + }, + ], + order: ['creationDate DESC', 'id DESC'], + limit: 20, + where: { + and: [ + { originFk: '1' }, + { userFk: { neq: null } }, + { action: { inq: ['insert', 'update', 'delete', 'select'] } }, + ], + }, +}; const { t } = useI18n(); const route = useRoute(); const router = useRouter(); diff --git a/src/pages/Customer/Card/CustomerRecoveries.vue b/src/pages/Customer/Card/CustomerRecoveries.vue index 7247145f2..df5c7f6e2 100644 --- a/src/pages/Customer/Card/CustomerRecoveries.vue +++ b/src/pages/Customer/Card/CustomerRecoveries.vue @@ -11,6 +11,39 @@ import { toCurrency } from 'src/filters'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; +const response = { + fields: [ + 'id', + 'originFk', + 'userFk', + 'action', + 'changedModel', + 'oldInstance', + 'newInstance', + 'creationDate', + 'changedModel', + 'changedModelId', + 'changedModelValue', + 'description', + ], + include: [ + { + relation: 'user', + scope: { + fields: ['nickname', 'name', 'image'], + include: { relation: 'worker', scope: { fields: ['id'] } }, + }, + }, + ], + order: ['creationDate DESC', 'id DESC'], + limit: 20, + where: { + and: [ + { originFk: '1' }, + { action: { inq: ['insert', 'update', 'delete', 'select'] } }, + ], + }, +}; const { t } = useI18n(); const route = useRoute(); const router = useRouter();