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
201
202
203
204
205
206
207
208
209
210
211
| import type { VxeGridProps } from '#/adapter/vxe-table';
|
| import { DictEnum } from '@vben/constants';
| import { getPopupContainer } from '@vben/utils';
|
| import { Badge } from 'ant-design-vue';
|
| import { type FormSchemaGetter } from '#/adapter/form';
| import { getDictOptions } from '#/utils/dict';
|
| export const querySchema: FormSchemaGetter = () => [
| {
| component: 'Input',
| fieldName: 'inventoryName',
| label: '盘点名称'
| },
| {
| component: 'Input',
| fieldName: 'inventoryCode',
| label: '盘点单号'
| },
| {
| component: 'TreeSelect',
| // 在drawer里更新 这里不需要默认的componentProps
| defaultValue: undefined,
| fieldName: 'userDept',
| label: '盘点部门',
| help: `盘点操作人员所属部门`
| // rules: 'selectRequired',
| },
| {
| component: 'Select',
| componentProps: {
| showSearch: true,
| allowClear: true,
| getPopupContainer
| },
| fieldName: 'inventoryUser',
| label: '盘点人'
| },
| {
| component: 'RangePicker',
| fieldName: 'startDate',
| label: '盘点日期',
| help: '开始盘点日期'
| }
| ];
|
| export const columns: VxeGridProps['columns'] = [
| { type: 'checkbox', width: 60, fixed: 'left' },
| {
| title: '盘点名称',
| field: 'inventoryName',
| minWidth: 100
| },
| {
| title: '盘点单号',
| field: 'inventoryCode',
| minWidth: 100,
| slots: { default: 'inventoryCode' }
| },
| {
| title: '盘点状态',
| field: 'status',
| minWidth: 100,
| slots: {
| default: ({ row }) => {
| const statu = row.status;
| switch (statu) {
| case '0': {
| return <Badge status="processing" text="盘点中" />;
| }
| case '1': {
| return <Badge status="success" text="盘点结束" />;
| }
| case null: {
| return <Badge status="processing" text="盘点中" />;
| }
| // No default
| }
| return '';
| }
| }
| },
| {
| title: '开始日期',
| field: 'startDate',
| sortable: true,
| minWidth: 120
| },
| {
| title: '结束日期',
| field: 'endDate',
| sortable: true,
| minWidth: 120
| },
| {
| title: '盘点人',
| field: 'inventoryUserName',
| minWidth: 100
| },
| {
| field: 'action',
| fixed: 'right',
| slots: { default: 'action' },
| title: '操作',
| width: 200
| }
| ];
|
| export const drawerSchema: FormSchemaGetter = () => [
| {
| component: 'Input',
| dependencies: {
| show: () => false,
| triggerFields: ['']
| },
| fieldName: 'inventoryId'
| },
| {
| component: 'Input',
| fieldName: 'inventoryName',
| label: '盘点名称'
| },
| {
| component: 'Input',
| fieldName: 'inventoryCode',
| label: '盘点单号'
| },
| {
| component: 'Radio',
| dependencies: {
| show: () => false,
| triggerFields: [''],
| },
| fieldName: 'checkStrictly',
| label: '父子联动'
| },
| {
| component: 'Input',
| defaultValue: [],
| fieldName: 'equTypesList',
| label: '设备类型',
| help: `设备类型留空不勾选,系统默认盘点全部`,
| formItemClass: 'col-span-2',
| },
| {
| component: 'Select',
| componentProps: {
| getPopupContainer,
| mode: 'multiple',
| optionFilterProp: 'label',
| options: getDictOptions(DictEnum.SYS_EQU_STATUS),
| },
| fieldName: 'equStatusList',
| label: '使用状态',
| help: `使用状态留空不勾选,系统默认盘点全部`,
| },
| {
| component: 'RadioGroup',
| componentProps: {
| buttonStyle: 'solid',
| options: getDictOptions(DictEnum.EIMS_INVENTORY_STATU),
| optionType: 'button'
| },
| defaultValue: '0',
| fieldName: 'status',
| label: '状态'
| },
| {
| component: 'DatePicker',
| componentProps: {
| format: 'YYYY-MM-DD',
| showTime: false,
| valueFormat: 'YYYY-MM-DD',
| getPopupContainer
| },
| fieldName: 'startDate',
| label: '开始日期'
| },
| {
| component: 'DatePicker',
| componentProps: {
| format: 'YYYY-MM-DD',
| showTime: false,
| valueFormat: 'YYYY-MM-DD',
| getPopupContainer
| },
| fieldName: 'endDate',
| label: '结束日期'
| },
| {
| component: 'TreeSelect',
| // 在drawer里更新 这里不需要默认的componentProps
| defaultValue: undefined,
| fieldName: 'userDept',
| label: '盘点人部门',
| help: `盘点操作人员所属部门`
| // rules: 'selectRequired',
| },
| {
| component: 'Select',
| componentProps: {
| showSearch: true,
| allowClear: true,
| getPopupContainer
| },
| fieldName: 'inventoryUser',
| label: '盘点人'
| }
| ];
|
|