kts-component-invoice-operate 3.2.175 → 3.2.176

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 (59) hide show
  1. package/dist/Invoice/Invoice-digtal/_test/freight/index.d.ts +4 -0
  2. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.d.ts +6 -0
  3. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.d.ts +23 -0
  4. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.d.ts +21 -0
  5. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.d.ts +31 -0
  6. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +5 -0
  7. package/dist/Invoice/InvoiceController/fns/addFreight.d.ts +6 -0
  8. package/dist/Invoice/InvoiceController/fns/delFreight.d.ts +6 -0
  9. package/dist/Invoice/InvoiceController/fns/saveEditFreight.d.ts +6 -0
  10. package/dist/Invoice/InvoiceController/fns/setEditFreight.d.ts +6 -0
  11. package/dist/Invoice/InvoiceController/fns/setFreight.d.ts +6 -0
  12. package/dist/Invoice/InvoiceController/index.d.ts +10 -0
  13. package/dist/Invoice/index.d.ts +2 -0
  14. package/dist/Invoice/ui/digtal/FreightList/hook/useColumns/index.d.ts +3 -0
  15. package/dist/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
  16. package/dist/Invoice/ui/digtal/FreightList/hook/useOnRow/index.d.ts +8 -0
  17. package/dist/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.d.ts +8 -0
  18. package/dist/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.d.ts +8 -0
  19. package/dist/Invoice/ui/digtal/FreightList/index.d.ts +9 -0
  20. package/dist/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.d.ts +3 -0
  21. package/dist/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
  22. package/dist/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
  23. package/dist/Invoice/ui/digtal/FreightList/ui/TableRow/index.d.ts +3 -0
  24. package/dist/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.d.ts +4 -0
  25. package/dist/index.esm.js +1683 -31
  26. package/dist/index.js +1683 -31
  27. package/package.json +1 -1
  28. package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +14564 -0
  29. package/src/Invoice/Invoice-digtal/index.md +5 -2
  30. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.ts +10 -0
  31. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.ts +33 -0
  32. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.ts +81 -0
  33. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.ts +40 -0
  34. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +6 -0
  35. package/src/Invoice/InvoiceController/fns/addFreight.ts +11 -0
  36. package/src/Invoice/InvoiceController/fns/delFreight.ts +38 -0
  37. package/src/Invoice/InvoiceController/fns/saveEditFreight.ts +24 -0
  38. package/src/Invoice/InvoiceController/fns/setEditFreight.ts +16 -0
  39. package/src/Invoice/InvoiceController/fns/setFreight.ts +11 -0
  40. package/src/Invoice/InvoiceController/index.ts +20 -1
  41. package/src/Invoice/index.tsx +3 -0
  42. package/src/Invoice/tools/useToGenerateId/index.ts +2 -0
  43. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/dist/index.js +616 -0
  44. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/index.tsx +246 -0
  45. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.tsx +20 -0
  46. package/src/Invoice/ui/digtal/FreightList/hook/useOnRow/index.tsx +37 -0
  47. package/src/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.tsx +120 -0
  48. package/src/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.tsx +23 -0
  49. package/src/Invoice/ui/digtal/FreightList/index.less +74 -0
  50. package/src/Invoice/ui/digtal/FreightList/index.tsx +108 -0
  51. package/src/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.tsx +65 -0
  52. package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
  53. package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +37 -0
  54. package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.less +29 -0
  55. package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.tsx +21 -0
  56. package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.less +39 -0
  57. package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.tsx +109 -0
  58. package/src/Invoice/ui/digtal/GoodsList/index.tsx +0 -1
  59. package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.tsx +0 -1
package/dist/index.esm.js CHANGED
@@ -4,8 +4,8 @@ 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
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';
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, Tooltip as Tooltip$1, Checkbox as Checkbox$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, Tree as Tree$1, Card, FormReadOnly } from 'kts-xui';
8
- import classNames from 'classnames';
7
+ import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Button as Button$1, Dropdown as Dropdown$1, Row, Col, Tooltip as Tooltip$1, Checkbox as Checkbox$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';
8
+ import classnames from 'classnames';
9
9
  import { Table } from 'kts-components-antd-x4-v4';
10
10
  import { render } from 'react-dom';
11
11
  import { DatePicker, Row as Row$1, Col as Col$1, Cascader, Input as Input$2, Select as Select$2 } from 'kts-components-antd-x4';
@@ -1130,6 +1130,26 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1130
1130
  this.drag = new Drag();
1131
1131
  });
1132
1132
 
1133
+ var FreightListState = /*#__PURE__*/_createClass(function FreightListState() {
1134
+ _classCallCheck(this, FreightListState);
1135
+
1136
+ this.goodMax = void 0;
1137
+ this.editGood = void 0;
1138
+ this.isAddRow = true;
1139
+ this.isRemRow = true;
1140
+ this.goodsMap = new Map();
1141
+ this.form = void 0;
1142
+ this.vehicleTypeList = [];
1143
+ this.goodsList = [];
1144
+ this.selectedGoodIndex = [];
1145
+ this.area = [];
1146
+ this.addressFieldNames = {
1147
+ label: 'label',
1148
+ value: 'value',
1149
+ children: 'children'
1150
+ };
1151
+ });
1152
+
1133
1153
  var BuyerState = /*#__PURE__*/_createClass(function BuyerState() {
1134
1154
  _classCallCheck(this, BuyerState);
1135
1155
 
@@ -1221,6 +1241,7 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
1221
1241
  this.typeModalProps = void 0;
1222
1242
  this.autoComplete = new AutoComplete();
1223
1243
  this.taxClassificationProps = void 0;
1244
+ this.freightListState = new FreightListState();
1224
1245
  });
1225
1246
 
1226
1247
  /**
@@ -1257,6 +1278,40 @@ var setEditGood = /*#__PURE__*/(function () {
1257
1278
  };
1258
1279
  })();
1259
1280
 
1281
+ /**
1282
+ * 设置当前的编辑货物运输
1283
+ */
1284
+ var setEditFreight = /*#__PURE__*/(function () {
1285
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, newEditGood) {
1286
+ var editGood;
1287
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1288
+ while (1) {
1289
+ switch (_context.prev = _context.next) {
1290
+ case 0:
1291
+ if (newEditGood) {
1292
+ editGood = state.freightListState.editGood;
1293
+ state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
1294
+ editGood: _objectSpread2(_objectSpread2({}, editGood), newEditGood)
1295
+ });
1296
+ } else {
1297
+ state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
1298
+ editGood: undefined
1299
+ });
1300
+ }
1301
+
1302
+ case 1:
1303
+ case "end":
1304
+ return _context.stop();
1305
+ }
1306
+ }
1307
+ }, _callee);
1308
+ }));
1309
+
1310
+ return function (_x, _x2) {
1311
+ return _ref.apply(this, arguments);
1312
+ };
1313
+ })();
1314
+
1260
1315
  /**
1261
1316
  * 设置单个货物属性
1262
1317
  */
@@ -1295,6 +1350,44 @@ var setGoods = /*#__PURE__*/(function () {
1295
1350
  };
1296
1351
  })();
1297
1352
 
1353
+ /**
1354
+ * 设置单个货物属性
1355
+ */
1356
+ var setFreight = /*#__PURE__*/(function () {
1357
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
1358
+ var goodsList;
1359
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1360
+ while (1) {
1361
+ switch (_context.prev = _context.next) {
1362
+ case 0:
1363
+ if (!(!options || !options.$index)) {
1364
+ _context.next = 2;
1365
+ break;
1366
+ }
1367
+
1368
+ return _context.abrupt("return");
1369
+
1370
+ case 2:
1371
+ goodsList = state.freightListState.goodsList.map(function (e) {
1372
+ return e.$index === options.$index ? _objectSpread2(_objectSpread2({}, e), options) : e;
1373
+ });
1374
+ state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
1375
+ goodsList: goodsList
1376
+ });
1377
+
1378
+ case 4:
1379
+ case "end":
1380
+ return _context.stop();
1381
+ }
1382
+ }
1383
+ }, _callee);
1384
+ }));
1385
+
1386
+ return function (_x, _x2) {
1387
+ return _ref.apply(this, arguments);
1388
+ };
1389
+ })();
1390
+
1298
1391
  /**
1299
1392
  * 删除一个货物
1300
1393
  */
@@ -1379,6 +1472,87 @@ var delGood = /*#__PURE__*/(function () {
1379
1472
  };
1380
1473
  })();
1381
1474
 
