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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
| import type { VbenFormSchema } from '#/adapter/form';
| import type { VxeTableGridOptions } from '#/adapter/vxe-table';
| import type { MesProPalletApi } from '#/api/mes/pro/pallet';
|
| import { DICT_TYPE } from '@vben/constants';
| import { getDictOptions } from '@vben/hooks';
|
| import { getRangePickerDefaultProps } from '#/utils';
|
| /** 列表的搜索表单 */
| export function useGridFormSchema(): VbenFormSchema[] {
| return [
| {
| fieldName: 'code',
| label: '托盘码',
| component: 'Input',
| componentProps: {
| allowClear: true,
| placeholder: '请输入托盘码',
| },
| },
| {
| fieldName: 'batchCode',
| label: '批次号',
| component: 'Input',
| componentProps: {
| allowClear: true,
| placeholder: '请输入批次号',
| },
| },
| {
| fieldName: 'status',
| label: '托盘状态',
| component: 'Select',
| componentProps: {
| allowClear: true,
| options: getDictOptions(DICT_TYPE.MES_PRO_PALLET_STATUS, 'number'),
| placeholder: '请选择托盘状态',
| },
| },
| {
| fieldName: 'createTime',
| label: '创建时间',
| component: 'RangePicker',
| componentProps: {
| ...getRangePickerDefaultProps(),
| allowClear: true,
| },
| },
| ];
| }
|
| /** 列表的字段 */
| export function useGridColumns(): VxeTableGridOptions<MesProPalletApi.Pallet>['columns'] {
| return [
| {
| field: 'code',
| title: '托盘码',
| fixed: 'left',
| minWidth: 210,
| },
| {
| field: 'palletNo',
| title: '托盘序号',
| width: 90,
| },
| {
| field: 'batchCode',
| title: '批次号',
| minWidth: 190,
| },
| {
| field: 'capacity',
| title: '可装袋数(袋/托盘)',
| width: 150,
| },
| {
| field: 'bagCount',
| title: '已绑袋码数量',
| width: 120,
| },
| {
| field: 'status',
| title: '托盘状态',
| width: 100,
| cellRender: {
| name: 'CellDict',
| props: { type: DICT_TYPE.MES_PRO_PALLET_STATUS },
| },
| },
| {
| field: 'remark',
| title: '备注',
| minWidth: 140,
| },
| {
| field: 'createTime',
| title: '创建时间',
| width: 170,
| formatter: 'formatDateTime',
| },
| {
| title: '操作',
| width: 200,
| fixed: 'right',
| slots: { default: 'actions' },
| },
| ];
| }
|
|