data.tsx
6.11 KB
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
import { Tag } from 'ant-design-vue';
import { BasicColumn } from '@/components/Table';
import { h } from 'vue';
import { queryNoOptions } from '/@/api/project/order';
export const COLUMNS = {
1: [
{
title: '客户编码',
dataIndex: 'settingValue',
width: 150,
},
{
title: '利润率',
dataIndex: 'relationValue',
width: 150,
editComponent: 'InputNumber',
editRow: true,
},
],
2: [
{
title: '客户编码',
dataIndex: 'settingValue',
width: 150,
},
{
title: '包装费用',
dataIndex: 'relationValue',
width: 150,
editComponent: 'InputNumber',
editRow: true,
},
],
3: [
{
title: '名称',
dataIndex: 'settingName',
width: 150,
},
{
title: '值',
dataIndex: 'settingValue',
width: 150,
editComponent: 'InputNumber',
editRow: true,
},
],
5: [
{
title: '客户编码',
dataIndex: 'settingValue',
width: 150,
},
{
title: '最后汇款日期',
dataIndex: 'relationValue',
width: 150,
editComponent: 'InputNumber',
editRow: true,
},
],
6: [
{
title: '客户编码',
dataIndex: 'settingValue',
width: 150,
},
{
title: '年份',
dataIndex: 'relationName',
width: 150,
},
{
title: '固定成本',
dataIndex: 'relationValue',
width: 150,
customRender: (column) => {
const value = JSON.parse(column.record.relationValue);
return value[0].relationValue;
},
},
{
title: '提成比例',
dataIndex: 'relationValue',
width: 150,
customRender: (column) => {
const value = JSON.parse(column.record.relationValue);
return (value[1]?.relationValue * 100).toFixed(2) + '%';
},
},
{
title: '西班牙提成比例',
dataIndex: 'relationValue',
width: 150,
customRender: (column) => {
const value = JSON.parse(column.record.relationValue);
return (value[2]?.relationValue * 100).toFixed(2) + '%';
},
},
// {
// title: '生产提成单价',
// dataIndex: 'relationValue',
// width: 150,
// customRender: (column) => {
// const value = JSON.parse(column.record.relationValue);
// return value[3].relationValue;
// },
// },
],
7: [
{
title: '客户编码',
dataIndex: 'settingValue',
width: 150,
},
{
title: '销售额',
dataIndex: 'relationValue',
width: 150,
editComponent: 'InputNumber',
editRow: true,
},
],
8: [
{
title: '生产科',
dataIndex: 'settingValue',
width: 150,
},
{
title: '生产科应付日期',
dataIndex: 'relationValue',
width: 150,
editComponent: 'InputNumber',
editRow: true,
},
],
9: [
{
title: '客户编码',
dataIndex: 'settingValue',
width: 150,
},
{
title: '年份',
dataIndex: 'relationName',
width: 150,
},
{
title: '固定成本',
dataIndex: 'relationValue',
width: 150,
customRender: (column) => {
const value = JSON.parse(column.record.relationValue);
return value[0].relationValue;
},
},
{
title: '提成单价',
dataIndex: 'relationValue',
width: 150,
customRender: (column) => {
const value = JSON.parse(column.record.relationValue);
return value[1].relationValue;
},
},
],
10: [
{
title: '客户编码',
dataIndex: 'settingValue',
width: 150,
},
{
title: '公司名称',
dataIndex: 'relationValue',
width: 150,
editComponent: 'Input',
editRow: true,
},
]
};
export const columns: BasicColumn[] = [
{
title: '客户编码',
dataIndex: 'typeValue',
width: 100,
},
{
title: '状态',
dataIndex: 'enableFlag',
width: 100,
// customRender: (column) => {
// const { record } = column || {};
// return record.enableFlag === 10 ? <Tag color="green">启用</Tag> : <Tag color="red">禁用</Tag>;
// },
customRender: (column) => {
const { record } = column || {};
const enableFlag = record.enableFlag;
const enable = ~~enableFlag === 10;
// return record.enableFlag === 10 ? <Tag color="green">启用</Tag> : <Tag color="red">禁用</Tag>;
const color = enable ? 'green' : 'red';
const text = enable ? '启用' : '禁用';
return h(Tag, { color: color }, () => text);
},
},
{
title: '确认样品确认状态',
dataIndex: 'configSample',
width: 300,
},
{
title: '其他需求样品发送时间',
dataIndex: 'otherSample',
width: 300,
},
{
title: '大货样确认意见',
dataIndex: 'bigSample',
width: 300,
},
{
title: 'AITEX/SGS测试状态',
dataIndex: 'aitexSgsTest',
width: 300,
},
{
title: '要求包装到货日期',
dataIndex: 'barcodeArrival',
width: 300,
},
{
title: '最晚订舱时间',
dataIndex: 'latestDc',
width: 300,
},
{
title: '尾期验货日期',
dataIndex: 'endCheckDate',
width: 300,
},
{
title: '中期验货报告',
dataIndex: 'midCheckReport',
width: 300,
},
{
title: '尾期验货报告',
dataIndex: 'endCheckReport',
width: 300,
},
];
export const columnsProduct: BasicColumn[] = [
{
title: '客户编码',
dataIndex: 'settingValue',
width: 100,
},
{
title: '状态',
dataIndex: 'relationValue',
width: 170,
editComponent: 'Input',
editRow: true,
},
];
export const searchFormSchema = [
{
field: 'relationName',
label: '年份',
component: 'Select',
colProps: { span: 8 },
componentProps: {
showSearch: true,
options: (() => {
const options = [];
const currentYear = new Date().getFullYear();
for (let y = 2023; y <= currentYear; y++) {
options.push({ label: y.toString(), value: y.toString() });
}
return options;
})(),
},
},
]