kts-component-invoice-operate 3.2.257 → 3.2.259

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/Invoice/Invoice-digtal/_test/passenger/index.d.ts +4 -0
  2. package/dist/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IColumnsReplenish/index.d.ts +6 -0
  3. package/dist/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IGood/index.d.ts +24 -0
  4. package/dist/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/index.d.ts +44 -0
  5. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +5 -0
  6. package/dist/Invoice/InvoiceController/fns/addPassenger.d.ts +6 -0
  7. package/dist/Invoice/InvoiceController/fns/delPassenger.d.ts +6 -0
  8. package/dist/Invoice/InvoiceController/fns/saveEditPassenger.d.ts +6 -0
  9. package/dist/Invoice/InvoiceController/fns/setEditPassenger.d.ts +6 -0
  10. package/dist/Invoice/InvoiceController/index.d.ts +12 -0
  11. package/dist/Invoice/index.d.ts +2 -0
  12. package/dist/Invoice/ui/components/CustomCascader/index.d.ts +20 -0
  13. package/dist/Invoice/ui/default/ImportPassengerDrawer/index.d.ts +3 -0
  14. package/dist/Invoice/ui/digtal/PassengerList/hook/useColumns/index.d.ts +3 -0
  15. package/dist/Invoice/ui/digtal/PassengerList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
  16. package/dist/Invoice/ui/digtal/PassengerList/hook/useOnRow/index.d.ts +8 -0
  17. package/dist/Invoice/ui/digtal/PassengerList/hook/useRowSelection/index.d.ts +8 -0
  18. package/dist/Invoice/ui/digtal/PassengerList/hook/useWindowClick/index.d.ts +8 -0
  19. package/dist/Invoice/ui/digtal/PassengerList/index.d.ts +18 -0
  20. package/dist/Invoice/ui/digtal/PassengerList/ui/AddRowButton/index.d.ts +3 -0
  21. package/dist/Invoice/ui/digtal/PassengerList/ui/BatchImportButton/index.d.ts +3 -0
  22. package/dist/Invoice/ui/digtal/PassengerList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
  23. package/dist/Invoice/ui/digtal/PassengerList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
  24. package/dist/Invoice/ui/digtal/PassengerList/ui/TableRow/index.d.ts +3 -0
  25. package/dist/Invoice/ui/digtal/PassengerList/ui/TableVirtual/index.d.ts +4 -0
  26. package/dist/Invoice/ui/digtal/Stakeholder/index.d.ts +2 -0
  27. package/dist/index.esm.js +3501 -45
  28. package/dist/index.js +3491 -35
  29. package/package.json +1 -1
  30. package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +12 -0
  31. package/src/Invoice/Invoice-digtal/_test/passenger/index.tsx +14602 -0
  32. package/src/Invoice/Invoice-digtal/index.md +3 -0
  33. package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +11 -0
  34. package/src/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IColumnsReplenish/index.ts +10 -0
  35. package/src/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IGood/index.ts +34 -0
  36. package/src/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/index.ts +179 -0
  37. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +8 -2
  38. package/src/Invoice/InvoiceController/fns/addPassenger.ts +11 -0
  39. package/src/Invoice/InvoiceController/fns/delPassenger.ts +38 -0
  40. package/src/Invoice/InvoiceController/fns/saveEditPassenger.ts +24 -0
  41. package/src/Invoice/InvoiceController/fns/setEditPassenger.ts +16 -0
  42. package/src/Invoice/InvoiceController/index.ts +23 -1
  43. package/src/Invoice/index.tsx +5 -0
  44. package/src/Invoice/ui/components/CustomCascader/index.tsx +356 -0
  45. package/src/Invoice/ui/default/ImportPassengerDrawer/index.tsx +214 -0
  46. package/src/Invoice/ui/digtal/PassengerList/hook/useColumns/index.tsx +428 -0
  47. package/src/Invoice/ui/digtal/PassengerList/hook/useColumns/ui/TitleText/index.tsx +20 -0
  48. package/src/Invoice/ui/digtal/PassengerList/hook/useOnRow/index.tsx +37 -0
  49. package/src/Invoice/ui/digtal/PassengerList/hook/useRowSelection/index.tsx +120 -0
  50. package/src/Invoice/ui/digtal/PassengerList/hook/useWindowClick/index.tsx +23 -0
  51. package/src/Invoice/ui/digtal/PassengerList/index.less +73 -0
  52. package/src/Invoice/ui/digtal/PassengerList/index.tsx +152 -0
  53. package/src/Invoice/ui/digtal/PassengerList/ui/AddRowButton/index.tsx +75 -0
  54. package/src/Invoice/ui/digtal/PassengerList/ui/BatchImportButton/index.tsx +74 -0
  55. package/src/Invoice/ui/digtal/PassengerList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
  56. package/src/Invoice/ui/digtal/PassengerList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +37 -0
  57. package/src/Invoice/ui/digtal/PassengerList/ui/TableRow/index.less +29 -0
  58. package/src/Invoice/ui/digtal/PassengerList/ui/TableRow/index.tsx +21 -0
  59. package/src/Invoice/ui/digtal/PassengerList/ui/TableVirtual/index.less +39 -0
  60. package/src/Invoice/ui/digtal/PassengerList/ui/TableVirtual/index.tsx +109 -0
  61. package/src/Invoice/ui/digtal/Stakeholder/index.tsx +22 -17
package/dist/index.esm.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import 'kts-components-antd-x3/dist/kts-components-antd-x3.css';
2
- import React, { createElement, createContext, useContext, useEffect, forwardRef, Children, isValidElement, useCallback } from 'react';
2
+ import React, { createElement, createContext, useContext, useEffect, forwardRef, Children, isValidElement, useCallback, useState, useRef, useImperativeHandle } from 'react';
3
3
  import GreyReactBox, { decorator } from 'grey-react-box';
4
4
  import { chain as chain$1, bignumber, format as format$1, create, all, equal } from 'mathjs';
5
- import { message, Form, Input, Icon as Icon$1, Tag as Tag$1, Select, Button, Tooltip, Switch as Switch$1, Typography, Menu, Dropdown, AutoComplete as AutoComplete$2, Spin, Checkbox, Drawer, Descriptions, Empty, Divider, Popover as Popover$1, Table as Table$1, Tree, Modal as Modal$1, Row as Row$2, Col as Col$2 } from 'kts-components-antd-x3';
5
+ import { message, Form, Input, Icon as Icon$2, Tag as Tag$1, Select, Button, Tooltip, Switch as Switch$1, Typography, Menu, Dropdown, AutoComplete as AutoComplete$2, Spin, Checkbox, Drawer, Descriptions, Empty, Divider, Popover as Popover$1, Table as Table$1, Tree, Modal as Modal$1, Row as Row$2, Col as Col$2 } from 'kts-components-antd-x3';
6
6
  import { v4 } from 'uuid';
7
- import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Button as Button$1, Dropdown as Dropdown$1, Row, Col, Checkbox as Checkbox$1, Tooltip as Tooltip$1, Input as Input$1, Select as Select$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal, Cascader as Cascader$1, Tree as Tree$1, Card, FormReadOnly } from 'kts-xui';
7
+ import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Button as Button$1, Dropdown as Dropdown$1, Row, Col, Checkbox as Checkbox$1, Tooltip as Tooltip$1, Input as Input$1, Select as Select$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal, Cascader as Cascader$1, DatePicker as DatePicker$1, Tree as Tree$1, Card, FormReadOnly } from 'kts-xui';
8
8
  import classnames from 'classnames';
9
9
  import { Table } from 'kts-components-antd-x4-v4';
10
10
  import { render } from 'react-dom';
11
- import { DatePicker, Row as Row$1, Col as Col$1, Input as Input$2, Cascader, Select as Select$2, Button as Button$2, Form as Form$2, Modal as Modal$2, Space as Space$1, Radio as Radio$1 } from 'kts-components-antd-x4';
11
+ import { DatePicker, Row as Row$1, Col as Col$1, Input as Input$2, Cascader, Select as Select$2, Button as Button$2, Upload, Typography as Typography$1, Drawer as Drawer$2, Space as Space$1, message as message$2, Alert, Table as Table$2, Form as Form$2, Modal as Modal$2, Radio as Radio$1 } from 'kts-components-antd-x4';
12
12
  import { Input as Input$3, NumberPicker } from '@formily/antd-components';
13
13
  import { createAsyncFormActions, FormEffectHooks, SchemaForm, FormButtonGroup, SchemaMarkupField } from '@formily/antd';
14
14
 
@@ -505,6 +505,42 @@ function _isNativeReflectConstruct() {
505
505
  }
506
506
  }
507
507
 
508
+ function _objectWithoutPropertiesLoose(source, excluded) {
509
+ if (source == null) return {};
510
+ var target = {};
511
+ var sourceKeys = Object.keys(source);
512
+ var key, i;
513
+
514
+ for (i = 0; i < sourceKeys.length; i++) {
515
+ key = sourceKeys[i];
516
+ if (excluded.indexOf(key) >= 0) continue;
517
+ target[key] = source[key];
518
+ }
519
+
520
+ return target;
521
+ }
522
+
523
+ function _objectWithoutProperties(source, excluded) {
524
+ if (source == null) return {};
525
+
526
+ var target = _objectWithoutPropertiesLoose(source, excluded);
527
+
528
+ var key, i;
529
+
530
+ if (Object.getOwnPropertySymbols) {
531
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
532
+
533
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
534
+ key = sourceSymbolKeys[i];
535
+ if (excluded.indexOf(key) >= 0) continue;
536
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
537
+ target[key] = source[key];
538
+ }
539
+ }
540
+
541
+ return target;
542
+ }
543
+
508
544
  function _assertThisInitialized(self) {
509
545
  if (self === void 0) {
510
546
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -759,7 +795,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
759
795
  var _validateFields2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
760
796
  var _this3 = this;
761
797
 
762
- var _errors, _values, arr, i, key, _yield$_validateField, errors, values, _this$state$goodsList, _this$state$freightLi, _this$state$payListSt;
798
+ var _errors, _values, arr, i, key, _yield$_validateField, errors, values, _this$state$goodsList, _this$state$freightLi, _this$state$passenger, _this$state$payListSt;
763
799
 
764
800
  return _regeneratorRuntime().wrap(function _callee$(_context) {
765
801
  while (1) {
@@ -840,17 +876,17 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
840
876
  _errors.set('freightList', _context.t1.errors);
841
877
 
842
878
  case 37:
843
- _values.set('freightList', this.state.freightListState.goodsList.slice()); //支付
879
+ _values.set('freightList', this.state.freightListState.goodsList.slice()); //旅客运输列表
844
880
 
845
881
 
846
- if (!this.state.payListState.form) {
882
+ if (!this.state.passengerListState.form) {
847
883
  _context.next = 47;
848
884
  break;
849
885
  }
850
886
 
851
887
  _context.prev = 39;
852
888
  _context.next = 42;
853
- return (_this$state$payListSt = this.state.payListState.form) === null || _this$state$payListSt === void 0 ? void 0 : _this$state$payListSt.validateFields();
889
+ return (_this$state$passenger = this.state.passengerListState.form) === null || _this$state$passenger === void 0 ? void 0 : _this$state$passenger.validateFields();
854
890
 
855
891
  case 42:
856
892
  _context.next = 47;
@@ -860,9 +896,32 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
860
896
  _context.prev = 44;
861
897
  _context.t2 = _context["catch"](39);
862
898
 
863
- _errors.set('payList', _context.t2.errors);
899
+ _errors.set('passengerList', _context.t2.errors);
864
900
 
865
901
  case 47:
902
+ _values.set('passengerList', this.state.passengerListState.goodsList.slice()); //支付
903
+
904
+
905
+ if (!this.state.payListState.form) {
906
+ _context.next = 57;
907
+ break;
908
+ }
909
+
910
+ _context.prev = 49;
911
+ _context.next = 52;
912
+ return (_this$state$payListSt = this.state.payListState.form) === null || _this$state$payListSt === void 0 ? void 0 : _this$state$payListSt.validateFields();
913
+
914
+ case 52:
915
+ _context.next = 57;
916
+ break;
917
+
918
+ case 54:
919
+ _context.prev = 54;
920
+ _context.t3 = _context["catch"](49);
921
+
922
+ _errors.set('payList', _context.t3.errors);
923
+
924
+ case 57:
866
925
  _values.set('payList', this.state.payListState.goodsList.slice()); // 金额(不含税)
867
926
 
868
927
 
@@ -909,12 +968,12 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
909
968
  values: _values
910
969
  });
911
970
 
912
- case 53:
971
+ case 63:
913
972
  case "end":
914
973
  return _context.stop();
915
974
  }
916
975
  }
917
- }, _callee, this, [[19, 24], [29, 34], [39, 44]]);
976
+ }, _callee, this, [[19, 24], [29, 34], [39, 44], [49, 54]]);
918
977
  }));
919
978
 
920
979
  function validateFields() {
@@ -1327,6 +1386,261 @@ var AutoComplete = /*#__PURE__*/_createClass(function AutoComplete() {
1327
1386
  this.onItemCodeSearch = void 0;
1328
1387
  });
1329
1388
 
1389
+ var CertificateTypeList = [{
1390
+ value: 'COMPANY',
1391
+ label: '单位'
1392
+ }, {
1393
+ value: 'ORGANIZATION_CODE',
1394
+ label: '组织机构代码证'
1395
+ }, {
1396
+ value: 'BUSINESS_LICENSE',
1397
+ label: '营业执照'
1398
+ }, {
1399
+ value: 'TAX_REGISTRATION_CERTIFICATE',
1400
+ label: '税务登记证'
1401
+ }, {
1402
+ value: 'OTHER_COMPANY_CERTIFICATE',
1403
+ label: '其他单位证件'
1404
+ }, {
1405
+ value: 'INDIVIDUAL',
1406
+ label: '个人'
1407
+ }, {
1408
+ value: 'RESIDENT_ID_CARD',
1409
+ label: '居民身份证'
1410
+ }, {
1411
+ value: 'OFFICER_ID_CARD',
1412
+ label: '军官证'
1413
+ }, {
1414
+ value: 'ARMED_POLICE_ID_CARD',
1415
+ label: '武警警官证'
1416
+ }, {
1417
+ value: 'SOLDIER_ID_CARD',
1418
+ label: '士兵证'
1419
+ }, {
1420
+ value: 'RETIRED_MILITARY_CADRE_CERTIFICATE',
1421
+ label: '军队离退休干部证'
1422
+ }, {
1423
+ value: 'DISABLED_PERSON_CERTIFICATE',
1424
+ label: '残疾人证'
1425
+ }, {
1426
+ value: 'DISABLED_SOLDIER_CERTIFICATE',
1427
+ label: '残疾军人证(1-8级)'
1428
+ }, {
1429
+ value: 'FOREIGN_PASSPORT',
1430
+ label: '外国护照'
1431
+ }, {
1432
+ value: 'HOME_RETURN_PERMIT',
1433
+ label: '港澳同胞回乡证'
1434
+ }, {
1435
+ value: 'HONG_KONG_MACAO_MAINLAND_PERMIT',
1436
+ label: '港澳居民来往内地通行证'
1437
+ }, {
1438
+ value: 'TAIWAN_COMPATRIOT_PERMIT',
1439
+ label: '台胞证'
1440
+ }, {
1441
+ value: 'HONG_KONG_MACAO_PERMIT',
1442
+ label: '中华人民共和国往来港澳通行证'
1443
+ }, {
1444
+ value: 'TAIWAN_MAINLAND_PERMIT',
1445
+ label: '台湾居民来往大陆通行证'
1446
+ }, {
1447
+ value: 'MAINLAND_TAIWAN_PERMIT',
1448
+ label: '大陆居民往来台湾通行证'
1449
+ }, {
1450
+ value: 'FOREIGN_RESIDENCE_PERMIT',
1451
+ label: '外国人居留证'
1452
+ }, {
1453
+ value: 'DIPLOMATIC_ID_CARD',
1454
+ label: '外交官证'
1455
+ }, {
1456
+ value: 'CONSULATE_ID_CARD',
1457
+ label: '使(领事)馆证'
1458
+ }, {
1459
+ value: 'SEAMAN_BOOK',
1460
+ label: '海员证'
1461
+ }, {
1462
+ value: 'HONG_KONG_PERMANENT_ID_CARD',
1463
+ label: '香港永久性居民身份证'
1464
+ }, {
1465
+ value: 'TAIWAN_ID_CARD',
1466
+ label: '台湾身份证'
1467
+ }, {
1468
+ value: 'MACAO_PERMANENT_ID_CARD',
1469
+ label: '澳门特别行政区永久性居民身份证'
1470
+ }, {
1471
+ value: 'FOREIGNER_ID_CARD',
1472
+ label: '外国人身份证件'
1473
+ }, {
1474
+ value: 'GRADUATE_STARTUP_CERTIFICATE',
1475
+ label: '高校毕业生自主创业证'
1476
+ }, {
1477
+ value: 'EMPLOYMENT_UNEMPLOYMENT_CERTIFICATE',
1478
+ label: '就业失业登记证'
1479
+ }, {
1480
+ value: 'RETIREMENT_CERTIFICATE',
1481
+ label: '退休证'
1482
+ }, {
1483
+ value: 'RETIRED_CADRE_CERTIFICATE',
1484
+ label: '离休证'
1485
+ }, {
1486
+ value: 'CHINESE_PASSPORT',
1487
+ label: '中国护照'
1488
+ }, {
1489
+ value: 'RETIRED_SOLDIER_SELF_EMPLOYMENT_CERTIFICATE',
1490
+ label: '城镇退役士兵自谋职业证'
1491
+ }, {
1492
+ value: 'MILITARY_FAMILY_IDENTITY_CERTIFICATE',
1493
+ label: '随军家属身份证明'
1494
+ }, {
1495
+ value: 'MILITARY_OFFICER_TRANSFER_CERTIFICATE',
1496
+ label: '中国人民解放军军官转业证书'
1497
+ }, {
1498
+ value: 'MILITARY_CONSCRIPT_RETIREMENT_CERTIFICATE',
1499
+ label: '中国人民解放军义务兵退出现役证'
1500
+ }, {
1501
+ value: 'MILITARY_NCO_RETIREMENT_CERTIFICATE',
1502
+ label: '中国人民解放军士官退出现役证'
1503
+ }, {
1504
+ value: 'FOREIGN_PERMANENT_RESIDENCE_ID_CARD',
1505
+ label: '外国人永久居留身份证(外国人永久居留证)'
1506
+ }, {
1507
+ value: 'EMPLOYMENT_ENTREPRENEURSHIP_CERTIFICATE',
1508
+ label: '就业创业证'
1509
+ }, {
1510
+ value: 'HONG_KONG_PASSPORT',
1511
+ label: '香港特别行政区护照'
1512
+ }, {
1513
+ value: 'MACAO_PASSPORT',
1514
+ label: '澳门特别行政区护照'
1515
+ }, {
1516
+ value: 'HONG_KONG_MACAO_RESIDENCE_PERMIT',
1517
+ label: '中华人民共和国港澳居民居住证'
1518
+ }, {
1519
+ value: 'TAIWAN_RESIDENCE_PERMIT',
1520
+ label: '中华人民共和国台湾居民居住证'
1521
+ }, {
1522
+ value: 'FOREIGN_WORK_PERMIT_A',
1523
+ label: '中华人民共和国外国人工作许可证(A类)'
1524
+ }, {
1525
+ value: 'FOREIGN_WORK_PERMIT_B',
1526
+ label: '中华人民共和国外国人工作许可证(B类)'
1527
+ }, {
1528
+ value: 'FOREIGN_WORK_PERMIT_C',
1529
+ label: '中华人民共和国外国人工作许可证(C类)'
1530
+ }, {
1531
+ value: 'BIRTH_MEDICAL_CERTIFICATE',
1532
+ label: '出生医学证明'
1533
+ }, {
1534
+ value: 'OTHER_INDIVIDUAL_CERTIFICATE',
1535
+ label: '其他个人证件'
1536
+ }]; // 在 Antd 中使用方式:
1537
+ // <Select options={options} />
1538
+
1539
+ var VehicleTypeList = [{
1540
+ value: 'AIRCRAFT',
1541
+ label: '飞机'
1542
+ }, {
1543
+ value: 'TRAIN',
1544
+ label: '火车'
1545
+ }, {
1546
+ value: 'LONG_DISTANCE_BUS',
1547
+ label: '长途汽车'
1548
+ }, {
1549
+ value: 'PUBLIC_TRANSPORT',
1550
+ label: '公共交通'
1551
+ }, {
1552
+ value: 'TAXI',
1553
+ label: '出租车'
1554
+ }, {
1555
+ value: 'AUTOMOBILE',
1556
+ label: '汽车'
1557
+ }, {
1558
+ value: 'SHIP',
1559
+ label: '船舶'
1560
+ }, {
1561
+ value: 'OTHER',
1562
+ label: '其他'
1563
+ }];
1564
+
1565
+ var PassengerListState = /*#__PURE__*/_createClass(function PassengerListState() {
1566
+ _classCallCheck(this, PassengerListState);
1567
+
1568
+ this.goodMax = void 0;
1569
+ this.editGood = void 0;
1570
+ this.isAddRow = true;
1571
+ this.isRemRow = true;
1572
+ this.isBatchImport = true;
1573
+ this.isVisibleDrawer = false;
1574
+ this.goodsMap = new Map();
1575
+ this.form = void 0;
1576
+ this.certificateTypeList = CertificateTypeList;
1577
+ this.vehicleTypeList = VehicleTypeList;
1578
+ this.goodsList = [];
1579
+ this.selectedGoodIndex = [];
1580
+ this.area = [];
1581
+ this.addressFieldNames = {
1582
+ label: 'label',
1583
+ value: 'value',
1584
+ children: 'children'
1585
+ };
1586
+ this.dataSource = [];
1587
+ this.pagination = {};
1588
+ this.columns = [{
1589
+ title: '序号',
1590
+ dataIndex: 'i',
1591
+ key: 'i',
1592
+ render: function render(t, record, index) {
1593
+ return index + 1;
1594
+ }
1595
+ }, {
1596
+ title: '出行人',
1597
+ dataIndex: 'cxr',
1598
+ key: 'cxr'
1599
+ }, {
1600
+ title: '出行日期',
1601
+ dataIndex: 'chuxrq',
1602
+ key: 'chuxrq'
1603
+ }, {
1604
+ title: '出行人证件类型',
1605
+ dataIndex: 'cxrzjlxDm',
1606
+ key: 'cxrzjlxDm'
1607
+ }, {
1608
+ title: '出行人证件号码',
1609
+ dataIndex: 'sfzjhm',
1610
+ key: 'sfzjhm',
1611
+ render: function render(text) {
1612
+ var _CertificateTypeList$;
1613
+
1614
+ return ((_CertificateTypeList$ = CertificateTypeList.find(function (e) {
1615
+ return e.value === text;
1616
+ })) === null || _CertificateTypeList$ === void 0 ? void 0 : _CertificateTypeList$.label) || '';
1617
+ }
1618
+ }, {
1619
+ title: '出发点',
1620
+ dataIndex: 'cfd',
1621
+ key: 'cfd'
1622
+ }, {
1623
+ title: '到达地',
1624
+ dataIndex: 'ddd',
1625
+ key: 'ddd'
1626
+ }, {
1627
+ title: '交通工具类型',
1628
+ dataIndex: 'jtgjlxDm',
1629
+ key: 'jtgjlxDm',
1630
+ render: function render(text) {
1631
+ var _VehicleTypeList$find;
1632
+
1633
+ return ((_VehicleTypeList$find = VehicleTypeList.find(function (e) {
1634
+ return e.value === text;
1635
+ })) === null || _VehicleTypeList$find === void 0 ? void 0 : _VehicleTypeList$find.label) || '';
1636
+ }
1637
+ }, {
1638
+ title: '等级',
1639
+ dataIndex: 'zwdj',
1640
+ key: 'zwdj'
1641
+ }];
1642
+ });
1643
+
1330
1644
  var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControllerState() {
1331
1645
  _classCallCheck(this, InvoiceControllerState);
1332
1646
 
@@ -1345,6 +1659,7 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
1345
1659
  this.taxClassificationProps = void 0;
1346
1660
  this.freightListState = new FreightListState();
1347
1661
  this.payListState = new PayListState();
1662
+ this.passengerListState = new PassengerListState();
1348
1663
  this.addGoodsCheck = void 0;
1349
1664
  });
