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
package/dist/index.js CHANGED
@@ -1028,10 +1028,38 @@ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
1028
1028
  value: 3
1029
1029
  }];
1030
1030
  this.cache = {};
1031
+ this.onSearchTaxClassificationCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1032
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1033
+ while (1) {
1034
+ switch (_context2.prev = _context2.next) {
1035
+ case 0:
1036
+ return _context2.abrupt("return", []);
1037
+
1038
+ case 1:
1039
+ case "end":
1040
+ return _context2.stop();
1041
+ }
1042
+ }
1043
+ }, _callee2);
1044
+ }));
1045
+ this.onLoadTaxClassificationCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1046
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1047
+ while (1) {
1048
+ switch (_context3.prev = _context3.next) {
1049
+ case 0:
1050
+ return _context3.abrupt("return", []);
1051
+
1052
+ case 1:
1053
+ case "end":
1054
+ return _context3.stop();
1055
+ }
1056
+ }
1057
+ }, _callee3);
1058
+ }));
1031
1059
  });
1032
1060
 
1033
1061
  function draft(value) {
1034
- if (!value) return true; // isDiscount
1062
+ if (!value) return true; // isDiscount
1035
1063
 
1036
1064
  var goods = value.endowCode.endowcodeGoodIndex.map(function (e) {
1037
1065
  return value.goodsMap.get(e);
@@ -1162,6 +1190,7 @@ var Stakeholder = /*#__PURE__*/_createClass(function Stakeholder() {
1162
1190
  _classCallCheck(this, Stakeholder);
1163
1191
 
1164
1192
  this.disableds = void 0;
1193
+ this.enables = void 0;
1165
1194
  this.rulesMap = void 0;
1166
1195
  });
1167
1196
 
@@ -1190,6 +1219,7 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
1190
1219
  this.rootElement = null;
1191
1220
  this.typeModalProps = void 0;
1192
1221
  this.autoComplete = new AutoComplete();
1222
+ this.taxClassificationProps = void 0;
1193
1223
  });
1194
1224
 
1195
1225
  /**
@@ -1524,6 +1554,7 @@ var addGoodDiscount = /*#__PURE__*/(function () {
1524
1554
  taxClassificationCode: good.taxClassificationCode,
1525
1555
  taxRate: good.taxRate,
1526
1556
  itemName: good.itemName,
1557
+ shorthand: good.shorthand,
1527
1558
  itemNameSelf: good.itemNameSelf,
1528
1559
  favouredPolicyMark: good.favouredPolicyMark,
1529
1560
  favouredPolicyName: good.favouredPolicyName,
@@ -13175,7 +13206,7 @@ var useColumns = (function (form) {
13175
13206
  dataIndex: 'taxRate',
13176
13207
  key: 'taxRate',
13177
13208
  align: 'right',
13178
- width: 70,
13209
+ width: 75,
13179
13210
  render: function render(value, record) {
13180
13211
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
13181
13212
  return React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('taxRate', {
@@ -16651,15 +16682,25 @@ var SignDigtal = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
16651
16682
  var model = controller.useMemo(function (s) {
16652
16683
  return s.model;
16653
16684
  }, []);
16685
+ /** 禁用字段 */
16686
+
16654
16687
  var disableds = controller.useMemo(function (s) {
16655
16688
  return s.stakeholder.disableds || [];
16656
16689
  }, []);
16690
+ /** 启用字段 */
16691
+
16692
+ var enables = controller.useMemo(function (s) {
16693
+ return s.stakeholder.enables || [];
16694
+ }, []);
16657
16695
  var readOnly = React__default['default'].useMemo(function () {
16658
16696
  return model === 'readOnly';
16659
16697
  }, [model]);
16660
16698
  var isReadOnly = React__default['default'].useCallback(function (field) {
16661
16699
  return disableds.indexOf(field) >= 0;
16662
- }, [disableds]); // 注册 form
16700
+ }, [disableds]);
16701
+ var isEnables = React__default['default'].useCallback(function (field) {
16702
+ return enables.indexOf(field) >= 0;
16703
+ }, [enables]); // 注册 form
16663
16704
 
16664
16705
  controller.useForm('sign', form);
16665
16706
 
@@ -16670,7 +16711,12 @@ var SignDigtal = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
16670
16711
  className: 'sign-digtal-readOnly-cont'
16671
16712
  }, React__default['default'].createElement("div", null, React__default['default'].createElement("span", null, "\u5907"), React__default['default'].createElement("span", null, "\u6CE8")), React__default['default'].createElement("div", null, getFieldDecorator('remarks', {
16672
16713
  initialValue: props.defaultRemark
16673
- })(React__default['default'].createElement(MyDiv$1, null)))), React__default['default'].createElement(ktsComponentsAntdX3.Form, {
16714
+ })(isEnables('remarks') ? React__default['default'].createElement(ktsXui.Input.TextArea, {
16715
+ placeholder: "\u8BF7\u8F93\u5165",
16716
+ style: {
16717
+ height: '100%'
16718
+ }
16719
+ }) : React__default['default'].createElement(MyDiv$1, null)))), React__default['default'].createElement(ktsComponentsAntdX3.Form, {
16674
16720
  layout: 'inline',
16675
16721
  className: 'digtal-readOnly-form'
16676
16722
  }, React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
@@ -22039,6 +22085,39 @@ var getItemCode = function getItemCode(record, editGood) {
22039
22085
  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";
22040
22086
  styleInject(css_248z$q);
22041
22087
 
22088
+ function TaxClassificationModal(props) {
22089
+ var _Form$useForm = ktsXui.Form.useForm(),
22090
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
22091
+ form = _Form$useForm2[0];
22092
+
22093
+ React__default['default'].useEffect(function () {
22094
+ if (!props.open) {
22095
+ form.resetFields();
22096
+ }
22097
+ }, [form, props.open]);
22098
+ return React__default['default'].createElement(ktsXui.Drawer, {
22099
+ title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
22100
+ placement: "right",
22101
+ open: props.open,
22102
+ width: 503,
22103
+ onClose: props.onCancel
22104
+ }, React__default['default'].createElement(ktsXui.Form, {
22105
+ form: form
22106
+ }, React__default['default'].createElement(ktsXui.Form.Item, {
22107
+ name: 'search'
22108
+ }, React__default['default'].createElement(ktsXui.Input, {
22109
+ placeholder: "\u8BF7\u8F93\u5165\u7A0E\u6536\u5206\u7C7B\u7F16\u7801\u3001\u7A0E\u6536\u5206\u7C7B\u540D\u79F0\u8FDB\u884C\u68C0\u7D22",
22110
+ onChange: props.onSearch
22111
+ })), React__default['default'].createElement(ktsXui.Tree, {
22112
+ onSelect: props.onSelect,
22113
+ loadData: props.onLoad,
22114
+ treeData: props.list,
22115
+ switcherIcon: React__default['default'].createElement(ktsComponentsAntdX3.Icon, {
22116
+ type: "down"
22117
+ })
22118
+ })));
22119
+ }
22120
+
22042
22121
  var TreeNode = ktsComponentsAntdX3.Tree.TreeNode;
22043
22122
  var confirm = ktsComponentsAntdX3.Modal.confirm;
22044
22123
  var EndowCodeDrawer = (function () {
@@ -22162,6 +22241,9 @@ var DrawerBody$3 = function DrawerBody(props) {
22162
22241
  var actions = React__default['default'].useMemo(function () {
22163
22242
  return antd.createAsyncFormActions();
22164
22243
  }, []);
22244
+ var taxClassificationProps = controller.useMemo(function (s) {
22245
+ return s.taxClassificationProps;
22246
+ }, []);
22165
22247
  /** 免税类型 是否需要 */
22166
22248
 
22167
22249
  var isTaxFreeTypeNeeded = controller.useMemo(function (s) {
@@ -22535,21 +22617,255 @@ var DrawerBody$3 = function DrawerBody(props) {
22535
22617
  color: '#00000073'
22536
22618
  }
22537
22619
  }, "\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")));
22538
- }, [controller, actions]); // 是否享受优惠政策
22620
+ }, [controller, actions]);
22621
+ /** 税收分类编码 选择组件3 */
22622
+
22623
+ var ShowSearch3 = React__default['default'].useCallback(function (props) {
22624
+ var _React$useState13 = React__default['default'].useState(false),
22625
+ _React$useState14 = _slicedToArray(_React$useState13, 2),
22626
+ open = _React$useState14[0],
22627
+ setOpen = _React$useState14[1];
22628
+
22629
+ var _React$useState15 = React__default['default'].useState([]),
22630
+ _React$useState16 = _slicedToArray(_React$useState15, 2),
22631
+ list = _React$useState16[0],
22632
+ setList = _React$useState16[1];
22633
+
22634
+ var onSearch = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
22635
+ var _value$target;
22636
+
22637
+ var value,
22638
+ arr,
22639
+ list,
22640
+ _args11 = arguments;
22641
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
22642
+ while (1) {
22643
+ switch (_context11.prev = _context11.next) {
22644
+ case 0:
22645
+ value = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : null;
22646
+ _context11.next = 3;
22647
+ 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);
22648
+
22649
+ case 3:
22650
+ arr = _context11.sent;
22651
+ list = arr.map(function (item) {
22652
+ var _value$target2;
22653
+
22654
+ var data = _objectSpread2(_objectSpread2({}, item), {}, {
22655
+ title: "".concat(item.productName, " ").concat(item.taxCategoryCode),
22656
+ key: item.taxCategoryCode
22657
+ });
22658
+
22659
+ if (value === null || value === void 0 ? void 0 : (_value$target2 = value.target) === null || _value$target2 === void 0 ? void 0 : _value$target2.value) {
22660
+ data.isLeaf = true;
22661
+ } else {
22662
+ data.selectable = false;
22663
+ }
22539
22664
 
22540
- var _React$useState13 = React__default['default'].useState(0),
22541
- _React$useState14 = _slicedToArray(_React$useState13, 2),
22542
- favouredPolicyMark = _React$useState14[0],
22543
- setFavouredPolicyMark = _React$useState14[1]; // 确定
22665
+ return data;
22666
+ });
22667
+ setList(list);
22668
+
22669
+ case 6:
22670
+ case "end":
22671
+ return _context11.stop();
22672
+ }
22673
+ }
22674
+ }, _callee11);
22675
+ })), []);
22676
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
22677
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
22678
+ while (1) {
22679
+ switch (_context12.prev = _context12.next) {
22680
+ case 0:
22681
+ _context12.next = 2;
22682
+ return onSearch();
22683
+
22684
+ case 2:
22685
+ setOpen(true);
22686
+
22687
+ case 3:
22688
+ case "end":
22689
+ return _context12.stop();
22690
+ }
22691
+ }
22692
+ }, _callee12);
22693
+ })), []);
22694
+ var onSelect = React__default['default'].useCallback(function (key, info) {
22695
+ actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
22696
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
22697
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
22698
+ while (1) {
22699
+ switch (_context13.prev = _context13.next) {
22700
+ case 0:
22701
+ s.value = info.node.taxCategoryCode;
22702
+
22703
+ case 1:
22704
+ case "end":
22705
+ return _context13.stop();
22706
+ }
22707
+ }
22708
+ }, _callee13);
22709
+ }));
22710
+
22711
+ return function (_x9) {
22712
+ return _ref13.apply(this, arguments);
22713
+ };
22714
+ }());
22715
+ actions.setFieldState('productName', /*#__PURE__*/function () {
22716
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
22717
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
22718
+ while (1) {
22719
+ switch (_context14.prev = _context14.next) {
22720
+ case 0:
22721
+ s.value = info.node.productName;
22722
+
22723
+ case 1:
22724
+ case "end":
22725
+ return _context14.stop();
22726
+ }
22727
+ }
22728
+ }, _callee14);
22729
+ }));
22730
+
22731
+ return function (_x10) {
22732
+ return _ref14.apply(this, arguments);
22733
+ };
22734
+ }());
22735
+ actions.setFieldState('shorthand', /*#__PURE__*/function () {
22736
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
22737
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
22738
+ while (1) {
22739
+ switch (_context15.prev = _context15.next) {
22740
+ case 0:
22741
+ s.value = info.node.shorthand;
22742
+
22743
+ case 1:
22744
+ case "end":
22745
+ return _context15.stop();
22746
+ }
22747
+ }
22748
+ }, _callee15);
22749
+ }));
22750
+
22751
+ return function (_x11) {
22752
+ return _ref15.apply(this, arguments);
22753
+ };
22754
+ }());
22755
+ actions.setFieldState('taxRate', /*#__PURE__*/function () {
22756
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
22757
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
22758
+ while (1) {
22759
+ switch (_context16.prev = _context16.next) {
22760
+ case 0:
22761
+ s.value = info.node.taxRate;
22762
+
22763
+ case 1:
22764
+ case "end":
22765
+ return _context16.stop();
22766
+ }
22767
+ }
22768
+ }, _callee16);
22769
+ }));
22770
+
22771
+ return function (_x12) {
22772
+ return _ref16.apply(this, arguments);
22773
+ };
22774
+ }());
22775
+ setOpen(false);
22776
+ }, [controller, actions]);
22777
+
22778
+ var updateTreeData = function updateTreeData(list, key, children) {
22779
+ var demo = list.map(function (node) {
22780
+ if (node.key === key) {
22781
+ return _objectSpread2(_objectSpread2({}, node), {}, {
22782
+ children: children
22783
+ });
22784
+ }
22785
+
22786
+ if (node.children) {
22787
+ return _objectSpread2(_objectSpread2({}, node), {}, {
22788
+ children: updateTreeData(node.children, key, children)
22789
+ });
22790
+ }
22791
+
22792
+ return node;
22793
+ });
22794
+ setList(demo);
22795
+ };
22796
+
22797
+ var onLoad = React__default['default'].useCallback( /*#__PURE__*/function () {
22798
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(value) {
22799
+ var arr, data;
22800
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
22801
+ while (1) {
22802
+ switch (_context17.prev = _context17.next) {
22803
+ case 0:
22804
+ if (!value.children) {
22805
+ _context17.next = 2;
22806
+ break;
22807
+ }
22808
+
22809
+ return _context17.abrupt("return", []);
22810
+
22811
+ case 2:
22812
+ _context17.next = 4;
22813
+ return controller.state.goodsListState.endowCode.onLoadTaxClassificationCode(value.taxCategoryCode);
22814
+
22815
+ case 4:
22816
+ arr = _context17.sent;
22817
+ data = arr.map(function (item) {
22818
+ return _objectSpread2(_objectSpread2({}, item), {}, {
22819
+ title: "".concat(item.productName, " ").concat(item.taxCategoryCode),
22820
+ key: item.taxCategoryCode
22821
+ });
22822
+ });
22823
+ setList(function (origin) {
22824
+ updateTreeData(origin, value.key, data);
22825
+ });
22826
+ return _context17.abrupt("return", []);
22827
+
22828
+ case 8:
22829
+ case "end":
22830
+ return _context17.stop();
22831
+ }
22832
+ }
22833
+ }, _callee17);
22834
+ }));
22835
+
22836
+ return function (_x13) {
22837
+ return _ref17.apply(this, arguments);
22838
+ };
22839
+ }(), []);
22840
+ return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(ktsComponentsAntdX3.Input, {
22841
+ readOnly: true,
22842
+ onClick: onClick,
22843
+ value: props.value
22844
+ }), React__default['default'].createElement(TaxClassificationModal, {
22845
+ list: list,
22846
+ open: open,
22847
+ onSelect: onSelect,
22848
+ onCancel: function onCancel() {
22849
+ setOpen(false);
22850
+ },
22851
+ onSearch: onSearch,
22852
+ onLoad: onLoad
22853
+ }));
22854
+ }, [controller]); // 是否享受优惠政策
22855
+
22856
+ var _React$useState17 = React__default['default'].useState(0),
22857
+ _React$useState18 = _slicedToArray(_React$useState17, 2),
22858
+ favouredPolicyMark = _React$useState18[0],
22859
+ setFavouredPolicyMark = _React$useState18[1]; // 确定
22544
22860
 
