This commit is contained in:
parent
00b7883aed
commit
8af09d46ed
|
@ -2,11 +2,13 @@
|
||||||
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
|
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCard from 'components/common/VnCard.vue';
|
||||||
import InvoiceOutFilter from '../InvoiceOutFilter.vue';
|
import InvoiceOutFilter from '../InvoiceOutFilter.vue';
|
||||||
|
import filter from './InvoiceOutFilter.js';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="InvoiceOut"
|
data-key="InvoiceOut"
|
||||||
url="InvoiceOuts"
|
url="InvoiceOuts"
|
||||||
|
:filter="filter"
|
||||||
:descriptor="InvoiceOutDescriptor"
|
:descriptor="InvoiceOutDescriptor"
|
||||||
:filter-panel="InvoiceOutFilter"
|
:filter-panel="InvoiceOutFilter"
|
||||||
search-data-key="InvoiceOutList"
|
search-data-key="InvoiceOutList"
|
||||||
|
|
|
@ -8,8 +8,8 @@ import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue';
|
import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue';
|
||||||
|
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
|
||||||
import { toCurrency, toDate } from 'src/filters';
|
import { toCurrency, toDate } from 'src/filters';
|
||||||
|
import filter from './InvoiceOutFilter.js';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -26,30 +26,11 @@ const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
const filter = {
|
|
||||||
include: [
|
|
||||||
{
|
|
||||||
relation: 'company',
|
|
||||||
scope: {
|
|
||||||
fields: ['id', 'code'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'client',
|
|
||||||
scope: {
|
|
||||||
fields: ['id', 'name', 'email'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
const descriptor = ref();
|
const descriptor = ref();
|
||||||
|
|
||||||
function ticketFilter(invoice) {
|
function ticketFilter(invoice) {
|
||||||
return JSON.stringify({ refFk: invoice.ref });
|
return JSON.stringify({ refFk: invoice.ref });
|
||||||
}
|
}
|
||||||
const data = ref(useCardDescription());
|
|
||||||
const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.id));
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -58,10 +39,8 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
|
||||||
module="InvoiceOut"
|
module="InvoiceOut"
|
||||||
:url="`InvoiceOuts/${entityId}`"
|
:url="`InvoiceOuts/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:title="data.title"
|
title="ref"
|
||||||
:subtitle="data.subtitle"
|
data-key="InvoiceOut"
|
||||||
@on-fetch="setData"
|
|
||||||
data-key="invoiceOutData"
|
|
||||||
>
|
>
|
||||||
<template #menu="{ entity, menuRef }">
|
<template #menu="{ entity, menuRef }">
|
||||||
<InvoiceOutDescriptorMenu :invoice-out-data="entity" :menu-ref="menuRef" />
|
<InvoiceOutDescriptorMenu :invoice-out-data="entity" :menu-ref="menuRef" />
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
export default {
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'company',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'code'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'client',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'name', 'email'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
Loading…
Reference in New Issue