From 1a31de7ae96da4f84ae3646d1d9190cfe01e6369 Mon Sep 17 00:00:00 2001 From: alexandre Date: Tue, 18 Apr 2023 10:13:19 +0200 Subject: [PATCH] refs #4800 added sections --- src/i18n/en/index.js | 8 + src/i18n/es/index.js | 8 + src/pages/Claim/Card/ClaimSummary.vue | 239 +++++++++++++++++++++++++- 3 files changed, 253 insertions(+), 2 deletions(-) diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 25cbe8c8b..86195c4f3 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -288,6 +288,14 @@ export default { responsibility: 'Responsibility', company: 'Company', person: 'Employee/Customer', + notes: 'Notes', + photos: 'Photos', + development: 'Development', + reason: 'Reason', + result: 'Result', + responsible: 'Responsible', + worker: 'Worker', + redelivery: 'Redelivery' }, basicData: { customer: 'Customer', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 1add6bad7..2ef817786 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -287,6 +287,14 @@ export default { responsibility: 'Responsabilidad', company: 'Empresa', person: 'Comercial/Cliente', + notes: 'Observaciones', + photos: 'Fotos', + development: 'Trazabilidad', + reason: 'Motivo', + result: 'Consecuencias', + responsible: 'Responsable', + worker: 'Trabajador', + redelivery: 'DevoluciĆ³n' }, basicData: { customer: 'Cliente', diff --git a/src/pages/Claim/Card/ClaimSummary.vue b/src/pages/Claim/Card/ClaimSummary.vue index f3180b13d..ac464d125 100644 --- a/src/pages/Claim/Card/ClaimSummary.vue +++ b/src/pages/Claim/Card/ClaimSummary.vue @@ -5,9 +5,13 @@ import { useI18n } from 'vue-i18n'; import { toDate, toCurrency } from 'src/filters'; import CardSummary from 'components/ui/CardSummary.vue'; import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue'; +import FetchData from 'components/FetchData.vue'; +import { useSession } from 'src/composables/useSession'; const route = useRoute(); const { t } = useI18n(); +const session = useSession(); +const token = session.getToken(); const $props = defineProps({ id: { @@ -76,14 +80,82 @@ function stateColor(code) { if (code === 'managed') return 'orange'; if (code === 'resolved') return 'red'; } + +const developmentColumns = ref([ + { + name: 'claimReason', + label: 'claim.summary.reason', + field: (row) => row.claimReason.description, + sortable: true, + }, + { + name: 'claimResult', + label: 'claim.summary.result', + field: (row) => row.claimResult.description, + sortable: true, + }, + { + name: 'claimResponsible', + label: 'claim.summary.responsible', + field: (row) => row.claimResponsible.description, + sortable: true, + }, + { + name: 'worker', + label: 'claim.summary.worker', + field: (row) => row.worker.user.nickname, + sortable: true, + }, + { + name: 'claimRedelivery', + label: 'claim.summary.redelivery', + field: (row) => row.claimRedelivery.description, + sortable: true, + }, +]); +const claimDms = ref([]); +const multimediaDialog = ref(); +const multimediaSlide = ref(); +const claimDmsFilter = ref({ + include: [ + { + relation: 'dms', + }, + ], + where: { claimFk: entityId.value }, +}); + +function setClaimDms(data) { + if (!data) return; + + data.forEach((media) => { + claimDms.value.push({ + isVideo: media.dms.contentType == 'video/mp4', + url: `/api/Claims/${media.dmsFk}/downloadFile?access_token=${token}`, + dmsFk: media.dmsFk, + }); + }); +} + +function openDialog(dmsId) { + multimediaSlide.value = dmsId; + multimediaDialog.value = true; +}