kts-component-invoice-operate 3.2.178 → 3.2.180

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 (67) hide show
  1. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +0 -5
  2. package/dist/Invoice/InvoiceController/index.d.ts +0 -10
  3. package/dist/Invoice/index.d.ts +0 -4
  4. package/dist/index.esm.js +47 -1958
  5. package/dist/index.js +47 -1958
  6. package/package.json +3 -3
  7. package/src/Invoice/Invoice-digtal/index.md +1 -7
  8. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +0 -6
  9. package/src/Invoice/InvoiceController/index.ts +1 -20
  10. package/src/Invoice/index.tsx +1 -8
  11. package/src/Invoice/tools/useToGenerateId/index.ts +0 -2
  12. package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +11 -10
  13. package/src/Invoice/ui/digtal/GoodsList/index.tsx +1 -0
  14. package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.tsx +1 -0
  15. package/src/TaxClassificationCodeModal/index.less +8 -0
  16. package/src/TaxClassificationCodeModal/index.tsx +14 -6
  17. package/dist/Invoice/Invoice-digtal/_test/architecture/index.d.ts +0 -4
  18. package/dist/Invoice/Invoice-digtal/_test/freight/index.d.ts +0 -4
  19. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.d.ts +0 -6
  20. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.d.ts +0 -23
  21. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.d.ts +0 -21
  22. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.d.ts +0 -31
  23. package/dist/Invoice/InvoiceController/fns/addFreight.d.ts +0 -6
  24. package/dist/Invoice/InvoiceController/fns/delFreight.d.ts +0 -6
  25. package/dist/Invoice/InvoiceController/fns/saveEditFreight.d.ts +0 -6
  26. package/dist/Invoice/InvoiceController/fns/setEditFreight.d.ts +0 -6
  27. package/dist/Invoice/InvoiceController/fns/setFreight.d.ts +0 -6
  28. package/dist/Invoice/ui/digtal/Architecture/index.d.ts +0 -15
  29. package/dist/Invoice/ui/digtal/FreightList/hook/useColumns/index.d.ts +0 -3
  30. package/dist/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.d.ts +0 -8
  31. package/dist/Invoice/ui/digtal/FreightList/hook/useOnRow/index.d.ts +0 -8
  32. package/dist/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.d.ts +0 -8
  33. package/dist/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.d.ts +0 -8
  34. package/dist/Invoice/ui/digtal/FreightList/index.d.ts +0 -15
  35. package/dist/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.d.ts +0 -3
  36. package/dist/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +0 -6
  37. package/dist/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +0 -6
  38. package/dist/Invoice/ui/digtal/FreightList/ui/TableRow/index.d.ts +0 -3
  39. package/dist/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.d.ts +0 -4
  40. package/src/Invoice/Invoice-digtal/_test/architecture/index.tsx +0 -22
  41. package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +0 -14575
  42. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.ts +0 -10
  43. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.ts +0 -33
  44. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.ts +0 -81
  45. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.ts +0 -40
  46. package/src/Invoice/InvoiceController/fns/addFreight.ts +0 -11
  47. package/src/Invoice/InvoiceController/fns/delFreight.ts +0 -38
  48. package/src/Invoice/InvoiceController/fns/saveEditFreight.ts +0 -24
  49. package/src/Invoice/InvoiceController/fns/setEditFreight.ts +0 -16
  50. package/src/Invoice/InvoiceController/fns/setFreight.ts +0 -11
  51. package/src/Invoice/ui/digtal/Architecture/index.less +0 -15
  52. package/src/Invoice/ui/digtal/Architecture/index.tsx +0 -166
  53. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/dist/index.js +0 -616
  54. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/index.tsx +0 -246
  55. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.tsx +0 -20
  56. package/src/Invoice/ui/digtal/FreightList/hook/useOnRow/index.tsx +0 -37
  57. package/src/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.tsx +0 -120
  58. package/src/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.tsx +0 -23
  59. package/src/Invoice/ui/digtal/FreightList/index.less +0 -74
  60. package/src/Invoice/ui/digtal/FreightList/index.tsx +0 -129
  61. package/src/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.tsx +0 -65
  62. package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +0 -50
  63. package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +0 -37
  64. package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.less +0 -29
  65. package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.tsx +0 -21
  66. package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.less +0 -39
  67. package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.tsx +0 -109
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var mathjs = require('mathjs');
9
9
  var ktsComponentsAntdX3 = require('kts-components-antd-x3');
10
10
  var uuid = require('uuid');
11
11
  var ktsXui = require('kts-xui');
12
- var classnames = require('classnames');
12
+ var classNames = require('classnames');
13
13
  var ktsComponentsAntdX4V4 = require('kts-components-antd-x4-v4');
14
14
  var ReactDOM = require('react-dom');
15
15
  var ktsComponentsAntdX4 = require('kts-components-antd-x4');
@@ -20,7 +20,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
20
20
 
21
21
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
22
  var GreyReactBox__default = /*#__PURE__*/_interopDefaultLegacy(GreyReactBox);
23
- var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
23
+ var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
24
24
 
25
25
  function ownKeys(object, enumerableOnly) {
26
26
  var keys = Object.keys(object);
@@ -1140,26 +1140,6 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1140
1140
  this.drag = new Drag();
1141
1141
  });
1142
1142
 
1143
- var FreightListState = /*#__PURE__*/_createClass(function FreightListState() {
1144
- _classCallCheck(this, FreightListState);
1145
-
1146
- this.goodMax = void 0;
1147
- this.editGood = void 0;
1148
- this.isAddRow = true;
1149
- this.isRemRow = true;
1150
- this.goodsMap = new Map();
1151
- this.form = void 0;
1152
- this.vehicleTypeList = [];
1153
- this.goodsList = [];
1154
- this.selectedGoodIndex = [];
1155
- this.area = [];
1156
- this.addressFieldNames = {
1157
- label: 'label',
1158
- value: 'value',
1159
- children: 'children'
1160
- };
1161
- });
1162
-
1163
1143
  var BuyerState = /*#__PURE__*/_createClass(function BuyerState() {
1164
1144
  _classCallCheck(this, BuyerState);
1165
1145
 
@@ -1251,7 +1231,6 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
1251
1231
  this.typeModalProps = void 0;
1252
1232
  this.autoComplete = new AutoComplete();
1253
1233
  this.taxClassificationProps = void 0;
1254
- this.freightListState = new FreightListState();
1255
1234
  });
1256
1235
 
1257
1236
  /**
@@ -1288,40 +1267,6 @@ var setEditGood = /*#__PURE__*/(function () {
1288
1267
  };
1289
1268
  })();
1290
1269
 
1291
- /**
1292
- * 设置当前的编辑货物运输
1293
- */
1294
- var setEditFreight = /*#__PURE__*/(function () {
1295
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, newEditGood) {
1296
- var editGood;
1297
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1298
- while (1) {
1299
- switch (_context.prev = _context.next) {
1300
- case 0:
1301
- if (newEditGood) {
1302
- editGood = state.freightListState.editGood;
1303
- state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
1304
- editGood: _objectSpread2(_objectSpread2({}, editGood), newEditGood)
1305
- });
1306
- } else {
1307
- state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
1308
- editGood: undefined
1309
- });
1310
- }
1311
-
1312
- case 1:
1313
- case "end":
1314
- return _context.stop();
1315
- }
1316
- }
1317
- }, _callee);
1318
- }));
1319
-
1320
- return function (_x, _x2) {
1321
- return _ref.apply(this, arguments);
1322
- };
1323
- })();
1324
-
1325
1270
  /**
1326
1271
  * 设置单个货物属性
1327
1272
  */
@@ -1360,44 +1305,6 @@ var setGoods = /*#__PURE__*/(function () {
1360
1305
  };
1361
1306
  })();
1362
1307
 
1363
- /**
1364
- * 设置单个货物属性
1365
- */
1366
- var setFreight = /*#__PURE__*/(function () {
1367
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
1368
- var goodsList;
1369
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1370
- while (1) {
1371
- switch (_context.prev = _context.next) {
1372
- case 0:
1373
- if (!(!options || !options.$index)) {
1374
- _context.next = 2;
1375
- break;
1376
- }
1377
-
1378
- return _context.abrupt("return");
1379
-
1380
- case 2:
1381
- goodsList = state.freightListState.goodsList.map(function (e) {
1382
- return e.$index === options.$index ? _objectSpread2(_objectSpread2({}, e), options) : e;
1383
- });
1384
- state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
1385
- goodsList: goodsList
1386
- });
1387
-
1388
- case 4:
1389
- case "end":
1390
- return _context.stop();
1391
- }
1392
- }
1393
- }, _callee);
1394
- }));
1395
-
1396
- return function (_x, _x2) {
1397
- return _ref.apply(this, arguments);
1398
- };
1399
- })();
1400
-
1401
1308
  /**
1402
1309
  * 删除一个货物
1403
1310
  */
@@ -1482,87 +1389,6 @@ var delGood = /*#__PURE__*/(function () {
1482
1389
  };
1483
1390
  })();
1484
1391
 
1485
- /**
1486
- * 删除一个货物运输
1487
- */
1488
- var delFreight = /*#__PURE__*/(function () {
1489
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, $index) {
1490
- var goods, goodsList, goodsMap, i;
1491
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1492
- while (1) {
1493
- switch (_context.prev = _context.next) {
1494
- case 0:
1495
- if ($index) {
1496
- _context.next = 2;
1497
- break;
1498
- }
1499
-
1500
- return _context.abrupt("return");
1501
-
1502
- case 2:
1503
- // 查下要删除的货物
1504
- goods = state.freightListState.goodsList.filter(function (e) {
1505
- return e.$index === $index;
1506
- })[0];
1507
-
1508
- if (goods) {
1509
- _context.next = 5;
1510
- break;
1511
- }
1512
-
1513
- return _context.abrupt("return");
1514
-
1515
- case 5:
1516
- // 如果正在编辑 就取消编辑
1517
- if (state.freightListState.editGood && state.freightListState.editGood.$index === $index) {
1518
- state.freightListState.editGood = undefined;
1519
- }
1520
-
1521
- goodsList = state.freightListState.goodsList;
1522
- goodsMap = state.freightListState.goodsMap;
1523
- goodsMap.delete($index);
1524
- i = 0;
1525
-
1526
- case 10:
1527
- if (!(i < goodsList.length)) {
1528
- _context.next = 17;
1529
- break;
1530
- }
1531
-
1532
- if (!(goodsList[i].$index === $index)) {
1533
- _context.next = 14;
1534
- break;
1535
- }
1536
-
1537
- // const good = goodsList[i];
1538
- // if (good.lineAttribute === LineAttributeType.折扣行 && goodsList[i - 1] && goodsList[i - 1].lineAttribute === LineAttributeType.被折扣行) {
1539
- // goodsList[i - 1].lineAttribute = LineAttributeType.正常;
1540
- // }
1541
- goodsList.splice(i, 1);
1542
- return _context.abrupt("break", 17);
1543
-
1544
- case 14:
1545
- i++;
1546
- _context.next = 10;
1547
- break;
1548
-
1549
- case 17:
1550
- state.freightListState.goodsList = _toConsumableArray(goodsList);
1551
- state.freightListState.goodsMap = new Map(goodsMap);
1552
-
1553
- case 19:
1554
- case "end":
1555
- return _context.stop();
1556
- }
1557
- }
1558
- }, _callee);
1559
- }));
1560
-
1561
- return function (_x, _x2) {
1562
- return _ref.apply(this, arguments);
1563
- };
1564
- })();
1565
-
1566
1392
  var idGenerator = (function () {
1567
1393
  return uuid.v4();
1568
1394
  });
