Merge pull request 'feat: refs #8087 refs#8087 Redadas en travel' (!908) from 8087-nuevosCamposTravel into dev
gitea/salix-front/pipeline/head There was a failure building this commit Details

Reviewed-on: #908
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Carlos Andrés 2024-11-21 11:51:51 +00:00
commit 977512cae0
10 changed files with 54 additions and 80 deletions

View File

@ -768,6 +768,7 @@ travel:
hb: HB hb: HB
basicData: basicData:
daysInForward: Days in forward daysInForward: Days in forward
isRaid: Raid
thermographs: thermographs:
temperature: Temperature temperature: Temperature
destination: Destination destination: Destination

View File

@ -762,6 +762,7 @@ travel:
hb: HB hb: HB
basicData: basicData:
daysInForward: Días redada daysInForward: Días redada
isRaid: Redada
thermographs: thermographs:
temperature: Temperatura temperature: Temperatura
destination: Destino destination: Destino

View File

@ -221,7 +221,7 @@ onMounted(async () => {
t('entry.list.tableVisibleColumns.isExcludedFromAvailable') t('entry.list.tableVisibleColumns.isExcludedFromAvailable')
}}</QTooltip> }}</QTooltip>
</QIcon> </QIcon>
<QIcon v-if="!!row.daysInForward" name="vn:net" color="primary"> <QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
<QTooltip> <QTooltip>
{{ {{
t('globals.raid', { daysInForward: row.daysInForward }) t('globals.raid', { daysInForward: row.daysInForward })

View File

@ -33,6 +33,7 @@ const canEditZone = useAcl().hasAny([
const agencyFetchRef = ref(); const agencyFetchRef = ref();
const warehousesOptions = ref([]); const warehousesOptions = ref([]);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const currenciesOptions = ref([]);
const agenciesOptions = ref([]); const agenciesOptions = ref([]);
const zonesOptions = ref([]); const zonesOptions = ref([]);
const addresses = ref([]); const addresses = ref([]);

View File

@ -21,12 +21,7 @@ const agenciesOptions = ref([]);
@on-fetch="(data) => (agenciesOptions = data)" @on-fetch="(data) => (agenciesOptions = data)"
auto-load auto-load
/> />
<FormModel <FormModel :url-update="`Travels/${route.params.id}`" model="Travel" auto-load>
:url="`Travels/${route.params.id}`"
:url-update="`Travels/${route.params.id}`"
model="Travel"
auto-load
>
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>
<VnInput v-model="data.ref" :label="t('globals.reference')" /> <VnInput v-model="data.ref" :label="t('globals.reference')" />
@ -78,6 +73,7 @@ const agenciesOptions = ref([]);
</VnInput> </VnInput>
</VnRow> </VnRow>
<VnRow> <VnRow>
<QCheckbox v-model="data.isRaid" :label="t('travel.basicData.isRaid')" />
<QCheckbox <QCheckbox
:label="t('travel.summary.delivered')" :label="t('travel.summary.delivered')"
v-model="data.isDelivered" v-model="data.isDelivered"
@ -93,7 +89,7 @@ const agenciesOptions = ref([]);
<i18n> <i18n>
es: es:
raidDays: Al rellenarlo, generamos una redada. Indica los días que un travel se moverá automáticamente en el tiempo raidDays: Si se marca "Redada", la fecha de entrega se moverá automáticamente los días indicados (incluido 0). Si se deja vacio, la fecha no cambiará
en: en:
raidDays: When filling, a raid is generated. Enter the number of days the travel will automatically forward in time raidDays: If "Raid" is checked, the landing date will automatically shift by the specified number of days (including 0). If left empty, the date will stay the same.
</i18n> </i18n>

View File

@ -1,34 +1,7 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue'; import VnCard from 'components/common/VnCard.vue';
import TravelDescriptor from './TravelDescriptor.vue'; import TravelDescriptor from './TravelDescriptor.vue';
import filter from './TravelFilter.js';
const filter = {
fields: [
'id',
'ref',
'shipped',
'landed',
'totalEntries',
'warehouseInFk',
'warehouseOutFk',
'cargoSupplierFk',
'agencyModeFk',
],
include: [
{
relation: 'warehouseIn',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
},
},
],
};
</script> </script>
<template> <template>
<VnCard <VnCard

View File

@ -7,7 +7,7 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription'; import useCardDescription from 'src/composables/useCardDescription';
import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue'; import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue';
import filter from './TravelFilter.js';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
const $props = defineProps({ const $props = defineProps({
@ -21,35 +21,6 @@ const $props = defineProps({
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const filter = {
fields: [
'id',
'ref',
'shipped',
'landed',
'totalEntries',
'warehouseInFk',
'warehouseOutFk',
'cargoSupplierFk',
'agencyModeFk',
'daysInForward',
],
include: [
{
relation: 'warehouseIn',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
},
},
],
};
const entityId = computed(() => { const entityId = computed(() => {
return $props.id || route.params.id; return $props.id || route.params.id;
}); });
@ -65,7 +36,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
:title="data.title" :title="data.title"
:subtitle="data.subtitle" :subtitle="data.subtitle"
:filter="filter" :filter="filter"
data-key="travelData" data-key="Travel"
@on-fetch="setData" @on-fetch="setData"
> >
<template #menu="{ entity }"> <template #menu="{ entity }">
@ -80,12 +51,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
</template> </template>
<template #icons="{ entity }"> <template #icons="{ entity }">
<QCardActions class="q-gutter-x-md"> <QCardActions class="q-gutter-x-md">
<QIcon <QIcon v-if="entity.isRaid" name="vn:net" color="primary" size="xs">
v-if="entity.daysInForward"
name="vn:net"
color="primary"
size="xs"
>
<QTooltip> <QTooltip>
{{ {{
t('globals.raid', { daysInForward: entity.daysInForward }) t('globals.raid', { daysInForward: entity.daysInForward })

View File

@ -0,0 +1,29 @@
export default {
fields: [
'id',
'ref',
'shipped',
'landed',
'totalEntries',
'warehouseInFk',
'warehouseOutFk',
'cargoSupplierFk',
'agencyModeFk',
'isRaid',
'daysInForward',
],
include: [
{
relation: 'warehouseIn',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
},
},
],
};

View File

@ -268,6 +268,11 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
:label="t('globals.warehouseOut')" :label="t('globals.warehouseOut')"
:value="travel.warehouseOut?.name" :value="travel.warehouseOut?.name"
/> />
<QCheckbox
:label="t('travel.basicData.isRaid')"
v-model="travel.isRaid"
:disable="true"
/>
<QCheckbox <QCheckbox
:label="t('travel.summary.delivered')" :label="t('travel.summary.delivered')"
v-model="travel.isDelivered" v-model="travel.isDelivered"
@ -286,6 +291,10 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
:label="t('globals.warehouseIn')" :label="t('globals.warehouseIn')"
:value="travel.warehouseIn?.name" :value="travel.warehouseIn?.name"
/> />
<VnLv
:label="t('travel.basicData.daysInForward')"
:value="travel?.daysInForward"
/>
<QCheckbox <QCheckbox
:label="t('travel.summary.received')" :label="t('travel.summary.received')"
v-model="travel.isReceived" v-model="travel.isReceived"
@ -303,10 +312,6 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
<VnLv :label="t('globals.reference')" :value="travel.ref" /> <VnLv :label="t('globals.reference')" :value="travel.ref" />
<VnLv label="m³" :value="travel.m3" /> <VnLv label="m³" :value="travel.m3" />
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" /> <VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
<VnLv
:label="t('travel.basicData.daysInForward')"
:value="travel?.daysInForward"
/>
</QCard> </QCard>
<QCard class="full-width"> <QCard class="full-width">
<VnTitle :text="t('travel.summary.entries')" /> <VnTitle :text="t('travel.summary.entries')" />

View File

@ -227,10 +227,12 @@ const columns = computed(() => [
> >
<template #column-status="{ row }"> <template #column-status="{ row }">
<div class="row"> <div class="row">
<QIcon v-if="!!row.daysInForward" name="vn:net" color="primary"> <QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
<QTooltip> <QTooltip>
{{ {{
t('globals.raid', { daysInForward: row.daysInForward }) t('globals.raid', {
daysInForward: row.daysInForward,
})
}}</QTooltip }}</QTooltip
> >
</QIcon> </QIcon>