| | |
| | | import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' |
| | | import { getDeliveryActionList } from './deliveryPage.helpers.js' |
| | | |
| | | export function createDeliveryTableColumns({ handleActionClick } = {}) { |
| | | export function createDeliveryTableColumns({ |
| | | handleActionClick, |
| | | canEdit = true, |
| | | canDelete = true |
| | | } = {}) { |
| | | return [ |
| | | { type: 'selection', width: 48, align: 'center' }, |
| | | { type: 'globalIndex', label: $t('table.index'), width: 72, align: 'center' }, |
| | | { |
| | | prop: 'id', |
| | | label: $t('table.id'), |
| | | width: 100, |
| | | align: 'right', |
| | | visible: false, |
| | | formatter: (row) => row.id ?? '--' |
| | | }, |
| | | { |
| | | prop: 'code', |
| | | label: $t('pages.orders.delivery.search.code'), |
| | |
| | | }, |
| | | { |
| | | prop: 'status', |
| | | label: $t('pages.orders.transfer.search.status'), |
| | | label: $t('table.status'), |
| | | width: 96, |
| | | align: 'center', |
| | | formatter: (row) => |
| | |
| | | minWidth: 120, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => |
| | | h(ElTag, { type: row.exceStatusTagType || 'info', effect: 'light' }, () => row.exceStatusText || '--') |
| | | h( |
| | | ElTag, |
| | | { type: row.exceStatusTagType || 'info', effect: 'light' }, |
| | | () => row.exceStatusText || '--' |
| | | ) |
| | | }, |
| | | { |
| | | prop: 'startTimeText', |
| | |
| | | formatter: (row) => row.endTimeText || '--' |
| | | }, |
| | | { |
| | | prop: 'updateByText', |
| | | label: $t('table.updateBy'), |
| | | minWidth: 130, |
| | | visible: false, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.updateByText || '--' |
| | | }, |
| | | { |
| | | prop: 'updateTimeText', |
| | | label: $t('table.updateTime'), |
| | | minWidth: 170, |
| | | visible: false, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.updateTimeText || '--' |
| | | }, |
| | | { |
| | | prop: 'createByText', |
| | | label: $t('table.createBy'), |
| | | minWidth: 130, |
| | | visible: false, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.createByText || '--' |
| | | }, |
| | | { |
| | | prop: 'createTimeText', |
| | | label: $t('table.createTime'), |
| | | minWidth: 170, |
| | | visible: false, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.createTimeText || '--' |
| | | }, |
| | | { |
| | | prop: 'memo', |
| | | label: $t('pages.orders.delivery.search.memo'), |
| | | minWidth: 180, |
| | |
| | | fixed: 'right', |
| | | formatter: (row) => |
| | | h(ArtButtonMore, { |
| | | list: getDeliveryActionList(row), |
| | | list: getDeliveryActionList(row, { canEdit, canDelete }), |
| | | onClick: (item) => handleActionClick?.(item, row) |
| | | }) |
| | | } |