1350
1665
 
@@ -1450,6 +1765,40 @@ var setEditPay = /*#__PURE__*/(function () {
1450
1765
  };
1451
1766
  })();
1452
1767
 
1768
+ /**
1769
+ * 设置当前的编辑货物运输
1770
+ */
1771
+ var setEditPassenger = /*#__PURE__*/(function () {
1772
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, newEditGood) {
1773
+ var editGood;
1774
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1775
+ while (1) {
1776
+ switch (_context.prev = _context.next) {
1777
+ case 0:
1778
+ if (newEditGood) {
1779
+ editGood = state.passengerListState.editGood;
1780
+ state.passengerListState = _objectSpread2(_objectSpread2({}, state.passengerListState), {}, {
1781
+ editGood: _objectSpread2(_objectSpread2({}, editGood), newEditGood)
1782
+ });
1783
+ } else {
1784
+ state.passengerListState = _objectSpread2(_objectSpread2({}, state.passengerListState), {}, {
1785
+ editGood: undefined
1786
+ });
1787
+ }
1788
+
1789
+ case 1:
1790
+ case "end":
1791
+ return _context.stop();
1792
+ }
1793
+ }
1794
+ }, _callee);
1795
+ }));
1796
+
1797
+ return function (_x, _x2) {
1798
+ return _ref.apply(this, arguments);
1799
+ };
1800
+ })();
1801
+
1453
1802
  /**
1454
1803
  * 设置单个货物属性
1455
1804
  */
@@ -1810,6 +2159,87 @@ var delPay = /*#__PURE__*/(function () {
1810
2159
  };
1811
2160
  })();
1812
2161
 
2162
+ /**
2163
+ * 删除一个货物运输
2164
+ */
2165
+ var delPassenger = /*#__PURE__*/(function () {
2166
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, $index) {
2167
+ var goods, goodsList, goodsMap, i;
2168
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2169
+ while (1) {
2170
+ switch (_context.prev = _context.next) {
2171
+ case 0:
2172
+ if ($index) {
2173
+ _context.next = 2;
2174
+ break;
2175
+ }
2176
+
2177
+ return _context.abrupt("return");
2178
+
2179
+ case 2:
2180
+ // 查下要删除的货物
2181
+ goods = state.passengerListState.goodsList.filter(function (e) {
2182
+ return e.$index === $index;
2183
+ })[0];
2184
+
2185
+ if (goods) {
2186
+ _context.next = 5;
2187
+ break;
2188
+ }
2189
+
2190
+ return _context.abrupt("return");
2191
+
2192
+ case 5:
2193
+ // 如果正在编辑 就取消编辑
2194
+ if (state.passengerListState.editGood && state.passengerListState.editGood.$index === $index) {
2195
+ state.passengerListState.editGood = undefined;
2196
+ }
2197
+
2198
+ goodsList = state.passengerListState.goodsList;
2199
+ goodsMap = state.passengerListState.goodsMap;
2200
+ goodsMap.delete($index);
2201
+ i = 0;
2202
+
2203
+ case 10:
2204
+ if (!(i < goodsList.length)) {
2205
+ _context.next = 17;
2206
+ break;
2207
+ }
2208
+
2209
+ if (!(goodsList[i].$index === $index)) {
2210
+ _context.next = 14;
2211
+ break;
2212
+ }
2213
+
2214
+ // const good = goodsList[i];
2215
+ // if (good.lineAttribute === LineAttributeType.折扣行 && goodsList[i - 1] && goodsList[i - 1].lineAttribute === LineAttributeType.被折扣行) {
2216
+ // goodsList[i - 1].lineAttribute = LineAttributeType.正常;
2217
+ // }
2218
+ goodsList.splice(i, 1);
2219
+ return _context.abrupt("break", 17);
2220
+
2221
+ case 14:
2222
+ i++;
2223
+ _context.next = 10;
2224
+ break;
2225
+
2226
+ case 17:
2227
+ state.passengerListState.goodsList = _toConsumableArray(goodsList);
2228
+ state.passengerListState.goodsMap = new Map(goodsMap);
2229
+
2230
+ case 19:
2231
+ case "end":
2232
+ return _context.stop();
2233
+ }
2234
+ }
2235
+ }, _callee);
2236
+ }));
2237
+
2238
+ return function (_x, _x2) {
2239
+ return _ref.apply(this, arguments);
2240
+ };
2241
+ })();
2242
+
1813
2243
  var idGenerator = (function () {
1814
2244
  return v4();
1815
2245
  });
@@ -2215,6 +2645,33 @@ var addFreight = /*#__PURE__*/(function () {
2215
2645
  };
2216
2646
  })();
2217
2647
 
2648
+ /**
2649
+ * 添加的编旅客运输
2650
+ */
2651
+
2652
+ var addPassenger = /*#__PURE__*/(function () {
2653
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
2654
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2655
+ while (1) {
2656
+ switch (_context.prev = _context.next) {
2657
+ case 0:
2658
+ options.$index = idGenerator();
2659
+ state.passengerListState.goodsList = [].concat(_toConsumableArray(state.passengerListState.goodsList), [options]);
2660
+ return _context.abrupt("return", options);
2661
+
2662
+ case 3:
2663
+ case "end":
2664
+ return _context.stop();
2665
+ }
2666
+ }
2667
+ }, _callee);
2668
+ }));
2669
+
2670
+ return function (_x, _x2) {
2671
+ return _ref.apply(this, arguments);
2672
+ };
2673
+ })();
2674
+
2218
2675
  /**
2219
2676
  * 添加的付款
2220
2677
  */
@@ -2479,6 +2936,85 @@ var validateFields$2 = function validateFields(form) {
2479
2936
  });
2480
2937
  };
2481
2938
 
