kts-component-invoice-operate 3.2.264 → 3.2.265

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 (31) hide show
  1. package/dist/DifferenceInputModal/demo.d.ts +4 -0
  2. package/dist/DifferenceInputModal/index.d.ts +67 -0
  3. package/dist/Invoice/Invoice-digtal/_test/differenceInput/index.d.ts +4 -0
  4. package/dist/Invoice/InvoiceController/InvoiceControllerState/DifferenceInputState/index.d.ts +9 -0
  5. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +3 -0
  6. package/dist/Invoice/_test/differenceInput/index.d.ts +4 -0
  7. package/dist/Invoice/ui/digtal/DifferenceInput/index.d.ts +3 -0
  8. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.d.ts +1 -0
  9. package/dist/index.d.ts +3 -0
  10. package/dist/index.esm.js +892 -114
  11. package/dist/index.js +889 -110
  12. package/package.json +1 -1
  13. package/src/DifferenceInputModal/demo.tsx +22 -0
  14. package/src/DifferenceInputModal/index.less +102 -0
  15. package/src/DifferenceInputModal/index.md +5 -0
  16. package/src/DifferenceInputModal/index.tsx +450 -0
  17. package/src/Invoice/Invoice-digtal/_test/differenceInput/index.tsx +31 -0
  18. package/src/Invoice/Invoice-digtal/index.md +4 -1
  19. package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +8 -2
  20. package/src/Invoice/InvoiceController/InvoiceControllerState/DifferenceInputState/index.ts +13 -0
  21. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +4 -0
  22. package/src/Invoice/_test/differenceInput/index.tsx +25 -0
  23. package/src/Invoice/index.md +3 -0
  24. package/src/Invoice/index.tsx +18 -6
  25. package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +7 -2
  26. package/src/Invoice/ui/default/GoodsList/ui/AddRowButton/index.tsx +4 -0
  27. package/src/Invoice/ui/digtal/DifferenceInput/index.tsx +39 -0
  28. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +15 -4
  29. package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +7 -7
  30. package/src/TaxClassificationCodeModal/index.tsx +2 -0
  31. package/src/index.ts +3 -0
package/dist/index.esm.js CHANGED
@@ -4,11 +4,11 @@ import GreyReactBox, { decorator } from 'grey-react-box';
4
4
  import { chain as chain$1, bignumber, format as format$1, create, all, equal } from 'mathjs';
5
5
  import { message, Form, Input, Icon as Icon$2, Tag as Tag$1, Select, Button, Tooltip, Switch as Switch$1, Typography, Menu, Dropdown, AutoComplete as AutoComplete$2, Spin, Checkbox, Drawer, Descriptions, Empty, Divider, Popover as Popover$1, Table as Table$1, Tree, Modal as Modal$1, Row as Row$2, Col as Col$2 } from 'kts-components-antd-x3';
6
6
  import { v4 } from 'uuid';
7
- import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Button as Button$1, Dropdown as Dropdown$1, Select as Select$1, Row, Col, Checkbox as Checkbox$1, Tooltip as Tooltip$1, Input as Input$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal, Cascader as Cascader$1, DatePicker as DatePicker$1, Tree as Tree$1, Card, FormReadOnly } from 'kts-xui';
7
+ import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Button as Button$1, Dropdown as Dropdown$1, Select as Select$1, Row, Col, Checkbox as Checkbox$1, Tooltip as Tooltip$1, Input as Input$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal, Cascader as Cascader$1, DatePicker as DatePicker$1, Tree as Tree$1, Card as Card$1, FormReadOnly } from 'kts-xui';
8
8
  import classnames from 'classnames';
9
9
  import { Table } from 'kts-components-antd-x4-v4';
10
10
  import { render } from 'react-dom';
11
- import { DatePicker, Row as Row$1, Col as Col$1, Input as Input$2, Cascader, Select as Select$2, Button as Button$2, Upload, Typography as Typography$1, Drawer as Drawer$2, Space as Space$1, message as message$2, Alert, Table as Table$2, Form as Form$2, Modal as Modal$2, Radio as Radio$1 } from 'kts-components-antd-x4';
11
+ import { DatePicker, Row as Row$1, Col as Col$1, Input as Input$2, Cascader, Select as Select$2, Button as Button$2, Upload, Typography as Typography$1, Drawer as Drawer$2, Space as Space$1, message as message$2, Alert, Table as Table$2, Form as Form$2, Modal as Modal$2, Radio as Radio$1, InputNumber as InputNumber$1, Card } from 'kts-components-antd-x4';
12
12
  import { Input as Input$3, NumberPicker } from '@formily/antd-components';
13
13
  import { createAsyncFormActions, FormEffectHooks, SchemaForm, FormButtonGroup, SchemaMarkupField } from '@formily/antd';
14
14
 
@@ -853,7 +853,13 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
853
853
  _errors.set('goodsList', _context.t0.errors);
854
854
 
855
855
  case 27:
856
- _values.set('goodsList', this.state.goodsListState.goodsList.slice()); //货物运输列表
856
+ _values.set('goodsList', this.state.goodsListState.goodsList.slice().map(function (e) {
857
+ var _this3$state, _this3$state$differen, _this3$state$differen2;
858
+
859
+ return _objectSpread2(_objectSpread2({}, e), {}, {
860
+ deductAmount: ((_this3$state = _this3.state) === null || _this3$state === void 0 ? void 0 : (_this3$state$differen = _this3$state.differenceInputState) === null || _this3$state$differen === void 0 ? void 0 : (_this3$state$differen2 = _this3$state$differen.data) === null || _this3$state$differen2 === void 0 ? void 0 : _this3$state$differen2.deductTotal) || 0
861
+ });
862
+ })); //货物运输列表
857
863
 
858
864
 
859
865
  if (!this.state.freightListState.form) {
@@ -1642,6 +1648,14 @@ var PassengerListState = /*#__PURE__*/_createClass(function PassengerListState()
1642
1648
  }];
1643
1649
  });
1644
1650
 
1651
+ var DifferenceInputState = /*#__PURE__*/_createClass(function DifferenceInputState() {
1652
+ _classCallCheck(this, DifferenceInputState);
1653
+
1654
+ this.enabled = false;
1655
+ this.open = false;
1656
+ this.data = void 0;
1657
+ });
1658
+
1645
1659
  var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControllerState() {
1646
1660
  _classCallCheck(this, InvoiceControllerState);
1647
1661
 
@@ -1661,6 +1675,7 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
1661
1675
  this.freightListState = new FreightListState();
1662
1676
  this.payListState = new PayListState();
1663
1677
  this.passengerListState = new PassengerListState();
1678
+ this.differenceInputState = new DifferenceInputState();
1664
1679
  this.addGoodsCheck = void 0;
1665
1680
  });
1666
1681
 