1475
+ /**
1476
+ * 删除一个货物运输
1477
+ */
1478
+ var delFreight = /*#__PURE__*/(function () {
1479
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, $index) {
1480
+ var goods, goodsList, goodsMap, i;
1481
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1482
+ while (1) {
1483
+ switch (_context.prev = _context.next) {
1484
+ case 0:
1485
+ if ($index) {
1486
+ _context.next = 2;
1487
+ break;
1488
+ }
1489
+
1490
+ return _context.abrupt("return");
1491
+
1492
+ case 2:
1493
+ // 查下要删除的货物
1494
+ goods = state.freightListState.goodsList.filter(function (e) {
1495
+ return e.$index === $index;
1496
+ })[0];
1497
+
1498
+ if (goods) {
1499
+ _context.next = 5;
1500
+ break;
1501
+ }
1502
+
1503
+ return _context.abrupt("return");
1504
+
1505
+ case 5:
1506
+ // 如果正在编辑 就取消编辑
1507
+ if (state.freightListState.editGood && state.freightListState.editGood.$index === $index) {
1508
+ state.freightListState.editGood = undefined;
1509
+ }
1510
+
1511
+ goodsList = state.freightListState.goodsList;
1512
+ goodsMap = state.freightListState.goodsMap;
1513
+ goodsMap.delete($index);
1514
+ i = 0;
1515
+
1516
+ case 10:
1517
+ if (!(i < goodsList.length)) {
1518
+ _context.next = 17;
1519
+ break;
1520
+ }
1521
+
1522
+ if (!(goodsList[i].$index === $index)) {
1523
+ _context.next = 14;
1524
+ break;
1525
+ }
1526
+
1527
+ // const good = goodsList[i];
1528
+ // if (good.lineAttribute === LineAttributeType.折扣行 && goodsList[i - 1] && goodsList[i - 1].lineAttribute === LineAttributeType.被折扣行) {
1529
+ // goodsList[i - 1].lineAttribute = LineAttributeType.正常;
1530
+ // }
1531
+ goodsList.splice(i, 1);
1532
+ return _context.abrupt("break", 17);
1533
+
1534
+ case 14:
1535
+ i++;
1536
+ _context.next = 10;
1537
+ break;
1538
+
1539
+ case 17:
1540
+ state.freightListState.goodsList = _toConsumableArray(goodsList);
1541
+ state.freightListState.goodsMap = new Map(goodsMap);
1542
+
1543
+ case 19:
1544
+ case "end":
1545
+ return _context.stop();
1546
+ }
1547
+ }
1548
+ }, _callee);
1549
+ }));
1550
+
1551
+ return function (_x, _x2) {
1552
+ return _ref.apply(this, arguments);
1553
+ };
1554
+ })();
1555
+
1382
1556
  var idGenerator = (function () {
1383
1557
  return v4();
1384
1558
  });
@@ -1744,6 +1918,33 @@ var addGood = /*#__PURE__*/(function () {
1744
1918
  };
1745
1919
  })();
1746
1920
 
1921
+ /**
1922
+ * 添加的编辑货物运输
1923
+ */
1924
+
1925
+ var addFreight = /*#__PURE__*/(function () {
1926
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
1927
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1928
+ while (1) {
1929
+ switch (_context.prev = _context.next) {
1930
+ case 0:
1931
+ options.$index = idGenerator();
1932
+ state.freightListState.goodsList = [].concat(_toConsumableArray(state.freightListState.goodsList), [options]);
1933
+ return _context.abrupt("return", options);
1934
+
1935
+ case 3:
1936
+ case "end":
1937
+ return _context.stop();
1938
+ }
1939
+ }
1940
+ }, _callee);
1941
+ }));
1942
+
1943
+ return function (_x, _x2) {
1944
+ return _ref.apply(this, arguments);
1945
+ };
1946
+ })();
1947
+
1747
1948
  /**
1748
1949
  * 保存正在编辑的货物
1749
1950
  */
@@ -1823,6 +2024,85 @@ var validateFields = function validateFields(form) {
1823
2024
  });
1824
2025
  };
1825
2026
 
2027
+ /**
2028
+ * 保存正在编辑的货物
2029
+ */
2030
+ var saveEditFreight = /*#__PURE__*/(function () {
2031
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state) {
2032
+ var editGood, form;
2033
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2034
+ while (1) {
2035
+ switch (_context.prev = _context.next) {
2036
+ case 0:
2037
+ editGood = state.freightListState.editGood;
2038
+ form = state.freightListState.form;
2039
+
2040
+ if (!(!editGood || !form)) {
2041
+ _context.next = 4;
2042
+ break;
2043
+ }
2044
+
2045
+ return _context.abrupt("return");
2046
+
2047
+ case 4:
2048
+ _context.next = 6;
2049
+ return validateFields$1(form);
2050
+
2051
+ case 6:
2052
+ if (!_context.sent.err) {
2053
+ _context.next = 8;
2054
+ break;
2055
+ }
2056
+
2057
+ return _context.abrupt("return");
2058
+
2059
+ case 8:
2060
+ state.freightListState.goodsList = state.freightListState.goodsList.map(function (e) {
2061
+ return e.$index === editGood.$index ? _objectSpread2(_objectSpread2({}, e), editGood) : e;
2062
+ });
2063
+ state.freightListState.editGood = undefined;
2064
+
2065
+ case 10:
2066
+ case "end":
2067
+ return _context.stop();
2068
+ }
2069
+ }
2070
+ }, _callee);
2071
+ }));
2072
+
2073
+ return function (_x) {
2074
+ return _ref.apply(this, arguments);
2075
+ };
2076
+ })();
2077
+
2078
+ var validateFields$1 = function validateFields(form) {
2079
+ return new Promise(function (resolve) {
2080
+ form.validateFields( /*#__PURE__*/function () {
2081
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
2082
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2083
+ while (1) {
2084
+ switch (_context2.prev = _context2.next) {
2085
+ case 0:
2086
+ resolve({
2087
+ err: err,
2088
+ values: values
2089
+ });
2090
+
2091
+ case 1:
2092
+ case "end":
2093
+ return _context2.stop();
2094
+ }
2095
+ }
2096
+ }, _callee2);
2097
+ }));
2098
+
2099
+ return function (_x2, _x3) {
2100
+ return _ref2.apply(this, arguments);
2101
+ };
2102
+ }());
2103
+ });
2104
+ };
2105
+
1826
2106
  /**
1827
2107
  * 计算搜索商品
1828
2108
  * @param goodsList 被搜索列表
@@ -9729,10 +10009,15 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
9729
10009
  _this.updateInvoiceNo = void 0;
9730
10010
  _this.getBuyerList = void 0;
9731
10011
  _this.setGoods = _this.pipeline(setGoods);
10012
+ _this.setFreight = _this.pipeline(setFreight);
10013
+ _this.setEditFreight = _this.pipeline(setEditFreight);
9732
10014
  _this.setEditGood = _this.pipeline(setEditGood);
9733
10015
  _this.saveEditGood = _this.pipeline(saveEditGood);
10016
+ _this.saveEditFreight = _this.pipeline(saveEditFreight);
9734
10017
  _this.delGood = _this.pipeline(delGood);
10018
+ _this.delFreight = _this.pipeline(delFreight);
9735
10019
  _this.addGood = _this.pipeline(addGood);
10020
+ _this.addFreight = _this.pipeline(addFreight);
9736
10021
  _this.mergeDetails = _this.pipeline(mergeDetails);
9737
10022
  _this.mergeDiscount = _this.pipeline(mergeDiscount);
9738
10023
  _this.addGoodDiscount = _this.pipeline(addGoodDiscount);
@@ -9764,6 +10049,14 @@ function useToGenerateId(controller) {
9764
10049
  e.serialNo = i + 1;
9765
10050
  });
9766
10051
  }, [goodsList]);
10052
+ var freightList = controller.useMemo(function (s) {
10053
+ return s.freightListState.goodsList;
10054
+ }, []);
10055
+ React.useEffect(function () {
10056
+ freightList.forEach(function (e, i) {
10057
+ e.sortNumber = i + 1;
10058
+ });
10059
+ }, [freightList]);
9767
10060
  }
9768
10061
 
9769
10062
  var Nzh = require("nzh");
@@ -10751,7 +11044,7 @@ function TableRow(props) {
10751
11044
  bottom: 0
10752
11045
  }
10753
11046
  })) : /*#__PURE__*/React.createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
10754
- className: classNames(props.className, discount, expandedRow, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
11047
+ className: classnames(props.className, discount, expandedRow, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
10755
11048
  }));
10756
11049
  }
10757
11050
 
@@ -12635,8 +12928,8 @@ var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
12635
12928
  _React$useContext$pre = _React$useContext.prefixCls,
12636
12929
  prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre;
12637
12930
 
