fix(claim_summary): url links
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Alex Moreno 2024-08-16 10:50:45 +02:00
parent 51ee79b7f7
commit b35bf85f4a
1 changed files with 11 additions and 13 deletions

View File

@ -36,8 +36,6 @@ const $props = defineProps({
const entityId = computed(() => $props.id || route.params.id);
const ClaimStates = ref([]);
const claimUrl = ref();
const salixUrl = ref();
const claimDmsRef = ref();
const claimDms = ref([]);
const multimediaDialog = ref();
@ -152,11 +150,6 @@ const developmentColumns = ref([
},
]);
onMounted(async () => {
salixUrl.value = await getUrl('');
claimUrl.value = salixUrl.value + `claim/${entityId.value}/`;
});
async function getClaimDms() {
claimDmsFilter.value.where = { claimFk: entityId.value };
await claimDmsRef.value.fetch();
@ -177,10 +170,15 @@ 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);
}
function claimUrl(section) {
return '#/claim/' + entityId.value + '/' + section;
}
</script>
<template>
@ -234,7 +232,7 @@ async function changeState(value) {
<template #body="{ entity: { claim, salesClaimed, developments } }">
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
<VnTitle
:url="`#/claim/${entityId}/basic-data`"
:url="claimUrl('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
<VnLv :label="t('claim.created')" :value="toDate(claim.created)" />
@ -275,7 +273,7 @@ async function changeState(value) {
/>
</QCard>
<QCard class="vn-two">
<VnTitle :url="`#/claim/${entityId}/notes`" :text="t('claim.notes')" />
<VnTitle :url="claimUrl('notes')" :text="t('claim.notes')" />
<ClaimNotes
:id="entityId"
:add-note="false"
@ -284,7 +282,7 @@ async function changeState(value) {
/>
</QCard>
<QCard class="vn-two" v-if="claimDms?.length">
<VnTitle :url="`#/claim/${entityId}/photos`" :text="t('claim.photos')" />
<VnTitle :url="claimUrl('photos')" :text="t('claim.photos')" />
<div class="container max-container-height" style="overflow: auto">
<div
class="multimedia-container"
@ -326,7 +324,7 @@ async function changeState(value) {
</div>
</QCard>
<QCard class="vn-max" v-if="salesClaimed.length > 0">
<VnTitle :url="`#/claim/${entityId}/lines`" :text="t('claim.details')" />
<VnTitle :url="claimUrl('lines')" :text="t('claim.details')" />
<QTable
:columns="detailsColumns"
:rows="salesClaimed"
@ -365,7 +363,7 @@ async function changeState(value) {
</QTable>
</QCard>
<QCard class="vn-max" v-if="developments.length > 0">
<VnTitle :url="claimUrl + 'development'" :text="t('claim.development')" />
<VnTitle :url="claimUrl('development')" :text="t('claim.development')" />
<QTable
:columns="developmentColumns"
:rows="developments"
@ -390,7 +388,7 @@ async function changeState(value) {
</QTable>
</QCard>
<QCard class="vn-max">
<VnTitle :url="claimUrl + 'action'" :text="t('claim.actions')" />
<VnTitle :url="claimUrl('action')" :text="t('claim.actions')" />
<div id="slider-container" class="q-px-xl q-py-md">
<QSlider
v-model="claim.responsibility"