kts-component-invoice-operate 1.2.27 → 1.2.28

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 (56) hide show
  1. package/d.dio +69 -2
  2. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{EndowCode/index.d.ts → EndowCode.d.ts} +2 -2
  3. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{IGood/index.d.ts → IGood.d.ts} +5 -13
  4. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{ImportGoods/index.d.ts → ImportGoods.d.ts} +0 -0
  5. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{LineAttributeType/index.d.ts → LineAttributeType.d.ts} +0 -0
  6. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +0 -7
  7. package/dist/Invoice/index.d.ts +1 -1
  8. package/dist/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +0 -2
  9. package/dist/Invoice/ui/GoodsList/ui/{BulkMenu/hooks/useAddDiscountRowButton → AddDiscountRowButton}/index.d.ts +2 -5
  10. package/dist/Invoice/ui/GoodsList/ui/{DescribeSwitch → DelRowButton}/index.d.ts +0 -0
  11. package/dist/Invoice/ui/GoodsList/ui/EndowCodeButton/index.d.ts +3 -0
  12. package/dist/index.d.ts +0 -1
  13. package/dist/index.esm.js +314 -1073
  14. package/dist/index.js +313 -1072
  15. package/docs/index.md +1 -1
  16. package/docs-dist/umi.css +7 -8
  17. package/docs-dist/umi.js +1 -1
  18. package/package.json +1 -8
  19. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{EndowCode/index.tsx → EndowCode.tsx} +3 -3
  20. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{IGood/index.ts → IGood.ts} +5 -17
  21. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{ImportGoods/index.ts → ImportGoods.ts} +0 -0
  22. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{LineAttributeType/index.ts → LineAttributeType.ts} +0 -0
  23. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +0 -10
  24. package/src/Invoice/_test/importGoods/index.tsx +3 -38
  25. package/src/Invoice/index.tsx +1 -5
  26. package/src/Invoice/ui/EndowCodeDrawer/index.tsx +17 -6
  27. package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +0 -16
  28. package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +36 -101
  29. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +2 -5
  30. package/src/Invoice/ui/GoodsList/index.less +4 -1
  31. package/src/Invoice/ui/GoodsList/index.tsx +17 -11
  32. package/src/Invoice/ui/GoodsList/ui/{BulkMenu/hooks/useAddDiscountRowButton → AddDiscountRowButton}/index.less +0 -0
  33. package/src/Invoice/ui/GoodsList/ui/{BulkMenu/hooks/useAddDiscountRowButton → AddDiscountRowButton}/index.tsx +17 -20
  34. package/src/Invoice/ui/GoodsList/ui/{BulkMenu/hooks/useDelRowButton → DelRowButton}/index.tsx +7 -15
  35. package/src/Invoice/ui/GoodsList/ui/{BulkMenu/hooks/useEndowCodeButton → EndowCodeButton}/index.tsx +9 -13
  36. package/src/Invoice/ui/GoodsList/ui/Search/index.tsx +1 -1
  37. package/src/Invoice/ui/GoodsList/ui/TaxIncludedSwitch/index.tsx +2 -2
  38. package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +18 -70
  39. package/src/index.ts +0 -1
  40. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.d.ts +0 -5
  41. package/dist/Invoice/tools/itemName/index.d.ts +0 -14
  42. package/dist/Invoice/ui/AddComparisonDrawer/index.d.ts +0 -2
  43. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddComparison/index.d.ts +0 -5
  44. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +0 -5
  45. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +0 -5
  46. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +0 -5
  47. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/index.d.ts +0 -2
  48. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.ts +0 -10
  49. package/src/Invoice/tools/itemName/index.ts +0 -47
  50. package/src/Invoice/ui/AddComparisonDrawer/index.tsx +0 -135
  51. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddComparison/index.tsx +0 -39
  52. package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +0 -75
  53. package/src/Invoice/ui/GoodsList/ui/BulkMenu/index.tsx +0 -43
  54. package/src/Invoice/ui/GoodsList/ui/DescribeSwitch/index.tsx +0 -37
  55. package/yarn.e.lock +0 -14331
  56. package/yarn.o.lock +0 -14800
package/dist/index.esm.js CHANGED
@@ -2,12 +2,11 @@ import 'kts-components-antd-x3/dist/kts-components-antd-x3.css';
2
2
  import React, { createElement } from 'react';
3
3
  import GreyReactBox, { decorator } from 'grey-react-box';
4
4
  import { chain as chain$1, bignumber, create, all } from 'mathjs';
5
- import { message, Form, Input, Icon, Tag, Select, Row, Col, Table, Button, Switch, Tooltip, Menu, Typography, Drawer, Dropdown, AutoComplete, Spin, Checkbox, Descriptions, Empty, Divider, Popover, Tree, Modal } from 'kts-components-antd-x3';
5
+ import { message, Form, Input, Icon, Tag, Select, Row, Col, Table, Button, Switch, Typography, Drawer, Menu, Dropdown, AutoComplete, Spin, Checkbox, Descriptions, Empty, Divider, Popover, Tree, Modal } from 'kts-components-antd-x3';
6
6
  import { v4 } from 'uuid';
7
7
  import classnames from 'classnames';
8
8
  import { Input as Input$1, NumberPicker } from '@formily/antd-components';
9
9
  import { createAsyncFormActions, FormEffectHooks, SchemaForm, FormButtonGroup, SchemaMarkupField } from '@formily/antd';
10
- import { Form as Form$1, Drawer as Drawer$1 } from 'kts-xui';
11
10
 
12
11
  function ownKeys(object, enumerableOnly) {
13
12
  var keys = Object.keys(object);
@@ -973,12 +972,6 @@ function draft(value) {
973
972
  }
974
973
  }
975
974
 
976
- var ProductComparison = /*#__PURE__*/_createClass(function ProductComparison() {
977
- _classCallCheck(this, ProductComparison);
978
-
979
- this.onComply = void 0;
980
- });
981
-
982
975
  var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
983
976
  _classCallCheck(this, GoodsListState);
984
977
 
@@ -987,7 +980,6 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
987
980
  this.isSwitchTax = void 0;
988
981
  this.isAddDiscount = void 0;
989
982
  this.isTaxIncluded = true;
990
- this.isMyShow = false;
991
983
  this.editGood = void 0;
992
984
  this.form = void 0;
993
985
  this.unitList = [];
@@ -1001,9 +993,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1001
993
  this.discountGoodIndex = [];
1002
994
  this.endowCode = new EndowCode();
1003
995
  this.importGoods = new ImportGoods();
1004
- this.productComparison = new ProductComparison();
1005
996
  this.isVisibleDrawer = false;
1006
- this.addComparisonIndex = void 0;
1007
997
  });
1008
998
 
