fix: refs #8627 routeDescriptor
gitea/salix-front/pipeline/pr-test This commit looks good Details

This commit is contained in:
Alex Moreno 2025-02-18 11:46:53 +01:00
parent 485d9203c2
commit 11848a1cd7
3 changed files with 5 additions and 52 deletions

View File

@ -6,6 +6,8 @@ import VnLv from 'components/ui/VnLv.vue';
import { dashIfEmpty, toDate } from 'src/filters'; import { dashIfEmpty, toDate } from 'src/filters';
import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue'; import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue';
import filter from './RouteFilter.js'; import filter from './RouteFilter.js';
import useCardDescription from 'src/composables/useCardDescription';
import axios from 'axios';
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -16,7 +18,6 @@ const $props = defineProps({
}); });
const route = useRoute(); const route = useRoute();
const { t } = useI18n();
const zone = ref(); const zone = ref();
const zoneId = ref(); const zoneId = ref();
const entityId = computed(() => { const entityId = computed(() => {
@ -50,9 +51,9 @@ onMounted(async () => {
width="lg-width" width="lg-width"
> >
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('Date')" :value="toDate(entity?.dated)" /> <VnLv :label="$t('Date')" :value="toDate(entity?.dated)" />
<VnLv :label="t('Agency')" :value="entity?.agencyMode?.name" /> <VnLv :label="$t('Agency')" :value="entity?.agencyMode?.name" />
<VnLv :label="t('Zone')" :value="zone" /> <VnLv :label="$t('Zone')" :value="zone" />
<VnLv <VnLv
:label="$t('Volume')" :label="$t('Volume')"
:value="`${dashIfEmpty(entity?.m3)} / ${dashIfEmpty( :value="`${dashIfEmpty(entity?.m3)} / ${dashIfEmpty(

View File

@ -14,7 +14,6 @@ export default {
'started', 'started',
'finished', 'finished',
'cost', 'cost',
'zoneFk',
'isOk', 'isOk',
], ],
include: [ include: [
@ -23,7 +22,6 @@ export default {
relation: 'vehicle', relation: 'vehicle',
scope: { fields: ['id', 'm3'] }, scope: { fields: ['id', 'm3'] },
}, },
{ relation: 'zone', scope: { fields: ['id', 'name'] } },
{ {
relation: 'worker', relation: 'worker',
scope: { scope: {

View File

@ -28,52 +28,6 @@ const defaultInitialData = {
isOk: false, isOk: false,
}; };
const maxDistance = ref(); const maxDistance = ref();
const routeFilter = {
fields: [
'id',
'workerFk',
'agencyModeFk',
'dated',
'm3',
'warehouseFk',
'description',
'vehicleFk',
'kmStart',
'kmEnd',
'started',
'finished',
'cost',
'isOk',
],
include: [
{ relation: 'agencyMode', scope: { fields: ['id', 'name'] } },
{
relation: 'vehicle',
scope: { fields: ['id', 'm3'] },
},
{
relation: 'ticket',
scope: {
fields: ['id', 'name', 'zoneFk'],
include: { relation: 'zone', scope: { fields: ['id', 'name'] } },
},
},
{
relation: 'worker',
scope: {
fields: ['id'],
include: {
relation: 'user',
scope: {
fields: ['id'],
include: { relation: 'emailUser', scope: { fields: ['email'] } },
},
},
},
},
],
};
const onSave = (data, response) => { const onSave = (data, response) => {
if (isNew) { if (isNew) {
axios.post(`Routes/${response?.id}/updateWorkCenter`); axios.post(`Routes/${response?.id}/updateWorkCenter`);