凌世锦
authored
11 months ago
1
2
3
4
5
import {
deleteOrderErpOrderStagesDelect,
getOrderErpOrderStagesListAll,
postOrderErpOrderStagesSearch,
} from '@/services';
曾国涛
authored
9 months ago
6
import { downloadFile } from '@/services/order';
凌世锦
authored
11 months ago
7
8
9
import { VerticalAlignTopOutlined } from '@ant-design/icons';
import type { ProColumns } from '@ant-design/pro-components';
import { EditableProTable } from '@ant-design/pro-components';
凌世锦
authored
11 months ago
10
11
12
import { Button, Space, Table, Tag, message } from 'antd';
import { Key, useRef, useState } from 'react';
import TableCheckModal from '../checkModal/TableCheckModal';
凌世锦
authored
11 months ago
13
14
15
16
17
18
19
import CheckModal from '../checkModal/checkModal';
import Comfire from '../comfire/comfire';
import AddModel from '../detail/detail';
import EditorModel from '../edit/edit';
import ReadModel from '../read/read';
import UploadModel from '../upload/uploadModel';
import './title.less';
凌世锦
authored
11 months ago
20
凌世锦
authored
11 months ago
21
22
23
24
25
26
27
export const waitTimePromise = async (time: number = 100) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
};
凌世锦
authored
11 months ago
28
凌世锦
authored
11 months ago
29
30
31
export const waitTime = async (time: number = 100) => {
await waitTimePromise(time);
};
凌世锦
authored
11 months ago
32
凌世锦
authored
11 months ago
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
type OrderStagesItem = {
//文件编号
id?: number;
//合同编号
contract?: string;
//供应商名称
vendor?: string;
//签合同日期
dateRange?: Date;
//终端名称
terminal?: string;
//设备编号
dId?: number;
//设备名称
deviceName?: string;
//设备型号
deviceModel?: string;
//数量
count?: number;
//单价
unitPrice?: number;
//总价
price?: number;
//合同总金额
totalPrice?: number;
//付款方式
payWay?: string;
//附件
annex?: string;
//备注
remark?: string;
//可选操作
opt?: string[];
//账单状态
status?: string;
//审核备注
statusMark?: string;
//子类
凌世锦
authored
11 months ago
71
72
// children?: OrderStagesItem[];
orderStagesDeviceVoList: orderStagesDevice[];
凌世锦
authored
11 months ago
73
};
凌世锦
authored
11 months ago
74
凌世锦
authored
11 months ago
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
type OrderStagesWithListItem = {
//文件编号
id: number;
//合同编号
contract: string;
//供应商名称
vendor: string;
//签合同日期
dateRange: Date;
//终端名称
terminal: string;
orderStagesDeviceVoList: orderStagesDevice[];
//合同总金额
totalPrice: number;
//付款方式
payWay: string;
//附件
annex: string;
//备注
remark: string;
//可选操作
paths: string[];
//账单状态
status?: string;
//审核备注
statusMark?: string;
};
凌世锦
authored
11 months ago
102
凌世锦
authored
11 months ago
103
104
105
106
107
108
109
110
111
112
113
114
115
116
type orderStagesDevice = {
//设备id
dId: number;
//设备名称
deviceName: string;
//设备型号
deviceModel: string;
//数量
count: number;
//单价
unitPrice: number;
//总价
price: number;
};
凌世锦
authored
11 months ago
117
凌世锦
authored
11 months ago
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// const loopOrderStagesFilter = (
// data: readonly OrderStagesItem[],
// dId: React.Key | undefined,
// ): OrderStagesItem[] => {
// return data
// .map((item) => {
// if (item.dId !== dId) {
// if (item.children) {
// if (item.children.length !== 0) {
// const newChildren = loopOrderStagesFilter(item.children, dId);
// return {
// ...item,
// children: newChildren.length > 0 ? newChildren : undefined,
// };
// }
// }
// return item;
// }
// return null;
// })
// .filter(Boolean) as OrderStagesItem[];
凌世锦
authored
11 months ago
139
140
// };
凌世锦
authored
11 months ago
141
142
143
144
145
146
147
148
149
export default () => {
interface ActionType {
reload: (resetPageIndex?: boolean) => void;
reloadAndRest: () => void;
reset: () => void;
clearSelected?: () => void;
startEditable: (rowKey: Key) => boolean;
cancelEditable: (rowKey: Key) => boolean;
}
凌世锦
authored
11 months ago
150
const [specialPath, setSpecialPath] = useState<string[]>([]);
凌世锦
authored
11 months ago
151
凌世锦
authored
11 months ago
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
const ref = useRef<ActionType>({
reload: () => {
// implementation for reload
},
reloadAndRest: () => {
// implementation for reloadAndRest
},
reset: () => {
// implementation for reset
},
startEditable: () => {
// implementation for startEditable
},
cancelEditable: () => {
// implementation for cancelEditable
},
});
凌世锦
authored
11 months ago
169
凌世锦
authored
11 months ago
170
171
172
function reload() {
ref.current.reload();
}
凌世锦
authored
11 months ago
173
凌世锦
authored
11 months ago
174
175
176
async function toDelete(value) {
const res = await deleteOrderErpOrderStagesDelect({
data: {
凌世锦
authored
11 months ago
177
178
ids: value,
deviceIds: null,
凌世锦
authored
11 months ago
179
180
181
182
183
184
185
186
187
},
});
if (res) {
message.success('删除成功');
ref.current.reload();
} else {
message.error('删除失败');
}
}
凌世锦
authored
11 months ago
188
凌世锦
authored
11 months ago
189
190
191
const exportLoadingDestory = () => {
message.success('导出成功');
};
凌世锦
authored
11 months ago
192
凌世锦
authored
11 months ago
193
194
async function toExport() {
// await getOrderErpOrderStagesExport()
曾国涛
authored
9 months ago
195
downloadFile(
凌世锦
authored
11 months ago
196
197
198
199
200
201
202
'/api/order/erp/orderStages/export',
'分期订单.xlsx',
'get',
{},
exportLoadingDestory,
);
}
凌世锦
authored
11 months ago
203
凌世锦
authored
11 months ago
204
205
206
207
208
209
210
211
const columns: ProColumns<OrderStagesItem>[] = [
{
title: '文件编号',
dataIndex: 'id',
width: 100,
disable: true,
onFilter: true,
ellipsis: true,
凌世锦
authored
11 months ago
212
213
214
215
216
217
218
219
// align: 'center',
render: (_, record) => {
if (record?.id) {
const text = record?.id?.toString();
const paddedText = '0'.repeat(4 - text.length) + text;
return (
<>
{paddedText}
凌世锦
authored
11 months ago
220
{/* {record?.orderStagesDeviceVoList?.length > 1 && (
凌世锦
authored
11 months ago
221
222
223
224
225
226
227
228
229
230
231
<>
<Badge
count={record?.orderStagesDeviceVoList?.length}
style={{
marginBlockStart: -2,
marginInlineStart: 4,
color: '#1890FF',
backgroundColor: '#E6F7FF',
}}
/>
</>
凌世锦
authored
11 months ago
232
)} */}
凌世锦
authored
11 months ago
233
234
235
236
</>
);
}
},
凌世锦
authored
11 months ago
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
290
291
292
293
294
295
296
297
298
299
300
},
{
title: '签合同日期',
dataIndex: 'dateRange',
valueType: 'date',
width: 100,
disable: true,
onFilter: true,
ellipsis: true,
},
{
title: '合同编号',
dataIndex: 'contract',
width: 200,
disable: true,
onFilter: true,
ellipsis: true,
copyable: true,
},
{
title: '供应商名称',
dataIndex: 'vendor',
width: 200,
disable: true,
onFilter: true,
ellipsis: true,
},
{
title: '终端名称',
dataIndex: 'terminal',
width: 200,
disable: true,
onFilter: true,
ellipsis: true,
},
{
title: '状态',
dataIndex: 'status',
width: 200,
disable: true,
onFilter: true,
ellipsis: true,
valueType: 'select',
valueEnum: {
CHECK: { text: '待审核', status: 'CHECK' },
PASS: { text: '审核通过', status: 'PASS' },
NOT_PASS: { text: '审核未通过', status: 'NOT_PASS' },
},
render: (_, record) => {
if (record.status !== null) {
if (
record.status === 'UPDATE_CHECK' ||
record.status === 'SAVE_CHECK' ||
record.status === 'IMPORT_CHECK'
) {
return <Tag color="blue">待审核</Tag>;
}
if (record.status === 'PASS') {
return <Tag color="green">审核通过</Tag>;
}
if (record.status === 'NOT_PASS') {
return <Tag color="red">审核未通过</Tag>;
}
}
凌世锦
authored
11 months ago
301
// return <Tag color="orange">暂无状态</Tag>;
凌世锦
authored
11 months ago
302
303
304
305
306
307
308
309
310
},
},
{
title: '设备名称',
dataIndex: 'deviceName',
width: 200,
disable: true,
onFilter: true,
ellipsis: true,
凌世锦
authored
11 months ago
311
312
hideInTable: true,
hideInSearch: true,
凌世锦
authored
11 months ago
313
314
315
316
317
318
319
320
321
},
{
title: '设备型号',
dataIndex: 'deviceModel',
hideInSearch: true,
width: 200,
disable: true,
onFilter: true,
ellipsis: true,
凌世锦
authored
11 months ago
322
hideInTable: true,
凌世锦
authored
11 months ago
323
324
325
326
327
328
329
330
331
},
{
title: '数量',
dataIndex: 'count',
hideInSearch: true,
width: 100,
disable: true,
onFilter: true,
ellipsis: true,
凌世锦
authored
11 months ago
332
hideInTable: true,
凌世锦
authored
11 months ago
333
334
335
336
337
338
339
340
341
},
{
title: '单价',
dataIndex: 'unitPrice',
hideInSearch: true,
width: 100,
disable: true,
onFilter: true,
ellipsis: true,
凌世锦
authored
11 months ago
342
hideInTable: true,
凌世锦
authored
11 months ago
343
344
345
346
347
348
349
350
351
},
{
title: '总价',
dataIndex: 'price',
hideInSearch: true,
width: 100,
disable: true,
onFilter: true,
ellipsis: true,
凌世锦
authored
11 months ago
352
hideInTable: true,
凌世锦
authored
11 months ago
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
},
{
title: '合同总金额',
dataIndex: 'totalPrice',
hideInSearch: true,
width: 100,
disable: true,
onFilter: true,
ellipsis: true,
},
{
title: '付款方式',
dataIndex: 'payWay',
hideInSearch: true,
width: 100,
disable: true,
onFilter: true,
ellipsis: true,
},
{
title: '附件',
dataIndex: 'annex',
hideInSearch: true,
width: 100,
disable: true,
onFilter: true,
ellipsis: true,
render: (_, record) => {
if (record.id && record.annex !== null) {
return <a href={record.annex}>附件文件</a>;
}
},
},
{
disable: true,
title: '备注',
dataIndex: 'remark',
filters: true,
hideInSearch: true,
onFilter: false,
ellipsis: true,
width: 100,
hideInTable: false,
},
{
disable: true,
title: '审核备注',
dataIndex: 'statusMark',
filters: true,
hideInSearch: true,
onFilter: false,
ellipsis: true,
width: 100,
hideInTable: false,
},
{
title: '操作',
valueType: 'option',
fixed: 'right',
width: 160,
disable: true,
onFilter: true,
ellipsis: true,
render: (_text, record) => {
if (record?.id) {
const hasOnlyReaderPermission = record?.opt?.includes('ONLYREAD');
// const hasReaderPermission = record?.opt?.includes("READ");
const hasDeletePermission = record?.opt?.includes('DELETE');
const hasCheckPermission = record?.opt?.includes('CHECK');
const hasEditPermission = record?.opt?.includes('EDIT');
const hasRePutPermission = record?.opt?.includes('REPUT');
return (
<>
{hasCheckPermission && (
<>
凌世锦
authored
11 months ago
428
<CheckModal id={[record.id]} toReload={reload}></CheckModal>
凌世锦
authored
11 months ago
429
430
431
</>
)}
凌世锦
authored
11 months ago
432
凌世锦
authored
11 months ago
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
{hasOnlyReaderPermission && (
<>
<ReadModel currentContract={record.contract}></ReadModel>
</>
)}
{hasEditPermission && (
<>
<EditorModel
currentContract={record.contract}
toReload={reload}
showTarget={'编辑'}
></EditorModel>
</>
)}
{hasRePutPermission && (
<>
<EditorModel
currentContract={record.contract}
toReload={reload}
showTarget={'重新上传'}
></EditorModel>
</>
)}
{hasDeletePermission && (
<>
凌世锦
authored
11 months ago
461
<Comfire currtDid={record.id} sureDelete={toDelete}></Comfire>
凌世锦
authored
11 months ago
462
463
464
465
466
467
468
469
470
</>
)}
</>
);
}
return null;
},
},
];
凌世锦
authored
11 months ago
471
凌世锦
authored
11 months ago
472
473
474
475
476
477
return (
<>
<EditableProTable<OrderStagesItem>
className="title-index"
columnEmptyText=""
columns={columns}
凌世锦
authored
11 months ago
478
479
480
481
rowSelection={{
selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
defaultSelectedRowKeys: [],
}}
凌世锦
authored
11 months ago
482
483
cardBordered
actionRef={ref}
凌世锦
authored
11 months ago
484
scroll={{ x: 1400 }}
凌世锦
authored
11 months ago
485
486
recordCreatorProps={false}
request={async (params) => {
凌世锦
authored
11 months ago
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
if (params.id === '') {
params.id = null;
}
if (params.contract === '') {
params.contract = null;
}
if (params.vendor === '') {
params.vendor = null;
}
if (params.terminal === '') {
params.terminal = null;
}
if (params.deviceName === '') {
params.deviceName = null;
}
if (params.dateRange === '') {
params.dateRange = null;
}
if (params.status === '') {
params.status = null;
}
凌世锦
authored
11 months ago
508
509
510
511
512
513
514
if (
params.id !== null ||
params.contract !== null ||
params.vendor !== null ||
params.terminal !== null ||
params.deviceName !== null ||
params.dateRange !== null ||
凌世锦
authored
11 months ago
515
516
517
params.status !== null ||
params.current !== null ||
params.pageSize !== null
凌世锦
authored
11 months ago
518
519
520
521
522
523
524
525
526
) {
let PostOrderErpOrderStagesSearchOption = {
id: params.id,
contract: params.contract,
vendor: params.vendor,
terminal: params.terminal,
deviceName: params.deviceName,
dateRange: params.dateRange,
statusText: params.status,
凌世锦
authored
11 months ago
527
528
current: params.current,
pageSize: params.pageSize,
凌世锦
authored
11 months ago
529
530
531
532
533
534
};
let res = await postOrderErpOrderStagesSearch({
data: { ...PostOrderErpOrderStagesSearchOption },
});
await waitTime(2000);
if (res) {
凌世锦
authored
11 months ago
535
536
537
const orderStagesWithList: OrderStagesWithListItem[] =
res?.data.data;
setSpecialPath(res.data.specialPath);
凌世锦
authored
11 months ago
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
let orderStagesList: OrderStagesItem[] = [];
for (let ind = 0; ind < orderStagesWithList.length; ind++) {
for (
let index = 0;
index <
orderStagesWithList[ind].orderStagesDeviceVoList.length;
index++
) {
let item: OrderStagesItem = {
id: undefined,
contract: undefined,
vendor: undefined,
dateRange: undefined,
terminal: undefined,
dId: undefined,
deviceName: undefined,
deviceModel: undefined,
count: undefined,
unitPrice: undefined,
price: undefined,
totalPrice: undefined,
payWay: undefined,
annex: undefined,
remark: undefined,
opt: undefined,
status: undefined,
statusMark: undefined,
凌世锦
authored
11 months ago
565
orderStagesDeviceVoList: [],
凌世锦
authored
11 months ago
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
};
if (index === 0) {
item.id = orderStagesWithList[ind].id;
item.contract = orderStagesWithList[ind].contract;
item.vendor = orderStagesWithList[ind].vendor;
item.dateRange = orderStagesWithList[ind].dateRange;
item.terminal = orderStagesWithList[ind].terminal;
item.dId =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].dId;
item.deviceName =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].deviceName;
item.deviceModel =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].deviceModel;
item.count =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].count;
item.unitPrice =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].unitPrice;
item.price =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].price;
item.totalPrice = orderStagesWithList[ind].totalPrice;
item.payWay = orderStagesWithList[ind].payWay;
item.annex = orderStagesWithList[ind].annex;
item.remark = orderStagesWithList[ind].remark;
item.status = orderStagesWithList[ind].status;
item.statusMark = orderStagesWithList[ind].statusMark;
凌世锦
authored
11 months ago
603
604
605
item.orderStagesDeviceVoList =
orderStagesWithList[ind].orderStagesDeviceVoList;
// item.children = [];
凌世锦
authored
11 months ago
606
607
608
609
610
611
if (orderStagesWithList[ind].paths) {
item.opt = [...orderStagesWithList[ind].paths];
if (orderStagesWithList[ind]?.paths?.includes('READ')) {
item.opt.push('ONLYREAD');
}
}
凌世锦
authored
11 months ago
612
613
614
615
616
617
618
// item.children = [];
// if (
// orderStagesWithList[ind].orderStagesDeviceVoList.length <=
// 1
// ) {
// delete item.children;
// }
凌世锦
authored
11 months ago
619
620
orderStagesList.push(item);
}
凌世锦
authored
11 months ago
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
// else {
// item.id = orderStagesWithList[ind].id;
// item.contract = orderStagesWithList[ind].contract;
// item.vendor = orderStagesWithList[ind].vendor;
// item.dateRange = orderStagesWithList[ind].dateRange;
// item.terminal = orderStagesWithList[ind].terminal;
// item.dId =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].dId;
// item.deviceName =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].deviceName;
// item.deviceModel =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].deviceModel;
// item.count =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].count;
// item.unitPrice =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].unitPrice;
// item.price =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].price;
// item.totalPrice = orderStagesWithList[ind].totalPrice;
// item.payWay = orderStagesWithList[ind].payWay;
// item.annex = orderStagesWithList[ind].annex;
// item.remark = orderStagesWithList[ind].remark;
// if (orderStagesWithList[ind].paths) {
// if (orderStagesList[ind]?.opt?.includes('READ')) {
// item.opt = ['ONLYREAD'];
// }
// }
// item.status = orderStagesWithList[ind].status;
// item.statusMark = orderStagesWithList[ind].statusMark;
// if (
// orderStagesWithList[ind].orderStagesDeviceVoList.length >
// 1
// ) {
// orderStagesList[ind].children?.push(item);
// }
// }
凌世锦
authored
11 months ago
669
670
671
672
}
}
return {
data: orderStagesList || [],
凌世锦
authored
11 months ago
673
total: res?.data?.total || 0,
凌世锦
authored
11 months ago
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
};
}
} else {
let res = await getOrderErpOrderStagesListAll();
await waitTime(2000);
if (res) {
const orderStagesWithList: OrderStagesWithListItem[] = res?.data;
let orderStagesList: OrderStagesItem[] = [];
for (let ind = 0; ind < orderStagesWithList.length; ind++) {
for (
let index = 0;
index <
orderStagesWithList[ind].orderStagesDeviceVoList.length;
index++
) {
let item: OrderStagesItem = {
id: undefined,
contract: undefined,
vendor: undefined,
dateRange: undefined,
terminal: undefined,
dId: undefined,
deviceName: undefined,
deviceModel: undefined,
count: undefined,
unitPrice: undefined,
price: undefined,
totalPrice: undefined,
payWay: undefined,
annex: undefined,
remark: undefined,
opt: undefined,
凌世锦
authored
11 months ago
706
// children: undefined,
凌世锦
authored
11 months ago
707
708
status: undefined,
statusMark: undefined,
凌世锦
authored
11 months ago
709
orderStagesDeviceVoList: [],
凌世锦
authored
11 months ago
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
};
if (index === 0) {
item.id = orderStagesWithList[ind].id;
item.contract = orderStagesWithList[ind].contract;
item.vendor = orderStagesWithList[ind].vendor;
item.dateRange = orderStagesWithList[ind].dateRange;
item.terminal = orderStagesWithList[ind].terminal;
item.dId =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].dId;
item.deviceName =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].deviceName;
item.deviceModel =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].deviceModel;
item.count =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].count;
item.unitPrice =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].unitPrice;
item.price =
orderStagesWithList[ind].orderStagesDeviceVoList[
index
].price;
item.totalPrice = orderStagesWithList[ind].totalPrice;
item.payWay = orderStagesWithList[ind].payWay;
item.annex = orderStagesWithList[ind].annex;
item.remark = orderStagesWithList[ind].remark;
item.opt = orderStagesWithList[ind].paths;
item.status = orderStagesWithList[ind].status;
item.statusMark = orderStagesWithList[ind].statusMark;
凌世锦
authored
11 months ago
748
749
item.orderStagesDeviceVoList =
orderStagesWithList[ind].orderStagesDeviceVoList;
凌世锦
authored
11 months ago
750
751
752
753
754
755
if (orderStagesWithList[ind].paths) {
item.opt = [...orderStagesWithList[ind].paths];
if (orderStagesWithList[ind]?.paths?.includes('READ')) {
item.opt.push('ONLYREAD');
}
}
凌世锦
authored
11 months ago
756
757
758
759
760
761
// if (
// orderStagesWithList[ind].orderStagesDeviceVoList.length <=
// 1
// ) {
// delete item.children;
// }
凌世锦
authored
11 months ago
762
763
orderStagesList.push(item);
}
凌世锦
authored
11 months ago
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
// else {
// item.id = orderStagesWithList[ind].id;
// item.contract = orderStagesWithList[ind].contract;
// item.vendor = orderStagesWithList[ind].vendor;
// item.dateRange = orderStagesWithList[ind].dateRange;
// item.terminal = orderStagesWithList[ind].terminal;
// item.dId =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].dId;
// item.deviceName =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].deviceName;
// item.deviceModel =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].deviceModel;
// item.count =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].count;
// item.unitPrice =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].unitPrice;
// item.price =
// orderStagesWithList[ind].orderStagesDeviceVoList[
// index
// ].price;
// item.totalPrice = orderStagesWithList[ind].totalPrice;
// item.payWay = orderStagesWithList[ind].payWay;
// item.annex = orderStagesWithList[ind].annex;
// item.remark = orderStagesWithList[ind].remark;
// if (orderStagesWithList[ind].paths) {
// if (orderStagesList[ind]?.opt?.includes('READ')) {
// item.opt = ['ONLYREAD'];
// }
// }
// item.status = orderStagesWithList[ind].status;
// item.statusMark = orderStagesWithList[ind].statusMark;
// if (
// orderStagesWithList[ind].orderStagesDeviceVoList.length >
// 1
// ) {
// orderStagesList[ind].children?.push(item);
// }
// }
凌世锦
authored
11 months ago
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
}
}
return {
data: orderStagesList || [],
};
}
}
}}
editable={{
type: 'multiple',
}}
columnsState={{
persistenceKey: 'pro-table-singe-demos',
persistenceType: 'localStorage',
defaultValue: {
option: { fixed: 'right', disable: true },
},
}}
rowKey="dId"
search={{
labelWidth: 'auto',
}}
options={{
setting: {
listsHeight: 800,
},
}}
form={{
syncToUrl: (values, type) => {
if (type === 'get') {
return {
...values,
created_at: [values.startTime, values.endTime],
};
}
return values;
},
}}
pagination={{
pageSize: 10,
}}
dateFormatter="string"
headerTitle={[]}
凌世锦
authored
11 months ago
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
tableAlertOptionRender={({ selectedRows, onCleanSelected }) => {
return (
<Space size={16}>
<TableCheckModal
id={selectedRows
.filter(
(item) =>
item.status === 'SAVE_CHECK' ||
item.status === 'UPDATE_CHECK' ||
item.status === 'IMPORT_CHECK',
)
.map((item) => item.id)}
toReload={reload}
isShow={!specialPath?.includes('BatchModeration')}
/>
<Button
title="确认删除所选中的分期账单吗?"
type="primary"
disabled={!specialPath?.includes('BatchDelete')}
onClick={() => {
let ids = selectedRows.map((item: any) => {
return item.id;
});
toDelete(ids);
onCleanSelected();
}}
>
批量删除
</Button>
<Button
type="primary"
onClick={onCleanSelected}
disabled={!specialPath?.includes('UnSelect')}
>
取消选中
</Button>
</Space>
);
}}
凌世锦
authored
11 months ago
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
toolBarRender={() => [
<>
<AddModel toReload={reload}></AddModel>
<UploadModel toReload={reload}></UploadModel>
<Button
type="primary"
onClick={() => {
toExport();
}}
>
<VerticalAlignTopOutlined />
导出
</Button>
</>,
]}
/>
</>
);
};