Merge pull request 'fix: agency list filters' (!1581) from warmFix_8688-fixAgencyFilters into test
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #1581
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
Reviewed-by: Pablo Natek <pablone@verdnatura.es>
This commit is contained in:
Jose Antonio Tubau 2025-03-13 06:15:39 +00:00
commit d51afa01c9
8 changed files with 50 additions and 29 deletions

View File

@ -6,6 +6,7 @@ import VnSelect from 'components/common/VnSelect.vue';
import VnInput from 'components/common/VnInput.vue'; import VnInput from 'components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputTime from 'components/common/VnInputTime.vue'; import VnInputTime from 'components/common/VnInputTime.vue';
import VnCheckbox from 'components/common/VnCheckbox.vue';
import VnColumn from 'components/VnTable/VnColumn.vue'; import VnColumn from 'components/VnTable/VnColumn.vue';
const $props = defineProps({ const $props = defineProps({
@ -106,7 +107,7 @@ const components = {
}, },
}, },
checkbox: { checkbox: {
component: markRaw(QCheckbox), component: markRaw(VnCheckbox),
event: updateEvent, event: updateEvent,
attrs: { attrs: {
class: $props.showTitle ? 'q-py-sm' : 'q-px-md q-py-xs fit', class: $props.showTitle ? 'q-py-sm' : 'q-px-md q-py-xs fit',

View File

@ -920,12 +920,24 @@ const rowCtrlClickFunction = computed(() => {
:row-index="index" :row-index="index"
> >
<VnColumn <VnColumn
:column="col" :column="{
...col,
disable:
col?.component ===
'checkbox'
? true
: false,
}"
:row="row" :row="row"
:is-editable="false" :is-editable="false"
v-model="row[col.name]" v-model="row[col.name]"
component-prop="columnField" component-prop="columnField"
:show-label="true" :show-label="
col?.component ===
'checkbox'
? false
: true
"
/> />
</slot> </slot>
</span> </span>

View File

@ -2,10 +2,13 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue'; import VnSection from 'src/components/common/VnSection.vue';
import AgencySummary from 'pages/Route/Agency/Card/AgencySummary.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const router = useRouter(); const router = useRouter();
const dataKey = 'AgencyList'; const dataKey = 'AgencyList';
function navigate(id) { function navigate(id) {
@ -40,16 +43,22 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('isOwn'), label: t('agency.isOwn'),
name: 'isOwn', name: 'isOwn',
component: 'checkbox', component: 'checkbox',
columnFilter: {
inWhere: true,
},
cardVisible: true, cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('isAnyVolumeAllowed'), label: t('agency.isAnyVolumeAllowed'),
name: 'isAnyVolumeAllowed', name: 'isAnyVolumeAllowed',
component: 'checkbox', component: 'checkbox',
columnFilter: {
inWhere: true,
},
cardVisible: true, cardVisible: true,
}, },
{ {
@ -58,9 +67,10 @@ const columns = computed(() => [
name: 'tableActions', name: 'tableActions',
actions: [ actions: [
{ {
title: t('Client ticket list'), title: t('globals.pageTitles.summary'),
icon: 'preview', icon: 'preview',
action: (row) => navigate(row.id), action: (row) => viewSummary(row?.id, AgencySummary),
isPrimary: true,
}, },
], ],
}, },
@ -82,7 +92,7 @@ const columns = computed(() => [
<VnTable <VnTable
:data-key :data-key
:columns="columns" :columns="columns"
is-editable="false" :is-editable="false"
:right-search="false" :right-search="false"
:use-model="true" :use-model="true"
redirect="route/agency" redirect="route/agency"
@ -103,11 +113,3 @@ const columns = computed(() => [
justify-content: center; justify-content: center;
} }
</style> </style>
<i18n>
es:
isOwn: Tiene propietario
isAnyVolumeAllowed: Permite cualquier volumen
en:
isOwn: Has owner
isAnyVolumeAllowed: Allows any volume
</i18n>

View File

@ -6,29 +6,31 @@ import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.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 $props = defineProps({ id: { type: Number, default: 0 } });
const { t } = useI18n(); const { t } = useI18n();
const entityId = computed(() => $props.id || useRoute().params.id); const entityId = computed(() => $props.id || route.params.id);
</script> </script>
<template> <template>
<div class="q-pa-md"> <div class="q-pa-md">
<CardSummary :url="`Agencies/${entityId}`" data-key="Agency"> <CardSummary :url="`Agencies/${entityId}`" data-key="Agency" module-name="Agency">
<template #header="{ entity: agency }">{{ agency.name }}</template> <template #header="{ entity: agency }">{{ agency.name }}</template>
<template #body="{ entity: agency }"> <template #body="{ entity: agency }">
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle <VnTitle
:url="`#/agency/${entityId}/basic-data`" :url="`#/${route.meta.moduleName.toLowerCase()}/agency/${entityId}/basic-data`"
:text="t('globals.pageTitles.basicData')" :text="t('globals.pageTitles.basicData')"
/> />
<VnLv :label="t('globals.name')" :value="agency.name" /> <VnLv :label="t('globals.name')" :value="agency.name" />
<QCheckbox <VnCheckbox
:label="t('agency.isOwn')" :label="t('agency.isOwn')"
v-model="agency.isOwn" v-model="agency.isOwn"
:disable="true" :disable="true"
/> />
<QCheckbox <VnCheckbox
:label="t('agency.isAnyVolumeAllowed')" :label="t('agency.isAnyVolumeAllowed')"
v-model="agency.isAnyVolumeAllowed" v-model="agency.isAnyVolumeAllowed"
:disable="true" :disable="true"

View File

@ -1,11 +1,12 @@
agency: agency:
search: Search agency search: Search agency
searchInfo: You can search by name searchInfo: You can search by name and by id
isOwn: Own isOwn: Own
isAnyVolumeAllowed: Any volume allowed isAnyVolumeAllowed: Any volume allowed
removeItem: Agency removed successfully
notification: notification:
removeItemError: Error removing agency removeItemError: Error removing work center
removeItem: WorkCenter removed successfully removeItem: Work center removed successfully
pageTitles: pageTitles:
agency: Agency agency: Agency
searchBar: searchBar:

View File

@ -1,15 +1,14 @@
agency: agency:
search: Buscar agencia search: Buscar agencia
searchInfo: Puedes buscar por nombre searchInfo: Puedes buscar por nombre y por id
isOwn: Propio isOwn: Propio
isAnyVolumeAllowed: Cualquier volumen isAnyVolumeAllowed: Cualquier volumen
removeItem: Agencia eliminada correctamente removeItem: Agencia eliminada correctamente
notification: notification:
removeItemError: Error al eliminar la agencia removeItemError: Error al eliminar la el centro de trabajo
removeItem: Centro de trabajo eliminado correctamente removeItem: Centro de trabajo eliminado correctamente
pageTitles: pageTitles:
agency: Agencia agency: Agencia
searchBar: searchBar:
info: Puedes buscar por nombre o id info: Puedes buscar por nombre o id
label: Buscar agencia... label: Buscar agencia...

View File

@ -16,6 +16,8 @@ route:
shipped: Shipped shipped: Shipped
agencyAgreement: Agency agreement agencyAgreement: Agency agreement
agencyModeName: Agency route agencyModeName: Agency route
isOwn: Own
isAnyVolumeallowed: Any volume allowed
Worker: Worker Worker: Worker
Agency: Agency Agency: Agency
Vehicle: Vehicle Vehicle: Vehicle

View File

@ -16,6 +16,8 @@ route:
ticketFk: Id ticket ticketFk: Id ticket
routeFK: Id ruta routeFK: Id ruta
shipped: Fecha preparación shipped: Fecha preparación
isOwn: Propio
isAnyVolumeAllowed: Cualquier volumen
Worker: Trabajador Worker: Trabajador
Agency: Agencia Agency: Agencia
Vehicle: Vehículo Vehicle: Vehículo