2939
+ /**
2940
+ * 保存正在编辑的货物
2941
+ */
2942
+ var saveEditPassenger = /*#__PURE__*/(function () {
2943
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state) {
2944
+ var editGood, form;
2945
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2946
+ while (1) {
2947
+ switch (_context.prev = _context.next) {
2948
+ case 0:
2949
+ editGood = state.passengerListState.editGood;
2950
+ form = state.passengerListState.form;
2951
+
2952
+ if (!(!editGood || !form)) {
2953
+ _context.next = 4;
2954
+ break;
2955
+ }
2956
+
2957
+ return _context.abrupt("return");
2958
+
2959
+ case 4:
2960
+ _context.next = 6;
2961
+ return validateFields$3(form);
2962
+
2963
+ case 6:
2964
+ if (!_context.sent.err) {
2965
+ _context.next = 8;
2966
+ break;
2967
+ }
2968
+
2969
+ return _context.abrupt("return");
2970
+
2971
+ case 8:
2972
+ state.passengerListState.goodsList = state.passengerListState.goodsList.map(function (e) {
2973
+ return e.$index === editGood.$index ? _objectSpread2(_objectSpread2({}, e), editGood) : e;
2974
+ });
2975
+ state.passengerListState.editGood = undefined;
2976
+
2977
+ case 10:
2978
+ case "end":
2979
+ return _context.stop();
2980
+ }
2981
+ }
2982
+ }, _callee);
2983
+ }));
2984
+
2985
+ return function (_x) {
2986
+ return _ref.apply(this, arguments);
2987
+ };
2988
+ })();
2989
+
2990
+ var validateFields$3 = function validateFields(form) {
2991
+ return new Promise(function (resolve) {
2992
+ form.validateFields( /*#__PURE__*/function () {
2993
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
2994
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2995
+ while (1) {
2996
+ switch (_context2.prev = _context2.next) {
2997
+ case 0:
2998
+ resolve({
2999
+ err: err,
3000
+ values: values
3001
+ });
3002
+
3003
+ case 1:
3004
+ case "end":
3005
+ return _context2.stop();
3006
+ }
3007
+ }
3008
+ }, _callee2);
3009
+ }));
3010
+
3011
+ return function (_x2, _x3) {
3012
+ return _ref2.apply(this, arguments);
3013
+ };
3014
+ }());
3015
+ });
3016
+ };
3017
+
2482
3018
  /**
2483
3019
  * 计算搜索商品
2484
3020
  * @param goodsList 被搜索列表
@@ -10489,16 +11025,20 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
10489
11025
  _this.setFreight = _this.pipeline(setFreight);
10490
11026
  _this.setPay = _this.pipeline(setPay);
10491
11027
  _this.setEditFreight = _this.pipeline(setEditFreight);
11028
+ _this.setEditPassenger = _this.pipeline(setEditPassenger);
10492
11029
  _this.setEditPay = _this.pipeline(setEditPay);
10493
11030
  _this.setEditGood = _this.pipeline(setEditGood);
10494
11031
  _this.saveEditGood = _this.pipeline(saveEditGood);
10495
11032
  _this.saveEditFreight = _this.pipeline(saveEditFreight);
11033
+ _this.saveEditPassenger = _this.pipeline(saveEditPassenger);
10496
11034
  _this.saveEditPay = _this.pipeline(saveEditPay);
10497
11035
  _this.delGood = _this.pipeline(delGood);
10498
11036
  _this.delFreight = _this.pipeline(delFreight);
11037
+ _this.delPassenger = _this.pipeline(delPassenger);
10499
11038
  _this.delPay = _this.pipeline(delPay);
10500
11039
  _this.addGood = _this.pipeline(addGood);
10501
11040
  _this.addFreight = _this.pipeline(addFreight);
11041
+ _this.addPassenger = _this.pipeline(addPassenger);
10502
11042
  _this.addPay = _this.pipeline(addPay);
10503
11043
  _this.mergeDetails = _this.pipeline(mergeDetails);
10504
11044
  _this.mergeDiscount = _this.pipeline(mergeDiscount);
@@ -10511,6 +11051,8 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
10511
11051
  _this.getGoodsSearch = getGoodsSearch;
10512
11052
  _this.getGoodsTaxRateList = void 0;
10513
11053
  _this.setColumnsConfig = void 0;
11054
+ _this.downloadPassengerTpt = void 0;
11055
+ _this.uploadPassenger = void 0;
10514
11056
  return _this;
10515
11057
  } // ----------------- 发票头 模块相关 -----------------
10516
11058
 
@@ -10722,7 +11264,7 @@ var InvoiceHeader = decorator(Form.create())(function (props) {
10722
11264
  width: 230
10723
11265
  },
10724
11266
  size: "small",
10725
- suffix: controller.updateInvoiceNo && /*#__PURE__*/React.createElement(Icon$1, {
11267
+ suffix: controller.updateInvoiceNo && /*#__PURE__*/React.createElement(Icon$2, {
10726
11268
  style: {
10727
11269
  cursor: 'pointer'
10728
11270
  },
@@ -11368,7 +11910,7 @@ var DescribeSwitch = (function () {
11368
11910
  }
11369
11911
  }, /*#__PURE__*/React.createElement(Tooltip, {
11370
11912
  title: "\u84DD\u8272\u4EE3\u8868\u6211\u65B9\u5546\u54C1\u63CF\u8FF0\uFF0C\u9ED1\u8272\u4EE3\u8868\u5BF9\u65B9\u7684\u5546\u54C1\u63CF\u8FF0\u3002"
11371
- }, /*#__PURE__*/React.createElement(Icon$1, {
11913
+ }, /*#__PURE__*/React.createElement(Icon$2, {
11372
11914
  style: {
11373
11915
  marginRight: 3
11374
11916
  },
@@ -11479,7 +12021,7 @@ function Search() {
11479
12021
  value: value,
11480
12022
  className: "kts-invoice-operate-goods-list-search",
11481
12023
  placeholder: "\u8BF7\u60A8\u8F93\u5165".concat(columnshide.includes('itemCode') ? '' : '商品编码、', "\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(").concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
11482
- prefix: /*#__PURE__*/React.createElement(Icon$1, {
12024
+ prefix: /*#__PURE__*/React.createElement(Icon$2, {
11483
12025
  component: SvgMagnifier,
11484
12026
  style: {
11485
12027
  color: "#b8b8b8"
@@ -12035,7 +12577,7 @@ var RowMenu = (function (props) {
12035
12577
  }, /*#__PURE__*/React.createElement(Button, {
12036
12578
  className: "kts-invoice-operate-goods-list-columns-row-menu ant-btn-icon-only",
12037
12579
  type: "link"
12038
- }, /*#__PURE__*/React.createElement(Icon$1, {
12580
+ }, /*#__PURE__*/React.createElement(Icon$2, {
12039
12581
  component: SvgSpot
12040
12582
  }))));
12041
12583
  });
@@ -12470,7 +13012,68 @@ function _objectSpread2$1(target) {
12470
13012
  return target;
12471
13013
  }
12472
13014
 
12473
- function _objectWithoutPropertiesLoose(source, excluded) {
13015
+ function _arrayWithHoles$1(arr) {
13016
+ if (Array.isArray(arr)) return arr;
13017
+ }
13018
+
13019
+ function _iterableToArrayLimit$1(arr, i) {
13020
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
13021
+
13022
+ if (_i == null) return;
13023
+ var _arr = [];
13024
+ var _n = true;
13025
+ var _d = false;
13026
+
13027
+ var _s, _e;
13028
+
13029
+ try {
13030
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
13031
+ _arr.push(_s.value);
13032
+
13033
+ if (i && _arr.length === i) break;
13034
+ }
13035
+ } catch (err) {
13036
+ _d = true;
13037
+ _e = err;
13038
+ } finally {
13039
+ try {
13040
+ if (!_n && _i["return"] != null) _i["return"]();
13041
+ } finally {
13042
+ if (_d) throw _e;
13043
+ }
13044
+ }
13045
+
13046
+ return _arr;
13047
+ }
13048
+
13049
+ function _arrayLikeToArray$1(arr, len) {
13050
+ if (len == null || len > arr.length) len = arr.length;
13051
+
13052
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
13053
+ arr2[i] = arr[i];
13054
+ }
13055
+
13056
+ return arr2;
13057
+ }
13058
+
13059
+ function _unsupportedIterableToArray$1(o, minLen) {
13060
+ if (!o) return;
13061
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
13062
+ var n = Object.prototype.toString.call(o).slice(8, -1);
13063
+ if (n === "Object" && o.constructor) n = o.constructor.name;
13064
+ if (n === "Map" || n === "Set") return Array.from(o);
13065
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
13066
+ }
13067
+
13068
+ function _nonIterableRest$1() {
13069
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
13070
+ }
13071
+
13072
+ function _slicedToArray$1(arr, i) {
13073
+ return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
13074
+ }
13075
+
13076
+ function _objectWithoutPropertiesLoose$1(source, excluded) {
12474
13077
  if (source == null) return {};
12475
13078
  var target = {};
12476
13079
  var sourceKeys = Object.keys(source);
@@ -12485,9 +13088,9 @@ function _objectWithoutPropertiesLoose(source, excluded) {
12485
13088
  return target;
12486
13089
  }
12487
13090
 
12488
- function _objectWithoutProperties(source, excluded) {
13091
+ function _objectWithoutProperties$1(source, excluded) {
12489
13092
  if (source == null) return {};
12490
- var target = _objectWithoutPropertiesLoose(source, excluded);
13093
+ var target = _objectWithoutPropertiesLoose$1(source, excluded);
12491
13094
  var key, i;
12492
13095
 
12493
13096
  if (Object.getOwnPropertySymbols) {
@@ -12504,6 +13107,16 @@ function _objectWithoutProperties(source, excluded) {
12504
13107
  return target;
12505
13108
  }
12506
13109
 
13110
+ function _typeof(obj) {
13111
+ "@babel/helpers - typeof";
13112
+
13113
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
13114
+ return typeof obj;
13115
+ } : function (obj) {
13116
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
13117
+ }, _typeof(obj);
13118
+ }
13119
+
12507
13120
  /**
12508
13121
  * Take input from [0, n] and return it as [0, 1]
12509
13122
  * @hidden
@@ -13405,6 +14018,53 @@ function updateCSS(css, key) {
13405
14018
  function warning$1(valid, message) {
13406
14019
  warningOnce(valid, "[@ant-design/icons] ".concat(message));
13407
14020
  }
14021
+ function isIconDefinition(target) {
14022
+ return _typeof(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (_typeof(target.icon) === 'object' || typeof target.icon === 'function');
14023
+ }
14024
+ function normalizeAttrs() {
14025
+ var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14026
+ return Object.keys(attrs).reduce(function (acc, key) {
14027
+ var val = attrs[key];
14028
+
14029
+ switch (key) {
14030
+ case 'class':
14031
+ acc.className = val;
14032
+ delete acc.class;
14033
+ break;
14034
+
14035
+ default:
14036
+ acc[key] = val;
14037
+ }
14038
+
14039
+ return acc;
14040
+ }, {});
14041
+ }
14042
+ function generate$1(node, key, rootProps) {
14043
+ if (!rootProps) {
14044
+ return /*#__PURE__*/React.createElement(node.tag, _objectSpread2$1({
14045
+ key: key
14046
+ }, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {
14047
+ return generate$1(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
14048
+ }));
14049
+ }
14050
+
14051
+ return /*#__PURE__*/React.createElement(node.tag, _objectSpread2$1(_objectSpread2$1({
14052
+ key: key
14053
+ }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {
14054
+ return generate$1(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
14055
+ }));
14056
+ }
14057
+ function getSecondaryColor(primaryColor) {
14058
+ // choose the second color
14059
+ return generate(primaryColor)[0];
14060
+ }
14061
+ function normalizeTwoToneColors(twoToneColor) {
14062
+ if (!twoToneColor) {
14063
+ return [];
14064
+ }
14065
+
14066
+ return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
14067
+ } // These props make sure that the SVG behaviours like general text.
13408
14068
  // Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
13409
14069
 
13410
14070
  var svgBaseProps = {
@@ -13429,8 +14089,192 @@ var useInsertStyles = function useInsertStyles() {
13429
14089
  }, []);
13430
14090
  };
13431
14091
 
13432
- var _excluded = ["className", "component", "viewBox", "spin", "rotate", "tabIndex", "onClick", "children"];
14092
+ var _excluded = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"];
14093
+ var twoToneColorPalette = {
14094
+ primaryColor: '#333',
14095
+ secondaryColor: '#E6E6E6',
14096
+ calculated: false
14097
+ };
14098
+
14099
+ function setTwoToneColors(_ref) {
14100
+ var primaryColor = _ref.primaryColor,
14101
+ secondaryColor = _ref.secondaryColor;
14102
+ twoToneColorPalette.primaryColor = primaryColor;
14103
+ twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
14104
+ twoToneColorPalette.calculated = !!secondaryColor;
14105
+ }
14106
+
14107
+ function getTwoToneColors() {
14108
+ return _objectSpread2$1({}, twoToneColorPalette);
14109
+ }
14110
+
14111
+ var IconBase = function IconBase(props) {
14112
+ var icon = props.icon,
14113
+ className = props.className,
14114
+ onClick = props.onClick,
14115
+ style = props.style,
14116
+ primaryColor = props.primaryColor,
14117
+ secondaryColor = props.secondaryColor,
14118
+ restProps = _objectWithoutProperties$1(props, _excluded);
14119
+
14120
+ var colors = twoToneColorPalette;
14121
+
14122
+ if (primaryColor) {
14123
+ colors = {
14124
+ primaryColor: primaryColor,
14125
+ secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
14126
+ };
14127
+ }
14128
+
14129
+ useInsertStyles();
14130
+ warning$1(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
14131
+
14132
+ if (!isIconDefinition(icon)) {
14133
+ return null;
14134
+ }
14135
+
14136
+ var target = icon;
14137
+
14138
+ if (target && typeof target.icon === 'function') {
14139
+ target = _objectSpread2$1(_objectSpread2$1({}, target), {}, {
14140
+ icon: target.icon(colors.primaryColor, colors.secondaryColor)
14141
+ });
14142
+ }
14143
+
14144
+ return generate$1(target.icon, "svg-".concat(target.name), _objectSpread2$1({
14145
+ className: className,
14146
+ onClick: onClick,
14147
+ style: style,
14148
+ 'data-icon': target.name,
14149
+ width: '1em',
14150
+ height: '1em',
14151
+ fill: 'currentColor',
14152
+ 'aria-hidden': 'true'
14153
+ }, restProps));
14154
+ };
14155
+
14156
+ IconBase.displayName = 'IconReact';
14157
+ IconBase.getTwoToneColors = getTwoToneColors;
14158
+ IconBase.setTwoToneColors = setTwoToneColors;
14159
+
14160
+ function setTwoToneColor(twoToneColor) {
14161
+ var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
14162
+ _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2),
14163
+ primaryColor = _normalizeTwoToneColo2[0],
14164
+ secondaryColor = _normalizeTwoToneColo2[1];
14165
+
14166
+ return IconBase.setTwoToneColors({
14167
+ primaryColor: primaryColor,
14168
+ secondaryColor: secondaryColor
14169
+ });
14170
+ }
14171
+ function getTwoToneColor() {
14172
+ var colors = IconBase.getTwoToneColors();
14173
+
14174
+ if (!colors.calculated) {
14175
+ return colors.primaryColor;
14176
+ }
14177
+
14178
+ return [colors.primaryColor, colors.secondaryColor];
14179
+ }
14180
+
14181
+ var _excluded$1 = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
14182
+ // should move it to antd main repo?
14183
+
14184
+ setTwoToneColor('#1890ff');
13433
14185
  var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
14186
+ var _classNames;
14187
+
14188
+ var className = props.className,
14189
+ icon = props.icon,
14190
+ spin = props.spin,
14191
+ rotate = props.rotate,
14192
+ tabIndex = props.tabIndex,
14193
+ onClick = props.onClick,
14194
+ twoToneColor = props.twoToneColor,
14195
+ restProps = _objectWithoutProperties$1(props, _excluded$1);
14196
+
14197
+ var _React$useContext = useContext(IconContext),
14198
+ _React$useContext$pre = _React$useContext.prefixCls,
14199
+ prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre;
14200
+
14201
+ var classString = classnames(prefixCls, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), _defineProperty$1(_classNames, "".concat(prefixCls, "-spin"), !!spin || icon.name === 'loading'), _classNames), className);
14202
+ var iconTabIndex = tabIndex;
14203
+
14204
+ if (iconTabIndex === undefined && onClick) {
14205
+ iconTabIndex = -1;
14206
+ }
14207
+
14208
+ var svgStyle = rotate ? {
14209
+ msTransform: "rotate(".concat(rotate, "deg)"),
14210
+ transform: "rotate(".concat(rotate, "deg)")
14211
+ } : undefined;
14212
+
14213
+ var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
14214
+ _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2),
14215
+ primaryColor = _normalizeTwoToneColo2[0],
14216
+ secondaryColor = _normalizeTwoToneColo2[1];
14217
+
14218
+ return /*#__PURE__*/createElement("span", _objectSpread2$1(_objectSpread2$1({
14219
+ role: "img",
14220
+ "aria-label": icon.name
14221
+ }, restProps), {}, {
14222
+ ref: ref,
14223
+ tabIndex: iconTabIndex,
14224
+ onClick: onClick,
14225
+ className: classString
14226
+ }), /*#__PURE__*/createElement(IconBase, {
14227
+ icon: icon,
14228
+ primaryColor: primaryColor,
14229
+ secondaryColor: secondaryColor,
14230
+ style: svgStyle
14231
+ }));
14232
+ });
14233
+ Icon.displayName = 'AntdIcon';
14234
+ Icon.getTwoToneColor = getTwoToneColor;
14235
+ Icon.setTwoToneColor = setTwoToneColor;
14236
+
14237
+ // This icon file is generated automatically.
14238
+ var CheckCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
14239
+
14240
+ var CheckCircleFilled$1 = function CheckCircleFilled$1(props, ref) {
14241
+ return /*#__PURE__*/createElement(Icon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
14242
+ ref: ref,
14243
+ icon: CheckCircleFilled
14244
+ }));
14245
+ };
14246
+
14247
+ CheckCircleFilled$1.displayName = 'CheckCircleFilled';
14248
+ var CheckCircleFilled$2 = /*#__PURE__*/forwardRef(CheckCircleFilled$1);
14249
+
14250
+ // This icon file is generated automatically.
14251
+ var CloseOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" } }] }, "name": "close", "theme": "outlined" };
14252
+
14253
+ var CloseOutlined$1 = function CloseOutlined$1(props, ref) {
14254
+ return /*#__PURE__*/createElement(Icon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
14255
+ ref: ref,
14256
+ icon: CloseOutlined
14257
+ }));
14258
+ };
14259
+
14260
+ CloseOutlined$1.displayName = 'CloseOutlined';
14261
+ var CloseOutlined$2 = /*#__PURE__*/forwardRef(CloseOutlined$1);
14262
+
14263
+ // This icon file is generated automatically.
14264
+ var DownOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, "name": "down", "theme": "outlined" };
14265
+
14266
+ var DownOutlined$1 = function DownOutlined$1(props, ref) {
14267
+ return /*#__PURE__*/createElement(Icon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
14268
+ ref: ref,
14269
+ icon: DownOutlined
14270
+ }));
14271
+ };
14272
+
14273
+ DownOutlined$1.displayName = 'DownOutlined';
14274
+ var DownOutlined$2 = /*#__PURE__*/forwardRef(DownOutlined$1);
14275
+
14276
+ var _excluded$2 = ["className", "component", "viewBox", "spin", "rotate", "tabIndex", "onClick", "children"];
14277
+ var Icon$1 = /*#__PURE__*/forwardRef(function (props, ref) {
13434
14278
  var className = props.className,
13435
14279
  Component = props.component,
13436
14280
  viewBox = props.viewBox,
@@ -13439,7 +14283,7 @@ var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
13439
14283
  tabIndex = props.tabIndex,
13440
14284
  onClick = props.onClick,
13441
14285
  children = props.children,
13442
- restProps = _objectWithoutProperties(props, _excluded);
14286
+ restProps = _objectWithoutProperties$1(props, _excluded$2);
13443
14287
 
13444
14288
  warning$1(Boolean(Component || children), 'Should have `component` prop or `children`.');
13445
14289
  useInsertStyles();
@@ -13496,7 +14340,7 @@ var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
13496
14340
  className: classString
13497
14341
  }), renderInnerNode());
13498
14342
  });
13499
- Icon.displayName = 'AntdIcon';
14343
+ Icon$1.displayName = 'AntdIcon';
13500
14344
 
13501
14345
  var _path$3;
13502
14346
 
@@ -13823,7 +14667,7 @@ function Drag$1(props) {
13823
14667
  },
13824
14668
  className: "kts-invoice-operate-goods-list-itemName-drag",
13825
14669
  onMouseOver: controller.saveEditGood
13826
- }, /*#__PURE__*/React.createElement(Icon, {
14670
+ }, /*#__PURE__*/React.createElement(Icon$1, {
13827
14671
  component: SvgI001
13828
14672
  }));
13829
14673
  }, [onMouseDown, controller]);
