| | |
| | | import { h } from 'vue' |
| | | import { ElTag } from 'element-plus' |
| | | import { ElLink, ElTag } from 'element-plus' |
| | | import { $t } from '@/locales' |
| | | import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' |
| | | import { getTransferActionList } from './transferPage.helpers.js' |
| | | import TransferOrdersPanel from './modules/transfer-orders-panel.vue' |
| | | |
| | | export function createTransferTableColumns({ handleActionClick } = {}) { |
| | | export function createTransferTableColumns({ handleActionClick, handleViewOrder } = {}) { |
| | | return [ |
| | | { |
| | | type: 'expand', |
| | | width: 56, |
| | | formatter: (row) => ({ |
| | | render() { |
| | | return h(TransferOrdersPanel, { |
| | | transferId: row.id, |
| | | transferCode: row.code, |
| | | onOrderView: handleViewOrder |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | { 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: 'center', |
| | | formatter: (row) => row.id ?? '--' |
| | | }, |
| | | { |
| | | prop: 'code', |
| | | label: $t('pages.orders.transfer.search.code'), |
| | |
| | | minWidth: 120, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => |
| | | h(ElTag, { type: row.sourceTagType || 'info', effect: 'light' }, () => row.sourceText || '--') |
| | | h( |
| | | ElTag, |
| | | { type: row.sourceTagType || 'info', effect: 'light' }, |
| | | () => row.sourceText || '--' |
| | | ) |
| | | }, |
| | | { |
| | | prop: 'orgWareName', |
| | |
| | | label: $t('pages.orders.transfer.search.exceStatus'), |
| | | minWidth: 120, |
| | | formatter: (row) => |
| | | h(ElTag, { type: row.exceStatusTagType || 'info', effect: 'light' }, () => row.exceStatusText || '--') |
| | | h( |
| | | ElTag, |
| | | { type: row.exceStatusTagType || 'info', effect: 'light' }, |
| | | () => row.exceStatusText || '--' |
| | | ) |
| | | }, |
| | | { |
| | | prop: 'statusText', |
| | |
| | | align: 'center', |
| | | formatter: (row) => |
| | | h(ElTag, { type: row.statusType || 'info', effect: 'light' }, () => row.statusText || '--') |
| | | }, |
| | | { |
| | | prop: 'updateByText', |
| | | label: $t('table.updateBy'), |
| | | minWidth: 120, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.updateByText || '--' |
| | | }, |
| | | { |
| | | prop: 'createByText', |
| | | label: $t('table.createBy'), |
| | | minWidth: 120, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.createByText || '--' |
| | | }, |
| | | { |
| | | prop: 'updateTimeText', |
| | |
| | | ] |
| | | } |
| | | |
| | | export function createTransferOrderTableColumns() { |
| | | export function createTransferOrderTableColumns({ handleViewOrder } = {}) { |
| | | return [ |
| | | { type: 'globalIndex', label: $t('table.index'), width: 72, align: 'center' }, |
| | | { |
| | |
| | | label: $t('pages.orders.transfer.detail.relatedCode'), |
| | | minWidth: 170, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.code || '--' |
| | | formatter: (row) => |
| | | row.code && typeof handleViewOrder === 'function' |
| | | ? h( |
| | | ElLink, |
| | | { |
| | | type: 'primary', |
| | | underline: 'hover', |
| | | onClick: () => handleViewOrder(row) |
| | | }, |
| | | () => row.code |
| | | ) |
| | | : row.code || '--' |
| | | }, |
| | | { |
| | | prop: 'poCode', |
| | |
| | | label: $t('pages.orders.transfer.detail.exceStatus'), |
| | | minWidth: 120, |
| | | formatter: (row) => |
| | | h(ElTag, { type: row.exceStatusTagType || 'info', effect: 'light' }, () => row.exceStatusText || '--') |
| | | h( |
| | | ElTag, |
| | | { type: row.exceStatusTagType || 'info', effect: 'light' }, |
| | | () => row.exceStatusText || '--' |
| | | ) |
| | | }, |
| | | { |
| | | prop: 'statusText', |