kts-component-invoice-operate 3.2.77 → 3.2.79

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 (24) hide show
  1. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode/index.d.ts +8 -0
  2. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +2 -0
  3. package/dist/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.d.ts +2 -0
  4. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +5 -0
  5. package/dist/TaxClassificationCodeModal/_test/easiest/index.d.ts +3 -0
  6. package/dist/TaxClassificationCodeModal/index.d.ts +16 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.esm.js +366 -44
  9. package/dist/index.js +362 -39
  10. package/package.json +1 -1
  11. package/src/Invoice/Invoice-digtal/_test/readOnly/index.tsx +4 -3
  12. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode/index.tsx +15 -5
  13. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +3 -0
  14. package/src/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.ts +3 -0
  15. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +9 -4
  16. package/src/Invoice/InvoiceController/fns/addGoodDiscount.ts +2 -1
  17. package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +112 -2
  18. package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +1 -1
  19. package/src/Invoice/ui/digtal/Sign/index.tsx +11 -1
  20. package/src/TaxClassificationCodeModal/_test/easiest/index.tsx +176 -0
  21. package/src/TaxClassificationCodeModal/index.less +0 -0
  22. package/src/TaxClassificationCodeModal/index.md +6 -0
  23. package/src/TaxClassificationCodeModal/index.tsx +63 -0
  24. package/src/index.ts +3 -0
@@ -47,4 +47,12 @@ export default class EndowCode {
47
47
  cache: {
48
48
  [key: string]: any;
49
49
  };
50
+ /**
51
+ * 打开侧边栏
52
+ * */
53
+ onSearchTaxClassificationCode: (value?: any) => Promise<any[]>;
54
+ /**
55
+ * 动态加载
56
+ * */
57
+ onLoadTaxClassificationCode: (value?: any) => Promise<any[]>;
50
58
  }
@@ -48,4 +48,6 @@ export default interface IGood {
48
48
  favouredPolicyMark?: number;
49
49
  /** 优惠政策类型 */
50
50
  favouredPolicyName?: string;
51
+ /** 税收分类名称 */
52
+ productName?: string;
51
53
  }
@@ -3,6 +3,8 @@ import { ValidationRule } from "kts-components-antd-x3/lib/form";
3
3
  export default class Stakeholder {
4
4
  /** 禁用字段 */
5
5
  disableds?: string[];
6
+ /** 启用字段 */
7
+ enables?: string[];
6
8
  /** 字段字段规则 */
7
9
  rulesMap?: {
8
10
  [key: string]: ValidationRule[] | undefined;
@@ -2,6 +2,7 @@ import GoodsListState from './GoodsListState';
2
2
  import BuyerState from './BuyerState';
3
3
  import Stakeholder from './Stakeholder';
4
4
  import { IInvoiceTypeModalProps } from '../../../InvoiceTypeModal';
5
+ import { TaxClassificationProps } from '../../../TaxClassificationCodeModal';
5
6
  import AutoComplete from './AutoComplete';
6
7
  export default class InvoiceControllerState {
7
8
  /**
@@ -44,4 +45,8 @@ export default class InvoiceControllerState {
44
45
  typeModalProps?: IInvoiceTypeModalProps;
45
46
  /** 自动补全 */
46
47
  autoComplete: AutoComplete;
48
+ /**
49
+ * 商品税收分类编码窗口
50
+ * */
51
+ taxClassificationProps?: TaxClassificationProps;
47
52
  }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ export interface TaxClassificationProps {
3
+ /** 是否开启 */
4
+ open?: boolean;
5
+ /** 数据 */
6
+ list?: any[];
7
+ /** 点击了取消 */
8
+ onCancel?: () => void;
9
+ /** 点击了选择 */
10
+ onSelect?: (key: any, info: any) => void;
11
+ /** 点击了加载 */
12
+ onLoad: (value: any) => Promise<any[]>;
13
+ /** 点击了搜索 */
14
+ onSearch?: (value?: any) => void;
15
+ }
16
+ export default function TaxClassificationModal(props: TaxClassificationProps): JSX.Element;
package/dist/index.d.ts CHANGED
@@ -4,3 +4,5 @@ export { default as InvoiceController } from './Invoice/InvoiceController';
4
4
  export type { default as IGood } from './Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood';
5
5
  export { default as InvoiceTypeModal } from './InvoiceTypeModal';
6
6
  export type { IInvoiceTypeModalProps } from './InvoiceTypeModal';
7
+ export { default as TaxClassificationModal } from './TaxClassificationCodeModal';
8
+ export type { TaxClassificationProps } from './TaxClassificationCodeModal';
package/dist/index.esm.js CHANGED
@@ -2,9 +2,9 @@ import 'kts-components-antd-x3/dist/kts-components-antd-x3.css';
2
2
  import React, { createElement, createContext, useContext, useEffect, forwardRef, Children, isValidElement } 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 as Icon$1, Tag as Tag$1, Select, Button, Tooltip, Switch as Switch$1, Typography, Menu, Dropdown, AutoComplete as AutoComplete$2, Spin, Checkbox, Drawer, Descriptions, Empty, Divider, Popover as Popover$1, Table as Table$1, Tree, Modal as Modal$1, Row as Row$1, Col as Col$1 } from 'kts-components-antd-x3';
5
+ import { message, Form, Input, Icon as Icon$1, Tag as Tag$1, Select, Button, Tooltip, Switch as Switch$1, Typography, Menu, Dropdown, AutoComplete as AutoComplete$2, Spin, Checkbox, Drawer, Descriptions, Empty, Divider, Popover as Popover$1, Table as Table$1, Tree as Tree$1, Modal as Modal$1, Row as Row$1, Col as Col$1 } from 'kts-components-antd-x3';
6
6
  import { v4 } from 'uuid';
7
- import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Dropdown as Dropdown$1, Row, Col, Button as Button$1, Tooltip as Tooltip$1, Checkbox as Checkbox$1, Input as Input$1, Select as Select$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal } from 'kts-xui';
7
+ import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Dropdown as Dropdown$1, Row, Col, Button as Button$1, Tooltip as Tooltip$1, Checkbox as Checkbox$1, Input as Input$1, Select as Select$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal, Tree } 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';
@@ -1018,10 +1018,38 @@ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
1018
1018
  value: 3