@@ -18025,6 +18869,7 @@ var formatCompanyName = function formatCompanyName(e) {
18025
18869
  var Stakeholder$1 = decorator(Form.create())(function (props) {
18026
18870
  var form = props.form,
18027
18871
  isShowImportButton = props.isShowImportButton,
18872
+ allowEditFlag = props.allowEditFlag,
18028
18873
  onClickImportButton = props.onClickImportButton,
18029
18874
  _props$isVatNormal = props.isVatNormal,
18030
18875
  isVatNormal = _props$isVatNormal === void 0 ? false : _props$isVatNormal;
@@ -18076,6 +18921,9 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
18076
18921
  var isReadOnly = React.useCallback(function (field) {
18077
18922
  return readOnly || disableds.indexOf(field) >= 0;
18078
18923
  }, [disableds, readOnly]);
18924
+ var isReadOnly2 = React.useCallback(function (field) {
18925
+ return model === 'readOnly' || model === 'prefab' && !allowEditFlag;
18926
+ }, [allowEditFlag, model]);
18079
18927
  var getRules = React.useCallback(function (field, defaultRules) {
18080
18928
  if (isReadOnly(field)) return [];
18081
18929
  return rulesMap[field] || defaultRules;
@@ -18091,7 +18939,10 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
18091
18939
  })
18092
18940
  }, /*#__PURE__*/React.createElement("div", null, '购买方信息'.split('').map(function (e) {
18093
18941
  return /*#__PURE__*/React.createElement("span", null, e);
18094
- }), !readOnly && /*#__PURE__*/React.createElement(Icon, {
18942
+ }),
18943
+ /*#__PURE__*/
18944
+ // !readOnly &&
18945
+ React.createElement(Icon$1, {
18095
18946
  className: "digtal-stakeholder-expand-button",
18096
18947
  component: isExpand ? SvgArrowUp : SvgArrowDown,
18097
18948
  onClick: onExpand
@@ -18128,7 +18979,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
18128
18979
  width: 20,
18129
18980
  height: '100%'
18130
18981
  },
18131
- icon: /*#__PURE__*/React.createElement(Icon, {
18982
+ icon: /*#__PURE__*/React.createElement(Icon$1, {
18132
18983
  component: SvgPlus
18133
18984
  }),
18134
18985
  onClick: function onClick() {
@@ -18194,7 +19045,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
18194
19045
  valuePropName: 'checked'
18195
19046
  })( /*#__PURE__*/React.createElement(Checkbox$1, {
18196
19047
  onChange: props === null || props === void 0 ? void 0 : props.invoiceMarkCallback,
18197
- disabled: isReadOnly('buyerAddressPhoneFlag'),
19048
+ disabled: isReadOnly2('buyerAddressPhoneFlag'),
18198
19049
  style: {
18199
19050
  whiteSpace: 'nowrap'
18200
19051
  }
@@ -18237,13 +19088,16 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
18237
19088
  valuePropName: 'checked'
18238
19089
  })( /*#__PURE__*/React.createElement(Checkbox$1, {
18239
19090
  onChange: props === null || props === void 0 ? void 0 : props.invoiceMarkCallback,
18240
- disabled: isReadOnly('buyerBankAccountFlag'),
19091
+ disabled: isReadOnly2('buyerBankAccountFlag'),
18241
19092
  style: {
18242
19093
  whiteSpace: 'nowrap'
18243
19094
  }
18244
19095
  }, "\u662F\u5426\u5C55\u793A"))))))), /*#__PURE__*/React.createElement("div", null, '销售方信息'.split('').map(function (e) {
18245
19096
  return /*#__PURE__*/React.createElement("span", null, e);
18246
- }), !readOnly && /*#__PURE__*/React.createElement(Icon, {
19097
+ }),
19098
+ /*#__PURE__*/
19099
+ // !readOnly &&
19100
+ React.createElement(Icon$1, {
18247
19101
  className: "digtal-stakeholder-expand-button",
18248
19102
  component: isExpand ? SvgArrowUp : SvgArrowDown,
18249
19103
  onClick: onExpand
@@ -18332,7 +19186,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
18332
19186
  valuePropName: 'checked'
18333
19187
  })( /*#__PURE__*/React.createElement(Checkbox$1, {
18334
19188
  onChange: props === null || props === void 0 ? void 0 : props.invoiceMarkCallback,
18335
- disabled: isReadOnly('sellerAddressPhoneFlag'),
19189
+ disabled: isReadOnly2('sellerAddressPhoneFlag'),
18336
19190
  style: {
18337
19191
  whiteSpace: 'nowrap'
18338
19192
  }
@@ -18375,7 +19229,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
18375
19229
  valuePropName: 'checked'
18376
19230
  })( /*#__PURE__*/React.createElement(Checkbox$1, {
18377
19231
  onChange: props === null || props === void 0 ? void 0 : props.invoiceMarkCallback,
18378
- disabled: isReadOnly('sellerBankAccountFlag'),
19232
+ disabled: isReadOnly2('sellerBankAccountFlag'),
18379
19233
  style: {
18380
19234
  whiteSpace: 'nowrap'
18381
19235
  }
@@ -19043,7 +19897,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
19043
19897
  })
19044
19898
  }, /*#__PURE__*/React.createElement("div", null, '销售方信息'.split('').map(function (e) {
19045
19899
  return /*#__PURE__*/React.createElement("span", null, e);
19046
- }), !readOnly && /*#__PURE__*/React.createElement(Icon, {
19900
+ }), !readOnly && /*#__PURE__*/React.createElement(Icon$1, {
19047
19901
  className: "digtal-stakeholder-expand-button",
19048
19902
  component: isExpand ? SvgArrowUp$1 : SvgArrowDown$1,
19049
19903
  onClick: onExpand
@@ -19081,7 +19935,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
19081
19935
  width: 20,
19082
19936
  height: '100%'
19083
19937
  },
19084
- icon: /*#__PURE__*/React.createElement(Icon, {
19938
+ icon: /*#__PURE__*/React.createElement(Icon$1, {
19085
19939
  component: SvgPlus$1
19086
19940
  }),
19087
19941
  onClick: function onClick() {
@@ -19197,7 +20051,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
19197
20051
  }
19198
20052
  }, "\u662F\u5426\u5C55\u793A"))))))), /*#__PURE__*/React.createElement("div", null, '购买方信息'.split('').map(function (e) {
19199
20053
  return /*#__PURE__*/React.createElement("span", null, e);
19200
- }), !readOnly && /*#__PURE__*/React.createElement(Icon, {
20054
+ }), !readOnly && /*#__PURE__*/React.createElement(Icon$1, {
19201
20055
  className: "digtal-stakeholder-expand-button",
19202
20056
  component: isExpand ? SvgArrowUp$1 : SvgArrowDown$1,
19203
20057
  onClick: onExpand
@@ -19237,7 +20091,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
19237
20091
  width: 20,
19238
20092
  height: '100%'
19239
20093
  },
19240
- icon: /*#__PURE__*/React.createElement(Icon, {
20094
+ icon: /*#__PURE__*/React.createElement(Icon$1, {
19241
20095
  component: SvgPlus$1
19242
20096
  }),
19243
20097
  onClick: function onClick() {
@@ -20869,7 +21723,7 @@ var Statistics$1 = (function () {
20869
21723
  style: {
20870
21724
  paddingLeft: 30
20871
21725
  }
20872
- }, /*#__PURE__*/React.createElement(Icon, {
21726
+ }, /*#__PURE__*/React.createElement(Icon$1, {
20873
21727
  style: {
20874
21728
  fontSize: 16
20875
21729
  },
@@ -22628,7 +23482,7 @@ function Search$1() {
22628
23482
  value: value,
22629
23483
  className: "kts-invoice-operate-goods-list-search",
22630
23484
  placeholder: "\u8BF7\u60A8\u8F93\u5165\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(".concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
22631
- prefix: /*#__PURE__*/React.createElement(Icon$1, {
23485
+ prefix: /*#__PURE__*/React.createElement(Icon$2, {
22632
23486
  component: SvgMagnifier$1,
22633
23487
  style: {
22634
23488
  color: "#b8b8b8"
@@ -23255,7 +24109,7 @@ function Drag$2(props) {
23255
24109
  },
23256
24110
  className: "kts-invoice-operate-goods-list-itemName-drag",
23257
24111
  onMouseOver: controller.saveEditGood
23258
- }, /*#__PURE__*/React.createElement(Icon, {
24112
+ }, /*#__PURE__*/React.createElement(Icon$1, {
23259
24113
  component: SvgI001$1
23260
24114
  }));
23261
24115
  }, [onMouseDown, controller]);
@@ -27239,7 +28093,7 @@ var Architecture = decorator(Form.create())(function (props) {
27239
28093
  width: "auto"
27240
28094
  },
27241
28095
  type: "link",
27242
- icon: /*#__PURE__*/React.createElement(Icon, {
28096
+ icon: /*#__PURE__*/React.createElement(Icon$1, {
27243
28097
  component: SvgPlus$3
27244
28098
  }),
27245
28099
  disabled: readOnly || crossCitiesSign !== 'Y',
@@ -30525,6 +31379,292 @@ var getItemCode = function getItemCode(record, editGood) {
30525
31379
  return record.productCode;
30526
31380
  };
30527
31381
 
31382
+ var Dragger = Upload.Dragger;
31383
+ var Text$8 = Typography$1.Text;
31384
+ var ImportPassengerDrawer = (function () {
31385
+ var controller = Invoice.useInvoiceController();
31386
+ var visible = controller.useMemo(function (s) {
31387
+ return s.passengerListState.isVisibleDrawer;
31388
+ }, []);
31389
+ var dataSource = controller.useMemo(function (s) {
31390
+ return s.passengerListState.dataSource;
31391
+ }, []);
31392
+ var onClose = React.useCallback(function () {
31393
+ controller.pipeline( /*#__PURE__*/function () {
31394
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
31395
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
31396
+ while (1) {
31397
+ switch (_context.prev = _context.next) {
31398
+ case 0:
31399
+ s.passengerListState.isVisibleDrawer = false;
31400
+
31401
+ case 1:
31402
+ case "end":
31403
+ return _context.stop();
31404
+ }
31405
+ }
31406
+ }, _callee);
31407
+ }));
31408
+
31409
+ return function (_x) {
31410
+ return _ref.apply(this, arguments);
31411
+ };
31412
+ }())();
31413
+ }, [controller]);
31414
+ var onConfirm = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
31415
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
31416
+ while (1) {
31417
+ switch (_context3.prev = _context3.next) {
31418
+ case 0:
31419
+ if (!dataSource.length) {
31420
+ _context3.next = 5;
31421
+ break;
31422
+ }
31423
+
31424
+ _context3.next = 3;
31425
+ return controller.pipeline( /*#__PURE__*/function () {
31426
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
31427
+ var data;
31428
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
31429
+ while (1) {
31430
+ switch (_context2.prev = _context2.next) {
31431
+ case 0:
31432
+ data = dataSource.map(function (item) {
31433
+ return _objectSpread2({
31434
+ $index: idGenerator()
31435
+ }, item);
31436
+ });
31437
+ s.passengerListState.goodsList = [].concat(_toConsumableArray(s.passengerListState.goodsList), _toConsumableArray(data));
31438
+ s.passengerListState.dataSource = [];
31439
+
31440
+ case 3:
31441
+ case "end":
31442
+ return _context2.stop();
31443
+ }
31444
+ }
31445
+ }, _callee2);
31446
+ }));
31447
+
31448
+ return function (_x2) {
31449
+ return _ref3.apply(this, arguments);
31450
+ };
31451
+ }())();
31452
+
31453
+ case 3:
31454
+ _context3.next = 5;
31455
+ return controller.wait();
31456
+
31457
+ case 5:
31458
+ onClose();
31459
+
31460
+ case 6:
31461
+ case "end":
31462
+ return _context3.stop();
31463
+ }
31464
+ }
31465
+ }, _callee3);
31466
+ })), [controller, dataSource]);
31467
+ return /*#__PURE__*/React.createElement(Drawer$2, {
31468
+ title: "\u6279\u91CF\u5BFC\u5165",
31469
+ placement: "right",
31470
+ // closable={false}
31471
+ destroyOnClose: true,
31472
+ width: 983,
31473
+ onClose: onClose,
31474
+ visible: visible,
31475
+ // 使用 footer 属性放置底部按钮
31476
+ footer: /*#__PURE__*/React.createElement("div", {
31477
+ style: {
31478
+ textAlign: 'right'
31479
+ }
31480
+ }, /*#__PURE__*/React.createElement(Space$1, null, /*#__PURE__*/React.createElement(Button$2, {
31481
+ onClick: function onClick() {
31482
+ return onClose();
31483
+ }
31484
+ }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button$2, {
31485
+ type: "primary",
31486
+ onClick: onConfirm
31487
+ }, "\u786E\u5B9A")))
31488
+ }, /*#__PURE__*/React.createElement(DrawerBody$3, null));
31489
+ });
31490
+
31491
+ var DrawerBody$3 = function DrawerBody() {
31492
+ var controller = Invoice.useInvoiceController();
31493
+
31494
+ var _React$useState = React.useState(''),
31495
+ _React$useState2 = _slicedToArray(_React$useState, 2),
31496
+ fileName = _React$useState2[0],
31497
+ setFileName = _React$useState2[1];
31498
+
31499
+ var _React$useState3 = React.useState('idle'),
31500
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
31501
+ status = _React$useState4[0],
31502
+ setStatus = _React$useState4[1];
31503
+
31504
+ var _React$useState5 = React.useState(0),
31505
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
31506
+ percent = _React$useState6[0],
31507
+ setPercent = _React$useState6[1];
31508
+
31509
+ var _React$useState7 = React.useState([]),
31510
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
31511
+ fileData = _React$useState8[0],
31512
+ setFileData = _React$useState8[1];
31513
+
31514
+ var _React$useState9 = React.useState(false),
31515
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
31516
+ success = _React$useState10[0],
31517
+ setSuccess = _React$useState10[1];
31518
+
31519
+ var columns = controller.useMemo(function (s) {
31520
+ return s.passengerListState.columns;
31521
+ }, []);
31522
+ var dataSource = controller.useMemo(function (s) {
31523
+ return s.passengerListState.dataSource;
31524
+ }, []);
31525
+ var pagination = controller.useMemo(function (s) {
31526
+ return s.passengerListState.pagination;
31527
+ }, []);
31528
+ var handleDownloadTemplate = React.useCallback(function () {
31529
+ if (controller.downloadPassengerTpt) {
31530
+ controller.downloadPassengerTpt();
31531
+ }
31532
+ }, [controller]); // 1. 前置校验:限制文件类型为 .xls, .xlsx
31533
+
31534
+ var beforeUpload = React.useCallback(function (file) {
31535
+ var isExcel = file.type === 'application/vnd.ms-excel' || file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || /\.(xls|xlsx)$/.test(file.name); // 兜底判断文件名后缀
31536
+
31537
+ if (!isExcel) {
31538
+ message$2.error('只能上传 .xls 或 .xlsx 格式的Excel文件!');
31539
+ return Upload.LIST_IGNORE; // 阻止上传
31540
+ }
31541
+
31542
+ setFileName(file.name);
31543
+ setStatus('uploading');
31544
+ setPercent(0);
31545
+ return true;
31546
+ }, []); // 2. 正确类型定义的 customRequest
31547
+ // 直接使用 UploadProps['customRequest'] 可以完美推导出 options 内所有的类型!
31548
+
31549
+ var customRequest = /*#__PURE__*/function () {
31550
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(options) {
31551
+ var file, onSuccess, onError, onProgress, res;
31552
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
31553
+ while (1) {
31554
+ switch (_context4.prev = _context4.next) {
31555
+ case 0:
31556
+ file = options.file, onSuccess = options.onSuccess, onError = options.onError, onProgress = options.onProgress;
31557
+
31558
+ if (!controller.uploadPassenger) {
31559
+ _context4.next = 6;
31560
+ break;
31561
+ }
31562
+
31563
+ _context4.next = 4;
31564
+ return controller.uploadPassenger(file);
31565
+
31566
+ case 4:
31567
+ res = _context4.sent;
31568
+
31569
+ if (res) {
31570
+ setStatus('done');
31571
+ setPercent(100);
31572
+ }
31573
+
31574
+ case 6:
31575
+ case "end":
31576
+ return _context4.stop();
31577
+ }
31578
+ }
31579
+ }, _callee4);
31580
+ }));
31581
+
31582
+ return function customRequest(_x3) {
31583
+ return _ref4.apply(this, arguments);
31584
+ };
31585
+ }(); // 3. 处理文件选择状态(更新左侧 Input 显示的文件名)
31586
+
31587
+ React.useEffect(function () {
31588
+ controller.getBuyerList && controller.getBuyerList({
31589
+ pagination: {
31590
+ current: 1
31591
+ }
31592
+ });
31593
+ }, [controller]);
31594
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Alert, {
31595
+ type: "info",
31596
+ showIcon: true,
31597
+ message: /*#__PURE__*/React.createElement("span", null, "\u8BF7\u5148\u4E0B\u8F7D\u6A21\u677F", /*#__PURE__*/React.createElement("a", {
31598
+ href: "#",
31599
+ style: {
31600
+ margin: '0 4px'
31601
+ },
31602
+ onClick: handleDownloadTemplate
31603
+ }, "\u300A\u65C5\u5BA2\u8FD0\u8F93\u670D\u52A1\u7279\u5B9A\u4FE1\u606F-\u6279\u91CF\u5BFC\u5165\u6A21\u677F\u300B"), "\uFF0C\u6309\u7167\u6A21\u677F\u586B\u5199\u540E\u4E0A\u4F20\u3002")
31604
+ }), /*#__PURE__*/React.createElement("div", {
31605
+ style: {
31606
+ display: 'flex',
31607
+ alignItems: 'center',
31608
+ gap: 8,
31609
+ marginBottom: 20,
31610
+ marginTop: 20
31611
+ }
31612
+ }, /*#__PURE__*/React.createElement(Input$2, {
31613
+ placeholder: "\u9009\u62E9\u6587\u4EF6",
31614
+ value: fileName,
31615
+ readOnly: true,
31616
+ style: {
31617
+ width: 400,
31618
+ height: 32
31619
+ },
31620
+ suffix: status === 'uploading' ? /*#__PURE__*/React.createElement("div", {
31621
+ style: {
31622
+ display: 'flex',
31623
+ alignItems: 'center',
31624
+ gap: 4
31625
+ }
31626
+ }, /*#__PURE__*/React.createElement("span", {
31627
+ style: {
31628
+ fontSize: 12,
31629
+ color: '#1890ff'
31630
+ }
31631
+ }, percent, "%")) : status === 'done' ? /*#__PURE__*/React.createElement(CheckCircleFilled$2, {
31632
+ style: {
31633
+ color: '#52c41a',
31634
+ fontSize: 16
31635
+ }
31636
+ }) : null
31637
+ }), /*#__PURE__*/React.createElement(Upload, {
31638
+ accept: ".xls,.xlsx",
31639
+ showUploadList: false,
31640
+ beforeUpload: beforeUpload,
31641
+ customRequest: customRequest
31642
+ }, /*#__PURE__*/React.createElement(Button$2, {
31643
+ style: status === 'uploading' ? {
31644
+ color: '#1890ff',
31645
+ borderColor: '#1890ff'
31646
+ } : undefined
31647
+ }, fileName ? '重新选择' : "选择文件"))), success && /*#__PURE__*/React.createElement("div", {
31648
+ style: {
31649
+ marginBottom: 20,
31650
+ marginTop: 20
31651
+ }
31652
+ }, /*#__PURE__*/React.createElement(Alert, {
31653
+ type: "success",
31654
+ showIcon: true,
31655
+ message: /*#__PURE__*/React.createElement("span", null, "\u6587\u4EF6\u5BFC\u5165\u6210\u529F\uFF0C\u5904\u7406\u65C5\u5BA2\u8FD0\u8F93\u670D\u52A1\u7279\u5B9A\u4FE1\u606F\u8BB0\u5F55", dataSource.length, "\u6761\uFF0C\u5904\u7406\u6210\u529F", dataSource.length, "\u6761\u3002")
31656
+ })), /*#__PURE__*/React.createElement(Table$2, {
31657
+ bordered: true,
31658
+ size: "small",
31659
+ columns: columns,
31660
+ dataSource: dataSource,
31661
+ locale: {
31662
+ emptyText: '暂无数据'
31663
+ },
31664
+ pagination: false
31665
+ }));
31666
+ };
31667
+
30528
31668
  var css_248z$A = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
30529
31669
  styleInject(css_248z$A);
30530
31670
 
@@ -30665,12 +31805,12 @@ var EndowCodeDrawer = (function () {
30665
31805
  width: 383,
30666
31806
  onClose: onClose,
30667
31807
  visible: visible
30668
- }, defaultValue && /*#__PURE__*/React.createElement(DrawerBody$3, {
31808
+ }, defaultValue && /*#__PURE__*/React.createElement(DrawerBody$4, {
30669
31809
  defaultValue: defaultValue
30670
31810
  }));
30671
31811
  });
30672
31812
 
30673
- var DrawerBody$3 = function DrawerBody(props) {
31813
+ var DrawerBody$4 = function DrawerBody(props) {
30674
31814
  var _defaultValue$taxRate, _defaultValue$favoure;
30675
31815
 
30676
31816
  var controller = Invoice.useInvoiceController();
@@ -31967,6 +33107,2321 @@ var MeiTanModal = (function () {
31967
33107
  }, "\u5E02\u573A\u7164"))))))));
31968
33108
  });
31969
33109
 
