refactor: refs #6919 export filter
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-11-12 11:15:34 +01:00
parent efd66ea02a
commit b4d7653661
3 changed files with 46 additions and 44 deletions

View File

@ -2,50 +2,7 @@
import VnCard from 'components/common/VnCard.vue'; import VnCard from 'components/common/VnCard.vue';
import EntryDescriptor from './EntryDescriptor.vue'; import EntryDescriptor from './EntryDescriptor.vue';
import EntryFilter from '../EntryFilter.vue'; import EntryFilter from '../EntryFilter.vue';
import filter from './EntryFilter.js';
const filter = {
include: [
{
relation: 'travel',
scope: {
fields: [
'id',
'landed',
'shipped',
'agencyModeFk',
'warehouseOutFk',
'daysInForward',
],
include: [
{
relation: 'agency',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseIn',
scope: {
fields: ['name'],
},
},
],
},
},
{
relation: 'supplier',
scope: {
fields: ['id', 'nickname'],
},
},
],
};
</script> </script>
<template> <template>
<VnCard <VnCard

View File

@ -9,6 +9,7 @@ import VnLv from 'src/components/ui/VnLv.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
import { usePrintService } from 'composables/usePrintService'; import { usePrintService } from 'composables/usePrintService';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import filter from './EntryFilter.js';
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -62,6 +63,7 @@ const showEntryReport = () => {
ref="entryDescriptorRef" ref="entryDescriptorRef"
module="Entry" module="Entry"
:url="`Entries/${entityId}`" :url="`Entries/${entityId}`"
:filter="filter"
title="supplier.nickname" title="supplier.nickname"
data-key="Entry" data-key="Entry"
> >

View File

@ -0,0 +1,43 @@
export default {
include: [
{
relation: 'travel',
scope: {
fields: [
'id',
'landed',
'shipped',
'agencyModeFk',
'warehouseOutFk',
'daysInForward',
],
include: [
{
relation: 'agency',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseIn',
scope: {
fields: ['name'],
},
},
],
},
},
{
relation: 'supplier',
scope: {
fields: ['id', 'nickname'],
},
},
],
};