1019
1019
  }];
1020
1020
  this.cache = {};
1021
+ this.onSearchTaxClassificationCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1022
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1023
+ while (1) {
1024
+ switch (_context2.prev = _context2.next) {
1025
+ case 0:
1026
+ return _context2.abrupt("return", []);
1027
+
1028
+ case 1:
1029
+ case "end":
1030
+ return _context2.stop();
1031
+ }
1032
+ }
1033
+ }, _callee2);
1034
+ }));
1035
+ this.onLoadTaxClassificationCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1036
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1037
+ while (1) {
1038
+ switch (_context3.prev = _context3.next) {
1039
+ case 0:
1040
+ return _context3.abrupt("return", []);
1041
+
1042
+ case 1:
1043
+ case "end":
1044
+ return _context3.stop();
1045
+ }
1046
+ }
1047
+ }, _callee3);
1048
+ }));
1021
1049
  });
1022
1050
 
1023
1051
  function draft(value) {
1024
- if (!value) return true; // isDiscount
1052
+ if (!value) return true; // isDiscount
1025
1053
 
1026
1054
  var goods = value.endowCode.endowcodeGoodIndex.map(function (e) {
1027
1055
  return value.goodsMap.get(e);
@@ -1152,6 +1180,7 @@ var Stakeholder = /*#__PURE__*/_createClass(function Stakeholder() {
1152
1180
  _classCallCheck(this, Stakeholder);
1153
1181
 
1154
1182
  this.disableds = void 0;
1183
+ this.enables = void 0;
1155
1184
  this.rulesMap = void 0;
1156
1185
  });
1157
1186
 
@@ -1180,6 +1209,7 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
1180
1209
  this.rootElement = null;
1181
1210
  this.typeModalProps = void 0;
1182
1211
  this.autoComplete = new AutoComplete();
1212
+ this.taxClassificationProps = void 0;
1183
1213
  });
1184
1214
 
1185
1215
  /**
@@ -1514,6 +1544,7 @@ var addGoodDiscount = /*#__PURE__*/(function () {
1514
1544
  taxClassificationCode: good.taxClassificationCode,
1515
1545
  taxRate: good.taxRate,
1516
1546
  itemName: good.itemName,
1547
+ shorthand: good.shorthand,
1517
1548
  itemNameSelf: good.itemNameSelf,
1518
1549
  favouredPolicyMark: good.favouredPolicyMark,
1519
1550
  favouredPolicyName: good.favouredPolicyName,
@@ -13165,7 +13196,7 @@ var useColumns = (function (form) {
13165
13196
  dataIndex: 'taxRate',
13166
13197
  key: 'taxRate',
13167
13198
  align: 'right',
13168
- width: 70,
13199
+ width: 75,
13169
13200
  render: function render(value, record) {
13170
13201
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
13171
13202
  return React.createElement(Form.Item, null, getFieldDecorator('taxRate', {
@@ -16641,15 +16672,25 @@ var SignDigtal = decorator(Form.create())(function (props) {
16641
16672
  var model = controller.useMemo(function (s) {
16642
16673
  return s.model;
16643
16674
  }, []);
16675
+ /** 禁用字段 */
16676
+
16644
16677
  var disableds = controller.useMemo(function (s) {
16645
16678
  return s.stakeholder.disableds || [];
16646
16679
  }, []);
16680
+ /** 启用字段 */
16681
+
16682
+ var enables = controller.useMemo(function (s) {
16683
+ return s.stakeholder.enables || [];
16684
+ }, []);
16647
16685
  var readOnly = React.useMemo(function () {
16648
16686
  return model === 'readOnly';
16649
16687
  }, [model]);
16650
16688
  var isReadOnly = React.useCallback(function (field) {
16651
16689
  return disableds.indexOf(field) >= 0;
16652
- }, [disableds]); // 注册 form
16690
+ }, [disableds]);
16691
+ var isEnables = React.useCallback(function (field) {
16692
+ return enables.indexOf(field) >= 0;
16693
+ }, [enables]); // 注册 form
16653
16694
 
16654
16695
  controller.useForm('sign', form);
16655
16696
 
@@ -16660,7 +16701,12 @@ var SignDigtal = decorator(Form.create())(function (props) {
16660
16701
  className: 'sign-digtal-readOnly-cont'
16661
16702
  }, React.createElement("div", null, React.createElement("span", null, "\u5907"), React.createElement("span", null, "\u6CE8")), React.createElement("div", null, getFieldDecorator('remarks', {
16662
16703
  initialValue: props.defaultRemark
16663
- })(React.createElement(MyDiv$1, null)))), React.createElement(Form, {
16704
+ })(isEnables('remarks') ? React.createElement(Input$1.TextArea, {
16705
+ placeholder: "\u8BF7\u8F93\u5165",
16706
+ style: {
16707
+ height: '100%'
16708
+ }
16709
+ }) : React.createElement(MyDiv$1, null)))), React.createElement(Form, {
16664
16710
  layout: 'inline',
16665
16711
  className: 'digtal-readOnly-form'
16666
16712
  }, React.createElement(Form.Item, {
@@ -22029,7 +22075,40 @@ var getItemCode = function getItemCode(record, editGood) {
22029
22075
  var css_248z$q = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
22030
22076
  styleInject(css_248z$q);
22031
22077
 
22032
- var TreeNode = Tree.TreeNode;
22078
+ function TaxClassificationModal(props) {
22079
+ var _Form$useForm = Form$1.useForm(),
22080
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
22081
+ form = _Form$useForm2[0];
22082
+
22083
+ React.useEffect(function () {
22084
+ if (!props.open) {
22085
+ form.resetFields();
22086
+ }
22087
+ }, [form, props.open]);
22088
+ return React.createElement(Drawer$1, {
22089
+ title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
22090
+ placement: "right",
22091
+ open: props.open,
22092
+ width: 503,
22093
+ onClose: props.onCancel
22094
+ }, React.createElement(Form$1, {
22095
+ form: form
22096
+ }, React.createElement(Form$1.Item, {
22097
+ name: 'search'
22098
+ }, React.createElement(Input$1, {
22099
+ placeholder: "\u8BF7\u8F93\u5165\u7A0E\u6536\u5206\u7C7B\u7F16\u7801\u3001\u7A0E\u6536\u5206\u7C7B\u540D\u79F0\u8FDB\u884C\u68C0\u7D22",
22100
+ onChange: props.onSearch
22101
+ })), React.createElement(Tree, {
22102
+ onSelect: props.onSelect,
22103
+ loadData: props.onLoad,
22104
+ treeData: props.list,
22105
+ switcherIcon: React.createElement(Icon$1, {
22106
+ type: "down"
22107
+ })
22108
+ })));
22109
+ }
22110
+
22111
+ var TreeNode = Tree$1.TreeNode;
22033
22112
  var confirm = Modal$1.confirm;
22034
22113
  var EndowCodeDrawer = (function () {
22035
22114
  var controller = Invoice.useInvoiceController();
@@ -22152,6 +22231,9 @@ var DrawerBody$3 = function DrawerBody(props) {
22152
22231
  var actions = React.useMemo(function () {
22153
22232
  return createAsyncFormActions();
22154
22233
  }, []);
22234
+ var taxClassificationProps = controller.useMemo(function (s) {
22235
+ return s.taxClassificationProps;
22236
+ }, []);
22155
22237
  /** 免税类型 是否需要 */
22156
22238
 
22157
22239
  var isTaxFreeTypeNeeded = controller.useMemo(function (s) {
@@ -22516,7 +22598,7 @@ var DrawerBody$3 = function DrawerBody(props) {
22516
22598
  taxCategoryCode: e.target.value
22517
22599
  }));
22518
22600
  }
22519
- }))), list && list.length > 0 ? React.createElement(Tree, {
22601
+ }))), list && list.length > 0 ? React.createElement(Tree$1, {
22520
22602
  defaultExpandAll: true,
22521
22603
  selectedKeys: [],
22522
22604
  onSelect: onSelect
@@ -22525,21 +22607,255 @@ var DrawerBody$3 = function DrawerBody(props) {
22525
22607
  color: '#00000073'
22526
22608
  }
22527
22609
  }, "\u8BF7\u8F93\u5165\u201C\u4EA7\u54C1\u6216\u670D\u52A1\u7B80\u79F0\u201D\u6216\u201C\u7A0E\u6536\u5206\u7C7B\u7F16\u7801\u201D\u67E5\u627E\u6570\u636E\u3002")));
22528
- }, [controller, actions]); // 是否享受优惠政策
22610
+ }, [controller, actions]);
22611
+ /** 税收分类编码 选择组件3 */
22612
+
22613
+ var ShowSearch3 = React.useCallback(function (props) {
22614
+ var _React$useState13 = React.useState(false),
22615
+ _React$useState14 = _slicedToArray(_React$useState13, 2),
22616
+ open = _React$useState14[0],
22617
+ setOpen = _React$useState14[1];
22618
+
22619
+ var _React$useState15 = React.useState([]),
22620
+ _React$useState16 = _slicedToArray(_React$useState15, 2),
22621
+ list = _React$useState16[0],
22622
+ setList = _React$useState16[1];
22623
+
22624
+ var onSearch = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
22625
+ var _value$target;
22626
+
22627
+ var value,
22628
+ arr,
22629
+ list,
22630
+ _args11 = arguments;
22631
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
22632
+ while (1) {
22633
+ switch (_context11.prev = _context11.next) {
22634
+ case 0:
22635
+ value = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : null;
22636
+ _context11.next = 3;
22637
+ return controller.state.goodsListState.endowCode.onSearchTaxClassificationCode(value === null || value === void 0 ? void 0 : (_value$target = value.target) === null || _value$target === void 0 ? void 0 : _value$target.value);
22638
+
22639
+ case 3:
22640
+ arr = _context11.sent;
22641
+ list = arr.map(function (item) {
22642
+ var _value$target2;
22643
+
22644
+ var data = _objectSpread2(_objectSpread2({}, item), {}, {
22645
+ title: "".concat(item.productName, " ").concat(item.taxCategoryCode),
22646
+ key: item.taxCategoryCode
22647
+ });
22648
+
22649
+ if (value === null || value === void 0 ? void 0 : (_value$target2 = value.target) === null || _value$target2 === void 0 ? void 0 : _value$target2.value) {
22650
+ data.isLeaf = true;
22651
+ } else {
22652
+ data.selectable = false;
22653
+ }
22529
22654
 
22530
- var _React$useState13 = React.useState(0),
22531
- _React$useState14 = _slicedToArray(_React$useState13, 2),
22532
- favouredPolicyMark = _React$useState14[0],
22533
- setFavouredPolicyMark = _React$useState14[1]; // 确定
22655
+ return data;
22656
+ });
22657
+ setList(list);
22658
+
22659
+ case 6:
22660
+ case "end":
22661
+ return _context11.stop();
22662
+ }
22663
+ }
22664
+ }, _callee11);
22665
+ })), []);
22666
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
22667
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
22668
+ while (1) {
22669
+ switch (_context12.prev = _context12.next) {
22670
+ case 0:
22671
+ _context12.next = 2;
22672
+ return onSearch();
22673
+
22674
+ case 2:
22675
+ setOpen(true);
22676
+
22677
+ case 3:
22678
+ case "end":
22679
+ return _context12.stop();
22680
+ }
22681
+ }
22682
+ }, _callee12);
22683
+ })), []);
22684
+ var onSelect = React.useCallback(function (key, info) {
22685
+ actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
22686
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
22687
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
22688
+ while (1) {
22689
+ switch (_context13.prev = _context13.next) {
22690
+ case 0:
22691
+ s.value = info.node.taxCategoryCode;
22692
+
22693
+ case 1:
22694
+ case "end":
22695
+ return _context13.stop();
22696
+ }
22697
+ }
22698
+ }, _callee13);
22699
+ }));
22700
+
22701
+ return function (_x9) {
22702
+ return _ref13.apply(this, arguments);
22703
+ };
22704
+ }());
22705
+ actions.setFieldState('productName', /*#__PURE__*/function () {
22706
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
22707
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
22708
+ while (1) {
22709
+ switch (_context14.prev = _context14.next) {
22710
+ case 0:
22711
+ s.value = info.node.productName;
22712
+
22713
+ case 1:
22714
+ case "end":
22715
+ return _context14.stop();
22716
+ }
22717
+ }
22718
+ }, _callee14);
22719
+ }));
22720
+
22721
+ return function (_x10) {
22722
+ return _ref14.apply(this, arguments);
22723
+ };
22724
+ }());
22725
+ actions.setFieldState('shorthand', /*#__PURE__*/function () {
22726
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
22727
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
22728
+ while (1) {
22729
+ switch (_context15.prev = _context15.next) {
22730
+ case 0:
22731
+ s.value = info.node.shorthand;
22732
+
22733
+ case 1:
22734
+ case "end":
22735
+ return _context15.stop();
22736
+ }
22737
+ }
22738
+ }, _callee15);
22739
+ }));
22740
+
22741
+ return function (_x11) {
22742
+ return _ref15.apply(this, arguments);
22743
+ };
22744
+ }());
22745
+ actions.setFieldState('taxRate', /*#__PURE__*/function () {
22746
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
22747
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
22748
+ while (1) {
22749
+ switch (_context16.prev = _context16.next) {
22750
+ case 0:
22751
+ s.value = info.node.taxRate;
22752
+
22753
+ case 1:
22754
+ case "end":
22755
+ return _context16.stop();
22756
+ }
22757
+ }
22758
+ }, _callee16);
22759
+ }));
22760
+
22761
+ return function (_x12) {
22762
+ return _ref16.apply(this, arguments);
22763
+ };
22764
+ }());
22765
+ setOpen(false);
22766
+ }, [controller, actions]);
22767
+
22768
+ var updateTreeData = function updateTreeData(list, key, children) {
22769
+ var demo = list.map(function (node) {
22770
+ if (node.key === key) {
22771
+ return _objectSpread2(_objectSpread2({}, node), {}, {
22772
+ children: children
22773
+ });
22774
+ }
22775
+
22776
+ if (node.children) {
22777
+ return _objectSpread2(_objectSpread2({}, node), {}, {
22778
+ children: updateTreeData(node.children, key, children)
22779
+ });
22780
+ }
22781
+
22782
+ return node;
22783
+ });
22784
+ setList(demo);
22785
+ };
22786
+
22787
+ var onLoad = React.useCallback( /*#__PURE__*/function () {
22788
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(value) {
22789
+ var arr, data;
22790
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
22791
+ while (1) {
22792
+ switch (_context17.prev = _context17.next) {
22793
+ case 0:
22794
+ if (!value.children) {
22795
+ _context17.next = 2;
22796
+ break;
22797
+ }
22798
+
22799
+ return _context17.abrupt("return", []);
22800
+
22801
+ case 2:
22802
+ _context17.next = 4;
22803
+ return controller.state.goodsListState.endowCode.onLoadTaxClassificationCode(value.taxCategoryCode);
22804
+
22805
+ case 4:
22806
+ arr = _context17.sent;
22807
+ data = arr.map(function (item) {
22808
+ return _objectSpread2(_objectSpread2({}, item), {}, {
22809
+ title: "".concat(item.productName, " ").concat(item.taxCategoryCode),
22810
+ key: item.taxCategoryCode
22811
+ });
22812
+ });
22813
+ setList(function (origin) {
22814
+ updateTreeData(origin, value.key, data);
22815
+ });
22816
+ return _context17.abrupt("return", []);
22817
+
22818
+ case 8:
22819
+ case "end":
22820
+ return _context17.stop();
22821
+ }
22822
+ }
22823
+ }, _callee17);
22824
+ }));
22825
+
22826
+ return function (_x13) {
22827
+ return _ref17.apply(this, arguments);
22828
+ };
22829
+ }(), []);
22830
+ return React.createElement(React.Fragment, null, React.createElement(Input, {
22831
+ readOnly: true,
22832
+ onClick: onClick,
22833
+ value: props.value
22834
+ }), React.createElement(TaxClassificationModal, {
22835
+ list: list,
22836
+ open: open,
22837
+ onSelect: onSelect,
22838
+ onCancel: function onCancel() {
22839
+ setOpen(false);
22840
+ },
22841
+ onSearch: onSearch,
22842
+ onLoad: onLoad
22843
+ }));
22844
+ }, [controller]); // 是否享受优惠政策
22845
+
22846
+ var _React$useState17 = React.useState(0),
22847
+ _React$useState18 = _slicedToArray(_React$useState17, 2),
22848
+ favouredPolicyMark = _React$useState18[0],
22849
+ setFavouredPolicyMark = _React$useState18[1]; // 确定
22534
22850
 
