feat(claimList): refs #6475 claimList add links
This commit is contained in:
parent
0114de4db5
commit
fd1f46ffc6
|
@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
||||||
import CustomerSummaryDialog from '../../pages/Customer/Card/CustomerSummaryDialog.vue';
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -26,9 +26,9 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
preview: {
|
summary: {
|
||||||
type: Boolean,
|
type: Object,
|
||||||
default: false,
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -60,7 +60,7 @@ watch($props, async () => {
|
||||||
|
|
||||||
function viewSummary(id) {
|
function viewSummary(id) {
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: CustomerSummaryDialog,
|
component: $props.summary,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
|
@ -81,7 +81,7 @@ function viewSummary(id) {
|
||||||
icon="preview"
|
icon="preview"
|
||||||
color="white"
|
color="white"
|
||||||
class="link"
|
class="link"
|
||||||
v-if="preview"
|
v-if="summary"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('components.smartCard.openSummary') }}
|
{{ t('components.smartCard.openSummary') }}
|
||||||
|
|
|
@ -5,12 +5,13 @@ import { useQuasar } from 'quasar';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { toDate } from 'filters/index';
|
import { toDate } from 'filters/index';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
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 VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import ClaimFilter from './ClaimFilter.vue';
|
import ClaimFilter from './ClaimFilter.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import CardList from 'src/components/ui/CardList.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 stateStore = useStateStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -27,9 +28,25 @@ function navigate(id) {
|
||||||
router.push({ path: `/claim/${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({
|
quasar.dialog({
|
||||||
component: ClaimSummaryDialog,
|
component: dialogComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
|
@ -86,12 +103,24 @@ function viewSummary(id) {
|
||||||
<VnLv label="ID" :value="row.id" />
|
<VnLv label="ID" :value="row.id" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('claim.list.customer')"
|
:label="t('claim.list.customer')"
|
||||||
:value="row.clientName"
|
@click.stop="viewSummary(row.clientFk, 'customer')"
|
||||||
/>
|
>
|
||||||
|
<template #value>
|
||||||
|
<span class="link">
|
||||||
|
{{ row.clientName }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('claim.list.assignedTo')"
|
:label="t('claim.list.assignedTo')"
|
||||||
:value="row.workerName"
|
@click.stop="viewSummary(row.workerFk, 'worker')"
|
||||||
/>
|
>
|
||||||
|
<template #value>
|
||||||
|
<span class="link">
|
||||||
|
{{ row.workerName }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('claim.list.created')"
|
:label="t('claim.list.created')"
|
||||||
:value="toDate(row.created)"
|
:value="toDate(row.created)"
|
||||||
|
@ -118,18 +147,15 @@ function viewSummary(id) {
|
||||||
{{ t('components.smartCard.openCard') }}
|
{{ t('components.smartCard.openCard') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn flat icon="preview" @click.stop="viewSummary(row.id)">
|
<QBtn
|
||||||
|
flat
|
||||||
|
icon="preview"
|
||||||
|
@click.stop="viewSummary(row.id, 'claim')"
|
||||||
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('components.smartCard.openSummary') }}
|
{{ t('components.smartCard.openSummary') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn flat icon="vn:client" @click.stop>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('components.smartCard.viewDescription') }}
|
|
||||||
</QTooltip>
|
|
||||||
|
|
||||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
|
||||||
</QBtn>
|
|
||||||
</template>
|
</template>
|
||||||
</CardList>
|
</CardList>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -14,6 +14,10 @@ const $props = defineProps({
|
||||||
required: false,
|
required: false,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
summary: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -34,6 +38,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
|
||||||
:title="data.title"
|
:title="data.title"
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
|
:summary="$props.summary"
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv v-if="entity.salesPersonUser" :label="t('customer.card.salesPerson')">
|
<VnLv v-if="entity.salesPersonUser" :label="t('customer.card.salesPerson')">
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CustomerDescriptor from './CustomerDescriptor.vue';
|
import CustomerDescriptor from './CustomerDescriptor.vue';
|
||||||
|
import CustomerSummaryDialog from './CustomerSummaryDialog.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -10,6 +11,10 @@ const $props = defineProps({
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy>
|
<QPopupProxy>
|
||||||
<CustomerDescriptor v-if="$props.id" :id="$props.id" :preview="true" />
|
<CustomerDescriptor
|
||||||
|
v-if="$props.id"
|
||||||
|
:id="$props.id"
|
||||||
|
:summary="CustomerSummaryDialog"
|
||||||
|
/>
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue