refs #7366 fix travel migration
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Carlos Satorres 2024-07-03 08:43:23 +02:00
parent 31cd266ec7
commit ad2265fe7c
4 changed files with 27 additions and 9 deletions

View File

@ -21,7 +21,6 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
onMounted(() => {
setOptions();
store.skip = 0;
const query = route.query;
const searchUrl = store.searchUrl;
if (query[searchUrl]) {

View File

@ -33,8 +33,12 @@ const filter = {
<template>
<VnCard
data-key="Travel"
:filter="filter"
base-url="Travels"
search-data-key="TravelList"
searchbar-label="Search travel"
searchbar-info="You can search by travel id or name"
search-url="Travels"
:filter="filter"
:descriptor="TravelDescriptor"
/>
</template>

View File

@ -12,8 +12,6 @@ import FetchData from 'src/components/FetchData.vue';
import { toDate, toCurrency } from 'src/filters';
import axios from 'axios';
onUpdated(() => summaryRef.value.fetch());
const $props = defineProps({
id: {
type: Number,

View File

@ -2,17 +2,27 @@
import { onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { useRoute } from 'vue-router';
import { useStateStore } from 'stores/useStateStore';
import VnTable from 'components/VnTable/VnTable.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { computed } from 'vue';
import TravelSummary from './Card/TravelSummary.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { dashIfEmpty, toDate } from 'src/filters';
const { viewSummary } = useSummaryDialog();
const router = useRouter();
const { t } = useI18n();
const stateStore = useStateStore();
const route = useRoute();
const tableRef = ref();
const $props = defineProps({
id: {
type: Number,
default: 0,
},
});
const entityId = computed(() => $props.id || route.params.id);
const cloneTravel = (travelData) => {
const stringifiedTravelData = JSON.stringify(travelData);
redirectToCreateView(stringifiedTravelData);
@ -164,16 +174,21 @@ const columns = computed(() => [
</script>
<template>
<VnSearchbar
:info="t('You can search by travel id or name')"
:label="t('Search travel')"
data-key="TravelList"
/>
<VnTable
ref="tableRef"
data-key="Travels"
:url="`Travels`"
data-key="TravelList"
url="Travels"
:create="{
urlCreate: 'Travels',
title: t('Create Travels'),
onDataSaved: () => tableRef.reload(),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {
workerFk: entityId,
editorFk: entityId,
},
}"
order="landed DESC"
@ -195,4 +210,6 @@ en:
es:
addEntry: Añadir entrada
searchByIdOrReference: Buscar por ID o por referencia
You can search by travel id or name: Buscar por envio por id o nombre
Search travel: Buscar envio
</i18n>