33110
+ var css_248z$C = ".kts-invoice-operate-goods-table-virtual .ktsAntX-table-body {\n height: 280px;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table.ktsAntX-table-bordered > .ktsAntX-table-container > .ktsAntX-table-header > table > thead > tr > th {\n padding: 0 10px;\n height: 32px;\n background: #f4f4f4;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table.ktsAntX-table-bordered > .ktsAntX-table-container > .ktsAntX-table-body > table > tbody > tr > td {\n padding: 0;\n height: 32px;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-body {\n position: relative;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-body > table {\n position: absolute;\n left: 0;\n top: 0;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody {\n position: relative;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-checkbox-wrapper .ktsAntX-checkbox-inner {\n width: 16px;\n height: 16px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n top: 1px;\n}\n";
33111
+ styleInject(css_248z$C);
33112
+
33113
+ function TableVirtual$4 (props) {
33114
+ var _props$dataSource2;
33115
+
33116
+ var _React$useState = React.useState(null),
33117
+ _React$useState2 = _slicedToArray(_React$useState, 2),
33118
+ self = _React$useState2[0],
33119
+ setSelf = _React$useState2[1];
33120
+
33121
+ var tableBody = React.useMemo(function () {
33122
+ if (!self) return;
33123
+ return self.querySelector('.ktsAntX-table-body');
33124
+ }, [self]);
33125
+ /** 显示指针 */
33126
+
33127
+ var _React$useState3 = React.useState(0),
33128
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
33129
+ pointer = _React$useState4[0],
33130
+ setPointer = _React$useState4[1];
33131
+ /** 行高 */
33132
+
33133
+
33134
+ var rowHeight = React.useMemo(function () {
33135
+ if (!self) return 50;
33136
+ var td = self.querySelector('.ktsAntX-table-tbody .ktsAntX-table-row');
33137
+ if (!td) return 50;
33138
+ return td.clientHeight;
33139
+ }, [self, props.dataSource]);
33140
+ /** 间隔容器 */
33141
+
33142
+ var placeholder = React.useMemo(function () {
33143
+ if (!self || !tableBody) return;
33144
+ var placeholder = tableBody.querySelector('.table-virtual-placeholder');
33145
+
33146
+ if (!placeholder) {
33147
+ placeholder = document.createElement('div');
33148
+ placeholder.className = 'table-virtual-placeholder';
33149
+ tableBody.appendChild(placeholder);
33150
+ }
33151
+
33152
+ return placeholder;
33153
+ }, [self, tableBody]); // 设置占位dom的搞
33154
+
33155
+ var placeholderHeight = React.useMemo(function () {
33156
+ if (!self || !rowHeight || !props.dataSource || !placeholder) return;
33157
+ var placeholderHeight = rowHeight * props.dataSource.length;
33158
+ placeholder.style.height = "".concat(placeholderHeight, "px");
33159
+ return placeholderHeight;
33160
+ }, [self, rowHeight, props.dataSource, placeholder]);
33161
+ /** 可以容纳的行数 */
33162
+
33163
+ var rowSize = React.useMemo(function () {
33164
+ if (!tableBody || !rowHeight) return 0;
33165
+ return Math.ceil(tableBody.clientHeight / rowHeight);
33166
+ }, [tableBody, rowHeight, placeholderHeight]); // 计算渲染的行
33167
+
33168
+ var dataSource = React.useMemo(function () {
33169
+ var _props$dataSource;
33170
+
33171
+ if (!props.dataSource) return [];
33172
+ if (props.dataSource.length < 10) return props.dataSource;
33173
+ if (!rowSize) return [props.dataSource[0]];
33174
+ return (_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.slice(pointer, pointer + 2 * rowSize);
33175
+ }, [props.dataSource, pointer, rowSize]); // 监听滚动
33176
+
33177
+ React.useEffect(function () {
33178
+ if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody || props.dataSource.length < 10) return;
33179
+
33180
+ var onScroll = function onScroll() {
33181
+ if (!props.dataSource || !tableBody) return;
33182
+ setPointer(Math.floor((props.dataSource.length - rowSize) * (tableBody.scrollTop / (placeholder.clientHeight - tableBody.clientHeight))));
33183
+ };
33184
+
33185
+ onScroll();
33186
+ tableBody.addEventListener('scroll', onScroll);
33187
+ return function () {
33188
+ tableBody.removeEventListener('scroll', onScroll);
33189
+ };
33190
+ }, [self, placeholder, props.dataSource, rowHeight, rowSize]); // 移动列表
33191
+
33192
+ React.useEffect(function () {
33193
+ if (!self) return;
33194
+ var table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table');
33195
+ if (!table) return;
33196
+ table.style.top = "".concat(pointer * rowHeight, "px");
33197
+ }, [pointer, self, rowHeight]);
33198
+ React.useEffect(function () {
33199
+ if (!self) return;
33200
+ var cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
33201
+ if (!cont) return;
33202
+ cont.scrollTop = 0;
33203
+ }, [(_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.length]);
33204
+ return /*#__PURE__*/React.createElement("span", {
33205
+ className: "kts-invoice-operate-goods-table-virtual",
33206
+ ref: function ref(e) {
33207
+ setSelf(e);
33208
+ }
33209
+ }, /*#__PURE__*/React.createElement(TableManual, _objectSpread2(_objectSpread2({}, props), {}, {
33210
+ dataSource: dataSource,
33211
+ // 新版本Table会有输入框无法连续输入的问题,先兼容老版本
33212
+ tableComponent: Table
33213
+ })));
33214
+ }
33215
+
33216
+ var AddRowButton$4 = (function () {
33217
+ var controller = Invoice.useInvoiceController();
33218
+ var model = controller.useMemo(function (s) {
33219
+ return s.model;
33220
+ }, []);
33221
+ var rootElement = controller.useMemo(function (s) {
33222
+ return s.rootElement;
33223
+ }, []);
33224
+ /** 产品数据量 */
33225
+
33226
+ var goodsNum = controller.useMemo(function (s) {
33227
+ return s.passengerListState.goodsList.length;
33228
+ }, []);
33229
+ /** 搜索条件 */
33230
+
33231
+ var isAddRow = controller.useMemo(function (s) {
33232
+ return s.passengerListState.isAddRow;
33233
+ }, []);
33234
+ /** 产品最大数 */
33235
+
33236
+ var goodMax = controller.useMemo(function (s) {
33237
+ return s.passengerListState.goodMax;
33238
+ }, []);
33239
+ /** 按钮是否禁用 */
33240
+
33241
+ var disabled = React.useMemo(function () {
33242
+ return typeof goodMax === 'number' ? goodsNum >= goodMax : false;
33243
+ }, [goodMax, goodsNum]);
33244
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
33245
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
33246
+ while (1) {
33247
+ switch (_context.prev = _context.next) {
33248
+ case 0:
33249
+ _context.next = 2;
33250
+ return addGood$5(controller);
33251
+
33252
+ case 2:
33253
+ _context.next = 4;
33254
+ return rollBottom$4(controller, rootElement);
33255
+
33256
+ case 4:
33257
+ case "end":
33258
+ return _context.stop();
33259
+ }
33260
+ }
33261
+ }, _callee);
33262
+ })), [controller, rootElement]);
33263
+ if (isAddRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
33264
+ if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
33265
+ if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
33266
+ return /*#__PURE__*/React.createElement(Button$1, {
33267
+ size: 'small',
33268
+ type: 'primary',
33269
+ onClick: onClick,
33270
+ disabled: disabled
33271
+ }, "\u589E\u884C");
33272
+ });
33273
+ /** 添加一个空货物 */
33274
+
33275
+ function addGood$5(_x) {
33276
+ return _addGood$4.apply(this, arguments);
33277
+ }
33278
+ /** 货物列表,滚动到底部 */
33279
+
33280
+
33281
+ function _addGood$4() {
33282
+ _addGood$4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller) {
33283
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
33284
+ while (1) {
33285
+ switch (_context4.prev = _context4.next) {
33286
+ case 0:
33287
+ _context4.next = 2;
33288
+ return controller.saveEditPassenger();
33289
+
33290
+ case 2:
33291
+ _context4.next = 4;
33292
+ return controller.wait();
33293
+
33294
+ case 4:
33295
+ _context4.next = 6;
33296
+ return controller.run( /*#__PURE__*/function () {
33297
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
33298
+ var _controller$state$pas;
33299
+
33300
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
33301
+ while (1) {
33302
+ switch (_context3.prev = _context3.next) {
33303
+ case 0:
33304
+ if (!s.passengerListState.editGood) {
33305
+ _context3.next = 3;
33306
+ break;
33307
+ }
33308
+
33309
+ _context3.next = 3;
33310
+ return (_controller$state$pas = controller.state.passengerListState.form) === null || _controller$state$pas === void 0 ? void 0 : _controller$state$pas.validateFields( /*#__PURE__*/function () {
33311
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
33312
+ var firstError;
33313
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
33314
+ while (1) {
33315
+ switch (_context2.prev = _context2.next) {
33316
+ case 0:
33317
+ if (!err) {
33318
+ _context2.next = 4;
33319
+ break;
33320
+ }
33321
+
33322
+ firstError = Object.values(err)[0];
33323
+ message$1.error({
33324
+ content: firstError.errors[0].message,
33325
+ key: '你正在编辑一条数据'
33326
+ });
33327
+ return _context2.abrupt("return");
33328
+
33329
+ case 4:
33330
+ case "end":
33331
+ return _context2.stop();
33332
+ }
33333
+ }
33334
+ }, _callee2);
33335
+ }));
33336
+
33337
+ return function (_x5, _x6) {
33338
+ return _ref3.apply(this, arguments);
33339
+ };
33340
+ }());
33341
+
33342
+ case 3:
33343
+ _context3.next = 5;
33344
+ return controller.addPassenger({});
33345
+
33346
+ case 5:
33347
+ s.passengerListState.editGood = _context3.sent;
33348
+
33349
+ case 6:
33350
+ case "end":
33351
+ return _context3.stop();
33352
+ }
33353
+ }
33354
+ }, _callee3);
33355
+ }));
33356
+
33357
+ return function (_x4) {
33358
+ return _ref2.apply(this, arguments);
33359
+ };
33360
+ }());
33361
+
33362
+ case 6:
33363
+ case "end":
33364
+ return _context4.stop();
33365
+ }
33366
+ }
33367
+ }, _callee4);
33368
+ }));
33369
+ return _addGood$4.apply(this, arguments);
33370
+ }
33371
+
33372
+ function rollBottom$4(_x2, _x3) {
33373
+ return _rollBottom$4.apply(this, arguments);
33374
+ }
33375
+
33376
+ function _rollBottom$4() {
33377
+ _rollBottom$4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(controller, rootElement) {
33378
+ var cont;
33379
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
33380
+ while (1) {
33381
+ switch (_context5.prev = _context5.next) {
33382
+ case 0:
33383
+ _context5.next = 2;
33384
+ return controller.wait();
33385
+
33386
+ case 2:
33387
+ cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
33388
+
33389
+ if (cont) {
33390
+ _context5.next = 5;
33391
+ break;
33392
+ }
33393
+
33394
+ return _context5.abrupt("return");
33395
+
33396
+ case 5:
33397
+ cont.scrollTop = cont.scrollHeight;
33398
+
33399
+ case 6:
33400
+ case "end":
33401
+ return _context5.stop();
33402
+ }
33403
+ }
33404
+ }, _callee5);
33405
+ }));
33406
+ return _rollBottom$4.apply(this, arguments);
33407
+ }
33408
+
33409
+ var css_248z$D = ".kts-invoice-operate-goods-list-itemName-drag-container-u {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-u::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 9999;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-d {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-d::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n bottom: 0;\n z-index: 9999;\n}\n";
33410
+ styleInject(css_248z$D);
33411
+
33412
+ function TableRow$4(props) {
33413
+ var rowKey = props['data-row-key'];
33414
+ return /*#__PURE__*/React.createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
33415
+ className: classnames(props.className)
33416
+ }));
33417
+ }
33418
+
33419
+ var Text$9 = Typography.Text;
33420
+ var TitleText$4 = (function (props) {
33421
+ var rules = props.rules,
33422
+ children = props.children;
33423
+ var required = React.useMemo(function () {
33424
+ return (rules === null || rules === void 0 ? void 0 : rules.some(function (e) {
33425
+ return !!e.required;
33426
+ })) || props.required;
33427
+ }, [rules, props.required]);
33428
+ return /*#__PURE__*/React.createElement(React.Fragment, null, required ? /*#__PURE__*/React.createElement(Text$9, {
33429
+ type: "danger"
33430
+ }, "*") : /*#__PURE__*/React.createElement(React.Fragment, null), children);
33431
+ });
33432
+
33433
+ var _excluded$3 = ["options", "fieldNames", "placeholder", "onChange", "value", "className", "style", "onBlur"];
33434
+ var DROPDOWN_CLASS = 'custom-cascader-dropdown';
33435
+ var ARROW_CLASS = 'custom-cascader-arrow';
33436
+ var CLEAR_CLASS = 'custom-cascader-clear';
33437
+ var CustomCascader = /*#__PURE__*/forwardRef(function (_ref, ref) {
33438
+ var _ref$options = _ref.options,
33439
+ options = _ref$options === void 0 ? [] : _ref$options,
33440
+ _ref$fieldNames = _ref.fieldNames,
33441
+ fieldNames = _ref$fieldNames === void 0 ? {
33442
+ label: 'label',
33443
+ value: 'value',
33444
+ children: 'children'
33445
+ } : _ref$fieldNames,
33446
+ _ref$placeholder = _ref.placeholder,
33447
+ placeholder = _ref$placeholder === void 0 ? '请选择或输入地址' : _ref$placeholder,
33448
+ onChange = _ref.onChange,
33449
+ externalValue = _ref.value,
33450
+ _ref$className = _ref.className,
33451
+ className = _ref$className === void 0 ? '' : _ref$className,
33452
+ _ref$style = _ref.style,
33453
+ style = _ref$style === void 0 ? {} : _ref$style,
33454
+ onBlurProp = _ref.onBlur,
33455
+ restProps = _objectWithoutProperties(_ref, _excluded$3);
33456
+
33457
+ var _useState = useState(false),
33458
+ _useState2 = _slicedToArray(_useState, 2),
33459
+ open = _useState2[0],
33460
+ setOpen = _useState2[1];
33461
+
33462
+ var _useState3 = useState(''),
33463
+ _useState4 = _slicedToArray(_useState3, 2),
33464
+ inputText = _useState4[0],
33465
+ setInputText = _useState4[1];
33466
+
33467
+ var isComposingRef = useRef(false);
33468
+ var inputRef = useRef(null);
33469
+ var containerRef = useRef(null);
33470
+ var blurTimerRef = useRef(null);
33471
+ var isMenuClickRef = useRef(false);
33472
+ var preventOpenRef = useRef(false);
33473
+ var labelKey = fieldNames.label || 'label';
33474
+ var valueKey = fieldNames.value || 'value';
33475
+ var childrenKey = fieldNames.children || 'children'; // ---------- 工具函数 ----------
33476
+
33477
+ var getPathLabel = useCallback(function (val) {
33478
+ if (!val || val.length === 0) return '';
33479
+ var current = options;
33480
+ var labels = [];
33481
+
33482
+ var _iterator = _createForOfIteratorHelper(val),
33483
+ _step;
33484
+
33485
+ try {
33486
+ var _loop = function _loop() {
33487
+ var _found$labelKey;
33488
+
33489
+ var v = _step.value;
33490
+ var found = current.find(function (node) {
33491
+ return node[valueKey] === v;
33492
+ });
33493
+ if (!found) return "break";
33494
+ labels.push(((_found$labelKey = found[labelKey]) === null || _found$labelKey === void 0 ? void 0 : _found$labelKey.toString()) || '');
33495
+ current = found[childrenKey] || [];
33496
+ };
33497
+
33498
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
33499
+ var _ret = _loop();
33500
+
33501
+ if (_ret === "break") break;
33502
+ }
33503
+ } catch (err) {
33504
+ _iterator.e(err);
33505
+ } finally {
33506
+ _iterator.f();
33507
+ }
33508
+
33509
+ return labels.length === val.length ? labels.join('') : val[val.length - 1].toString();
33510
+ }, [options, valueKey, labelKey, childrenKey]);
33511
+ var findInTree = useCallback(function (searchVal, nodes) {
33512
+ if (!searchVal || !nodes) return false;
33513
+
33514
+ var _iterator2 = _createForOfIteratorHelper(nodes),
33515
+ _step2;
33516
+
33517
+ try {
33518
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
33519
+ var _node$labelKey;
33520
+
33521
+ var node = _step2.value;
33522
+ var nodeLabel = ((_node$labelKey = node[labelKey]) === null || _node$labelKey === void 0 ? void 0 : _node$labelKey.toString()) || '';
33523
+ if (nodeLabel === searchVal) return true;
33524
+ if (node[childrenKey] && findInTree(searchVal, node[childrenKey])) return true;
33525
+ }
33526
+ } catch (err) {
33527
+ _iterator2.e(err);
33528
+ } finally {
33529
+ _iterator2.f();
33530
+ }
33531
+
33532
+ return false;
33533
+ }, [labelKey, childrenKey]); // ---------- 同步外部值 ----------
33534
+
33535
+ useEffect(function () {
33536
+ if (externalValue && externalValue.length > 0) {
33537
+ var pathLabel = getPathLabel(externalValue);
33538
+ setInputText(pathLabel);
33539
+ } else {
33540
+ setInputText('');
33541
+ }
33542
+ }, [externalValue, getPathLabel]); // ---------- 清理定时器 ----------
33543
+
33544
+ useEffect(function () {
33545
+ return function () {
33546
+ if (blurTimerRef.current) clearTimeout(blurTimerRef.current);
33547
+ };
33548
+ }, []); // ---------- 核心逻辑 ----------
33549
+
33550
+ var processText = useCallback(function (text) {
33551
+ if (!text.trim()) {
33552
+ onChange === null || onChange === void 0 ? void 0 : onChange(undefined, []);
33553
+ setOpen(false);
33554
+ } else {
33555
+ var _ref2;
33556
+
33557
+ var matched = findInTree(text, options);
33558
+ var newValue = [text];
33559
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue, [(_ref2 = {}, _defineProperty(_ref2, labelKey, text), _defineProperty(_ref2, valueKey, text), _defineProperty(_ref2, "isCustom", true), _ref2)]);
33560
+ setOpen(matched);
33561
+ }
33562
+ }, [options, findInTree, labelKey, valueKey, onChange]); // ---------- 全局 mousedown 监听 ----------
33563
+
33564
+ useEffect(function () {
33565
+ var handleMouseDown = function handleMouseDown(e) {
33566
+ var _inputRef$current, _target$closest, _target$closest2;
33567
+
33568
+ var target = e.target;
33569
+ var container = containerRef.current;
33570
+ if (!container) return;
33571
+ var inputElement = (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.input;
33572
+ var hasFocus = inputElement && document.activeElement === inputElement; // 检查是否点击在级联菜单内
33573
+
33574
+ var isMenu = (_target$closest = target.closest) === null || _target$closest === void 0 ? void 0 : _target$closest.call(target, ".".concat(DROPDOWN_CLASS));
33575
+
33576
+ if (isMenu) {
33577
+ isMenuClickRef.current = true;
33578
+
33579
+ if (hasFocus) {
33580
+ requestAnimationFrame(function () {
33581
+ var _inputRef$current2;
33582
+
33583
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
33584
+ });
33585
+ }
33586
+
33587
+ return;
33588
+ } // 检查是否点击在自定义内部元素(箭头、清除按钮)
33589
+
33590
+
33591
+ var isInternal = (_target$closest2 = target.closest) === null || _target$closest2 === void 0 ? void 0 : _target$closest2.call(target, ".".concat(ARROW_CLASS, ", .").concat(CLEAR_CLASS));
33592
+
33593
+ if (isInternal) {
33594
+ // 如果是箭头,允许 toggleOpen 处理,不干预焦点
33595
+ // 如果是清除,也不干预
33596
+ return;
33597
+ }
33598
+
33599
+ isMenuClickRef.current = false;
33600
+
33601
+ if (container.contains(target)) {
33602
+ return;
33603
+ }
33604
+
33605
+ if (hasFocus) {
33606
+ if (blurTimerRef.current) clearTimeout(blurTimerRef.current);
33607
+ blurTimerRef.current = setTimeout(function () {
33608
+ if (inputElement && document.activeElement === inputElement) {
33609
+ var _inputRef$current3;
33610
+
33611
+ (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.blur();
33612
+ }
33613
+
33614
+ blurTimerRef.current = null;
33615
+ }, 0);
33616
+ }
33617
+ };
33618
+
33619
+ document.addEventListener('mousedown', handleMouseDown);
33620
+ return function () {
33621
+ document.removeEventListener('mousedown', handleMouseDown);
33622
+ };
33623
+ }, []); // ---------- 事件处理 ----------
33624
+
33625
+ var handleInputChange = function handleInputChange(e) {
33626
+ var text = e.target.value;
33627
+ setInputText(text);
33628
+ if (isComposingRef.current) return;
33629
+ processText(text);
33630
+ };
33631
+
33632
+ var handleCompositionStart = function handleCompositionStart() {
33633
+ isComposingRef.current = true;
33634
+ };
33635
+
33636
+ var handleCompositionEnd = function handleCompositionEnd(e) {
33637
+ isComposingRef.current = false;
33638
+ var text = e.target.value;
33639
+ processText(text);
33640
+ };
33641
+
33642
+ var handleInputFocus = function handleInputFocus() {
33643
+ if (preventOpenRef.current) {
33644
+ preventOpenRef.current = false;
33645
+ return;
33646
+ }
33647
+
33648
+ setOpen(true);
33649
+ };
33650
+
33651
+ var handleInputBlur = function handleInputBlur(e) {
33652
+ if (isMenuClickRef.current) {
33653
+ isMenuClickRef.current = false;
33654
+ return;
33655
+ }
33656
+
33657
+ var relatedTarget = e.relatedTarget;
33658
+
33659
+ if (relatedTarget) {
33660
+ var _relatedTarget$closes, _relatedTarget$closes2;
33661
+
33662
+ // 如果焦点移向菜单或内部自定义元素(箭头、清除),忽略失焦
33663
+ var isMenu = (_relatedTarget$closes = relatedTarget.closest) === null || _relatedTarget$closes === void 0 ? void 0 : _relatedTarget$closes.call(relatedTarget, ".".concat(DROPDOWN_CLASS));
33664
+ var isInternal = (_relatedTarget$closes2 = relatedTarget.closest) === null || _relatedTarget$closes2 === void 0 ? void 0 : _relatedTarget$closes2.call(relatedTarget, ".".concat(ARROW_CLASS, ", .").concat(CLEAR_CLASS));
33665
+
33666
+ if (isMenu || isInternal) {
33667
+ return;
33668
+ }
33669
+ }
33670
+
33671
+ setOpen(false);
33672
+ onBlurProp === null || onBlurProp === void 0 ? void 0 : onBlurProp(e);
33673
+ };
33674
+
33675
+ var handleCascaderChange = function handleCascaderChange(selectedValue, selectedOptions) {
33676
+ var path = selectedOptions.map(function (opt) {
33677
+ var _opt$labelKey;
33678
+
33679
+ return ((_opt$labelKey = opt[labelKey]) === null || _opt$labelKey === void 0 ? void 0 : _opt$labelKey.toString()) || '';
33680
+ }).join('');
33681
+ setInputText(path);
33682
+ onChange === null || onChange === void 0 ? void 0 : onChange(selectedValue, selectedOptions);
33683
+ var lastOption = selectedOptions[selectedOptions.length - 1];
33684
+ var hasChildren = (lastOption === null || lastOption === void 0 ? void 0 : lastOption[childrenKey]) && lastOption[childrenKey].length > 0;
33685
+
33686
+ if (hasChildren) {
33687
+ setOpen(true);
33688
+ setTimeout(function () {
33689
+ var _inputRef$current4;
33690
+
33691
+ (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.focus();
33692
+ }, 0);
33693
+ } else {
33694
+ setOpen(false);
33695
+ preventOpenRef.current = true;
33696
+ setTimeout(function () {
33697
+ var _inputRef$current5;
33698
+
33699
+ (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.focus();
33700
+ }, 0);
33701
+ }
33702
+ };
33703
+
33704
+ var handleClear = function handleClear(e) {
33705
+ var _inputRef$current6;
33706
+
33707
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
33708
+ setInputText('');
33709
+ setOpen(false);
33710
+ onChange === null || onChange === void 0 ? void 0 : onChange(undefined, []); // 保持焦点
33711
+
33712
+ (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.focus();
33713
+ };
33714
+
33715
+ var toggleOpen = function toggleOpen() {
33716
+ if (open) {
33717
+ var _inputRef$current7;
33718
+
33719
+ setOpen(false); // 保持焦点
33720
+
33721
+ (_inputRef$current7 = inputRef.current) === null || _inputRef$current7 === void 0 ? void 0 : _inputRef$current7.focus();
33722
+ } else {
33723
+ var _inputRef$current8;
33724
+
33725
+ // 打开弹窗,清除阻止标记,确保 onFocus 能正常工作
33726
+ preventOpenRef.current = false;
33727
+ setOpen(true);
33728
+ (_inputRef$current8 = inputRef.current) === null || _inputRef$current8 === void 0 ? void 0 : _inputRef$current8.focus();
33729
+ }
33730
+ };
33731
+
33732
+ var showClear = externalValue && externalValue.length > 0;
33733
+ useImperativeHandle(ref, function () {
33734
+ return {
33735
+ focus: function focus() {
33736
+ var _inputRef$current9;
33737
+
33738
+ return (_inputRef$current9 = inputRef.current) === null || _inputRef$current9 === void 0 ? void 0 : _inputRef$current9.focus();
33739
+ },
33740
+ blur: function blur() {
33741
+ var _inputRef$current10;
33742
+
33743
+ return (_inputRef$current10 = inputRef.current) === null || _inputRef$current10 === void 0 ? void 0 : _inputRef$current10.blur();
33744
+ }
33745
+ };
33746
+ });
33747
+ return /*#__PURE__*/React.createElement("div", {
33748
+ ref: containerRef,
33749
+ className: className,
33750
+ style: _objectSpread2({
33751
+ position: 'relative',
33752
+ width: '100%'
33753
+ }, style)
33754
+ }, /*#__PURE__*/React.createElement(Input$1, {
33755
+ ref: inputRef,
33756
+ placeholder: placeholder,
33757
+ value: inputText,
33758
+ onChange: handleInputChange,
33759
+ onCompositionStart: handleCompositionStart,
33760
+ onCompositionEnd: handleCompositionEnd,
33761
+ onFocus: handleInputFocus,
33762
+ onBlur: handleInputBlur,
33763
+ style: _objectSpread2({}, style),
33764
+ suffix: /*#__PURE__*/React.createElement(React.Fragment, null, showClear && /*#__PURE__*/React.createElement(CloseOutlined$2, {
33765
+ className: CLEAR_CLASS,
33766
+ onClick: handleClear,
33767
+ style: {
33768
+ color: 'rgba(0,0,0,0.25)',
33769
+ cursor: 'pointer',
33770
+ marginRight: 4
33771
+ }
33772
+ }), /*#__PURE__*/React.createElement(DownOutlined$2, {
33773
+ className: ARROW_CLASS,
33774
+ onClick: toggleOpen,
33775
+ style: {
33776
+ color: open ? '#1677ff' : 'rgba(0,0,0,0.25)',
33777
+ cursor: 'pointer',
33778
+ transition: 'transform 0.2s',
33779
+ transform: open ? 'rotate(180deg)' : 'none'
33780
+ }
33781
+ }))
33782
+ }), /*#__PURE__*/React.createElement(Cascader$1, _objectSpread2(_objectSpread2({}, restProps), {}, {
33783
+ options: options,
33784
+ fieldNames: fieldNames,
33785
+ value: externalValue,
33786
+ onChange: handleCascaderChange,
33787
+ open: open,
33788
+ getPopupContainer: function getPopupContainer() {
33789
+ return document.body;
33790
+ },
33791
+ dropdownClassName: DROPDOWN_CLASS,
33792
+ style: {
33793
+ position: 'absolute',
33794
+ top: 0,
33795
+ left: 0,
33796
+ width: '100%',
33797
+ height: '100%',
33798
+ opacity: 0,
33799
+ pointerEvents: 'none',
33800
+ zIndex: -1
33801
+ },
33802
+ showSearch: false,
33803
+ expandIcon: null
33804
+ })));
33805
+ });
33806
+ CustomCascader.displayName = 'CustomCascader';
33807
+
33808
+ var useColumns$4 = (function (form, isRequired) {
33809
+ var getFieldDecorator = form.getFieldDecorator;
33810
+ var controller = Invoice.useInvoiceController();
33811
+ var rootElement = controller.useMemo(function (s) {
33812
+ return s.rootElement;
33813
+ }, []);
33814
+ /** 组件模式 */
33815
+
33816
+ var model = controller.useMemo(function (e) {
33817
+ return e.model;
33818
+ }, []);
33819
+ /** 正在编辑的货物 */
33820
+
33821
+ var editGood = controller.useMemo(function (e) {
33822
+ return e.passengerListState.editGood;
33823
+ }, []);
33824
+ /** 禁用字段 */
33825
+
33826
+ var disableds = controller.useMemo(function (e) {
33827
+ return e.stakeholder.disableds || [];
33828
+ }, []);
33829
+ /** 运输工具种类列表 */
33830
+
33831
+ var vehicleTypeList = controller.useMemo(function (e) {
33832
+ return e.passengerListState.vehicleTypeList;
33833
+ }, []);
33834
+ /** 证件类型列表 */
33835
+
33836
+ var certificateTypeList = controller.useMemo(function (e) {
33837
+ return e.passengerListState.certificateTypeList;
33838
+ }, []);
33839
+ var area = controller.useMemo(function (e) {
33840
+ return e.passengerListState.area;
33841
+ }, []);
33842
+ var addressFieldNames = controller.useMemo(function (e) {
33843
+ return e.passengerListState.addressFieldNames;
33844
+ }, []);
33845
+ var getVehicle = React.useCallback(function (value) {
33846
+ if (vehicleTypeList && vehicleTypeList.length > 0) {
33847
+ var _vehicleTypeList$find;
33848
+
33849
+ return ((_vehicleTypeList$find = vehicleTypeList.find(function (e) {
33850
+ return e.value === value;
33851
+ })) === null || _vehicleTypeList$find === void 0 ? void 0 : _vehicleTypeList$find.label) || '';
33852
+ }
33853
+ }, [vehicleTypeList]);
33854
+ var getCertificateType = React.useCallback(function (value) {
33855
+ if (certificateTypeList && certificateTypeList.length > 0) {
33856
+ var _certificateTypeList$;
33857
+
33858
+ return ((_certificateTypeList$ = certificateTypeList.find(function (e) {
33859
+ return e.value === value;
33860
+ })) === null || _certificateTypeList$ === void 0 ? void 0 : _certificateTypeList$.label) || '';
33861
+ }
33862
+ }, [certificateTypeList]); // 等级选项配置
33863
+
33864
+ var levelOptionsMap = React.useMemo(function () {
33865
+ return {
33866
+ 'AIRCRAFT': {
33867
+ options: [{
33868
+ value: '公务舱',
33869
+ label: '公务舱'
33870
+ }, {
33871
+ value: '头等舱',
33872
+ label: '头等舱'
33873
+ }, {
33874
+ value: '经济舱',
33875
+ label: '经济舱'
33876
+ }],
33877
+ required: true
33878
+ },
33879
+ 'TRAIN': {
33880
+ options: [{
33881
+ value: '一等座',
33882
+ label: '一等座'
33883
+ }, {
33884
+ value: '二等座',
33885
+ label: '二等座'
33886
+ }, {
33887
+ value: '软席(软座、软卧)',
33888
+ label: '软席(软座、软卧)'
33889
+ }, {
33890
+ value: '硬席(硬座、硬卧)',
33891
+ label: '硬席(硬座、硬卧)'
33892
+ }],
33893
+ required: true
33894
+ },
33895
+ 'SHIP': {
33896
+ options: [{
33897
+ value: '一等舱',
33898
+ label: '一等舱'
33899
+ }, {
33900
+ value: '二等舱',
33901
+ label: '二等舱'
33902
+ }, {
33903
+ value: '三等舱',
33904
+ label: '三等舱'
33905
+ }],
33906
+ required: true
33907
+ } // 其他类型不配置,则等级为非必填的文本输入
33908
+
33909
+ };
33910
+ }, []);
33911
+ var splitArea = React.useCallback(function (value) {
33912
+ if (value) {
33913
+ var _array = value.split(',');
33914
+
33915
+ return _array;
33916
+ } else {
33917
+ return [];
33918
+ }
33919
+ }, []);
33920
+ /** 表头 */
33921
+
33922
+ var columns = React.useMemo(function () {
33923
+ return [// {
33924
+ // title: '序号',
33925
+ // key: 'cxrxh',
33926
+ // dataIndex: 'cxrxh',
33927
+ // width: 50,
33928
+ // render: (e: number) => <span style={{ padding: '0 10px' }}>{e}</span>,
33929
+ // },
33930
+ {
33931
+ title: /*#__PURE__*/React.createElement(TitleText$4, {
33932
+ required: true
33933
+ }, "\u51FA\u884C\u4EBA"),
33934
+ dataIndex: 'cxr',
33935
+ key: 'cxr',
33936
+ width: 100,
33937
+ render: function render(_, record) {
33938
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
33939
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('cxr', {
33940
+ initialValue: editGood.cxr,
33941
+ rules: [{
33942
+ required: true,
33943
+ message: '请输入出行人'
33944
+ }]
33945
+ })( /*#__PURE__*/React.createElement(MyInput$6, {
33946
+ maxLength: 20,
33947
+ onChange: function () {
33948
+ var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
33949
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
33950
+ while (1) {
33951
+ switch (_context.prev = _context.next) {
33952
+ case 0:
33953
+ _context.next = 2;
33954
+ return controller.wait();
33955
+
33956
+ case 2:
33957
+ _context.next = 4;
33958
+ return controller.setEditPassenger({
33959
+ cxr: form.getFieldsValue().cxr
33960
+ });
33961
+
33962
+ case 4:
33963
+ case "end":
33964
+ return _context.stop();
33965
+ }
33966
+ }
33967
+ }, _callee);
33968
+ }));
33969
+
33970
+ function onChange() {
33971
+ return _onChange.apply(this, arguments);
33972
+ }
33973
+
33974
+ return onChange;
33975
+ }()
33976
+ })));
33977
+ } else {
33978
+ return /*#__PURE__*/React.createElement("span", {
33979
+ style: {
33980
+ padding: '0 10px'
33981
+ }
33982
+ }, record.cxr);
33983
+ }
33984
+ }
33985
+ }, {
33986
+ title: /*#__PURE__*/React.createElement(TitleText$4, {
33987
+ required: isRequired
33988
+ }, "\u51FA\u884C\u65E5\u671F"),
33989
+ dataIndex: 'chuxrq',
33990
+ key: 'chuxrq',
33991
+ width: 130,
33992
+ render: function render(_, record) {
33993
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
33994
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('chuxrq', {
33995
+ initialValue: editGood.chuxrq ? hooks(editGood.chuxrq) : undefined,
33996
+ rules: [{
33997
+ required: isRequired,
33998
+ message: '请选择出行日期'
33999
+ }]
34000
+ })( /*#__PURE__*/React.createElement(DatePicker$1, {
34001
+ format: "YYYY-MM-DD",
34002
+ placeholder: "\u8BF7\u9009\u62E9",
34003
+ onChange: function () {
34004
+ var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(v) {
34005
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
34006
+ while (1) {
34007
+ switch (_context2.prev = _context2.next) {
34008
+ case 0:
34009
+ _context2.next = 2;
34010
+ return controller.wait();
34011
+
34012
+ case 2:
34013
+ _context2.next = 4;
34014
+ return controller.setEditPassenger({
34015
+ chuxrq: hooks(v).format('YYYY-MM-DD')
34016
+ });
34017
+
34018
+ case 4:
34019
+ case "end":
34020
+ return _context2.stop();
34021
+ }
34022
+ }
34023
+ }, _callee2);
34024
+ }));
34025
+
34026
+ function onChange(_x) {
34027
+ return _onChange2.apply(this, arguments);
34028
+ }
34029
+
34030
+ return onChange;
34031
+ }()
34032
+ })));
34033
+ } else {
34034
+ return /*#__PURE__*/React.createElement("span", {
34035
+ style: {
34036
+ padding: '0 10px'
34037
+ }
34038
+ }, record.chuxrq);
34039
+ }
34040
+ }
34041
+ }, {
34042
+ title: /*#__PURE__*/React.createElement(TitleText$4, {
34043
+ required: isRequired
34044
+ }, "\u51FA\u884C\u4EBA\u8BC1\u4EF6\u7C7B\u578B"),
34045
+ key: 'cxrzjlxDm',
34046
+ dataIndex: 'cxrzjlxDm',
34047
+ width: 160,
34048
+ render: function render(_, record) {
34049
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !(model === 'prefab')) {
34050
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('cxrzjlxDm', {
34051
+ initialValue: editGood.cxrzjlxDm,
34052
+ rules: [{
34053
+ required: isRequired,
34054
+ message: '请选择出行人证件类型'
34055
+ }]
34056
+ })( /*#__PURE__*/React.createElement(Select$1, {
34057
+ className: "kts-invoice-operate-goods-list-table-tax-rate",
34058
+ showArrow: true,
34059
+ allowClear: true,
34060
+ style: {
34061
+ width: '100%'
34062
+ },
34063
+ getPopupContainer: function getPopupContainer() {
34064
+ return rootElement || document.body;
34065
+ },
34066
+ onChange: function () {
34067
+ var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value) {
34068
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
34069
+ while (1) {
34070
+ switch (_context3.prev = _context3.next) {
34071
+ case 0:
34072
+ _context3.next = 2;
34073
+ return controller.wait();
34074
+
34075
+ case 2:
34076
+ controller.setEditPassenger({
34077
+ cxrzjlxDm: value
34078
+ });
34079
+
34080
+ case 3:
34081
+ case "end":
34082
+ return _context3.stop();
34083
+ }
34084
+ }
34085
+ }, _callee3);
34086
+ }));
34087
+
34088
+ function onChange(_x2) {
34089
+ return _onChange3.apply(this, arguments);
34090
+ }
34091
+
34092
+ return onChange;
34093
+ }()
34094
+ }, certificateTypeList.map(function (e, i) {
34095
+ return /*#__PURE__*/React.createElement(Select$1.Option, {
34096
+ key: i,
34097
+ value: e.value
34098
+ }, e.label);
34099
+ }))));
34100
+ } else {
34101
+ return /*#__PURE__*/React.createElement("span", {
34102
+ style: {
34103
+ padding: '0 10px'
34104
+ }
34105
+ }, getCertificateType(record.cxrzjlxDm));
34106
+ }
34107
+ }
34108
+ }, {
34109
+ title: /*#__PURE__*/React.createElement(TitleText$4, {
34110
+ required: isRequired
34111
+ }, "\u51FA\u884C\u4EBA\u8BC1\u4EF6\u53F7\u7801"),
34112
+ dataIndex: 'sfzjhm',
34113
+ key: 'sfzjhm',
34114
+ width: 150,
34115
+ render: function render(_, record) {
34116
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
34117
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('sfzjhm', {
34118
+ initialValue: editGood.sfzjhm,
34119
+ rules: [{
34120
+ required: isRequired,
34121
+ message: '请输入证件号码'
34122
+ }]
34123
+ })( /*#__PURE__*/React.createElement(MyInput$6, {
34124
+ maxLength: 20,
34125
+ onChange: function () {
34126
+ var _onChange4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
34127
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
34128
+ while (1) {
34129
+ switch (_context4.prev = _context4.next) {
34130
+ case 0:
34131
+ _context4.next = 2;
34132
+ return controller.wait();
34133
+
34134
+ case 2:
34135
+ _context4.next = 4;
34136
+ return controller.setEditPassenger({
34137
+ sfzjhm: form.getFieldsValue().sfzjhm
34138
+ });
34139
+
34140
+ case 4:
34141
+ case "end":
34142
+ return _context4.stop();
34143
+ }
34144
+ }
34145
+ }, _callee4);
34146
+ }));
34147
+
34148
+ function onChange() {
34149
+ return _onChange4.apply(this, arguments);
34150
+ }
34151
+
34152
+ return onChange;
34153
+ }()
34154
+ })));
34155
+ } else {
34156
+ return /*#__PURE__*/React.createElement("span", {
34157
+ style: {
34158
+ padding: '0 10px'
34159
+ }
34160
+ }, record.sfzjhm);
34161
+ }
34162
+ }
34163
+ }, {
34164
+ title: /*#__PURE__*/React.createElement(TitleText$4, {
34165
+ required: isRequired
34166
+ }, "\u51FA\u53D1\u70B9"),
34167
+ key: 'cfd',
34168
+ dataIndex: 'cfd',
34169
+ width: 180,
34170
+ render: function render(_, record) {
34171
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
34172
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('cfd', {
34173
+ initialValue: editGood.cfd,
34174
+ rules: [{
34175
+ required: isRequired,
34176
+ message: '请输入出发点'
34177
+ }]
34178
+ })( /*#__PURE__*/React.createElement(CustomCascader, {
34179
+ style: {
34180
+ width: '100%'
34181
+ },
34182
+ options: area,
34183
+ fieldNames: addressFieldNames,
34184
+ onChange: function () {
34185
+ var _onChange5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(value) {
34186
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
34187
+ while (1) {
34188
+ switch (_context5.prev = _context5.next) {
34189
+ case 0:
34190
+ _context5.next = 2;
34191
+ return controller.setEditPassenger({
34192
+ cfd: value
34193
+ });
34194
+
34195
+ case 2:
34196
+ case "end":
34197
+ return _context5.stop();
34198
+ }
34199
+ }
34200
+ }, _callee5);
34201
+ }));
34202
+
34203
+ function onChange(_x3) {
34204
+ return _onChange5.apply(this, arguments);
34205
+ }
34206
+
34207
+ return onChange;
34208
+ }()
34209
+ })));
34210
+ } else {
34211
+ return /*#__PURE__*/React.createElement("span", {
34212
+ style: {
34213
+ padding: '0 10px'
34214
+ }
34215
+ }, record.cfd);
34216
+ }
34217
+ }
34218
+ }, {
34219
+ title: /*#__PURE__*/React.createElement(TitleText$4, {
34220
+ required: isRequired
34221
+ }, "\u5230\u8FBE\u5730"),
34222
+ dataIndex: 'ddd',
34223
+ key: 'ddd',
34224
+ width: 180,
34225
+ render: function render(_, record) {
34226
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
34227
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('ddd', {
34228
+ initialValue: editGood.ddd,
34229
+ rules: [{
34230
+ required: isRequired,
34231
+ message: '请输入到达地'
34232
+ }]
34233
+ })( /*#__PURE__*/React.createElement(CustomCascader, {
34234
+ options: area,
34235
+ fieldNames: addressFieldNames,
34236
+ style: {
34237
+ width: '100%'
34238
+ },
34239
+ onChange: function () {
34240
+ var _onChange6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(value) {
34241
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
34242
+ while (1) {
34243
+ switch (_context6.prev = _context6.next) {
34244
+ case 0:
34245
+ _context6.next = 2;
34246
+ return controller.setEditPassenger({
34247
+ ddd: value
34248
+ });
34249
+
34250
+ case 2:
34251
+ case "end":
34252
+ return _context6.stop();
34253
+ }
34254
+ }
34255
+ }, _callee6);
34256
+ }));
34257
+
34258
+ function onChange(_x4) {
34259
+ return _onChange6.apply(this, arguments);
34260
+ }
34261
+
34262
+ return onChange;
34263
+ }()
34264
+ })));
34265
+ } else {
34266
+ return /*#__PURE__*/React.createElement("span", {
34267
+ style: {
34268
+ padding: '0 10px'
34269
+ }
34270
+ }, record.ddd);
34271
+ }
34272
+ }
34273
+ }, {
34274
+ title: /*#__PURE__*/React.createElement(TitleText$4, {
34275
+ required: isRequired
34276
+ }, "\u4EA4\u901A\u5DE5\u5177\u7C7B\u578B"),
34277
+ key: 'jtgjlxDm',
34278
+ dataIndex: 'jtgjlxDm',
34279
+ width: 130,
34280
+ render: function render(_, record) {
34281
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !(model === 'prefab')) {
34282
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('jtgjlxDm', {
34283
+ initialValue: editGood.jtgjlxDm,
34284
+ rules: [{
34285
+ required: isRequired,
34286
+ message: '请选择交通工具类型'
34287
+ }]
34288
+ })( /*#__PURE__*/React.createElement(Select$1, {
34289
+ className: "kts-invoice-operate-goods-list-table-tax-rate",
34290
+ showArrow: true,
34291
+ allowClear: true,
34292
+ style: {
34293
+ width: '100%'
34294
+ },
34295
+ getPopupContainer: function getPopupContainer() {
34296
+ return rootElement || document.body;
34297
+ },
34298
+ onChange: function () {
34299
+ var _onChange7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(value) {
34300
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
34301
+ while (1) {
34302
+ switch (_context7.prev = _context7.next) {
34303
+ case 0:
34304
+ _context7.next = 2;
34305
+ return controller.wait();
34306
+
34307
+ case 2:
34308
+ controller.setEditPassenger({
34309
+ jtgjlxDm: value
34310
+ });
34311
+
34312
+ case 3:
34313
+ case "end":
34314
+ return _context7.stop();
34315
+ }
34316
+ }
34317
+ }, _callee7);
34318
+ }));
34319
+
34320
+ function onChange(_x5) {
34321
+ return _onChange7.apply(this, arguments);
34322
+ }
34323
+
34324
+ return onChange;
34325
+ }()
34326
+ }, vehicleTypeList.map(function (e, i) {
34327
+ return /*#__PURE__*/React.createElement(Select$1.Option, {
34328
+ key: i,
34329
+ value: e.value,
34330
+ disabled: e.disabled
34331
+ }, e.label, e.disabled ? '(暂不支持)' : '');
34332
+ }))));
34333
+ } else {
34334
+ return /*#__PURE__*/React.createElement("span", {
34335
+ style: {
34336
+ padding: '0 10px'
34337
+ }
34338
+ }, getVehicle(record.jtgjlxDm));
34339
+ }
34340
+ }
34341
+ }, {
34342
+ title: /*#__PURE__*/React.createElement(TitleText$4, {
34343
+ required: false
34344
+ }, "\u7B49\u7EA7"),
34345
+ dataIndex: 'zwdj',
34346
+ key: 'zwdj',
34347
+ width: 110,
34348
+ render: function render(_, record) {
34349
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
34350
+ // 获取当前等级配置
34351
+ var levelConfig = editGood.jtgjlxDm ? levelOptionsMap[editGood.jtgjlxDm] : undefined;
34352
+ var isLevelSelect = !!levelConfig;
34353
+ var isLevelRequired = (levelConfig === null || levelConfig === void 0 ? void 0 : levelConfig.required) || false;
34354
+ var levelOptions = (levelConfig === null || levelConfig === void 0 ? void 0 : levelConfig.options) || [];
34355
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('zwdj', {
34356
+ initialValue: editGood.zwdj,
34357
+ rules: [{
34358
+ required: isLevelRequired,
34359
+ message: '请选择等级'
34360
+ }]
34361
+ })(isLevelSelect ? /*#__PURE__*/React.createElement(Select$1, {
34362
+ className: "kts-invoice-operate-goods-list-table-tax-rate",
34363
+ showArrow: true,
34364
+ allowClear: true,
34365
+ style: {
34366
+ width: '100%'
34367
+ },
34368
+ getPopupContainer: function getPopupContainer() {
34369
+ return rootElement || document.body;
34370
+ },
34371
+ onChange: function () {
34372
+ var _onChange8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(value) {
34373
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
34374
+ while (1) {
34375
+ switch (_context8.prev = _context8.next) {
34376
+ case 0:
34377
+ _context8.next = 2;
34378
+ return controller.wait();
34379
+
34380
+ case 2:
34381
+ controller.setEditPassenger({
34382
+ zwdj: value
34383
+ });
34384
+
34385
+ case 3:
34386
+ case "end":
34387
+ return _context8.stop();
34388
+ }
34389
+ }
34390
+ }, _callee8);
34391
+ }));
34392
+
34393
+ function onChange(_x6) {
34394
+ return _onChange8.apply(this, arguments);
34395
+ }
34396
+
34397
+ return onChange;
34398
+ }()
34399
+ }, levelOptions.map(function (e, i) {
34400
+ return /*#__PURE__*/React.createElement(Select$1.Option, {
34401
+ key: i,
34402
+ value: e.value
34403
+ }, e.label);
34404
+ })) : /*#__PURE__*/React.createElement(MyInput$6, {
34405
+ maxLength: 20,
34406
+ onChange: function () {
34407
+ var _onChange9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
34408
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
34409
+ while (1) {
34410
+ switch (_context9.prev = _context9.next) {
34411
+ case 0:
34412
+ _context9.next = 2;
34413
+ return controller.wait();
34414
+
34415
+ case 2:
34416
+ _context9.next = 4;
34417
+ return controller.setEditPassenger({
34418
+ zwdj: form.getFieldsValue().zwdj
34419
+ });
34420
+
34421
+ case 4:
34422
+ case "end":
34423
+ return _context9.stop();
34424
+ }
34425
+ }
34426
+ }, _callee9);
34427
+ }));
34428
+
34429
+ function onChange() {
34430
+ return _onChange9.apply(this, arguments);
34431
+ }
34432
+
34433
+ return onChange;
34434
+ }()
34435
+ })));
34436
+ } else {
34437
+ return /*#__PURE__*/React.createElement("span", {
34438
+ style: {
34439
+ padding: '0 10px'
34440
+ }
34441
+ }, record.zwdj);
34442
+ }
34443
+ }
34444
+ }] // 只读
34445
+ .filter(function (e) {
34446
+ if (model === 'readOnly') {
34447
+ return e.key !== 'operating';
34448
+ } else {
34449
+ return true;
34450
+ }
34451
+ }).map(function (e) {
34452
+ return _objectSpread2(_objectSpread2({}, e), {}, {
34453
+ ellipsis: true
34454
+ });
34455
+ });
34456
+ }, [editGood, controller, model, getVehicle]);
34457
+ return columns;
34458
+ });
34459
+
34460
+ var MyInput$6 = /*#__PURE__*/function (_React$Component) {
34461
+ _inherits(MyInput, _React$Component);
34462
+
34463
+ var _super = _createSuper(MyInput);
34464
+
34465
+ function MyInput() {
34466
+ _classCallCheck(this, MyInput);
34467
+
34468
+ return _super.apply(this, arguments);
34469
+ }
34470
+
34471
+ _createClass(MyInput, [{
34472
+ key: "render",
34473
+ value: function render() {
34474
+ if (this.props.loading) {
34475
+ return /*#__PURE__*/React.createElement(Spin$1, {
34476
+ size: "small"
34477
+ }, /*#__PURE__*/React.createElement(Input$1, _objectSpread2(_objectSpread2({}, this.props), {}, {
34478
+ autoComplete: "off"
34479
+ })));
34480
+ } else {
34481
+ return /*#__PURE__*/React.createElement(Input$1, _objectSpread2(_objectSpread2({}, this.props), {}, {
34482
+ autoComplete: "off"
34483
+ }));
34484
+ }
34485
+ }
34486
+ }]);
34487
+
34488
+ return MyInput;
34489
+ }(React.Component);
34490
+
34491
+ var useOnRow$4 = (function () {
34492
+ /** 控制器 */
34493
+ var controller = Invoice.useInvoiceController();
34494
+ var model = controller.useMemo(function (s) {
34495
+ return s.model;
34496
+ }, []);
34497
+ var onClick = React.useCallback( /*#__PURE__*/function () {
34498
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(record) {
34499
+ var editGood;
34500
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
34501
+ while (1) {
34502
+ switch (_context2.prev = _context2.next) {
34503
+ case 0:
34504
+ if (!(model === 'readOnly')) {
34505
+ _context2.next = 2;
34506
+ break;
34507
+ }
34508
+
34509
+ return _context2.abrupt("return");
34510
+
34511
+ case 2:
34512
+ editGood = controller.state.passengerListState.editGood;
34513
+
34514
+ if (!editGood) {
34515
+ _context2.next = 14;
34516
+ break;
34517
+ }
34518
+
34519
+ if (!(editGood.$index === record.$index)) {
34520
+ _context2.next = 6;
34521
+ break;
34522
+ }
34523
+
34524
+ return _context2.abrupt("return");
34525
+
34526
+ case 6:
34527
+ _context2.next = 8;
34528
+ return controller.saveEditPassenger();
34529
+
34530
+ case 8:
34531
+ _context2.next = 10;
34532
+ return controller.wait();
34533
+
34534
+ case 10:
34535
+ _context2.next = 12;
34536
+ return controller.pipeline( /*#__PURE__*/function () {
34537
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
34538
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34539
+ while (1) {
34540
+ switch (_context.prev = _context.next) {
34541
+ case 0:
34542
+ _context.t0 = s.passengerListState.editGood;
34543
+
34544
+ if (_context.t0) {
34545
+ _context.next = 4;
34546
+ break;
34547
+ }
34548
+
34549
+ _context.next = 4;
34550
+ return controller.setEditPassenger(record);
34551
+
34552
+ case 4:
34553
+ case "end":
34554
+ return _context.stop();
34555
+ }
34556
+ }
34557
+ }, _callee);
34558
+ }));
34559
+
34560
+ return function (_x2) {
34561
+ return _ref2.apply(this, arguments);
34562
+ };
34563
+ }())();
34564
+
34565
+ case 12:
34566
+ _context2.next = 16;
34567
+ break;
34568
+
34569
+ case 14:
34570
+ _context2.next = 16;
34571
+ return controller.setEditPassenger(record);
34572
+
34573
+ case 16:
34574
+ case "end":
34575
+ return _context2.stop();
34576
+ }
34577
+ }
34578
+ }, _callee2);
34579
+ }));
34580
+
34581
+ return function (_x) {
34582
+ return _ref.apply(this, arguments);
34583
+ };
34584
+ }(), [controller, model]);
34585
+ return {
34586
+ onClick: onClick
34587
+ };
34588
+ });
34589
+
34590
+ /**
34591
+ * 点击组件外部 保存正在编辑的行
34592
+ */
34593
+ /**
34594
+ * 点击组件外部 保存正在编辑的货物
34595
+ */
34596
+
34597
+ function useWindowClick$4(controller) {
34598
+ /** 点击组件外部 保存正在编辑的货物 */
34599
+ React.useEffect(function () {
34600
+ var click = function click() {
34601
+ setTimeout(controller.saveEditPassenger);
34602
+ };
34603
+
34604
+ window.addEventListener('click', click);
34605
+ return function () {
34606
+ window.removeEventListener('click', click);
34607
+ };
34608
+ }, [controller]);
34609
+ }
34610
+
34611
+ var useRowSelection$4 = (function () {
34612
+ /** 控制器 */
34613
+ var controller = Invoice.useInvoiceController();
34614
+ /** 列表选中的货物索引列表 */
34615
+
34616
+ var selectedRowKeys = controller.useMemo(function (s) {
34617
+ return s.passengerListState.selectedGoodIndex;
34618
+ }, []);
34619
+ /** 货物列表 */
34620
+
34621
+ var goodsList = controller.useMemo(function (s) {
34622
+ return s.passengerListState.goodsList;
34623
+ }, []);
34624
+ /** 组件模式 */
34625
+
34626
+ var model = controller.useMemo(function (s) {
34627
+ return s.model;
34628
+ }, []);
34629
+ /** 搜索条件 */
34630
+ // const searchValue = controller.useMemo(s => s.goodsListState.searchValue, []);
34631
+
34632
+ /** 是否显示选择框 */
34633
+
34634
+ var isShow = React.useMemo(function () {
34635
+ if (model === 'readOnly' || model === 'prefab') return false;
34636
+ return true;
34637
+ }, [model]);
34638
+ /** 是否全选 */
34639
+ // const isAll = controller.useMemo(s => s.goodsListState.goodsList.length > 0 && s.goodsListState.selectedGoodIndex.length === s.goodsListState.goodsList.length, [])
34640
+
34641
+ var isAll = controller.useMemo(function (s) {
34642
+ if (s.passengerListState.selectedGoodIndex.length <= 0) return false;
34643
+ var seeGoodsIndex = s.passengerListState.goodsList.map(function (e) {
34644
+ return e.$index;
34645
+ });
34646
+ var selectedGoodIndex = s.passengerListState.selectedGoodIndex.filter(function (e) {
34647
+ return seeGoodsIndex.some(function (t) {
34648
+ return e === t;
34649
+ });
34650
+ });
34651
+ return selectedGoodIndex.length === seeGoodsIndex.length;
34652
+ }, []);
34653
+ var indeterminate = controller.useMemo(function (s) {
34654
+ var seeGoodsIndex = s.passengerListState.goodsList.map(function (e) {
34655
+ return e.$index;
34656
+ });
34657
+ var selectedGoodIndex = s.passengerListState.selectedGoodIndex.filter(function (e) {
34658
+ return seeGoodsIndex.some(function (t) {
34659
+ return e === t;
34660
+ });
34661
+ });
34662
+ if (selectedGoodIndex.length === 0) return false;
34663
+ return selectedGoodIndex.length < seeGoodsIndex.length;
34664
+ }, []);
34665
+ /** 点击了全选 */
34666
+
34667
+ var onClickSelectAll = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
34668
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
34669
+ while (1) {
34670
+ switch (_context3.prev = _context3.next) {
34671
+ case 0:
34672
+ if (!isAll) {
34673
+ _context3.next = 5;
34674
+ break;
34675
+ }
34676
+
34677
+ _context3.next = 3;
34678
+ return controller.pipeline( /*#__PURE__*/function () {
34679
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
34680
+ var seeGoodsIndex;
34681
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34682
+ while (1) {
34683
+ switch (_context.prev = _context.next) {
34684
+ case 0:
34685
+ seeGoodsIndex = s.passengerListState.goodsList.map(function (e) {
34686
+ return e.$index;
34687
+ });
34688
+ s.passengerListState.selectedGoodIndex = s.passengerListState.selectedGoodIndex.filter(function (e) {
34689
+ return !seeGoodsIndex.some(function (t) {
34690
+ return e === t;
34691
+ });
34692
+ });
34693
+
34694
+ case 2:
34695
+ case "end":
34696
+ return _context.stop();
34697
+ }
34698
+ }
34699
+ }, _callee);
34700
+ }));
34701
+
34702
+ return function (_x) {
34703
+ return _ref2.apply(this, arguments);
34704
+ };
34705
+ }())();
34706
+
34707
+ case 3:
34708
+ _context3.next = 7;
34709
+ break;
34710
+
34711
+ case 5:
34712
+ _context3.next = 7;
34713
+ return controller.pipeline( /*#__PURE__*/function () {
34714
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
34715
+ var seeGoodsIndex;
34716
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
34717
+ while (1) {
34718
+ switch (_context2.prev = _context2.next) {
34719
+ case 0:
34720
+ seeGoodsIndex = s.passengerListState.goodsList.map(function (e) {
34721
+ return e.$index;
34722
+ });
34723
+ s.passengerListState.selectedGoodIndex = [].concat(_toConsumableArray(s.passengerListState.selectedGoodIndex), _toConsumableArray(seeGoodsIndex));
34724
+ s.passengerListState.selectedGoodIndex = Array.from(new Set(s.passengerListState.selectedGoodIndex));
34725
+
34726
+ case 3:
34727
+ case "end":
34728
+ return _context2.stop();
34729
+ }
34730
+ }
34731
+ }, _callee2);
34732
+ }));
34733
+
34734
+ return function (_x2) {
34735
+ return _ref3.apply(this, arguments);
34736
+ };
34737
+ }())();
34738
+
34739
+ case 7:
34740
+ case "end":
34741
+ return _context3.stop();
34742
+ }
34743
+ }
34744
+ }, _callee3);
34745
+ })), [controller, isAll]);
34746
+ var onSelect = React.useCallback( /*#__PURE__*/function () {
34747
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(record, selected) {
34748
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
34749
+ while (1) {
34750
+ switch (_context6.prev = _context6.next) {
34751
+ case 0:
34752
+ if (!selected) {
34753
+ _context6.next = 5;
34754
+ break;
34755
+ }
34756
+
34757
+ _context6.next = 3;
34758
+ return controller.pipeline( /*#__PURE__*/function () {
34759
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
34760
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
34761
+ while (1) {
34762
+ switch (_context4.prev = _context4.next) {
34763
+ case 0:
34764
+ s.passengerListState.selectedGoodIndex = [].concat(_toConsumableArray(s.passengerListState.selectedGoodIndex), [record.$index]);
34765
+ s.passengerListState = _objectSpread2({}, s.passengerListState);
34766
+
34767
+ case 2:
34768
+ case "end":
34769
+ return _context4.stop();
34770
+ }
34771
+ }
34772
+ }, _callee4);
34773
+ }));
34774
+
34775
+ return function (_x5) {
34776
+ return _ref5.apply(this, arguments);
34777
+ };
34778
+ }())();
34779
+
34780
+ case 3:
34781
+ _context6.next = 7;
34782
+ break;
34783
+
34784
+ case 5:
34785
+ _context6.next = 7;
34786
+ return controller.pipeline( /*#__PURE__*/function () {
34787
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
34788
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
34789
+ while (1) {
34790
+ switch (_context5.prev = _context5.next) {
34791
+ case 0:
34792
+ s.passengerListState.selectedGoodIndex = s.passengerListState.selectedGoodIndex.filter(function (e) {
34793
+ return e !== record.$index;
34794
+ });
34795
+ s.passengerListState = _objectSpread2({}, s.passengerListState);
34796
+
34797
+ case 2:
34798
+ case "end":
34799
+ return _context5.stop();
34800
+ }
34801
+ }
34802
+ }, _callee5);
34803
+ }));
34804
+
34805
+ return function (_x6) {
34806
+ return _ref6.apply(this, arguments);
34807
+ };
34808
+ }())();
34809
+
34810
+ case 7:
34811
+ case "end":
34812
+ return _context6.stop();
34813
+ }
34814
+ }
34815
+ }, _callee6);
34816
+ }));
34817
+
34818
+ return function (_x3, _x4) {
34819
+ return _ref4.apply(this, arguments);
34820
+ };
34821
+ }(), [controller]);
34822
+ var columnTitle = React.useMemo(function () {
34823
+ return /*#__PURE__*/React.createElement(Checkbox, {
34824
+ onChange: onClickSelectAll,
34825
+ indeterminate: indeterminate,
34826
+ checked: isAll
34827
+ });
34828
+ }, [goodsList, selectedRowKeys, onClickSelectAll, isAll, indeterminate]);
34829
+ /** 选择了商品后 调整 折扣行 和 被折扣行 */
34830
+
34831
+ var sortOut = React.useCallback( /*#__PURE__*/function () {
34832
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(selected) {
34833
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
34834
+ while (1) {
34835
+ switch (_context8.prev = _context8.next) {
34836
+ case 0:
34837
+ _context8.next = 2;
34838
+ return controller.wait();
34839
+
34840
+ case 2:
34841
+ _context8.next = 4;
34842
+ return controller.pipeline( /*#__PURE__*/function () {
34843
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s) {
34844
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
34845
+ while (1) {
34846
+ switch (_context7.prev = _context7.next) {
34847
+ case 0:
34848
+ s.passengerListState.selectedGoodIndex.forEach(function ($index) {
34849
+ var goods = s.passengerListState.goodsMap.get($index);
34850
+ if (!goods) return; // 数组位置
34851
+
34852
+ var t = s.passengerListState.goodsList.indexOf(goods); // goods.lineAttribute === LineAttributeType.折扣行 ? t : t++;
34853
+
34854
+ var i = s.goodsListState.goodsList[t].$index;
34855
+
34856
+ if (selected) {
34857
+ if (s.passengerListState.selectedGoodIndex.indexOf(i) < 0) s.passengerListState.selectedGoodIndex = [].concat(_toConsumableArray(s.passengerListState.selectedGoodIndex), [i]);
34858
+ } else {
34859
+ if (s.passengerListState.selectedGoodIndex.indexOf(i) < 0) s.passengerListState.selectedGoodIndex = s.passengerListState.selectedGoodIndex.filter(function (e) {
34860
+ return e !== $index;
34861
+ });
34862
+ }
34863
+ });
34864
+
34865
+ case 1:
34866
+ case "end":
34867
+ return _context7.stop();
34868
+ }
34869
+ }
34870
+ }, _callee7);
34871
+ }));
34872
+
34873
+ return function (_x8) {
34874
+ return _ref8.apply(this, arguments);
34875
+ };
34876
+ }())();
34877
+
34878
+ case 4:
34879
+ case "end":
34880
+ return _context8.stop();
34881
+ }
34882
+ }
34883
+ }, _callee8);
34884
+ }));
34885
+
34886
+ return function (_x7) {
34887
+ return _ref7.apply(this, arguments);
34888
+ };
34889
+ }(), [controller]); // React.useEffect(() => {
34890
+ // sortOut(true);
34891
+ // }, [sortOut, goodsList])
34892
+
34893
+ if (isShow === false) return undefined;
34894
+ return {
34895
+ columnWidth: 45,
34896
+ columnTitle: columnTitle,
34897
+ onSelect: onSelect,
34898
+ selectedRowKeys: selectedRowKeys
34899
+ };
34900
+ });
34901
+
34902
+ var useDelRowButton$4 = (function () {
34903
+ var controller = Invoice.useInvoiceController();
34904
+ var model = controller.useMemo(function (s) {
34905
+ return s.model;
34906
+ }, []);
34907
+ var isRemRow = controller.useMemo(function (s) {
34908
+ return s.passengerListState.isRemRow;
34909
+ }, []);
34910
+ /** 是否禁用 */
34911
+
34912
+ var disabled = controller.useMemo(function (s) {
34913
+ if (s.passengerListState.selectedGoodIndex.length <= 0) return true;
34914
+ return false;
34915
+ }, []);
34916
+ /** 点击了删除 */
34917
+
34918
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
34919
+ var selectedGoodIndex, i;
34920
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
34921
+ while (1) {
34922
+ switch (_context2.prev = _context2.next) {
34923
+ case 0:
34924
+ selectedGoodIndex = controller.state.passengerListState.selectedGoodIndex.slice();
34925
+ i = 0;
34926
+
34927
+ case 2:
34928
+ if (!(i < selectedGoodIndex.length)) {
34929
+ _context2.next = 8;
34930
+ break;
34931
+ }
34932
+
34933
+ _context2.next = 5;
34934
+ return controller.delPassenger(selectedGoodIndex[i]);
34935
+
34936
+ case 5:
34937
+ i++;
34938
+ _context2.next = 2;
34939
+ break;
34940
+
34941
+ case 8:
34942
+ _context2.next = 10;
34943
+ return controller.run( /*#__PURE__*/function () {
34944
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
34945
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34946
+ while (1) {
34947
+ switch (_context.prev = _context.next) {
34948
+ case 0:
34949
+ s.passengerListState.selectedGoodIndex = [];
34950
+
34951
+ case 1:
34952
+ case "end":
34953
+ return _context.stop();
34954
+ }
34955
+ }
34956
+ }, _callee);
34957
+ }));
34958
+
34959
+ return function (_x) {
34960
+ return _ref2.apply(this, arguments);
34961
+ };
34962
+ }());
34963
+
34964
+ case 10:
34965
+ case "end":
34966
+ return _context2.stop();
34967
+ }
34968
+ }
34969
+ }, _callee2);
34970
+ })), []);
34971
+ var menuItem = React.useMemo(function () {
34972
+ if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
34973
+ if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
34974
+ return /*#__PURE__*/React.createElement(Menu$1.Item, {
34975
+ key: "1",
34976
+ onClick: onClick,
34977
+ disabled: disabled
34978
+ }, " \u5220\u9664\u884C ");
34979
+ }, [model, onClick, disabled]);
34980
+ var button = React.useMemo(function () {
34981
+ if (isRemRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
34982
+ if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
34983
+ if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
34984
+ return /*#__PURE__*/React.createElement(Button$1, {
34985
+ size: 'small',
34986
+ onClick: onClick,
34987
+ disabled: disabled
34988
+ }, "\u5220\u9664");
34989
+ }, [model, onClick, disabled, isRemRow]);
34990
+ return {
34991
+ button: button,
34992
+ menuItem: menuItem
34993
+ };
34994
+ });
34995
+
34996
+ var css_248z$E = ".kts-invoice-operate-freight {\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-freight .real-estate-info-digtal-label {\n padding: 20px 20px 0;\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-freight .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n.kts-invoice-operate-goods-list-digtal .goods-list-digtal-discount-tag {\n display: inline-block;\n height: 20px;\n line-height: 20px;\n border: 1px solid;\n padding: 0 5px;\n border-radius: 4px;\n}\n.kts-invoice-operate-goods-list-digtal .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list-digtal .kts-invoice-operate-freight-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 2px solid #9F613E;\n gap: 10px;\n align-items: center;\n}\n.kts-invoice-operate-goods-list-digtal .ktsAntX-table .ktsAntX-table-row.kts-invoice-operate-goods-be-discount .ktsAntX-table-cell {\n color: #f00;\n}\n.kts-invoice-operate-goods-list-table-digtal .ktsAnt3x-form-item-control.has-error {\n border: 1px solid #f00;\n}\n.kts-invoice-operate-goods-list-table-digtal .kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table-digtal .kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n";
34997
+ styleInject(css_248z$E);
34998
+
34999
+ var BatchImportButton = (function () {
35000
+ var controller = Invoice.useInvoiceController();
35001
+ var model = controller.useMemo(function (s) {
35002
+ return s.model;
35003
+ }, []);
35004
+ var rootElement = controller.useMemo(function (s) {
35005
+ return s.rootElement;
35006
+ }, []);
35007
+ /** 产品数据量 */
35008
+
35009
+ var goodsNum = controller.useMemo(function (s) {
35010
+ return s.passengerListState.goodsList.length;
35011
+ }, []);
35012
+ var isBatchImport = controller.useMemo(function (s) {
35013
+ return s.passengerListState.isBatchImport;
35014
+ }, []);
35015
+ /** 产品最大数 */
35016
+
35017
+ var goodMax = controller.useMemo(function (s) {
35018
+ return s.passengerListState.goodMax;
35019
+ }, []);
35020
+ /** 按钮是否禁用 */
35021
+
35022
+ var disabled = React.useMemo(function () {
35023
+ return typeof goodMax === 'number' ? goodsNum >= goodMax : false;
35024
+ }, [goodMax, goodsNum]);
35025
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
35026
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
35027
+ while (1) {
35028
+ switch (_context.prev = _context.next) {
35029
+ case 0:
35030
+ _context.next = 2;
35031
+ return importGood(controller);
35032
+
35033
+ case 2:
35034
+ _context.next = 4;
35035
+ return rollBottom$5(controller, rootElement);
35036
+
35037
+ case 4:
35038
+ case "end":
35039
+ return _context.stop();
35040
+ }
35041
+ }
35042
+ }, _callee);
35043
+ })), [controller, rootElement]);
35044
+ if (isBatchImport === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
35045
+ if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
35046
+ if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
35047
+ return /*#__PURE__*/React.createElement(Button$1, {
35048
+ size: 'small',
35049
+ onClick: onClick,
35050
+ disabled: disabled
35051
+ }, "\u6279\u91CF\u5BFC\u5165");
35052
+ });
35053
+ /** 导入 */
35054
+
35055
+ function importGood(_x) {
35056
+ return _importGood.apply(this, arguments);
35057
+ }
35058
+ /** 货物列表,滚动到底部 */
35059
+
35060
+
35061
+ function _importGood() {
35062
+ _importGood = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller) {
35063
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
35064
+ while (1) {
35065
+ switch (_context4.prev = _context4.next) {
35066
+ case 0:
35067
+ _context4.next = 2;
35068
+ return controller.saveEditPassenger();
35069
+
35070
+ case 2:
35071
+ _context4.next = 4;
35072
+ return controller.wait();
35073
+
35074
+ case 4:
35075
+ _context4.next = 6;
35076
+ return controller.run( /*#__PURE__*/function () {
35077
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
35078
+ var _controller$state$pas;
35079
+
35080
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
35081
+ while (1) {
35082
+ switch (_context3.prev = _context3.next) {
35083
+ case 0:
35084
+ if (!s.passengerListState.editGood) {
35085
+ _context3.next = 3;
35086
+ break;
35087
+ }
35088
+
35089
+ _context3.next = 3;
35090
+ return (_controller$state$pas = controller.state.passengerListState.form) === null || _controller$state$pas === void 0 ? void 0 : _controller$state$pas.validateFields( /*#__PURE__*/function () {
35091
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
35092
+ var firstError;
35093
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
35094
+ while (1) {
35095
+ switch (_context2.prev = _context2.next) {
35096
+ case 0:
35097
+ if (!err) {
35098
+ _context2.next = 4;
35099
+ break;
35100
+ }
35101
+
35102
+ firstError = Object.values(err)[0];
35103
+ message$1.error({
35104
+ content: firstError.errors[0].message,
35105
+ key: '你正在编辑一条数据'
35106
+ });
35107
+ return _context2.abrupt("return");
35108
+
35109
+ case 4:
35110
+ case "end":
35111
+ return _context2.stop();
35112
+ }
35113
+ }
35114
+ }, _callee2);
35115
+ }));
35116
+
35117
+ return function (_x5, _x6) {
35118
+ return _ref3.apply(this, arguments);
35119
+ };
35120
+ }());
35121
+
35122
+ case 3:
35123
+ s.passengerListState.isVisibleDrawer = true;
35124
+
35125
+ case 4:
35126
+ case "end":
35127
+ return _context3.stop();
35128
+ }
35129
+ }
35130
+ }, _callee3);
35131
+ }));
35132
+
35133
+ return function (_x4) {
35134
+ return _ref2.apply(this, arguments);
35135
+ };
35136
+ }());
35137
+
35138
+ case 6:
35139
+ case "end":
35140
+ return _context4.stop();
35141
+ }
35142
+ }
35143
+ }, _callee4);
35144
+ }));
35145
+ return _importGood.apply(this, arguments);
35146
+ }
35147
+
35148
+ function rollBottom$5(_x2, _x3) {
35149
+ return _rollBottom$5.apply(this, arguments);
35150
+ }
35151
+
35152
+ function _rollBottom$5() {
35153
+ _rollBottom$5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(controller, rootElement) {
35154
+ var cont;
35155
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
35156
+ while (1) {
35157
+ switch (_context5.prev = _context5.next) {
35158
+ case 0:
35159
+ _context5.next = 2;
35160
+ return controller.wait();
35161
+
35162
+ case 2:
35163
+ cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
35164
+
35165
+ if (cont) {
35166
+ _context5.next = 5;
35167
+ break;
35168
+ }
35169
+
35170
+ return _context5.abrupt("return");
35171
+
35172
+ case 5:
35173
+ cont.scrollTop = cont.scrollHeight;
35174
+
35175
+ case 6:
35176
+ case "end":
35177
+ return _context5.stop();
35178
+ }
35179
+ }
35180
+ }, _callee5);
35181
+ }));
35182
+ return _rollBottom$5.apply(this, arguments);
35183
+ }
35184
+
35185
+ var PassengerList = /*#__PURE__*/function (_React$Component) {
35186
+ _inherits(PassengerList, _React$Component);
35187
+
35188
+ var _super = _createSuper(PassengerList);
35189
+
35190
+ function PassengerList() {
35191
+ _classCallCheck(this, PassengerList);
35192
+
35193
+ return _super.apply(this, arguments);
35194
+ }
35195
+
35196
+ _createClass(PassengerList, [{
35197
+ key: "render",
35198
+ value: function render() {
35199
+ return /*#__PURE__*/React.createElement(Main$6, _objectSpread2({}, this.props));
35200
+ }
35201
+ }]);
35202
+
35203
+ return PassengerList;
35204
+ }(React.Component);
35205
+ var Main$6 = decorator(Form.create())(function (props) {
35206
+ var form = props.form;
35207
+
35208
+ var _React$useState = React.useState(typeof props.required === 'boolean' ? props.required : true),
35209
+ _React$useState2 = _slicedToArray(_React$useState, 2),
35210
+ isRequired = _React$useState2[0],
35211
+ setRequired = _React$useState2[1];
35212
+ /** 控制器 */
35213
+
35214
+
35215
+ var controller = Invoice.useInvoiceController();
35216
+ var goodsList = controller.useMemo(function (s) {
35217
+ return s.passengerListState.goodsList;
35218
+ }, []);
35219
+ /** 货物列表 */
35220
+
35221
+ var dataSource = controller.useMemo(function (s) {
35222
+ return s.passengerListState.goodsList;
35223
+ }, []);
35224
+ /** 表格行事件 */
35225
+
35226
+ var _onRow = useOnRow$4();
35227
+ /** 批量删除 */
35228
+
35229
+
35230
+ var delRowButton = useDelRowButton$4();
35231
+ useWindowClick$4(controller); // 点击组件外部 保存正在编辑的货物
35232
+
35233
+ /** 注册 from 对象 */
35234
+
35235
+ React.useEffect(function () {
35236
+ controller.pipeline( /*#__PURE__*/function () {
35237
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s, form) {
35238
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
35239
+ while (1) {
35240
+ switch (_context.prev = _context.next) {
35241
+ case 0:
35242
+ s.passengerListState = _objectSpread2(_objectSpread2({}, s.passengerListState), {}, {
35243
+ form: form
35244
+ });
35245
+
35246
+ case 1:
35247
+ case "end":
35248
+ return _context.stop();
35249
+ }
35250
+ }
35251
+ }, _callee);
35252
+ }));
35253
+
35254
+ return function (_x, _x2) {
35255
+ return _ref.apply(this, arguments);
35256
+ };
35257
+ }())(props.form);
35258
+ }, [controller, props.form]);
35259
+ React.useEffect(function () {
35260
+ controller.run( /*#__PURE__*/function () {
35261
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
35262
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
35263
+ while (1) {
35264
+ switch (_context2.prev = _context2.next) {
35265
+ case 0:
35266
+ s.passengerListState.addressFieldNames = props.fieldNames;
35267
+
35268
+ case 1:
35269
+ case "end":
35270
+ return _context2.stop();
35271
+ }
35272
+ }
35273
+ }, _callee2);
35274
+ }));
35275
+
35276
+ return function (_x3) {
35277
+ return _ref2.apply(this, arguments);
35278
+ };
35279
+ }());
35280
+ }, [props.fieldNames]);
35281
+ React.useEffect(function () {
35282
+ controller.run( /*#__PURE__*/function () {
35283
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
35284
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
35285
+ while (1) {
35286
+ switch (_context3.prev = _context3.next) {
35287
+ case 0:
35288
+ if (props.certificateTypeList) {
35289
+ s.passengerListState.certificateTypeList = props.certificateTypeList;
35290
+ }
35291
+
35292
+ if (props.vehicleTypeList) {
35293
+ s.passengerListState.vehicleTypeList = props.vehicleTypeList;
35294
+ }
35295
+
35296
+ case 2:
35297
+ case "end":
35298
+ return _context3.stop();
35299
+ }
35300
+ }
35301
+ }, _callee3);
35302
+ }));
35303
+
35304
+ return function (_x4) {
35305
+ return _ref3.apply(this, arguments);
35306
+ };
35307
+ }());
35308
+ }, [props.vehicleTypeList, props.certificateTypeList]);
35309
+ React.useEffect(function () {
35310
+ controller.run( /*#__PURE__*/function () {
35311
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
35312
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
35313
+ while (1) {
35314
+ switch (_context4.prev = _context4.next) {
35315
+ case 0:
35316
+ s.passengerListState.area = props.addressOptions;
35317
+
35318
+ case 1:
35319
+ case "end":
35320
+ return _context4.stop();
35321
+ }
35322
+ }
35323
+ }, _callee4);
35324
+ }));
35325
+
35326
+ return function (_x5) {
35327
+ return _ref4.apply(this, arguments);
35328
+ };
35329
+ }());
35330
+ }, [props.addressOptions]); // 跟新 货物
35331
+
35332
+ React.useEffect(function () {
35333
+ controller.run( /*#__PURE__*/function () {
35334
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
35335
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
35336
+ while (1) {
35337
+ switch (_context5.prev = _context5.next) {
35338
+ case 0:
35339
+ s.passengerListState.goodsMap = new Map();
35340
+ goodsList.forEach(function (e) {
35341
+ s.passengerListState.goodsMap.set(e.$index, e);
35342
+ });
35343
+
35344
+ case 2:
35345
+ case "end":
35346
+ return _context5.stop();
35347
+ }
35348
+ }
35349
+ }, _callee5);
35350
+ }));
35351
+
35352
+ return function (_x6) {
35353
+ return _ref5.apply(this, arguments);
35354
+ };
35355
+ }());
35356
+ }, [controller, goodsList]);
35357
+ /** props 产品最大数 更新 */
35358
+
35359
+ React.useEffect(function () {
35360
+ controller.pipeline( /*#__PURE__*/function () {
35361
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
35362
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
35363
+ while (1) {
35364
+ switch (_context6.prev = _context6.next) {
35365
+ case 0:
35366
+ s.passengerListState.goodMax = props.goodMax;
35367
+
35368
+ case 1:
35369
+ case "end":
35370
+ return _context6.stop();
35371
+ }
35372
+ }
35373
+ }, _callee6);
35374
+ }));
35375
+
35376
+ return function (_x7) {
35377
+ return _ref6.apply(this, arguments);
35378
+ };
35379
+ }())();
35380
+ }, [controller, props.goodMax]); // 注册 form
35381
+ // controller.useForm('freightInfo', form);
35382
+
35383
+ return /*#__PURE__*/React.createElement("div", {
35384
+ className: "kts-invoice-operate-freight"
35385
+ }, /*#__PURE__*/React.createElement("div", {
35386
+ className: 'real-estate-info-digtal-label'
35387
+ }, "\u7279\u5B9A\u4FE1\u606F-\u65C5\u5BA2\u8FD0\u8F93\u670D\u52A1"), /*#__PURE__*/React.createElement("div", {
35388
+ className: "kts-invoice-operate-goods-list-digtal",
35389
+ onClick: function onClick(e) {
35390
+ e.stopPropagation();
35391
+ }
35392
+ }, /*#__PURE__*/React.createElement("div", {
35393
+ className: "kts-invoice-operate-freight-list-able"
35394
+ }, /*#__PURE__*/React.createElement(AddRowButton$4, null), delRowButton.button, /*#__PURE__*/React.createElement(BatchImportButton, null), /*#__PURE__*/React.createElement("div", {
35395
+ style: {
35396
+ flex: 1
35397
+ }
35398
+ })), /*#__PURE__*/React.createElement("div", {
35399
+ className: classnames('kts-invoice-operate-goods-list-table-digtal')
35400
+ }, /*#__PURE__*/React.createElement(TableVirtual$4, {
35401
+ size: "small",
35402
+ rowKey: "$index",
35403
+ pagination: false,
35404
+ scroll: {
35405
+ y: 280
35406
+ },
35407
+ components: {
35408
+ body: {
35409
+ row: TableRow$4
35410
+ }
35411
+ },
35412
+ dataSource: dataSource,
35413
+ columns: useColumns$4(props.form, isRequired),
35414
+ rowSelection: useRowSelection$4(),
35415
+ onRow: function onRow(record) {
35416
+ return {
35417
+ onClick: function onClick() {
35418
+ _onRow.onClick(record);
35419
+ }
35420
+ };
35421
+ }
35422
+ }))));
35423
+ });
35424
+
31970
35425
  // const config = {