22545
22861
 
22546
22862
  var onSubmit = React__default['default'].useCallback(function (values) {
22547
22863
  controller.pipeline( /*#__PURE__*/function () {
22548
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
22864
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
22549
22865
  var endowCodeGood;
22550
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
22866
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
22551
22867
  while (1) {
22552
- switch (_context11.prev = _context11.next) {
22868
+ switch (_context18.prev = _context18.next) {
22553
22869
  case 0:
22554
22870
  endowCodeGood = s.goodsListState.endowCode.endowcodeGoodIndex.map(function (e) {
22555
22871
  return s.goodsListState.goodsMap.get(e);
@@ -22576,14 +22892,14 @@ var DrawerBody$3 = function DrawerBody(props) {
22576
22892
 
22577
22893
  case 4:
22578
22894
  case "end":
22579
- return _context11.stop();
22895
+ return _context18.stop();
22580
22896
  }
22581
22897
  }
22582
- }, _callee11);
22898
+ }, _callee18);
22583
22899
  }));
22584
22900
 
22585
- return function (_x9) {
22586
- return _ref11.apply(this, arguments);
22901
+ return function (_x14) {
22902
+ return _ref18.apply(this, arguments);
22587
22903
  };
22588
22904
  }())();
22589
22905
  }, [controller]);