1009
999
  var BuyerState = /*#__PURE__*/_createClass(function BuyerState() {
@@ -1608,7 +1598,7 @@ var InvoiceHeader = decorator(Form.create())(function (props) {
1608
1598
  /** 控制器 */
1609
1599
 
1610
1600
 
1611
- var controller = Invoice.useInvoiceController();
1601
+ var controller = default_1.useInvoiceController();
1612
1602
  var model = controller.useMemo(function (s) {
1613
1603
  return s.model;
1614
1604
  }, []);
@@ -1922,7 +1912,7 @@ styleInject(css_248z$3);
1922
1912
  var nzhcn = require('nzh').cn;
1923
1913
 
1924
1914
  var Statistics = (function () {
1925
- var controller = Invoice.useInvoiceController();
1915
+ var controller = default_1.useInvoiceController();
1926
1916
  /** 是否不含税) */
1927
1917
 
1928
1918
  var isTaxIncluded = controller.useMemo(function (s) {
@@ -2030,7 +2020,7 @@ var Statistics = (function () {
2030
2020
  });
2031
2021
 
2032
2022
  var AddRowButton = (function () {
2033
- var controller = Invoice.useInvoiceController();
2023
+ var controller = default_1.useInvoiceController();
2034
2024
  var model = controller.useMemo(function (s) {
2035
2025
  return s.model;
2036
2026
  }, []);
@@ -2124,7 +2114,7 @@ var AddRowButton = (function () {
2124
2114
  });
2125
2115
 
2126
2116
  var TaxIncludedSwitch = (function () {
2127
- var controller = Invoice.useInvoiceController();
2117
+ var controller = default_1.useInvoiceController();
2128
2118
  /** 是否含税 */
2129
2119
 
2130
2120
  var isTaxIncluded = controller.useMemo(function (e) {
@@ -2159,11 +2149,7 @@ var TaxIncludedSwitch = (function () {
2159
2149
  };
2160
2150
  }())();
2161
2151
  }, []);
2162
- return React.createElement("span", null, React.createElement("label", {
2163
- style: {
2164
- marginRight: 2
2165
- }
2166
- }, "\u542B\u7A0E:"), React.createElement(Switch, {
2152
+ return React.createElement("span", null, React.createElement("label", null, "\u542B\u7A0E:"), React.createElement(Switch, {
2167
2153
  disabled: isSwitchTax === false,
2168
2154
  checked: isTaxIncluded,
2169
2155
  checkedChildren: "\u5F00",
@@ -2173,57 +2159,6 @@ var TaxIncludedSwitch = (function () {
2173
2159
  }));
2174
2160
  });
2175
2161
 
2176
- var DescribeSwitch = (function () {
2177
- var controller = Invoice.useInvoiceController();
2178
- var productComparison = controller.useMemo(function (s) {
2179
- return s.goodsListState.productComparison;
2180
- }, []);
2181
- var isMyShow = controller.useMemo(function (s) {
2182
- return s.goodsListState.isMyShow;
2183
- }, []);
2184
- var onChange = React.useCallback(function (e) {
2185
- controller.run( /*#__PURE__*/function () {
2186
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2187
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2188
- while (1) {
2189
- switch (_context.prev = _context.next) {
2190
- case 0:
2191
- return _context.abrupt("return", s.goodsListState.isMyShow = !s.goodsListState.isMyShow);
2192
-
2193
- case 1:
2194
- case "end":
2195
- return _context.stop();
2196
- }
2197
- }
2198
- }, _callee);
2199
- }));
2200
-
2201
- return function (_x) {
2202
- return _ref.apply(this, arguments);
2203
- };
2204
- }());
2205
- }, []);
2206
- if (!productComparison.onComply) return React.createElement(React.Fragment, null);
2207
- return React.createElement("span", null, React.createElement("label", {
2208
- style: {
2209
- marginRight: 2
2210
- }
2211
- }, React.createElement(Tooltip, {
2212
- title: "\u84DD\u8272\u4EE3\u8868\u6211\u65B9\u5546\u54C1\u63CF\u8FF0\uFF0C\u9ED1\u8272\u4EE3\u8868\u5BF9\u65B9\u7684\u5546\u54C1\u63CF\u8FF0\u3002"
2213
- }, React.createElement(Icon, {
2214
- style: {
2215
- marginRight: 3
2216
- },
2217
- type: "info-circle"
2218
- })), "\u4F7F\u7528\u54EA\u65B9\u5546\u54C1\u63CF\u8FF0:"), React.createElement(Switch, {
2219
- checked: isMyShow,
2220
- checkedChildren: "\u6211\u65B9",
2221
- unCheckedChildren: "\u5BF9\u65B9",
2222
- defaultChecked: true,
2223
- onChange: onChange
2224
- }));
2225
- });
2226
-
2227
2162
  var _path$1;
2228
2163
 
2229
2164
  function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
@@ -2244,7 +2179,7 @@ var css_248z$4 = ".kts-invoice-operate-goods-list-able-list .kts-invoice-operate
2244
2179
  styleInject(css_248z$4);
2245
2180
 
2246
2181
  function Search() {
2247
- var controller = Invoice.useInvoiceController();
2182
+ var controller = default_1.useInvoiceController();
2248
2183
 
2249
2184
  var _React$useState = React.useState(''),
2250
2185
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -2292,7 +2227,7 @@ function Search() {
2292
2227
  while (1) {
2293
2228
  switch (_context2.prev = _context2.next) {
2294
2229
  case 0:
2295
- s.goodsListState.searchValue = value.replace(/^ */, '').replace(/ *$/, '');
2230
+ s.goodsListState.searchValue = value.trim();
2296
2231
 
2297
2232
  case 1:
2298
2233
  case "end":
@@ -2327,7 +2262,7 @@ function Search() {
2327
2262
  }
2328
2263
 
2329
2264
  function TableRow(props) {
2330
- var controller = Invoice.useInvoiceController();
2265
+ var controller = default_1.useInvoiceController();
2331
2266
  var goodsMap = controller.useMemo(function (s) {
2332
2267
  return s.goodsListState.goodsMap;
2333
2268
  }, []);
@@ -2341,70 +2276,6 @@ function TableRow(props) {
2341
2276
  }));
2342
2277
  }
2343
2278
 
2344
- var useDelRowButton = (function () {
2345
- var controller = Invoice.useInvoiceController();
2346
- var model = controller.useMemo(function (s) {
2347
- return s.model;
2348
- }, []);
2349
- /** 是否禁用 */
2350
-
2351
- var disabled = controller.useMemo(function (s) {
2352
- if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
2353
- return s.goodsListState.selectedGoodIndex.some(function (e) {
2354
- var good = s.goodsListState.goodsMap.get(e);
2355
- if (!good) return true;
2356
- return good.lineAttribute !== LineAttributeType$1.正常;
2357
- });
2358
- }, []);
2359
- var onClick = React.useCallback(function () {
2360
- controller.pipeline( /*#__PURE__*/function () {
2361
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2362
- var goodsList;
2363
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2364
- while (1) {
2365
- switch (_context.prev = _context.next) {
2366
- case 0:
2367
- goodsList = s.goodsListState.goodsList.filter(function (e) {
2368
- return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
2369
- });
2370
-
2371
- if (s.goodsListState.editGood) {
2372
- if (s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0) {
2373
- controller.setEditGood();
2374
- }
2375
- }
2376
-
2377
- s.goodsListState = _objectSpread2(_objectSpread2({}, s.goodsListState), {}, {
2378
- goodsList: goodsList,
2379
- selectedGoodIndex: []
2380
- });
2381
-
2382
- case 3:
2383
- case "end":
2384
- return _context.stop();
2385
- }
2386
- }
2387
- }, _callee);
2388
- }));
2389
-
2390
- return function (_x) {
2391
- return _ref.apply(this, arguments);
2392
- };
2393
- }())();
2394
- }, [controller]);
2395
- var menuItem = React.useMemo(function () {
2396
- if (model === 'prefab') return React.createElement(React.Fragment, null);
2397
- return React.createElement(Menu.Item, {
2398
- key: "1",
2399
- onClick: onClick,
2400
- disabled: disabled
2401
- }, "\u5220\u9664\u884C");
2402
- }, [model, onClick, disabled]);
2403
- return {
2404
- menuItem: menuItem
2405
- };
2406
- });
2407
-
2408
2279
  /** 延迟函数 */
2409
2280
  var lazyFn = (function (fn) {
2410
2281
  var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
@@ -2451,9 +2322,9 @@ var _create = create(all, {
2451
2322
  }),
2452
2323
  chain = _create.chain;
2453
2324
 
2454
- var useAddDiscountRowButton = (function () {
2325
+ var AddDiscountRowButton = decorator(Form.create())(function (props) {
2455
2326
  /** 控制器 */
2456
- var controller = Invoice.useInvoiceController();
2327
+ var controller = default_1.useInvoiceController();
2457
2328
  var model = controller.useMemo(function (s) {
2458
2329
  return s.model;
2459
2330
  }, []);
@@ -2597,33 +2468,25 @@ var useAddDiscountRowButton = (function () {
2597
2468
  }
2598
2469
  }, _callee3);
2599
2470
  })), [controller]);
2600
- var menuItem = React.useMemo(function () {
2601
- return model === 'prefab' ? React.createElement(React.Fragment, null) : isAddDiscount !== false ? React.createElement(Menu.Item, {
2602
- key: "0",
2603
- onClick: onClick,
2604
- disabled: disabled
2605
- }, "\u6DFB\u52A0\u6298\u6263\u884C") : undefined;
2606
- }, [isAddDiscount, disabled, onClick]);
2607
- var drawer = React.useMemo(function () {
2608
- return React.createElement(Drawer, {
2609
- className: "kts-invoice-operate-goods-list-add-discount-row",
2610
- width: 540,
2611
- title: "\u6DFB\u52A0\u6298\u6263\u884C",
2612
- placement: "right",
2613
- destroyOnClose: true,
2614
- onClose: onClose,
2615
- visible: visible
2616
- }, React.createElement(DrawerBody, null));
2617
- }, [visible, onClose]);
2618
- return {
2619
- menuItem: menuItem,
2620
- drawer: drawer
2621
- };
2471
+ if (model === 'prefab') return React.createElement(React.Fragment, null);
2472
+ return React.createElement(React.Fragment, null, isAddDiscount !== false && React.createElement(Button, {
2473
+ icon: "plus-circle",
2474
+ disabled: disabled,
2475
+ onClick: onClick
2476
+ }, "\u6DFB\u52A0\u6298\u6263\u884C"), React.createElement(Drawer, {
2477
+ className: "kts-invoice-operate-goods-list-add-discount-row",
2478
+ width: 540,
2479
+ title: "\u6DFB\u52A0\u6298\u6263\u884C",
2480
+ placement: "right",
2481
+ destroyOnClose: true,
2482
+ onClose: onClose,
2483
+ visible: visible
2484
+ }, React.createElement(DrawerBody, null)));
2622
2485
  });
2623
2486
  var DrawerBody = decorator(Form.create())(function (props) {
2624
2487
  var form = props.form;
2625
2488
  var getFieldDecorator = form.getFieldDecorator;
2626
- var controller = Invoice.useInvoiceController();
2489
+ var controller = default_1.useInvoiceController();
2627
2490
  /** 选中的货物索引列表 */
2628
2491
 
2629
2492
  var discountGoodIndex = controller.useMemo(function (s) {
@@ -2842,8 +2705,8 @@ var coolingFn = (function () {
2842
2705
  }
2843
2706
  });
2844
2707
 
2845
- var useEndowCodeButton = (function () {
2846
- var controller = Invoice.useInvoiceController();
2708
+ var EndowCodeButton = (function () {
2709
+ var controller = default_1.useInvoiceController();
2847
2710
  /** 是否禁用 */
2848
2711
 
2849
2712
  var disabled = controller.useMemo(function (s) {
@@ -2920,193 +2783,71 @@ var useEndowCodeButton = (function () {
2920
2783
  }
2921
2784
  }, _callee2);
2922
2785
  })), [controller]);
2923
- var menuItem = React.useMemo(function () {
2924
- return React.createElement(Menu.Item, {
2925
- key: "2",
2926
- onClick: onClick,
2927
- disabled: disabled
2928
- }, "\u6279\u91CF\u8D4B\u7801");
2929
- }, [onClick, disabled]);
2930
- return {
2931
- menuItem: menuItem
2932
- };
2786
+ return React.createElement(Button, {
2787
+ icon: "file-add",
2788
+ disabled: disabled,
2789
+ onClick: onClick
2790
+ }, "\u6279\u91CF\u8D4B\u7801");
2933
2791
  });
2934
2792
 
2935
- /** 拆分全称加简称 */
2936
- var getSN = function getSN(value) {
2937
- if (!value) return undefined;
2938
- var arr = value.match(/\*[^*]+\*/);
2939
-
2940
- if (arr && arr[0]) {
2941
- return {
2942
- shorthand: arr[0].split('*')[1],
2943
- full: value.replace(arr[0], '')
2944
- };
2945
- } else {
2946
- return {
2947
- shorthand: undefined,
2948
- full: value
2949
- };
2950
- }
2951
- };
2952
- /** 组合全称加简称 */
2953
-
2954
- var getItemName = function getItemName(value) {
2955
- if (value.shorthand) {
2956
- return "*".concat(value.shorthand, "*").concat(value.full);
2957
- } else {
2958
- return value.full;
2959
- }
2960
- };
2961
- /** 设置简称 */
2962
-
2963
- var setShorthand = function setShorthand(name, shorthand) {
2964
- if (!name) return undefined;
2965
- var sn = getSN(name);
2966
- if (!sn) return undefined;
2967
- sn.shorthand = shorthand || '';
2968
- return getItemName(sn);
2969
- };
2970
-
2971
- var useCommodityComparisonButton = (function () {
2972
- var controller = Invoice.useInvoiceController();
2973
-
2974
- var _controller$useMemo = controller.useMemo(function (s) {
2975
- return s.goodsListState.productComparison;
2976
- }, []),
2977
- onComply = _controller$useMemo.onComply;
2793
+ var DelRowButton = (function () {
2794
+ var controller = default_1.useInvoiceController();
2795
+ var model = controller.useMemo(function (s) {
2796
+ return s.model;
2797
+ }, []);
2978
2798
  /** 是否禁用 */
2979
2799
 
2980
-
2981
2800
  var disabled = controller.useMemo(function (s) {
2982
- return s.goodsListState.selectedGoodIndex.length <= 0;
2801
+ if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
2802
+ return s.goodsListState.selectedGoodIndex.some(function (e) {
2803
+ var good = s.goodsListState.goodsMap.get(e);
2804
+ if (!good) return true;
2805
+ return good.lineAttribute !== LineAttributeType$1.正常;
2806
+ });
2983
2807
  }, []);
2984
- /** 点击了 */
2985
-
2986
- var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2987
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2988
- while (1) {
2989
- switch (_context2.prev = _context2.next) {
2990
- case 0:
2991
- _context2.next = 2;
2992
- return controller.saveEditGood();
2993
-
2994
- case 2:
2995
- _context2.next = 4;
2996
- return controller.wait();
2997
-
2998
- case 4:
2999
- _context2.next = 6;
3000
- return controller.run( /*#__PURE__*/function () {
3001
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
3002
- var _s$goodsListState, _s$goodsListState$pro;
3003
-
3004
- var goods, newGoods;
3005
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3006
- while (1) {
3007
- switch (_context.prev = _context.next) {
3008
- case 0:
3009
- if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
3010
- _context.next = 3;
3011
- break;
3012
- }
3013
-
3014
- coolingFn('不能给正在编辑的货物执行商品对照', 3000, function () {
3015
- message.error('不能给正在编辑的货物执行商品对照');
3016
- });
3017
- return _context.abrupt("return");
3018
-
3019
- case 3:
3020
- if ((_s$goodsListState = s.goodsListState) === null || _s$goodsListState === void 0 ? void 0 : (_s$goodsListState$pro = _s$goodsListState.productComparison) === null || _s$goodsListState$pro === void 0 ? void 0 : _s$goodsListState$pro.onComply) {
3021
- _context.next = 5;
3022
- break;
3023
- }
3024
-
3025
- return _context.abrupt("return");
3026
-
3027
- case 5:
3028
- goods = s.goodsListState.selectedGoodIndex.map(function (e) {
3029
- var _getSN, _getSN2;
3030
-
3031
- var t = s.goodsListState.goodsMap.get(e);
3032
- if (!t) return undefined;
3033
- return _objectSpread2(_objectSpread2({}, t), {}, {
3034
- itemName: (_getSN = getSN(t.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.full,
3035
- itemNameSelf: (_getSN2 = getSN(t.itemNameSelf)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
3036
- });
3037
- }).filter(function (e) {
3038
- return !!e;
3039
- }); // 比对后的商品
3040
-
3041
- _context.next = 8;
3042
- return s.goodsListState.productComparison.onComply(goods);
3043
-
3044
- case 8:
3045
- newGoods = _context.sent;
3046
- newGoods.forEach(function (e) {
3047
- var _getSN3, _getSN4;
3048
-
3049
- var vt = s.goodsListState.goodsMap.get(e.$index);
3050
- if (!vt) return undefined;
3051
- vt.itemName = e.itemName ? setShorthand(e.itemName, (_getSN3 = getSN(vt.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.shorthand) : vt.itemName;
3052
- vt.itemNameSelf = e.itemNameSelf ? setShorthand(e.itemNameSelf, (_getSN4 = getSN(vt.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameSelf;
3053
- vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
3054
- vt.itemModelNameSelf = e.itemModelNameSelf ? e.itemModelNameSelf : vt.itemModelNameSelf;
3055
- vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
3056
- vt.itemCodeSelf = e.itemCodeSelf ? e.itemCodeSelf : vt.itemCodeSelf;
3057
- });
2808
+ var onClick = React.useCallback(function () {
2809
+ controller.pipeline( /*#__PURE__*/function () {
2810
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2811
+ var goodsList;
2812
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2813
+ while (1) {
2814
+ switch (_context.prev = _context.next) {
2815
+ case 0:
2816
+ goodsList = s.goodsListState.goodsList.filter(function (e) {
2817
+ return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
2818
+ });
3058
2819
 
3059
- case 10:
3060
- case "end":
3061
- return _context.stop();
3062
- }
2820
+ if (s.goodsListState.editGood) {
2821
+ if (s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0) {
2822
+ controller.setEditGood();
3063
2823
  }
3064
- }, _callee);
3065
- }));
3066
-
3067
- return function (_x) {
3068
- return _ref2.apply(this, arguments);
3069
- };
3070
- }());
3071
-
3072
- case 6:
3073
- case "end":
3074
- return _context2.stop();
3075
- }
3076
- }
3077
- }, _callee2);
3078
- })), []);
3079
- var menuItem = React.useMemo(function () {
3080
- // 没用 执行商品对照 的方法 不显示按钮
3081
- if (!onComply) return React.createElement(React.Fragment, null);
3082
- return React.createElement(Menu.Item, {
3083
- key: "3",
3084
- disabled: disabled,
3085
- onClick: onClick
3086
- }, "\u6267\u884C\u5546\u54C1\u5BF9\u7167");
3087
- }, [disabled, onClick, onComply]);
3088
- return {
3089
- menuItem: menuItem
3090
- };
3091
- });
3092
-
3093
- function BulkMenu() {
3094
- /** 删除行 */
3095
- var delRowButton = useDelRowButton();
3096
- /** 添加折扣行 */
2824
+ }
3097
2825
 
3098
- var addDiscountRowButton = useAddDiscountRowButton();
3099
- /** 批量赋码 */
2826
+ s.goodsListState = _objectSpread2(_objectSpread2({}, s.goodsListState), {}, {
2827
+ goodsList: goodsList,
2828
+ selectedGoodIndex: []
2829
+ });
3100
2830
 
3101
- var endowCodeButton = useEndowCodeButton();
3102
- /** 执行商品对照 */
2831
+ case 3:
2832
+ case "end":
2833
+ return _context.stop();
2834
+ }
2835
+ }
2836
+ }, _callee);
2837
+ }));
3103
2838
 
3104
- var commodityComparisonButton = useCommodityComparisonButton();
3105
- var menu = React.createElement(Menu, null, delRowButton.menuItem, addDiscountRowButton.menuItem, endowCodeButton.menuItem, commodityComparisonButton.menuItem);
3106
- return React.createElement(React.Fragment, null, React.createElement(Dropdown, {
3107
- overlay: menu
3108
- }, React.createElement(Button, null, "\u6279\u91CF\u64CD\u4F5C\u884C")), addDiscountRowButton.drawer);
3109
- }
2839
+ return function (_x) {
2840
+ return _ref.apply(this, arguments);
2841
+ };
2842
+ }())();
2843
+ }, [controller]);
2844
+ if (model === 'prefab') return React.createElement(React.Fragment, null);
2845
+ return React.createElement(Button, {
2846
+ icon: "delete",
2847
+ onClick: onClick,
2848
+ disabled: disabled
2849
+ }, "\u5220\u9664\u884C");
2850
+ });
3110
2851
 
