import { h } from 'vue' import { ElTag } from 'element-plus' import ArtButtonTable from '@/components/core/forms/art-button-table/index.vue' import { $t } from '@/locales' export function createDeliveryItemTableColumns({ handleActionClick, t = $t } = {}) { return [ { type: 'selection', width: 48, align: 'center' }, { type: 'globalIndex', label: t('table.index'), width: 72, align: 'center' }, { prop: 'deliveryCode', label: t('pages.orders.deliveryItem.table.deliveryCode'), minWidth: 160, showOverflowTooltip: true, formatter: (row) => row.deliveryCode || '--' }, { prop: 'deliveryId', label: t('pages.orders.deliveryItem.table.deliveryId'), width: 110, align: 'right', formatter: (row) => row.deliveryId ?? '--' }, { prop: 'platItemId', label: t('pages.orders.deliveryItem.table.platItemId'), minWidth: 130, showOverflowTooltip: true, formatter: (row) => row.platItemId || '--' }, { prop: 'matnrCode', label: t('table.materialCode'), minWidth: 150, showOverflowTooltip: true, formatter: (row) => row.matnrCode || '--' }, { prop: 'maktx', label: t('table.materialName'), minWidth: 220, showOverflowTooltip: true, formatter: (row) => row.maktx || '--' }, { prop: 'fieldsIndex', label: t('pages.orders.deliveryItem.table.fieldsIndex'), minWidth: 150, showOverflowTooltip: true, formatter: (row) => row.fieldsIndex || '--' }, { prop: 'unit', label: t('table.unit'), width: 90, align: 'center', formatter: (row) => row.unit || '--' }, { prop: 'anfme', label: t('table.quantity'), width: 110, align: 'right', formatter: (row) => row.anfme ?? '--' }, { prop: 'workQty', label: t('pages.orders.deliveryItem.table.workQty'), width: 110, align: 'right', formatter: (row) => row.workQty ?? '--' }, { prop: 'qty', label: t('pages.orders.deliveryItem.table.qty'), width: 110, align: 'right', formatter: (row) => row.qty ?? '--' }, { prop: 'nromQty', label: t('pages.orders.deliveryItem.table.nromQty'), width: 110, align: 'right', formatter: (row) => row.nromQty ?? '--' }, { prop: 'printQty', label: t('pages.orders.deliveryItem.table.printQty'), width: 110, align: 'right', formatter: (row) => row.printQty ?? '--' }, { prop: 'splrName', label: t('pages.orders.deliveryItem.table.supplierName'), minWidth: 180, showOverflowTooltip: true, formatter: (row) => row.splrName || '--' }, { prop: 'splrCode', label: t('pages.orders.deliveryItem.table.supplierCode'), minWidth: 140, showOverflowTooltip: true, formatter: (row) => row.splrCode || '--' }, { prop: 'splrBatch', label: t('table.supplierBatch'), minWidth: 140, showOverflowTooltip: true, formatter: (row) => row.splrBatch || '--' }, { prop: 'status', label: t('table.status'), width: 96, align: 'center', formatter: (row) => h(ElTag, { type: row.statusType || 'info', effect: 'light' }, () => row.statusText || '--') }, { prop: 'memo', label: t('table.memo'), minWidth: 180, showOverflowTooltip: true, formatter: (row) => row.memo || '--' }, { prop: 'operation', label: t('table.operation'), width: 92, fixed: 'right', formatter: (row) => h(ArtButtonTable, { type: 'view', onClick: () => handleActionClick?.(row) }) } ] }