From f11597102f01d7bba3b6bddf93c1a3f4f247b223 Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 5 Mar 2025 11:32:31 +0100 Subject: [PATCH 01/17] feat: refs #8721 add ticket navigation and update route columns --- src/pages/Route/RouteList.vue | 13 +++++++++++++ src/pages/Route/RouteTickets.vue | 12 ++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 5723e2f0d..f06249de6 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -9,6 +9,7 @@ import VnTable from 'components/VnTable/VnTable.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import VnSection from 'src/components/common/VnSection.vue'; import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; +import RouteTickets from './RouteTickets.vue'; const { t } = useI18n(); const { viewSummary } = useSummaryDialog(); @@ -24,6 +25,12 @@ const routeFilter = { }, ], }; + +function redirectToTickets(id) { + const url = `#/route/${id}/tickets`; + window.open(url, '_blank'); +} + const columns = computed(() => [ { align: 'right', @@ -130,6 +137,12 @@ const columns = computed(() => [ align: 'right', name: 'tableActions', actions: [ + { + title: t('globals.pageTitles.tickets'), + icon: 'vn:ticket', + action: (row) => redirectToTickets(row?.id), + isPrimary: true, + }, { title: t('components.smartCard.viewSummary'), icon: 'preview', diff --git a/src/pages/Route/RouteTickets.vue b/src/pages/Route/RouteTickets.vue index adc7dfdaa..b17fb543f 100644 --- a/src/pages/Route/RouteTickets.vue +++ b/src/pages/Route/RouteTickets.vue @@ -37,9 +37,9 @@ const columns = computed(() => [ align: 'left', }, { - name: 'city', - label: t('City'), - field: (row) => row?.city, + name: 'client', + label: t('Client'), + field: (row) => row?.nickname, sortable: false, align: 'left', }, @@ -51,9 +51,9 @@ const columns = computed(() => [ align: 'center', }, { - name: 'client', - label: t('Client'), - field: (row) => row?.nickname, + name: 'city', + label: t('City'), + field: (row) => row?.city, sortable: false, align: 'left', }, From baf1c56b56063c977faf6f89862d898d6fd6ff37 Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 10 Mar 2025 08:13:39 +0100 Subject: [PATCH 02/17] fix: agency list filters --- src/components/VnTable/VnFilter.vue | 3 +- src/components/VnTable/VnTable.vue | 16 +++++++++-- src/pages/Route/Agency/AgencyList.vue | 28 ++++++++++--------- src/pages/Route/Agency/Card/AgencySummary.vue | 12 ++++---- src/pages/Route/Agency/locale/en.yml | 7 +++-- src/pages/Route/Agency/locale/es.yml | 5 ++-- src/pages/Route/locale/en.yml | 4 ++- src/pages/Route/locale/es.yml | 4 ++- 8 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue index e9660e4c2..82d7c772c 100644 --- a/src/components/VnTable/VnFilter.vue +++ b/src/components/VnTable/VnFilter.vue @@ -6,6 +6,7 @@ import VnSelect from 'components/common/VnSelect.vue'; import VnInput from 'components/common/VnInput.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputTime from 'components/common/VnInputTime.vue'; +import VnCheckbox from 'components/common/VnCheckbox.vue'; import VnColumn from 'components/VnTable/VnColumn.vue'; const $props = defineProps({ @@ -106,7 +107,7 @@ const components = { }, }, checkbox: { - component: markRaw(QCheckbox), + component: markRaw(VnCheckbox), event: updateEvent, attrs: { class: $props.showTitle ? 'q-py-sm' : 'q-px-md q-py-xs fit', diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index d0c657f8a..d323817b0 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -920,12 +920,24 @@ const rowCtrlClickFunction = computed(() => { :row-index="index" > diff --git a/src/pages/Route/Agency/AgencyList.vue b/src/pages/Route/Agency/AgencyList.vue index 5c2904bf3..c01dd272c 100644 --- a/src/pages/Route/Agency/AgencyList.vue +++ b/src/pages/Route/Agency/AgencyList.vue @@ -2,10 +2,13 @@ import { computed } from 'vue'; import { useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; +import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import VnTable from 'components/VnTable/VnTable.vue'; import VnSection from 'src/components/common/VnSection.vue'; +import AgencySummary from 'pages/Route/Agency/Card/AgencySummary.vue'; const { t } = useI18n(); +const { viewSummary } = useSummaryDialog(); const router = useRouter(); const dataKey = 'AgencyList'; function navigate(id) { @@ -40,16 +43,22 @@ const columns = computed(() => [ }, { align: 'left', - label: t('isOwn'), + label: t('agency.isOwn'), name: 'isOwn', component: 'checkbox', + columnFilter: { + inWhere: true, + }, cardVisible: true, }, { align: 'left', - label: t('isAnyVolumeAllowed'), + label: t('agency.isAnyVolumeAllowed'), name: 'isAnyVolumeAllowed', component: 'checkbox', + columnFilter: { + inWhere: true, + }, cardVisible: true, }, { @@ -58,9 +67,10 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('Client ticket list'), + title: t('globals.pageTitles.summary'), icon: 'preview', - action: (row) => navigate(row.id), + action: (row) => viewSummary(row?.id, AgencySummary), + isPrimary: true, }, ], }, @@ -82,7 +92,7 @@ const columns = computed(() => [ [ justify-content: center; } - - es: - isOwn: Tiene propietario - isAnyVolumeAllowed: Permite cualquier volumen - en: - isOwn: Has owner - isAnyVolumeAllowed: Allows any volume - diff --git a/src/pages/Route/Agency/Card/AgencySummary.vue b/src/pages/Route/Agency/Card/AgencySummary.vue index 71a6d1066..ab274939a 100644 --- a/src/pages/Route/Agency/Card/AgencySummary.vue +++ b/src/pages/Route/Agency/Card/AgencySummary.vue @@ -6,29 +6,31 @@ import { useI18n } from 'vue-i18n'; import CardSummary from 'components/ui/CardSummary.vue'; import VnLv from 'components/ui/VnLv.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; +import VnCheckbox from 'components/common/VnCheckbox.vue'; +const route = useRoute(); const $props = defineProps({ id: { type: Number, default: 0 } }); const { t } = useI18n(); -const entityId = computed(() => $props.id || useRoute().params.id); +const entityId = computed(() => $props.id || route.params.id);