From 2340aaba0b48f8114d9c64ce4feb4d21a3d26585 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 3 Jul 2024 14:39:15 +0200 Subject: [PATCH 01/34] feat: list use vnTable, fix descriptor --- src/components/ui/CardDescriptor.vue | 7 +- src/i18n/locale/en.yml | 63 ----- src/i18n/locale/es.yml | 63 ----- src/pages/Claim/Card/ClaimAction.vue | 8 +- src/pages/Claim/Card/ClaimActionTable.vue | 99 ++++++++ src/pages/Claim/Card/ClaimBasicData.vue | 17 +- src/pages/Claim/Card/ClaimDescriptor.vue | 27 +-- src/pages/Claim/Card/ClaimPhoto.vue | 8 +- src/pages/Claim/ClaimFilter.vue | 277 +++++++++------------- src/pages/Claim/ClaimList.vue | 174 +++++++------- src/pages/Claim/locale/en.yml | 46 ++++ src/pages/Claim/locale/es.yml | 46 ++++ src/pages/Order/Card/OrderDescriptor.vue | 2 +- 13 files changed, 419 insertions(+), 418 deletions(-) create mode 100644 src/pages/Claim/Card/ClaimActionTable.vue create mode 100644 src/pages/Claim/locale/en.yml diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 2bb5234ad..e4e007567 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -56,7 +56,12 @@ onBeforeMount(async () => { skip: 0, }); store = arrayData.store; - entity = computed(() => (Array.isArray(store.data) ? store.data[0] : store.data)); + entity = computed(() => { + const data = Array.isArray(store.data) ? store.data[0] : store.data; + emit('onFetch', data); + return data; + }); + // It enables to load data only once if the module is the same as the dataKey if (!isSameDataKey.value || !route.params.id) await getData(); watch( diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e4ef31f8e..766463c1e 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -627,69 +627,6 @@ ticket: landed: Landed warehouse: Warehouse agency: Agency -claim: - list: - customer: Customer - assignedTo: Assigned - created: Created - state: State - rmaList: - code: Code - records: records - card: - claimId: Claim ID - attendedBy: Attended by - created: Created - state: State - ticketId: Ticket ID - customerSummary: Customer summary - claimedTicket: Claimed ticket - saleTracking: Sale tracking - ticketTracking: Ticket tracking - commercial: Commercial - province: Province - zone: Zone - customerId: client ID - summary: - customer: Customer - assignedTo: Assigned - attendedBy: Attended by - created: Created - state: State - details: Details - item: Item - landed: Landed - quantity: Quantity - claimed: Claimed - price: Price - discount: Discount - total: Total - actions: Actions - responsibility: Responsibility - company: Company - person: Employee/Customer - notes: Notes - photos: Photos - development: Development - reason: Reason - result: Result - responsible: Responsible - worker: Worker - redelivery: Redelivery - changeState: Change state - basicData: - customer: Customer - assignedTo: Assigned - created: Created - state: State - pickup: Pick up - null: No - agency: Agency - delivery: Delivery - photo: - fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}' - noData: 'There are no images/videos, click here or drag and drop the file' - dragDrop: Drag and drop it here invoiceOut: list: ref: Reference diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index d02f47afd..585ced8b5 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -625,69 +625,6 @@ ticket: landed: F. entrega warehouse: Almacén agency: Agencia -claim: - list: - customer: Cliente - assignedTo: Asignada a - created: Creada - state: Estado - rmaList: - code: Código - records: registros - card: - claimId: ID reclamación - attendedBy: Atendida por - created: Creada - state: Estado - ticketId: ID ticket - customerSummary: Resumen del cliente - claimedTicket: Ticket reclamado - saleTracking: Líneas preparadas - ticketTracking: Estados del ticket - commercial: Comercial - province: Provincia - zone: Zona - customerId: ID del cliente - summary: - customer: Cliente - assignedTo: Asignada a - attendedBy: Atendida por - created: Creada - state: Estado - details: Detalles - item: Artículo - landed: Entregado - quantity: Cantidad - claimed: Reclamado - price: Precio - discount: Descuento - total: Total - actions: Acciones - responsibility: Responsabilidad - company: Empresa - person: Comercial/Cliente - notes: Observaciones - photos: Fotos - development: Trazabilidad - reason: Motivo - result: Consecuencias - responsible: Responsable - worker: Trabajador - redelivery: Devolución - changeState: Cambiar estado - basicData: - customer: Cliente - assignedTo: Asignada a - created: Creada - state: Estado - pickup: Recogida - null: No - agency: Agencia - delivery: Reparto - photo: - fileDescription: 'Reclamacion ID {claimId} del cliente {clientName} id {clientId}' - noData: No hay imágenes/videos haz click aquí o arrastra y suelta el archivo - dragDrop: Arrástralo y sueltalo aquí invoiceOut: list: ref: Referencia diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index a24a2a15e..e64eab81d 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -33,8 +33,8 @@ const DEFAULT_MAX_RESPONSABILITY = 5; const DEFAULT_MIN_RESPONSABILITY = 1; const arrayData = useArrayData('claimData'); const marker_labels = [ - { value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.summary.company') }, - { value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.summary.person') }, + { value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.company') }, + { value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.person') }, ]; const multiplicatorValue = ref(); const loading = ref(false); @@ -209,12 +209,12 @@ async function post(query, params) {

