In TravelList show warehouses name instead warehouseFk
This commit is contained in:
parent
0c385d9a6f
commit
cbd8af7fae
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted } 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 { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
@ -9,6 +9,7 @@ import CardList from 'src/components/ui/CardList.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import TravelSummaryDialog from './Card/TravelSummaryDialog.vue';
|
import TravelSummaryDialog from './Card/TravelSummaryDialog.vue';
|
||||||
import TravelFilter from './TravelFilter.vue';
|
import TravelFilter from './TravelFilter.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { toDate } from 'src/filters/index';
|
import { toDate } from 'src/filters/index';
|
||||||
|
@ -18,6 +19,8 @@ const quasar = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
|
||||||
|
const warehouses = ref([]);
|
||||||
|
|
||||||
const navigateToTravelId = (id) => {
|
const navigateToTravelId = (id) => {
|
||||||
router.push({ path: `/travel/${id}` });
|
router.push({ path: `/travel/${id}` });
|
||||||
};
|
};
|
||||||
|
@ -35,6 +38,10 @@ const redirectCreateEntryView = (travelData) => {
|
||||||
router.push({ name: 'EntryCreate', query: { travelFk: travelData.id } });
|
router.push({ name: 'EntryCreate', query: { travelFk: travelData.id } });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getWarehouseName = (id) => {
|
||||||
|
return warehouses.value.find((warehouse) => warehouse.id === id).name;
|
||||||
|
};
|
||||||
|
|
||||||
const viewSummary = (id) => {
|
const viewSummary = (id) => {
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: TravelSummaryDialog,
|
component: TravelSummaryDialog,
|
||||||
|
@ -50,6 +57,13 @@ onMounted(async () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="Warehouses"
|
||||||
|
:filter="{ fields: ['id', 'name'] }"
|
||||||
|
order="name"
|
||||||
|
@on-fetch="(data) => (warehouses = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||||
<QScrollArea class="fit text-grey-8">
|
<QScrollArea class="fit text-grey-8">
|
||||||
<TravelFilter data-key="TravelList" />
|
<TravelFilter data-key="TravelList" />
|
||||||
|
@ -77,8 +91,9 @@ onMounted(async () => {
|
||||||
:value="row.agencyModeName"
|
:value="row.agencyModeName"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
v-if="warehouses.length > 0"
|
||||||
:label="t('globals.wareHouseOut')"
|
:label="t('globals.wareHouseOut')"
|
||||||
:value="row.warehouseOutFk"
|
:value="getWarehouseName(row.warehouseOutFk)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('globals.shipped')"
|
:label="t('globals.shipped')"
|
||||||
|
@ -89,10 +104,10 @@ onMounted(async () => {
|
||||||
:value="toDate(row.landed)"
|
:value="toDate(row.landed)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
v-if="warehouses.length > 0"
|
||||||
:label="t('globals.wareHouseIn')"
|
:label="t('globals.wareHouseIn')"
|
||||||
:value="row.warehouseInFk"
|
:value="getWarehouseName(row.warehouseInFk)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('globals.totalEntries')"
|
:label="t('globals.totalEntries')"
|
||||||
:value="row.totalEntries"
|
:value="row.totalEntries"
|
||||||
|
@ -143,9 +158,6 @@ onMounted(async () => {
|
||||||
en:
|
en:
|
||||||
addEntry: Add entry
|
addEntry: Add entry
|
||||||
|
|
||||||
|
|
||||||
es:
|
es:
|
||||||
addEntry: Añadir entrada
|
addEntry: Añadir entrada
|
||||||
|
|
||||||
|
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
Loading…
Reference in New Issue