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
basicData:
daysInForward: Days in forward
isRaid: Raid
thermographs:
temperature: Temperature
destination: Destination

View File

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

View File

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

View File

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

View File

@ -21,12 +21,7 @@ const agenciesOptions = ref([]);
@on-fetch="(data) => (agenciesOptions = data)"
auto-load
/>
<FormModel
:url="`Travels/${route.params.id}`"
:url-update="`Travels/${route.params.id}`"
model="Travel"
auto-load
>
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel" auto-load>
<template #form="{ data }">
<VnRow>
<VnInput v-model="data.ref" :label="t('globals.reference')" />
@ -78,6 +73,7 @@ const agenciesOptions = ref([]);
</VnInput>
</VnRow>
<VnRow>
<QCheckbox v-model="data.isRaid" :label="t('travel.basicData.isRaid')" />
<QCheckbox
:label="t('travel.summary.delivered')"
v-model="data.isDelivered"
@ -93,7 +89,7 @@ const agenciesOptions = ref([]);
<i18n>
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:
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>

View File

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

View File

@ -7,7 +7,7 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription';
import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue';
import filter from './TravelFilter.js';
import { toDate } from 'src/filters';
const $props = defineProps({
@ -21,35 +21,6 @@ const $props = defineProps({
const route = useRoute();
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(() => {
return $props.id || route.params.id;
});
@ -65,7 +36,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
:title="data.title"
:subtitle="data.subtitle"
:filter="filter"
data-key="travelData"
data-key="Travel"
@on-fetch="setData"
>
<template #menu="{ entity }">
@ -80,12 +51,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
</template>
<template #icons="{ entity }">
<QCardActions class="q-gutter-x-md">
<QIcon
v-if="entity.daysInForward"
name="vn:net"
color="primary"
size="xs"
>
<QIcon v-if="entity.isRaid" name="vn:net" color="primary" size="xs">
<QTooltip>
{{
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')"
:value="travel.warehouseOut?.name"
/>
<QCheckbox
:label="t('travel.basicData.isRaid')"
v-model="travel.isRaid"
:disable="true"
/>
<QCheckbox
:label="t('travel.summary.delivered')"
v-model="travel.isDelivered"
@ -286,6 +291,10 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
:label="t('globals.warehouseIn')"
:value="travel.warehouseIn?.name"
/>
<VnLv
:label="t('travel.basicData.daysInForward')"
:value="travel?.daysInForward"
/>
<QCheckbox
:label="t('travel.summary.received')"
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="m³" :value="travel.m3" />
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
<VnLv
:label="t('travel.basicData.daysInForward')"
:value="travel?.daysInForward"
/>
</QCard>
<QCard class="full-width">
<VnTitle :text="t('travel.summary.entries')" />

View File

@ -227,10 +227,12 @@ const columns = computed(() => [
>
<template #column-status="{ 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>
{{
t('globals.raid', { daysInForward: row.daysInForward })
t('globals.raid', {
daysInForward: row.daysInForward,
})
}}</QTooltip
>
</QIcon>