22535
22851
 
22536
22852
  var onSubmit = React.useCallback(function (values) {
22537
22853
  controller.pipeline( /*#__PURE__*/function () {
22538
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
22854
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
22539
22855
  var endowCodeGood;
22540
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
22856
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
22541
22857
  while (1) {
22542
- switch (_context11.prev = _context11.next) {
22858
+ switch (_context18.prev = _context18.next) {
22543
22859
  case 0:
22544
22860
  endowCodeGood = s.goodsListState.endowCode.endowcodeGoodIndex.map(function (e) {
22545
22861
  return s.goodsListState.goodsMap.get(e);
@@ -22566,14 +22882,14 @@ var DrawerBody$3 = function DrawerBody(props) {
22566
22882
 
22567
22883
  case 4:
22568
22884
  case "end":
22569
- return _context11.stop();
22885
+ return _context18.stop();
22570
22886
  }
22571
22887
  }
22572
- }, _callee11);
22888
+ }, _callee18);
22573
22889
  }));
22574
22890
 
22575
- return function (_x9) {
22576
- return _ref11.apply(this, arguments);
22891
+ return function (_x14) {
22892
+ return _ref18.apply(this, arguments);
22577
22893
  };
22578
22894
  }())();
22579
22895
  }, [controller]);
@@ -22582,23 +22898,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22582
22898
  FormEffectHooks.onFieldValueChange$('taxRate').subscribe(function (e) {
22583
22899
  setTaxRate(e.value);
22584
22900
  actions.setFieldState('taxFreeType', /*#__PURE__*/function () {
22585
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
22586
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
22901
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(s) {
22902
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
22587
22903
  while (1) {
22588
- switch (_context12.prev = _context12.next) {
22904
+ switch (_context19.prev = _context19.next) {
22589
22905
  case 0:
22590
22906
  if (e.value !== 0) s.value = undefined;
22591
22907
 
22592
22908
  case 1:
22593
22909
  case "end":
22594
- return _context12.stop();
22910
+ return _context19.stop();
22595
22911
  }
22596
22912
  }
22597
- }, _callee12);
22913
+ }, _callee19);
22598
22914
  }));
