Blame view

src/pages/Instalment/components/title/titletest.tsx 29.1 KB
1
2
3
4
5
import {
  deleteOrderErpOrderStagesDelect,
  getOrderErpOrderStagesListAll,
  postOrderErpOrderStagesSearch,
} from '@/services';
6
import { downloadFile } from '@/services/order';
7
8
9
import { VerticalAlignTopOutlined } from '@ant-design/icons';
import type { ProColumns } from '@ant-design/pro-components';
import { EditableProTable } from '@ant-design/pro-components';
PurelzMgnead authored
10
11
12
import { Button, Space, Table, Tag, message } from 'antd';
import { Key, useRef, useState } from 'react';
import TableCheckModal from '../checkModal/TableCheckModal';
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';
20
21
22
23
24
25
26
27
export const waitTimePromise = async (time: number = 100) => {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve(true);
    }, time);
  });
};
28
29
30
31
export const waitTime = async (time: number = 100) => {
  await waitTimePromise(time);
};
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
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;
  //子类
71
72
  // children?: OrderStagesItem[];
  orderStagesDeviceVoList: orderStagesDevice[];
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
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;
};
102
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;
};
117
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[];
139
140
// };
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;
  }
PurelzMgnead authored
150
  const [specialPath, setSpecialPath] = useState<string[]>([]);
151
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
    },
  });
169
170
171
172
  function reload() {
    ref.current.reload();
  }
173
174
175
176
  async function toDelete(value) {
    const res = await deleteOrderErpOrderStagesDelect({
      data: {
PurelzMgnead authored
177
178
        ids: value,
        deviceIds: null,
179
180
181
182
183
184
185
186
187
      },
    });
    if (res) {
      message.success('删除成功');
      ref.current.reload();
    } else {
      message.error('删除失败');
    }
  }
188
189
190
191
  const exportLoadingDestory = () => {
    message.success('导出成功');
  };
192
193
194
  async function toExport() {
    // await getOrderErpOrderStagesExport()
195
    downloadFile(
196
197
198
199
200
201
202
      '/api/order/erp/orderStages/export',
      '分期订单.xlsx',
      'get',
      {},
      exportLoadingDestory,
    );
  }
203
204
205
206
207
208
209
210
211
  const columns: ProColumns<OrderStagesItem>[] = [
    {
      title: '文件编号',
      dataIndex: 'id',
      width: 100,
      disable: true,
      onFilter: true,
      ellipsis: true,
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}
220
              {/* {record?.orderStagesDeviceVoList?.length > 1 && (
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',
                    }}
                  />
                </>
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
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>;
          }
        }
301
        // return <Tag color="orange">暂无状态</Tag>;
302
303
304
305
306
307
308
309
310
      },
    },
    {
      title: '设备名称',
      dataIndex: 'deviceName',
      width: 200,
      disable: true,
      onFilter: true,
      ellipsis: true,
311
312
      hideInTable: true,
      hideInSearch: true,
313
314
315
316
317
318
319
320
321
    },
    {
      title: '设备型号',
      dataIndex: 'deviceModel',
      hideInSearch: true,
      width: 200,
      disable: true,
      onFilter: true,
      ellipsis: true,
322
      hideInTable: true,
323
324
325
326
327
328
329
330
331
    },
    {
      title: '数量',
      dataIndex: 'count',
      hideInSearch: true,
      width: 100,
      disable: true,
      onFilter: true,
      ellipsis: true,
332
      hideInTable: true,
333
334
335
336
337
338
339
340
341
    },
    {
      title: '单价',
      dataIndex: 'unitPrice',
      hideInSearch: true,
      width: 100,
      disable: true,
      onFilter: true,
      ellipsis: true,
342
      hideInTable: true,
343
344
345
346
347
348
349
350
351
    },
    {
      title: '总价',
      dataIndex: 'price',
      hideInSearch: true,
      width: 100,
      disable: true,
      onFilter: true,
      ellipsis: true,
352
      hideInTable: true,
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 && (
                <>
PurelzMgnead authored
428
                  <CheckModal id={[record.id]} toReload={reload}></CheckModal>
429
430
431
                  &nbsp;
                </>
              )}
432
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>
                  &nbsp;
                </>
              )}
              {hasEditPermission && (
                <>
                  <EditorModel
                    currentContract={record.contract}
                    toReload={reload}
                    showTarget={'编辑'}
                  ></EditorModel>
                  &nbsp;
                </>
              )}
              {hasRePutPermission && (
                <>
                  <EditorModel
                    currentContract={record.contract}
                    toReload={reload}
                    showTarget={'重新上传'}
                  ></EditorModel>
                  &nbsp;
                </>
              )}
              {hasDeletePermission && (
                <>
PurelzMgnead authored
461
                  <Comfire currtDid={record.id} sureDelete={toDelete}></Comfire>
462
463
464
465
466
467
468
469
470
                </>
              )}
            </>
          );
        }
        return null;
      },
    },
  ];
471
472
473
474
475
476
477
  return (
    <>
      <EditableProTable<OrderStagesItem>
        className="title-index"
        columnEmptyText=""
        columns={columns}
PurelzMgnead authored
478
479
480
481
        rowSelection={{
          selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
          defaultSelectedRowKeys: [],
        }}
482
483
        cardBordered
        actionRef={ref}
PurelzMgnead authored
484
        scroll={{ x: 1400 }}
485
486
        recordCreatorProps={false}
        request={async (params) => {
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;
          }
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 ||
PurelzMgnead authored
515
516
517
            params.status !== null ||
            params.current !== null ||
            params.pageSize !== null
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,
PurelzMgnead authored
527
528
              current: params.current,
              pageSize: params.pageSize,
529
530
531
532
533
534
            };
            let res = await postOrderErpOrderStagesSearch({
              data: { ...PostOrderErpOrderStagesSearchOption },
            });
            await waitTime(2000);
            if (res) {
PurelzMgnead authored
535
536
537
              const orderStagesWithList: OrderStagesWithListItem[] =
                res?.data.data;
              setSpecialPath(res.data.specialPath);
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,
565
                    orderStagesDeviceVoList: [],
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;
603
604
605
                    item.orderStagesDeviceVoList =
                      orderStagesWithList[ind].orderStagesDeviceVoList;
                    // item.children = [];
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');
                      }
                    }
612
613
614
615
616
617
618
                    // item.children = [];
                    // if (
                    //     orderStagesWithList[ind].orderStagesDeviceVoList.length <=
                    //     1
                    // ) {
                    //     delete item.children;
                    // }
619
620
                    orderStagesList.push(item);
                  }
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);
                  //     }
                  // }
669
670
671
672
                }
              }
              return {
                data: orderStagesList || [],
PurelzMgnead authored
673
                total: res?.data?.total || 0,
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,
706
                    // children: undefined,
707
708
                    status: undefined,
                    statusMark: undefined,
709
                    orderStagesDeviceVoList: [],
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;
748
749
                    item.orderStagesDeviceVoList =
                      orderStagesWithList[ind].orderStagesDeviceVoList;
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');
                      }
                    }
756
757
758
759
760
761
                    // if (
                    //     orderStagesWithList[ind].orderStagesDeviceVoList.length <=
                    //     1
                    // ) {
                    //     delete item.children;
                    // }
762
763
                    orderStagesList.push(item);
                  }
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);
                  //     }
                  // }
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={[]}
PurelzMgnead authored
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>
          );
        }}
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>
          </>,
        ]}
      />
    </>
  );
};