forked from verdnatura/salix-front
refs #7366 fix travel migration
This commit is contained in:
parent
31cd266ec7
commit
ad2265fe7c
|
@ -21,7 +21,6 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setOptions();
|
setOptions();
|
||||||
store.skip = 0;
|
store.skip = 0;
|
||||||
|
|
||||||
const query = route.query;
|
const query = route.query;
|
||||||
const searchUrl = store.searchUrl;
|
const searchUrl = store.searchUrl;
|
||||||
if (query[searchUrl]) {
|
if (query[searchUrl]) {
|
||||||
|
|
|
@ -33,8 +33,12 @@ const filter = {
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="Travel"
|
data-key="Travel"
|
||||||
:filter="filter"
|
|
||||||
base-url="Travels"
|
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"
|
:descriptor="TravelDescriptor"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -12,8 +12,6 @@ import FetchData from 'src/components/FetchData.vue';
|
||||||
import { toDate, toCurrency } from 'src/filters';
|
import { toDate, toCurrency } from 'src/filters';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
onUpdated(() => summaryRef.value.fetch());
|
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
|
|
@ -2,17 +2,27 @@
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import TravelSummary from './Card/TravelSummary.vue';
|
import TravelSummary from './Card/TravelSummary.vue';
|
||||||
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import { dashIfEmpty, toDate } from 'src/filters';
|
import { dashIfEmpty, toDate } from 'src/filters';
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
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 cloneTravel = (travelData) => {
|
||||||
const stringifiedTravelData = JSON.stringify(travelData);
|
const stringifiedTravelData = JSON.stringify(travelData);
|
||||||
redirectToCreateView(stringifiedTravelData);
|
redirectToCreateView(stringifiedTravelData);
|
||||||
|
@ -164,16 +174,21 @@ const columns = computed(() => [
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<VnSearchbar
|
||||||
|
:info="t('You can search by travel id or name')"
|
||||||
|
:label="t('Search travel')"
|
||||||
|
data-key="TravelList"
|
||||||
|
/>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="Travels"
|
data-key="TravelList"
|
||||||
:url="`Travels`"
|
url="Travels"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Travels',
|
urlCreate: 'Travels',
|
||||||
title: t('Create Travels'),
|
title: t('Create Travels'),
|
||||||
onDataSaved: () => tableRef.reload(),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: {
|
formInitialData: {
|
||||||
workerFk: entityId,
|
editorFk: entityId,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
order="landed DESC"
|
order="landed DESC"
|
||||||
|
@ -195,4 +210,6 @@ en:
|
||||||
es:
|
es:
|
||||||
addEntry: Añadir entrada
|
addEntry: Añadir entrada
|
||||||
searchByIdOrReference: Buscar por ID o por referencia
|
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>
|
</i18n>
|
||||||
|
|
Loading…
Reference in New Issue