This commit is contained in:
parent
96e9d1a00a
commit
96e7bf78c5
|
@ -16,9 +16,8 @@ const companySizes = [
|
|||
</script>
|
||||
<template>
|
||||
<FormModel
|
||||
:url="`Suppliers/${route.params.id}`"
|
||||
:url-update="`Suppliers/${route.params.id}`"
|
||||
model="supplier"
|
||||
model="Supplier"
|
||||
auto-load
|
||||
:clear-store-on-unmount="false"
|
||||
>
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
import VnCard from 'components/common/VnCard.vue';
|
||||
import SupplierDescriptor from './SupplierDescriptor.vue';
|
||||
import SupplierListFilter from '../SupplierListFilter.vue';
|
||||
import filter from './SupplierFilter.js';
|
||||
</script>
|
||||
<template>
|
||||
<VnCard
|
||||
data-key="Supplier"
|
||||
url="Suppliers"
|
||||
:filter="filter"
|
||||
:descriptor="SupplierDescriptor"
|
||||
:filter-panel="SupplierListFilter"
|
||||
search-data-key="SupplierList"
|
||||
|
|
|
@ -7,9 +7,9 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
|||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
|
||||
import { toDateString } from 'src/filters';
|
||||
import useCardDescription from 'src/composables/useCardDescription';
|
||||
import { getUrl } from 'src/composables/getUrl';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import filter from './SupplierFilter.js';
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -28,42 +28,6 @@ const { t } = useI18n();
|
|||
const url = ref();
|
||||
const state = useState();
|
||||
|
||||
const filter = {
|
||||
fields: [
|
||||
'id',
|
||||
'name',
|
||||
'nickname',
|
||||
'nif',
|
||||
'payMethodFk',
|
||||
'payDemFk',
|
||||
'payDay',
|
||||
'isActive',
|
||||
'isSerious',
|
||||
'isTrucker',
|
||||
'account',
|
||||
],
|
||||
include: [
|
||||
{
|
||||
relation: 'payMethod',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'payDem',
|
||||
scope: {
|
||||
fields: ['id', 'payDem'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['id', 'fi'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
url.value = await getUrl('');
|
||||
});
|
||||
|
@ -72,11 +36,6 @@ const entityId = computed(() => {
|
|||
return $props.id || route.params.id;
|
||||
});
|
||||
|
||||
const data = ref(useCardDescription());
|
||||
const setData = (entity) => {
|
||||
data.value = useCardDescription(entity.ref, entity.id);
|
||||
};
|
||||
|
||||
const supplier = computed(() => state.get('supplier'));
|
||||
|
||||
const getEntryQueryParams = (supplier) => {
|
||||
|
@ -105,11 +64,8 @@ const getEntryQueryParams = (supplier) => {
|
|||
<CardDescriptor
|
||||
module="Supplier"
|
||||
:url="`Suppliers/${entityId}`"
|
||||
:title="data.title"
|
||||
:subtitle="data.subtitle"
|
||||
:filter="filter"
|
||||
@on-fetch="setData"
|
||||
data-key="supplierDescriptor"
|
||||
data-key="Supplier"
|
||||
:summary="$props.summary"
|
||||
>
|
||||
<template #body="{ entity }">
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
export default {
|
||||
fields: [
|
||||
'id',
|
||||
'name',
|
||||
'nickname',
|
||||
'nif',
|
||||
'payMethodFk',
|
||||
'payDemFk',
|
||||
'payDay',
|
||||
'isActive',
|
||||
'isSerious',
|
||||
'isTrucker',
|
||||
'account',
|
||||
],
|
||||
include: [
|
||||
{
|
||||
relation: 'payMethod',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'payDem',
|
||||
scope: {
|
||||
fields: ['id', 'payDem'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['id', 'fi'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
Loading…
Reference in New Issue