From 7e660466fddab0e7dcd2a16bfab1ca76913d9c00 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 17 Oct 2023 12:53:04 +0200 Subject: [PATCH] ref #6157 front created back wip --- src/components/common/VnSelectFilter.vue | 2 +- src/components/ui/CardDescriptor.vue | 13 +- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + src/pages/Claim/Card/ClaimAction.vue | 397 +++++++++++++++++++++++ src/pages/Claim/Card/ClaimCard.vue | 59 +++- src/router/modules/claim.js | 10 + 7 files changed, 468 insertions(+), 15 deletions(-) create mode 100644 src/pages/Claim/Card/ClaimAction.vue diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 9ccb94e33..53bd8deb2 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -4,7 +4,7 @@ const emit = defineEmits(['update:modelValue', 'update:options']); const $props = defineProps({ modelValue: { - type: [String, Number], + type: [String, Number, Object], default: null, }, options: { diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index f63b75de6..2dd531f20 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -2,6 +2,7 @@ import { onMounted, useSlots, ref, watch } from 'vue'; import { useI18n } from 'vue-i18n'; import axios from 'axios'; +import { useArrayData } from 'src/composables/useArrayData'; import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue'; const $props = defineProps({ @@ -26,18 +27,21 @@ const $props = defineProps({ default: 0, }, }); - +const arrayData = useArrayData('claimData'); +const store = arrayData.store; +console.log('eee', store.data); const slots = useSlots(); const { t } = useI18n(); -const entity = ref(); +const entity = ref(null); +let lastUrl = ref(null); onMounted(async () => { - await fetch(); + entity.value = await store.data; }); const emit = defineEmits(['onFetch']); - async function fetch() { + lastUrl.value = $props.url; const params = {}; if ($props.filter) params.filter = JSON.stringify($props.filter); @@ -49,6 +53,7 @@ async function fetch() { } watch($props, async () => { + if (lastUrl.value == $props.url) return; entity.value = null; await fetch(); }); diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index cfd20716b..e6d071c73 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -269,6 +269,7 @@ export default { development: 'Development', log: 'Audit logs', notes: 'Notes', + action: 'Action', }, list: { customer: 'Customer', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 532c1bb3b..ec8346fda 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -268,6 +268,7 @@ export default { photos: 'Fotos', log: 'Registros de auditoría', notes: 'Notas', + action: 'Acción', }, list: { customer: 'Cliente', diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue new file mode 100644 index 000000000..0f936f17e --- /dev/null +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -0,0 +1,397 @@ + + + + + +en: + mana: Is paid with mana + dialog title: Change destination to all selected rows +es: + mana: Cargado al maná + Delivered: Descripción + Quantity: Cantidad + Claimed: Rec + Description: Description + Price: Precio + Discount: Dto. + Destination: Destino + Landed: F.entrega + Remove line: Eliminar línea + Total claimed: Total reclamado + Regularize: Regularizar + Change destination: Cambiar destino + Import claim: Importar reclamación + dialog title: Cambiar destino en todas las filas seleccionadas + Remove: Eliminar + diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index 03b9889f0..40a3bcd7a 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -1,17 +1,58 @@