From 6e935cb91f9891d6eaf2d8e2838d8133a375b8f0 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 21 Mar 2023 14:54:28 +0100 Subject: [PATCH 01/14] feat(claim): added claim lines section --- src/pages/Claim/Card/ClaimDescriptor.vue | 4 +- src/pages/Claim/Card/ClaimLines.vue | 269 +++++++++++++++++++++++ src/router/modules/claim.js | 11 +- 3 files changed, 281 insertions(+), 3 deletions(-) create mode 100644 src/pages/Claim/Card/ClaimLines.vue diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue index aa78776a9..a0e68b0ae 100644 --- a/src/pages/Claim/Card/ClaimDescriptor.vue +++ b/src/pages/Claim/Card/ClaimDescriptor.vue @@ -72,9 +72,9 @@ function stateColor(code) { {{ t('claim.card.state') }} - + {{ entity.claimState.description }} - + diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue new file mode 100644 index 000000000..62a9676e4 --- /dev/null +++ b/src/pages/Claim/Card/ClaimLines.vue @@ -0,0 +1,269 @@ + + + + + + +es: + Delivered: Entregado + Quantity: Cantidad + Claimed: Reclamada + Description: Descripción + Price: Precio + Discount: Descuento + Actions: Acciones + Amount: Total + Amount Claimed: Cantidad reclamada + Delete claimed sale: Eliminar venta reclamada + diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js index 0e8222cc5..77ef8551a 100644 --- a/src/router/modules/claim.js +++ b/src/router/modules/claim.js @@ -11,7 +11,7 @@ export default { redirect: { name: 'ClaimMain' }, menus: { main: ['ClaimList', 'ClaimRmaList'], - card: ['ClaimBasicData', 'ClaimRma', 'ClaimPhotos', 'ClaimLog'], + card: ['ClaimBasicData', 'ClaimLines', 'ClaimRma', 'ClaimPhotos', 'ClaimLog'], }, children: [ { @@ -85,6 +85,15 @@ export default { }, component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'), }, + { + name: 'ClaimLines', + path: 'lines', + meta: { + title: 'lines', + icon: 'history', + }, + component: () => import('src/pages/Claim/Card/ClaimLines.vue'), + }, { name: 'ClaimLog', path: 'log', From b75eda08309f85231e9e8706b0c7e8a5e6dc150e Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 21 Mar 2023 14:57:50 +0100 Subject: [PATCH 02/14] Added translations --- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + src/router/modules/claim.js | 18 +++++++++--------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index be4603ea8..ecd7e0251 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -240,6 +240,7 @@ export default { rmaList: 'RMA', summary: 'Summary', basicData: 'Basic Data', + lines: 'Lines', rma: 'RMA', photos: 'Photos', log: 'Audit logs', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index b3336ca7a..8c3d99bcf 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -239,6 +239,7 @@ export default { rmaList: 'RMA', summary: 'Resumen', basicData: 'Datos básicos', + lines: 'Líneas', rma: 'RMA', photos: 'Fotos', log: 'Registros de auditoría', diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js index 77ef8551a..c43ed5012 100644 --- a/src/router/modules/claim.js +++ b/src/router/modules/claim.js @@ -66,6 +66,15 @@ export default { }, component: () => import('src/pages/Claim/Card/ClaimBasicData.vue'), }, + { + name: 'ClaimLines', + path: 'lines', + meta: { + title: 'lines', + icon: 'vn:details', + }, + component: () => import('src/pages/Claim/Card/ClaimLines.vue'), + }, { name: 'ClaimRma', path: 'rma', @@ -85,15 +94,6 @@ export default { }, component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'), }, - { - name: 'ClaimLines', - path: 'lines', - meta: { - title: 'lines', - icon: 'history', - }, - component: () => import('src/pages/Claim/Card/ClaimLines.vue'), - }, { name: 'ClaimLog', path: 'log', From dba094e84096f39ae0d977830d19de9d17bef97a Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 21 Mar 2023 15:00:15 +0100 Subject: [PATCH 03/14] Type number --- src/pages/Claim/Card/ClaimLines.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue index 62a9676e4..f7f4715fe 100644 --- a/src/pages/Claim/Card/ClaimLines.vue +++ b/src/pages/Claim/Card/ClaimLines.vue @@ -172,6 +172,7 @@ async function remove({ id }) { > Date: Wed, 22 Mar 2023 15:11:08 +0100 Subject: [PATCH 04/14] Show mana --- src/pages/Claim/Card/ClaimLines.vue | 34 ++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue index f7f4715fe..8fc0838d4 100644 --- a/src/pages/Claim/Card/ClaimLines.vue +++ b/src/pages/Claim/Card/ClaimLines.vue @@ -19,7 +19,10 @@ const stateStore = useStateStore(); const arrayData = useArrayData('ClaimLines'); const store = arrayData.store; -const filter = { +const claimFilter = { + fields: ['ticketFk'], +}; +const linesFilter = { include: { relation: 'sale', scope: { @@ -31,6 +34,13 @@ const filter = { }, }; +const claim = ref(null); +async function onFetchClaim(data) { + claim.value = data; + + fetchMana(); +} + const amount = ref(0); const amountClaimed = ref(0); async function onFetch(rows) { @@ -96,6 +106,13 @@ const columns = computed(() => [ }, ]); +const mana = ref(0); +async function fetchMana() { + const ticketId = claim.value.ticketFk; + const response = await axios.get(`Tickets/${ticketId}/getSalesPersonMana`); + mana.value = response.data; +} + async function updateQuantity({ id, quantity }) { if (!id) return; await axios.patch(`ClaimBeginnings/${id}`, { quantity }); @@ -124,6 +141,9 @@ async function remove({ id }) { message: t('globals.rowRemoved'), }); } + +const manaTitle = computed(() => `${t('Mana')} ${toCurrency(mana.value)}`); +const totalClaimed = 0; diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue index a0e68b0ae..baba66e2a 100644 --- a/src/pages/Claim/Card/ClaimDescriptor.vue +++ b/src/pages/Claim/Card/ClaimDescriptor.vue @@ -47,77 +47,77 @@ function stateColor(code) { diff --git a/src/pages/Claim/Card/ClaimDescriptorMenu.vue b/src/pages/Claim/Card/ClaimDescriptorMenu.vue index bd1efe0ce..5688613d6 100644 --- a/src/pages/Claim/Card/ClaimDescriptorMenu.vue +++ b/src/pages/Claim/Card/ClaimDescriptorMenu.vue @@ -69,43 +69,43 @@ async function remove() { await axios.delete(`Claims/${id}`); quasar.notify({ message: t('globals.dataDeleted'), - type: 'positive' + type: 'positive', }); } diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue index ddb0f7561..6bd8dc21f 100644 --- a/src/pages/Claim/Card/ClaimLines.vue +++ b/src/pages/Claim/Card/ClaimLines.vue @@ -191,29 +191,29 @@ function showImportDialog() { } diff --git a/src/pages/Customer/Card/CustomerSummaryDialog.vue b/src/pages/Customer/Card/CustomerSummaryDialog.vue index d40d99d1b..d9571ac54 100644 --- a/src/pages/Customer/Card/CustomerSummaryDialog.vue +++ b/src/pages/Customer/Card/CustomerSummaryDialog.vue @@ -15,9 +15,9 @@ const { dialogRef, onDialogHide } = useDialogPluginComponent(); diff --git a/src/pages/InvoiceOut/Card/InvoiceOutSummary.vue b/src/pages/InvoiceOut/Card/InvoiceOutSummary.vue index 2df449f2a..71ec773e9 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutSummary.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutSummary.vue @@ -200,10 +200,10 @@ const ticketsColumns = ref([ margin: 0 auto; .q-slider { - .q-slider__markerLabels:nth-child(1) { + .q-slider__marker-labels:nth-child(1) { transform: none; } - .q-slider__markerLabels:nth-child(2) { + .q-slider__marker-labels:nth-child(2) { transform: none; left: auto !important; right: 0%; diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index 2792b7dd5..945a98925 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -646,8 +646,8 @@ async function changeState(value) { } .summary { - .QList { - .QItem__label--header { + .q-list { + .q-item__label--header { display: flex; justify-content: space-between; @@ -672,7 +672,7 @@ async function changeState(value) { } .q-table__container { text-align: left; - .QIcon { + .q-icon { padding: 2%; } } diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index 82356cabd..7fc4802c6 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -242,8 +242,8 @@ function sipExtension() { } .summary { - .QList { - .QItem__label--header { + .q-list { + .q-item__label--header { display: flex; justify-content: space-between; @@ -270,10 +270,10 @@ function sipExtension() { margin: 0 auto; .q-slider { - .q-slider__markerLabels:nth-child(1) { + .q-slider__marker-labels:nth-child(1) { transform: none; } - .q-slider__markerLabels:nth-child(2) { + .q-slider__marker-labels:nth-child(2) { transform: none; left: auto !important; right: 0%; From dfac909f8db4d164bdea57297cec6cb477ff6cef Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 11 Apr 2023 14:53:08 +0200 Subject: [PATCH 14/14] Renamed component --- test/vitest/__tests__/components/Paginate.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/vitest/__tests__/components/Paginate.spec.js b/test/vitest/__tests__/components/Paginate.spec.js index 723c98476..af9fb41a1 100644 --- a/test/vitest/__tests__/components/Paginate.spec.js +++ b/test/vitest/__tests__/components/Paginate.spec.js @@ -1,8 +1,8 @@ import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest'; import { createWrapper, axios } from 'app/test/vitest/helper'; -import Paginate from 'src/components/ui/VnPaginate.vue'; +import VnPaginate from 'src/components/ui/VnPaginate.vue'; -describe('Paginate', () => { +describe('VnPaginate', () => { const expectedUrl = '/api/customers'; let vm; @@ -15,7 +15,7 @@ describe('Paginate', () => { limit: 3, }, }; - vm = createWrapper(Paginate, options).vm; + vm = createWrapper(VnPaginate, options).vm; }); afterEach(() => {