feat: refs #8117 filters and values added as needed
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jose Antonio Tubau 2024-12-26 08:29:29 +01:00
parent 790c82926b
commit 7a2de50d7d
15 changed files with 81 additions and 60 deletions

View File

@ -194,10 +194,10 @@ function filter(val, options) {
} }
if (!row) return; if (!row) return;
const id = row[$props.optionValue]; const id = String(row[$props.optionValue]);
const optionLabel = String(row[$props.optionLabel]).toLowerCase(); const optionLabel = String(row[$props.optionLabel]).toLowerCase();
return id == search || optionLabel.includes(search); return id.includes(search) || optionLabel.includes(search);
}); });
} }

View File

@ -51,6 +51,7 @@ const url = computed(() => {
option-value="id" option-value="id"
option-label="nickname" option-label="nickname"
:fields="['id', 'name', 'nickname', 'code']" :fields="['id', 'name', 'nickname', 'code']"
:filter-options="['id', 'name', 'nickname', 'code']"
sort-by="nickname ASC" sort-by="nickname ASC"
> >
<template #prepend v-if="$props.hasAvatar"> <template #prepend v-if="$props.hasAvatar">
@ -71,7 +72,7 @@ const url = computed(() => {
{{ scope.opt.nickname }} {{ scope.opt.nickname }}
</QItemLabel> </QItemLabel>
<QItemLabel caption v-else> <QItemLabel caption v-else>
{{ scope.opt.nickname }}, {{ scope.opt.code }} #{{ scope.opt.id }}, {{ scope.opt.nickname }}, {{ scope.opt.code }}
</QItemLabel> </QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>

View File

@ -93,16 +93,7 @@ defineExpose({ states });
outlined outlined
rounded rounded
dense dense
> />
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
<QItemLabel caption>{{ scope.opt?.name }}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect <VnSelect
:label="t('claim.responsible')" :label="t('claim.responsible')"
v-model="params.claimResponsibleFk" v-model="params.claimResponsibleFk"

View File

@ -123,6 +123,7 @@ const companiesOptions = ref([]);
option-value="id" option-value="id"
option-label="name" option-label="name"
:fields="['id', 'name', 'nickname']" :fields="['id', 'name', 'nickname']"
:filter-options="['id', 'name', 'nickname']"
sort-by="nickname" sort-by="nickname"
hide-selected hide-selected
dense dense
@ -132,9 +133,12 @@ const companiesOptions = ref([]);
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
<QItemLabel>{{ <QItemLabel>
scope.opt?.name + ': ' + scope.opt?.nickname {{ scope.opt?.name}}
}}</QItemLabel> </QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>

View File

@ -69,12 +69,14 @@ const tagValues = ref([]);
use-input use-input
@update:model-value="searchFn()" @update:model-value="searchFn()"
> >
<template #option="{ itemProps, opt }"> <template #option="scope">
<QItem v-bind="itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel> <QItemLabel>
{{ scope.opt?.name}}
</QItemLabel>
<QItemLabel caption> <QItemLabel caption>
{{ opt.nickname }} {{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel> </QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>

View File

@ -68,13 +68,26 @@ function handleDaysAgo(params, daysAgo) {
<VnSelect <VnSelect
v-model="params.supplierFk" v-model="params.supplierFk"
url="Suppliers" url="Suppliers"
:fields="['id', 'nickname']" :fields="['id', 'nickname', 'name']"
:label="getLocale('supplierFk')" :label="getLocale('supplierFk')"
option-label="nickname" option-label="nickname"
dense dense
outlined outlined
rounded rounded
/> >
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.name}}
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>

View File

@ -178,18 +178,18 @@ const cols = computed(() => [
<VnSelect <VnSelect
v-model="data.supplierFk" v-model="data.supplierFk"
url="Suppliers" url="Suppliers"
:fields="['id', 'nickname']" :fields="['id', 'nickname', 'name']"
:label="t('globals.supplier')" :label="t('globals.supplier')"
option-value="id" option-value="id"
option-label="nickname" option-label="nickname"
:filter-options="['id', 'name']" :filter-options="['id', 'name', 'nickname']"
:required="true" :required="true"
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel> <QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel> <QItemLabel caption> #{{ scope.opt?.id }}, {{ scope.opt?.name }} </QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>

View File

@ -101,17 +101,7 @@ onMounted(async () => {
dense dense
outlined outlined
rounded rounded
> />
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
#{{ scope.opt?.id }} {{ scope.opt?.name }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect <VnSelect
:label="t('invoiceOutSerialType')" :label="t('invoiceOutSerialType')"
v-model="formData.serialType" v-model="formData.serialType"

View File

@ -139,6 +139,17 @@ const columns = computed(() => [
label: t('item.list.typeName'), label: t('item.list.typeName'),
name: 'typeName', name: 'typeName',
align: 'left', align: 'left',
component: 'select',
columnFilter: {
name: 'typeFk',
attrs: {
url: 'ItemTypes',
fields: ['id', 'name'],
},
},
columnField: {
component: null,
}
}, },
{ {
label: t('item.list.category'), label: t('item.list.category'),

View File

@ -199,17 +199,7 @@ onMounted(async () => {
dense dense
outlined outlined
rounded rounded
> />
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
t(`params.${scope.opt?.name}`)
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
@ -265,6 +255,7 @@ onMounted(async () => {
option-value="id" option-value="id"
option-label="name" option-label="name"
:fields="['id', 'name', 'nickname']" :fields="['id', 'name', 'nickname']"
:filter-options="['id', 'name', 'nickname']"
sort-by="name ASC" sort-by="name ASC"
hide-selected hide-selected
dense dense
@ -274,9 +265,12 @@ onMounted(async () => {
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
<QItemLabel>{{ <QItemLabel>
scope.opt?.name + ': ' + scope.opt?.nickname {{ scope.opt?.name}}
}}</QItemLabel> </QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
@ -375,6 +369,7 @@ onMounted(async () => {
:model-value="fieldFilter.selectedField" :model-value="fieldFilter.selectedField"
:options="moreFields" :options="moreFields"
option-label="label" option-label="label"
option-value="label"
dense dense
outlined outlined
rounded rounded

View File

@ -149,7 +149,6 @@ onMounted(async () => {
:label="t('params.requesterFk')" :label="t('params.requesterFk')"
v-model="params.requesterFk" v-model="params.requesterFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
:fields="['id', 'name']"
:params="{ departmentCodes: ['VT'] }" :params="{ departmentCodes: ['VT'] }"
hide-selected hide-selected
dense dense

View File

@ -97,6 +97,7 @@ const sourceList = ref([]);
v-model="params.sourceApp" v-model="params.sourceApp"
:options="sourceList" :options="sourceList"
option-label="value" option-label="value"
option-value="value"
dense dense
outlined outlined
rounded rounded

View File

@ -101,7 +101,7 @@ const getGroupedStates = (data) => {
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="states"> <QItemSection v-if="states">
<QSelect <VnSelect
:label="t('State')" :label="t('State')"
v-model="params.stateFk" v-model="params.stateFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
@ -122,7 +122,7 @@ const getGroupedStates = (data) => {
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="groupedStates"> <QItemSection v-if="groupedStates">
<QSelect <VnSelect
:label="t('Grouped state')" :label="t('Grouped state')"
v-model="params.groupedStates" v-model="params.groupedStates"
@update:model-value="searchFn()" @update:model-value="searchFn()"
@ -217,7 +217,7 @@ const getGroupedStates = (data) => {
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="provinces"> <QItemSection v-if="provinces">
<QSelect <VnSelect
:label="t('Province')" :label="t('Province')"
v-model="params.provinceFk" v-model="params.provinceFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
@ -238,7 +238,7 @@ const getGroupedStates = (data) => {
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="agencies"> <QItemSection v-if="agencies">
<QSelect <VnSelect
:label="t('Agency')" :label="t('Agency')"
v-model="params.agencyModeFk" v-model="params.agencyModeFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
@ -259,7 +259,7 @@ const getGroupedStates = (data) => {
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="warehouses"> <QItemSection v-if="warehouses">
<QSelect <VnSelect
:label="t('Warehouse')" :label="t('Warehouse')"
v-model="params.warehouseFk" v-model="params.warehouseFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"

View File

@ -221,7 +221,20 @@ warehouses();
dense dense
outlined outlined
rounded rounded
/> >
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.name}}
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
@ -232,6 +245,7 @@ warehouses();
:options="continentsOptions" :options="continentsOptions"
option-value="code" option-value="code"
option-label="name" option-label="name"
:filter-options="['code', 'name']"
hide-selected hide-selected
dense dense
outlined outlined

View File

@ -140,10 +140,10 @@ en:
Id: Contains Id: Contains
ref: Reference ref: Reference
agency: Agency agency: Agency
warehouseInFk: W. In warehouseInFk: Warehouse In
shipped: Shipped shipped: Shipped
shipmentHour: Shipment Hour shipmentHour: Shipment Hour
warehouseOut: W. Out warehouseOut: Warehouse Out
landed: Landed landed: Landed
landingHour: Landing Hour landingHour: Landing Hour
totalEntries: Σ totalEntries: Σ
@ -156,7 +156,7 @@ es:
warehouseInFk: Alm.Entrada warehouseInFk: Alm.Entrada
shipped: F.Envío shipped: F.Envío
shipmentHour: Hora de envío shipmentHour: Hora de envío
warehouseOut: Alm.Entrada warehouseOut: Alm.Salida
landed: F.Entrega landed: F.Entrega
landingHour: Hora de entrega landingHour: Hora de entrega
totalEntries: Σ totalEntries: Σ