@@ -1928,33 +1754,6 @@ var addGood = /*#__PURE__*/(function () {
1928
1754
  };
1929
1755
  })();
1930
1756
 
1931
- /**
1932
- * 添加的编辑货物运输
1933
- */
1934
-
1935
- var addFreight = /*#__PURE__*/(function () {
1936
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
1937
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1938
- while (1) {
1939
- switch (_context.prev = _context.next) {
1940
- case 0:
1941
- options.$index = idGenerator();
1942
- state.freightListState.goodsList = [].concat(_toConsumableArray(state.freightListState.goodsList), [options]);
1943
- return _context.abrupt("return", options);
1944
-
1945
- case 3:
1946
- case "end":
1947
- return _context.stop();
1948
- }
1949
- }
1950
- }, _callee);
1951
- }));
1952
-
1953
- return function (_x, _x2) {
1954
- return _ref.apply(this, arguments);
1955
- };
1956
- })();
1957
-
1958
1757
  /**
1959
1758
  * 保存正在编辑的货物
1960
1759
  */
@@ -2034,85 +1833,6 @@ var validateFields = function validateFields(form) {
2034
1833
  });
2035
1834
  };
2036
1835
 
2037
- /**
2038
- * 保存正在编辑的货物
2039
- */
2040
- var saveEditFreight = /*#__PURE__*/(function () {
2041
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state) {
2042
- var editGood, form;
2043
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2044
- while (1) {
2045
- switch (_context.prev = _context.next) {
2046
- case 0:
2047
- editGood = state.freightListState.editGood;
2048
- form = state.freightListState.form;
2049
-
2050
- if (!(!editGood || !form)) {
2051
- _context.next = 4;
2052
- break;
2053
- }
2054
-
2055
- return _context.abrupt("return");
2056
-
2057
- case 4:
2058
- _context.next = 6;
2059
- return validateFields$1(form);
2060
-
2061
- case 6:
2062
- if (!_context.sent.err) {
2063
- _context.next = 8;
2064
- break;
2065
- }
2066
-
2067
- return _context.abrupt("return");
2068
-
2069
- case 8:
2070
- state.freightListState.goodsList = state.freightListState.goodsList.map(function (e) {
2071
- return e.$index === editGood.$index ? _objectSpread2(_objectSpread2({}, e), editGood) : e;
2072
- });
2073
- state.freightListState.editGood = undefined;
2074
-
2075
- case 10:
2076
- case "end":
2077
- return _context.stop();
2078
- }
2079
- }
2080
- }, _callee);
2081
- }));
2082
-
2083
- return function (_x) {
2084
- return _ref.apply(this, arguments);
2085
- };
2086
- })();
2087
-
2088
- var validateFields$1 = function validateFields(form) {
2089
- return new Promise(function (resolve) {
2090
- form.validateFields( /*#__PURE__*/function () {
2091
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
2092
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2093
- while (1) {
2094
- switch (_context2.prev = _context2.next) {
2095
- case 0:
2096
- resolve({
2097
- err: err,
2098
- values: values
2099
- });
2100
-
2101
- case 1:
2102
- case "end":
2103
- return _context2.stop();
2104
- }
2105
- }
2106
- }, _callee2);
2107
- }));
2108
-
2109
- return function (_x2, _x3) {
2110
- return _ref2.apply(this, arguments);
2111
- };
2112
- }());
2113
- });
2114
- };
2115
-
2116
1836
  /**
2117
1837
  * 计算搜索商品
2118
1838
  * @param goodsList 被搜索列表
@@ -10019,15 +9739,10 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
10019
9739
  _this.updateInvoiceNo = void 0;
10020
9740
  _this.getBuyerList = void 0;
10021
9741
  _this.setGoods = _this.pipeline(setGoods);
10022
- _this.setFreight = _this.pipeline(setFreight);
10023
- _this.setEditFreight = _this.pipeline(setEditFreight);
10024
9742
  _this.setEditGood = _this.pipeline(setEditGood);
10025
9743
  _this.saveEditGood = _this.pipeline(saveEditGood);
10026
- _this.saveEditFreight = _this.pipeline(saveEditFreight);
10027
9744
  _this.delGood = _this.pipeline(delGood);
10028
- _this.delFreight = _this.pipeline(delFreight);
10029
9745
  _this.addGood = _this.pipeline(addGood);
10030
- _this.addFreight = _this.pipeline(addFreight);
10031
9746
  _this.mergeDetails = _this.pipeline(mergeDetails);
10032
9747
  _this.mergeDiscount = _this.pipeline(mergeDiscount);
10033
9748
  _this.addGoodDiscount = _this.pipeline(addGoodDiscount);
@@ -10059,14 +9774,6 @@ function useToGenerateId(controller) {
10059
9774
  e.serialNo = i + 1;
10060
9775
  });
10061
9776
  }, [goodsList]);
10062
- var freightList = controller.useMemo(function (s) {
10063
- return s.freightListState.goodsList;
10064
- }, []);
10065
- React__default['default'].useEffect(function () {
10066
- freightList.forEach(function (e, i) {
10067
- e.sortNumber = i + 1;
10068
- });
10069
- }, [freightList]);
10070
9777
  }
10071
9778
 
10072
9779
  var Nzh = require("nzh");
@@ -11054,7 +10761,7 @@ function TableRow(props) {
11054
10761
  bottom: 0
11055
10762
  }
11056
10763
  })) : /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
11057
- className: classnames__default['default'](props.className, discount, expandedRow, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
10764
+ className: classNames__default['default'](props.className, discount, expandedRow, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
11058
10765
  }));
11059
10766
  }
11060
10767
 
@@ -12938,8 +12645,8 @@ var Icon = /*#__PURE__*/React.forwardRef(function (props, ref) {
12938
12645
  _React$useContext$pre = _React$useContext.prefixCls,
12939
12646
  prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre;
12940
12647
 
12941
- var classString = classnames__default['default'](prefixCls, className);
12942
- var svgClassString = classnames__default['default'](_defineProperty$1({}, "".concat(prefixCls, "-spin"), !!spin));
12648
+ var classString = classNames__default['default'](prefixCls, className);
12649
+ var svgClassString = classNames__default['default'](_defineProperty$1({}, "".concat(prefixCls, "-spin"), !!spin));
12943
12650
  var svgStyle = rotate ? {
12944
12651
  msTransform: "rotate(".concat(rotate, "deg)"),
12945
12652
  transform: "rotate(".concat(rotate, "deg)")
@@ -16578,7 +16285,7 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
16578
16285
  }, /*#__PURE__*/React__default['default'].createElement(AddRowButton, null), endowCodeButton.button, delRowButton.button, mergeDetails.button, mergeDiscount.button, addDiscountRowButton.drawer, salesDiscount.button, salesGifts.button, /*#__PURE__*/React__default['default'].createElement(Search, null)), /*#__PURE__*/React__default['default'].createElement("div", {
16579
16286
  className: "kts-invoice-operate-goods-list-able-extend"
16580
16287
  }, props.menuExpansion, /*#__PURE__*/React__default['default'].createElement(DescribeSwitch, null), /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React__default['default'].createElement("div", {
16581
- className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
16288
+ className: classNames__default['default']('kts-invoice-operate-goods-list-table', {
16582
16289
  'kts-invoice-operate-prefab': isprefab
16583
16290
  })
16584
16291
  }, /*#__PURE__*/React__default['default'].createElement(TableVirtual, {
@@ -17495,7 +17202,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
17495
17202
  setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
17496
17203
  }, [props.isExpand]);
17497
17204
  return /*#__PURE__*/React__default['default'].createElement("div", {
17498
- className: classnames__default['default']("kts-invoice-operate-invoice-digtal-stakeholder", {
17205
+ className: classNames__default['default']("kts-invoice-operate-invoice-digtal-stakeholder", {
17499
17206
  readOnly: readOnly
17500
17207
  })
17501
17208
  }, /*#__PURE__*/React__default['default'].createElement("div", null, '购买方信息'.split('').map(function (e) {
@@ -18083,7 +17790,7 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
18083
17790
  setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
18084
17791
  }, [props.isExpand]);
18085
17792
  return /*#__PURE__*/React__default['default'].createElement("div", {
18086
- className: classnames__default['default']("kts-invoice-operate-invoice-digtal-stakeholder", {
17793
+ className: classNames__default['default']("kts-invoice-operate-invoice-digtal-stakeholder", {
18087
17794
  readOnly: readOnly
18088
17795
  })
18089
17796
  }, /*#__PURE__*/React__default['default'].createElement("div", null, '销售方信息'.split('').map(function (e) {
@@ -20550,7 +20257,7 @@ function TableRow$1(props) {
20550
20257
  /*#__PURE__*/
20551
20258
  // <tr {...props} className={classnames(props.className, discount, (rowKey === container && current) ? 'kts-invoice-operate-goods-list-itemName-drag-container' : '')} />
20552
20259
  React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
20553
- className: classnames__default['default'](props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
20260
+ className: classNames__default['default'](props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
20554
20261
  }));
20555
20262
  }
20556
20263
 
@@ -23950,7 +23657,7 @@ var Main$3 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
23950
23657
  flex: 1
23951
23658
  }
23952
23659
  }), props.menuExpansion, reselectInvoiceType.button, emptyRefill.button), /*#__PURE__*/React__default['default'].createElement("div", {
23953
- className: classnames__default['default']('kts-invoice-operate-goods-list-table-digtal')
23660
+ className: classNames__default['default']('kts-invoice-operate-goods-list-table-digtal')
23954
23661
  }, /*#__PURE__*/React__default['default'].createElement(TableVirtual$1, {
23955
23662
  size: "small",
23956
23663
  rowKey: "$index",
@@ -24217,1632 +23924,10 @@ var MyNY = /*#__PURE__*/function (_React$Component4) {
24217
23924
  return MyNY;
24218
23925
  }(React__default['default'].Component);
24219
23926
 
24220
- var css_248z$s = ".kts-invoice-operate-real-estate-info-digtal {\n padding: 20px;\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-real-estate-info-digtal .real-estate-info-digtal-label {\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-real-estate-info-digtal .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n";
24221
- styleInject(css_248z$s);
24222
-
24223
- /** 特殊信息-建筑服务 */
24224
-
24225
- var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
24226
- /** 控制器 */
23927
+ var ImportBuyerDrawer = (function () {
24227
23928
  var controller = Invoice.useInvoiceController();
24228
- var form = props.form;
24229
- var getFieldDecorator = form.getFieldDecorator;
24230
- var model = controller.useMemo(function (s) {
24231
- return s.model;
24232
- }, []);
24233
- var readOnly = React__default['default'].useMemo(function () {
24234
- return model === 'readOnly';
24235
- }, [model]); // 注册 form
24236
-
24237
- controller.useForm('realEstateInfo', form);
24238
- return /*#__PURE__*/React__default['default'].createElement("div", {
24239
- className: "kts-invoice-operate-real-estate-info-digtal"
24240
- }, /*#__PURE__*/React__default['default'].createElement("div", {
24241
- className: 'real-estate-info-digtal-label'
24242
- }, "\u7279\u6B8A\u4FE1\u606F-\u5EFA\u7B51\u670D\u52A1"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Row, {
24243
- gutter: [17, 0]
24244
- }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24245
- span: 6
24246
- }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24247
- label: "\u571F\u5730\u589E\u503C\u7A0E\u9879\u76EE\u7F16\u53F7"
24248
- }, getFieldDecorator('landNumber', {})(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
24249
- autoComplete: 'off',
24250
- placeholder: "\u8BF7\u8F93\u5165"
24251
- })))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24252
- span: 6
24253
- }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24254
- label: "\u8DE8\u5730\uFF08\u5E02\uFF09\u6807\u5FD7"
24255
- }, getFieldDecorator('crossCitiesSign', {
24256
- rules: readOnly ? [] : [{
24257
- required: true,
24258
- message: '请选择跨地(市)标志'
24259
- }]
24260
- })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyNY$1, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select, {
24261
- placeholder: "\u8BF7\u9009\u62E9",
24262
- style: {
24263
- width: '100%'
24264
- }
24265
- }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select.Option, {
24266
- value: 'Y'
24267
- }, "\u662F"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select.Option, {
24268
- value: 'N'
24269
- }, "\u5426"))))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24270
- span: 6
24271
- }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24272
- label: "\u5EFA\u7B51\u670D\u52A1\u53D1\u751F\u5730"
24273
- }, getFieldDecorator('constructAddress', {
24274
- rules: readOnly ? [] : [{
24275
- required: true,
24276
- message: '请选择省市区县'
24277
- }]
24278
- })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyArrString$1, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Cascader, {
24279
- style: {
24280
- width: '100%'
24281
- },
24282
- options: props.addressOptions,
24283
- fieldNames: props.fieldNames,
24284
- placeholder: "\u8BF7\u9009\u62E9\u7701\u5E02\u533A\u53BF"
24285
- })))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24286
- span: 6
24287
- }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24288
- label: "\u8BE6\u7EC6\u5730\u5740"
24289
- }, getFieldDecorator('constructDetailAddress', {
24290
- rules: readOnly ? [] : [{
24291
- max: 200,
24292
- message: '详细地址最多200个字符'
24293
- }]
24294
- })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
24295
- autoComplete: 'off',
24296
- placeholder: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740"
24297
- })))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24298
- span: 6
24299
- }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24300
- label: "\u5EFA\u7B51\u9879\u76EE\u540D\u79F0"
24301
- }, getFieldDecorator('constructName', {
24302
- rules: readOnly ? [] : [{
24303
- required: true,
24304
- message: '请输入建筑项目名称'
24305
- }, {
24306
- max: 200,
24307
- message: '建筑项目名称最多200个字符'
24308
- }]
24309
- })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
24310
- autoComplete: 'off',
24311
- placeholder: "\u8BF7\u8F93\u5165"
24312
- }))))));
24313
- });
24314
-
24315
- var MyDiv$4 = /*#__PURE__*/function (_React$Component) {
24316
- _inherits(MyDiv, _React$Component);
24317
-
24318
- var _super = _createSuper(MyDiv);
24319
-
24320
- function MyDiv() {
24321
- _classCallCheck(this, MyDiv);
24322
-
24323
- return _super.apply(this, arguments);
24324
- }
24325
-
24326
- _createClass(MyDiv, [{
24327
- key: "render",
24328
- value: function render() {
24329
- return /*#__PURE__*/React__default['default'].createElement("div", {
24330
- style: this.props.style
24331
- }, this.props.value);
24332
- }
24333
- }]);
24334
-
24335
- return MyDiv;
24336
- }(React__default['default'].Component);
24337
-
24338
- var MyArrString$1 = /*#__PURE__*/function (_React$Component2) {
24339
- _inherits(MyArrString, _React$Component2);
24340
-
24341
- var _super2 = _createSuper(MyArrString);
24342
-
24343
- function MyArrString() {
24344
- _classCallCheck(this, MyArrString);
24345
-
24346
- return _super2.apply(this, arguments);
24347
- }
24348
-
24349
- _createClass(MyArrString, [{
24350
- key: "render",
24351
- value: function render() {
24352
- var _this$props$value;
24353
-
24354
- return /*#__PURE__*/React__default['default'].createElement("div", {
24355
- style: this.props.style
24356
- }, (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (e) {
24357
- return !!e;
24358
- }).join(','));
24359
- }
24360
- }]);
24361
-
24362
- return MyArrString;
24363
- }(React__default['default'].Component);
24364
-
24365
- var MyArrMoment$1 = /*#__PURE__*/function (_React$Component3) {
24366
- _inherits(MyArrMoment, _React$Component3);
24367
-
24368
- var _super3 = _createSuper(MyArrMoment);
24369
-
24370
- function MyArrMoment() {
24371
- _classCallCheck(this, MyArrMoment);
24372
-
24373
- return _super3.apply(this, arguments);
24374
- }
24375
-
24376
- _createClass(MyArrMoment, [{
24377
- key: "render",
24378
- value: function render() {
24379
- var _this$props$value2 = this.props.value,
24380
- value = _this$props$value2 === void 0 ? [] : _this$props$value2;
24381
- return /*#__PURE__*/React__default['default'].createElement("div", {
24382
- style: this.props.style
24383
- }, /*#__PURE__*/React__default['default'].createElement("span", null, hooks.isMoment(value[0]) && value[0].format('YYYY-MM-DD')), /*#__PURE__*/React__default['default'].createElement("span", {
24384
- style: {
24385
- color: '#9F603D',
24386
- fontWeight: 600
24387
- }
24388
- }, " - "), /*#__PURE__*/React__default['default'].createElement("span", null, hooks.isMoment(value[1]) && value[0].format('YYYY-MM-DD')));
24389
- }
24390
- }]);
24391
-
24392
- return MyArrMoment;
24393
- }(React__default['default'].Component);
24394
-
24395
- var MyNY$1 = /*#__PURE__*/function (_React$Component4) {
24396
- _inherits(MyNY, _React$Component4);
24397
-
24398
- var _super4 = _createSuper(MyNY);
24399
-
24400
- function MyNY() {
24401
- _classCallCheck(this, MyNY);
24402
-
24403
- return _super4.apply(this, arguments);
24404
- }
24405
-
24406
- _createClass(MyNY, [{
24407
- key: "render",
24408
- value: function render() {
24409
- return /*#__PURE__*/React__default['default'].createElement("div", {
24410
- style: this.props.style
24411
- }, this.props.value === 'Y' ? '是' : '否');
24412
- }
24413
- }]);
24414
-
24415
- return MyNY;
24416
- }(React__default['default'].Component);
24417
-
24418
- 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";
24419
- styleInject(css_248z$t);
24420
-
24421
- function TableVirtual$2 (props) {
24422
- var _props$dataSource2;
24423
-
24424
- var _React$useState = React__default['default'].useState(null),
24425
- _React$useState2 = _slicedToArray(_React$useState, 2),
24426
- self = _React$useState2[0],
24427
- setSelf = _React$useState2[1];
24428
-
24429
- var tableBody = React__default['default'].useMemo(function () {
24430
- if (!self) return;
24431
- return self.querySelector('.ktsAntX-table-body');
24432
- }, [self]);
24433
- /** 显示指针 */
24434
-
24435
- var _React$useState3 = React__default['default'].useState(0),
24436
- _React$useState4 = _slicedToArray(_React$useState3, 2),
24437
- pointer = _React$useState4[0],
24438
- setPointer = _React$useState4[1];
24439
- /** 行高 */
24440
-
24441
-
24442
- var rowHeight = React__default['default'].useMemo(function () {
24443
- if (!self) return 50;
24444
- var td = self.querySelector('.ktsAntX-table-tbody .ktsAntX-table-row');
24445
- if (!td) return 50;
24446
- return td.clientHeight;
24447
- }, [self, props.dataSource]);
24448
- /** 间隔容器 */
24449
-
24450
- var placeholder = React__default['default'].useMemo(function () {
24451
- if (!self || !tableBody) return;
24452
- var placeholder = tableBody.querySelector('.table-virtual-placeholder');
24453
-
24454
- if (!placeholder) {
24455
- placeholder = document.createElement('div');
24456
- placeholder.className = 'table-virtual-placeholder';
24457
- tableBody.appendChild(placeholder);
24458
- }
24459
-
24460
- return placeholder;
24461
- }, [self, tableBody]); // 设置占位dom的搞
24462
-
24463
- var placeholderHeight = React__default['default'].useMemo(function () {
24464
- if (!self || !rowHeight || !props.dataSource || !placeholder) return;
24465
- var placeholderHeight = rowHeight * props.dataSource.length;
24466
- placeholder.style.height = "".concat(placeholderHeight, "px");
24467
- return placeholderHeight;
24468
- }, [self, rowHeight, props.dataSource, placeholder]);
24469
- /** 可以容纳的行数 */
24470
-
24471
- var rowSize = React__default['default'].useMemo(function () {
24472
- if (!tableBody || !rowHeight) return 0;
24473
- return Math.ceil(tableBody.clientHeight / rowHeight);
24474
- }, [tableBody, rowHeight, placeholderHeight]); // 计算渲染的行
24475
-
24476
- var dataSource = React__default['default'].useMemo(function () {
24477
- var _props$dataSource;
24478
-
24479
- if (!props.dataSource) return [];
24480
- if (props.dataSource.length < 10) return props.dataSource;
24481
- if (!rowSize) return [props.dataSource[0]];
24482
- return (_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.slice(pointer, pointer + 2 * rowSize);
24483
- }, [props.dataSource, pointer, rowSize]); // 监听滚动
24484
-
24485
- React__default['default'].useEffect(function () {
24486
- if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody || props.dataSource.length < 10) return;
24487
-
24488
- var onScroll = function onScroll() {
24489
- if (!props.dataSource || !tableBody) return;
24490
- setPointer(Math.floor((props.dataSource.length - rowSize) * (tableBody.scrollTop / (placeholder.clientHeight - tableBody.clientHeight))));
24491
- };
24492
-
24493
- onScroll();
24494
- tableBody.addEventListener('scroll', onScroll);
24495
- return function () {
24496
- tableBody.removeEventListener('scroll', onScroll);
24497
- };
24498
- }, [self, placeholder, props.dataSource, rowHeight, rowSize]); // 移动列表
24499
-
24500
- React__default['default'].useEffect(function () {
24501
- if (!self) return;
24502
- var table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table');
24503
- if (!table) return;
24504
- table.style.top = "".concat(pointer * rowHeight, "px");
24505
- }, [pointer, self, rowHeight]);
24506
- React__default['default'].useEffect(function () {
24507
- if (!self) return;
24508
- var cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
24509
- if (!cont) return;
24510
- cont.scrollTop = 0;
24511
- }, [(_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.length]);
24512
- return /*#__PURE__*/React__default['default'].createElement("span", {
24513
- className: "kts-invoice-operate-goods-table-virtual",
24514
- ref: function ref(e) {
24515
- setSelf(e);
24516
- }
24517
- }, /*#__PURE__*/React__default['default'].createElement(ktsXui.TableManual, _objectSpread2(_objectSpread2({}, props), {}, {
24518
- dataSource: dataSource,
24519
- // 新版本Table会有输入框无法连续输入的问题,先兼容老版本
24520
- tableComponent: ktsComponentsAntdX4V4.Table
24521
- })));
24522
- }
24523
-
24524
- var AddRowButton$2 = (function () {
24525
- var controller = Invoice.useInvoiceController();
24526
- var model = controller.useMemo(function (s) {
24527
- return s.model;
24528
- }, []);
24529
- var rootElement = controller.useMemo(function (s) {
24530
- return s.rootElement;
24531
- }, []);
24532
- /** 产品数据量 */
24533
-
24534
- var goodsNum = controller.useMemo(function (s) {
24535
- return s.freightListState.goodsList.length;
24536
- }, []);
24537
- /** 搜索条件 */
24538
-
24539
- var isAddRow = controller.useMemo(function (s) {
24540
- return s.freightListState.isAddRow;
24541
- }, []);
24542
- /** 产品最大数 */
24543
-
24544
- var goodMax = controller.useMemo(function (s) {
24545
- return s.freightListState.goodMax;
24546
- }, []);
24547
- /** 按钮是否禁用 */
24548
-
24549
- var disabled = React__default['default'].useMemo(function () {
24550
- return typeof goodMax === 'number' ? goodsNum >= goodMax : false;
24551
- }, [goodMax, goodsNum]);
24552
- var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
24553
- return _regeneratorRuntime().wrap(function _callee$(_context) {
24554
- while (1) {
24555
- switch (_context.prev = _context.next) {
24556
- case 0:
24557
- _context.next = 2;
24558
- return addGood$3(controller);
24559
-
24560
- case 2:
24561
- _context.next = 4;
24562
- return rollBottom$2(controller, rootElement);
24563
-
24564
- case 4:
24565
- case "end":
24566
- return _context.stop();
24567
- }
24568
- }
24569
- }, _callee);
24570
- })), [controller, rootElement]);
24571
- if (isAddRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
24572
- if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
24573
- if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
24574
- return /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
24575
- size: 'small',
24576
- type: 'primary',
24577
- onClick: onClick,
24578
- disabled: disabled
24579
- }, "\u589E\u884C");
24580
- });
24581
- /** 添加一个空货物 */
24582
-
24583
- function addGood$3(_x) {
24584
- return _addGood$2.apply(this, arguments);
24585
- }
24586
- /** 货物列表,滚动到底部 */
24587
-
24588
-
24589
- function _addGood$2() {
24590
- _addGood$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(controller) {
24591
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
24592
- while (1) {
24593
- switch (_context3.prev = _context3.next) {
24594
- case 0:
24595
- _context3.next = 2;
24596
- return controller.saveEditFreight();
24597
-
24598
- case 2:
24599
- _context3.next = 4;
24600
- return controller.wait();
24601
-
24602
- case 4:
24603
- _context3.next = 6;
24604
- return controller.run( /*#__PURE__*/function () {
24605
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
24606
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
24607
- while (1) {
24608
- switch (_context2.prev = _context2.next) {
24609
- case 0:
24610
- if (!s.freightListState.editGood) {
24611
- _context2.next = 3;
24612
- break;
24613
- }
24614
-
24615
- ktsXui.message.error({
24616
- content: '你正在编辑一个货物运输行',
24617
- key: '你正在编辑一个货物运输行'
24618
- });
24619
- return _context2.abrupt("return");
24620
-
24621
- case 3:
24622
- _context2.next = 5;
24623
- return controller.addFreight({});
24624
-
24625
- case 5:
24626
- s.freightListState.editGood = _context2.sent;
24627
-
24628
- case 6:
24629
- case "end":
24630
- return _context2.stop();
24631
- }
24632
- }
24633
- }, _callee2);
24634
- }));
24635
-
24636
- return function (_x4) {
24637
- return _ref2.apply(this, arguments);
24638
- };
24639
- }());
24640
-
24641
- case 6:
24642
- case "end":
24643
- return _context3.stop();
24644
- }
24645
- }
24646
- }, _callee3);
24647
- }));
24648
- return _addGood$2.apply(this, arguments);
24649
- }
24650
-
24651
- function rollBottom$2(_x2, _x3) {
24652
- return _rollBottom$2.apply(this, arguments);
24653
- }
24654
-
24655
- function _rollBottom$2() {
24656
- _rollBottom$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller, rootElement) {
24657
- var cont;
24658
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
24659
- while (1) {
24660
- switch (_context4.prev = _context4.next) {
24661
- case 0:
24662
- _context4.next = 2;
24663
- return controller.wait();
24664
-
24665
- case 2:
24666
- cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
24667
-
24668
- if (cont) {
24669
- _context4.next = 5;
24670
- break;
24671
- }
24672
-
24673
- return _context4.abrupt("return");
24674
-
24675
- case 5:
24676
- cont.scrollTop = cont.scrollHeight;
24677
-
24678
- case 6:
24679
- case "end":
24680
- return _context4.stop();
24681
- }
24682
- }
24683
- }, _callee4);
24684
- }));
24685
- return _rollBottom$2.apply(this, arguments);
24686
- }
24687
-
24688
- 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";
24689
- styleInject(css_248z$u);
24690
-
24691
- function TableRow$2(props) {
24692
- var rowKey = props['data-row-key'];
24693
- return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
24694
- className: classnames__default['default'](props.className)
24695
- }));
24696
- }
24697
-
24698
- var Text$6 = ktsComponentsAntdX3.Typography.Text;
24699
- var TitleText$2 = (function (props) {
24700
- var rules = props.rules,
24701
- children = props.children;
24702
- var required = React__default['default'].useMemo(function () {
24703
- return (rules === null || rules === void 0 ? void 0 : rules.some(function (e) {
24704
- return !!e.required;
24705
- })) || props.required;
24706
- }, [rules, props.required]);
24707
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, required ? /*#__PURE__*/React__default['default'].createElement(Text$6, {
24708
- type: "danger"
24709
- }, "*") : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null), children);
24710
- });
24711
-
24712
- var useColumns$2 = (function (form) {
24713
- var getFieldDecorator = form.getFieldDecorator;
24714
- var controller = Invoice.useInvoiceController();
24715
- var rootElement = controller.useMemo(function (s) {
24716
- return s.rootElement;
24717
- }, []);
24718
- /** 组件模式 */
24719
-
24720
- var model = controller.useMemo(function (e) {
24721
- return e.model;
24722
- }, []);
24723
- /** 正在编辑的货物 */
24724
-
24725
- var editGood = controller.useMemo(function (e) {
24726
- return e.freightListState.editGood;
24727
- }, []);
24728
- /** 禁用字段 */
24729
-
24730
- var disableds = controller.useMemo(function (e) {
24731
- return e.stakeholder.disableds || [];
24732
- }, []);
24733
- /** 运输工具种类列表 */
24734
-
24735
- var vehicleTypeList = controller.useMemo(function (e) {
24736
- return e.freightListState.vehicleTypeList;
24737
- }, []);
24738
- var area = controller.useMemo(function (e) {
24739
- return e.freightListState.area;
24740
- }, []);
24741
- var addressFieldNames = controller.useMemo(function (e) {
24742
- return e.freightListState.addressFieldNames;
24743
- }, []);
24744
- var getVehicle = React__default['default'].useCallback(function (value) {
24745
- if (vehicleTypeList && vehicleTypeList.length > 0) {
24746
- var _vehicleTypeList$find;
24747
-
24748
- return ((_vehicleTypeList$find = vehicleTypeList.find(function (e) {
24749
- return e.value === value;
24750
- })) === null || _vehicleTypeList$find === void 0 ? void 0 : _vehicleTypeList$find.label) || '';
24751
- }
24752
- }, [vehicleTypeList]);
24753
- var splitArea = React__default['default'].useCallback(function (value) {
24754
- if (value) {
24755
- var _array = value.split(',');
24756
-
24757
- return _array;
24758
- } else {
24759
- return [];
24760
- }
24761
- }, []);
24762
- /** 表头 */
24763
-
24764
- var columns = React__default['default'].useMemo(function () {
24765
- return [{
24766
- title: '序号',
24767
- key: 'sortNumber',
24768
- dataIndex: 'sortNumber',
24769
- width: 50,
24770
- render: function render(e) {
24771
- return /*#__PURE__*/React__default['default'].createElement("span", {
24772
- style: {
24773
- padding: '0 10px'
24774
- }
24775
- }, e);
24776
- }
24777
- }, {
24778
- title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
24779
- required: true
24780
- }, "\u8FD0\u8F93\u5DE5\u5177\u79CD\u7C7B"),
24781
- key: 'type',
24782
- render: function render(_, record) {
24783
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('type') && !(model === 'prefab')) {
24784
- return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('type', {
24785
- initialValue: editGood.type,
24786
- rules: [{
24787
- required: true,
24788
- message: '请输入'
24789
- }]
24790
- })( /*#__PURE__*/React__default['default'].createElement(ktsXui.Select, {
24791
- className: "kts-invoice-operate-goods-list-table-tax-rate",
24792
- showArrow: false,
24793
- style: {
24794
- width: '100%'
24795
- },
24796
- getPopupContainer: function getPopupContainer() {
24797
- return rootElement || document.body;
24798
- },
24799
- onChange: function () {
24800
- var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
24801
- return _regeneratorRuntime().wrap(function _callee$(_context) {
24802
- while (1) {
24803
- switch (_context.prev = _context.next) {
24804
- case 0:
24805
- _context.next = 2;
24806
- return controller.wait();
24807
-
24808
- case 2:
24809
- controller.setEditFreight({
24810
- type: value
24811
- });
24812
-
24813
- case 3:
24814
- case "end":
24815
- return _context.stop();
24816
- }
24817
- }
24818
- }, _callee);
24819
- }));
24820
-
24821
- function onChange(_x) {
24822
- return _onChange.apply(this, arguments);
24823
- }
24824
-
24825
- return onChange;
24826
- }()
24827
- }, (record.vehicleList || vehicleTypeList).map(function (e, i) {
24828
- return /*#__PURE__*/React__default['default'].createElement(ktsXui.Select.Option, {
24829
- key: i,
24830
- value: e.value
24831
- }, e.label);
24832
- }))));
24833
- } else {
24834
- return /*#__PURE__*/React__default['default'].createElement("span", {
24835
- style: {
24836
- padding: '0 10px'
24837
- }
24838
- }, getVehicle(record.type));
24839
- }
24840
- }
24841
- }, {
24842
- title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
24843
- required: true
24844
- }, "\u8FD0\u8F93\u5DE5\u5177\u724C\u53F7"),
24845
- key: 'licensePlate',
24846
- width: 119,
24847
- render: function render(_, record) {
24848
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('licensePlate') && model !== 'prefab') {
24849
- return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('licensePlate', {
24850
- initialValue: editGood.licensePlate,
24851
- rules: [{
24852
- required: true,
24853
- message: '请输入'
24854
- }]
24855
- })( /*#__PURE__*/React__default['default'].createElement(MyInput$4, {
24856
- maxLength: 200,
24857
- onChange: function () {
24858
- var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
24859
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
24860
- while (1) {
24861
- switch (_context2.prev = _context2.next) {
24862
- case 0:
24863
- _context2.next = 2;
24864
- return controller.wait();
24865
-
24866
- case 2:
24867
- _context2.next = 4;
24868
- return controller.setEditFreight({
24869
- licensePlate: form.getFieldsValue().licensePlate
24870
- });
24871
-
24872
- case 4:
24873
- case "end":
24874
- return _context2.stop();
24875
- }
24876
- }
24877
- }, _callee2);
24878
- }));
24879
-
24880
- function onChange() {
24881
- return _onChange2.apply(this, arguments);
24882
- }
24883
-
24884
- return onChange;
24885
- }()
24886
- })));
24887
- } else {
24888
- return /*#__PURE__*/React__default['default'].createElement("span", {
24889
- style: {
24890
- padding: '0 10px'
24891
- }
24892
- }, record.licensePlate);
24893
- }
24894
- }
24895
- }, {
24896
- title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
24897
- required: true
24898
- }, "\u8D77\u8FD0\u5730"),
24899
- key: 'origin',
24900
- width: 150,
24901
- render: function render(_, record) {
24902
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('origin') && model !== 'prefab') {
24903
- return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('origin', {
24904
- initialValue: editGood.origin,
24905
- rules: [{
24906
- required: true,
24907
- message: '请输入'
24908
- }]
24909
- })( /*#__PURE__*/React__default['default'].createElement(ktsXui.Cascader, {
24910
- style: {
24911
- width: '100%'
24912
- },
24913
- options: area,
24914
- fieldNames: addressFieldNames,
24915
- onChange: function () {
24916
- var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value) {
24917
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
24918
- while (1) {
24919
- switch (_context3.prev = _context3.next) {
24920
- case 0:
24921
- _context3.next = 2;
24922
- return controller.setEditFreight({
24923
- origin: value
24924
- });
24925
-
24926
- case 2:
24927
- case "end":
24928
- return _context3.stop();
24929
- }
24930
- }
24931
- }, _callee3);
24932
- }));
24933
-
24934
- function onChange(_x2) {
24935
- return _onChange3.apply(this, arguments);
24936
- }
24937
-
24938
- return onChange;
24939
- }()
24940
- })));
24941
- } else {
24942
- return /*#__PURE__*/React__default['default'].createElement("span", {
24943
- style: {
24944
- padding: '0 10px'
24945
- }
24946
- }, record.origin);
24947
- }
24948
- }
24949
- }, {
24950
- title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
24951
- required: true
24952
- }, "\u5230\u8FBE\u5730"),
24953
- dataIndex: 'destination',
24954
- key: 'destination',
24955
- width: 149,
24956
- render: function render(_, record) {
24957
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('destination') && model !== 'prefab') {
24958
- return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('destination', {
24959
- initialValue: editGood.destination,
24960
- rules: [{
24961
- required: true,
24962
- message: '请输入'
24963
- }]
24964
- })( /*#__PURE__*/React__default['default'].createElement(ktsXui.Cascader, {
24965
- options: area,
24966
- fieldNames: addressFieldNames,
24967
- style: {
24968
- width: '100%'
24969
- },
24970
- onChange: function () {
24971
- var _onChange4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(value) {
24972
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
24973
- while (1) {
24974
- switch (_context4.prev = _context4.next) {
24975
- case 0:
24976
- _context4.next = 2;
24977
- return controller.setEditFreight({
24978
- destination: value
24979
- });
24980
-
24981
- case 2:
24982
- case "end":
24983
- return _context4.stop();
24984
- }
24985
- }
24986
- }, _callee4);
24987
- }));
24988
-
24989
- function onChange(_x3) {
24990
- return _onChange4.apply(this, arguments);
24991
- }
24992
-
24993
- return onChange;
24994
- }()
24995
- })));
24996
- } else {
24997
- return /*#__PURE__*/React__default['default'].createElement("span", {
24998
- style: {
24999
- padding: '0 10px'
25000
- }
25001
- }, record.destination);
25002
- }
25003
- }
25004
- }, {
25005
- title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
25006
- required: true
25007
- }, "\u8FD0\u8F93\u8D27\u7269\u540D\u79F0"),
25008
- dataIndex: 'itemName',
25009
- key: 'itemName',
25010
- width: 149,
25011
- render: function render(_, record) {
25012
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('itemName') && model !== 'prefab') {
25013
- return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('itemName', {
25014
- initialValue: editGood.itemName,
25015
- rules: [{
25016
- required: true,
25017
- message: '请输入货物名称'
25018
- }]
25019
- })( /*#__PURE__*/React__default['default'].createElement(MyInput$4, {
25020
- maxLength: 200,
25021
- onChange: function () {
25022
- var _onChange5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
25023
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
25024
- while (1) {
25025
- switch (_context5.prev = _context5.next) {
25026
- case 0:
25027
- _context5.next = 2;
25028
- return controller.wait();
25029
-
25030
- case 2:
25031
- _context5.next = 4;
25032
- return controller.setEditFreight({
25033
- itemName: form.getFieldsValue().itemName
25034
- });
25035
-
25036
- case 4:
25037
- case "end":
25038
- return _context5.stop();
25039
- }
25040
- }
25041
- }, _callee5);
25042
- }));
25043
-
25044
- function onChange() {
25045
- return _onChange5.apply(this, arguments);
25046
- }
25047
-
25048
- return onChange;
25049
- }()
25050
- })));
25051
- } else {
25052
- return /*#__PURE__*/React__default['default'].createElement("span", {
25053
- style: {
25054
- padding: '0 10px'
25055
- }
25056
- }, record.itemName);
25057
- }
25058
- }
25059
- }] // 只读
25060
- .filter(function (e) {
25061
- if (model === 'readOnly') {
25062
- return e.key !== 'operating';
25063
- } else {
25064
- return true;
25065
- }
25066
- }).map(function (e) {
25067
- return _objectSpread2(_objectSpread2({}, e), {}, {
25068
- ellipsis: true
25069
- });
25070
- });
25071
- }, [editGood, controller, model, getVehicle]);
25072
- return columns;
25073
- });
25074
-
25075
- var MyInput$4 = /*#__PURE__*/function (_React$Component) {
25076
- _inherits(MyInput, _React$Component);
25077
-
25078
- var _super = _createSuper(MyInput);
25079
-
25080
- function MyInput() {
25081
- _classCallCheck(this, MyInput);
25082
-
25083
- return _super.apply(this, arguments);
25084
- }
25085
-
25086
- _createClass(MyInput, [{
25087
- key: "render",
25088
- value: function render() {
25089
- if (this.props.loading) {
25090
- return /*#__PURE__*/React__default['default'].createElement(ktsXui.Spin, {
25091
- size: "small"
25092
- }, /*#__PURE__*/React__default['default'].createElement(ktsXui.Input, _objectSpread2(_objectSpread2({}, this.props), {}, {
25093
- autoComplete: "off"
25094
- })));
25095
- } else {
25096
- return /*#__PURE__*/React__default['default'].createElement(ktsXui.Input, _objectSpread2(_objectSpread2({}, this.props), {}, {
25097
- autoComplete: "off"
25098
- }));
25099
- }
25100
- }
25101
- }]);
25102
-
25103
- return MyInput;
25104
- }(React__default['default'].Component);
25105
-
25106
- var useOnRow$2 = (function () {
25107
- /** 控制器 */
25108
- var controller = Invoice.useInvoiceController();
25109
- var model = controller.useMemo(function (s) {
25110
- return s.model;
25111
- }, []);
25112
- var onClick = React__default['default'].useCallback( /*#__PURE__*/function () {
25113
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(record) {
25114
- var editGood;
25115
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25116
- while (1) {
25117
- switch (_context2.prev = _context2.next) {
25118
- case 0:
25119
- if (!(model === 'readOnly')) {
25120
- _context2.next = 2;
25121
- break;
25122
- }
25123
-
25124
- return _context2.abrupt("return");
25125
-
25126
- case 2:
25127
- editGood = controller.state.freightListState.editGood;
25128
-
25129
- if (!editGood) {
25130
- _context2.next = 14;
25131
- break;
25132
- }
25133
-
25134
- if (!(editGood.$index === record.$index)) {
25135
- _context2.next = 6;
25136
- break;
25137
- }
25138
-
25139
- return _context2.abrupt("return");
25140
-
25141
- case 6:
25142
- _context2.next = 8;
25143
- return controller.saveEditFreight();
25144
-
25145
- case 8:
25146
- _context2.next = 10;
25147
- return controller.wait();
25148
-
25149
- case 10:
25150
- _context2.next = 12;
25151
- return controller.pipeline( /*#__PURE__*/function () {
25152
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
25153
- return _regeneratorRuntime().wrap(function _callee$(_context) {
25154
- while (1) {
25155
- switch (_context.prev = _context.next) {
25156
- case 0:
25157
- _context.t0 = s.freightListState.editGood;
25158
-
25159
- if (_context.t0) {
25160
- _context.next = 4;
25161
- break;
25162
- }
25163
-
25164
- _context.next = 4;
25165
- return controller.setEditFreight(record);
25166
-
25167
- case 4:
25168
- case "end":
25169
- return _context.stop();
25170
- }
25171
- }
25172
- }, _callee);
25173
- }));
25174
-
25175
- return function (_x2) {
25176
- return _ref2.apply(this, arguments);
25177
- };
25178
- }())();
25179
-
25180
- case 12:
25181
- _context2.next = 16;
25182
- break;
25183
-
25184
- case 14:
25185
- _context2.next = 16;
25186
- return controller.setEditFreight(record);
25187
-
25188
- case 16:
25189
- case "end":
25190
- return _context2.stop();
25191
- }
25192
- }
25193
- }, _callee2);
25194
- }));
25195
-
25196
- return function (_x) {
25197
- return _ref.apply(this, arguments);
25198
- };
25199
- }(), [controller, model]);
25200
- return {
25201
- onClick: onClick
25202
- };
25203
- });
25204
-
25205
- /**
25206
- * 点击组件外部 保存正在编辑的货物
25207
- */
25208
- /**
25209
- * 点击组件外部 保存正在编辑的货物
25210
- */
25211
-
25212
- function useWindowClick$2(controller) {
25213
- /** 点击组件外部 保存正在编辑的货物 */
25214
- React__default['default'].useEffect(function () {
25215
- var click = function click() {
25216
- setTimeout(controller.saveEditFreight);
25217
- };
25218
-
25219
- window.addEventListener('click', click);
25220
- return function () {
25221
- window.removeEventListener('click', click);
25222
- };
25223
- }, [controller]);
25224
- }
25225
-
25226
- var useRowSelection$2 = (function () {
25227
- /** 控制器 */
25228
- var controller = Invoice.useInvoiceController();
25229
- /** 列表选中的货物索引列表 */
25230
-
25231
- var selectedRowKeys = controller.useMemo(function (s) {
25232
- return s.freightListState.selectedGoodIndex;
25233
- }, []);
25234
- /** 货物列表 */
25235
-
25236
- var goodsList = controller.useMemo(function (s) {
25237
- return s.freightListState.goodsList;
25238
- }, []);
25239
- /** 组件模式 */
25240
-
25241
- var model = controller.useMemo(function (s) {
25242
- return s.model;
25243
- }, []);
25244
- /** 搜索条件 */
25245
- // const searchValue = controller.useMemo(s => s.goodsListState.searchValue, []);
25246
-
25247
- /** 是否显示选择框 */
25248
-
25249
- var isShow = React__default['default'].useMemo(function () {
25250
- if (model === 'readOnly') return false;
25251
- return true;
25252
- }, [model]);
25253
- /** 是否全选 */
25254
- // const isAll = controller.useMemo(s => s.goodsListState.goodsList.length > 0 && s.goodsListState.selectedGoodIndex.length === s.goodsListState.goodsList.length, [])
25255
-
25256
- var isAll = controller.useMemo(function (s) {
25257
- if (s.freightListState.selectedGoodIndex.length <= 0) return false;
25258
- var seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
25259
- return e.$index;
25260
- });
25261
- var selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25262
- return seeGoodsIndex.some(function (t) {
25263
- return e === t;
25264
- });
25265
- });
25266
- return selectedGoodIndex.length === seeGoodsIndex.length;
25267
- }, []);
25268
- var indeterminate = controller.useMemo(function (s) {
25269
- var seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
25270
- return e.$index;
25271
- });
25272
- var selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25273
- return seeGoodsIndex.some(function (t) {
25274
- return e === t;
25275
- });
25276
- });
25277
- if (selectedGoodIndex.length === 0) return false;
25278
- return selectedGoodIndex.length < seeGoodsIndex.length;
25279
- }, []);
25280
- /** 点击了全选 */
25281
-
25282
- var onClickSelectAll = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
25283
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
25284
- while (1) {
25285
- switch (_context3.prev = _context3.next) {
25286
- case 0:
25287
- if (!isAll) {
25288
- _context3.next = 5;
25289
- break;
25290
- }
25291
-
25292
- _context3.next = 3;
25293
- return controller.pipeline( /*#__PURE__*/function () {
25294
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
25295
- var seeGoodsIndex;
25296
- return _regeneratorRuntime().wrap(function _callee$(_context) {
25297
- while (1) {
25298
- switch (_context.prev = _context.next) {
25299
- case 0:
25300
- seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
25301
- return e.$index;
25302
- });
25303
- s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25304
- return !seeGoodsIndex.some(function (t) {
25305
- return e === t;
25306
- });
25307
- });
25308
-
25309
- case 2:
25310
- case "end":
25311
- return _context.stop();
25312
- }
25313
- }
25314
- }, _callee);
25315
- }));
25316
-
25317
- return function (_x) {
25318
- return _ref2.apply(this, arguments);
25319
- };
25320
- }())();
25321
-
25322
- case 3:
25323
- _context3.next = 7;
25324
- break;
25325
-
25326
- case 5:
25327
- _context3.next = 7;
25328
- return controller.pipeline( /*#__PURE__*/function () {
25329
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
25330
- var seeGoodsIndex;
25331
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25332
- while (1) {
25333
- switch (_context2.prev = _context2.next) {
25334
- case 0:
25335
- seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
25336
- return e.$index;
25337
- });
25338
- s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), _toConsumableArray(seeGoodsIndex));
25339
- s.freightListState.selectedGoodIndex = Array.from(new Set(s.freightListState.selectedGoodIndex));
25340
-
25341
- case 3:
25342
- case "end":
25343
- return _context2.stop();
25344
- }
25345
- }
25346
- }, _callee2);
25347
- }));
25348
-
25349
- return function (_x2) {
25350
- return _ref3.apply(this, arguments);
25351
- };
25352
- }())();
25353
-
25354
- case 7:
25355
- case "end":
25356
- return _context3.stop();
25357
- }
25358
- }
25359
- }, _callee3);
25360
- })), [controller, isAll]);
25361
- var onSelect = React__default['default'].useCallback( /*#__PURE__*/function () {
25362
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(record, selected) {
25363
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
25364
- while (1) {
25365
- switch (_context6.prev = _context6.next) {
25366
- case 0:
25367
- if (!selected) {
25368
- _context6.next = 5;
25369
- break;
25370
- }
25371
-
25372
- _context6.next = 3;
25373
- return controller.pipeline( /*#__PURE__*/function () {
25374
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
25375
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
25376
- while (1) {
25377
- switch (_context4.prev = _context4.next) {
25378
- case 0:
25379
- s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), [record.$index]);
25380
- s.freightListState = _objectSpread2({}, s.freightListState);
25381
-
25382
- case 2:
25383
- case "end":
25384
- return _context4.stop();
25385
- }
25386
- }
25387
- }, _callee4);
25388
- }));
25389
-
25390
- return function (_x5) {
25391
- return _ref5.apply(this, arguments);
25392
- };
25393
- }())();
25394
-
25395
- case 3:
25396
- _context6.next = 7;
25397
- break;
25398
-
25399
- case 5:
25400
- _context6.next = 7;
25401
- return controller.pipeline( /*#__PURE__*/function () {
25402
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
25403
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
25404
- while (1) {
25405
- switch (_context5.prev = _context5.next) {
25406
- case 0:
25407
- s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25408
- return e !== record.$index;
25409
- });
25410
- s.freightListState = _objectSpread2({}, s.freightListState);
25411
-
25412
- case 2:
25413
- case "end":
25414
- return _context5.stop();
25415
- }
25416
- }
25417
- }, _callee5);
25418
- }));
25419
-
25420
- return function (_x6) {
25421
- return _ref6.apply(this, arguments);
25422
- };
25423
- }())();
25424
-
25425
- case 7:
25426
- case "end":
25427
- return _context6.stop();
25428
- }
25429
- }
25430
- }, _callee6);
25431
- }));
25432
-
25433
- return function (_x3, _x4) {
25434
- return _ref4.apply(this, arguments);
25435
- };
25436
- }(), [controller]);
25437
- var columnTitle = React__default['default'].useMemo(function () {
25438
- return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Checkbox, {
25439
- onChange: onClickSelectAll,
25440
- indeterminate: indeterminate,
25441
- checked: isAll
25442
- });
25443
- }, [goodsList, selectedRowKeys, onClickSelectAll, isAll, indeterminate]);
25444
- /** 选择了商品后 调整 折扣行 和 被折扣行 */
25445
-
25446
- var sortOut = React__default['default'].useCallback( /*#__PURE__*/function () {
25447
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(selected) {
25448
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
25449
- while (1) {
25450
- switch (_context8.prev = _context8.next) {
25451
- case 0:
25452
- _context8.next = 2;
25453
- return controller.wait();
25454
-
25455
- case 2:
25456
- _context8.next = 4;
25457
- return controller.pipeline( /*#__PURE__*/function () {
25458
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s) {
25459
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
25460
- while (1) {
25461
- switch (_context7.prev = _context7.next) {
25462
- case 0:
25463
- s.freightListState.selectedGoodIndex.forEach(function ($index) {
25464
- var goods = s.freightListState.goodsMap.get($index);
25465
- if (!goods) return; // 数组位置
25466
-
25467
- var t = s.freightListState.goodsList.indexOf(goods); // goods.lineAttribute === LineAttributeType.折扣行 ? t : t++;
25468
-
25469
- var i = s.goodsListState.goodsList[t].$index;
25470
-
25471
- if (selected) {
25472
- if (s.freightListState.selectedGoodIndex.indexOf(i) < 0) s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), [i]);
25473
- } else {
25474
- if (s.freightListState.selectedGoodIndex.indexOf(i) < 0) s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
25475
- return e !== $index;
25476
- });
25477
- }
25478
- });
25479
-
25480
- case 1:
25481
- case "end":
25482
- return _context7.stop();
25483
- }
25484
- }
25485
- }, _callee7);
25486
- }));
25487
-
25488
- return function (_x8) {
25489
- return _ref8.apply(this, arguments);
25490
- };
25491
- }())();
25492
-
25493
- case 4:
25494
- case "end":
25495
- return _context8.stop();
25496
- }
25497
- }
25498
- }, _callee8);
25499
- }));
25500
-
25501
- return function (_x7) {
25502
- return _ref7.apply(this, arguments);
25503
- };
25504
- }(), [controller]); // React.useEffect(() => {
25505
- // sortOut(true);
25506
- // }, [sortOut, goodsList])
25507
-
25508
- if (isShow === false) return undefined;
25509
- return {
25510
- columnWidth: 45,
25511
- columnTitle: columnTitle,
25512
- onSelect: onSelect,
25513
- selectedRowKeys: selectedRowKeys
25514
- };
25515
- });
25516
-
25517
- var useDelRowButton$2 = (function () {
25518
- var controller = Invoice.useInvoiceController();
25519
- var model = controller.useMemo(function (s) {
25520
- return s.model;
25521
- }, []);
25522
- var isRemRow = controller.useMemo(function (s) {
25523
- return s.freightListState.isRemRow;
25524
- }, []);
25525
- /** 是否禁用 */
25526
-
25527
- var disabled = controller.useMemo(function (s) {
25528
- if (s.freightListState.selectedGoodIndex.length <= 0) return true;
25529
- return false;
25530
- }, []);
25531
- /** 点击了删除 */
25532
-
25533
- var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
25534
- var selectedGoodIndex, i;
25535
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25536
- while (1) {
25537
- switch (_context2.prev = _context2.next) {
25538
- case 0:
25539
- selectedGoodIndex = controller.state.freightListState.selectedGoodIndex.slice();
25540
- i = 0;
25541
-
25542
- case 2:
25543
- if (!(i < selectedGoodIndex.length)) {
25544
- _context2.next = 8;
25545
- break;
25546
- }
25547
-
25548
- _context2.next = 5;
25549
- return controller.delFreight(selectedGoodIndex[i]);
25550
-
25551
- case 5:
25552
- i++;
25553
- _context2.next = 2;
25554
- break;
25555
-
25556
- case 8:
25557
- _context2.next = 10;
25558
- return controller.run( /*#__PURE__*/function () {
25559
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
25560
- return _regeneratorRuntime().wrap(function _callee$(_context) {
25561
- while (1) {
25562
- switch (_context.prev = _context.next) {
25563
- case 0:
25564
- s.freightListState.selectedGoodIndex = [];
25565
-
25566
- case 1:
25567
- case "end":
25568
- return _context.stop();
25569
- }
25570
- }
25571
- }, _callee);
25572
- }));
25573
-
25574
- return function (_x) {
25575
- return _ref2.apply(this, arguments);
25576
- };
25577
- }());
25578
-
25579
- case 10:
25580
- case "end":
25581
- return _context2.stop();
25582
- }
25583
- }
25584
- }, _callee2);
25585
- })), []);
25586
- var menuItem = React__default['default'].useMemo(function () {
25587
- if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
25588
- if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
25589
- return /*#__PURE__*/React__default['default'].createElement(ktsXui.Menu.Item, {
25590
- key: "1",
25591
- onClick: onClick,
25592
- disabled: disabled
25593
- }, " \u5220\u9664\u884C ");
25594
- }, [model, onClick, disabled]);
25595
- var button = React__default['default'].useMemo(function () {
25596
- if (isRemRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
25597
- if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
25598
- if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
25599
- return /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
25600
- size: 'small',
25601
- onClick: onClick,
25602
- disabled: disabled
25603
- }, "\u5220\u9664");
25604
- }, [model, onClick, disabled, isRemRow]);
25605
- return {
25606
- button: button,
25607
- menuItem: menuItem
25608
- };
25609
- });
25610
-
25611
- 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";
25612
- styleInject(css_248z$v);
25613
-
25614
- var FreightList = /*#__PURE__*/function (_React$Component) {
25615
- _inherits(FreightList, _React$Component);
25616
-
25617
- var _super = _createSuper(FreightList);
25618
-
25619
- function FreightList() {
25620
- _classCallCheck(this, FreightList);
25621
-
25622
- return _super.apply(this, arguments);
25623
- }
25624
-
25625
- _createClass(FreightList, [{
25626
- key: "render",
25627
- value: function render() {
25628
- return /*#__PURE__*/React__default['default'].createElement(Main$4, _objectSpread2({}, this.props));
25629
- }
25630
- }]);
25631
-
25632
- return FreightList;
25633
- }(React__default['default'].Component);
25634
- var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
25635
- var form = props.form;
25636
- /** 控制器 */
25637
-
25638
- var controller = Invoice.useInvoiceController();
25639
- var goodsList = controller.useMemo(function (s) {
25640
- return s.freightListState.goodsList;
25641
- }, []);
25642
- /** 货物列表 */
25643
-
25644
- var dataSource = controller.useMemo(function (s) {
25645
- return s.freightListState.goodsList;
25646
- }, []);
25647
- /** 表格行事件 */
25648
-
25649
- var _onRow = useOnRow$2();
25650
- /** 批量删除 */
25651
-
25652
-
25653
- var delRowButton = useDelRowButton$2();
25654
- useWindowClick$2(controller); // 点击组件外部 保存正在编辑的货物
25655
-
25656
- /** 注册 from 对象 */
25657
-
25658
- React__default['default'].useEffect(function () {
25659
- controller.pipeline( /*#__PURE__*/function () {
25660
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s, form) {
25661
- return _regeneratorRuntime().wrap(function _callee$(_context) {
25662
- while (1) {
25663
- switch (_context.prev = _context.next) {
25664
- case 0:
25665
- s.freightListState = _objectSpread2(_objectSpread2({}, s.freightListState), {}, {
25666
- form: form
25667
- });
25668
-
25669
- case 1:
25670
- case "end":
25671
- return _context.stop();
25672
- }
25673
- }
25674
- }, _callee);
25675
- }));
25676
-
25677
- return function (_x, _x2) {
25678
- return _ref.apply(this, arguments);
25679
- };
25680
- }())(props.form);
25681
- }, [controller, props.form]);
25682
- React__default['default'].useEffect(function () {
25683
- controller.run( /*#__PURE__*/function () {
25684
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
25685
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25686
- while (1) {
25687
- switch (_context2.prev = _context2.next) {
25688
- case 0:
25689
- s.freightListState.addressFieldNames = props.fieldNames;
25690
-
25691
- case 1:
25692
- case "end":
25693
- return _context2.stop();
25694
- }
25695
- }
25696
- }, _callee2);
25697
- }));
25698
-
25699
- return function (_x3) {
25700
- return _ref2.apply(this, arguments);
25701
- };
25702
- }());
25703
- }, [props.fieldNames]);
25704
- React__default['default'].useEffect(function () {
25705
- controller.run( /*#__PURE__*/function () {
25706
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
25707
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
25708
- while (1) {
25709
- switch (_context3.prev = _context3.next) {
25710
- case 0:
25711
- s.freightListState.vehicleTypeList = props.vehicleTypeList;
25712
-
25713
- case 1:
25714
- case "end":
25715
- return _context3.stop();
25716
- }
25717
- }
25718
- }, _callee3);
25719
- }));
25720
-
25721
- return function (_x4) {
25722
- return _ref3.apply(this, arguments);
25723
- };
25724
- }());
25725
- }, [props.vehicleTypeList]);
25726
- React__default['default'].useEffect(function () {
25727
- controller.run( /*#__PURE__*/function () {
25728
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
25729
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
25730
- while (1) {
25731
- switch (_context4.prev = _context4.next) {
25732
- case 0:
25733
- s.freightListState.area = props.addressOptions;
25734
-
25735
- case 1:
25736
- case "end":
25737
- return _context4.stop();
25738
- }
25739
- }
25740
- }, _callee4);
25741
- }));
25742
-
25743
- return function (_x5) {
25744
- return _ref4.apply(this, arguments);
25745
- };
25746
- }());
25747
- }, [props.addressOptions]); // 跟新 货物
25748
-
25749
- React__default['default'].useEffect(function () {
25750
- controller.run( /*#__PURE__*/function () {
25751
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
25752
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
25753
- while (1) {
25754
- switch (_context5.prev = _context5.next) {
25755
- case 0:
25756
- s.freightListState.goodsMap = new Map();
25757
- goodsList.forEach(function (e) {
25758
- s.freightListState.goodsMap.set(e.$index, e);
25759
- });
25760
-
25761
- case 2:
25762
- case "end":
25763
- return _context5.stop();
25764
- }
25765
- }
25766
- }, _callee5);
25767
- }));
25768
-
25769
- return function (_x6) {
25770
- return _ref5.apply(this, arguments);
25771
- };
25772
- }());
25773
- }, [controller, goodsList]);
25774
- /** props 产品最大数 更新 */
25775
-
25776
- React__default['default'].useEffect(function () {
25777
- controller.pipeline( /*#__PURE__*/function () {
25778
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
25779
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
25780
- while (1) {
25781
- switch (_context6.prev = _context6.next) {
25782
- case 0:
25783
- s.freightListState.goodMax = props.goodMax;
25784
-
25785
- case 1:
25786
- case "end":
25787
- return _context6.stop();
25788
- }
25789
- }
25790
- }, _callee6);
25791
- }));
25792
-
25793
- return function (_x7) {
25794
- return _ref6.apply(this, arguments);
25795
- };
25796
- }())();
25797
- }, [controller, props.goodMax]); // 注册 form
25798
- // controller.useForm('freightInfo', form);
25799
-
25800
- return /*#__PURE__*/React__default['default'].createElement("div", {
25801
- className: "kts-invoice-operate-freight"
25802
- }, /*#__PURE__*/React__default['default'].createElement("div", {
25803
- className: 'real-estate-info-digtal-label'
25804
- }, "\u7279\u6B8A\u4FE1\u606F-\u5EFA\u7B51\u670D\u52A1"), /*#__PURE__*/React__default['default'].createElement("div", {
25805
- className: "kts-invoice-operate-goods-list-digtal",
25806
- onClick: function onClick(e) {
25807
- e.stopPropagation();
25808
- }
25809
- }, /*#__PURE__*/React__default['default'].createElement("div", {
25810
- className: "kts-invoice-operate-goods-list-able"
25811
- }, /*#__PURE__*/React__default['default'].createElement(AddRowButton$2, null), delRowButton.button, /*#__PURE__*/React__default['default'].createElement("div", {
25812
- style: {
25813
- flex: 1
25814
- }
25815
- })), /*#__PURE__*/React__default['default'].createElement("div", {
25816
- className: classnames__default['default']('kts-invoice-operate-goods-list-table-digtal')
25817
- }, /*#__PURE__*/React__default['default'].createElement(TableVirtual$2, {
25818
- size: "small",
25819
- rowKey: "$index",
25820
- pagination: false,
25821
- scroll: {
25822
- y: 280
25823
- },
25824
- components: {
25825
- body: {
25826
- row: TableRow$2
25827
- }
25828
- },
25829
- dataSource: dataSource,
25830
- columns: useColumns$2(props.form),
25831
- rowSelection: useRowSelection$2(),
25832
- onRow: function onRow(record) {
25833
- return {
25834
- onClick: function onClick() {
25835
- _onRow.onClick(record);
25836
- }
25837
- };
25838
- }
25839
- }))));
25840
- });
25841
-
25842
- var ImportBuyerDrawer = (function () {
25843
- var controller = Invoice.useInvoiceController();
25844
- var visible = controller.useMemo(function (s) {
25845
- return s.buyerState.isVisibleDrawer;
23929
+ var visible = controller.useMemo(function (s) {
23930
+ return s.buyerState.isVisibleDrawer;
25846
23931
  }, []);
25847
23932
  var topExpand = controller.useMemo(function (s) {
25848
23933
  return s.buyerState.topExpand;
@@ -26215,8 +24300,8 @@ var getItemCode = function getItemCode(record, editGood) {
26215
24300
  return record.productCode;
26216
24301
  };
26217
24302
 
26218
- 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";
26219
- styleInject(css_248z$w);
24303
+ var css_248z$s = ".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";
24304
+ styleInject(css_248z$s);
26220
24305
 
26221
24306
  var TreeNode = ktsComponentsAntdX3.Tree.TreeNode;
26222
24307
  var confirm = ktsComponentsAntdX3.Modal.confirm;
@@ -26856,14 +24941,15 @@ var DrawerBody$3 = function DrawerBody(props) {
26856
24941
  // s.value = info.node.taxRate
26857
24942
  // }
26858
24943
  // });
24944
+ var node = info.node || info;
26859
24945
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
26860
24946
  var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
26861
24947
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
26862
24948
  while (1) {
26863
24949
  switch (_context12.prev = _context12.next) {
26864
24950
  case 0:
26865
- if (info.taxCategoryCode) {
26866
- s.value = info.taxCategoryCode;
24951
+ if (node.taxCategoryCode) {
24952
+ s.value = node.taxCategoryCode;
26867
24953
  }
26868
24954
 
26869
24955
  case 1:
@@ -26884,8 +24970,8 @@ var DrawerBody$3 = function DrawerBody(props) {
26884
24970
  while (1) {
26885
24971
  switch (_context13.prev = _context13.next) {
26886
24972
  case 0:
26887
- if (info.shorthand) {
26888
- s.value = info.shorthand;
24973
+ if (node.shorthand) {
24974
+ s.value = node.shorthand;
26889
24975
  }
26890
24976
 
26891
24977
  case 1:
@@ -26903,24 +24989,26 @@ var DrawerBody$3 = function DrawerBody(props) {
26903
24989
  setOpen(false);
26904
24990
  }, [controller, actions]);
26905
24991
  var onSelect = React__default['default'].useCallback(function (key, info) {
24992
+ var node = info.node || info;
24993
+
26906
24994
  if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
26907
- var _info$node$taxRateLis;
24995
+ var _node$taxRateList;
26908
24996
 
26909
- if ((_info$node$taxRateLis = info.node.taxRateList) === null || _info$node$taxRateLis === void 0 ? void 0 : _info$node$taxRateLis.length) {
26910
- setGoodsTaxRateList(info.node.taxRateList);
24997
+ if ((_node$taxRateList = node.taxRateList) === null || _node$taxRateList === void 0 ? void 0 : _node$taxRateList.length) {
24998
+ setGoodsTaxRateList(node.taxRateList);
26911
24999
  }
26912
25000
 
26913
25001
  if (!readOnlyTaxRate) {
26914
25002
  actions.setFieldState('taxRate', /*#__PURE__*/function () {
26915
25003
  var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
26916
- var _info$node$taxRateLis2;
25004
+ var _node$taxRateList2;
26917
25005
 
26918
25006
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
26919
25007
  while (1) {
26920
25008
  switch (_context14.prev = _context14.next) {
26921
25009
  case 0:
26922
- if (info.node.taxRateList && ((_info$node$taxRateLis2 = info.node.taxRateList) === null || _info$node$taxRateLis2 === void 0 ? void 0 : _info$node$taxRateLis2.length) === 1) {
26923
- s.value = info.node.taxRateList[0];
25010
+ if (node.taxRateList && ((_node$taxRateList2 = node.taxRateList) === null || _node$taxRateList2 === void 0 ? void 0 : _node$taxRateList2.length) === 1) {
25011
+ s.value = node.taxRateList[0];
26924
25012
  } else {
26925
25013
  s.value = undefined;
26926
25014
  }
@@ -26989,6 +25077,7 @@ var DrawerBody$3 = function DrawerBody(props) {
26989
25077
  onSubmit: onSubmit1,
26990
25078
  onCancel: function onCancel() {
26991
25079
  setOpen(false);
25080
+ setInfo({});
26992
25081
  },
26993
25082
  onSearch: onSearch,
26994
25083
  onLoad: onLoad
@@ -27448,8 +25537,6 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
27448
25537
 
27449
25538
  /** 特殊信息-不动产经营租赁服务(数电) */
27450
25539
 
27451
- /** 特殊信息-建筑服务(数电) */
27452
-
27453
25540
  /** 货物列表(数电) */
27454
25541
 
27455
25542
  /** 货物索引生成器 */
@@ -27463,7 +25550,7 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
27463
25550
  if (this.props.invoiceType === 'digtal') {
27464
25551
  return /*#__PURE__*/React__default['default'].createElement(Digtal, _objectSpread2({}, this.props));
27465
25552
  } else {
27466
- return /*#__PURE__*/React__default['default'].createElement(Main$5, _objectSpread2({}, this.props));
25553
+ return /*#__PURE__*/React__default['default'].createElement(Main$4, _objectSpread2({}, this.props));
27467
25554
  }
27468
25555
  }
27469
25556
  }]);
@@ -27484,8 +25571,6 @@ Invoice.Stakeholder = Stakeholder$1;
27484
25571
  Invoice.StakeFarmerholder = StakeFarmerholder;
27485
25572
  Invoice.SignDigtal = SignDigtal;
27486
25573
  Invoice.RealEstateInfo = RealEstateInfo;
27487
- Invoice.Architecture = Architecture;
27488
- Invoice.FreightList = FreightList;
27489
25574
  Invoice.GoodsListDigtal = GoodsList$1;
27490
25575
  Invoice.idGenerator = idGenerator;
27491
25576
  Invoice.calculator = calculator;
@@ -27495,7 +25580,7 @@ Invoice.useInvoiceController = function () {
27495
25580
  return React__default['default'].useContext(InvoiceContext);
27496
25581
  };
27497
25582
 
27498
- var Main$5 = function Main(props) {
25583
+ var Main$4 = function Main(props) {
27499
25584
  var controller = React__default['default'].useMemo(function () {
27500
25585
  return props.controller || new InvoiceController();
27501
25586
  }, [props.controller]);
@@ -27603,11 +25688,11 @@ var Digtal = function Digtal(props) {
27603
25688
  ), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null));
27604
25689
  };
27605
25690
 
27606
- 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";
27607
- styleInject(css_248z$x);
25691
+ var css_248z$t = ".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";
25692
+ styleInject(css_248z$t);
27608
25693
 
27609
25694
  function TaxClassificationModal(props) {
27610
- var _props$info2, _props$info3;
25695
+ var _props$info6;
27611
25696
 
27612
25697
  var _Form$useForm = ktsXui.Form.useForm(),
27613
25698
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -27679,7 +25764,6 @@ function TaxClassificationModal(props) {
27679
25764
  return;
27680
25765
  }
27681
25766
 
27682
- props.onCancel && props.onCancel();
27683
25767
  onChildrenDrawerClose();
27684
25768
  props.onSubmit && props.onSubmit((_props$info = props.info) === null || _props$info === void 0 ? void 0 : _props$info.key, _objectSpread2(_objectSpread2({}, props.info), values));
27685
25769
  }).catch(function (errorInfo) {
@@ -27687,6 +25771,16 @@ function TaxClassificationModal(props) {
27687
25771
  });
27688
25772
  };
27689
25773
 
25774
+ React__default['default'].useEffect(function () {
25775
+ var _props$info2, _props$info3, _props$info4, _props$info5;
25776
+
25777
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form.getFieldsValue()), {}, {
25778
+ taxCategoryCode: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.taxCategoryCode,
25779
+ productName: props === null || props === void 0 ? void 0 : (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.productName,
25780
+ shorthand: props === null || props === void 0 ? void 0 : (_props$info4 = props.info) === null || _props$info4 === void 0 ? void 0 : _props$info4.shorthand,
25781
+ taxDesc: props === null || props === void 0 ? void 0 : (_props$info5 = props.info) === null || _props$info5 === void 0 ? void 0 : _props$info5.taxDesc
25782
+ }));
25783
+ }, [props === null || props === void 0 ? void 0 : (_props$info6 = props.info) === null || _props$info6 === void 0 ? void 0 : _props$info6.key]);
27690
25784
  return /*#__PURE__*/React__default['default'].createElement(ktsXui.Drawer, {
27691
25785
  title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
27692
25786
  placement: "right",
@@ -27732,16 +25826,10 @@ function TaxClassificationModal(props) {
27732
25826
  }))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Card, {
27733
25827
  className: "taxrightbox"
27734
25828
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.Form, _objectSpread2(_objectSpread2({
27735
- form: form,
27736
- key: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.key
25829
+ form: form
27737
25830
  }, layout), {}, {
27738
25831
  initialValues: props.info
27739
25832
  }), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
27740
- rules: [{
27741
- required: true,
27742
- message: '请勾选税收分类编码'
27743
- }],
27744
- initialValue: (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.taxCategoryCode,
27745
25833
  name: "taxCategoryCode",
27746
25834
  label: "\u7F16\u7801"
27747
25835
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null)), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
@@ -27751,7 +25839,8 @@ function TaxClassificationModal(props) {
27751
25839
  name: "shorthand",
27752
25840
  label: "\u7B80\u79F0"
27753
25841
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null)), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
27754
- name: "desc",
25842
+ name: "taxDesc",
25843
+ className: "taxdesc",
27755
25844
  label: "\u8BF4\u660E"
27756
25845
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null))))));
27757
25846
  }