zhou zhou
21 小时以前 c579731e0c206d6062f8442ec9df70ca781b26f6
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
67
68
69
70
import { h } from 'vue'
import { ElTag } from 'element-plus'
import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue'
import { getCheckDiffActionList, getCheckDiffStatusMeta } from './checkDiffPage.helpers'
 
export function createCheckDiffTableColumns({ handleActionClick } = {}) {
  return [
    { type: 'selection', width: 52, fixed: 'left' },
    {
      prop: 'orderCode',
      label: '盘点单号',
      minWidth: 160,
      showOverflowTooltip: true
    },
    {
      prop: 'checkTypeLabel',
      label: '盘点类型',
      width: 110,
      formatter: (row) => row.checkTypeLabel || '-'
    },
    {
      prop: 'areaName',
      label: '库区名称',
      minWidth: 140,
      showOverflowTooltip: true
    },
    {
      prop: 'anfme',
      label: '应盘数量',
      width: 110,
      formatter: (row) => row.anfme ?? '-'
    },
    {
      prop: 'checkQty',
      label: '已盘数量',
      width: 110,
      formatter: (row) => row.checkQty ?? '-'
    },
    {
      prop: 'exceStatus',
      label: '单据状态',
      width: 120,
      formatter: (row) => {
        const statusMeta = getCheckDiffStatusMeta(row.exceStatus ?? row.exceStatus$)
        return h(ElTag, { type: statusMeta.type, effect: 'light' }, () => statusMeta.text)
      }
    },
    {
      prop: 'updateTimeText',
      label: '更新时间',
      minWidth: 180,
      sortable: true,
      formatter: (row) => row.updateTimeText || '-'
    },
    {
      prop: 'operation',
      label: '操作',
      width: 120,
      align: 'center',
      fixed: 'right',
      formatter: (row) =>
        h('div', [
          h(ArtButtonMore, {
            list: getCheckDiffActionList(row),
            onClick: (item) => handleActionClick?.(item, row)
          })
        ])
    }
  ]
}