Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Alex Moreno 2024-02-26 10:03:17 +01:00
commit 5ac5f91847
3 changed files with 35 additions and 7 deletions

View File

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

View File

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

View File

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