3111
2852
  var _defs$1, _path$2;
3112
2853
 
@@ -3124,7 +2865,7 @@ function SvgSpot(props) {
3124
2865
 
3125
2866
  var Text$1 = Typography.Text;
3126
2867
  var useDelItem = (function (goods) {
3127
- var controller = Invoice.useInvoiceController();
2868
+ var controller = default_1.useInvoiceController();
3128
2869
  var onClick = React.useCallback(function () {
3129
2870
  controller.delGood(goods.$index);
3130
2871
  }, [controller, goods.$index]);
@@ -3146,7 +2887,7 @@ var useDelItem = (function (goods) {
3146
2887
 
3147
2888
  var Text$2 = Typography.Text;
3148
2889
  var useAddDiscount = (function (goods) {
3149
- var controller = Invoice.useInvoiceController();
2890
+ var controller = default_1.useInvoiceController();
3150
2891
  /** 点击了 添加折扣行 按钮 */
3151
2892
 
3152
2893
  var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
@@ -9744,6 +9485,44 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
9744
9485
  };
9745
9486
  }());
9746
9487
  };
9488
+ /** 保存到编辑货物 */
9489
+
9490
+ var onSaveEditGood = lazyFn$1(function (controller, form, record, id) {
9491
+ form.validateFields( /*#__PURE__*/function () {
9492
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
9493
+ var v;
9494
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
9495
+ while (1) {
9496
+ switch (_context9.prev = _context9.next) {
9497
+ case 0:
9498
+ err = err || {};
9499
+
9500
+ if (!err[id]) {
9501
+ _context9.next = 3;
9502
+ break;
9503
+ }
9504
+
9505
+ return _context9.abrupt("return");
9506
+
9507
+ case 3:
9508
+ v = {};
9509
+ v[id] = values[id];
9510
+ _context9.next = 7;
9511
+ return controller.setEditGood(_objectSpread2({}, v));
9512
+
9513
+ case 7:
9514
+ case "end":
9515
+ return _context9.stop();
9516
+ }
9517
+ }
9518
+ }, _callee9);
9519
+ }));
9520
+
9521
+ return function (_x17, _x18) {
9522
+ return _ref9.apply(this, arguments);
9523
+ };
9524
+ }());
9525
+ }, 1000);
9747
9526
  /** 单调赋码 */
9748
9527
 
9749
9528
  var endowCode = /*#__PURE__*/function () {
@@ -9839,101 +9618,10 @@ var endowCode = /*#__PURE__*/function () {
9839
9618
  return _ref10.apply(this, arguments);
9840
9619
  };
9841
9620
  }();
9842
- /** 修改了 货物名称 */
9843
-
9844
- var onChangeItemName = /*#__PURE__*/function () {
9845
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, form, record) {
9846
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
9847
- while (1) {
9848
- switch (_context13.prev = _context13.next) {
9849
- case 0:
9850
- controller.run( /*#__PURE__*/function () {
9851
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
9852
- var _getSN$shorthand, _getSN;
9853
-
9854
- var value, shorthand;
9855
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
9856
- while (1) {
9857
- switch (_context12.prev = _context12.next) {
9858
- case 0:
9859
- value = form.getFieldsValue().itemName;
9860
- shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
9861
-
9862
- if (!s.goodsListState.isMyShow) {
9863
- _context12.next = 11;
9864
- break;
9865
- }
9866
-
9867
- _context12.next = 5;
9868
- return controller.setEditGood({
9869
- itemNameSelf: value
9870
- });
9871
-
9872
- case 5:
9873
- _context12.t0 = record.itemName;
9874
-
9875
- if (!_context12.t0) {
9876
- _context12.next = 9;
9877
- break;
9878
- }
9879
-
9880
- _context12.next = 9;
9881
- return controller.setEditGood({
9882
- itemName: setShorthand(record.itemName, shorthand)
9883
- });
9884
-
9885
- case 9:
9886
- _context12.next = 17;
9887
- break;
9888
-
9889
- case 11:
9890
- _context12.next = 13;
9891
- return controller.setEditGood({
9892
- itemName: value
9893
- });
9894
-
9895
- case 13:
9896
- _context12.t1 = record.itemNameSelf;
9897
-
9898
- if (!_context12.t1) {
9899
- _context12.next = 17;
9900
- break;
9901
- }
9902
-
9903
- _context12.next = 17;
9904
- return controller.setEditGood({
9905
- itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
9906
- });
9907
-
9908
- case 17:
9909
- case "end":
9910
- return _context12.stop();
9911
- }
9912
- }
9913
- }, _callee12);
9914
- }));
9915
-
9916
- return function (_x25) {
9917
- return _ref13.apply(this, arguments);
9918
- };
9919
- }());
9920
-
9921
- case 1:
9922
- case "end":
9923
- return _context13.stop();
9924
- }
9925
- }
9926
- }, _callee13);
9927
- }));
9928
-
9929
- return function onChangeItemName(_x22, _x23, _x24) {
9930
- return _ref12.apply(this, arguments);
9931
- };
9932
- }();
9933
9621
 
9934
9622
  var Text$3 = Typography.Text;
