import { h } from 'vue' import { ElProgress, ElTag } from 'element-plus' import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' import { getWaveActionList } from './wavePage.helpers' export function createWaveTableColumns({ handleActionClick }) { return [ { type: 'selection', width: 48, align: 'center' }, { type: 'globalIndex', label: '序号', width: 72, align: 'center' }, { prop: 'code', label: '波次单号', minWidth: 170, showOverflowTooltip: true }, { prop: 'typeLabel', label: '波次类型', width: 110 }, { prop: 'exceStatusText', label: '波次状态', width: 120, formatter: (row) => h( ElTag, { type: row.exceStatusTagType || 'info', effect: 'light' }, () => row.exceStatusText ) }, { prop: 'anfme', label: '应盘数量', width: 110, align: 'right' }, { prop: 'workQty', label: '执行数量', width: 110, align: 'right' }, { prop: 'qty', label: '已盘数量', width: 110, align: 'right' }, { prop: 'orderNum', label: '单据数量', width: 110, align: 'right' }, { prop: 'progress', label: '进度', width: 160, formatter: (row) => h(ElProgress, { percentage: Number(row.progress || 0), strokeWidth: 10, status: row.progress >= 100 ? 'success' : undefined, striped: false, showText: true }) }, { prop: 'createTimeText', label: '创建时间', minWidth: 170, showOverflowTooltip: true }, { prop: 'updateTimeText', label: '更新时间', minWidth: 170, showOverflowTooltip: true }, { prop: 'statusLabel', label: '状态', width: 100, formatter: (row) => h( ElTag, { type: Number(row.status) === 1 ? 'success' : 'danger', effect: 'light' }, () => row.statusLabel ) }, { prop: 'operation', label: '操作', width: 120, align: 'center', fixed: 'right', formatter: (row) => h(ArtButtonMore, { list: getWaveActionList(row), onClick: (item) => handleActionClick(item, row) }) } ] } export function createWavePreviewItemColumns() { return [ { type: 'globalIndex', label: '序号', width: 72, align: 'center' }, { prop: 'waveCode', label: '波次号', minWidth: 170, showOverflowTooltip: true }, { prop: 'orderCode', label: '单据编码', minWidth: 170, showOverflowTooltip: true }, { prop: 'matnrCode', label: '物料编码', minWidth: 150, showOverflowTooltip: true }, { prop: 'maktx', label: '物料名称', minWidth: 220, showOverflowTooltip: true }, { prop: 'batch', label: '批次', minWidth: 130, showOverflowTooltip: true }, { prop: 'unit', label: '单位', width: 90 }, { prop: 'anfme', label: '应配数量', width: 110, align: 'right' }, { prop: 'workQty', label: '已配数量', width: 110, align: 'right' }, { prop: 'stockQty', label: '库存数量', width: 110, align: 'right' }, { prop: 'splrBatch', label: '供应商批次', minWidth: 150, showOverflowTooltip: true }, { prop: 'stockLocsText', label: '库位', minWidth: 220, showOverflowTooltip: true } ] } export function createWaveDetailItemColumns() { return createWavePreviewItemColumns() }