- {{ t('claim.summary.actions') }} + {{ t('claim.actions') }}

+import { ref, computed, onMounted } from 'vue'; +import { useQuasar } from 'quasar'; +import { useI18n } from 'vue-i18n'; +import { useRoute } from 'vue-router'; +import axios from 'axios'; +import { useStateStore } from 'src/stores/useStateStore'; +import { toDate, toPercentage, toCurrency } from 'filters/index'; +import VnTable from 'src/components/VnTable/VnTable.vue'; +import FetchData from 'src/components/FetchData.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; +import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; +import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; +import { useArrayData } from 'composables/useArrayData'; + +const { t } = useI18n(); +const quasar = useQuasar(); + +const $props = defineProps({ + id: { + type: Number, + required: true, + }, +}); + +const columns = computed(() => [ + { + name: 'id', + label: t('Id item'), + field: (row) => row.itemFk, + }, + { + name: 'ticketFk', + label: t('Ticket'), + align: 'center', + }, + { + name: 'destination', + label: t('Destination'), + field: (row) => row.claimDestinationFk, + align: 'left', + }, + { + name: 'Landed', + label: t('Landed'), + field: (row) => toDate(row.landed), + }, + { + name: 'quantity', + label: t('Quantity'), + field: (row) => row.quantity, + }, + { + name: 'concept', + label: t('Description'), + field: (row) => row.concept, + align: 'left', + }, + { + name: 'price', + label: t('Price'), + field: (row) => row.price, + format: (value) => value, + align: 'center', + }, + { + name: 'discount', + label: t('Discount'), + field: (row) => row.discount, + format: (value) => toPercentage(value / 100), + align: 'left', + }, + { + name: 'total', + label: t('Total'), + field: (row) => row.total, + format: (value) => value, + align: 'center', + }, + { + name: 'delete', + }, +]); + + diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 4656980d9..de0dc50c3 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -30,7 +30,7 @@ function setClaimStates(data) { } async function getEnumValues() { - optionsList.value = [{ id: null, description: t('claim.basicData.null') }]; + optionsList.value = [{ id: null, description: t('claim.null') }]; const { data } = await axios.get(`Applications/get-enum-values`, { params: { schema: 'vn', @@ -39,7 +39,7 @@ async function getEnumValues() { }, }); for (let value of data) - optionsList.value.push({ id: value, description: t(`claim.basicData.${value}`) }); + optionsList.value.push({ id: value, description: t(`claim.${value}`) }); } getEnumValues(); @@ -77,17 +77,14 @@ const statesFilter = { - + { From 317746b1f5ed078064be819ef0c71d9b59c60ee6 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 5 Jul 2024 07:10:41 +0200 Subject: [PATCH 02/34] hotfix: refs #6769 Changes --- src/pages/Item/Card/ItemDiary.vue | 71 +++++++++++++++---- src/pages/Item/locale/en.yml | 4 +- src/pages/Item/locale/es.yml | 4 +- src/pages/Order/Card/OrderDescriptorProxy.vue | 17 +++++ 4 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 src/pages/Order/Card/OrderDescriptorProxy.vue diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue index c2687e0fd..9e2deef1c 100644 --- a/src/pages/Item/Card/ItemDiary.vue +++ b/src/pages/Item/Card/ItemDiary.vue @@ -5,7 +5,9 @@ import { useRoute } from 'vue-router'; import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue'; +import OrderDescriptorProxy from 'src/pages/Order/Card/OrderDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; +import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; import FetchData from 'components/FetchData.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; @@ -45,8 +47,8 @@ const columns = computed(() => [ align: 'left', }, { - label: t('itemDiary.id'), - name: 'id', + label: t('itemDiary.origin'), + name: 'origin', align: 'left', }, { @@ -65,8 +67,8 @@ const columns = computed(() => [ }, { - label: t('itemDiary.client'), - name: 'client', + label: t('itemDiary.entity'), + name: 'entity', align: 'left', format: (val) => dashIfEmpty(val), }, @@ -111,10 +113,30 @@ const getBadgeAttrs = (_date) => { return attrs; }; -const getIdDescriptor = (row) => { - let descriptor = EntryDescriptorProxy; - if (row.isTicket) descriptor = TicketDescriptorProxy; - return descriptor; +const originTypeMap = { + entry: { + descriptor: EntryDescriptorProxy, + icon: 'vn:entry', + }, + ticket: { + descriptor: TicketDescriptorProxy, + icon: 'vn:ticket', + }, + order: { + descriptor: OrderDescriptorProxy, + icon: 'vn:basket', + }, +}; + +const entityTypeMap = { + client: { + descriptor: CustomerDescriptorProxy, + icon: 'vn:client', + }, + supplier: { + descriptor: SupplierDescriptorProxy, + icon: 'vn:supplier', + }, }; onMounted(async () => { @@ -206,10 +228,10 @@ onUnmounted(() => (stateStore.rightDrawer = false)); -