0
0
Fork 0

Merge pull request 'refs #6336 hotFix(claimSummary): loadPhoto, ItemDescriptor' (!205) from 6336-hotFix-claimSummary into master

Reviewed-on: verdnatura/salix-front#205
Reviewed-by: JAVIER SEGARRA MARTINEZ <jsegarra@verdnatura.es>
This commit is contained in:
Alex Moreno 2024-02-26 08:50:37 +00:00
commit 99bb04bb0f
3 changed files with 35 additions and 7 deletions

View File

@ -35,7 +35,6 @@ const claimDmsFilter = ref({
relation: 'dms',
},
],
where: { claimFk: entityId.value },
});
onMounted(async () => {
@ -141,6 +140,11 @@ const claimDms = ref([]);
const multimediaDialog = ref();
const multimediaSlide = ref();
async function getClaimDms() {
claimDmsFilter.value.where = { claimFk: entityId.value };
await claimDmsRef.value.fetch();
}
function setClaimDms(data) {
claimDms.value = [];
data.forEach((media) => {
@ -163,10 +167,13 @@ function openDialog(dmsId) {
url="ClaimDms"
:filter="claimDmsFilter"
@on-fetch="(data) => setClaimDms(data)"
limit="20"
ref="claimDmsRef"
/>
<CardSummary ref="summary" :url="`Claims/${entityId}/getSummary`">
<CardSummary
ref="summary"
:url="`Claims/${entityId}/getSummary`"
@on-fetch="getClaimDms"
>
<template #header="{ entity: { claim } }">
{{ claim.id }} - {{ claim.client.name }}
</template>
@ -252,7 +259,8 @@ function openDialog(dmsId) {
>
<ItemDescriptorProxy
v-if="col.name == 'description'"
:id="2"
:id="props.row.id"
:sale-fk="props.row.saleFk"
></ItemDescriptorProxy>
</QTh>
</QTr>
@ -274,7 +282,6 @@ function openDialog(dmsId) {
</template>
</QTable>
</QCard>
<QCard class="vn-max" v-if="claimDms.length > 0">
<a class="header" :href="`#/claim/${entityId}/photos`">
{{ t('claim.summary.photos') }}

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, ref, onMounted, onUnmounted } from 'vue';
import { computed, ref, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
@ -14,6 +14,7 @@ import EditPictureForm from 'components/EditPictureForm.vue';
import { useState } from 'src/composables/useState';
import useCardDescription from 'src/composables/useCardDescription';
import { useSession } from 'src/composables/useSession';
import { getUrl } from 'src/composables/getUrl';
import axios from 'axios';
const $props = defineProps({
@ -30,6 +31,10 @@ const $props = defineProps({
type: String,
default: null,
},
saleFk: {
type: Number,
default: null,
},
});
const quasar = useQuasar();
@ -51,6 +56,7 @@ const available = ref(null);
const visible = ref(null);
const _warehouseFk = ref(null);
const warehouseText = ref(null);
const salixUrl = ref();
const warehouseFk = computed({
get() {
return _warehouseFk.value;
@ -69,6 +75,7 @@ const showEditPhotoForm = ref(false);
onMounted(async () => {
await getItemAvatar();
warehouseFk.value = user.value.warehouseFk;
salixUrl.value = await getUrl('');
});
const getItemAvatar = async () => {
@ -276,7 +283,16 @@ const openCloneDialog = async () => {
<template #actions="{}">
<QCardActions class="row justify-center">
<QBtn
:to="{ name: 'ItemDiary' }"
:href="
salixUrl +
'item/' +
entityId +
'/diary?' +
'warehouseFk=' +
warehouseFk +
'&lineFk=' +
$props.saleFk
"
size="md"
icon="vn:transaction"
color="primary"

View File

@ -11,6 +11,10 @@ const $props = defineProps({
type: String,
default: null,
},
saleFk: {
type: Number,
default: null,
},
});
</script>
@ -21,6 +25,7 @@ const $props = defineProps({
:id="$props.id"
:summary="ItemSummary"
:dated="dated"
:sale-fk="saleFk"
/>
</QPopupProxy>
</template>