zhou zhou
10 小时以前 e12fb4e6e8e0a408e81ce05a269a15cc535d8c78
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { h } from 'vue'
import ArtButtonTable from '@/components/core/forms/art-button-table/index.vue'
 
function createTextColumn(prop, label, minWidth, { align, formatter } = {}) {
  return {
    prop,
    label,
    minWidth,
    align,
    showOverflowTooltip: true,
    formatter: formatter || ((row) => row?.[prop] || '-')
  }
}
 
export function createAsnOrderItemTableColumns({ handleView } = {}) {
  return [
    { type: 'globalIndex', label: '序号', width: 72, align: 'center' },
    createTextColumn('poCode', 'PO单号', 160),
    createTextColumn('wkTypeLabel', '业务类型', 120),
    createTextColumn('typeLabel', '单据类型', 110),
    createTextColumn('purchaseOrgName', '采购组织', 150),
    createTextColumn('purchaseUserName', '采购员', 120),
    createTextColumn('supplierName', '供应商', 160),
    createTextColumn('platWorkCode', '计划跟踪号', 150),
    createTextColumn('platItemId', '行号', 110),
    createTextColumn('matnrCode', '物料编码', 160),
    createTextColumn('maktx', '物料名称', 220),
    createTextColumn('batch', '供应商批次', 140),
    createTextColumn('stockUnit', '库存单位', 110),
    {
      prop: 'anfme',
      label: '送货数量',
      width: 110,
      align: 'right',
      formatter: (row) => row.anfme ?? 0
    },
    {
      prop: 'qty',
      label: '已收数量',
      width: 110,
      align: 'right',
      formatter: (row) => row.qty ?? 0
    },
    createTextColumn('targetWarehouseId', '建议目标仓', 140),
    createTextColumn('businessTimeText', '业务时间', 180),
    createTextColumn('updateTimeText', '更新时间', 180),
    {
      prop: 'operation',
      label: '操作',
      width: 110,
      fixed: 'right',
      align: 'right',
      formatter: (row) =>
        h(
          'div',
          { class: 'flex justify-end' },
          [
            h(ArtButtonTable, {
              type: 'view',
              onClick: () => handleView?.(row)
            })
          ]
        )
    }
  ]
}