refs #7283 itemFilters
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-09-16 14:29:39 +02:00
parent 70759b8a4e
commit 1916c6e4bf
2 changed files with 45 additions and 16 deletions

View File

@ -84,7 +84,7 @@ const columns = computed(() => [
align: 'left',
create: true,
columnFilter: {
name: 'description',
name: 'search',
},
},
{
@ -103,9 +103,10 @@ const columns = computed(() => [
align: 'left',
component: 'select',
columnFilter: {
name: 'typeFk',
attrs: {
url: 'ItemTypes',
fields: ['name'],
fields: ['id', 'name'],
},
},
columnField: {
@ -118,9 +119,12 @@ const columns = computed(() => [
name: 'category',
align: 'left',
component: 'select',
attrs: {
url: 'ItemCategories',
fields: ['id', 'name'],
columnFilter: {
name: 'categoryFk',
attrs: {
url: 'ItemCategories',
fields: ['id', 'name'],
},
},
columnField: {
component: null,
@ -131,9 +135,15 @@ const columns = computed(() => [
name: 'intrastat',
align: 'left',
component: 'select',
attrs: {
url: 'Intrastats',
fields: ['id', 'description'],
columnFilter: {
name: 'description',
attrs: {
url: 'Intrastats',
optionValue: 'description',
optionLabel: 'description',
},
inWhere: true,
alias: 'intr',
},
columnField: {
component: null,
@ -145,9 +155,15 @@ const columns = computed(() => [
name: 'origin',
align: 'left',
component: 'select',
attrs: {
url: 'Origins',
fields: ['id', 'name'],
columnFilter: {
name: 'id',
attrs: {
url: 'Origins',
optionValue: 'id',
optionLabel: 'code',
},
inWhere: true,
alias: 'ori',
},
columnField: {
component: null,
@ -158,6 +174,14 @@ const columns = computed(() => [
label: t('item.list.userName'),
name: 'userName',
align: 'left',
columnFilter: {
name: 'workerFk',
attrs: {
url: 'Users',
optionValue: 'id',
optionLabel: 'userName',
},
},
},
{
label: t('item.list.weightByPiece'),
@ -249,8 +273,6 @@ const cloneItem = async (itemFk) => {
data-key="ItemList"
url="Items/filter"
url-create="Items"
save-url="Items/crud"
:filter="itemFilter"
:create="{
urlCreate: 'Items',
title: 'Create Item',
@ -264,7 +286,7 @@ const cloneItem = async (itemFk) => {
auto-load
redirect="Item"
:is-editable="false"
:use-model="true"
:filer="itemFilter"
>
<template #column-userName="{ row }">
<span class="link" @click.stop>

View File

@ -57,45 +57,51 @@ const columns = computed(() => [
component: null,
},
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.shipped)),
columnClass: 'shrink',
},
{
label: t('globals.description'),
field: 'description',
name: 'description',
align: 'left',
columnClass: 'expand',
},
{
label: t('item.buyRequest.requester'),
name: 'requesterName',
align: 'left',
columnClass: 'shrink',
},
{
label: t('item.buyRequest.requested'),
name: 'quantity',
align: 'left',
columnClass: 'shrink',
},
{
label: t('item.buyRequest.price'),
name: 'price',
align: 'left',
format: (row) => toCurrency(row.price),
columnClass: 'shrink',
},
{
label: t('item.buyRequest.attender'),
name: 'attenderName',
align: 'left',
columnClass: 'shrink',
},
{
label: t('item.buyRequest.item'),
name: 'item',
align: 'left',
component: 'input',
columnClass: 'expand',
},
{
label: t('item.buyRequest.achieved'),
name: 'achieved',
align: 'left',
component: 'input',
columnClass: 'shrink',
},
{
label: t('item.buyRequest.concept'),
@ -103,6 +109,7 @@ const columns = computed(() => [
align: 'left',
sortable: true,
component: 'input',
columnClass: 'expand',
},
{
label: t('item.buyRequest.state'),