diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index fbab06966..5ebd50649 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1144,6 +1144,16 @@ travel: basicData: Basic data history: Log thermographs: Thermograph + travelList: + tableVisibleColumns: + id: Id + ref: Reference + agency: Agency + shipped: Shipped + landed: Landed + warehouseIn: Warehouse in + warehouseOut: Warehouse out + totalEntries: Total entries summary: confirmed: Confirmed entryId: Entry Id diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index fec78d5e6..cecca86da 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -1132,6 +1132,16 @@ travel: basicData: Datos básicos history: Historial thermographs: Termógrafos + travelList: + tableVisibleColumns: + id: Id + ref: Referencia + agency: Agencia + shipped: Enviado + landed: Llegada + warehouseIn: Almacén de salida + warehouseOut: Almacén de entrada + totalEntries: Total de entradas summary: confirmed: Confirmado entryId: Id entrada diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index e6696b26f..eca79d690 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -2,19 +2,12 @@ import { onMounted, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; -import VnPaginate from 'src/components/ui/VnPaginate.vue'; -import CardList from 'src/components/ui/CardList.vue'; -import VnLv from 'src/components/ui/VnLv.vue'; -import TravelSummary from './Card/TravelSummary.vue'; -import TravelFilter from './TravelFilter.vue'; -import FetchData from 'components/FetchData.vue'; -import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; - import { useStateStore } from 'stores/useStateStore'; -import { toDate } from 'src/filters/index'; +import VnTable from 'components/VnTable/VnTable.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; -import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js'; -import RightMenu from 'src/components/common/RightMenu.vue'; + +import { computed } from 'vue'; +import TravelSummary from './Card/TravelSummary.vue'; const router = useRouter(); const { t } = useI18n(); @@ -47,118 +40,134 @@ const getWarehouseName = (id) => { onMounted(async () => { stateStore.rightDrawer = true; }); + +const columns = computed(() => [ + { + align: 'left', + name: 'id', + label: t('travel.travelList.tableVisibleColumns.id'), + isId: true, + field: 'id', + cardVisible: true, + }, + { + align: 'left', + name: 'ref', + label: t('travel.travelList.tableVisibleColumns.ref'), + field: 'ref', + component: 'input', + cardVisible: true, + create: true, + }, + { + align: 'left', + name: 'agencyModeFk', + label: t('travel.travelList.tableVisibleColumns.agency'), + field: 'agencyModeFk', + component: 'select', + attrs: { + url: 'agencyModes', + fields: ['id', 'name'], + }, + cardVisible: true, + create: true, + }, + { + align: 'left', + name: 'shipped', + label: t('travel.travelList.tableVisibleColumns.shipped'), + field: 'shipped', + component: 'date', + cardVisible: true, + create: true, + }, + { + align: 'left', + name: 'landed', + label: t('travel.travelList.tableVisibleColumns.landed'), + field: 'landed', + component: 'date', + cardVisible: true, + create: true, + }, + { + align: 'left', + name: 'warehouseInFk', + label: t('travel.travelList.tableVisibleColumns.warehouseIn'), + field: 'warehouseInFk', + component: 'select', + attrs: { + url: 'warehouses', + fields: ['id', 'name'], + }, + cardVisible: true, + create: true, + }, + { + align: 'left', + name: 'warehouseOutFk', + label: t('travel.travelList.tableVisibleColumns.warehouseOut'), + field: 'warehouseOutFk', + component: 'select', + attrs: { + url: 'warehouses', + fields: ['id', 'name'], + }, + cardVisible: true, + create: true, + }, + { + align: 'left', + name: 'totalEntries', + label: t('travel.travelList.tableVisibleColumns.totalEntries'), + field: 'totalEntries', + component: 'input', + cardVisible: true, + create: true, + }, + { + align: 'right', + label: '', + name: 'tableActions', + actions: [ + { + title: t('Clone'), + icon: 'vn:ticket', + action: cloneTravel, + isPrimary: true, + }, + { + title: t('Add entry'), + icon: 'preview', + action: (row) => viewSummary(row.id, TravelSummary), + }, + ], + }, +]); - (warehouses = data)" + - - - - - - - - - - - - - - - - - - {{ toDate(row.shipped) }} - - {{ toDate(row.shipped) }} - - - - - - {{ toDate(row.landed) }} - - {{ toDate(row.landed) }} - - - - - - - - - - - - - - - - - - {{ t('supplier.list.newSupplier') }} - - -