@@ -22592,23 +22908,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22592
22908
  antd.FormEffectHooks.onFieldValueChange$('taxRate').subscribe(function (e) {
22593
22909
  setTaxRate(e.value);
22594
22910
  actions.setFieldState('taxFreeType', /*#__PURE__*/function () {
22595
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
22596
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
22911
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(s) {
22912
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
22597
22913
  while (1) {
22598
- switch (_context12.prev = _context12.next) {
22914
+ switch (_context19.prev = _context19.next) {
22599
22915
  case 0:
22600
22916
  if (e.value !== 0) s.value = undefined;
22601
22917
 
22602
22918
  case 1:
22603
22919
  case "end":
22604
- return _context12.stop();
22920
+ return _context19.stop();
22605
22921
  }
22606
22922
  }
22607
- }, _callee12);
22923
+ }, _callee19);
22608
22924
  }));
22609
22925
 
22610
- return function (_x10) {
22611
- return _ref12.apply(this, arguments);
22926
+ return function (_x15) {
22927
+ return _ref19.apply(this, arguments);
22612
22928
  };
22613
22929
  }());
22614
22930
  }); // 是否享受优惠政策
@@ -22616,23 +22932,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22616
22932
  antd.FormEffectHooks.onFieldValueChange$('favouredPolicyMark').subscribe(function (e) {
22617
22933
  setFavouredPolicyMark(e.value);
22618
22934
  actions.setFieldState('favouredPolicyName', /*#__PURE__*/function () {
22619
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
22620
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
22935
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(s) {
22936
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
22621
22937
  while (1) {
22622
- switch (_context13.prev = _context13.next) {
22938
+ switch (_context20.prev = _context20.next) {
22623
22939
  case 0:
22624
22940
  if (e.value === 0) s.value = undefined;
22625
22941
 
22626
22942
  case 1:
22627
22943
  case "end":
22628
- return _context13.stop();
22944
+ return _context20.stop();
22629
22945
  }
22630
22946
  }
22631
- }, _callee13);
22947
+ }, _callee20);
22632
22948
  }));
