From 6ae38d26119baf867d039ee29682ed26f360072f Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 29 Apr 2024 09:49:06 +0200 Subject: [PATCH 1/6] refactor: refs #6887 pending claim changes --- src/i18n/locale/en.yml | 3 +- src/i18n/locale/es.yml | 3 +- src/pages/Claim/Card/ClaimDescriptor.vue | 14 +- src/pages/Claim/Card/ClaimSummary.vue | 45 ++++++- src/pages/Zone/Card/ZoneDescriptor.vue | 127 ++++++++++++++++++ .../Zone/Card/ZoneDescriptorMenuItems.vue | 108 +++++++++++++++ src/pages/Zone/Card/ZoneDescriptorProxy.vue | 16 +++ 7 files changed, 309 insertions(+), 7 deletions(-) create mode 100644 src/pages/Zone/Card/ZoneDescriptor.vue create mode 100644 src/pages/Zone/Card/ZoneDescriptorMenuItems.vue create mode 100644 src/pages/Zone/Card/ZoneDescriptorProxy.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index ff57bf968..942018b84 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -513,7 +513,7 @@ claim: records: records card: claimId: Claim ID - assignedTo: Assigned + attendedBy: Attended by created: Created state: State ticketId: Ticket ID @@ -551,6 +551,7 @@ claim: responsible: Responsible worker: Worker redelivery: Redelivery + changeState: Change state basicData: customer: Customer assignedTo: Assigned diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f9278a9b0..3de5af50c 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -511,7 +511,7 @@ claim: records: registros card: claimId: ID reclamación - assignedTo: Asignada a + attendedBy: Atendida por created: Creada state: Estado ticketId: ID ticket @@ -549,6 +549,7 @@ claim: responsible: Responsable worker: Trabajador redelivery: Devolución + changeState: Cambiar estado basicData: customer: Cliente assignedTo: Asignada a diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue index 968f1e294..3b5dd82b8 100644 --- a/src/pages/Claim/Card/ClaimDescriptor.vue +++ b/src/pages/Claim/Card/ClaimDescriptor.vue @@ -11,6 +11,7 @@ import VnLv from 'src/components/ui/VnLv.vue'; import useCardDescription from 'src/composables/useCardDescription'; import VnUserLink from 'src/components/ui/VnUserLink.vue'; import { getUrl } from 'src/composables/getUrl'; +import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue'; const $props = defineProps({ id: { @@ -127,17 +128,24 @@ onMounted(async () => { - + + + import { onMounted, ref, computed } from 'vue'; -import { useRoute } from 'vue-router'; +import { useRoute, useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { toDate, toCurrency } from 'src/filters'; import CardSummary from 'components/ui/CardSummary.vue'; @@ -13,8 +13,10 @@ import VnUserLink from 'src/components/ui/VnUserLink.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; +import axios from 'axios'; const route = useRoute(); +const router = useRouter(); const { t } = useI18n(); const { getTokenMultimedia } = useSession(); const token = getTokenMultimedia(); @@ -27,7 +29,7 @@ const $props = defineProps({ }); const entityId = computed(() => $props.id || route.params.id); - +const ClaimStates = ref([]); const claimUrl = ref(); const salixUrl = ref(); const claimDmsRef = ref(); @@ -162,6 +164,10 @@ function openDialog(dmsId) { multimediaSlide.value = dmsId; multimediaDialog.value = true; } +async function changeState(value) { + await axios.patch(`Claims/updateClaim/${entityId.value}`, { claimStateFk: value }); + router.go(route.fullPath); +} +