31971
35426
  // number: 'BigNumber',
31972
35427
  // precision: 64,
@@ -32030,7 +35485,7 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
32030
35485
  if (this.props.invoiceType === 'digtal') {
32031
35486
  return /*#__PURE__*/React.createElement(Digtal, _objectSpread2({}, this.props));
32032
35487
  } else {
32033
- return /*#__PURE__*/React.createElement(Main$6, _objectSpread2({}, this.props));
35488
+ return /*#__PURE__*/React.createElement(Main$7, _objectSpread2({}, this.props));
32034
35489
  }
32035
35490
  }
32036
35491
  }]);
@@ -32054,6 +35509,7 @@ Invoice.RealEstateInfo = RealEstateInfo;
32054
35509
  Invoice.RealEstateSales = RealEstateSales;
32055
35510
  Invoice.Architecture = Architecture;
32056
35511
  Invoice.FreightList = FreightList;
35512
+ Invoice.PassengerList = PassengerList;
32057
35513
  Invoice.PayList = PayList;
32058
35514
  Invoice.GoodsListDigtal = GoodsList$1;
32059
35515
  Invoice.idGenerator = idGenerator;
@@ -32064,7 +35520,7 @@ Invoice.useInvoiceController = function () {
32064
35520
  return React.useContext(InvoiceContext);
32065
35521
  };
