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
| /*
| * @Description: 自定义弹出框请数据
| * @Author: Ben Lin
| * @version:
| * @Date: 2024-06-05 15:50:59
| * @LastEditors: Ben Lin
| * @LastEditTime: 2024-06-28 11:31:37
| */
| import {
| getWoFns,
| woGetSelectSuccess,
| woCustFn,
| woformSchema,
| woCfgformSchema,
| prodCfgformSchema,
| xxCfgformSchema,
| } from './bizMesWo';
| import { FormSchema } from '/@/components/Table';
| import { useI18n } from '/@/hooks/web/useI18n';
|
| const { t } = useI18n();
| export const formSchema: FormSchema[] = [];
| export async function custFunction<T = any>(
| e: any,
| fnName: string,
| type: string,
| ...args
| ): Promise<T> {
| switch (type) {
| case 'BIZ_MES_WO':
| case 'BIZ_MES_WO_Config':
| return getWoFns[fnName](e, args);
| // break;
| default:
| return new Promise((resolve, reject) => {
| try {
| (e) => {};
| resolve(true);
| } catch {
| reject(false);
| } finally {
| args[0][0]({ confirmLoading: false });
| }
| });
| // break;
| }
| }
|
| export function getFormSchema(type: string) {
| let _formSchema: FormSchema[] = [];
| switch (type) {
| case 'BIZ_MES_WO':
| _formSchema = woformSchema;
| break;
| case 'woinfo':
| _formSchema = woCfgformSchema;
| break;
| case 'prodinfo':
| _formSchema = prodCfgformSchema;
| break;
| case 'xxinfo':
| _formSchema = xxCfgformSchema;
| break;
| default:
| break;
| (e) => {};
| }
| return _formSchema;
| }
|
| /**
| * @description: 弹出选择框选择成功
| * @param {*} d
| * @param {*} u
| * @param {string} entityName
| * @return {*}
| */
| export function GetSelectSuccess(d, u, entityName: string) {
| let data = {};
| switch (entityName) {
| case 'BIZ_MES_WO':
| case 'BIZ_MES_WO_Config':
| data = woGetSelectSuccess(d, u);
| break;
| default:
| data = {
| ITEM_CODE: d.values['val'],
| };
| break;
| }
| return data;
| }
|
| /**
| * @description: 打开弹出选择框
| * @return {*}
| */
| export function OpenSelectItem(
| openItemModal: Fn,
| entityName: string,
| slotName: string,
| others: Fn[],
| ...args
| ) {
| switch (entityName) {
| case 'BIZ_MES_WO':
| case 'BIZ_MES_WO_Config': //根据带入的名称打开不同的实体列表
| woCustFn(openItemModal, slotName, others, args);
| break;
| default: //默认打开物料列表
| openItemModal(true, {
| title: '物料列表',
| schemas: [
| {
| field: 'ITEM_CODE',
| component: 'Input',
| label: '物料编码',
| colProps: {
| span: 12,
| },
| },
| ],
| ItemColumns: [
| {
| title: t('物料编码'),
| dataIndex: 'ITEM_CODE',
| resizable: true,
| sorter: true,
| width: 200,
| },
| {
| title: t('物料名称'),
| dataIndex: 'ITEM_NAME',
| resizable: true,
| sorter: true,
| width: 180,
| },
| ],
| tableName: 'BAS_ITEM',
| rowKey: 'ITEM_CODE',
| searchInfo: { TABLE_NAME: 'BAS_ITEM' }, //searchInfo: {TABLE_NAME: 'MES_CUSTOM_ACT', ACT_TYPE: routeConfig.currentAct.ACT_TYPE}
| });
| break;
| }
| }
|
| export const step1Schemas: FormSchema[] = [
| {
| field: 'CUST_CODE',
| component: 'Input',
| label: '客户编码',
| required: true,
| colProps: {
| span: 20,
| },
| },
| {
| field: '0',
| label: '',
| defaultValue: '',
| slot: 'add',
| colProps: {
| span: 4,
| },
| },
| {
| field: 'CUST_ID',
| component: 'Input',
| label: 'ID',
| required: true,
| colProps: {
| span: 20,
| },
| show: false,
| },
| ];
|
| export const step2Schemas: FormSchema[] = [
| {
| field: 'ROT_CODE',
| component: 'Input',
| label: '工艺路线',
| required: true,
| colProps: {
| span: 20,
| },
| },
| {
| field: '0',
| label: '',
| defaultValue: '',
| slot: 'add',
| colProps: {
| span: 4,
| },
| },
| {
| field: 'ROT_ID',
| component: 'Input',
| label: 'ID',
| required: true,
| colProps: {
| span: 20,
| },
| show: false,
| },
| ];
|
|