@@ -11675,6 +11690,11 @@ var AddRowButton = (function (props) {
11675
11690
  var goodMax = controller.useMemo(function (s) {
11676
11691
  return s.goodsListState.goodMax;
11677
11692
  }, []);
11693
+ /** 是否是差额开票模式 */
11694
+
11695
+ var isDifferenceInput = controller.useMemo(function (s) {
11696
+ return s.differenceInputState.enabled;
11697
+ }, []);
11678
11698
  /** 按钮是否禁用 */
11679
11699
 
11680
11700
  var disabled = React.useMemo(function () {
@@ -11732,6 +11752,7 @@ var AddRowButton = (function (props) {
11732
11752
  if (isAddRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
11733
11753
  if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
11734
11754
  if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
11755
+ if (isDifferenceInput && goodsNum >= 1) return /*#__PURE__*/React.createElement(React.Fragment, null);
11735
11756
  return /*#__PURE__*/React.createElement(Button, {
11736
11757
  onClick: onClick,
11737
11758
  disabled: disabled
@@ -12608,6 +12629,9 @@ function ItemNameInput(props) {
12608
12629
  var autoComplete = controller.useMemo(function (s) {
12609
12630
  return s.autoComplete;
12610
12631
  }, []);
12632
+ var enabled = controller.useMemo(function (s) {
12633
+ return s.differenceInputState.enabled;
12634
+ }, []);
12611
12635
 
12612
12636
  var _React$useState = React.useState([]),
12613
12637
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -12630,30 +12654,30 @@ function ItemNameInput(props) {
12630
12654
  props.onChange && props.onChange(event);
12631
12655
  }, []);
12632
12656
  var onBlur = React.useCallback( /*#__PURE__*/function () {
12633
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
12657
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(searchText) {
12634
12658
  var _searchText$target, taxCategoryData, params;
12635
12659
 
12636
- return _regeneratorRuntime().wrap(function _callee$(_context) {
12660
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
12637
12661
  while (1) {
12638
- switch (_context.prev = _context.next) {
12662
+ switch (_context2.prev = _context2.next) {
12639
12663
  case 0:
12640
- _context.prev = 0;
12664
+ _context2.prev = 0;
12641
12665
 
12642
12666
  if (!autoComplete.onItemNameBlur) {
12643
- _context.next = 8;
12667
+ _context2.next = 8;
12644
12668
  break;
12645
12669
  }
12646
12670
 
12647
12671
  if (!(!(selectLine === null || selectLine === void 0 ? void 0 : selectLine.shorthand) && !!(searchText === null || searchText === void 0 ? void 0 : (_searchText$target = searchText.target) === null || _searchText$target === void 0 ? void 0 : _searchText$target.value))) {
12648
- _context.next = 7;
12672
+ _context2.next = 7;
12649
12673
  break;
12650
12674
  }
12651
12675
 
12652
- _context.next = 5;
12676
+ _context2.next = 5;
12653
12677
  return autoComplete.onItemNameBlur(searchText);
12654
12678
 
12655
12679
  case 5:
12656
- taxCategoryData = _context.sent;
12680
+ taxCategoryData = _context2.sent;
12657
12681
 
12658
12682
  if (taxCategoryData && taxCategoryData[0]) {
12659
12683
  params = {
@@ -12667,122 +12691,146 @@ function ItemNameInput(props) {
12667
12691
  setSelectLine(null);
12668
12692
 
12669
12693
  case 8:
12670
- _context.next = 13;
12694
+ // 失去焦点时,打开差额开票弹窗
12695
+ if (enabled) {
12696
+ controller.run( /*#__PURE__*/function () {
12697
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
12698
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12699
+ while (1) {
12700
+ switch (_context.prev = _context.next) {
12701
+ case 0:
12702
+ s.differenceInputState.open = true;
12703
+
12704
+ case 1:
12705
+ case "end":
12706
+ return _context.stop();
12707
+ }
12708
+ }
12709
+ }, _callee);
12710
+ }));
12711
+
12712
+ return function (_x2) {
12713
+ return _ref2.apply(this, arguments);
12714
+ };
12715
+ }());
12716
+ }
12717
+
12718
+ _context2.next = 14;
12671
12719
  break;
12672
12720
 
12673
- case 10:
12674
- _context.prev = 10;
12675
- _context.t0 = _context["catch"](0);
12676
- throw _context.t0;
12721
+ case 11:
12722
+ _context2.prev = 11;
12723
+ _context2.t0 = _context2["catch"](0);
12724
+ throw _context2.t0;
12677
12725
 
12678
- case 13:
12726
+ case 14:
12679
12727
  case "end":
12680
- return _context.stop();
12728
+ return _context2.stop();
12681
12729
  }
12682
12730
  }
12683
- }, _callee, null, [[0, 10]]);
12731
+ }, _callee2, null, [[0, 11]]);
12684
12732
  }));
12685
12733
 
12686
12734
  return function (_x) {
12687
12735
  return _ref.apply(this, arguments);
12688
12736
  };
12689
- }(), [autoComplete.onItemNameBlur, selectLine, props.editGood]);
12737
+ }(), [autoComplete.onItemNameBlur, selectLine, props.editGood, enabled]);
12690
12738
  var onSearch = React.useCallback( /*#__PURE__*/function () {
12691
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(searchText) {
12739
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(searchText) {
12692
12740
  var list;
12693
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
12741
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
12694
12742
  while (1) {
12695
- switch (_context2.prev = _context2.next) {
12743
+ switch (_context3.prev = _context3.next) {
12696
12744
  case 0:
12697
- _context2.prev = 0;
12745
+ _context3.prev = 0;
12698
12746
 
12699
12747
  if (!(autoComplete.onItemNameSearch && searchText)) {
12700
- _context2.next = 10;
12748
+ _context3.next = 10;
12701
12749
  break;
12702
12750
  }
12703
12751
 
12704
- _context2.t0 = _toConsumableArray;
12705
- _context2.next = 5;
12752
+ _context3.t0 = _toConsumableArray;
12753
+ _context3.next = 5;
12706
12754
  return autoComplete.onItemNameSearch(searchText);
12707
12755
 
12708
12756
  case 5:
12709
- _context2.t1 = _context2.sent;
12710
- list = (0, _context2.t0)(_context2.t1).map(function (e) {
12757
+ _context3.t1 = _context3.sent;
12758
+ list = (0, _context3.t0)(_context3.t1).map(function (e) {
12711
12759
  return _objectSpread2(_objectSpread2({}, e), {}, {
12712
12760
  $index: v4()
12713
12761
  });
12714
12762
  });
12715
12763
  setOptions(list);
12716
- _context2.next = 11;
12764
+ _context3.next = 11;
12717
12765
  break;
12718
12766
 
12719
12767
  case 10:
12720
12768
  setOptions([]);
12721
12769
 
12722
12770
  case 11:
12723
- _context2.next = 17;
12771
+ _context3.next = 17;
12724
12772
  break;
12725
12773
 
12726
12774
  case 13:
12727
- _context2.prev = 13;
12728
- _context2.t2 = _context2["catch"](0);
12775
+ _context3.prev = 13;
12776
+ _context3.t2 = _context3["catch"](0);
12729
12777
  setOptions([]);
12730
- throw _context2.t2;
12778
+ throw _context3.t2;
12731
12779
 
12732
12780
  case 17:
12733
12781
  case "end":
12734
- return _context2.stop();
12782
+ return _context3.stop();
12735
12783
  }
12736
12784
  }
12737
- }, _callee2, null, [[0, 13]]);
12785
+ }, _callee3, null, [[0, 13]]);
12738
12786
  }));
12739
12787
 
12740
- return function (_x2) {
12741
- return _ref2.apply(this, arguments);
12788
+ return function (_x3) {
12789
+ return _ref3.apply(this, arguments);
12742
12790
  };
12743
12791
  }(), [autoComplete.onItemNameSearch]);
12744
12792
  var onChangeAutoComplete = React.useCallback( /*#__PURE__*/function () {
12745
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_, i) {
12793
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_, i) {
12746
12794
  var record;
12747
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
12795
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
12748
12796
  while (1) {
12749
- switch (_context3.prev = _context3.next) {
12797
+ switch (_context4.prev = _context4.next) {
12750
12798
  case 0:
12751
12799
  record = options.filter(function (e) {
12752
12800
  return e.$index === i.value;
12753
12801
  })[0];
12754
12802
 
12755
12803
  if (record) {
12756
- _context3.next = 3;
12804
+ _context4.next = 3;
12757
12805
  break;
12758
12806
  }
12759
12807
 
12760
- return _context3.abrupt("return");
12808
+ return _context4.abrupt("return");
12761
12809
 
12762
12810
  case 3:
12763
12811
  setValue(record.itemName);
12764
12812
  setSelectLine(record);
12765
- _context3.next = 7;
12813
+ _context4.next = 7;
12766
12814
  return controller.setEditGood({
12767
12815
  itemName: record.itemName
12768
12816
  });
12769
12817
 
12770
12818
  case 7:
12771
- _context3.next = 9;
12819
+ _context4.next = 9;
12772
12820
  return controller.importGoodsDrawer(_objectSpread2(_objectSpread2({}, record), {}, {
12773
12821
  $index: undefined
12774
12822
  }));
12775
12823
 
12776
12824
  case 9:
12777
12825
  case "end":
12778
- return _context3.stop();
12826
+ return _context4.stop();
12779
12827
  }
12780
12828
  }
12781
- }, _callee3);
12829
+ }, _callee4);
12782
12830
  }));
