YangYuGang
2025-03-08 8cae1dcd8d2bde01880ac4b70bdda4e61df3c7ef
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
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { optionsListApi,optionsListApiType } from '/@/api/tigerapi/mes/smt/tool_his';
import { h,unref } from 'vue';
import { Tag ,Tooltip} from 'ant-design-vue';
import{ useLocale } from '/@/locales/useLocale';
 
const { getLocale }=useLocale();
 
export const columns: BasicColumn[] = [
  {
    title: '条码',
    dataIndex: 'TOOL_CODE',
    width:200,
    sorter: true,
    resizable:true
  },
  {
    title: '状态',
    dataIndex: 'STATUS',
    width: 100,
    sorter: true,
    resizable: true,
    customRender: ({ record }) => {
      const status = record.STATUS;
      var text = '';
      var color = '';
      switch (status) {
        case 0:
          text = '已入库';
          color = 'green';
          break;
        case 1:
          text = '已领用';
          color = 'blue';
          break;
        case 2:
          text = '已上线';
          color = 'blue';
          break;
        case 3:
          text = '已下线';
          color = 'blue';
          break;
        case 4:
          text = '保养中';
          color = 'blue';
          break;
        case 5:
          text = '已报废';
          color = 'blue';
          break;
        default:
          break;
      }
      return h(Tooltip, { title: 'xxxxxx' }, () => h(Tag, { color: color }, () => text));
    },
  },
  {
    title: '仓库编码',
    dataIndex: 'WH_CODE',
    width:100,
    sorter: true,
    resizable:true
  }
  ,
  {
    title: '储区编码',
    dataIndex: 'REGION_CODE',
    width:100,
    sorter: true,
    resizable:true
  }
  ,
  {
    title: '货架/料车编码',
    dataIndex: 'SHELF_CODE',
    width:100,
    sorter: true,
    resizable:true
  }
  ,
  {
    title: '储位编码',
    dataIndex: 'LOCATION_CODE',
    width:100,
    sorter: true,
    resizable:true
  }
  ,
  {
    title: '产线编码',
    dataIndex: 'LINE_CODE',
    width:100,
    sorter: true,
    resizable:true
  }
  ,
  {
    title: '创建人',
    dataIndex: 'CREATE_USER',
    width:100,
    sorter: true,
    resizable:true
  },
  {
    title: '创建时间',
    dataIndex: 'CREATE_TIME',
    width:100,
    sorter: true,
    resizable:true
  }
];
 
export const searchFormSchema: FormSchema[] = [
  {
    field: 'TOOL_CODE',
    label: '条码',
    component: 'Input',
    colProps: { span: 8 },
  },
 
  // {
  //   field: 'ALARM_TYPE',
  //   label: '预警列表',
  //   component: 'ApiSelect',
  //   colProps: { span: 8 },
  //   componentProps: {
  //     api: optionsListApi,
  //     resultField: 'Data',
  //     labelField: unref(getLocale)=='zh_CN'?'Desc':'Name',
  //     valueField: 'Value',
  //   },
  // },
 
  // {
  //   field: 'MANUFACTURER',
  //   label: '制造商',
  //   component: 'Input',
  //   colProps: { span: 8 },
  // },
 
  // {
  //   field: 'TOOL_MODEL',
  //   label: '型号',
  //   component: 'Input',
  //   colProps: { span: 8 },
  // }
];