From f230fcbca2a1ca7cc3e0ea145f5533468afa438f Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 17 Oct 2023 17:32:47 +0200 Subject: [PATCH 01/18] refs #6157 claimAction --- 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 | 454 +++++++++++++++++++++++ src/pages/Claim/Card/ClaimCard.vue | 59 ++- src/pages/Ticket/TicketList.vue | 2 +- src/router/modules/claim.js | 10 + 8 files changed, 526 insertions(+), 16 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 55395f260..d3c073c6e 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..c171d6456 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: 'Action', }, 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..77f1dab40 --- /dev/null +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -0,0 +1,454 @@ + + + + + +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 @@ - + diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js index 9df1dd64e..1dfd75cff 100644 --- a/src/router/modules/claim.js +++ b/src/router/modules/claim.js @@ -19,6 +19,7 @@ export default { 'ClaimLog', 'ClaimNotes', 'ClaimDevelopment', + 'ClaimAction', ], }, children: [ @@ -130,6 +131,15 @@ export default { }, component: () => import('src/pages/Claim/Card/ClaimNotes.vue'), }, + { + name: 'ClaimAction', + path: 'action', + meta: { + title: 'action', + icon: 'vn:actions', + }, + component: () => import('src/pages/Claim/Card/ClaimAction.vue'), + }, ], }, ], From 841ed5d81a39747a5b3e702faea8f06b56abbaf0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 19 Oct 2023 14:29:38 +0200 Subject: [PATCH 02/18] refs #6157 change hide, descriptor, development --- src/components/common/VnSelectFilter.vue | 1 - src/components/ui/CardDescriptor.vue | 8 +++----- src/pages/Claim/Card/ClaimAction.vue | 22 ++++++++++++++-------- src/pages/Claim/Card/ClaimDevelopment.vue | 2 ++ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index d3c073c6e..0ceabc87d 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -81,7 +81,6 @@ const value = computed({ map-options use-input @filter="filterHandler" - hide-selected fill-input ref="vnSelectRef" > diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 2dd531f20..8976795fb 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -2,7 +2,6 @@ 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({ @@ -27,19 +26,18 @@ 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(null); let lastUrl = ref(null); onMounted(async () => { - entity.value = await store.data; + await fetch(); }); const emit = defineEmits(['onFetch']); + async function fetch() { lastUrl.value = $props.url; const params = {}; diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index 77f1dab40..f2031cf2e 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -92,7 +92,7 @@ const columns = computed(() => [ name: 'delete', }, ]); -console.log(claimData.store.data); + watchEffect(() => { if (rows.value.length) { destinations.value = rows.value.map((row) => @@ -103,6 +103,7 @@ watchEffect(() => { }); function getDestination(destinationId) { + console.log(destinationTypes.value.find((type) => type.id == destinationId)); return destinationTypes.value.find((type) => type.id == destinationId); } @@ -205,6 +206,17 @@ async function updateDestinations(claimDestinationFk) { @click="dialog = !dialog" /> +
@@ -248,9 +260,6 @@ async function updateDestinations(claimDestinationFk) { :options="destinationTypes" option-value="id" option-label="description" - @update:model-value=" - (value) => updateDestination(value, rows[rowIndex]) - " /> @@ -317,11 +326,10 @@ async function updateDestinations(claimDestinationFk) { -