22599
22915
 
22600
- return function (_x10) {
22601
- return _ref12.apply(this, arguments);
22916
+ return function (_x15) {
22917
+ return _ref19.apply(this, arguments);
22602
22918
  };
22603
22919
  }());
22604
22920
  }); // 是否享受优惠政策
@@ -22606,23 +22922,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22606
22922
  FormEffectHooks.onFieldValueChange$('favouredPolicyMark').subscribe(function (e) {
22607
22923
  setFavouredPolicyMark(e.value);
22608
22924
  actions.setFieldState('favouredPolicyName', /*#__PURE__*/function () {
22609
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
22610
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
22925
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(s) {
22926
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
22611
22927
  while (1) {
22612
- switch (_context13.prev = _context13.next) {
22928
+ switch (_context20.prev = _context20.next) {
22613
22929
  case 0:
22614
22930
  if (e.value === 0) s.value = undefined;
22615
22931
 
22616
22932
  case 1:
22617
22933
  case "end":
22618
- return _context13.stop();
22934
+ return _context20.stop();
22619
22935
  }
22620
22936
  }
22621
- }, _callee13);
22937
+ }, _callee20);
22622
22938
  }));
22623
22939
 
22624
- return function (_x11) {
22625
- return _ref13.apply(this, arguments);
22940
+ return function (_x16) {
22941
+ return _ref20.apply(this, arguments);
22626
22942
  };
22627
22943
  }());
