From b12ab288da105f9a5668345cf7e180122ba51d62 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 8 Aug 2023 10:24:01 +0200 Subject: [PATCH 1/8] refs #5986 WIP descriptors replaced --- src/components/ui/CardDescriptor.vue | 124 +++++++++++++++--- src/components/ui/VnLv.vue | 63 +++++---- src/composables/useCardDescription.js | 8 ++ src/css/quasar.variables.scss | 19 +++ src/i18n/en/index.js | 11 +- src/i18n/es/index.js | 11 +- src/pages/Claim/Card/ClaimDescriptor.vue | 120 ++++++++++------- .../Customer/Card/CustomerDescriptor.vue | 102 +++++--------- .../InvoiceOut/Card/InvoiceOutDescriptor.vue | 66 ++++------ src/pages/Ticket/Card/TicketDescriptor.vue | 117 +++++++---------- src/pages/Ticket/Card/TicketSummary.vue | 2 +- src/pages/Ticket/TicketList.vue | 6 +- src/pages/Worker/Card/WorkerDescriptor.vue | 70 +++------- 13 files changed, 389 insertions(+), 330 deletions(-) create mode 100644 src/composables/useCardDescription.js diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 54123d087..afdc2d108 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n'; import axios from 'axios'; import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue'; -const props = defineProps({ +const $props = defineProps({ url: { type: String, default: '', @@ -17,6 +17,14 @@ const props = defineProps({ type: String, required: true, }, + title: { + type: String, + default: '', + }, + subtitle: { + type: Number, + default: 0, + }, }); const slots = useSlots(); @@ -30,15 +38,15 @@ const entity = ref(); async function fetch() { const params = {}; - if (props.filter) params.filter = JSON.stringify(props.filter); + if ($props.filter) params.filter = JSON.stringify($props.filter); - const { data } = await axios.get(props.url, { params }); + const { data } = await axios.get($props.url, { params }); entity.value = data; emit('onFetch', data); } -watch(props, async () => { +watch($props, async () => { entity.value = null; await fetch(); }); @@ -49,14 +57,30 @@ watch(props, async () => { @@ -110,24 +148,74 @@ watch(props, async () => { diff --git a/src/components/ui/VnLv.vue b/src/components/ui/VnLv.vue index b0b0316ad..21205e63b 100644 --- a/src/components/ui/VnLv.vue +++ b/src/components/ui/VnLv.vue @@ -1,36 +1,45 @@ diff --git a/src/composables/useCardDescription.js b/src/composables/useCardDescription.js new file mode 100644 index 000000000..d064da0d7 --- /dev/null +++ b/src/composables/useCardDescription.js @@ -0,0 +1,8 @@ +export default function useCardDescription(title, subtitle) { + const getTitle = (title) => title; + const getSubtitle = (subtitle) => subtitle; + return { + title: getTitle(title), + subtitle: getSubtitle(subtitle), + }; +} diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index 6ebf7a7a7..14819f8dd 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -21,6 +21,23 @@ $negative: #c10015; $info: #31ccec; $warning: #f2c037; +// Pendiente de cuadrar con la base de datos +$success: $positive; +$alert: $negative; + +.bg-success { + background-color: $positive; +} +.bg-notice { + background-color: $info; +} +.text-notice { + color: $info; +} +.bg-alert { + background-color: $negative; +} + $color-spacer-light: rgba(255, 255, 255, 0.12); $color-spacer: rgba(255, 255, 255, 0.3); $border-thin-light: 1px solid $color-spacer-light; @@ -29,3 +46,5 @@ $dark-shadow-color: #000; $dark: #292929; $layout-shadow-dark: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0px 10px rgba(0, 0, 0, 0.24); $spacing-md: 16px; + +$label-color: rgba(255, 255, 255, 0.6); diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index a43c5fe7c..c6ef905c3 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -268,6 +268,9 @@ export default { ticketId: 'Ticket ID', customerSummary: 'Customer summary', claimedTicket: 'Claimed ticket', + commercial: 'Commercial', + province: 'Province', + zone: 'Zone', }, summary: { customer: 'Customer', @@ -295,7 +298,7 @@ export default { result: 'Result', responsible: 'Responsible', worker: 'Worker', - redelivery: 'Redelivery' + redelivery: 'Redelivery', }, basicData: { customer: 'Customer', @@ -411,7 +414,7 @@ export default { wagonEdit: 'Edit wagon', typesList: 'Types List', typeCreate: 'Create type', - typeEdit: 'Edit type' + typeEdit: 'Edit type', }, type: { name: 'Name', @@ -431,7 +434,7 @@ export default { plate: 'Plate', volume: 'Volume', type: 'Type', - label: 'Label' + label: 'Label', }, warnings: { noData: 'No data available', @@ -444,7 +447,7 @@ export default { minHeightBetweenTrays: 'The minimum height between trays is ', maxWagonHeight: 'The maximum height of the wagon is ', uncompleteTrays: 'There are incomplete trays', - } + }, }, components: { topbar: {}, diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 6328c8f5d..4129acc76 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -63,7 +63,7 @@ export default { webPayments: 'Pagos Web', createCustomer: 'Crear cliente', basicData: 'Datos básicos', - summary: 'Resumen' + summary: 'Resumen', }, list: { phone: 'Teléfono', @@ -267,6 +267,9 @@ export default { ticketId: 'ID ticket', customerSummary: 'Resumen del cliente', claimedTicket: 'Ticket reclamado', + commercial: 'Comercial', + province: 'Provincia', + zone: 'Zone', }, summary: { customer: 'Cliente', @@ -294,7 +297,7 @@ export default { result: 'Consecuencias', responsible: 'Responsable', worker: 'Trabajador', - redelivery: 'Devolución' + redelivery: 'Devolución', }, basicData: { customer: 'Cliente', @@ -411,7 +414,7 @@ export default { wagonEdit: 'Editar tipo', typesList: 'Listado tipos', typeCreate: 'Crear tipo', - typeEdit: 'Editar tipo' + typeEdit: 'Editar tipo', }, type: { name: 'Nombre', @@ -444,7 +447,7 @@ export default { minHeightBetweenTrays: 'La distancia mínima entre bandejas es ', maxWagonHeight: 'La altura máxima del vagón es ', uncompleteTrays: 'Hay bandejas sin completar', - } + }, }, components: { topbar: {}, diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue index baba66e2a..bdb4cd557 100644 --- a/src/pages/Claim/Card/ClaimDescriptor.vue +++ b/src/pages/Claim/Card/ClaimDescriptor.vue @@ -1,12 +1,13 @@