Ben Lin
2024-06-08 cca7adfe0b76ed7c2fbdbc9978533de147695184
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
import { getFns, woGetSelectSuccess, woCustFn, woformSchema, woCfgformSchema, prodCfgformSchema, xxCfgformSchema } from './bizMesWo';
import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
 
const { t } = useI18n();
export const formSchema: FormSchema[] = [];
export function custFunction(e: any, fnName: string, type: string, ...args) {
  switch (type) {
    case 'BIZ_MES_WO':
      getFns[fnName](e, args);
      break;
    case 'BIZ_MES_WO_Config':
      getFns[fnName](e, args);
      break;
    default:
      break;
      (e) => {};
  }
}
 
export function getFormSchema(type: string) {
  let _formSchema = [] as 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;
}
 
/* 弹出选择框选择成功 */
export function GetSelectSuccess(d, u, entityName: string) {
  let data = {};
  switch (entityName) {
    case 'BIZ_MES_WO':
      data = woGetSelectSuccess(d, u);
      break;
    default:
      data = {
        ITEM_CODE: d.values['val'],
      };
      break;
  }
  return data;
}
 
/* 打开弹出选择框 */
export function OpenSelectItem(
  openItemModal: Fn,
  entityName: string,
  slotName: string,
  others: Fn[],
  ...args
) {
  switch (entityName) {
    case 'BIZ_MES_WO':
      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',
      });
      break;
  }
}