12783
12831
 
12784
- return function (_x3, _x4) {
12785
- return _ref3.apply(this, arguments);
12832
+ return function (_x4, _x5) {
12833
+ return _ref4.apply(this, arguments);
12786
12834
  };
12787
12835
  }(), [options, controller]);
12788
12836
  React.useEffect(function () {
@@ -23083,6 +23131,11 @@ var AddRowButton$1 = (function () {
23083
23131
  var goodsNum = controller.useMemo(function (s) {
23084
23132
  return s.goodsListState.goodsList.length;
23085
23133
  }, []);
23134
+ /** 是否是差额开票模式 */
23135
+
23136
+ var isDifferenceInput = controller.useMemo(function (s) {
23137
+ return s.differenceInputState.enabled;
23138
+ }, []);
23086
23139
  /** 搜索条件 */
23087
23140
 
23088
23141
  var searchValue = controller.useMemo(function (s) {
@@ -23125,6 +23178,7 @@ var AddRowButton$1 = (function () {
23125
23178
  if (isAddRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
23126
23179
  if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
23127
23180
  if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
23181
+ if (isDifferenceInput && goodsNum >= 1) return /*#__PURE__*/React.createElement(React.Fragment, null);
23128
23182
  return /*#__PURE__*/React.createElement(Button$1, {
23129
23183
  size: 'small',
23130
23184
  type: 'primary',
@@ -23199,11 +23253,6 @@ function _addGood$1() {
23199
23253
  break;
23200
23254
  }
23201
23255
 
23202
- // message.error({
23203
- // content: '你正在编辑一个货物',
23204
- // key: '你正在编辑一个货物',
23205
- // });
23206
- // return;
23207
23256
  isValidateGood = controller.state.goodsListState.isValidateGood;
23208
23257
 
23209
23258
  if (!isValidateGood) {
@@ -24910,8 +24959,13 @@ var TitleText$1 = (function (props) {
24910
24959
  var css_248z$n = ".kts-invoice-operate-goods-list-itemName-input {\n display: flex;\n flex: 1;\n padding-left: 0;\n height: 31px;\n}\n";
24911
24960
  styleInject(css_248z$n);
24912
24961
 
24962
+ /** 商品名称输入框 */
24963
+
24913
24964
  function ItemNameInput$1(props) {
24914
24965
  var controller = Invoice.useInvoiceController();
24966
+ var enabled = controller.useMemo(function (s) {
24967
+ return s.differenceInputState.enabled;
24968
+ }, []);
24915
24969
  var rootElement = controller.useMemo(function (s) {
24916
24970
  return s.rootElement;
24917
24971
  }, []);
@@ -24935,30 +24989,30 @@ function ItemNameInput$1(props) {
24935
24989
  props.onChange && props.onChange(event);
24936
24990
  }, []);
24937
24991
  var onBlur = React.useCallback( /*#__PURE__*/function () {
24938
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
24992
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(searchText) {
24939
24993
  var _searchText$target, taxCategoryData, params;
24940
24994
 
24941
- return _regeneratorRuntime().wrap(function _callee$(_context) {
24995
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
24942
24996
  while (1) {
24943
- switch (_context.prev = _context.next) {
24997
+ switch (_context2.prev = _context2.next) {
24944
24998
  case 0:
24945
- _context.prev = 0;
24999
+ _context2.prev = 0;
24946
25000
 
24947
25001
  if (!autoComplete.onItemNameBlur) {
24948
- _context.next = 8;
25002
+ _context2.next = 8;
24949
25003
  break;
24950
25004
  }
24951
25005
 
24952
25006
  if (!(!(selectLine === null || selectLine === void 0 ? void 0 : selectLine.shorthand) && !!(searchText === null || searchText === void 0 ? void 0 : (_searchText$target = searchText.target) === null || _searchText$target === void 0 ? void 0 : _searchText$target.value))) {
24953
- _context.next = 7;
25007
+ _context2.next = 7;
24954
25008
  break;
24955
25009
  }
24956
25010
 
24957
- _context.next = 5;
25011
+ _context2.next = 5;
24958
25012
  return autoComplete.onItemNameBlur(searchText);
24959
25013
 
24960
25014
  case 5:
24961
- taxCategoryData = _context.sent;
25015
+ taxCategoryData = _context2.sent;
24962
25016
 
24963
25017
  if (taxCategoryData && taxCategoryData[0]) {
24964
25018
  params = {
@@ -24972,120 +25026,144 @@ function ItemNameInput$1(props) {
24972
25026
  setSelectLine(null);
24973
25027
 
24974
25028
  case 8:
24975
- _context.next = 13;
25029
+ // 失去焦点时,打开差额开票弹窗
25030
+ if (enabled) {
25031
+ controller.run( /*#__PURE__*/function () {
25032
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
25033
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
25034
+ while (1) {
25035
+ switch (_context.prev = _context.next) {
25036
+ case 0:
25037
+ s.differenceInputState.open = true;
25038
+
25039
+ case 1:
25040
+ case "end":
25041
+ return _context.stop();
25042
+ }
25043
+ }
25044
+ }, _callee);
25045
+ }));
25046
+
25047
+ return function (_x2) {
25048
+ return _ref2.apply(this, arguments);
25049
+ };
25050
+ }());
25051
+ }
25052
+
25053
+ _context2.next = 14;
24976
25054
  break;
24977
25055
 
24978
- case 10:
24979
- _context.prev = 10;
24980
- _context.t0 = _context["catch"](0);
24981
- throw _context.t0;
25056
+ case 11:
25057
+ _context2.prev = 11;
25058
+ _context2.t0 = _context2["catch"](0);
25059
+ throw _context2.t0;
24982
25060
 
24983
- case 13:
25061
+ case 14:
24984
25062
  case "end":
24985
- return _context.stop();
25063
+ return _context2.stop();
24986
25064
  }
24987
25065
  }
24988
- }, _callee, null, [[0, 10]]);
25066
+ }, _callee2, null, [[0, 11]]);
24989
25067
  }));
24990
25068
 
24991
25069
  return function (_x) {
24992
25070
  return _ref.apply(this, arguments);
24993
25071
  };
24994
- }(), [autoComplete.onItemNameBlur, selectLine, props.editGood]);
25072
+ }(), [autoComplete.onItemNameBlur, selectLine, props.editGood, enabled]);
24995
25073
  var onChangeAutoComplete = React.useCallback( /*#__PURE__*/function () {
24996
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_, i) {
25074
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_, i) {
24997
25075
  var record;
24998
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
25076
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
24999
25077
  while (1) {
25000
- switch (_context2.prev = _context2.next) {
25078
+ switch (_context3.prev = _context3.next) {
25001
25079
  case 0:
25002
25080
  record = options.filter(function (e) {
25003
25081
  return e.$index === i.value;
25004
25082
  })[0];
25005
25083
 
25006
25084
  if (record) {
25007
- _context2.next = 3;
25085
+ _context3.next = 3;
25008
25086
  break;
25009
25087
  }
25010
25088
 
25011
- return _context2.abrupt("return");
25089
+ return _context3.abrupt("return");
25012
25090
 
25013
25091
  case 3:
25014
- _context2.next = 5;
25092
+ _context3.next = 5;
25015
25093
  return controller.setEditGood({
25016
25094
  itemName: record.itemName
25017
25095
  });
25018
25096
 
25019
25097
  case 5:
25020
- _context2.next = 7;
25098
+ _context3.next = 7;
25021
25099
  return controller.importGoodsDrawer(_objectSpread2(_objectSpread2({}, record), {}, {
25022
25100
  $index: undefined
25023
25101
  }));
25024
25102
 
25025
25103
  case 7:
25026
25104
  case "end":
25027
- return _context2.stop();
25105
+ return _context3.stop();
25028
25106
  }
25029
25107
  }
25030
- }, _callee2);
25108
+ }, _callee3);
25031
25109
  }));
25032
25110
 
25033
- return function (_x2, _x3) {
25034
- return _ref2.apply(this, arguments);
25111
+ return function (_x3, _x4) {
25112
+ return _ref3.apply(this, arguments);
25035
25113
  };
25036
25114
  }(), [options, controller]);
25037
25115
  var onSearch = React.useCallback( /*#__PURE__*/function () {
25038
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(searchText) {
25116
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(searchText) {
25039
25117
  var list;
25040
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
25118
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
25041
25119
  while (1) {
25042
- switch (_context3.prev = _context3.next) {
25120
+ switch (_context4.prev = _context4.next) {
25043
25121
  case 0:
25044
- _context3.prev = 0;
25122
+ _context4.prev = 0;
25045
25123
 
25046
25124
  if (!(autoComplete.onItemNameSearch && searchText)) {
25047
- _context3.next = 10;
25125
+ _context4.next = 10;
25048
25126
  break;
25049
25127
  }
25050
25128
 
25051
- _context3.t0 = _toConsumableArray;
25052
- _context3.next = 5;
25129
+ _context4.t0 = _toConsumableArray;
25130
+ _context4.next = 5;
25053
25131
  return autoComplete.onItemNameSearch(searchText);
25054
25132
 
25055
25133
  case 5:
25056
- _context3.t1 = _context3.sent;
25057
- list = (0, _context3.t0)(_context3.t1).map(function (e) {
25134
+ _context4.t1 = _context4.sent;
25135
+ list = (0, _context4.t0)(_context4.t1).map(function (e) {
25058
25136
  return _objectSpread2(_objectSpread2({}, e), {}, {
25059
25137
  $index: v4()
25060
25138
  });
25061
25139
  });
25062
25140
  setOptions(list);
25063
- _context3.next = 11;
25141
+ _context4.next = 11;
25064
25142
  break;
25065
25143
 
25066
25144
  case 10:
25067
25145
  setOptions([]);
25068
25146
 
25069
25147
  case 11:
25070
- _context3.next = 17;
25148
+ _context4.next = 17;
25071
25149
  break;
25072
25150
 
25073
25151
  case 13:
25074
- _context3.prev = 13;
25075
- _context3.t2 = _context3["catch"](0);
25152
+ _context4.prev = 13;
25153
+ _context4.t2 = _context4["catch"](0);
25076
25154
  setOptions([]);
25077
- throw _context3.t2;
25155
+ throw _context4.t2;
25078
25156
 
25079
25157
  case 17:
25080
25158
  case "end":
25081
- return _context3.stop();
25159
+ return _context4.stop();
25082
25160
  }
25083
25161
  }
25084
- }, _callee3, null, [[0, 13]]);
25162
+ }, _callee4, null, [[0, 13]]);
25085
25163
  }));
25086
25164
 
25087
- return function (_x4) {
25088
- return _ref3.apply(this, arguments);
25165
+ return function (_x5) {
25166
+ return _ref4.apply(this, arguments);
25089
25167
  };
25090
25168
  }(), [autoComplete.onItemNameSearch]);
25091
25169
  return /*#__PURE__*/React.createElement("div", {
@@ -36731,6 +36809,698 @@ var Main$6 = decorator(Form.create())(function (props) {
36731
36809
  }))));
