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 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',

View File

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

View File

@ -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(() => [
<VnTable
:data-key
:columns="columns"
is-editable="false"
:is-editable="false"
:right-search="false"
:use-model="true"
redirect="route/agency"
@ -103,11 +113,3 @@ const columns = computed(() => [
justify-content: center;
}
</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 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);
</script>
<template>
<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 #body="{ entity: agency }">
<QCard class="vn-one">
<VnTitle
:url="`#/agency/${entityId}/basic-data`"
:url="`#/${route.meta.moduleName.toLowerCase()}/agency/${entityId}/basic-data`"
:text="t('globals.pageTitles.basicData')"
/>
<VnLv :label="t('globals.name')" :value="agency.name" />
<QCheckbox
<VnCheckbox
:label="t('agency.isOwn')"
v-model="agency.isOwn"
:disable="true"
/>
<QCheckbox
<VnCheckbox
:label="t('agency.isAnyVolumeAllowed')"
v-model="agency.isAnyVolumeAllowed"
:disable="true"

View File

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

View File

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

View File

@ -16,6 +16,8 @@ route:
shipped: Shipped
agencyAgreement: Agency agreement
agencyModeName: Agency route
isOwn: Own
isAnyVolumeallowed: Any volume allowed
Worker: Worker
Agency: Agency
Vehicle: Vehicle
@ -54,4 +56,4 @@ route:
clientFk: Client id
shipped: Preparation date
viewCmr: View CMR
downloadCmrs: Download CMRs
downloadCmrs: Download CMRs

View File

@ -16,6 +16,8 @@ route:
ticketFk: Id ticket
routeFK: Id ruta
shipped: Fecha preparación
isOwn: Propio
isAnyVolumeAllowed: Cualquier volumen
Worker: Trabajador
Agency: Agencia
Vehicle: Vehículo
@ -55,4 +57,4 @@ route:
clientFk: Id cliente
shipped: Fecha preparación
viewCmr: Ver CMR
downloadCmrs: Descargar CMRs
downloadCmrs: Descargar CMRs