From fd1f46ffc61ac0426f6347374816927af6d7e6b8 Mon Sep 17 00:00:00 2001 From: pablone Date: Thu, 7 Dec 2023 12:51:47 +0100 Subject: [PATCH] feat(claimList): refs #6475 claimList add links --- src/components/ui/CardDescriptor.vue | 12 ++-- src/pages/Claim/ClaimList.vue | 58 ++++++++++++++----- .../Customer/Card/CustomerDescriptor.vue | 5 ++ .../Customer/Card/CustomerDescriptorProxy.vue | 7 ++- 4 files changed, 59 insertions(+), 23 deletions(-) diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index cfba0dfe1..2e706a56c 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n'; import { useQuasar } from 'quasar'; import axios from 'axios'; import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue'; -import CustomerSummaryDialog from '../../pages/Customer/Card/CustomerSummaryDialog.vue'; + const $props = defineProps({ url: { type: String, @@ -26,9 +26,9 @@ const $props = defineProps({ type: Number, default: 0, }, - preview: { - type: Boolean, - default: false, + summary: { + type: Object, + default: null, }, }); const quasar = useQuasar(); @@ -60,7 +60,7 @@ watch($props, async () => { function viewSummary(id) { quasar.dialog({ - component: CustomerSummaryDialog, + component: $props.summary, componentProps: { id, }, @@ -81,7 +81,7 @@ function viewSummary(id) { icon="preview" color="white" class="link" - v-if="preview" + v-if="summary" > {{ t('components.smartCard.openSummary') }} diff --git a/src/pages/Claim/ClaimList.vue b/src/pages/Claim/ClaimList.vue index 79afc7e91..cbc51174f 100644 --- a/src/pages/Claim/ClaimList.vue +++ b/src/pages/Claim/ClaimList.vue @@ -5,12 +5,13 @@ import { useQuasar } from 'quasar'; import { useStateStore } from 'stores/useStateStore'; import { toDate } from 'filters/index'; import VnPaginate from 'src/components/ui/VnPaginate.vue'; -import ClaimSummaryDialog from './Card/ClaimSummaryDialog.vue'; -import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; import ClaimFilter from './ClaimFilter.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import CardList from 'src/components/ui/CardList.vue'; +import ClaimSummaryDialog from './Card/ClaimSummaryDialog.vue'; +import WorkerSummaryDialog from 'src/pages/Worker/Card/WorkerSummaryDialog.vue'; +import CustomerSummaryDialog from 'src/pages/Customer/Card/CustomerSummaryDialog.vue'; const stateStore = useStateStore(); const router = useRouter(); @@ -27,9 +28,25 @@ function navigate(id) { router.push({ path: `/claim/${id}` }); } -function viewSummary(id) { +function viewSummary(id, summaryDialog) { + let dialogComponent; + + switch (summaryDialog) { + case 'worker': + dialogComponent = WorkerSummaryDialog; + break; + case 'customer': + dialogComponent = CustomerSummaryDialog; + break; + case 'claim': + dialogComponent = ClaimSummaryDialog; + break; + default: + return; + } + quasar.dialog({ - component: ClaimSummaryDialog, + component: dialogComponent, componentProps: { id, }, @@ -86,12 +103,24 @@ function viewSummary(id) { + @click.stop="viewSummary(row.clientFk, 'customer')" + > + + + @click.stop="viewSummary(row.workerFk, 'worker')" + > + + - + {{ t('components.smartCard.openSummary') }} - - - {{ t('components.smartCard.viewDescription') }} - - - - diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index 23e6228ee..4a793404d 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -14,6 +14,10 @@ const $props = defineProps({ required: false, default: null, }, + summary: { + type: Object, + default: null, + }, }); const route = useRoute(); @@ -34,6 +38,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity :title="data.title" :subtitle="data.subtitle" @on-fetch="setData" + :summary="$props.summary" >