32066
35522
 
32067
- var Main$6 = function Main(props) {
35523
+ var Main$7 = function Main(props) {
32068
35524
  var controller = React.useMemo(function () {
32069
35525
  return props.controller || new InvoiceController();
32070
35526
  }, [props.controller]);
@@ -32173,11 +35629,11 @@ var Digtal = function Digtal(props) {
32173
35629
  /** 特殊信息 */
32174
35630
  , props.sign || /*#__PURE__*/React.createElement(SignDigtal, null)
32175
35631
  /** 落款 */
32176
- ), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(MeiTanModal, null), " ");
35632
+ ), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(ImportPassengerDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(MeiTanModal, null), " ");
32177
35633
  };
32178
35634
 
32179
- var css_248z$C = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
32180
- styleInject(css_248z$C);
35635
+ var css_248z$F = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
35636
+ styleInject(css_248z$F);
32181
35637
 
32182
35638
  function TaxClassificationModal(props) {
32183
35639
  var _props$info6;
@@ -32308,7 +35764,7 @@ function TaxClassificationModal(props) {
32308
35764
  },
32309
35765
  loadData: props.onLoad,
32310
35766
  treeData: props.list,
32311
- switcherIcon: /*#__PURE__*/React.createElement(Icon$1, {
35767
+ switcherIcon: /*#__PURE__*/React.createElement(Icon$2, {
32312
35768
  type: "down"
32313
35769
  })
32314
35770
  }))), /*#__PURE__*/React.createElement(Card, {