9935
9623
  var useEndowCode = (function (goods) {
9936
- var controller = Invoice.useInvoiceController();
9624
+ var controller = default_1.useInvoiceController();
9937
9625
  var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9938
9626
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9939
9627
  while (1) {
@@ -9958,102 +9646,11 @@ var useEndowCode = (function (goods) {
9958
9646
  }, [goods.lineAttribute, onClick]);
9959
9647
  });
9960
9648
 
9961
- var Text$4 = Typography.Text;
9962
- var useAddComparison = (function (goods) {
9963
- var controller = Invoice.useInvoiceController();
9964
- var productComparison = controller.useMemo(function (s) {
9965
- return s.goodsListState.productComparison;
9966
- }, []);
9967
- var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9968
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9969
- while (1) {
9970
- switch (_context2.prev = _context2.next) {
9971
- case 0:
9972
- _context2.next = 2;
9973
- return controller.saveEditGood();
9974
-
9975
- case 2:
9976
- _context2.next = 4;
9977
- return controller.wait();
9978
-
9979
- case 4:
9980
- _context2.next = 6;
9981
- return controller.run( /*#__PURE__*/function () {
9982
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
9983
- var err, key;
9984
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9985
- while (1) {
9986
- switch (_context.prev = _context.next) {
9987
- case 0:
9988
- if (!s.goodsListState.form) {
9989
- _context.next = 11;
9990
- break;
9991
- }
9992
-
9993
- err = s.goodsListState.form.getFieldsError();
9994
- _context.t0 = _regeneratorRuntime().keys(err);
9995
-
9996
- case 3:
9997
- if ((_context.t1 = _context.t0()).done) {
9998
- _context.next = 11;
9999
- break;
10000
- }
10001
-
10002
- key = _context.t1.value;
10003
-
10004
- if (err[key]) {
10005
- _context.next = 7;
10006
- break;
10007
- }
10008
-
10009
- return _context.abrupt("continue", 3);
10010
-
10011
- case 7:
10012
- message.error(err[key][0]);
10013
- return _context.abrupt("return");
10014
-
10015
- case 11:
10016
- s.goodsListState.addComparisonIndex = goods.$index;
10017
-
10018
- case 12:
10019
- case "end":
10020
- return _context.stop();
10021
- }
10022
- }
10023
- }, _callee);
10024
- }));
10025
-
10026
- return function (_x) {
10027
- return _ref2.apply(this, arguments);
10028
- };
10029
- }());
10030
-
10031
- case 6:
10032
- case "end":
10033
- return _context2.stop();
10034
- }
10035
- }
10036
- }, _callee2);
10037
- })), [controller, goods.$index]);
10038
- return React.useMemo(function () {
10039
- if (productComparison.onComply) {
10040
- return React.createElement(Menu.Item, {
10041
- key: "delItem",
10042
- onClick: onClick
10043
- }, React.createElement(Text$4, {
10044
- strong: true
10045
- }, "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167"));
10046
- } else {
10047
- return React.createElement(React.Fragment, null);
10048
- }
10049
- }, [onClick, productComparison]);
10050
- });
10051
-
10052
9649
  var css_248z$6 = ".ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:focus,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu {\n font-size: 16px;\n color: #000;\n text-align: center;\n padding: 0;\n}\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu.ktsAnt3x-dropdown-open {\n background: #ebebeb;\n border-radius: 9999px;\n}\n";
10053
9650
  styleInject(css_248z$6);
10054
9651
 
10055
9652
  var RowMenu = (function (props) {
10056
- var controller = Invoice.useInvoiceController();
9653
+ var controller = default_1.useInvoiceController();
10057
9654
  var model = controller.useMemo(function (s) {
10058
9655
  return s.model;
10059
9656
  }, []);
@@ -10068,13 +9665,10 @@ var RowMenu = (function (props) {
10068
9665
  var delItem = useDelItem(props.goods);
10069
9666
  var addDiscount = useAddDiscount(props.goods);
10070
9667
  var endowCode = useEndowCode(props.goods);
10071
- var addComparison = useAddComparison(props.goods);
10072
9668
  var itemList = React.useMemo(function () {
10073
9669
  var arr = [];
10074
9670
  model !== 'prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
10075
9671
 
10076
- arr.push(addComparison); // 添加商品对照
10077
-
10078
9672
  endowCode && arr.push(endowCode); // 赋码
10079
9673
 
10080
9674
  model !== 'prefab' && delItem && arr.push(delItem); // 删除
@@ -10107,21 +9701,16 @@ var RowMenu = (function (props) {
10107
9701
  })));
10108
9702
  });
10109
9703
 
10110
- var Text$5 = Typography.Text;
9704
+ var Text$4 = Typography.Text;
10111
9705
  var useColumns = (function (form) {
10112
9706
  var getFieldDecorator = form.getFieldDecorator,
10113
9707
  getFieldValue = form.getFieldValue;
10114
- var controller = Invoice.useInvoiceController();
9708
+ var controller = default_1.useInvoiceController();
10115
9709
  /** 是否含税 */
10116
9710
 
10117
9711
  var isTaxIncluded = controller.useMemo(function (e) {
10118
9712
  return e.goodsListState.isTaxIncluded;
10119
9713
  }, []);
10120
- /** 是否显示我方 */
10121
-
10122
- var isMyShow = controller.useMemo(function (e) {
10123
- return e.goodsListState.isMyShow;
10124
- }, []);
10125
9714
  /** 正在编辑的货物 */
10126
9715
 
10127
9716
  var editGood = controller.useMemo(function (e) {
@@ -10158,11 +9747,12 @@ var useColumns = (function (form) {
10158
9747
 
10159
9748
  var columns = React.useMemo(function () {
10160
9749
  return [{
10161
- title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
9750
+ title: React.createElement(React.Fragment, null, React.createElement(Text$4, {
10162
9751
  type: "danger"
10163
9752
  }, "*"), "\u8D27\u7269\u540D\u79F0"),
9753
+ dataIndex: 'itemName',
10164
9754
  key: 'itemName',
10165
- render: function render(_, record) {
9755
+ render: function render(value, record) {
10166
9756
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
10167
9757
  var _editGood$itemName;
10168
9758
 
@@ -10171,54 +9761,17 @@ var useColumns = (function (form) {
10171
9761
  display: 'flex'
10172
9762
  }
10173
9763
  }, getFieldDecorator('itemName', {
10174
- initialValue: isMyShow ? record.itemNameSelf : record.itemName,
9764
+ initialValue: editGood.itemName,
10175
9765
  rules: [{
10176
- validator: function () {
10177
- var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, __, callback) {
10178
- var value;
10179
- return _regeneratorRuntime().wrap(function _callee$(_context) {
10180
- while (1) {
10181
- switch (_context.prev = _context.next) {
10182
- case 0:
10183
- _context.next = 2;
10184
- return controller.wait();
10185
-
10186
- case 2:
10187
- value = controller.state.goodsListState.editGood;
10188
-
10189
- if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf))) {
10190
- _context.next = 7;
10191
- break;
10192
- }
10193
-
10194
- callback('货物名称不能为空');
10195
- _context.next = 8;
10196
- break;
10197
-
10198
- case 7:
10199
- return _context.abrupt("return");
10200
-
10201
- case 8:
10202
- case "end":
10203
- return _context.stop();
10204
- }
10205
- }
10206
- }, _callee);
10207
- }));
10208
-
10209
- function validator(_x, _x2, _x3) {
10210
- return _validator.apply(this, arguments);
10211
- }
10212
-
10213
- return validator;
10214
- }()
9766
+ required: true,
9767
+ message: '货物名称不能为空'
10215
9768
  }]
10216
9769
  })(React.createElement(MyInput, {
10217
9770
  style: {
10218
9771
  flex: 1
10219
9772
  },
10220
9773
  onChange: function onChange() {
10221
- onChangeItemName(controller, form, record);
9774
+ onSaveEditGood(controller, form, record, 'itemName');
10222
9775
  }
10223
9776
  })), React.createElement("div", {
10224
9777
  className: "kts-invoice-operate-goods-list-able-list-itemName-import"
@@ -10229,92 +9782,67 @@ var useColumns = (function (form) {
10229
9782
  type: "link",
10230
9783
  icon: "file-add"
10231
9784
  }), controller.getGoodsList && React.createElement(Button, {
10232
- onClick: controller.pipeline( /*#__PURE__*/function () {
10233
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
10234
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10235
- while (1) {
10236
- switch (_context2.prev = _context2.next) {
10237
- case 0:
10238
- s.goodsListState.importGoods.isVisibleDrawer = true;
9785
+ onClick: function onClick() {
9786
+ controller.pipeline( /*#__PURE__*/function () {
9787
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
9788
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9789
+ while (1) {
9790
+ switch (_context.prev = _context.next) {
9791
+ case 0:
9792
+ s.goodsListState.importGoods.isVisibleDrawer = true;
10239
9793
 
10240
- case 1:
10241
- case "end":
10242
- return _context2.stop();
9794
+ case 1:
9795
+ case "end":
9796
+ return _context.stop();
9797
+ }
10243
9798
  }
10244
- }
10245
- }, _callee2);
10246
- }));
9799
+ }, _callee);
9800
+ }));
10247
9801
 
10248
- return function (_x4) {
10249
- return _ref.apply(this, arguments);
10250
- };
10251
- }()),
9802
+ return function (_x) {
9803
+ return _ref.apply(this, arguments);
9804
+ };
9805
+ }())();
9806
+ },
10252
9807
  type: "link",
10253
9808
  icon: "plus-circle"
10254
9809
  }))));
10255
9810
  } else {
10256
- return React.createElement(MyItemNameDiv, {
10257
- valueT: formatSearch(record.itemNameSelf, searchValue),
10258
- valueF: formatSearch(record.itemName, searchValue),
10259
- isMyShow: isMyShow
10260
- }); // return (
10261
- // <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
10262
- // );
9811
+ return React.createElement("span", {
9812
+ style: {
9813
+ padding: '0 10px'
9814
+ }
9815
+ }, formatSearch(value, searchValue));
10263
9816
  }
10264
9817
  }
10265
9818
  }, {
10266
9819
  title: '货物规格型号',
9820
+ dataIndex: 'itemModelName',
10267
9821
  key: 'itemModelName',
10268
9822
  width: 119,
10269
- render: function render(_, record) {
9823
+ render: function render(value, record) {
10270
9824
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
10271
9825
  return React.createElement(Form.Item, null, getFieldDecorator('itemModelName', {
10272
- initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName
9826
+ initialValue: editGood.itemModelName
10273
9827
  })(React.createElement(MyInput, {
10274
- onChange: function () {
10275
- var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
10276
- var key, value;
10277
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10278
- while (1) {
10279
- switch (_context3.prev = _context3.next) {
10280
- case 0:
10281
- _context3.next = 2;
10282
- return controller.wait();
10283
-
10284
- case 2:
10285
- key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
10286
- value = {};
10287
- value[key] = form.getFieldsValue().itemModelName;
10288
- controller.setEditGood(value);
10289
-
10290
- case 6:
10291
- case "end":
10292
- return _context3.stop();
10293
- }
10294
- }
10295
- }, _callee3);
10296
- }));
10297
-
10298
- function onChange() {
10299
- return _onChange.apply(this, arguments);
10300
- }
10301
-
10302
- return onChange;
10303
- }()
9828
+ onChange: function onChange() {
9829
+ onSaveEditGood(controller, form, record, 'itemModelName');
9830
+ }
10304
9831
  })));
10305
9832
  } else {
10306
- return React.createElement(MyItemNameDiv, {
10307
- valueT: formatSearch(record.itemModelNameSelf, searchValue),
10308
- valueF: formatSearch(record.itemModelName, searchValue),
10309
- isMyShow: isMyShow
10310
- });
9833
+ return React.createElement("span", {
9834
+ style: {
9835
+ padding: '0 10px'
9836
+ }
9837
+ }, formatSearch(value, searchValue));
10311
9838
  }
10312
9839
  }
