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
| /*
| * @Description: 工单批次相关
| * @Author: Ben Lin
| * @version:
| * @Date: 2024-06-19 20:34:27
| * @LastEditors: Ben Lin
| * @LastEditTime: 2024-07-20 22:29:35
| */
|
| import { Tag, Tooltip } from 'ant-design-vue';
| import { ActionItem, BasicColumn } from '/@/components/Table';
| import { useI18n } from '/@/hooks/web/useI18n';
| import { h, unref } from 'vue';
| import { GetEnum } from '/@/api/tigerapi/system';
| import { useLocale } from '/@/locales/useLocale';
|
| const { getLocale } = useLocale();
|
| const { t } = useI18n();
|
| function _default() {
| const ActionColumn: BasicColumn = {
| width: 80,
| title: '操作',
| dataIndex: 'action',
| slots: { customRender: 'action' },
| fixed: undefined,
| };
|
| /**
| * @description: 一些自定义方法
| * @return {*}
| */
| const methods = {
| /**
| * @description: 获取新增按钮的行为,必需要有的方法
| * @return {*}
| */
| CreateAction: (fnName: string) => {
| return {
| action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
| };
| },
| /**
| * @description: 产品绑定工艺路线操作字段自定义按钮,必需要有的方法
| * @return {*}
| */
| ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
| return data;
| },
| /**
| * @description: 高级表单和详情页面返回主页面的url
| * @return {*}
| */
| GetHomeUrl: (params: {}) => {
| return `/BIZ_MES_WO/LC/${encodeURI(JSON.stringify({ ID: 'BIZ_MES_WO', colSlots: params['colSlots'], crudColSlots: [] }))}`;
| },
| GetBaseColumns: () => {
| return [
| {
| dataIndex: 'ORDER_NO',
| title: '工单号',
| // ifShow: false,
| sorter: true,
| resizable: true,
| },
| {
| dataIndex: 'BATCH_NO',
| title: '工单批次号',
| ifShow: true,
| sorter: true,
| resizable: true,
| customRender: () => {},
| },
| {
| dataIndex: 'STATUS',
| title: '状态',
| ifShow: true,
| sorter: true,
| resizable: true,
| customRender: ({ record }) => {
| let color = '';
| let text = '';
| switch (
| record.STATUS //状态(0Init初始化|1Imported已导入|2Release已下发|3Working生产中|4Paused已暂停|5Closed已关闭)
| ) {
| case 0:
| text = '初始化';
| color = '#bfbfbf';
| break;
| case 1:
| text = '已导入';
| color = 'orange';
| break;
| case 2:
| text = '已下发';
| color = '#4f68b0';
| break;
| case 3:
| text = '生产中';
| color = 'green';
| break;
| case 4:
| text = '已暂停';
| color = 'red';
| break;
| case 5:
| text = '已关闭';
| color = 'blue';
| break;
| }
| return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text));
| },
| },
| {
| dataIndex: 'PLAN_QTY',
| title: '计划数量',
| ifShow: true,
| sorter: true,
| resizable: true,
| },
| {
| dataIndex: 'ITEM_CODE',
| title: '物料编码',
| ifShow: true,
| sorter: true,
| resizable: true,
| },
| {
| dataIndex: 'CUST_CODE',
| title: '客户编码',
| ifShow: true,
| sorter: true,
| resizable: true,
| },
| {
| dataIndex: 'ACT_LINE',
| title: '实际线体',
| ifShow: true,
| sorter: true,
| resizable: true,
| },
| {
| dataIndex: 'ACT_START_TIME',
| title: '实际开始时间',
| ifShow: true,
| sorter: true,
| resizable: true,
| },
| {
| dataIndex: 'REMARK',
| title: '备注',
| ifShow: true,
| sorter: true,
| resizable: true,
| },
| ];
| },
| GetSearchForm: () => {
| return [
| {
| field: 'BATCH_NO',
| label: t('工单批次号'),
| colProps: { span: 8 },
| component: 'Input',
| },
| ];
| },
| GetCrudForm: () => {
| return [];
| },
| KeyFieldValues: (val: string, id: string) => {
| return { ORDER_NO: val };
| },
| GetUseForm: () => {
| return {};
| },
| };
|
| return [methods, ActionColumn];
| }
|
| export default _default;
|
|