22628
22944
  });
@@ -22635,7 +22951,7 @@ var DrawerBody$3 = function DrawerBody(props) {
22635
22951
  actions: actions,
22636
22952
  previewPlaceholder: " ",
22637
22953
  components: _objectSpread2(_objectSpread2({}, components), {}, {
22638
- showSearch: !!controller.state.goodsListState.endowCode.getTaxCategoryCodeTree ? ShowSearch2 : ShowSearch
22954
+ showSearch: !!controller.state.goodsListState.endowCode.onSearchTaxClassificationCode() ? ShowSearch3 : ShowSearch
22639
22955
  }),
22640
22956
  effects: effects
22641
22957
  }, React.createElement(FormButtonGroup, null, React.createElement(SchemaMarkupField, {
@@ -22648,6 +22964,12 @@ var DrawerBody$3 = function DrawerBody(props) {
22648
22964
  message: '请选择税收分类编码',
22649
22965
  required: true
22650
22966
  }]
22967
+ }), React.createElement(SchemaMarkupField, {
22968
+ name: "productName",
22969
+ type: "string",
22970
+ readOnly: true,
22971
+ default: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.productName,
22972
+ title: "\u7A0E\u6536\u5206\u7C7B\u540D\u79F0"
22651
22973
  }), React.createElement(SchemaMarkupField, {
22652
22974
  name: "shorthand",
22653
22975
  type: "string",
@@ -22722,23 +23044,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22722
23044
  }, "\u786E\u5B9A"), React.createElement(Button, {
22723
23045
  onClick: function onClick() {
22724
23046
  controller.pipeline( /*#__PURE__*/function () {
22725
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
22726
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
23047
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(s) {
23048
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
22727
23049
  while (1) {
22728
- switch (_context14.prev = _context14.next) {
23050
+ switch (_context21.prev = _context21.next) {
22729
23051
  case 0:
22730
- return _context14.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
23052
+ return _context21.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
22731
23053
 
22732
23054
  case 1:
22733
23055
  case "end":
22734
- return _context14.stop();
23056
+ return _context21.stop();
22735
23057
  }
22736
23058
  }
22737
- }, _callee14);
23059
+ }, _callee21);
22738
23060
  }));
22739
23061
 
22740
- return function (_x12) {
22741
- return _ref14.apply(this, arguments);
23062
+ return function (_x17) {
23063
+ return _ref21.apply(this, arguments);
22742
23064
  };
22743
23065
  }())();
22744
23066
  }
@@ -23114,4 +23436,4 @@ var Digtal = function Digtal(props) {
23114
23436
  ), React.createElement(ImportGoodsDrawer, null), React.createElement(EndowCodeDrawer, null));
23115
23437
  };
23116
23438
 
23117
- export { Invoice, InvoiceController, InvoiceTypeModal };
23439
+ export { Invoice, InvoiceController, InvoiceTypeModal, TaxClassificationModal };