36732
36810
  });
36733
36811
 
36812
+ var css_248z$F = ".kts-difference-modal {\n color: rgba(0, 0, 0, 0.85);\n font-size: 14px;\n}\n.kts-difference-modal-item {\n flex: 1 1 240px;\n min-width: 200px;\n margin-right: 16px;\n}\n.kts-difference-modal-item:last-child {\n margin-right: 0;\n}\n.kts-difference-modal-item .ktsAntX-form-item-label > label {\n color: rgba(0, 0, 0, 0.85);\n}\n.kts-difference-modal-mode {\n display: flex;\n align-items: center;\n margin: 4px 0 12px;\n}\n.kts-difference-modal-mode-label {\n margin-right: 12px;\n}\n.kts-difference-modal-mode-tip {\n margin-left: 12px;\n color: rgba(0, 0, 0, 0.45);\n}\n.kts-difference-modal-form .ktsAntX-form-item {\n margin-bottom: 12px;\n}\n.kts-difference-modal-row {\n display: flex;\n flex-wrap: wrap;\n}\n.kts-difference-modal-cell {\n flex: 1 1 180px;\n min-width: 160px;\n margin-right: 16px;\n}\n.kts-difference-modal-cell:last-child {\n margin-right: 0;\n}\n.kts-difference-modal-cell-remark {\n flex: 2 1 260px;\n}\n.kts-difference-modal-total {\n display: flex;\n justify-content: flex-end;\n margin: 4px 0 8px;\n}\n.kts-difference-modal-total-item {\n margin-left: 24px;\n}\n.kts-difference-modal-total-item b {\n font-weight: 600;\n}\n.kts-difference-modal-table {\n /* kts-xui 全局表格样式(padding: 6px 20px; height: 50px; font-size: 12px)特异性更高,这里提高特异性覆盖。\n 内边距收窄到 10px,避免列宽较窄时表头文字折行(纳税人识别号等)。 */\n}\n.kts-difference-modal-table .ktsAntX-table.ktsAntX-table-small > .ktsAntX-table-container > .ktsAntX-table-content > table > .ktsAntX-table-thead > tr > th {\n padding: 0 10px;\n height: 40px;\n background: #fafafa;\n color: rgba(0, 0, 0, 0.85);\n font-size: 14px;\n font-weight: 500;\n}\n.kts-difference-modal-table .ktsAntX-table.ktsAntX-table-small > .ktsAntX-table-container > .ktsAntX-table-content > table > .ktsAntX-table-tbody > tr > td {\n padding: 0 10px;\n height: 32px;\n}\n/** 底部按钮区:与 body 内容对齐(body 左右各 20px 内边距) */\n.kts-difference-modal-footer {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin: 0 20px;\n}\n.kts-difference-modal-footer button {\n margin-left: 0;\n}\n";
36813
+ styleInject(css_248z$F);
36814
+
36815
+ var _voucherTypeRules;
36816
+ /** 数据来源枚举 */
36817
+
36818
+ var DataSrcEnum;
36819
+
36820
+ (function (DataSrcEnum) {
36821
+ /** 手工录入 */
36822
+ DataSrcEnum[DataSrcEnum["MANUAL"] = 1] = "MANUAL";
36823
+ /** 勾选录入 */
36824
+
36825
+ DataSrcEnum[DataSrcEnum["CHECK"] = 2] = "CHECK";
36826
+ /** 模板录入 */
36827
+
36828
+ DataSrcEnum[DataSrcEnum["TEMPLATE"] = 3] = "TEMPLATE";
36829
+ })(DataSrcEnum || (DataSrcEnum = {}));
36830
+
36831
+ var dataSrcOptions = [{
36832
+ value: DataSrcEnum.MANUAL,
36833
+ label: '手工录入'
36834
+ }, {
36835
+ value: DataSrcEnum.CHECK,
36836
+ label: '勾选录入'
36837
+ }, {
36838
+ value: DataSrcEnum.TEMPLATE,
36839
+ label: '模板录入'
36840
+ }];
36841
+ /** 静态的表格列定义(表头按参考图,待确认) */
36842
+
36843
+ var columns = [{
36844
+ title: '序号',
36845
+ dataIndex: 'sortNumber',
36846
+ key: 'sortNumber',
36847
+ width: 55,
36848
+ fixed: 'left',
36849
+ render: function render(text, record, index) {
36850
+ return index + 1;
36851
+ }
36852
+ }, {
36853
+ title: '合计金额',
36854
+ dataIndex: 'voucherTotalAmt',
36855
+ key: 'voucherTotalAmt',
36856
+ width: 90,
36857
+ align: 'right',
36858
+ render: function render(text) {
36859
+ return text ? text.toFixed(2) : '0.00';
36860
+ }
36861
+ }, {
36862
+ title: '扣除金额',
36863
+ dataIndex: 'currentDeductAmt',
36864
+ key: 'currentDeductAmt',
36865
+ width: 90,
36866
+ align: 'right',
36867
+ render: function render(text) {
36868
+ return text ? text.toFixed(2) : '0.00';
36869
+ }
36870
+ }, {
36871
+ title: '凭证类型',
36872
+ dataIndex: 'voucherType',
36873
+ key: 'voucherType',
36874
+ width: 110,
36875
+ render: function render(text) {
36876
+ var _voucherTypeOptions$f;
36877
+
36878
+ return (_voucherTypeOptions$f = voucherTypeOptions.find(function (item) {
36879
+ return item.value === text;
36880
+ })) === null || _voucherTypeOptions$f === void 0 ? void 0 : _voucherTypeOptions$f.label;
36881
+ }
36882
+ }, // { title: '数电票号码', dataIndex: 'xxx', key: 'xxx', width: 110 },
36883
+ {
36884
+ title: '凭证代码',
36885
+ dataIndex: 'deductVoucherCode',
36886
+ key: 'deductVoucherCode',
36887
+ width: 80
36888
+ }, // { title: '发票号码', dataIndex: 'invoiceNumber', key: 'invoiceNumber', width: 80 },
36889
+ {
36890
+ title: '凭证号码',
36891
+ dataIndex: 'deductVoucherNo',
36892
+ key: 'deductVoucherNo',
36893
+ width: 80
36894
+ }, {
36895
+ title: '开具日期',
36896
+ dataIndex: 'issueDate',
36897
+ key: 'issueDate',
36898
+ width: 120,
36899
+ render: function render(text) {
36900
+ return text ? hooks(text).format('YYYY-MM-DD') : '';
36901
+ }
36902
+ }, {
36903
+ title: '备注',
36904
+ dataIndex: 'remark',
36905
+ key: 'remark',
36906
+ width: 80
36907
+ }, {
36908
+ title: '来源',
36909
+ dataIndex: 'dataSrc',
36910
+ key: 'dataSrc',
36911
+ width: 80,
36912
+ render: function render(text) {
36913
+ var _dataSrcOptions$find;
36914
+
36915
+ return (_dataSrcOptions$find = dataSrcOptions.find(function (item) {
36916
+ return item.value === text;
36917
+ })) === null || _dataSrcOptions$find === void 0 ? void 0 : _dataSrcOptions$find.label;
36918
+ }
36919
+ }];
36920
+ /** 凭证类型候枚举 */
36921
+
36922
+ var VoucherType;
36923
+
36924
+ (function (VoucherType) {
36925
+ /** 专用发票 */
36926
+ VoucherType["SPECIAL_INVOICE"] = "10";
36927
+ /** 普通发票 */
36928
+
36929
+ VoucherType["COMMON_INVOICE"] = "11";
36930
+ /** 海关进口增值税专用缴款书 */
36931
+
36932
+ VoucherType["CUSTOMS_IMPORT_VAT_PAYMENT_BOOK"] = "12";
36933
+ /** 航空运输电子客票行程单 */
36934
+
36935
+ VoucherType["AIR_TRANSPORT_ELECTRONIC_TICKET"] = "13";
36936
+ /** 铁路电子客票 */
36937
+
36938
+ VoucherType["RAILWAY_ELECTRONIC_TICKET"] = "14";
36939
+ /** 税收完税证明(契税) */
36940
+
36941
+ VoucherType["TAX_PAYMENT_CERTIFICATE"] = "15";
36942
+ /** 中央非税收入统一票据(土地出让金) */
36943
+
36944
+ VoucherType["CENTRAL_NON_TAX_REVENUE_UNIFIED_RECEIPT"] = "16";
36945
+ /** 财政票据 */
36946
+
36947
+ VoucherType["FINANCIAL_BILL"] = "05";
36948
+ /** 法院裁决书 */
36949
+
36950
+ VoucherType["COURT_DECISION"] = "06";
36951
+ /** 其他扣除凭证 */
36952
+
36953
+ VoucherType["OTHER_DEDUCTION_VOUCHER"] = "09";
36954
+ })(VoucherType || (VoucherType = {}));
36955
+ /** 凭证类型候选项 */
36956
+
36957
+
36958
+ var voucherTypeOptions = [{
36959
+ value: VoucherType.SPECIAL_INVOICE,
36960
+ label: '专用发票'
36961
+ }, {
36962
+ value: VoucherType.COMMON_INVOICE,
36963
+ label: '普通发票'
36964
+ }, {
36965
+ value: VoucherType.CUSTOMS_IMPORT_VAT_PAYMENT_BOOK,
36966
+ label: '海关进口增值税专用缴款书'
36967
+ }, {
36968
+ value: VoucherType.AIR_TRANSPORT_ELECTRONIC_TICKET,
36969
+ label: '航空运输电子客票行程单'
36970
+ }, {
36971
+ value: VoucherType.RAILWAY_ELECTRONIC_TICKET,
36972
+ label: '铁路电子客票'
36973
+ }, {
36974
+ value: VoucherType.TAX_PAYMENT_CERTIFICATE,
36975
+ label: '税收完税证明(契税)'
36976
+ }, {
36977
+ value: VoucherType.CENTRAL_NON_TAX_REVENUE_UNIFIED_RECEIPT,
36978
+ label: '中央非税收入统一票据(土地出让金)'
36979
+ }, {
36980
+ value: VoucherType.FINANCIAL_BILL,
36981
+ label: '财政票据'
36982
+ }, {
36983
+ value: VoucherType.COURT_DECISION,
36984
+ label: '法院裁决书'
36985
+ }, {
36986
+ value: VoucherType.OTHER_DEDUCTION_VOUCHER,
36987
+ label: '其他扣除凭证'
36988
+ }];
36989
+ /** 凭证类型候 - 规则字典 */
36990
+
36991
+ var voucherTypeRules = (_voucherTypeRules = {}, _defineProperty(_voucherTypeRules, VoucherType.SPECIAL_INVOICE, {
36992
+ 'deductVoucherNo': [{
36993
+ required: true
36994
+ }],
36995
+ 'issueDate': [{
36996
+ required: true
36997
+ }],
36998
+ 'voucherTotalAmt': [{
36999
+ required: true
37000
+ }],
37001
+ 'currentDeductAmt': [{
37002
+ required: true
37003
+ }]
37004
+ }), _defineProperty(_voucherTypeRules, VoucherType.COMMON_INVOICE, {
37005
+ 'deductVoucherNo': [{
37006
+ required: true
37007
+ }],
37008
+ 'issueDate': [{
37009
+ required: true
37010
+ }],
37011
+ 'voucherTotalAmt': [{
37012
+ required: true
37013
+ }],
37014
+ 'currentDeductAmt': [{
37015
+ required: true
37016
+ }]
37017
+ }), _defineProperty(_voucherTypeRules, VoucherType.CUSTOMS_IMPORT_VAT_PAYMENT_BOOK, {
37018
+ 'deductVoucherNo': [{
37019
+ required: true
37020
+ }],
37021
+ 'issueDate': [{
37022
+ required: true
37023
+ }],
37024
+ 'voucherTotalAmt': [{
37025
+ required: true
37026
+ }],
37027
+ 'currentDeductAmt': [{
37028
+ required: true
37029
+ }]
37030
+ }), _defineProperty(_voucherTypeRules, VoucherType.AIR_TRANSPORT_ELECTRONIC_TICKET, {
37031
+ 'deductVoucherNo': [{
37032
+ required: true
37033
+ }],
37034
+ 'issueDate': [{
37035
+ required: true
37036
+ }],
37037
+ 'voucherTotalAmt': [{
37038
+ required: true
37039
+ }],
37040
+ 'currentDeductAmt': [{
37041
+ required: true
37042
+ }]
37043
+ }), _defineProperty(_voucherTypeRules, VoucherType.RAILWAY_ELECTRONIC_TICKET, {
37044
+ 'deductVoucherNo': [{
37045
+ required: true
37046
+ }],
37047
+ 'issueDate': [{
37048
+ required: true
37049
+ }],
37050
+ 'voucherTotalAmt': [{
37051
+ required: true
37052
+ }],
37053
+ 'currentDeductAmt': [{
37054
+ required: true
37055
+ }]
37056
+ }), _defineProperty(_voucherTypeRules, VoucherType.TAX_PAYMENT_CERTIFICATE, {
37057
+ 'deductVoucherNo': [{
37058
+ required: true
37059
+ }],
37060
+ 'voucherTotalAmt': [{
37061
+ required: true
37062
+ }],
37063
+ 'currentDeductAmt': [{
37064
+ required: true
37065
+ }]
37066
+ }), _defineProperty(_voucherTypeRules, VoucherType.CENTRAL_NON_TAX_REVENUE_UNIFIED_RECEIPT, {
37067
+ 'deductVoucherCode': [{
37068
+ required: true
37069
+ }],
37070
+ 'deductVoucherNo': [{
37071
+ required: true
37072
+ }],
37073
+ 'voucherTotalAmt': [{
37074
+ required: true
37075
+ }],
37076
+ 'currentDeductAmt': [{
37077
+ required: true
37078
+ }]
37079
+ }), _defineProperty(_voucherTypeRules, VoucherType.FINANCIAL_BILL, {
37080
+ 'deductVoucherNo': [{
37081
+ required: true
37082
+ }],
37083
+ 'voucherTotalAmt': [{
37084
+ required: true
37085
+ }],
37086
+ 'currentDeductAmt': [{
37087
+ required: true
37088
+ }]
37089
+ }), _defineProperty(_voucherTypeRules, VoucherType.COURT_DECISION, {
37090
+ 'deductVoucherNo': [{
37091
+ required: true
37092
+ }],
37093
+ 'voucherTotalAmt': [{
37094
+ required: true
37095
+ }],
37096
+ 'currentDeductAmt': [{
37097
+ required: true
37098
+ }]
37099
+ }), _defineProperty(_voucherTypeRules, VoucherType.OTHER_DEDUCTION_VOUCHER, {
37100
+ 'voucherTotalAmt': [{
37101
+ required: true
37102
+ }],
37103
+ 'currentDeductAmt': [{
37104
+ required: true
37105
+ }],
37106
+ 'remark': [{
37107
+ required: true
37108
+ }]
37109
+ }), _voucherTypeRules);
37110
+ /** 静态的申报项目名称候选项 */
37111
+
37112
+ var projectOptions = [{
37113
+ value: 'KC0209',
37114
+ label: '小规模纳税人销售其取得(不含自建)的不动产(不含个人销售购买的住房)'
37115
+ }, {
37116
+ value: 'KC0210',
37117
+ label: '一般纳税人销售其取得(不含自建)的2016年4月30日前取得的不动产'
37118
+ }, {
37119
+ value: 'KC0211',
37120
+ label: '房地产开发企业销售房地产项目'
37121
+ }, {
37122
+ value: 'KC0212',
37123
+ label: '银行业金融机构、金融资产管理公司中的增值税一般纳税人处置抵债不动产'
37124
+ }];
37125
+ /**
37126
+ * 差额录入弹窗(静态)
37127
+ */
37128
+
37129
+ function DifferenceInputModal(props) {
37130
+ var _voucherTypeRules$vou, _voucherTypeRules$vou2, _voucherTypeRules$vou3, _voucherTypeRules$vou4, _voucherTypeRules$vou5, _voucherTypeRules$vou6;
37131
+
37132
+ var _props$open = props.open,
37133
+ open = _props$open === void 0 ? true : _props$open,
37134
+ onCancel = props.onCancel,
37135
+ onOk = props.onOk;
37136
+
37137
+ var _Form$useForm = Form$2.useForm(),
37138
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
37139
+ form = _Form$useForm2[0];
37140
+
37141
+ var _React$useState = React.useState([]),
37142
+ _React$useState2 = _slicedToArray(_React$useState, 2),
37143
+ dataSource = _React$useState2[0],
37144
+ setDataSource = _React$useState2[1];
37145
+
37146
+ var voucherType = Form$2.useWatch('voucherType', form) || form.getFieldValue('voucherType');
37147
+
37148
+ var _React$useState3 = React.useState(''),
37149
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
37150
+ projectCode = _React$useState4[0],
37151
+ setProjectCode = _React$useState4[1];
37152
+ /** 扣除额 (明细汇总) */
37153
+
37154
+
37155
+ var deductTotal = React.useMemo(function () {
37156
+ return dataSource.reduce(function (acc, curr) {
37157
+ return acc + (curr.currentDeductAmt || 0);
37158
+ }, 0);
37159
+ }, [dataSource]);
37160
+ /** 合计金额(明细汇总) */
37161
+
37162
+ var voucherTotal = React.useMemo(function () {
37163
+ return dataSource.reduce(function (acc, curr) {
37164
+ return acc + (curr.voucherTotalAmt || 0);
37165
+ }, 0);
37166
+ }, [dataSource]);
37167
+ var total = props.total || {
37168
+ voucherTotal: 0,
37169
+ deductTotal: 0
37170
+ };
37171
+ var onFinish = React.useCallback(function (values) {
37172
+ setDataSource([].concat(_toConsumableArray(dataSource), [_objectSpread2(_objectSpread2({}, values), {}, {
37173
+ $index: v4(),
37174
+ dataSrc: DataSrcEnum.MANUAL
37175
+ })]));
37176
+ form.resetFields();
37177
+ }, [dataSource, form]);
37178
+ React.useEffect(function () {
37179
+ console.log('DifferenceInputModal props.value ===>', props.value);
37180
+
37181
+ if (open) {
37182
+ var _props$value, _props$value2;
37183
+
37184
+ form.resetFields();
37185
+ setDataSource(((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.rows) || []);
37186
+ setProjectCode(((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.projectCode) || '');
37187
+ }
37188
+ }, [open, props.value]);
37189
+ return /*#__PURE__*/React.createElement(Modal$2, {
37190
+ title: "\u5DEE\u989D\u5F55\u5165",
37191
+ destroyOnClose: true,
37192
+ width: 1000,
37193
+ open: open,
37194
+ onCancel: onCancel,
37195
+ footer: /*#__PURE__*/React.createElement(Space$1, {
37196
+ align: "end",
37197
+ className: "kts-difference-modal-footer"
37198
+ }, /*#__PURE__*/React.createElement(Button$1, {
37199
+ onClick: onCancel
37200
+ }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button$1, {
37201
+ type: "primary",
37202
+ onClick: function onClick() {
37203
+ return onOk === null || onOk === void 0 ? void 0 : onOk({
37204
+ voucherTotal: voucherTotal,
37205
+ deductTotal: deductTotal,
37206
+ rows: dataSource,
37207
+ projectCode: projectCode
37208
+ });
37209
+ }
37210
+ }, "\u786E\u5B9A"))
37211
+ }, /*#__PURE__*/React.createElement("div", {
37212
+ className: "kts-difference-modal"
37213
+ }, /*#__PURE__*/React.createElement("div", {
37214
+ className: "kts-difference-modal-top"
37215
+ }, /*#__PURE__*/React.createElement(Form$2, {
37216
+ layout: 'horizontal',
37217
+ className: "kts-difference-modal-top-form",
37218
+ labelCol: {
37219
+ flex: '100px'
37220
+ }
37221
+ }, /*#__PURE__*/React.createElement(Row$1, null, /*#__PURE__*/React.createElement(Col$1, {
37222
+ span: 12
37223
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37224
+ label: "\u542B\u7A0E\u9500\u552E\u989D",
37225
+ className: "kts-difference-modal-item"
37226
+ }, /*#__PURE__*/React.createElement(InputNumber$1, {
37227
+ style: {
37228
+ width: '100%'
37229
+ },
37230
+ disabled: true,
37231
+ placeholder: "\u8BF7\u8F93\u5165\u542B\u7A0E\u9500\u552E\u989D",
37232
+ value: voucherTotal || 0
37233
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37234
+ span: 12
37235
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37236
+ label: "\u6263\u9664\u989D",
37237
+ className: "kts-difference-modal-item"
37238
+ }, /*#__PURE__*/React.createElement(InputNumber$1, {
37239
+ style: {
37240
+ width: '100%'
37241
+ },
37242
+ disabled: true,
37243
+ placeholder: "\u8BF7\u8F93\u5165\u6263\u9664\u989D",
37244
+ value: deductTotal || 0
37245
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37246
+ span: 24
37247
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37248
+ label: "\u7533\u62A5\u9879\u76EE\u540D\u79F0",
37249
+ className: "kts-difference-modal-item"
37250
+ }, /*#__PURE__*/React.createElement(Select$2, {
37251
+ options: projectOptions,
37252
+ placeholder: "\u8BF7\u9009\u62E9\u7533\u62A5\u9879\u76EE\u540D\u79F0",
37253
+ onChange: function onChange(value) {
37254
+ setProjectCode(value);
37255
+ },
37256
+ value: projectCode
37257
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37258
+ span: 24
37259
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37260
+ label: "\u5F55\u5165\u65B9\u5F0F",
37261
+ className: "kts-difference-modal-item"
37262
+ }, /*#__PURE__*/React.createElement(Radio$1.Group, {
37263
+ value: 'manual',
37264
+ optionType: 'button',
37265
+ options: [{
37266
+ label: '手工录入',
37267
+ value: 'manual'
37268
+ }, {
37269
+ label: '勾选录入',
37270
+ value: '1',
37271
+ disabled: true
37272
+ }, {
37273
+ label: '模板录入',
37274
+ value: '2',
37275
+ disabled: true
37276
+ }]
37277
+ })))))), /*#__PURE__*/React.createElement(Card, {
37278
+ className: "kts-difference-modal-form",
37279
+ bodyStyle: {
37280
+ padding: '20px 20px 10px 0'
37281
+ }
37282
+ }, /*#__PURE__*/React.createElement(Form$2, {
37283
+ form: form,
37284
+ layout: "horizontal",
37285
+ labelCol: {
37286
+ flex: '110px'
37287
+ },
37288
+ onFinish: onFinish
37289
+ }, /*#__PURE__*/React.createElement(Row$1, {
37290
+ className: "kts-difference-modal-row"
37291
+ }, /*#__PURE__*/React.createElement(Col$1, {
37292
+ span: 24 / 3
37293
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37294
+ name: 'voucherType',
37295
+ label: "\u51ED\u8BC1\u7C7B\u578B",
37296
+ className: "kts-difference-modal-cell",
37297
+ rules: [{
37298
+ required: true,
37299
+ message: '请选择凭证类型'
37300
+ }]
37301
+ }, /*#__PURE__*/React.createElement(Select$2, {
37302
+ options: voucherTypeOptions,
37303
+ placeholder: "\u8BF7\u9009\u62E9\u51ED\u8BC1\u7C7B\u578B"
37304
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37305
+ span: 24 / 3
37306
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37307
+ name: 'issueDate',
37308
+ label: "\u5F00\u5177\u65F6\u95F4",
37309
+ className: "kts-difference-modal-cell",
37310
+ rules: (_voucherTypeRules$vou = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou === void 0 ? void 0 : _voucherTypeRules$vou['issueDate']
37311
+ }, /*#__PURE__*/React.createElement(DatePicker, {
37312
+ style: {
37313
+ width: '100%'
37314
+ },
37315
+ placeholder: "\u8BF7\u8F93\u5165\u5F00\u5177\u65F6\u95F4"
37316
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37317
+ span: 24 / 3
37318
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37319
+ name: 'deductVoucherNo',
37320
+ label: "\u51ED\u8BC1\u53F7\u7801",
37321
+ className: "kts-difference-modal-cell",
37322
+ rules: (_voucherTypeRules$vou2 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou2 === void 0 ? void 0 : _voucherTypeRules$vou2['deductVoucherNo']
37323
+ }, /*#__PURE__*/React.createElement(Input$2, {
37324
+ placeholder: "\u8BF7\u8F93\u5165\u51ED\u8BC1\u53F7\u7801"
37325
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37326
+ span: 24 / 3
37327
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37328
+ name: 'deductVoucherCode',
37329
+ label: "\u51ED\u8BC1\u4EE3\u7801",
37330
+ className: "kts-difference-modal-cell",
37331
+ rules: (_voucherTypeRules$vou3 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou3 === void 0 ? void 0 : _voucherTypeRules$vou3['deductVoucherCode']
37332
+ }, /*#__PURE__*/React.createElement(Input$2, {
37333
+ placeholder: "\u8BF7\u8F93\u5165\u51ED\u8BC1\u4EE3\u7801"
37334
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37335
+ span: 24 / 3
37336
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37337
+ name: 'voucherTotalAmt',
37338
+ label: "\u51ED\u8BC1\u5408\u8BA1\u91D1\u989D",
37339
+ className: "kts-difference-modal-cell",
37340
+ rules: (_voucherTypeRules$vou4 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou4 === void 0 ? void 0 : _voucherTypeRules$vou4['voucherTotalAmt']
37341
+ }, /*#__PURE__*/React.createElement(InputNumber$1, {
37342
+ style: {
37343
+ width: '100%'
37344
+ },
37345
+ placeholder: "\u8BF7\u8F93\u5165\u51ED\u8BC1\u5408\u8BA1\u91D1\u989D"
37346
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37347
+ span: 24 / 3
37348
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37349
+ name: 'currentDeductAmt',
37350
+ label: "\u672C\u6B21\u6263\u9664\u91D1\u989D",
37351
+ className: "kts-difference-modal-cell",
37352
+ rules: (_voucherTypeRules$vou5 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou5 === void 0 ? void 0 : _voucherTypeRules$vou5['currentDeductAmt']
37353
+ }, /*#__PURE__*/React.createElement(InputNumber$1, {
37354
+ style: {
37355
+ width: '100%'
37356
+ },
37357
+ placeholder: "\u8BF7\u8F93\u5165\u672C\u6B21\u6263\u9664\u91D1\u989D"
37358
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37359
+ span: 24 / 3
37360
+ }, /*#__PURE__*/React.createElement(Form$2.Item, {
37361
+ name: 'remark',
37362
+ label: "\u5907\u6CE8",
37363
+ className: "kts-difference-modal-cell",
37364
+ rules: (_voucherTypeRules$vou6 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou6 === void 0 ? void 0 : _voucherTypeRules$vou6['remark']
37365
+ }, /*#__PURE__*/React.createElement(Input$2, {
37366
+ placeholder: "\u8BF7\u8F93\u5165\u5907\u6CE8"
37367
+ }))), /*#__PURE__*/React.createElement(Col$1, {
37368
+ span: 24
37369
+ }, /*#__PURE__*/React.createElement("div", {
37370
+ style: {
37371
+ display: 'flex',
37372
+ justifyContent: 'center',
37373
+ gap: 10
37374
+ }
37375
+ }, /*#__PURE__*/React.createElement(Button$1, {
37376
+ type: 'primary',
37377
+ size: 'small',
37378
+ onClick: function onClick() {
37379
+ return form.resetFields();
37380
+ }
37381
+ }, "\u6E05\u695A"), /*#__PURE__*/React.createElement(Button$1, {
37382
+ type: 'primary',
37383
+ size: 'small',
37384
+ onClick: function onClick() {
37385
+ return form.submit();
37386
+ }
37387
+ }, "\u6DFB\u52A0\u5E76\u7EE7\u7EED")))))), /*#__PURE__*/React.createElement("div", {
37388
+ className: "kts-difference-modal-total",
37389
+ style: {
37390
+ marginTop: 30
37391
+ }
37392
+ }, /*#__PURE__*/React.createElement("span", {
37393
+ className: "kts-difference-modal-total-item"
37394
+ }, "\u51ED\u8BC1\u5408\u8BA1\u91D1\u989D\u603B\u8BA1\uFF1A", /*#__PURE__*/React.createElement("b", null, total.voucherTotal.toFixed(2)), " \u5143"), /*#__PURE__*/React.createElement("span", {
37395
+ className: "kts-difference-modal-total-item"
37396
+ }, "\u672C\u6B21\u6263\u9664\u91D1\u989D\u603B\u8BA1\uFF1A", /*#__PURE__*/React.createElement("b", null, total.deductTotal.toFixed(2)), " \u5143")), /*#__PURE__*/React.createElement(Table$2, {
37397
+ className: "kts-difference-modal-table",
37398
+ bordered: true,
37399
+ size: "small",
37400
+ rowKey: "voucherNo",
37401
+ columns: [].concat(columns, [{
37402
+ title: '操作',
37403
+ dataIndex: 'action',
37404
+ key: 'action',
37405
+ width: 80,
37406
+ fixed: 'right',
37407
+ render: function render(text, record) {
37408
+ return /*#__PURE__*/React.createElement(Button$1, {
37409
+ type: 'link',
37410
+ size: 'small',
37411
+ onClick: function onClick() {
37412
+ return setDataSource(dataSource.filter(function (item) {
37413
+ return item.$index !== record.$index;
37414
+ }));
37415
+ }
37416
+ }, "\u5220\u9664");
37417
+ }
37418
+ }]),
37419
+ dataSource: dataSource,
37420
+ scroll: {
37421
+ x: 1000
37422
+ },
37423
+ pagination: {
37424
+ pageSize: 10,
37425
+ total: dataSource.length,
37426
+ showSizeChanger: false,
37427
+ showQuickJumper: false,
37428
+ showTotal: function showTotal(total) {
37429
+ return "\u5171 ".concat(total, " \u6761");
37430
+ }
37431
+ }
37432
+ })));
37433
+ }
37434
+
37435
+ var DifferenceInput = (function () {
37436
+ var controller = Invoice.useInvoiceController();
37437
+ var open = controller.useMemo(function (s) {
37438
+ return s.differenceInputState.open && s.differenceInputState.enabled && !s.goodsListState.importGoods.isVisibleDrawer;
37439
+ }, []);
37440
+ var data = controller.useMemo(function (s) {
37441
+ return s.differenceInputState.data;
37442
+ }, []);
37443
+ var value = React.useMemo(function () {
37444
+ return {
37445
+ rows: (data === null || data === void 0 ? void 0 : data.rows) || [],
37446
+ projectCode: (data === null || data === void 0 ? void 0 : data.projectCode) || '',
37447
+ voucherTotal: (data === null || data === void 0 ? void 0 : data.voucherTotal) || 0,
37448
+ deductTotal: (data === null || data === void 0 ? void 0 : data.deductTotal) || 0
37449
+ };
37450
+ }, [data, open]);
37451
+ console.log('DifferenceInput data ===>', data);
37452
+ return /*#__PURE__*/React.createElement(DifferenceInputModal, {
37453
+ value: value,
37454
+ open: open,
37455
+ onCancel: function onCancel() {
37456
+ controller.run( /*#__PURE__*/function () {
37457
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
37458
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
37459
+ while (1) {
37460
+ switch (_context.prev = _context.next) {
37461
+ case 0:
37462
+ s.differenceInputState.open = false;
37463
+
37464
+ case 1:
37465
+ case "end":
37466
+ return _context.stop();
37467
+ }
37468
+ }
37469
+ }, _callee);
37470
+ }));
37471
+
37472
+ return function (_x) {
37473
+ return _ref.apply(this, arguments);
37474
+ };
37475
+ }());
37476
+ },
37477
+ onOk: function onOk(data) {
37478
+ controller.run( /*#__PURE__*/function () {
37479
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
37480
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
37481
+ while (1) {
37482
+ switch (_context2.prev = _context2.next) {
37483
+ case 0:
37484
+ s.differenceInputState.data = data;
37485
+ s.goodsListState.deduction = data.deductTotal;
37486
+ s.differenceInputState.open = false;
37487
+
37488
+ case 3:
37489
+ case "end":
37490
+ return _context2.stop();
37491
+ }
37492
+ }
37493
+ }, _callee2);
37494
+ }));
37495
+
37496
+ return function (_x2) {
37497
+ return _ref2.apply(this, arguments);
37498
+ };
37499
+ }());
37500
+ }
37501
+ });
37502
+ });
37503
+
36734
37504
  // const config = {
36735
37505
  // number: 'BigNumber',
36736
37506
  // precision: 64,
@@ -36839,14 +37609,11 @@ var Main$7 = function Main(props) {
36839
37609
  key = _React$useState2[0],
36840
37610
  setKey = _React$useState2[1];
36841
37611
 
36842
- useToGenerateId(controller);
37612
+ useToGenerateId(controller); // useClearGoodsList(controller);
37613
+
36843
37614
  React.useEffect(function () {
36844
37615
  setKey(key + 1);
36845
- }, [controller]); // React.useEffect(() => {
36846
- // setKey(key + 1)
36847
- // controller.state.stakeholder.enables = ['taxAmount']
36848
- // }, [controller]);
36849
-
37616
+ }, [controller]);
36850
37617
  return /*#__PURE__*/React.createElement(InvoiceContext.Provider, {
36851
37618
  key: key,
36852
37619
  value: controller
@@ -36882,7 +37649,7 @@ var Main$7 = function Main(props) {
36882
37649
  /** 销售方 */
36883
37650
  , props.sign || /*#__PURE__*/React.createElement(Sign, null)
36884
37651
  /** 落款 */
36885
- , props.footExpand), /*#__PURE__*/React.createElement(ImportBuyerDrawer, null), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(AddComparisonDrawer, null), /*#__PURE__*/React.createElement(MeiTanModal, null), " ");
37652
+ , props.footExpand), /*#__PURE__*/React.createElement(ImportBuyerDrawer, null), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(AddComparisonDrawer, null), /*#__PURE__*/React.createElement(DifferenceInput, null), /*#__PURE__*/React.createElement(MeiTanModal, null), " ");
36886
37653
  };
36887
37654
  /** 数电 */
36888
37655
 
@@ -36897,7 +37664,8 @@ var Digtal = function Digtal(props) {
36897
37664
  key = _React$useState4[0],
36898
37665
  setKey = _React$useState4[1];
36899
37666
 
36900
- useToGenerateId(controller);
37667
+ useToGenerateId(controller); // useClearGoodsList(controller);
37668
+
36901
37669
  React.useEffect(function () {
36902
37670
  setKey(key + 1);
36903
37671
  }, [controller]);
@@ -36938,11 +37706,21 @@ var Digtal = function Digtal(props) {
36938
37706
  /** 特殊信息 */
36939
37707
  , props.sign || /*#__PURE__*/React.createElement(SignDigtal, null)
36940
37708
  /** 落款 */
36941
- ), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(ImportPassengerDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(MeiTanModal, null), " ");
36942
- };
37709
+ ), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(ImportPassengerDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(DifferenceInput, null), /*#__PURE__*/React.createElement(MeiTanModal, null), " ");
37710
+ }; // 切换到差额开票清楚商品列表
37711
+ // function useClearGoodsList(controller: InvoiceController) {
37712
+ // const enabled = controller.useMemo((s) => s.differenceInputState.enabled, []);
37713
+ // React.useEffect(() => {
37714
+ // controller.run(async (s) => {
37715
+ // if (enabled) {
37716
+ // s.goodsListState.goodsList = [];
37717
+ // }
37718
+ // })
37719
+ // }, [controller, enabled]);
37720
+ // }
36943
37721
 
36944
- var css_248z$F = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
36945
- styleInject(css_248z$F);
37722
+ var css_248z$G = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
37723
+ styleInject(css_248z$G);
36946
37724
 
36947
37725
  function TaxClassificationModal(props) {
36948
37726
  var _props$info6;
@@ -37076,7 +37854,7 @@ function TaxClassificationModal(props) {
37076
37854
  switcherIcon: /*#__PURE__*/React.createElement(Icon$2, {
37077
37855
  type: "down"
37078
37856
  })
37079
- }))), /*#__PURE__*/React.createElement(Card, {
37857
+ }))), /*#__PURE__*/React.createElement(Card$1, {
37080
37858
  className: "taxrightbox"
37081
37859
  }, /*#__PURE__*/React.createElement(Form$1, _objectSpread2(_objectSpread2({
37082
37860
  form: form
@@ -37098,4 +37876,4 @@ function TaxClassificationModal(props) {
37098
37876
  }, /*#__PURE__*/React.createElement(FormReadOnly, null))))));
37099
37877
  }
37100
37878
 
37101
- export { Invoice, InvoiceController, InvoiceTypeModal, TaxClassificationModal };
37879
+ export { DifferenceInputModal, Invoice, InvoiceController, InvoiceTypeModal, TaxClassificationModal };