From af6a20729b2ba4d8062bf208670420055107029e Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 22 Jul 2024 09:12:56 +0200 Subject: [PATCH 1/9] fix: refs #7129 fixFilters --- src/components/VnTable/VnTable.vue | 7 ++++- src/pages/Route/Cmr/CmrList.vue | 28 ++++++++++++++++---- src/pages/Route/RouteAutonomous.vue | 40 +++++++++++++++++++++-------- src/pages/Route/RouteList.vue | 40 +++++++++++++++++++++-------- src/pages/Route/RouteRoadmap.vue | 11 +++++--- 5 files changed, 96 insertions(+), 30 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 22fd3acaf..843935736 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -177,7 +177,8 @@ function splitColumns(columns) { if (col.create) splittedColumns.value.create.push(col); if (col.cardVisible) splittedColumns.value.cardVisible.push(col); if ($props.isEditable && col.disable == null) col.disable = false; - if ($props.useModel) col.columnFilter = { ...col.columnFilter, inWhere: true }; + if ($props.useModel && col.columnFilter != false) + col.columnFilter = { ...col.columnFilter, inWhere: true }; splittedColumns.value.columns.push(col); } // Status column @@ -273,6 +274,10 @@ defineExpose({ :search-url="searchUrl" /> [ isId: true, }, { - align: 'left', + align: 'center', name: 'hasCmrDms', label: t('route.cmr.list.hasCmrDms'), component: 'checkbox', @@ -51,8 +51,18 @@ const columns = computed(() => [ { align: 'left', label: t('route.cmr.list.country'), - name: 'country', + name: 'countryFk', cardVisible: true, + component: 'select', + attrs: { + url: 'countries', + fields: ['id', 'name'], + optionLabel: 'name', + optionValue: 'id', + }, + columnFilter: { + inWhere: true, + }, }, { align: 'center', @@ -61,7 +71,6 @@ const columns = computed(() => [ cardVisible: true, component: 'date', columnFilter: { - alias: 'c', inWhere: true, }, format: ({ date }) => toDate(date), @@ -153,9 +162,18 @@ function downloadPdfs() { + + + diff --git a/src/pages/Route/RouteAutonomous.vue b/src/pages/Route/RouteAutonomous.vue index 83bc3b7c5..8e7900652 100644 --- a/src/pages/Route/RouteAutonomous.vue +++ b/src/pages/Route/RouteAutonomous.vue @@ -36,23 +36,20 @@ const tableRef = ref(); const columns = computed(() => [ { align: 'left', - name: 'id', + name: 'routeFk', label: 'Id', chip: { condition: () => true, }, isId: true, + columnFilter: false, }, { align: 'left', name: 'created', label: t('Date'), - component: 'date', - columnFilter: { - alias: 'c', - inWhere: true, - }, - format: ({ date }) => toDate(date), + columnFilter: false, + format: ({ created }) => toDate(created), }, { align: 'left', @@ -66,40 +63,63 @@ const columns = computed(() => [ label: t('Agency agreement'), cardVisible: true, }, + { + align: 'left', + name: 'to', + label: t('To'), + visible: false, + cardVisible: true, + create: true, + component: 'date', + format: ({ date }) => toDate(date), + }, + { + align: 'left', + name: 'from', + label: t('From'), + visible: false, + cardVisible: true, + create: true, + component: 'date', + format: ({ date }) => toDate(date), + }, { align: 'left', name: 'packages', label: t('Packages'), + columnFilter: false, }, { align: 'left', name: 'm3', label: 'm³', cardVisible: true, - columnFilter: { - inWhere: true, - }, + columnFilter: false, }, { align: 'left', name: 'kmTotal', label: t('Km'), cardVisible: true, + columnFilter: false, }, { align: 'left', name: 'price', label: t('Price'), + columnFilter: false, }, { align: 'left', name: 'invoiceInFk', label: t('Received'), + columnFilter: false, }, { align: 'left', name: 'supplierName', label: t('Autonomous'), + columnFilter: false, }, { align: 'right', diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 0f7c06de9..9d8394c4e 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -24,7 +24,6 @@ const selectedRows = ref([]); const tableRef = ref([]); const confirmationDialog = ref(false); const startingDate = ref(null); -const refreshKey = ref(0); const router = useRouter(); const routeFilter = { include: [ @@ -45,9 +44,7 @@ const columns = computed(() => [ condition: () => true, }, isId: true, - columnFilter: { - name: 'search', - }, + columnFilter: false, }, { align: 'left', @@ -107,13 +104,30 @@ const columns = computed(() => [ align: 'left', name: 'created', label: t('Date'), + columnFilter: false, + cardVisible: true, + create: true, + component: 'date', + format: ({ date }) => toDate(date), + }, + { + align: 'left', + name: 'to', + label: t('To'), + visible: false, + cardVisible: true, + create: true, + component: 'date', + format: ({ date }) => toDate(date), + }, + { + align: 'left', + name: 'from', + label: t('From'), + visible: false, cardVisible: true, create: true, component: 'date', - columnFilter: { - alias: 'c', - inWhere: true, - }, format: ({ date }) => toDate(date), }, { @@ -136,18 +150,21 @@ const columns = computed(() => [ name: 'started', label: t('hourStarted'), component: 'time', + columnFilter: false, }, { align: 'left', name: 'finished', label: t('hourFinished'), component: 'time', + columnFilter: false, }, { align: 'left', name: 'isOk', label: t('Served'), component: 'checkbox', + columnFilter: false, }, { align: 'right', @@ -183,8 +200,8 @@ const cloneRoutes = () => { created: startingDate.value, ids: selectedRows.value.map((row) => row?.id), }); - tableRef.value.reload(); startingDate.value = null; + tableRef.value.reload(); }; const showRouteReport = () => { @@ -220,7 +237,7 @@ const openTicketsDialog = (id) => { id, }, }) - .onOk(() => refreshKey.value++); + .onOk(() => tableRef.value.reload()); }; @@ -266,7 +283,6 @@ const openTicketsDialog = (id) => { }" save-url="Routes/crud" :disable-option="{ card: true }" - :use-model="true" table-height="85vh" v-model:selected="selectedRows" :table="{ @@ -332,6 +348,8 @@ en: hourStarted: Started hour hourFinished: Finished hour es: + From: Desde + To: Hasta Worker: Trabajador Agency: Agencia Vehicle: Vehículo diff --git a/src/pages/Route/RouteRoadmap.vue b/src/pages/Route/RouteRoadmap.vue index 050691af4..306387cbe 100644 --- a/src/pages/Route/RouteRoadmap.vue +++ b/src/pages/Route/RouteRoadmap.vue @@ -2,7 +2,7 @@ import { useI18n } from 'vue-i18n'; import { computed, ref } from 'vue'; import { dashIfEmpty } from 'src/filters'; -import { toDate } from 'filters/index'; +import { toDate, toDateHourMin } from 'filters/index'; import { useQuasar } from 'quasar'; import { useSummaryDialog } from 'composables/useSummaryDialog'; import toCurrency from 'filters/toCurrency'; @@ -43,10 +43,9 @@ const columns = computed(() => [ label: t('ETD'), component: 'date', columnFilter: { - alias: 'c', inWhere: true, }, - format: ({ date }) => toDate(date), + format: ({ created }) => toDate(created), cardVisible: true, }, { @@ -200,6 +199,12 @@ function confirmRemove() { }" :disable-option="{ card: true }" > + + - - - From c7d54668e6ea0bdfcd7d7fd0a303e1dbd26d8ddf Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 23 Jul 2024 08:45:54 +0200 Subject: [PATCH 5/9] hotfix(entry_latest-buys): refs #6897 redirect to entry --- src/pages/Entry/EntryLatestBuys.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue index 3f199314d..3ce5c4adf 100644 --- a/src/pages/Entry/EntryLatestBuys.vue +++ b/src/pages/Entry/EntryLatestBuys.vue @@ -1,5 +1,5 @@