diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 1487b0d76..40e2c14c1 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -119,9 +119,10 @@ onMounted(async () => { // Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla state.set(modelValue, $props.formInitialData); - if ($props.autoLoad && !$props.formInitialData && $props.url) await fetch(); - else if (arrayData.store.data) updateAndEmit('onFetch', arrayData.store.data); - + if (!$props.formInitialData) { + if ($props.autoLoad && $props.url) await fetch(); + else if (arrayData.store.data) updateAndEmit(arrayData.store.data, 'onFetch'); + } if ($props.observeFormChanges) { watch( () => formData.value, diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 5ef3a5472..b3a85eefa 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -421,6 +421,7 @@ entry: buyingValue: Buying value freightValue: Freight value comissionValue: Commission value + description: Description packageValue: Package value isIgnored: Is ignored price2: Grouping diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index cfadd57b3..d03ee9d5c 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -419,6 +419,7 @@ entry: buyingValue: Coste freightValue: Porte comissionValue: Comisión + description: Descripción packageValue: Embalaje isIgnored: Ignorado price2: Grouping diff --git a/src/pages/Entry/Card/EntryDescriptor.vue b/src/pages/Entry/Card/EntryDescriptor.vue index 807ccdae4..3c925ead6 100644 --- a/src/pages/Entry/Card/EntryDescriptor.vue +++ b/src/pages/Entry/Card/EntryDescriptor.vue @@ -135,14 +135,19 @@ watch; {{ t('Inventory entry') }} - + {{ t('Virtual entry') }} diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue index cae59207b..291b828c9 100644 --- a/src/pages/Entry/EntryLatestBuys.vue +++ b/src/pages/Entry/EntryLatestBuys.vue @@ -167,7 +167,7 @@ const columns = computed(() => [ }, }, { - label: t('globals.description'), + label: t('entry.latestBuys.description'), field: 'description', name: 'description', align: 'left', @@ -653,6 +653,15 @@ onUnmounted(() => (stateStore.rightDrawer = false)); + + + + + {{ t('globals.collapseMenu') }} + + + + - - - diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue index cbfc3751a..7db088860 100644 --- a/src/pages/Route/Cmr/CmrList.vue +++ b/src/pages/Route/Cmr/CmrList.vue @@ -1,7 +1,8 @@ - + diff --git a/src/pages/Travel/Card/TravelDescriptor.vue b/src/pages/Travel/Card/TravelDescriptor.vue index c7501b1d4..975beb9ab 100644 --- a/src/pages/Travel/Card/TravelDescriptor.vue +++ b/src/pages/Travel/Card/TravelDescriptor.vue @@ -52,23 +52,15 @@ const filter = { const entityId = computed(() => { return $props.id || route.params.id; }); - -const data = ref(useCardDescription()); - -const setData = (entity) => { - data.value = useCardDescription(entity.ref, entity.id); -}; { redirectToCreateView(stringifiedTravelData); }; -const cloneTravelWithEntries = () => { +const cloneTravelWithEntries = async () => { try { - axios.post(`Travels/${$props.travel.id}/cloneWithEntries`); + const { data } = await axios.post(`Travels/${$props.travel.id}/cloneWithEntries`); notify('globals.dataSaved', 'positive'); + router.push({ name: 'TravelBasicData', params: { id: data.id } }); } catch (err) { console.err('Error cloning travel with entries'); } diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index 7fc92e7b6..91b36f0cf 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -8,7 +8,6 @@ import VnLv from 'src/components/ui/VnLv.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue'; import FetchData from 'src/components/FetchData.vue'; -import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue'; import { toDate, toCurrency } from 'src/filters'; import axios from 'axios'; @@ -222,6 +221,8 @@ async function setTravelData(travelData) { console.error(`Error setting travel data`, err); } } + +const getLink = (param) => `#/travel/${entityId.value}/${param}`; @@ -240,21 +241,15 @@ async function setTravelData(travelData) { {{ travel.ref }} - {{ travel.id }} - - - - {{ t('components.cardDescriptor.moreOptions') }} - - - - - - - - + + + + + + + + + - + - + - diff --git a/src/pages/Travel/TravelCreate.vue b/src/pages/Travel/TravelCreate.vue index 53c8d402d..0c734a367 100644 --- a/src/pages/Travel/TravelCreate.vue +++ b/src/pages/Travel/TravelCreate.vue @@ -15,29 +15,19 @@ const { t } = useI18n(); const route = useRoute(); const router = useRouter(); -const newTravelForm = reactive({ - ref: null, - agencyModeFk: null, - shipped: null, - landed: null, - warehouseOutFk: null, - warehouseInFk: null, -}); - const agenciesOptions = ref([]); const warehousesOptions = ref([]); const viewAction = ref(); +const newTravelForm = ref({}); onBeforeMount(() => { - // Esto nos permite decirle a FormModel si queremos observar los cambios o no - // Ya que si queremos clonar queremos que nos permita guardar inmediatamente sin realizar cambios en el form viewAction.value = route.query.travelData ? 'clone' : 'create'; if (route.query.travelData) { const travelData = JSON.parse(route.query.travelData); - for (let key in newTravelForm) { - newTravelForm[key] = travelData[key]; - } + + newTravelForm.value = { ...newTravelForm.value, ...travelData }; + delete newTravelForm.value.id; } }); @@ -60,8 +50,8 @@ const redirectToTravelBasicData = (_, { id }) => {