12638
- var classString = classNames(prefixCls, className);
12639
- var svgClassString = classNames(_defineProperty$1({}, "".concat(prefixCls, "-spin"), !!spin));
12931
+ var classString = classnames(prefixCls, className);
12932
+ var svgClassString = classnames(_defineProperty$1({}, "".concat(prefixCls, "-spin"), !!spin));
12640
12933
  var svgStyle = rotate ? {
12641
12934
  msTransform: "rotate(".concat(rotate, "deg)"),
12642
12935
  transform: "rotate(".concat(rotate, "deg)")
@@ -16275,7 +16568,7 @@ var Main = decorator(Form.create())(function (props) {
16275
16568
  }, /*#__PURE__*/React.createElement(AddRowButton, null), endowCodeButton.button, delRowButton.button, mergeDetails.button, mergeDiscount.button, addDiscountRowButton.drawer, salesDiscount.button, salesGifts.button, /*#__PURE__*/React.createElement(Search, null)), /*#__PURE__*/React.createElement("div", {
16276
16569
  className: "kts-invoice-operate-goods-list-able-extend"
16277
16570
  }, props.menuExpansion, /*#__PURE__*/React.createElement(DescribeSwitch, null), /*#__PURE__*/React.createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React.createElement("div", {
16278
- className: classNames('kts-invoice-operate-goods-list-table', {
16571
+ className: classnames('kts-invoice-operate-goods-list-table', {
16279
16572
  'kts-invoice-operate-prefab': isprefab
16280
16573
  })
16281
16574
  }, /*#__PURE__*/React.createElement(TableVirtual, {
@@ -17192,7 +17485,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
17192
17485
  setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
17193
17486
  }, [props.isExpand]);
17194
17487
  return /*#__PURE__*/React.createElement("div", {
17195
- className: classNames("kts-invoice-operate-invoice-digtal-stakeholder", {
17488
+ className: classnames("kts-invoice-operate-invoice-digtal-stakeholder", {
17196
17489
  readOnly: readOnly
17197
17490
  })
17198
17491
  }, /*#__PURE__*/React.createElement("div", null, '购买方信息'.split('').map(function (e) {
@@ -17780,7 +18073,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
17780
18073
  setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
17781
18074
  }, [props.isExpand]);
17782
18075
  return /*#__PURE__*/React.createElement("div", {
17783
- className: classNames("kts-invoice-operate-invoice-digtal-stakeholder", {
18076
+ className: classnames("kts-invoice-operate-invoice-digtal-stakeholder", {
17784
18077
  readOnly: readOnly
17785
18078
  })
17786
18079
  }, /*#__PURE__*/React.createElement("div", null, '销售方信息'.split('').map(function (e) {
@@ -20247,7 +20540,7 @@ function TableRow$1(props) {
20247
20540
  /*#__PURE__*/
20248
20541
  // <tr {...props} className={classnames(props.className, discount, (rowKey === container && current) ? 'kts-invoice-operate-goods-list-itemName-drag-container' : '')} />
20249
20542
  React.createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
20250
- className: classNames(props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
20543
+ className: classnames(props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
20251
20544
  }));
20252
20545
  }
20253
20546
 
@@ -23647,7 +23940,7 @@ var Main$3 = decorator(Form.create())(function (props) {
23647
23940
  flex: 1
23648
23941
  }
23649
23942
  }), props.menuExpansion, reselectInvoiceType.button, emptyRefill.button), /*#__PURE__*/React.createElement("div", {
23650
- className: classNames('kts-invoice-operate-goods-list-table-digtal')
23943
+ className: classnames('kts-invoice-operate-goods-list-table-digtal')
23651
23944
  }, /*#__PURE__*/React.createElement(TableVirtual$1, {
23652
23945
  size: "small",
23653
23946
  rowKey: "$index",
@@ -24112,22 +24405,1380 @@ var MyNY$1 = /*#__PURE__*/function (_React$Component4) {
24112
24405
  return MyNY;
24113
24406
  }(React.Component);
24114
24407
 
24115
- var ImportBuyerDrawer = (function () {
24116
- var controller = Invoice.useInvoiceController();
24117
- var visible = controller.useMemo(function (s) {
24118
- return s.buyerState.isVisibleDrawer;
24119
- }, []);
24120
- var topExpand = controller.useMemo(function (s) {
24121
- return s.buyerState.topExpand;
24122
- }, []); // controller.pipeline(async s=>s.goodsListState.isTaxIncluded = true)()
24408
+ var css_248z$t = ".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";
24409
+ styleInject(css_248z$t);
24123
24410
 
24124
- var onClose = React.useCallback(function () {
24125
- controller.pipeline( /*#__PURE__*/function () {
24126
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
24127
- return _regeneratorRuntime().wrap(function _callee$(_context) {
24128
- while (1) {
24129
- switch (_context.prev = _context.next) {
24130
- case 0:
24411
+ function TableVirtual$2 (props) {
24412
+ var _props$dataSource2;
24413
+
24414
+ var _React$useState = React.useState(null),
24415
+ _React$useState2 = _slicedToArray(_React$useState, 2),
24416
+ self = _React$useState2[0],
24417
+ setSelf = _React$useState2[1];
24418
+
24419
+ var tableBody = React.useMemo(function () {
24420
+ if (!self) return;
24421
+ return self.querySelector('.ktsAntX-table-body');
24422
+ }, [self]);
24423
+ /** 显示指针 */
24424
+
24425
+ var _React$useState3 = React.useState(0),
24426
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
24427
+ pointer = _React$useState4[0],
24428
+ setPointer = _React$useState4[1];
24429
+ /** 行高 */
24430
+
24431
+
24432
+ var rowHeight = React.useMemo(function () {
24433
+ if (!self) return 50;
24434
+ var td = self.querySelector('.ktsAntX-table-tbody .ktsAntX-table-row');
24435
+ if (!td) return 50;
24436
+ return td.clientHeight;
24437
+ }, [self, props.dataSource]);
24438
+ /** 间隔容器 */
24439
+
24440
+ var placeholder = React.useMemo(function () {
24441
+ if (!self || !tableBody) return;
24442
+ var placeholder = tableBody.querySelector('.table-virtual-placeholder');
24443
+
24444
+ if (!placeholder) {
24445
+ placeholder = document.createElement('div');
24446
+ placeholder.className = 'table-virtual-placeholder';
24447
+ tableBody.appendChild(placeholder);
24448
+ }
24449
+
24450
+ return placeholder;
24451
+ }, [self, tableBody]); // 设置占位dom的搞
24452
+
24453
+ var placeholderHeight = React.useMemo(function () {
24454
+ if (!self || !rowHeight || !props.dataSource || !placeholder) return;
24455
+ var placeholderHeight = rowHeight * props.dataSource.length;
24456
+ placeholder.style.height = "".concat(placeholderHeight, "px");
24457
+ return placeholderHeight;
24458
+ }, [self, rowHeight, props.dataSource, placeholder]);
24459
+ /** 可以容纳的行数 */
24460
+
24461
+ var rowSize = React.useMemo(function () {
24462
+ if (!tableBody || !rowHeight) return 0;
24463
+ return Math.ceil(tableBody.clientHeight / rowHeight);
24464
+ }, [tableBody, rowHeight, placeholderHeight]); // 计算渲染的行
24465
+
24466
+ var dataSource = React.useMemo(function () {
24467
+ var _props$dataSource;
24468
+
24469
+ if (!props.dataSource) return [];
24470
+ if (props.dataSource.length < 10) return props.dataSource;
24471
+ if (!rowSize) return [props.dataSource[0]];
24472
+ return (_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.slice(pointer, pointer + 2 * rowSize);
24473
+ }, [props.dataSource, pointer, rowSize]); // 监听滚动
24474
+
24475
+ React.useEffect(function () {
24476
+ if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody || props.dataSource.length < 10) return;
24477
+
24478
+ var onScroll = function onScroll() {
24479
+ if (!props.dataSource || !tableBody) return;
24480
+ setPointer(Math.floor((props.dataSource.length - rowSize) * (tableBody.scrollTop / (placeholder.clientHeight - tableBody.clientHeight))));
24481
+ };
24482
+
24483
+ onScroll();
24484
+ tableBody.addEventListener('scroll', onScroll);
24485
+ return function () {
24486
+ tableBody.removeEventListener('scroll', onScroll);
24487
+ };
24488
+ }, [self, placeholder, props.dataSource, rowHeight, rowSize]); // 移动列表
24489
+
24490
+ React.useEffect(function () {
24491
+ if (!self) return;
24492
+ var table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table');
24493
+ if (!table) return;
24494
+ table.style.top = "".concat(pointer * rowHeight, "px");
24495
+ }, [pointer, self, rowHeight]);
24496
+ React.useEffect(function () {
24497
+ if (!self) return;
24498
+ var cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
24499
+ if (!cont) return;
24500
+ cont.scrollTop = 0;
24501
+ }, [(_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.length]);
24502
+ return /*#__PURE__*/React.createElement("span", {
24503
+ className: "kts-invoice-operate-goods-table-virtual",
24504
+ ref: function ref(e) {
24505
+ setSelf(e);
24506
+ }
24507
+ }, /*#__PURE__*/React.createElement(TableManual, _objectSpread2(_objectSpread2({}, props), {}, {
24508
+ dataSource: dataSource,
24509
+ // 新版本Table会有输入框无法连续输入的问题,先兼容老版本
24510
+ tableComponent: Table
24511
+ })));
24512
+ }
24513
+
24514
+ var AddRowButton$2 = (function () {
24515
+ var controller = Invoice.useInvoiceController();
24516
+ var model = controller.useMemo(function (s) {
24517
+ return s.model;
24518
+ }, []);
24519
+ var rootElement = controller.useMemo(function (s) {
24520
+ return s.rootElement;
24521
+ }, []);
24522
+ /** 产品数据量 */
24523
+
24524
+ var goodsNum = controller.useMemo(function (s) {
24525
+ return s.freightListState.goodsList.length;
24526
+ }, []);
24527
+ /** 搜索条件 */
24528
+
24529
+ var isAddRow = controller.useMemo(function (s) {
24530
+ return s.freightListState.isAddRow;
24531
+ }, []);
24532
+ /** 产品最大数 */
24533
+
24534
+ var goodMax = controller.useMemo(function (s) {
24535
+ return s.freightListState.goodMax;
24536
+ }, []);
24537
+ /** 按钮是否禁用 */
24538
+
24539
+ var disabled = React.useMemo(function () {
24540
+ return typeof goodMax === 'number' ? goodsNum >= goodMax : false;
24541
+ }, [goodMax, goodsNum]);
24542
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
24543
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
24544
+ while (1) {
24545
+ switch (_context.prev = _context.next) {
24546
+ case 0:
24547
+ _context.next = 2;
24548
+ return addGood$3(controller);
24549
+
24550
+ case 2:
24551
+ _context.next = 4;
24552
+ return rollBottom$2(controller, rootElement);
24553
+
24554
+ case 4:
24555
+ case "end":
24556
+ return _context.stop();
24557
+ }
24558
+ }
24559
+ }, _callee);
24560
+ })), [controller, rootElement]);
24561
+ if (isAddRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
24562
+ if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
24563
+ if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
24564
+ return /*#__PURE__*/React.createElement(Button$1, {
24565
+ size: 'small',
24566
+ type: 'primary',
24567
+ onClick: onClick,
24568
+ disabled: disabled
24569
+ }, "\u589E\u884C");
24570
+ });
24571
+ /** 添加一个空货物 */
24572
+
24573
+ function addGood$3(_x) {
24574
+ return _addGood$2.apply(this, arguments);
24575
+ }
24576
+ /** 货物列表,滚动到底部 */
24577
+
24578
+
24579
+ function _addGood$2() {
24580
+ _addGood$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(controller) {
24581
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
24582
+ while (1) {
24583
+ switch (_context3.prev = _context3.next) {
24584
+ case 0:
24585
+ _context3.next = 2;
24586
+ return controller.saveEditFreight();
24587
+
24588
+ case 2:
24589
+ _context3.next = 4;
24590
+ return controller.wait();
24591
+
24592
+ case 4:
24593
+ _context3.next = 6;
24594
+ return controller.run( /*#__PURE__*/function () {
24595
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
24596
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
24597
+ while (1) {
24598
+ switch (_context2.prev = _context2.next) {
24599
+ case 0:
24600
+ if (!s.freightListState.editGood) {
24601
+ _context2.next = 3;
24602
+ break;
24603
+ }
24604
+
24605
+ message$1.error({
24606
+ content: '你正在编辑一个货物运输行',
24607
+ key: '你正在编辑一个货物运输行'
24608
+ });
24609
+ return _context2.abrupt("return");
24610
+
24611
+ case 3:
24612
+ _context2.next = 5;
24613
+ return controller.addFreight({});
24614
+
24615
+ case 5:
24616
+ s.freightListState.editGood = _context2.sent;
24617
+
24618
+ case 6:
24619
+ case "end":
24620
+ return _context2.stop();
24621
+ }
24622
+ }
24623
+ }, _callee2);
24624
+ }));
24625
+
24626
+ return function (_x4) {
24627
+ return _ref2.apply(this, arguments);
24628
+ };
24629
+ }());
24630
+
24631
+ case 6:
24632
+ case "end":
24633
+ return _context3.stop();
24634
+ }
24635
+ }
24636
+ }, _callee3);
24637
+ }));
24638
+ return _addGood$2.apply(this, arguments);
24639
+ }
24640
+
24641
+ function rollBottom$2(_x2, _x3) {
24642
+ return _rollBottom$2.apply(this, arguments);
24643
+ }
24644
+
24645
+ function _rollBottom$2() {
24646
+ _rollBottom$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller, rootElement) {
24647
+ var cont;
24648
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
24649
+ while (1) {
24650
+ switch (_context4.prev = _context4.next) {
24651
+ case 0:
24652
+ _context4.next = 2;
24653
+ return controller.wait();
24654
+
24655
+ case 2:
24656
+ cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
24657
+
24658
+ if (cont) {
24659
+ _context4.next = 5;
24660
+ break;
24661
+ }
24662
+
24663
+ return _context4.abrupt("return");
24664
+
24665
+ case 5:
24666
+ cont.scrollTop = cont.scrollHeight;
24667
+
24668
+ case 6:
24669
+ case "end":
24670
+ return _context4.stop();
24671
+ }
24672
+ }
24673
+ }, _callee4);
24674
+ }));
24675
+ return _rollBottom$2.apply(this, arguments);
24676
+ }
24677
+
24678
+ var css_248z$u = ".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";
24679
+ styleInject(css_248z$u);
24680
+
24681
+ function TableRow$2(props) {
24682
+ var rowKey = props['data-row-key'];
24683
+ return /*#__PURE__*/React.createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
24684
+ className: classnames(props.className)
24685
+ }));
24686
+ }
24687
+
24688
+ var Text$6 = Typography.Text;
24689
+ var TitleText$2 = (function (props) {
24690
+ var rules = props.rules,
24691
+ children = props.children;
24692
+ var required = React.useMemo(function () {
24693
+ return (rules === null || rules === void 0 ? void 0 : rules.some(function (e) {
24694
+ return !!e.required;
24695
+ })) || props.required;
24696
+ }, [rules, props.required]);
24697
+ return /*#__PURE__*/React.createElement(React.Fragment, null, required ? /*#__PURE__*/React.createElement(Text$6, {
24698
+ type: "danger"
24699
+ }, "*") : /*#__PURE__*/React.createElement(React.Fragment, null), children);
24700
+ });
24701
+
24702
+ var useColumns$2 = (function (form) {
24703
+ var getFieldDecorator = form.getFieldDecorator;
24704
+ var controller = Invoice.useInvoiceController();
24705
+ var rootElement = controller.useMemo(function (s) {
24706
+ return s.rootElement;
24707
+ }, []);
24708
+ /** 组件模式 */
24709
+
24710
+ var model = controller.useMemo(function (e) {
24711
+ return e.model;
24712
+ }, []);
24713
+ /** 正在编辑的货物 */
24714
+
24715
+ var editGood = controller.useMemo(function (e) {
24716
+ return e.freightListState.editGood;
24717
+ }, []);
24718
+ /** 禁用字段 */
24719
+
24720
+ var disableds = controller.useMemo(function (e) {
24721
+ return e.stakeholder.disableds || [];
24722
+ }, []);
24723
+ /** 运输工具种类列表 */
24724
+
24725
+ var vehicleTypeList = controller.useMemo(function (e) {
24726
+ return e.freightListState.vehicleTypeList;
24727
+ }, []);
24728
+ var area = controller.useMemo(function (e) {
24729
+ return e.freightListState.area;
24730
+ }, []);
24731
+ var addressFieldNames = controller.useMemo(function (e) {
24732
+ return e.freightListState.addressFieldNames;
24733
+ }, []);
24734
+ var getVehicle = React.useCallback(function (value) {
24735
+ if (vehicleTypeList && vehicleTypeList.length > 0) {
24736
+ var _vehicleTypeList$find;
24737
+
24738
+ return ((_vehicleTypeList$find = vehicleTypeList.find(function (e) {
24739
+ return e.value === value;
24740
+ })) === null || _vehicleTypeList$find === void 0 ? void 0 : _vehicleTypeList$find.label) || '';
24741
+ }
24742
+ }, [vehicleTypeList]);
24743
+ var splitArea = React.useCallback(function (value) {
24744
+ if (value) {
24745
+ var _array = value.split(',');
24746
+
24747
+ return _array;
24748
+ } else {
24749
+ return [];
24750
+ }
24751
+ }, []);
24752
+ /** 表头 */
24753
+
24754
+ var columns = React.useMemo(function () {
24755
+ return [{
24756
+ title: '序号',
24757
+ key: 'sortNumber',
24758
+ dataIndex: 'sortNumber',
24759
+ width: 50,
24760
+ render: function render(e) {
24761
+ return /*#__PURE__*/React.createElement("span", {
24762
+ style: {
24763
+ padding: '0 10px'
24764
+ }
24765
+ }, e);
24766
+ }
24767
+ }, {
24768
+ title: /*#__PURE__*/React.createElement(TitleText$2, {
24769
+ required: true
24770
+ }, "\u8FD0\u8F93\u5DE5\u5177\u79CD\u7C7B"),
24771
+ key: 'type',
24772
+ render: function render(_, record) {
24773
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('type') && !(model === 'prefab')) {
24774
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('type', {
24775
+ initialValue: editGood.type,
24776
+ rules: [{
24777
+ required: true,
24778
+ message: '请输入'
24779
+ }]
24780
+ })( /*#__PURE__*/React.createElement(Select$1, {
24781
+ className: "kts-invoice-operate-goods-list-table-tax-rate",
24782
+ showArrow: false,
24783
+ style: {
24784
+ width: '100%'
24785
+ },
24786
+ getPopupContainer: function getPopupContainer() {
24787
+ return rootElement || document.body;
24788
+ },
24789
+ onChange: function () {
24790
+ var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
24791
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
24792
+ while (1) {
24793
+ switch (_context.prev = _context.next) {
24794
+ case 0:
24795
+ _context.next = 2;
24796
+ return controller.wait();
24797
+
24798
+ case 2:
24799
+ controller.setEditFreight({
24800
+ type: value
24801
+ });
24802
+
24803
+ case 3:
24804
+ case "end":
24805
+ return _context.stop();
24806
+ }
24807
+ }
24808
+ }, _callee);
24809
+ }));
24810
+
24811
+ function onChange(_x) {
24812
+ return _onChange.apply(this, arguments);
24813
+ }
24814
+
24815
+ return onChange;
24816
+ }()
24817
+ }, (record.vehicleList || vehicleTypeList).map(function (e, i) {
24818
+ return /*#__PURE__*/React.createElement(Select$1.Option, {
24819
+ key: i,
24820
+ value: e.value
24821
+ }, e.label);
24822
+ }))));
24823
+ } else {
24824
+ return /*#__PURE__*/React.createElement("span", {
24825
+ style: {
24826
+ padding: '0 10px'
24827
+ }
24828
+ }, getVehicle(record.type));
24829
+ }
24830
+ }
24831
+ }, {
24832
+ title: /*#__PURE__*/React.createElement(TitleText$2, {
24833
+ required: true
24834
+ }, "\u8FD0\u8F93\u5DE5\u5177\u724C\u53F7"),
24835
+ key: 'licensePlate',
24836
+ width: 119,
24837
+ render: function render(_, record) {
24838
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('licensePlate') && model !== 'prefab') {
24839
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('licensePlate', {
24840
+ initialValue: editGood.licensePlate,
24841
+ rules: [{
24842
+ required: true,
24843
+ message: '请输入'
24844
+ }]
24845
+ })( /*#__PURE__*/React.createElement(MyInput$4, {
24846
+ maxLength: 200,
24847
+ onChange: function () {
24848
+ var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
24849
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
24850
+ while (1) {
24851
+ switch (_context2.prev = _context2.next) {
24852
+ case 0:
24853
+ _context2.next = 2;
24854
+ return controller.wait();
24855
+
24856
+ case 2:
24857
+ _context2.next = 4;
24858
+ return controller.setEditFreight({
24859
+ licensePlate: form.getFieldsValue().licensePlate
24860
+ });
24861
+
24862
+ case 4:
24863
+ case "end":
24864
+ return _context2.stop();
24865
+ }
24866
+ }
24867
+ }, _callee2);
24868
+ }));
24869
+
24870
+ function onChange() {
24871
+ return _onChange2.apply(this, arguments);
24872
+ }
24873
+
24874
+ return onChange;
24875
+ }()
24876
+ })));
24877
+ } else {
24878
+ return /*#__PURE__*/React.createElement("span", {
24879
+ style: {
24880
+ padding: '0 10px'
24881
+ }
24882
+ }, record.licensePlate);
24883
+ }
24884
+ }
24885
+ }, {
24886
+ title: /*#__PURE__*/React.createElement(TitleText$2, {
24887
+ required: true
24888
+ }, "\u8D77\u8FD0\u5730"),
24889
+ key: 'origin',
24890
+ width: 150,
24891
+ render: function render(_, record) {
24892
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('origin') && model !== 'prefab') {
24893
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('origin', {
24894
+ initialValue: editGood.origin,
24895
+ rules: [{
24896
+ required: true,
24897
+ message: '请输入'
24898
+ }]
24899
+ })( /*#__PURE__*/React.createElement(Cascader$1, {
24900
+ style: {
24901
+ width: '100%'
24902
+ },
24903
+ options: area,
24904
+ fieldNames: addressFieldNames,
24905
+ onChange: function () {
24906
+ var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value) {
24907
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
24908
+ while (1) {
24909
+ switch (_context3.prev = _context3.next) {
24910
+ case 0:
24911
+ _context3.next = 2;
24912
+ return controller.setEditFreight({
24913
+ origin: value
24914
+ });
24915
+
24916
+ case 2:
24917
+ case "end":
24918
+ return _context3.stop();
24919
+ }
24920
+ }
24921
+ }, _callee3);
24922
+ }));
24923
+
24924
+ function onChange(_x2) {
24925
+ return _onChange3.apply(this, arguments);
24926
+ }
24927
+
24928
+ return onChange;
24929
+ }()
24930
+ })));
24931
+ } else {
24932
+ return /*#__PURE__*/React.createElement("span", {
24933
+ style: {
24934
+ padding: '0 10px'
24935
+ }
24936
+ }, record.origin);
24937
+ }
24938
+ }
24939
+ }, {
24940
+ title: /*#__PURE__*/React.createElement(TitleText$2, {
24941
+ required: true
24942
+ }, "\u5230\u8FBE\u5730"),
24943
+ dataIndex: 'destination',
24944
+ key: 'destination',
24945
+ width: 149,
24946
+ render: function render(_, record) {
24947
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('destination') && model !== 'prefab') {
24948
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('destination', {
24949
+ initialValue: editGood.destination,
24950
+ rules: [{
24951
+ required: true,
24952
+ message: '请输入'
24953
+ }]
24954
+ })( /*#__PURE__*/React.createElement(Cascader$1, {
24955
+ options: area,
24956
+ fieldNames: addressFieldNames,
24957
+ style: {
24958
+ width: '100%'
24959
+ },
24960
+ onChange: function () {
24961
+ var _onChange4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(value) {
24962
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
24963
+ while (1) {
24964
+ switch (_context4.prev = _context4.next) {
24965
+ case 0:
24966
+ _context4.next = 2;
24967
+ return controller.setEditFreight({
24968
+ destination: value
24969
+ });
24970
+
24971
+ case 2:
24972
+ case "end":
24973
+ return _context4.stop();
24974
+ }
24975
+ }
24976
+ }, _callee4);
24977
+ }));
24978
+
24979
+ function onChange(_x3) {
24980
+ return _onChange4.apply(this, arguments);
24981
+ }
24982
+
24983
+ return onChange;
24984
+ }()
24985
+ })));
24986
+ } else {
24987
+ return /*#__PURE__*/React.createElement("span", {
24988
+ style: {
24989
+ padding: '0 10px'
24990
+ }
24991
+ }, record.destination);
24992
+ }
24993
+ }
24994
+ }, {
24995
+ title: /*#__PURE__*/React.createElement(TitleText$2, {
24996
+ required: true
24997
+ }, "\u8FD0\u8F93\u8D27\u7269\u540D\u79F0"),
24998
+ dataIndex: 'itemName',
24999
+ key: 'itemName',
25000
+ width: 149,
25001
+ render: function render(_, record) {
25002
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('itemName') && model !== 'prefab') {
25003
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('itemName', {
25004
+ initialValue: editGood.itemName,
25005
+ rules: [{
25006
+ required: true,
25007
+ message: '请输入货物名称'
25008
+ }]
25009
+ })( /*#__PURE__*/React.createElement(MyInput$4, {
25010
+ maxLength: 200,
25011
+ onChange: function () {
25012
+ var _onChange5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
25013
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
25014
+ while (1) {
25015
+ switch (_context5.prev = _context5.next) {
25016
+ case 0:
25017
+ _context5.next = 2;
25018
+ return controller.wait();
25019
+
25020
+ case 2:
25021
+ _context5.next = 4;
25022
+ return controller.setEditFreight({
25023
+ itemName: form.getFieldsValue().itemName
25024
+ });
25025
+
25026
+ case 4:
25027
+ case "end":
25028
+ return _context5.stop();
25029
+ }
25030
+ }
25031
+ }, _callee5);
25032
+ }));
25033
+
25034
+ function onChange() {
25035
+ return _onChange5.apply(this, arguments);
25036
+ }
25037
+
25038
+ return onChange;
25039
+ }()
25040
+ })));
25041
+ } else {
25042
+ return /*#__PURE__*/React.createElement("span", {
25043
+ style: {
25044
+ padding: '0 10px'
25045
+ }
25046
+ }, record.itemName);
25047
+ }
25048
+ }
25049
+ }] // 只读
25050
+ .filter(function (e) {
25051
+ if (model === 'readOnly') {
25052
+ return e.key !== 'operating';
25053
+ } else {
25054
+ return true;
25055
+ }
25056
+ }).map(function (e) {
25057
+ return _objectSpread2(_objectSpread2({}, e), {}, {
25058
+ ellipsis: true
25059
+ });
25060
+ });
25061
+ }, [editGood, controller, model, getVehicle]);
25062
+ return columns;
25063
+ });
25064
+
25065
+ var MyInput$4 = /*#__PURE__*/function (_React$Component) {
25066
+ _inherits(MyInput, _React$Component);
25067
+
25068
+ var _super = _createSuper(MyInput);
25069
+
25070
+ function MyInput() {
25071
+ _classCallCheck(this, MyInput);
25072
+
25073
+ return _super.apply(this, arguments);
25074
+ }
25075
+
25076
+ _createClass(MyInput, [{
25077
+ key: "render",
25078
+ value: function render() {
25079
+ if (this.props.loading) {
25080
+ return /*#__PURE__*/React.createElement(Spin$1, {
25081
+ size: "small"
25082
+ }, /*#__PURE__*/React.createElement(Input$1, _objectSpread2(_objectSpread2({}, this.props), {}, {
25083
+ autoComplete: "off"
25084
+ })));
25085
+ } else {
25086
+ return /*#__PURE__*/React.createElement(Input$1, _objectSpread2(_objectSpread2({}, this.props), {}, {
25087
+ autoComplete: "off"
25088
+ }));
25089
+ }
25090
+ }
25091
+ }]);
25092
+
25093
+ return MyInput;
25094
+ }(React.Component);
25095
+
25096
+ var useOnRow$2 = (function () {
25097
+ /** 控制器 */
25098
+ var controller = Invoice.useInvoiceController();
25099
+ var model = controller.useMemo(function (s) {
25100
+ return s.model;
25101
+ }, []);
25102
+ var onClick = React.useCallback( /*#__PURE__*/function () {
25103
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(record) {
25104
+ var editGood;
25105
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25106
+ while (1) {
25107
+ switch (_context2.prev = _context2.next) {
25108
+ case 0:
25109
+ if (!(model === 'readOnly')) {
25110
+ _context2.next = 2;
25111
+ break;
25112
+ }
25113
+
25114
+ return _context2.abrupt("return");
25115
+
25116
+ case 2:
25117
+ editGood = controller.state.freightListState.editGood;
25118
+
25119
+ if (!editGood) {
25120
+ _context2.next = 14;
25121
+ break;
25122
+ }
25123
+
25124
+ if (!(editGood.$index === record.$index)) {
25125
+ _context2.next = 6;
25126
+ break;
25127
+ }
25128
+
25129
+ return _context2.abrupt("return");
25130
+
25131
+ case 6:
25132
+ _context2.next = 8;
25133
+ return controller.saveEditFreight();
25134
+
25135
+ case 8:
25136
+ _context2.next = 10;
25137
+ return controller.wait();
25138
+
25139
+ case 10:
25140
+ _context2.next = 12;
25141
+ return controller.pipeline( /*#__PURE__*/function () {
25142
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
25143
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
25144
+ while (1) {
25145
+ switch (_context.prev = _context.next) {
25146
+ case 0:
25147
+ _context.t0 = s.freightListState.editGood;
25148
+
25149
+ if (_context.t0) {
25150
+ _context.next = 4;
25151
+ break;
25152
+ }
25153
+
25154
+ _context.next = 4;
25155
+ return controller.setEditFreight(record);
25156
+
25157
+ case 4:
25158
+ case "end":
25159
+ return _context.stop();
25160
+ }
25161
+ }
25162
+ }, _callee);
25163
+ }));
25164
+
25165
+ return function (_x2) {
25166
+ return _ref2.apply(this, arguments);
25167
+ };
25168
+ }())();
25169
+
25170
+ case 12:
25171
+ _context2.next = 16;
25172
+ break;
25173
+
25174
+ case 14:
25175
+ _context2.next = 16;
25176
+ return controller.setEditFreight(record);
25177
+
25178
+ case 16:
25179
+ case "end":
25180
+ return _context2.stop();
25181
+ }
25182
+ }
25183
+ }, _callee2);
25184
+ }));
25185
+
25186
+ return function (_x) {
25187
+ return _ref.apply(this, arguments);
25188
+ };
25189
+ }(), [controller, model]);
25190
+ return {
25191
+ onClick: onClick
25192
+ };
25193
+ });
25194
+
25195
+ /**
25196
+ * 点击组件外部 保存正在编辑的货物
25197
+ */
25198
+ /**
25199
+ * 点击组件外部 保存正在编辑的货物
25200
+ */
25201
+
25202
+ function useWindowClick$2(controller) {
25203
+ /** 点击组件外部 保存正在编辑的货物 */
25204
+ React.useEffect(function () {
25205
+ var click = function click() {
25206
+ setTimeout(controller.saveEditFreight);
25207
+ };
25208
+
25209
+ window.addEventListener('click', click);
25210
+ return function () {
25211
+ window.removeEventListener('click', click);
25212
+ };
25213
+ }, [controller]);
25214
+ }
25215
+
25216
+ var useRowSelection$2 = (function () {
25217
+ /** 控制器 */
25218
+ var controller = Invoice.useInvoiceController();
25219
+ /** 列表选中的货物索引列表 */
25220
+
25221
+ var selectedRowKeys = controller.useMemo(function (s) {
25222
+ return s.freightListState.selectedGoodIndex;
25223
+ }, []);
25224
+ /** 货物列表 */
25225
+
25226
+ var goodsList = controller.useMemo(function (s) {
25227
+ return s.freightListState.goodsList;
25228
+ }, []);
25229
+ /** 组件模式 */
25230
+
25231
+ var model = controller.useMemo(function (s) {
25232
+ return s.model;
25233
+ }, []);
25234
+ /** 搜索条件 */
25235
+ // const searchValue = controller.useMemo(s => s.goodsListState.searchValue, []);
25236
+
25237
+ /** 是否显示选择框 */
25238
+
25239
+ var isShow = React.useMemo(function () {
25240
+ if (model === 'readOnly') return false;
25241
+ return true;
25242
+ }, [model]);
25243
+ /** 是否全选 */
25244
+ // const isAll = controller.useMemo(s => s.goodsListState.goodsList.length > 0 && s.goodsListState.selectedGoodIndex.length === s.goodsListState.goodsList.length, [])
25245
+
25246
+ var isAll = controller.useMemo(function (s) {
25247
+ if (s.freightListState.selectedGoodIndex.length <= 0) return false;
25248
+ var seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
25249
+ return e.$index;
25250
+ });
25251
+ var selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25252
+ return seeGoodsIndex.some(function (t) {
25253
+ return e === t;
25254
+ });
25255
+ });
25256
+ return selectedGoodIndex.length === seeGoodsIndex.length;
25257
+ }, []);
25258
+ var indeterminate = controller.useMemo(function (s) {
25259
+ var seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
25260
+ return e.$index;
25261
+ });
25262
+ var selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25263
+ return seeGoodsIndex.some(function (t) {
25264
+ return e === t;
25265
+ });
25266
+ });
25267
+ if (selectedGoodIndex.length === 0) return false;
25268
+ return selectedGoodIndex.length < seeGoodsIndex.length;
25269
+ }, []);
25270
+ /** 点击了全选 */
25271
+
25272
+ var onClickSelectAll = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
25273
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
25274
+ while (1) {
25275
+ switch (_context3.prev = _context3.next) {
25276
+ case 0:
25277
+ if (!isAll) {
25278
+ _context3.next = 5;
25279
+ break;
25280
+ }
25281
+
25282
+ _context3.next = 3;
25283
+ return controller.pipeline( /*#__PURE__*/function () {
25284
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
25285
+ var seeGoodsIndex;
25286
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
25287
+ while (1) {
25288
+ switch (_context.prev = _context.next) {
25289
+ case 0:
25290
+ seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
25291
+ return e.$index;
25292
+ });
25293
+ s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25294
+ return !seeGoodsIndex.some(function (t) {
25295
+ return e === t;
25296
+ });
25297
+ });
25298
+
25299
+ case 2:
25300
+ case "end":
25301
+ return _context.stop();
25302
+ }
25303
+ }
25304
+ }, _callee);
25305
+ }));
25306
+
25307
+ return function (_x) {
25308
+ return _ref2.apply(this, arguments);
25309
+ };
25310
+ }())();
25311
+
25312
+ case 3:
25313
+ _context3.next = 7;
25314
+ break;
25315
+
25316
+ case 5:
25317
+ _context3.next = 7;
25318
+ return controller.pipeline( /*#__PURE__*/function () {
25319
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
25320
+ var seeGoodsIndex;
25321
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25322
+ while (1) {
25323
+ switch (_context2.prev = _context2.next) {
25324
+ case 0:
25325
+ seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
25326
+ return e.$index;
25327
+ });
25328
+ s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), _toConsumableArray(seeGoodsIndex));
25329
+ s.freightListState.selectedGoodIndex = Array.from(new Set(s.freightListState.selectedGoodIndex));
25330
+
25331
+ case 3:
25332
+ case "end":
25333
+ return _context2.stop();
25334
+ }
25335
+ }
25336
+ }, _callee2);
25337
+ }));
25338
+
25339
+ return function (_x2) {
25340
+ return _ref3.apply(this, arguments);
25341
+ };
25342
+ }())();
25343
+
25344
+ case 7:
25345
+ case "end":
25346
+ return _context3.stop();
25347
+ }
25348
+ }
25349
+ }, _callee3);
25350
+ })), [controller, isAll]);
25351
+ var onSelect = React.useCallback( /*#__PURE__*/function () {
25352
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(record, selected) {
25353
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
25354
+ while (1) {
25355
+ switch (_context6.prev = _context6.next) {
25356
+ case 0:
25357
+ if (!selected) {
25358
+ _context6.next = 5;
25359
+ break;
25360
+ }
25361
+
25362
+ _context6.next = 3;
25363
+ return controller.pipeline( /*#__PURE__*/function () {
25364
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
25365
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
25366
+ while (1) {
25367
+ switch (_context4.prev = _context4.next) {
25368
+ case 0:
25369
+ s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), [record.$index]);
25370
+ s.freightListState = _objectSpread2({}, s.freightListState);
25371
+
25372
+ case 2:
25373
+ case "end":
25374
+ return _context4.stop();
25375
+ }
25376
+ }
25377
+ }, _callee4);
25378
+ }));
25379
+
25380
+ return function (_x5) {
25381
+ return _ref5.apply(this, arguments);
25382
+ };
25383
+ }())();
25384
+
25385
+ case 3:
25386
+ _context6.next = 7;
25387
+ break;
25388
+
25389
+ case 5:
25390
+ _context6.next = 7;
25391
+ return controller.pipeline( /*#__PURE__*/function () {
25392
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
25393
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
25394
+ while (1) {
25395
+ switch (_context5.prev = _context5.next) {
25396
+ case 0:
25397
+ s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25398
+ return e !== record.$index;
25399
+ });
25400
+ s.freightListState = _objectSpread2({}, s.freightListState);
25401
+
25402
+ case 2:
25403
+ case "end":
25404
+ return _context5.stop();
25405
+ }
25406
+ }
25407
+ }, _callee5);
25408
+ }));
25409
+
25410
+ return function (_x6) {
25411
+ return _ref6.apply(this, arguments);
25412
+ };
25413
+ }())();
25414
+
25415
+ case 7:
25416
+ case "end":
25417
+ return _context6.stop();
25418
+ }
25419
+ }
25420
+ }, _callee6);
25421
+ }));
25422
+
25423
+ return function (_x3, _x4) {
25424
+ return _ref4.apply(this, arguments);
25425
+ };
25426
+ }(), [controller]);
25427
+ var columnTitle = React.useMemo(function () {
25428
+ return /*#__PURE__*/React.createElement(Checkbox, {
25429
+ onChange: onClickSelectAll,
25430
+ indeterminate: indeterminate,
25431
+ checked: isAll
25432
+ });
25433
+ }, [goodsList, selectedRowKeys, onClickSelectAll, isAll, indeterminate]);
25434
+ /** 选择了商品后 调整 折扣行 和 被折扣行 */
25435
+
25436
+ var sortOut = React.useCallback( /*#__PURE__*/function () {
25437
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(selected) {
25438
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
25439
+ while (1) {
25440
+ switch (_context8.prev = _context8.next) {
25441
+ case 0:
25442
+ _context8.next = 2;
25443
+ return controller.wait();
25444
+
25445
+ case 2:
25446
+ _context8.next = 4;
25447
+ return controller.pipeline( /*#__PURE__*/function () {
25448
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s) {
25449
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
25450
+ while (1) {
25451
+ switch (_context7.prev = _context7.next) {
25452
+ case 0:
25453
+ s.freightListState.selectedGoodIndex.forEach(function ($index) {
25454
+ var goods = s.freightListState.goodsMap.get($index);
25455
+ if (!goods) return; // 数组位置
25456
+
25457
+ var t = s.freightListState.goodsList.indexOf(goods); // goods.lineAttribute === LineAttributeType.折扣行 ? t : t++;
25458
+
25459
+ var i = s.goodsListState.goodsList[t].$index;
25460
+
25461
+ if (selected) {
25462
+ if (s.freightListState.selectedGoodIndex.indexOf(i) < 0) s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), [i]);
25463
+ } else {
25464
+ if (s.freightListState.selectedGoodIndex.indexOf(i) < 0) s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25465
+ return e !== $index;
25466
+ });
25467
+ }
25468
+ });
25469
+
25470
+ case 1:
25471
+ case "end":
25472
+ return _context7.stop();
25473
+ }
25474
+ }
25475
+ }, _callee7);
25476
+ }));
25477
+
25478
+ return function (_x8) {
25479
+ return _ref8.apply(this, arguments);
25480
+ };
25481
+ }())();
25482
+
25483
+ case 4:
25484
+ case "end":
25485
+ return _context8.stop();
25486
+ }
25487
+ }
25488
+ }, _callee8);
25489
+ }));
25490
+
25491
+ return function (_x7) {
25492
+ return _ref7.apply(this, arguments);
25493
+ };
25494
+ }(), [controller]); // React.useEffect(() => {
25495
+ // sortOut(true);
25496
+ // }, [sortOut, goodsList])
25497
+
25498
+ if (isShow === false) return undefined;
25499
+ return {
25500
+ columnWidth: 45,
25501
+ columnTitle: columnTitle,
25502
+ onSelect: onSelect,
25503
+ selectedRowKeys: selectedRowKeys
25504
+ };
25505
+ });
25506
+
25507
+ var useDelRowButton$2 = (function () {
25508
+ var controller = Invoice.useInvoiceController();
25509
+ var model = controller.useMemo(function (s) {
25510
+ return s.model;
25511
+ }, []);
25512
+ var isRemRow = controller.useMemo(function (s) {
25513
+ return s.freightListState.isRemRow;
25514
+ }, []);
25515
+ /** 是否禁用 */
25516
+
25517
+ var disabled = controller.useMemo(function (s) {
25518
+ if (s.freightListState.selectedGoodIndex.length <= 0) return true;
25519
+ return false;
25520
+ }, []);
25521
+ /** 点击了删除 */
25522
+
25523
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
25524
+ var selectedGoodIndex, i;
25525
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25526
+ while (1) {
25527
+ switch (_context2.prev = _context2.next) {
25528
+ case 0:
25529
+ selectedGoodIndex = controller.state.freightListState.selectedGoodIndex.slice();
25530
+ i = 0;
25531
+
25532
+ case 2:
25533
+ if (!(i < selectedGoodIndex.length)) {
25534
+ _context2.next = 8;
25535
+ break;
25536
+ }
25537
+
25538
+ _context2.next = 5;
25539
+ return controller.delFreight(selectedGoodIndex[i]);
25540
+
25541
+ case 5:
25542
+ i++;
25543
+ _context2.next = 2;
25544
+ break;
25545
+
25546
+ case 8:
25547
+ _context2.next = 10;
25548
+ return controller.run( /*#__PURE__*/function () {
25549
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
25550
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
25551
+ while (1) {
25552
+ switch (_context.prev = _context.next) {
25553
+ case 0:
25554
+ s.freightListState.selectedGoodIndex = [];
25555
+
25556
+ case 1:
25557
+ case "end":
25558
+ return _context.stop();
25559
+ }
25560
+ }
25561
+ }, _callee);
25562
+ }));
25563
+
25564
+ return function (_x) {
25565
+ return _ref2.apply(this, arguments);
25566
+ };
25567
+ }());
25568
+
25569
+ case 10:
25570
+ case "end":
25571
+ return _context2.stop();
25572
+ }
25573
+ }
25574
+ }, _callee2);
25575
+ })), []);
25576
+ var menuItem = React.useMemo(function () {
25577
+ if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
25578
+ if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
25579
+ return /*#__PURE__*/React.createElement(Menu$1.Item, {
25580
+ key: "1",
25581
+ onClick: onClick,
25582
+ disabled: disabled
25583
+ }, " \u5220\u9664\u884C ");
25584
+ }, [model, onClick, disabled]);
25585
+ var button = React.useMemo(function () {
25586
+ if (isRemRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
25587
+ if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
25588
+ if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
25589
+ return /*#__PURE__*/React.createElement(Button$1, {
25590
+ size: 'small',
25591
+ onClick: onClick,
25592
+ disabled: disabled
25593
+ }, "\u5220\u9664");
25594
+ }, [model, onClick, disabled, isRemRow]);
25595
+ return {
25596
+ button: button,
25597
+ menuItem: menuItem
25598
+ };
25599
+ });
25600
+
25601
+ var css_248z$v = ".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-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 2px solid #9F613E;\n gap: 10px;\n align-items: center;\n height: 48px;\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";
25602
+ styleInject(css_248z$v);
25603
+
25604
+ var FreightList = /*#__PURE__*/function (_React$Component) {
25605
+ _inherits(FreightList, _React$Component);
25606
+
25607
+ var _super = _createSuper(FreightList);
25608
+
25609
+ function FreightList() {
25610
+ _classCallCheck(this, FreightList);
25611
+
25612
+ return _super.apply(this, arguments);
25613
+ }
25614
+
25615
+ _createClass(FreightList, [{
25616
+ key: "render",
25617
+ value: function render() {
25618
+ return /*#__PURE__*/React.createElement(Main$4, _objectSpread2({}, this.props));
25619
+ }
25620
+ }]);
25621
+
25622
+ return FreightList;
25623
+ }(React.Component);
25624
+ var Main$4 = decorator(Form.create())(function (props) {
25625
+ var form = props.form;
25626
+ /** 控制器 */
25627
+
25628
+ var controller = Invoice.useInvoiceController();
25629
+ var goodsList = controller.useMemo(function (s) {
25630
+ return s.freightListState.goodsList;
25631
+ }, []);
25632
+ /** 货物列表 */
25633
+
25634
+ var dataSource = controller.useMemo(function (s) {
25635
+ return s.freightListState.goodsList;
25636
+ }, []);
25637
+ /** 表格行事件 */
25638
+
25639
+ var _onRow = useOnRow$2();
25640
+ /** 批量删除 */
25641
+
25642
+
25643
+ var delRowButton = useDelRowButton$2();
25644
+ useWindowClick$2(controller); // 点击组件外部 保存正在编辑的货物
25645
+
25646
+ /** 注册 from 对象 */
25647
+
25648
+ React.useEffect(function () {
25649
+ controller.pipeline( /*#__PURE__*/function () {
25650
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s, form) {
25651
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
25652
+ while (1) {
25653
+ switch (_context.prev = _context.next) {
25654
+ case 0:
25655
+ s.freightListState = _objectSpread2(_objectSpread2({}, s.freightListState), {}, {
25656
+ form: form
25657
+ });
25658
+
25659
+ case 1:
25660
+ case "end":
25661
+ return _context.stop();
25662
+ }
25663
+ }
25664
+ }, _callee);
25665
+ }));
25666
+
25667
+ return function (_x, _x2) {
25668
+ return _ref.apply(this, arguments);
25669
+ };
25670
+ }())(props.form);
25671
+ }, [controller, props.form]); // 跟新 货物
25672
+
25673
+ React.useEffect(function () {
25674
+ controller.run( /*#__PURE__*/function () {
25675
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
25676
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25677
+ while (1) {
25678
+ switch (_context2.prev = _context2.next) {
25679
+ case 0:
25680
+ s.freightListState.goodsMap = new Map();
25681
+ goodsList.forEach(function (e) {
25682
+ s.freightListState.goodsMap.set(e.$index, e);
25683
+ });
25684
+
25685
+ case 2:
25686
+ case "end":
25687
+ return _context2.stop();
25688
+ }
25689
+ }
25690
+ }, _callee2);
25691
+ }));
25692
+
25693
+ return function (_x3) {
25694
+ return _ref2.apply(this, arguments);
25695
+ };
25696
+ }());
25697
+ }, [controller, goodsList]);
25698
+ /** props 产品最大数 更新 */
25699
+
25700
+ React.useEffect(function () {
25701
+ controller.pipeline( /*#__PURE__*/function () {
25702
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
25703
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
25704
+ while (1) {
25705
+ switch (_context3.prev = _context3.next) {
25706
+ case 0:
25707
+ s.freightListState.goodMax = props.goodMax;
25708
+
25709
+ case 1:
25710
+ case "end":
25711
+ return _context3.stop();
25712
+ }
25713
+ }
25714
+ }, _callee3);
25715
+ }));
25716
+
25717
+ return function (_x4) {
25718
+ return _ref3.apply(this, arguments);
25719
+ };
25720
+ }())();
25721
+ }, [controller, props.goodMax]); // 注册 form
25722
+ // controller.useForm('freightInfo', form);
25723
+
25724
+ return /*#__PURE__*/React.createElement("div", {
25725
+ className: "kts-invoice-operate-freight"
25726
+ }, /*#__PURE__*/React.createElement("div", {
25727
+ className: 'real-estate-info-digtal-label'
25728
+ }, "\u7279\u6B8A\u4FE1\u606F-\u5EFA\u7B51\u670D\u52A1"), /*#__PURE__*/React.createElement("div", {
25729
+ className: "kts-invoice-operate-goods-list-digtal",
25730
+ onClick: function onClick(e) {
25731
+ e.stopPropagation();
25732
+ }
25733
+ }, /*#__PURE__*/React.createElement("div", {
25734
+ className: "kts-invoice-operate-goods-list-able"
25735
+ }, /*#__PURE__*/React.createElement(AddRowButton$2, null), delRowButton.button, /*#__PURE__*/React.createElement("div", {
25736
+ style: {
25737
+ flex: 1
25738
+ }
25739
+ })), /*#__PURE__*/React.createElement("div", {
25740
+ className: classnames('kts-invoice-operate-goods-list-table-digtal')
25741
+ }, /*#__PURE__*/React.createElement(TableVirtual$2, {
25742
+ size: "small",
25743
+ rowKey: "$index",
25744
+ pagination: false,
25745
+ scroll: {
25746
+ y: 280
25747
+ },
25748
+ components: {
25749
+ body: {
25750
+ row: TableRow$2
25751
+ }
25752
+ },
25753
+ dataSource: dataSource,
25754
+ columns: useColumns$2(props.form),
25755
+ rowSelection: useRowSelection$2(),
25756
+ onRow: function onRow(record) {
25757
+ return {
25758
+ onClick: function onClick() {
25759
+ _onRow.onClick(record);
25760
+ }
25761
+ };
25762
+ }
25763
+ }))));
25764
+ });
25765
+
25766
+ var ImportBuyerDrawer = (function () {
25767
+ var controller = Invoice.useInvoiceController();
25768
+ var visible = controller.useMemo(function (s) {
25769
+ return s.buyerState.isVisibleDrawer;
25770
+ }, []);
25771
+ var topExpand = controller.useMemo(function (s) {
25772
+ return s.buyerState.topExpand;
25773
+ }, []); // controller.pipeline(async s=>s.goodsListState.isTaxIncluded = true)()
25774
+
25775
+ var onClose = React.useCallback(function () {
25776
+ controller.pipeline( /*#__PURE__*/function () {
25777
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
25778
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
25779
+ while (1) {
25780
+ switch (_context.prev = _context.next) {
25781
+ case 0:
24131
25782
  s.buyerState.isVisibleDrawer = false;
24132
25783
 
24133
25784
  case 1:
@@ -24488,8 +26139,8 @@ var getItemCode = function getItemCode(record, editGood) {
24488
26139
  return record.productCode;
24489
26140
  };
24490
26141
 
24491
- var css_248z$t = ".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";
24492
- styleInject(css_248z$t);
26142
+ var css_248z$w = ".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";
26143
+ styleInject(css_248z$w);
24493
26144
 
24494
26145
  var TreeNode = Tree.TreeNode;
24495
26146
  var confirm = Modal$1.confirm;
@@ -25736,7 +27387,7 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
25736
27387
  if (this.props.invoiceType === 'digtal') {
25737
27388
  return /*#__PURE__*/React.createElement(Digtal, _objectSpread2({}, this.props));
25738
27389
  } else {
25739
- return /*#__PURE__*/React.createElement(Main$4, _objectSpread2({}, this.props));
27390
+ return /*#__PURE__*/React.createElement(Main$5, _objectSpread2({}, this.props));
25740
27391
  }
25741
27392
  }
25742
27393
  }]);
@@ -25758,6 +27409,7 @@ Invoice.StakeFarmerholder = StakeFarmerholder;
25758
27409
  Invoice.SignDigtal = SignDigtal;
25759
27410
  Invoice.RealEstateInfo = RealEstateInfo;
25760
27411
  Invoice.Architecture = Architecture;
27412
+ Invoice.FreightList = FreightList;
25761
27413
  Invoice.GoodsListDigtal = GoodsList$1;
25762
27414
  Invoice.idGenerator = idGenerator;
25763
27415
  Invoice.calculator = calculator;
@@ -25767,7 +27419,7 @@ Invoice.useInvoiceController = function () {
25767
27419
  return React.useContext(InvoiceContext);
25768
27420
  };
25769
27421
 
25770
- var Main$4 = function Main(props) {
27422
+ var Main$5 = function Main(props) {
25771
27423
  var controller = React.useMemo(function () {
25772
27424
  return props.controller || new InvoiceController();
25773
27425
  }, [props.controller]);
@@ -25875,8 +27527,8 @@ var Digtal = function Digtal(props) {
25875
27527
  ), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null));
25876
27528
  };
25877
27529
 
25878
- var css_248z$u = ".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}\n";
25879
- styleInject(css_248z$u);
27530
+ var css_248z$x = ".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}\n";
27531
+ styleInject(css_248z$x);
25880
27532
 
25881
27533
  function TaxClassificationModal(props) {
25882
27534
  var _props$info2, _props$info3;