Item Fixed prices #307

Merged
jsegarra merged 17 commits from :feature/FixedPrices into dev 2024-04-24 07:39:23 +00:00
1 changed files with 28 additions and 51 deletions
Showing only changes of commit e11625e05f - Show all commits

View File

@ -93,53 +93,47 @@ const getColumnInputEvents = (col) => {
};
};
const defaultColumnFilter = {
component: VnInput,
jsegarra marked this conversation as resolved Outdated

Propuesta, podemos definir un objeto configuración default y así reducir líneas?

Propuesta, podemos definir un objeto configuración default y así reducir líneas?

Estructuras en común entre columnas definidas y reutilizadas

Commit: e11625e05f

Estructuras en común entre columnas definidas y reutilizadas Commit: https://gitea.verdnatura.es/verdnatura/salix-front/commit/e11625e05f70cffadedc7b02c96c974725225886
type: 'text',
filterValue: null,
event: getColumnInputEvents,
attrs: {
dense: true,
},
};
const defaultColumnAttrs = {
align: 'left',
sortable: true,
};
const columns = computed(() => [
{
label: t('item.fixedPrice.itemId'),
name: 'itemId',
field: 'itemFk',
align: 'left',
sortable: true,
...defaultColumnAttrs,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getColumnInputEvents,
attrs: {
dense: true,
},
...defaultColumnFilter,
},
},
{
label: t('globals.description'),
field: 'name',
name: 'description',
align: 'left',
sortable: true,
...defaultColumnAttrs,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getColumnInputEvents,
attrs: {
dense: true,
},
...defaultColumnFilter,
},
},
{
label: t('item.fixedPrice.groupingPrice'),
field: 'rate2',
name: 'groupingPrice',
align: 'left',
sortable: true,
...defaultColumnAttrs,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getColumnInputEvents,
attrs: {
dense: true,
},
...defaultColumnFilter,
},
format: (val) => toCurrency(val),
},
@ -147,16 +141,9 @@ const columns = computed(() => [
label: t('item.fixedPrice.packingPrice'),
field: 'rate3',
name: 'packingPrice',
align: 'left',
sortable: true,
...defaultColumnAttrs,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getColumnInputEvents,
attrs: {
dense: true,
},
...defaultColumnFilter,
},
format: (val) => dashIfEmpty(val),
},
@ -165,32 +152,23 @@ const columns = computed(() => [
label: t('item.fixedPrice.minPrice'),
field: 'minPrice',
name: 'minPrice',
align: 'left',
sortable: true,
...defaultColumnAttrs,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getColumnInputEvents,
attrs: {
dense: true,
},
...defaultColumnFilter,
},
},
{
label: t('item.fixedPrice.started'),
field: 'started',
name: 'started',
align: 'left',
sortable: true,
...defaultColumnAttrs,
columnFilter: null,
},
{
label: t('item.fixedPrice.ended'),
field: 'ended',
name: 'ended',
align: 'left',
sortable: true,
...defaultColumnAttrs,
columnFilter: null,
},
@ -198,8 +176,7 @@ const columns = computed(() => [
label: t('item.fixedPrice.warehouse'),
field: 'warehouseFk',
name: 'warehouse',
align: 'left',
sortable: true,
...defaultColumnAttrs,
columnFilter: {
component: VnSelectFilter,
type: 'select',