From c0454ed3e81c1970bca5975920af73e9e63a9386 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 24 Oct 2022 08:48:53 +0200 Subject: [PATCH] Updated ticket module --- src/components/SkeletonSummary.vue | 57 +++ src/css/quasar.variables.scss | 2 +- src/filters/index.js | 2 + src/filters/toCurrency.js | 2 +- src/filters/toPercentage.js | 18 + src/i18n/en/index.js | 81 +++- src/i18n/es/index.js | 91 +++- src/pages/Claim/Card/ClaimCard.vue | 21 +- src/pages/Claim/Card/ClaimSummary.vue | 110 ++--- src/pages/Claim/ClaimList.vue | 6 +- src/pages/Customer/Card/CustomerCard.vue | 31 +- src/pages/Customer/Card/CustomerSummary.vue | 456 ++++++++++++++++---- src/pages/Ticket/Card/TicketCard.vue | 185 +++++++- src/pages/Ticket/Card/TicketSummary.vue | 0 src/pages/Ticket/TicketList.vue | 226 +++++----- src/router/modules/ticket.js | 11 +- 16 files changed, 1031 insertions(+), 268 deletions(-) create mode 100644 src/components/SkeletonSummary.vue create mode 100644 src/filters/toPercentage.js create mode 100644 src/pages/Ticket/Card/TicketSummary.vue diff --git a/src/components/SkeletonSummary.vue b/src/components/SkeletonSummary.vue new file mode 100644 index 000000000..34244d457 --- /dev/null +++ b/src/components/SkeletonSummary.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index dff10bed5..37f693da6 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -12,7 +12,7 @@ // to match your app's branding. // Tip: Use the "Theme Builder" on Quasar's documentation website. -$primary: #1976d2; +$primary: #ff9800; $secondary: #26a69a; $accent: #9c27b0; diff --git a/src/filters/index.js b/src/filters/index.js index cbe044219..459087e8e 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -1,9 +1,11 @@ import toLowerCase from './toLowerCase'; import toDate from './toDate'; import toCurrency from './toCurrency'; +import toPercentage from './toPercentage'; export { toLowerCase, toDate, toCurrency, + toPercentage, }; diff --git a/src/filters/toCurrency.js b/src/filters/toCurrency.js index 34586b5db..bbe93aa61 100644 --- a/src/filters/toCurrency.js +++ b/src/filters/toCurrency.js @@ -1,7 +1,7 @@ import { useI18n } from 'vue-i18n'; export default function (value, symbol = 'EUR', fractionSize = 2) { - if (!value) return; + if (value == null || value === '') return; const { locale } = useI18n(); diff --git a/src/filters/toPercentage.js b/src/filters/toPercentage.js new file mode 100644 index 000000000..d701cb9e7 --- /dev/null +++ b/src/filters/toPercentage.js @@ -0,0 +1,18 @@ +import { useI18n } from 'vue-i18n'; + +export default function (value, fractionSize = 2) { + if (value == null || value === '') return; + + const { locale } = useI18n(); + + const options = { + style: 'percent', + minimumFractionDigits: fractionSize, + maximumFractionDigits: fractionSize + }; + + return new Intl.NumberFormat(locale, options) + .format(parseFloat(value)); + + +} \ No newline at end of file diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index dd69cafe7..b7d89bb17 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -44,6 +44,7 @@ export default { customers: 'Customers', list: 'List', createCustomer: 'Create customer', + summary: 'Summary', basicData: 'Basic Data' }, list: { @@ -53,22 +54,75 @@ export default { moreOptions: 'More options' }, card: { + customerList: 'Customer list', customerId: 'Claim ID', salesPerson: 'Sales person', credit: 'Credit', securedCredit: 'Secured credit', payMethod: 'Pay method', - debt: 'Debt' + debt: 'Debt', + isDisabled: 'Customer is disabled', + isFrozen: 'Customer is frozen', + hasDebt: 'Customer has debt', + notChecked: 'Customer not checked', + noWebAccess: 'Web access is disabled' }, summary: { + basicData: 'Basic data', + fiscalAddress: 'Fiscal address', + fiscalData: 'Fiscal data', + billingData: 'Billing data', + consignee: 'Consignee', + businessData: 'Business data', + financialData: 'Financial data', customerId: 'Customer ID', - socialName: 'Social name', + name: 'Name', contact: 'Contact', phone: 'Phone', mobile: 'Mobile', email: 'Email', salesPerson: 'Sales person', contactChannel: 'Contact channel', + socialName: 'Social name', + fiscalId: 'Fiscal ID', + postcode: 'Postcode', + province: 'Province', + country: 'Country', + street: 'Address', + isEqualizated: 'Is equalizated', + isActive: 'Is active', + invoiceByAddress: 'Invoice by address', + verifiedData: 'Verified data', + hasToInvoice: 'Has to invoice', + notifyByEmail: 'Notify by email', + vies: 'VIES', + payMethod: 'Pay method', + bankAccount: 'Bank account', + dueDay: 'Due day', + hasLcr: 'Has LCR', + hasCoreVnl: 'Has core VNL', + hasB2BVnl: 'Has B2B VNL', + addressName: 'Address name', + addressCity: 'City', + addressStreet: 'Street', + username: 'Username', + webAccess: 'Web access', + totalGreuge: 'Total greuge', + mana: 'Mana', + priceIncreasingRate: 'Price increasing rate', + averageInvoiced: 'Average invoiced', + claimRate: 'Claming rate', + risk: 'Risk', + riskInfo: 'Invoices minus payments plus orders not yet invoiced', + credit: 'Credit', + creditInfo: `Company's maximum risk`, + securedCredit: 'Secured credit', + securedCreditInfo: `Solunion's maximum risk`, + balance: 'Balance', + balanceInfo: 'Invoices minus payments', + balanceDue: 'Balance due', + balanceDueInfo: 'Deviated invoices minus payments', + recoverySince: 'Recovery since', }, basicData: { socialName: 'Fiscal name', @@ -87,6 +141,24 @@ export default { list: 'List', createTicket: 'Create ticket', basicData: 'Basic Data' + }, + list: { + nickname: 'Nickname', + state: 'State', + shipped: 'Shipped', + landed: 'Landed', + salesPerson: 'Sales person', + total: 'Total' + }, + card: { + ticketId: 'Ticket ID', + state: 'State', + customerId: 'Customer ID', + salesPerson: 'Sales person', + agency: 'Agency', + shipped: 'Shipped', + warehouse: 'Warehouse', + customerCard: 'Customer card' } }, claim: { @@ -146,6 +218,11 @@ export default { noData: 'No data to display', openCard: 'View card', openSummary: 'Open summary' + }, + card: { + mainList: 'Main list', + summary: 'Summary', + moreOptions: 'More options', } }, }; diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index ec4420ba4..7fdf40a4d 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -44,6 +44,7 @@ export default { customers: 'Clientes', list: 'Listado', createCustomer: 'Crear cliente', + summary: 'Resumen', basicData: 'Datos básicos' }, list: { @@ -54,8 +55,73 @@ export default { }, card: { customerId: 'ID cliente', + salesPerson: 'Comercial', credit: 'Crédito', - securedCredit: 'Crédito asegurado' + securedCredit: 'Crédito asegurado', + payMethod: 'Método de pago', + debt: 'Riesgo', + isDisabled: 'El cliente está desactivado', + isFrozen: 'El cliente está congelado', + hasDebt: 'El cliente tiene riesgo', + notChecked: 'El cliente no está comprobado', + noWebAccess: 'El acceso web está desactivado' + }, + summary: { + basicData: 'Datos básicos', + fiscalAddress: 'Dirección fiscal', + fiscalData: 'Datos fiscales', + billingData: 'Datos de facturación', + consignee: 'Consignatario', + businessData: 'Datos comerciales', + financialData: 'Datos financieros', + customerId: 'ID cliente', + name: 'Nombre', + contact: 'Contacto', + phone: 'Teléfono', + mobile: 'Móvil', + email: 'Email', + salesPerson: 'Comercial', + contactChannel: 'Canal de contacto', + socialName: 'Razón social', + fiscalId: 'NIF/CIF', + postcode: 'Código postal', + province: 'Provincia', + country: 'País', + street: 'Calle', + isEqualizated: 'Equalizado', + isActive: 'Activo', + invoiceByAddress: 'Facturar por consignatario', + verifiedData: 'Datos verificados', + hasToInvoice: 'Facturar', + notifyByEmail: 'Notificar por email', + vies: 'VIES', + payMethod: 'Método de pago', + bankAccount: 'Cuenta bancaria', + dueDay: 'Día de pago', + hasLcr: 'Recibido LCR', + hasCoreVnl: 'Recibido core VNL', + hasB2BVnl: 'Recibido B2B VNL', + addressName: 'Nombre de la dirección', + addressCity: 'Ciudad', + addressStreet: 'Calle', + username: 'Usuario', + webAccess: 'Acceso web', + totalGreuge: 'Greuge total', + mana: 'Maná', + priceIncreasingRate: 'Ratio de incremento de precio', + averageInvoiced: 'Facturación media', + claimRate: 'Ratio de reclamaciones', + risk: 'Riesgo', + riskInfo: 'Facturas menos recibos mas pedidos sin facturar', + credit: 'Crédito', + creditInfo: `Riesgo máximo asumido por la empresa`, + securedCredit: 'Crédito asegurado', + securedCreditInfo: `Riesgo máximo asumido por Solunion`, + balance: 'Balance', + balanceInfo: 'Facturas menos recibos', + balanceDue: 'Saldo vencido', + balanceDueInfo: 'Facturas fuera de plazo menos recibos', + recoverySince: 'Recobro desde', }, basicData: { socialName: 'Nombre fiscal', @@ -74,6 +140,24 @@ export default { list: 'Listado', createTicket: 'Crear ticket', basicData: 'Datos básicos' + }, + list: { + nickname: 'Alias', + state: 'Estado', + shipped: 'Enviado', + landed: 'Entregado', + salesPerson: 'Comercial', + total: 'Total' + }, + card: { + ticketId: 'ID ticket', + state: 'Estado', + customerId: 'ID cliente', + salesPerson: 'Comercial', + agency: 'Agencia', + shipped: 'Enviado', + warehouse: 'Almacén', + customerCard: 'Ficha del cliente' } }, claim: { @@ -133,6 +217,11 @@ export default { noData: 'Sin datos que mostrar', openCard: 'Ver ficha', openSummary: 'Abrir detalles' + }, + card: { + mainList: 'Listado principal', + summary: 'Resumen', + moreOptions: 'Más opciones', } }, }; diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index 2bec36bf0..2a023cb0d 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -50,29 +50,32 @@ function stateColor(code) {
- Claim list + {{ t('components.card.mainList') }} - Claim summary + {{ t('components.card.summary') }} - More options - + {{ t('components.card.moreOptions') }} +
-
{{ claim.client.name }}
+ + {{ claim.client.name }} + {{ claim.client.name }} + {{ t('claim.card.claimId') }} @@ -158,6 +161,12 @@ function stateColor(code) { + + + + diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue new file mode 100644 index 000000000..e69de29bb diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index ebc291933..2683ed42a 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -1,110 +1,140 @@ + + + + + + + diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index e224ff824..a95c9c455 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -4,7 +4,6 @@ export default { name: 'Ticket', path: '/ticket', meta: { - roles: ['developer'], title: 'tickets', icon: 'vn:ticket' }, @@ -43,8 +42,16 @@ export default { name: 'TicketCard', path: ':id', component: () => import('src/pages/Ticket/Card/TicketCard.vue'), - redirect: { name: 'TicketBasicData' }, + redirect: { name: 'TicketSummary' }, children: [ + { + name: 'TicketSummary', + path: 'summary', + meta: { + title: 'summary' + }, + component: () => import('src/pages/Ticket/Card/TicketSummary.vue'), + }, { name: 'TicketBasicData', path: 'basic-data',