import { h } from 'vue' import { ElTag } from 'element-plus' import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' import { getTransferActionList } from './transferPage.helpers.js' export function createTransferTableColumns({ handleActionClick } = {}) { return [ { type: 'selection', width: 48, align: 'center' }, { type: 'globalIndex', label: '序号', width: 72, align: 'center' }, { prop: 'code', label: '调拨单号', minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.code || '--' }, { prop: 'typeLabel', label: '调拨类型', minWidth: 120, showOverflowTooltip: true, formatter: (row) => row.typeLabel || '--' }, { prop: 'sourceText', label: '来源', minWidth: 120, showOverflowTooltip: true, formatter: (row) => h(ElTag, { type: row.sourceTagType || 'info', effect: 'light' }, () => row.sourceText || '--') }, { prop: 'orgWareName', label: '源仓库', minWidth: 160, showOverflowTooltip: true, formatter: (row) => row.orgWareName || '--' }, { prop: 'tarWareName', label: '目标仓库', minWidth: 160, showOverflowTooltip: true, formatter: (row) => row.tarWareName || '--' }, { prop: 'orgAreaName', label: '源库区', minWidth: 160, showOverflowTooltip: true, formatter: (row) => row.orgAreaName || '--' }, { prop: 'tarAreaName', label: '目标库区', minWidth: 160, showOverflowTooltip: true, formatter: (row) => row.tarAreaName || '--' }, { prop: 'exceStatusText', label: '执行状态', minWidth: 120, formatter: (row) => h(ElTag, { type: row.exceStatusTagType || 'info', effect: 'light' }, () => row.exceStatusText || '--') }, { prop: 'statusText', label: '状态', width: 96, align: 'center', formatter: (row) => h(ElTag, { type: row.statusType || 'info', effect: 'light' }, () => row.statusText || '--') }, { prop: 'updateTimeText', label: '更新时间', minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.updateTimeText || '--' }, { prop: 'createTimeText', label: '创建时间', minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.createTimeText || '--' }, { prop: 'memo', label: '备注', minWidth: 180, showOverflowTooltip: true, formatter: (row) => row.memo || '--' }, { prop: 'operation', label: '操作', width: 120, align: 'center', fixed: 'right', formatter: (row) => h(ArtButtonMore, { list: getTransferActionList(row), onClick: (item) => handleActionClick?.(item, row) }) } ] } export function createTransferOrderTableColumns() { return [ { type: 'globalIndex', label: '序号', width: 72, align: 'center' }, { prop: 'code', label: '关联单号', minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.code || '--' }, { prop: 'poCode', label: '调拨单号', minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.poCode || '--' }, { prop: 'typeLabel', label: '单据类型', minWidth: 120, showOverflowTooltip: true, formatter: (row) => row.typeLabel || '--' }, { prop: 'wkTypeLabel', label: '业务类型', minWidth: 120, showOverflowTooltip: true, formatter: (row) => row.wkTypeLabel || '--' }, { prop: 'exceStatusText', label: '执行状态', minWidth: 120, formatter: (row) => h(ElTag, { type: row.exceStatusTagType || 'info', effect: 'light' }, () => row.exceStatusText || '--') }, { prop: 'statusText', label: '状态', width: 96, align: 'center', formatter: (row) => h(ElTag, { type: row.statusType || 'info', effect: 'light' }, () => row.statusText || '--') }, { prop: 'anfme', label: '数量', width: 110, align: 'right', formatter: (row) => row.anfme ?? '--' }, { prop: 'workQty', label: '执行数量', width: 110, align: 'right', formatter: (row) => row.workQty ?? '--' }, { prop: 'qty', label: '已完成数量', width: 110, align: 'right', formatter: (row) => row.qty ?? '--' }, { prop: 'stationId', label: '站点', minWidth: 120, showOverflowTooltip: true, formatter: (row) => row.stationId || '--' }, { prop: 'businessTimeText', label: '业务时间', minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.businessTimeText || '--' }, { prop: 'createTimeText', label: '创建时间', minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.createTimeText || '--' } ] }