10313
9840
  }, {
10314
9841
  title: '单位',
9842
+ dataIndex: 'unit',
10315
9843
  key: 'unit',
10316
9844
  width: 70,
10317
- render: function render(_, record) {
9845
+ render: function render(value, record) {
10318
9846
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
10319
9847
  return React.createElement(Form.Item, null, getFieldDecorator('unit', {
10320
9848
  initialValue: editGood.unit
@@ -10323,39 +9851,16 @@ var useColumns = (function (form) {
10323
9851
  width: '100%'
10324
9852
  },
10325
9853
  dataSource: unitList,
10326
- onChange: function () {
10327
- var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10328
- var key, value;
10329
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10330
- while (1) {
10331
- switch (_context4.prev = _context4.next) {
10332
- case 0:
10333
- _context4.next = 2;
10334
- return controller.wait();
10335
-
10336
- case 2:
10337
- key = isMyShow ? 'unit' : 'unitOther';
10338
- value = {};
10339
- value[key] = form.getFieldsValue().unit;
10340
- controller.setEditGood(value);
10341
-
10342
- case 6:
10343
- case "end":
10344
- return _context4.stop();
10345
- }
10346
- }
10347
- }, _callee4);
10348
- }));
10349
-
10350
- function onChange() {
10351
- return _onChange2.apply(this, arguments);
10352
- }
10353
-
10354
- return onChange;
10355
- }()
9854
+ onChange: function onChange() {
9855
+ onSaveEditGood(controller, form, record, 'unit');
9856
+ }
10356
9857
  })));
10357
9858
  } else {
10358
- return record.unit;
9859
+ return React.createElement("span", {
9860
+ style: {
9861
+ padding: '0 10px'
9862
+ }
9863
+ }, value);
10359
9864
  }
10360
9865
  }
10361
9866
  }, {
@@ -10373,13 +9878,13 @@ var useColumns = (function (form) {
10373
9878
  message: '数量必须为数字'
10374
9879
  }, {
10375
9880
  validator: function () {
10376
- var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
9881
+ var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_, value, callback) {
10377
9882
  var isvalue, isPrice;
10378
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
9883
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10379
9884
  while (1) {
10380
- switch (_context5.prev = _context5.next) {
9885
+ switch (_context2.prev = _context2.next) {
10381
9886
  case 0:
10382
- _context5.next = 2;
9887
+ _context2.next = 2;
10383
9888
  return controller.wait();
10384
9889
 
10385
9890
  case 2:
@@ -10387,25 +9892,25 @@ var useColumns = (function (form) {
10387
9892
  isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
10388
9893
 
10389
9894
  if (!(isvalue || isPrice === isvalue)) {
10390
- _context5.next = 6;
9895
+ _context2.next = 6;
10391
9896
  break;
10392
9897
  }
10393
9898
 
10394
- return _context5.abrupt("return");
9899
+ return _context2.abrupt("return");
10395
9900
 
10396
9901
  case 6:
10397
9902
  callback('请输入数量');
10398
9903
 
10399
9904
  case 7:
10400
9905
  case "end":
10401
- return _context5.stop();
9906
+ return _context2.stop();
10402
9907
  }
10403
9908
  }
10404
- }, _callee5);
9909
+ }, _callee2);
10405
9910
  }));
10406
9911
 
10407
- function validator(_x5, _x6, _x7) {
10408
- return _validator2.apply(this, arguments);
9912
+ function validator(_x2, _x3, _x4) {
9913
+ return _validator.apply(this, arguments);
10409
9914
  }
10410
9915
 
10411
9916
  return validator;
@@ -10445,13 +9950,13 @@ var useColumns = (function (form) {
10445
9950
  message: '单价必须为数字'
10446
9951
  }, {
10447
9952
  validator: function () {
10448
- var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_, value, callback) {
9953
+ var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_, value, callback) {
10449
9954
  var isQuantity, isvalue;
10450
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
9955
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10451
9956
  while (1) {
10452
- switch (_context6.prev = _context6.next) {
9957
+ switch (_context3.prev = _context3.next) {
10453
9958
  case 0:
10454
- _context6.next = 2;
9959
+ _context3.next = 2;
10455
9960
  return controller.wait();
10456
9961
 
10457
9962
  case 2:
@@ -10459,25 +9964,25 @@ var useColumns = (function (form) {
10459
9964
  isvalue = !!value || value === 0;
10460
9965
 
10461
9966
  if (!(isvalue || isQuantity === isvalue)) {
10462
- _context6.next = 6;
9967
+ _context3.next = 6;
10463
9968
  break;
10464
9969
  }
10465
9970
 
10466
- return _context6.abrupt("return");
9971
+ return _context3.abrupt("return");
10467
9972
 
10468
9973
  case 6:
10469
9974
  callback('请输入单价');
10470
9975
 
10471
9976
  case 7:
10472
9977
  case "end":
10473
- return _context6.stop();
9978
+ return _context3.stop();
10474
9979
  }
10475
9980
  }
10476
- }, _callee6);
9981
+ }, _callee3);
10477
9982
  }));
10478
9983
 
10479
- function validator(_x8, _x9, _x10) {
10480
- return _validator3.apply(this, arguments);
9984
+ function validator(_x5, _x6, _x7) {
9985
+ return _validator2.apply(this, arguments);
10481
9986
  }
10482
9987
 
10483
9988
  return validator;
@@ -10517,13 +10022,13 @@ var useColumns = (function (form) {
10517
10022
  message: '单价必须为数字'
10518
10023
  }, {
10519
10024
  validator: function () {
10520
- var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
10025
+ var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_, value, callback) {
10521
10026
  var isQuantity, isvalue;
10522
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
10027
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10523
10028
  while (1) {
10524
- switch (_context7.prev = _context7.next) {
10029
+ switch (_context4.prev = _context4.next) {
10525
10030
  case 0:
10526
- _context7.next = 2;
10031
+ _context4.next = 2;
10527
10032
  return controller.wait();
10528
10033
 
10529
10034
  case 2:
@@ -10531,25 +10036,25 @@ var useColumns = (function (form) {
10531
10036
  isvalue = !!value || value === 0;
10532
10037
 
10533
10038
  if (!(isvalue || isQuantity === isvalue)) {
10534
- _context7.next = 6;
10039
+ _context4.next = 6;
10535
10040
  break;
10536
10041
  }
10537
10042
 
10538
- return _context7.abrupt("return");
10043
+ return _context4.abrupt("return");
10539
10044
 
10540
10045
  case 6:
10541
10046
  callback('请输入单价');
10542
10047
 
10543
10048
  case 7:
10544
10049
  case "end":
10545
- return _context7.stop();
10050
+ return _context4.stop();
10546
10051
  }
10547
10052
  }
10548
- }, _callee7);
10053
+ }, _callee4);
10549
10054
  }));
10550
10055
 
10551
- function validator(_x11, _x12, _x13) {
10552
- return _validator4.apply(this, arguments);
10056
+ function validator(_x8, _x9, _x10) {
10057
+ return _validator3.apply(this, arguments);
10553
10058
  }
10554
10059
 
10555
10060
  return validator;
@@ -10575,7 +10080,7 @@ var useColumns = (function (form) {
10575
10080
  }
10576
10081
  }
10577
10082
  }, {
10578
- title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
10083
+ title: React.createElement(React.Fragment, null, React.createElement(Text$4, {
10579
10084
  type: "danger"
10580
10085
  }, "*"), "\u91D1\u989D(\u542B\u7A0E)"),
10581
10086
  dataIndex: 'lineAmountIncludeTax',
@@ -10594,10 +10099,10 @@ var useColumns = (function (form) {
10594
10099
  message: '金额必须为数字'
10595
10100
  }, {
10596
10101
  validator: function () {
10597
- var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
10598
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
10102
+ var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
10103
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10599
10104
  while (1) {
10600
- switch (_context8.prev = _context8.next) {
10105
+ switch (_context5.prev = _context5.next) {
10601
10106
  case 0:
10602
10107
  if ("".concat(value).split('.')[0].length > 9) {
10603
10108
  callback('金额整数部分不能大于9位,小数点后最多2位');
@@ -10605,24 +10110,24 @@ var useColumns = (function (form) {
10605
10110
 
10606
10111
  case 1:
10607
10112
  case "end":
10608
- return _context8.stop();
10113
+ return _context5.stop();
10609
10114
  }
10610
10115
  }
10611
- }, _callee8);
10116
+ }, _callee5);
10612
10117
  }));
10613
10118
 
10614
- function validator(_x14, _x15, _x16) {
10615
- return _validator5.apply(this, arguments);
10119
+ function validator(_x11, _x12, _x13) {
10120
+ return _validator4.apply(this, arguments);
10616
10121
  }
10617
10122
 
10618
10123
  return validator;
10619
10124
  }()
10620
10125
  }, {
10621
10126
  validator: function () {
10622
- var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
10623
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
10127
+ var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_, value, callback) {
10128
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
10624
10129
  while (1) {
10625
- switch (_context9.prev = _context9.next) {
10130
+ switch (_context6.prev = _context6.next) {
10626
10131
  case 0:
10627
10132
  if (deduction && parseFloat(value) <= deduction) {
10628
10133
  callback('扣除额不能大于等于价税合计');
@@ -10630,14 +10135,14 @@ var useColumns = (function (form) {
10630
10135
 
10631
10136
  case 1:
10632
10137
  case "end":
10633
- return _context9.stop();
10138
+ return _context6.stop();
10634
10139
  }
10635
10140
  }
10636
- }, _callee9);
10141
+ }, _callee6);
10637
10142
  }));
10638
10143
 
