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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
| import type { VbenFormSchema } from '#/adapter/form';
| import type { VxeTableGridOptions } from '#/adapter/vxe-table';
| import type { MesQcInspectionLedgerApi } from '#/api/mes/qc/ledger';
|
| import { markRaw } from 'vue';
|
| import { DICT_TYPE } from '@vben/constants';
| import { getDictOptions } from '@vben/hooks';
|
| import { getSimpleUserList } from '#/api/system/user';
| import { getRangePickerDefaultProps } from '#/utils';
| import { MdmItemSelect } from '#/views/basicData/mdm/components';
|
| /** 列表的搜索表单 */
| export function useGridFormSchema(): VbenFormSchema[] {
| return [
| {
| fieldName: 'qcType',
| label: '分类',
| component: 'Select',
| componentProps: {
| allowClear: true,
| options: getDictOptions(DICT_TYPE.MES_QC_TYPE, 'number'),
| placeholder: '请选择分类',
| },
| },
| {
| fieldName: 'inspectDate',
| label: '检测日期',
| component: 'RangePicker',
| componentProps: {
| ...getRangePickerDefaultProps(),
| },
| },
| {
| fieldName: 'code',
| label: '检验单编号',
| component: 'Input',
| componentProps: {
| allowClear: true,
| placeholder: '请输入检验单编号',
| },
| },
| {
| fieldName: 'itemId',
| label: '产品物料',
| component: markRaw(MdmItemSelect),
| componentProps: {
| placeholder: '请选择产品物料',
| },
| },
| {
| fieldName: 'batchNo',
| label: '批次号',
| component: 'Input',
| componentProps: {
| allowClear: true,
| placeholder: '请输入批次号',
| },
| },
| {
| fieldName: 'checkResult',
| label: '检测结果',
| component: 'Select',
| componentProps: {
| allowClear: true,
| options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
| placeholder: '请选择检测结果',
| },
| },
| {
| fieldName: 'inspectorUserId',
| label: '检测人员',
| component: 'ApiSelect',
| componentProps: {
| allowClear: true,
| api: getSimpleUserList,
| labelField: 'nickname',
| placeholder: '请选择检测人员',
| valueField: 'id',
| },
| },
| ];
| }
|
| /** 列表的字段(一行一个检测项结果) */
| export function useGridColumns(): VxeTableGridOptions<MesQcInspectionLedgerApi.Ledger>['columns'] {
| return [
| {
| field: 'qcType',
| title: '分类',
| width: 130,
| cellRender: {
| name: 'CellDict',
| props: { type: DICT_TYPE.MES_QC_TYPE },
| },
| },
| {
| field: 'code',
| title: '检验单编号',
| width: 170,
| },
| {
| field: 'name',
| title: '检验单名称',
| minWidth: 180,
| showOverflow: 'tooltip',
| },
| {
| field: 'itemCode',
| title: '物料编码',
| width: 130,
| },
| {
| field: 'itemName',
| title: '物料名称',
| minWidth: 150,
| showOverflow: 'tooltip',
| },
| {
| field: 'itemSpecification',
| title: '规格型号',
| minWidth: 140,
| showOverflow: 'tooltip',
| },
| {
| field: 'batchNo',
| title: '批次号',
| width: 130,
| },
| {
| field: 'indicatorName',
| title: '检测项',
| minWidth: 140,
| showOverflow: 'tooltip',
| },
| {
| field: 'indicatorValue',
| title: '检测值',
| minWidth: 120,
| showOverflow: 'tooltip',
| },
| {
| field: 'judgementBasis',
| title: '判定依据',
| minWidth: 120,
| showOverflow: 'tooltip',
| },
| {
| field: 'checkResult',
| title: '检测结果',
| width: 110,
| cellRender: {
| name: 'CellDict',
| props: { type: DICT_TYPE.MES_QC_CHECK_RESULT },
| },
| },
| {
| field: 'checkQuantity',
| title: '检测数量',
| width: 100,
| },
| {
| field: 'qualifiedQuantity',
| title: '合格数量',
| width: 100,
| },
| {
| field: 'unqualifiedQuantity',
| title: '不合格数量',
| width: 110,
| },
| {
| field: 'inspectorName',
| title: '检测人员',
| width: 110,
| },
| {
| field: 'inspectDate',
| title: '检测日期',
| width: 170,
| formatter: 'formatDateTime',
| },
| {
| field: 'status',
| title: '单据状态',
| width: 110,
| cellRender: {
| name: 'CellDict',
| props: { type: DICT_TYPE.MES_ORDER_STATUS },
| },
| },
| {
| field: 'remark',
| title: '备注',
| minWidth: 160,
| showOverflow: 'tooltip',
| },
| ];
| }
|
|