22633
22949
 
22634
- return function (_x11) {
22635
- return _ref13.apply(this, arguments);
22950
+ return function (_x16) {
22951
+ return _ref20.apply(this, arguments);
22636
22952
  };
22637
22953
  }());
22638
22954
  });
@@ -22645,7 +22961,7 @@ var DrawerBody$3 = function DrawerBody(props) {
22645
22961
  actions: actions,
22646
22962
  previewPlaceholder: " ",
22647
22963
  components: _objectSpread2(_objectSpread2({}, components), {}, {
22648
- showSearch: !!controller.state.goodsListState.endowCode.getTaxCategoryCodeTree ? ShowSearch2 : ShowSearch
22964
+ showSearch: !!controller.state.goodsListState.endowCode.onSearchTaxClassificationCode() ? ShowSearch3 : ShowSearch
22649
22965
  }),
22650
22966
  effects: effects
22651
22967
  }, React__default['default'].createElement(antd.FormButtonGroup, null, React__default['default'].createElement(antd.SchemaMarkupField, {
@@ -22658,6 +22974,12 @@ var DrawerBody$3 = function DrawerBody(props) {
22658
22974
  message: '请选择税收分类编码',
22659
22975
  required: true
22660
22976
  }]
22977
+ }), React__default['default'].createElement(antd.SchemaMarkupField, {
22978
+ name: "productName",
22979
+ type: "string",
22980
+ readOnly: true,
22981
+ default: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.productName,
22982
+ title: "\u7A0E\u6536\u5206\u7C7B\u540D\u79F0"
22661
22983
  }), React__default['default'].createElement(antd.SchemaMarkupField, {
22662
22984
  name: "shorthand",
22663
22985
  type: "string",
@@ -22732,23 +23054,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22732
23054
  }, "\u786E\u5B9A"), React__default['default'].createElement(ktsComponentsAntdX3.Button, {
22733
23055
  onClick: function onClick() {
22734
23056
  controller.pipeline( /*#__PURE__*/function () {
22735
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
22736
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
23057
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(s) {
23058
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
22737
23059
  while (1) {
22738
- switch (_context14.prev = _context14.next) {
23060
+ switch (_context21.prev = _context21.next) {
22739
23061
  case 0:
22740
- return _context14.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
23062
+ return _context21.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
22741
23063
 
22742
23064
  case 1:
22743
23065
  case "end":
22744
- return _context14.stop();
23066
+ return _context21.stop();
22745
23067
  }
22746
23068
  }
22747
- }, _callee14);
23069
+ }, _callee21);
22748
23070
  }));