10639
- function validator(_x17, _x18, _x19) {
10640
- return _validator6.apply(this, arguments);
10144
+ function validator(_x14, _x15, _x16) {
10145
+ return _validator5.apply(this, arguments);
10641
10146
  }
10642
10147
 
10643
10148
  return validator;
@@ -10662,7 +10167,7 @@ var useColumns = (function (form) {
10662
10167
  }
10663
10168
  }
10664
10169
  }, {
10665
- title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
10170
+ title: React.createElement(React.Fragment, null, React.createElement(Text$4, {
10666
10171
  type: "danger"
10667
10172
  }, "*"), "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
10668
10173
  dataIndex: 'lineAmountExcludeTax',
@@ -10681,10 +10186,10 @@ var useColumns = (function (form) {
10681
10186
  message: '金额必须为数字'
10682
10187
  }, {
10683
10188
  validator: function () {
10684
- var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
10685
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
10189
+ var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
10190
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
10686
10191
  while (1) {
10687
- switch (_context10.prev = _context10.next) {
10192
+ switch (_context7.prev = _context7.next) {
10688
10193
  case 0:
10689
10194
  if ("".concat(value).split('.')[0].length > 9) {
10690
10195
  callback('金额整数部分不能大于9位,小数点后最多2位');
@@ -10692,14 +10197,14 @@ var useColumns = (function (form) {
10692
10197
 
10693
10198
  case 1:
10694
10199
  case "end":
10695
- return _context10.stop();
10200
+ return _context7.stop();
10696
10201
  }
10697
10202
  }
10698
- }, _callee10);
10203
+ }, _callee7);
10699
10204
  }));
10700
10205
 
10701
- function validator(_x20, _x21, _x22) {
10702
- return _validator7.apply(this, arguments);
10206
+ function validator(_x17, _x18, _x19) {
10207
+ return _validator6.apply(this, arguments);
10703
10208
  }
10704
10209
 
10705
10210
  return validator;
@@ -10724,7 +10229,7 @@ var useColumns = (function (form) {
10724
10229
  }
10725
10230
  }
10726
10231
  }, {
10727
- title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
10232
+ title: React.createElement(React.Fragment, null, React.createElement(Text$4, {
10728
10233
  type: "danger"
10729
10234
  }, "*"), "\u7A0E\u7387"),
10730
10235
  dataIndex: 'taxRate',
@@ -10752,7 +10257,6 @@ var useColumns = (function (form) {
10752
10257
  width: '100%'
10753
10258
  },
10754
10259
  onChange: function onChange() {
10755
- setChangeField('taxRate');
10756
10260
  onChangeTaxRate(controller, form, record);
10757
10261
  }
10758
10262
  }, taxRateList.map(function (e, i) {
@@ -10779,9 +10283,7 @@ var useColumns = (function (form) {
10779
10283
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
10780
10284
  return getFieldDecorator('taxAmount', {
10781
10285
  initialValue: editGood.taxAmount
10782
- })(React.createElement(MyDiv, {
10783
- loading: isCipher(changeField, 'taxAmount')
10784
- }));
10286
+ })(React.createElement(MyDiv, null));
10785
10287
  } else {
10786
10288
  return React.createElement("span", {
10787
10289
  style: {
@@ -10813,7 +10315,7 @@ var useColumns = (function (form) {
10813
10315
  ellipsis: true
10814
10316
  });
10815
10317
  });
10816
- }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue]);
10318
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, searchValue]);
10817
10319
  React.useEffect(function () {
10818
10320
  if (!changeField) return;
10819
10321
  var t = setTimeout(function () {
@@ -10877,81 +10379,15 @@ var MyDiv = /*#__PURE__*/function (_React$Component2) {
10877
10379
  _createClass(MyDiv, [{
10878
10380
  key: "render",
10879
10381
  value: function render() {
10880
- if (this.props.loading) {
10881
- return React.createElement(Spin, {
10882
- size: "small"
10883
- }, React.createElement("span", {
10884
- style: {
10885
- padding: '0 10px'
10886
- }
10887
- }, this.props.value));
10888
- } else {
10889
- return React.createElement("span", {
10890
- style: {
10891
- padding: '0 10px'
10892
- }
10893
- }, this.props.value);
10894
- }
10895
- }
10896
- }]);
10897
-
10898
- return MyDiv;
10899
- }(React.Component);
10900
-
10901
- var MyItemNameDiv = /*#__PURE__*/function (_React$Component3) {
10902
- _inherits(MyItemNameDiv, _React$Component3);
10903
-
10904
- var _super3 = _createSuper(MyItemNameDiv);
10905
-
10906
- function MyItemNameDiv() {
10907
- _classCallCheck(this, MyItemNameDiv);
10908
-
10909
- return _super3.apply(this, arguments);
10910
- }
10911
-
10912
- _createClass(MyItemNameDiv, [{
10913
- key: "render",
10914
- value: function render() {
10915
- var _this$props = this.props,
10916
- isMyShow = _this$props.isMyShow,
10917
- valueT = _this$props.valueT,
10918
- valueF = _this$props.valueF;
10919
-
10920
- if (isMyShow) {
10921
- if (valueT) {
10922
- return React.createElement("span", {
10923
- style: {
10924
- padding: '0 10px',
10925
- color: '#0074ff'
10926
- }
10927
- }, valueT);
10928
- } else {
10929
- return React.createElement("span", {
10930
- style: {
10931
- padding: '0 10px'
10932
- }
10933
- }, valueF);
10934
- }
10935
- } else {
10936
- if (valueF) {
10937
- return React.createElement("span", {
10938
- style: {
10939
- padding: '0 10px'
10940
- }
10941
- }, valueF);
10942
- } else {
10943
- return React.createElement("span", {
10944
- style: {
10945
- padding: '0 10px',
10946
- color: '#0074ff'
10947
- }
10948
- }, valueT);
10382
+ return React.createElement("span", {
10383
+ style: {
10384
+ padding: '0 10px'
10949
10385
  }
10950
- }
10386
+ }, this.props.value);
10951
10387
  }
10952
10388
  }]);
10953
10389
 
10954
- return MyItemNameDiv;
10390
+ return MyDiv;
10955
10391
  }(React.Component);
10956
10392
  /** 格式搜索结果 */
10957
10393
 
@@ -10988,7 +10424,7 @@ function dcoding(v) {
10988
10424
 
10989
10425
  var useOnRow = (function () {
10990
10426
  /** 控制器 */
10991
- var controller = Invoice.useInvoiceController();
10427
+ var controller = default_1.useInvoiceController();
10992
10428
  var model = controller.useMemo(function (s) {
10993
10429
  return s.model;
10994
10430
  }, []);
@@ -11171,7 +10607,7 @@ function useWindowClick(controller) {
11171
10607
 
11172
10608
  var useRowSelection = (function () {
11173
10609
  /** 控制器 */
11174
- var controller = Invoice.useInvoiceController();
10610
+ var controller = default_1.useInvoiceController();
11175
10611
  /** 列表选中的货物索引列表 */
11176
10612
 
11177
10613
  var selectedRowKeys = controller.useMemo(function (s) {
@@ -11458,7 +10894,7 @@ var useRowSelection = (function () {
11458
10894
  };
11459
10895
  });
11460
10896
 
11461
- var css_248z$7 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n display: flex;\n gap: 10px;\n padding-right: 10px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n display: flex;\n gap: 5px;\n}\n.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 {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 263px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n.kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n";
10897
+ var css_248z$7 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n display: flex;\n gap: 10px;\n padding-right: 10px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n display: flex;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend label {\n margin-right: 5px;\n}\n.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 {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 263px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n.kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n";
11462
10898
  styleInject(css_248z$7);
11463
10899
 
11464
10900
  var GoodsList = /*#__PURE__*/function (_React$Component) {
@@ -11483,7 +10919,7 @@ var GoodsList = /*#__PURE__*/function (_React$Component) {
11483
10919
  }(React.Component);
11484
10920
  var Main = decorator(Form.create())(function (props) {
11485
10921
  /** 控制器 */
11486
- var controller = Invoice.useInvoiceController();
10922
+ var controller = default_1.useInvoiceController();
11487
10923
  var goodsList = controller.useMemo(function (s) {
11488
10924
  return s.goodsListState.goodsList;
11489
10925
  }, []);
@@ -11557,7 +10993,7 @@ var Main = decorator(Form.create())(function (props) {
11557
10993
  }, [controller, props.form]); // 跟新 货物
11558
10994
 
11559
10995
  React.useEffect(function () {
11560
- controller.run( /*#__PURE__*/function () {
10996
+ controller.pipeline( /*#__PURE__*/function () {
11561
10997
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
11562
10998
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11563
10999
  while (1) {
@@ -11579,7 +11015,7 @@ var Main = decorator(Form.create())(function (props) {
11579
11015
  return function (_x4) {
11580
11016
  return _ref3.apply(this, arguments);
11581
11017
  };
11582
- }());
11018
+ }())();
11583
11019
  }, [controller, goodsList]);
11584
11020
  /** props 产品最大数 更新 */
11585
11021
 
@@ -11662,9 +11098,9 @@ var Main = decorator(Form.create())(function (props) {
11662
11098
  className: "kts-invoice-operate-goods-list-able"
11663
11099
  }, React.createElement("div", {
11664
11100
  className: "kts-invoice-operate-goods-list-able-list"
11665
- }, React.createElement(AddRowButton, null), React.createElement(BulkMenu, null), React.createElement(Search, null)), React.createElement("div", {
11101
+ }, React.createElement(AddRowButton, null), React.createElement(DelRowButton, null), React.createElement(AddDiscountRowButton, null), React.createElement(EndowCodeButton, null), React.createElement(Search, null)), React.createElement("div", {
11666
11102
  className: "kts-invoice-operate-goods-list-able-extend"
11667
- }, props.menuExpansion, React.createElement(DescribeSwitch, null), React.createElement(TaxIncludedSwitch, null))), React.createElement("div", {
11103
+ }, props.menuExpansion, React.createElement(TaxIncludedSwitch, null))), React.createElement("div", {
11668
11104
  className: classnames('kts-invoice-operate-goods-list-table', {
11669
11105
  'kts-invoice-operate-prefab': isprefab
11670
11106
  })
@@ -11729,7 +11165,7 @@ var Main$1 = decorator(Form.create())(function (props) {
11729
11165
  var getFieldDecorator = form.getFieldDecorator;
11730
11166
  /** 控制器 */
11731
11167
 
11732
- var controller = Invoice.useInvoiceController();
11168
+ var controller = default_1.useInvoiceController();
11733
11169
  /** 控制器 */
11734
11170
 
11735
11171
  var model = controller.useMemo(function (s) {
@@ -11847,7 +11283,7 @@ var Sign = decorator(Form.create())(function (props) {
11847
11283
  var getFieldDecorator = form.getFieldDecorator;
11848
11284
  /** 控制器 */
11849
11285
 
11850
- var controller = Invoice.useInvoiceController();
11286
+ var controller = default_1.useInvoiceController();
11851
11287
  var model = controller.useMemo(function (s) {
11852
11288
  return s.model;
11853
11289
  }, []); // 注册 form
@@ -11889,7 +11325,7 @@ var formItemLayout = {
11889
11325
  };
11890
11326
 
11891
11327
  var ImportBuyerButton = (function () {
11892
- var controller = Invoice.useInvoiceController();
11328
+ var controller = default_1.useInvoiceController();
11893
11329
  var onClick = React.useCallback(function () {
11894
11330
  controller.pipeline( /*#__PURE__*/function () {
11895
11331
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
@@ -11921,7 +11357,7 @@ var ImportBuyerButton = (function () {
11921
11357
 
11922
11358
  var BuyerNameInput = (function (props) {
11923
11359
  /** 控制器 */
11924
- var controller = Invoice.useInvoiceController();
11360
+ var controller = default_1.useInvoiceController();
11925
11361
  /** 组件模式 */
11926
11362
 
11927
11363
  var model = controller.useMemo(function (s) {
@@ -12081,7 +11517,7 @@ var BuyerNameInput = (function (props) {
12081
11517
 
12082
11518
  function useDataSource() {
12083
11519
  /** 控制器 */
12084
- var controller = Invoice.useInvoiceController();
11520
+ var controller = default_1.useInvoiceController();
12085
11521
 
12086
11522
  var _React$useState3 = React.useState(false),
12087
11523
  _React$useState4 = _slicedToArray(_React$useState3, 2),
@@ -12165,7 +11601,7 @@ function interval(i, t) {
12165
11601
  var css_248z$a = ".kts-invoice-operate-buyer {\n display: flex;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message {\n flex: 1;\n display: flex;\n position: relative;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .ktsAnt3x-descriptions-item-label {\n width: 179px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list {\n width: 100%;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-view {\n border: none;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-label {\n padding: 0 10px;\n font-size: 12px;\n background-color: #fff;\n line-height: 30px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content {\n padding: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .ktsAnt3x-input {\n box-shadow: none;\n border-color: #fff;\n border-radius: 0;\n padding: 0 10px;\n font-size: 12px;\n line-height: 30px;\n width: 100%;\n height: 100%;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .ktsAnt3x-input:hover {\n border: 1 solid;\n border-color: #40a9ff;\n border-right-width: 1px !important;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .has-error .ktsAnt3x-input,\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .has-error .ktsAnt3x-input:hover {\n background-color: #fff;\n border: 1 solid;\n border-color: #f5222d;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-control {\n line-height: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-children .ktsAnt3x-btn {\n line-height: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-explain {\n position: absolute;\n left: 5px;\n top: 6px;\n z-index: 10;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-Import {\n position: absolute;\n right: 0px;\n top: 0px;\n z-index: 10;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-password {\n border-left: 1px solid #dcdcdc;\n display: flex;\n flex: none;\n width: 458px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-title {\n flex: none;\n width: 30px;\n height: 100%;\n text-align: center;\n border-right: 1px solid #dcdcdc;\n display: table;\n padding: 0 5px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-title label {\n display: table-cell;\n vertical-align: middle;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover {\n padding-top: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .ktsAnt3x-popover-inner-content {\n padding: 6px 0;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .ktsAnt3x-popover-arrow {\n display: none;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content {\n width: 567px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-block {\n padding: 14px 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-block label {\n display: block;\n font-size: 12px;\n color: #666666;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued {\n padding: 0;\n margin: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued li {\n list-style: none;\n width: 50%;\n float: left;\n margin-bottom: 20px;\n padding: 0 10px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued::after {\n content: \".\";\n display: block;\n height: 0;\n clear: left;\n visibility: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company {\n padding: 0;\n margin: 0;\n font-size: 12px;\n padding: 10px;\n font-weight: bold;\n color: #000000;\n cursor: pointer;\n transition: background 0.4s;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company:hover {\n background: #e6e6e6e6;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company:last-child {\n margin-bottom: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company li {\n list-style: none;\n width: 50%;\n float: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n padding-right: 10px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company::after {\n content: \".\";\n display: block;\n height: 0;\n clear: left;\n visibility: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content-tag {\n line-height: 1;\n padding: 4px 12px;\n background: #F3F3F3;\n border-radius: 9999px;\n font-size: 12px;\n font-weight: bold;\n color: #000;\n cursor: pointer;\n transition: background 0.4s;\n display: inline-block;\n max-width: 100%;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content-tag:hover {\n background: #e6e6e6e6;\n}\n";
12166
11602
  styleInject(css_248z$a);
12167
11603
 
12168
- var Text$6 = Typography.Text;
11604
+ var Text$5 = Typography.Text;
12169
11605
 
12170
11606
  var Buyer$1 = /*#__PURE__*/function (_React$Component) {
12171
11607
  _inherits(Buyer, _React$Component);
@@ -12197,7 +11633,7 @@ var Main$2 = decorator(Form.create())(function (props) {
12197
11633
  var getFieldDecorator = form.getFieldDecorator;
12198
11634
  /** 控制器 */
12199
11635
 
12200
- var controller = Invoice.useInvoiceController();
11636
+ var controller = default_1.useInvoiceController();
12201
11637
  /** 组件模式 */
12202
11638
 
12203
11639
  var model = controller.useMemo(function (s) {
@@ -12279,7 +11715,7 @@ var Main$2 = decorator(Form.create())(function (props) {
12279
11715
  if (e.options.rules.some(function (e) {
12280
11716
  return e.required;
12281
11717
  })) {
12282
- return React.createElement(React.Fragment, null, React.createElement(Text$6, {
11718
+ return React.createElement(React.Fragment, null, React.createElement(Text$5, {
12283
11719
  type: "danger"
12284
11720
  }, "*"), e.label);
12285
11721
  } else {
@@ -12315,7 +11751,7 @@ var Main$2 = decorator(Form.create())(function (props) {
12315
11751
  });
12316
11752
 
12317
11753
  var ImportBuyerDrawer = (function () {
12318
- var controller = Invoice.useInvoiceController();
11754
+ var controller = default_1.useInvoiceController();
12319
11755
  var visible = controller.useMemo(function (s) {
12320
11756
  return s.buyerState.isVisibleDrawer;
12321
11757
  }, []);
@@ -12357,7 +11793,7 @@ var ImportBuyerDrawer = (function () {
12357
11793
  });
12358
11794
 
12359
11795
  var DrawerBody$1 = function DrawerBody() {
12360
- var controller = Invoice.useInvoiceController();
11796
+ var controller = default_1.useInvoiceController();
12361
11797
  var columns = controller.useMemo(function (e) {
12362
11798
  return e.buyerState.columns;
12363
11799
  }, []);
@@ -12445,7 +11881,7 @@ var DrawerBody$1 = function DrawerBody() {
12445
11881
  };
12446
11882
 
12447
11883
  var ImportGoodsDrawer = (function () {
12448
- var controller = Invoice.useInvoiceController();
11884
+ var controller = default_1.useInvoiceController();
12449
11885
  var visible = controller.useMemo(function (s) {
12450
11886
  return s.goodsListState.importGoods.isVisibleDrawer;
12451
11887
  }, []);
@@ -12491,7 +11927,7 @@ var ImportGoodsDrawer = (function () {
12491
11927
  });
12492
11928
 
12493
11929
  var DrawerBody$2 = function DrawerBody() {
12494
- var controller = Invoice.useInvoiceController();
11930
+ var controller = default_1.useInvoiceController();
12495
11931
  var columns = controller.useMemo(function (s) {
12496
11932
  return s.goodsListState.importGoods.columns;
12497
11933
  }, []);
@@ -12525,7 +11961,6 @@ var DrawerBody$2 = function DrawerBody() {
12525
11961
  onClick: function onClick() {
12526
11962
  controller.run( /*#__PURE__*/function () {
12527
11963
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
12528
- var between, editGood;
12529
11964
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
12530
11965
  while (1) {
12531
11966
  switch (_context2.prev = _context2.next) {
@@ -12534,8 +11969,7 @@ var DrawerBody$2 = function DrawerBody() {
12534
11969
  return !record[e] && record[e] !== 0;
12535
11970
  }).forEach(function (e) {
12536
11971
  delete record[e];
12537
- }); // 导入时校验函数
12538
-
11972
+ });
12539
11973
  _context2.next = 3;
12540
11974
  return s.goodsListState.importGoods.verifyFn(record);
12541
11975
 
@@ -12563,40 +11997,30 @@ var DrawerBody$2 = function DrawerBody() {
12563
11997
  record.priceIncludeTax = s.goodsListState.editGood.priceIncludeTax;
12564
11998
  record.lineAmountExcludeTax = s.goodsListState.editGood.lineAmountExcludeTax;
12565
11999
  record.lineAmountIncludeTax = s.goodsListState.editGood.lineAmountIncludeTax;
12566
- } // 中间数据
12567
-
12568
-
12569
- between = _objectSpread2({}, record);
12570
- between.itemName = getItemName$1(record, s.goodsListState.editGood);
12571
- between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
12572
-
12573
- editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
12574
-
12575
- if (editGood.taxRate) {
12576
- editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
12577
12000
  }
12578
12001
 
12579
- if ("".concat(editGood.priceIncludeTax) === '0') {
12580
- editGood.priceIncludeTax = undefined;
12581
- editGood.priceExcludeTax = undefined;
12582
- } else {
12583
- editGood.priceExcludeTax = getPriceExcludeTax(editGood, record);
12002
+ s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
12003
+
12004
+ if (s.goodsListState.editGood) {
12005
+ _context2.next = 12;
12006
+ break;
12584
12007
  }
12585
12008
 
12586
- if (editGood.quantity && editGood.priceIncludeTax) {
12587
- editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax);
12588
- } // 导入FORM里
12009
+ return _context2.abrupt("return");
12589
12010
 
12011
+ case 12:
12012
+ if (s.goodsListState.editGood.taxRate) s.goodsListState.editGood.taxRate = dutyFree(controller, s.goodsListState.editGood.taxRate, s.goodsListState.form, s.goodsListState.editGood);
12590
12013
 
12591
- if (s.goodsListState.isMyShow) {
12592
- s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
12593
- itemName: editGood.itemNameSelf,
12594
- itemModelName: editGood.itemModelNameSelf
12595
- }));
12014
+ if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
12015
+ s.goodsListState.editGood.priceIncludeTax = undefined;
12016
+ s.goodsListState.editGood.priceExcludeTax = undefined;
12596
12017
  } else {
12597
- s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
12018
+ s.goodsListState.editGood.priceExcludeTax = getPriceExcludeTax(s.goodsListState.editGood, record);
12598
12019
  }
12599
12020
 
12021
+ if (s.goodsListState.editGood.quantity && s.goodsListState.editGood.priceIncludeTax) s.goodsListState.editGood.lineAmountIncludeTax = countAmountIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
12022
+ s.goodsListState.editGood.itemName = getItemName(record);
12023
+ s.goodsListState.form.setFieldsValue(s.goodsListState.editGood);
12600
12024
  s.goodsListState.importGoods.isVisibleDrawer = false;
12601
12025
  s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
12602
12026
 
@@ -12618,12 +12042,11 @@ var DrawerBody$2 = function DrawerBody() {
12618
12042
  });
12619
12043
  };
12620
12044
  /** 货物名称 */
12621
- // const getItemName = (record: any) => {
12622
- // return record.shorthand
12623
- // ? `*${record.shorthand}*${record.itemName}`
12624
- // : record.itemName;
12625
- // };
12626
12045
 
12046
+
12047
+ var getItemName = function getItemName(record) {
12048
+ return record.shorthand ? "*".concat(record.shorthand, "*").concat(record.itemName) : record.itemName;
12049
+ };
12627
12050
  /** 货物单价,不含税 */
12628
12051
 
12629
12052
 
@@ -12631,39 +12054,6 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record) {
12631
12054
  if (!s.taxRate && s.taxRate !== 0 || !record.priceIncludeTax && record.priceIncludeTax !== 0) return; // 单价(含税)/(1+税率) = 单价(不含税)
12632
12055
 
12633
12056
  return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")));
12634
- }; // 获取我方名称
12635
-
12636
-
12637
- var getItemName$1 = function getItemName(record, editGood) {
12638
- var _getSN;
12639
-
12640
- var shorthand;
12641
- shorthand = record.shorthand;
12642
-
12643
- if (shorthand) {
12644
- return "*".concat(shorthand, "*").concat(record.itemName);
12645
- }
12646
-
12647
- shorthand = (_getSN = getSN(editGood.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
12648
-
12649
- if (shorthand) {
12650
- return "*".concat(shorthand, "*").concat(record.itemNameSelf);
12651
- }
12652
-
12653
- return record.itemName;
12654
- }; // 获取他方名称
12655
-
12656
-
12657
- var getItemNameOther = function getItemNameOther(record, editGood) {
12658
- if (!editGood.itemName) return editGood.itemName;
12659
- var shorthand;
12660
- shorthand = record.shorthand;
12661
-
12662
- if (shorthand) {
12663
- return "*".concat(shorthand, "*").concat(record.itemNameSelf);
12664
- }
12665
-
12666
- return record.itemName;
12667
12057
  };
12668
12058
 
12669
12059
  /**
@@ -12723,7 +12113,7 @@ styleInject(css_248z$b);
12723
12113
  var TreeNode = Tree.TreeNode;
12724
12114
  var confirm = Modal.confirm;
12725
12115
  var EndowCodeDrawer = (function () {
12726
- var controller = Invoice.useInvoiceController();
12116
+ var controller = default_1.useInvoiceController();
12727
12117
  var visible = controller.useMemo(function (s) {
12728
12118
  return s.goodsListState.endowCode.endowcodeGoodIndex.length > 0;
12729
12119
  }, []);
@@ -12838,7 +12228,7 @@ var EndowCodeDrawer = (function () {
12838
12228
  var DrawerBody$3 = function DrawerBody(props) {
12839
12229
  var _defaultValue$taxRate, _defaultValue$favoure;
12840
12230
 
12841
- var controller = Invoice.useInvoiceController();
12231
+ var controller = default_1.useInvoiceController();
12842
12232
  var defaultValue = props.defaultValue;
12843
12233
  var actions = React.useMemo(function () {
12844
12234
  return createAsyncFormActions();
@@ -13223,10 +12613,9 @@ var DrawerBody$3 = function DrawerBody(props) {
13223
12613
  }); // 赋码
13224
12614
 
13225
12615
  endowCodeGood.forEach(function (good) {
13226
- if (!good) return;
13227
- good.itemName = setShorthand(good.itemName, values.shorthand);
13228
- good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
13229
- // good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
12616
+ if (!good) return; // const name = getItemName(good.itemName, values.shorthand);
12617
+
12618
+ good.itemName = getItemName$1(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
13230
12619
 
13231
12620
  good.taxClassificationCode = values.taxClassificationCode;
13232
12621
  good.taxRate = values.taxRate;
@@ -13474,189 +12863,41 @@ var getShorthand = function getShorthand(value) {
13474
12863
  return undefined;
13475
12864
  }
13476
12865
  };
12866
+ /** 简称填入名称 */
13477
12867
 
13478
- function AddComparisonDrawer() {
13479
- var _Form$useForm = Form$1.useForm(),
13480
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
13481
- form = _Form$useForm2[0];
13482
- /** 控制器 */
13483
-
13484
-
13485
- var controller = Invoice.useInvoiceController();
13486
- /** 正在 添加商品对照 的货物索引 */
13487
-
13488
- var addComparisonIndex = controller.useMemo(function (s) {
13489
- return s.goodsListState.addComparisonIndex;
13490
- }, []);
13491
- /** 货物字典 */
13492
-
13493
- var goodsMap = controller.useMemo(function (s) {
13494
- return s.goodsListState.goodsMap;
13495
- }, []);
13496
- /** 正在 对照 的货物 */
13497
-
13498
- var good = React.useMemo(function () {
13499
- return addComparisonIndex ? goodsMap.get(addComparisonIndex) : undefined;
13500
- }, [addComparisonIndex]);
13501
- /** 关闭对照 */
13502
-
13503
- var onClose = React.useCallback(controller.pipeline( /*#__PURE__*/function () {
13504
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
13505
- return _regeneratorRuntime().wrap(function _callee$(_context) {
13506
- while (1) {
13507
- switch (_context.prev = _context.next) {
13508
- case 0:
13509
- s.goodsListState.addComparisonIndex = undefined;
13510
-
13511
- case 1:
13512
- case "end":
13513
- return _context.stop();
13514
- }
13515
- }
13516
- }, _callee);
13517
- }));
13518
-
13519
- return function (_x) {
13520
- return _ref.apply(this, arguments);
13521
- };
13522
- }()), [controller]);
13523
- /** 提交数据 */
13524
12868
 
13525
- var onSubmit = React.useCallback(function () {
13526
- controller.run( /*#__PURE__*/function () {
13527
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
13528
- var _getSN, _getSN2, values, shorthand;
12869
+ var getItemName$1 = function getItemName(value, shorthand) {
12870
+ if (!value) value = '';
13529
12871
 
13530
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
13531
- while (1) {
13532
- switch (_context2.prev = _context2.next) {
13533
- case 0:
13534
- if (good) {
13535
- _context2.next = 2;
13536
- break;
13537
- }
13538
-
13539
- return _context2.abrupt("return");
13540
-
13541
- case 2:
13542
- _context2.prev = 2;
13543
- _context2.next = 5;
13544
- return form.validateFields();
13545
-
13546
- case 5:
13547
- values = _context2.sent;
13548
- shorthand = s.goodsListState.isMyShow ? (_getSN = getSN(good.itemNameSelf)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand : (_getSN2 = getSN(good.itemName)) === null || _getSN2 === void 0 ? void 0 : _getSN2.shorthand;
13549
- good.itemCode = values.itemCode;
13550
- good.itemCodeSelf = values.itemCodeSelf;
13551
- good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
13552
- good.itemNameSelf = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameSelf) : values.itemNameSelf;
13553
- good.itemModelName = values.itemModelName;
13554
- good.itemModelNameSelf = values.itemModelNameSelf;
13555
- s.goodsListState.addComparisonIndex = undefined;
13556
- s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
13557
- _context2.next = 19;
13558
- break;
13559
-
13560
- case 17:
13561
- _context2.prev = 17;
13562
- _context2.t0 = _context2["catch"](2);
13563
-
13564
- case 19:
13565
- case "end":
13566
- return _context2.stop();
13567
- }
13568
- }
13569
- }, _callee2, null, [[2, 17]]);
13570
- }));
13571
-
13572
- return function (_x2) {
13573
- return _ref2.apply(this, arguments);
13574
- };
13575
- }());
13576
- }, [form, good]);
13577
- React.useEffect(function () {
13578
- form.resetFields();
12872
+ if (!shorthand) {
12873
+ return value.replace(/\*[^*]+\*/, "");
12874
+ }
13579
12875
 
13580
- if (good) {
13581
- var _getSN3, _getSN4;
12876
+ var arr = value.match(/\*[^*]+\*/);
13582
12877
 
13583
- form.setFieldsValue(_objectSpread2(_objectSpread2({}, good), {}, {
13584
- itemName: (_getSN3 = getSN(good.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.full,
13585
- itemNameSelf: (_getSN4 = getSN(good.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
13586
- }));
13587
- }
13588
- }, [good]);
13589
- return React.createElement(Drawer$1, {
13590
- width: 500,
13591
- onClose: onClose,
13592
- placement: "right",
13593
- title: "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167",
13594
- visible: !!good,
13595
- footer: React.createElement("div", {
13596
- style: {
13597
- display: 'flex',
13598
- justifyContent: 'flex-end',
13599
- gap: 10
13600
- }
13601
- }, React.createElement(Button, {
13602
- type: "primary",
13603
- onClick: onSubmit
13604
- }, "\u63D0\u4EA4"), React.createElement(Button, {
13605
- onClick: onClose
13606
- }, "\u53D6\u6D88"))
13607
- }, !!good && React.createElement(Form$1, {
13608
- layout: "vertical",
13609
- style: {
13610
- flex: 1
13611
- },
13612
- form: form
13613
- }, React.createElement(Row, {
13614
- gutter: [8, 8]
13615
- }, React.createElement(Col, {
13616
- span: 12
13617
- }, React.createElement(Form$1.Item, {
13618
- name: "itemNameSelf",
13619
- label: "\u6211\u65B9\u5546\u54C1\u540D\u79F0"
13620
- }, React.createElement(Input, null))), React.createElement(Col, {
13621
- span: 12
13622
- }, React.createElement(Form$1.Item, {
13623
- name: "itemName",
13624
- label: "\u5BF9\u65B9\u5546\u54C1\u540D\u79F0"
13625
- }, React.createElement(Input, null))), React.createElement(Col, {
13626
- span: 12
13627
- }, React.createElement(Form$1.Item, {
13628
- name: 'itemModelNameSelf',
13629
- label: "\u6211\u65B9\u89C4\u683C\u578B\u53F7"
13630
- }, React.createElement(Input, null))), React.createElement(Col, {
13631
- span: 12
13632
- }, React.createElement(Form$1.Item, {
13633
- name: "itemModelName",
13634
- label: "\u5BF9\u65B9\u89C4\u683C\u578B\u53F7"
13635
- }, React.createElement(Input, null))))));
13636
- } // function validateFields(form: WrappedFormUtils<any>) {
13637
- // return new Promise<{ err: any, values: any }>(resolve => {
13638
- // form.validateFields((err, values) => {
13639
- // resolve({ err, values })
13640
- // })
13641
- // })
13642
- // }
12878
+ if (arr) {
12879
+ return value.replace(/\*[^*]+\*/, "*".concat(shorthand, "*"));
12880
+ } else {
12881
+ return "*".concat(shorthand, "*").concat(value);
12882
+ }
12883
+ };
13643
12884
 
13644
12885
  /** 发票组件的上下文 */
13645
12886
 
13646
12887
  var InvoiceContext = React.createContext(undefined);
13647
12888
 
13648
- var Invoice = /*#__PURE__*/function (_React$PureComponent) {
13649
- _inherits(Invoice, _React$PureComponent);
12889
+ var default_1 = /*#__PURE__*/function (_React$PureComponent) {
12890
+ _inherits(default_1, _React$PureComponent);
13650
12891
 
13651
- var _super = _createSuper(Invoice);
12892
+ var _super = _createSuper(default_1);
13652
12893
 
13653
- function Invoice() {
13654
- _classCallCheck(this, Invoice);
12894
+ function default_1() {
12895
+ _classCallCheck(this, default_1);
13655
12896
 
13656
12897
  return _super.apply(this, arguments);
13657
12898
  }
13658
12899
 
13659
- _createClass(Invoice, [{
12900
+ _createClass(default_1, [{
13660
12901
  key: "render",
13661
12902
  value:
13662
12903
  /** 控制器 */
@@ -13679,18 +12920,18 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
13679
12920
  }
13680
12921
  }]);
13681
12922
 
13682
- return Invoice;
12923
+ return default_1;
13683
12924
  }(React.PureComponent);
13684
12925
 
13685
- Invoice.InvoiceController = InvoiceController;
13686
- Invoice.InvoiceHeader = InvoiceHeader;
13687
- Invoice.GoodsList = GoodsList;
13688
- Invoice.Seller = Buyer;
13689
- Invoice.Sign = Sign;
13690
- Invoice.Buyer = Buyer$1;
13691
- Invoice.idGenerator = idGenerator;
12926
+ default_1.InvoiceController = InvoiceController;
12927
+ default_1.InvoiceHeader = InvoiceHeader;
12928
+ default_1.GoodsList = GoodsList;
12929
+ default_1.Seller = Buyer;
12930
+ default_1.Sign = Sign;
12931
+ default_1.Buyer = Buyer$1;
12932
+ default_1.idGenerator = idGenerator;
13692
12933
 
13693
- Invoice.useInvoiceController = function () {
12934
+ default_1.useInvoiceController = function () {
13694
12935
  return React.useContext(InvoiceContext);
13695
12936
  };
13696
12937
 
@@ -13722,7 +12963,7 @@ var Main$3 = function Main(props) {
13722
12963
  /** 销售方 */
13723
12964
  , props.sign || React.createElement(Sign, null)
13724
12965
  /** 落款 */
13725
- , props.footExpand), React.createElement(ImportBuyerDrawer, null), React.createElement(ImportGoodsDrawer, null), React.createElement(EndowCodeDrawer, null), React.createElement(AddComparisonDrawer, null));
12966
+ , props.footExpand), React.createElement(ImportBuyerDrawer, null), React.createElement(ImportGoodsDrawer, null), React.createElement(EndowCodeDrawer, null));
13726
12967
  };
13727
12968
 
13728
- export { Invoice, InvoiceController };
12969
+ export { default_1 as Invoice, InvoiceController };