diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue index c93c326a6..0dd7ca07d 100644 --- a/src/pages/Item/ItemFixedPrice.vue +++ b/src/pages/Item/ItemFixedPrice.vue @@ -93,53 +93,47 @@ const getColumnInputEvents = (col) => { }; }; +const defaultColumnFilter = { + component: VnInput, + 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',