22749
23071
 
22750
- return function (_x12) {
22751
- return _ref14.apply(this, arguments);
23072
+ return function (_x17) {
23073
+ return _ref21.apply(this, arguments);
22752
23074
  };
22753
23075
  }())();
22754
23076
  }
@@ -23127,3 +23449,4 @@ var Digtal = function Digtal(props) {
23127
23449
  exports.Invoice = Invoice;
23128
23450
  exports.InvoiceController = InvoiceController;
23129
23451
  exports.InvoiceTypeModal = InvoiceTypeModal;
23452
+ exports.TaxClassificationModal = TaxClassificationModal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.77",
3
+ "version": "3.2.79",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -9,10 +9,11 @@ export default () => {
9
9
  React.useEffect(() => {
10
10
  (async () => {
11
11
  await controller.run(async s => { s.model = 'readOnly' }); // 设置只读
12
+ await controller.run(async s => { s.stakeholder.enables = ['remarks'] });
12
13
  await controller.formList.get('invoiceHeader')?.setFieldsValue({
13
14
  no: '2029292029201920291029',
14
15
  invoicingDate: '2023年7月6日',
15
- tag:'成品油',
16
+ tag: '成品油',
16
17
  })
17
18
  await controller.formList.get('stakeholder')?.setFieldsValue({
18
19
  buyerName: '国能供应链内蒙古有限公司',
@@ -30,8 +31,8 @@ export default () => {
30
31
  sellerAccount: '9550880218186900195',
31
32
  })
32
33
  await controller.formList.get('sign')?.setFieldsValue({
33
- remark: '备注',
34
- issuer: '张自豪',
34
+ remarks: '备注',
35
+ drawer: '张自豪',
35
36
  })
36
37
  })()
37
38
  }, [controller])
@@ -7,7 +7,7 @@ export default class EndowCode {
7
7
  /** 准备赋码的货物索引列表 */
8
8
  endowcodeGoodIndex: string[] = [];
9
9
 
10
- /**
10
+ /**
11
11
  * 获取 税收分类编码列表 (弃用)
12
12
  * @deprecated 请使用 getTaxCategoryCodeTree 替换
13
13
  * */
@@ -27,7 +27,7 @@ export default class EndowCode {
27
27
  /** 优惠政策 优惠政策 */
28
28
  getReadOnlyFavouredPolicy?: (value?: GoodsListState) => boolean;
29
29
 
30
- /**
30
+ /**
31
31
  * 获取赋码时候的默认值
32
32
  * @param value 商品信息
33
33
  * @param length 商品数量
@@ -71,17 +71,27 @@ export default class EndowCode {
71
71
  { label: '普通零税率(0%)', value: 3 },
72
72
  ];
73
73
 
74
- /**
74
+ /**
75
75
  * 小规模纳税人 自动赋码缓存 、
76
76
  * */
77
77
  cache: { [key: string]: any } = {};
78
+
79
+ /**
80
+ * 打开侧边栏
81
+ * */
82
+ onSearchTaxClassificationCode: (value?: any) => Promise<any[]> = async () => [];
83
+
84
+ /**
85
+ * 动态加载
86
+ * */
87
+ onLoadTaxClassificationCode: (value?: any) => Promise<any[]> = async () => [];
78
88
  }
79
89
 
80
90
  /** 草稿发票 税率 是否可以编辑 校验函数 */
81
91
  function draft(value?: GoodsListState) {
82
92
  if (!value) return true;
83
93
 
84
- // isDiscount
94
+ // isDiscount
85
95
  const goods = value.endowCode.endowcodeGoodIndex.map(e => value.goodsMap.get(e)).filter(e => e?.lineAttribute !== LineAttributeType.折扣行);
86
96
  const isDiscount = goods.some(e => e?.lineAttribute === LineAttributeType.被折扣行);
87
97
 
@@ -91,4 +101,4 @@ function draft(value?: GoodsListState) {
91
101
  } else {
92
102
  return false;
93
103
  }
94
- }
104
+ }
@@ -72,4 +72,7 @@ export default interface IGood {
72
72
 
73
73
  /** 优惠政策类型 */
74
74
  favouredPolicyName?: string;
75
+
76
+ /** 税收分类名称 */
77
+ productName?: string;
75
78
  }
@@ -6,6 +6,9 @@ export default class Stakeholder {
6
6
  /** 禁用字段 */
7
7
  disableds?: string[];
8
8
 
9
+ /** 启用字段 */
10
+ enables?: string[];
11
+
9
12
  /** 字段字段规则 */
10
13
  rulesMap?: { [key: string]: ValidationRule[] | undefined }
11
14
  }