kts-component-invoice-operate 3.2.78 → 3.2.80

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 (23) 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 +379 -44
  9. package/dist/index.js +375 -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/ui/default/EndowCodeDrawer/index.tsx +123 -2
  17. package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +1 -1
  18. package/src/Invoice/ui/digtal/Sign/index.tsx +11 -1
  19. package/src/TaxClassificationCodeModal/_test/easiest/index.tsx +178 -0
  20. package/src/TaxClassificationCodeModal/index.less +0 -0
  21. package/src/TaxClassificationCodeModal/index.md +6 -0
  22. package/src/TaxClassificationCodeModal/index.tsx +67 -0
  23. 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
  /**
@@ -13176,7 +13206,7 @@ var useColumns = (function (form) {
13176
13206
  dataIndex: 'taxRate',
13177
13207
  key: 'taxRate',
13178
13208
  align: 'right',
13179
- width: 70,
13209
+ width: 75,
13180
13210
  render: function render(value, record) {
13181
13211
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
13182
13212
  return React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('taxRate', {
@@ -16652,15 +16682,25 @@ var SignDigtal = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
16652
16682
  var model = controller.useMemo(function (s) {
16653
16683
  return s.model;
16654
16684
  }, []);
16685
+ /** 禁用字段 */
16686
+
16655
16687
  var disableds = controller.useMemo(function (s) {
16656
16688
  return s.stakeholder.disableds || [];
16657
16689
  }, []);
16690
+ /** 启用字段 */
16691
+
16692
+ var enables = controller.useMemo(function (s) {
16693
+ return s.stakeholder.enables || [];
16694
+ }, []);
16658
16695
  var readOnly = React__default['default'].useMemo(function () {
16659
16696
  return model === 'readOnly';
16660
16697
  }, [model]);
16661
16698
  var isReadOnly = React__default['default'].useCallback(function (field) {
16662
16699
  return disableds.indexOf(field) >= 0;
16663
- }, [disableds]); // 注册 form
16700
+ }, [disableds]);
16701
+ var isEnables = React__default['default'].useCallback(function (field) {
16702
+ return enables.indexOf(field) >= 0;
16703
+ }, [enables]); // 注册 form
16664
16704
 
16665
16705
  controller.useForm('sign', form);
16666
16706
 
@@ -16671,7 +16711,12 @@ var SignDigtal = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
16671
16711
  className: 'sign-digtal-readOnly-cont'
16672
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', {
16673
16713
  initialValue: props.defaultRemark
16674
- })(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, {
16675
16720
  layout: 'inline',
16676
16721
  className: 'digtal-readOnly-form'
16677
16722
  }, React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
@@ -22040,6 +22085,43 @@ var getItemCode = function getItemCode(record, editGood) {
22040
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";
22041
22086
  styleInject(css_248z$q);
22042
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
+ setTimeout(function () {
22096
+ form.resetFields();
22097
+ }, 500);
22098
+ }
22099
+ }, [form, props.open]);
22100
+ return React__default['default'].createElement(ktsXui.Drawer, {
22101
+ title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
22102
+ placement: "right",
22103
+ open: props.open,
22104
+ width: 503,
22105
+ onClose: props.onCancel
22106
+ }, React__default['default'].createElement(ktsXui.Form, {
22107
+ form: form
22108
+ }, React__default['default'].createElement(ktsXui.Form.Item, {
22109
+ name: 'search'
22110
+ }, React__default['default'].createElement(ktsXui.Input, {
22111
+ placeholder: "\u8BF7\u8F93\u5165\u7A0E\u6536\u5206\u7C7B\u7F16\u7801\u3001\u7A0E\u6536\u5206\u7C7B\u540D\u79F0\u8FDB\u884C\u68C0\u7D22",
22112
+ onChange: props.onSearch
22113
+ })), React__default['default'].createElement(ktsXui.Form.Item, {
22114
+ name: 'tree'
22115
+ }, React__default['default'].createElement(ktsXui.Tree, {
22116
+ onSelect: props.onSelect,
22117
+ loadData: props.onLoad,
22118
+ treeData: props.list,
22119
+ switcherIcon: React__default['default'].createElement(ktsComponentsAntdX3.Icon, {
22120
+ type: "down"
22121
+ })
22122
+ }))));
22123
+ }
22124
+
22043
22125
  var TreeNode = ktsComponentsAntdX3.Tree.TreeNode;
22044
22126
  var confirm = ktsComponentsAntdX3.Modal.confirm;
22045
22127
  var EndowCodeDrawer = (function () {
@@ -22163,6 +22245,9 @@ var DrawerBody$3 = function DrawerBody(props) {
22163
22245
  var actions = React__default['default'].useMemo(function () {
22164
22246
  return antd.createAsyncFormActions();
22165
22247
  }, []);
22248
+ var taxClassificationProps = controller.useMemo(function (s) {
22249
+ return s.taxClassificationProps;
22250
+ }, []);
22166
22251
  /** 免税类型 是否需要 */
22167
22252
 
22168
22253
  var isTaxFreeTypeNeeded = controller.useMemo(function (s) {
@@ -22536,21 +22621,265 @@ var DrawerBody$3 = function DrawerBody(props) {
22536
22621
  color: '#00000073'
22537
22622
  }
22538
22623
  }, "\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")));
22539
- }, [controller, actions]); // 是否享受优惠政策
22624
+ }, [controller, actions]);
22625
+ /** 税收分类编码 选择组件3 */
22626
+
22627
+ var ShowSearch3 = React__default['default'].useCallback(function (props) {
22628
+ var _React$useState13 = React__default['default'].useState(false),
22629
+ _React$useState14 = _slicedToArray(_React$useState13, 2),
22630
+ open = _React$useState14[0],
22631
+ setOpen = _React$useState14[1];
22632
+
22633
+ var _React$useState15 = React__default['default'].useState([]),
22634
+ _React$useState16 = _slicedToArray(_React$useState15, 2),
22635
+ list = _React$useState16[0],
22636
+ setList = _React$useState16[1];
22637
+
22638
+ var onSearch = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
22639
+ var value,
22640
+ _value$target,
22641
+ arr,
22642
+ _list,
22643
+ _args11 = arguments;
22644
+
22645
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
22646
+ while (1) {
22647
+ switch (_context11.prev = _context11.next) {
22648
+ case 0:
22649
+ value = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : null;
22650
+
22651
+ if (!value) {
22652
+ _context11.next = 9;
22653
+ break;
22654
+ }
22655
+
22656
+ _context11.next = 4;
22657
+ 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);
22658
+
22659
+ case 4:
22660
+ arr = _context11.sent;
22661
+ _list = arr.map(function (item) {
22662
+ return _objectSpread2(_objectSpread2({}, item), {}, {
22663
+ title: "".concat(item.productName, " ").concat(item.taxCategoryCode),
22664
+ key: item.taxCategoryCode,
22665
+ isLeaf: true
22666
+ });
22667
+ });
22668
+ setList(_list);
22669
+ _context11.next = 11;
22670
+ break;
22671
+
22672
+ case 9:
22673
+ _context11.next = 11;
22674
+ return onLoad();
22675
+
22676
+ case 11:
22677
+ case "end":
22678
+ return _context11.stop();
22679
+ }
22680
+ }
22681
+ }, _callee11);
22682
+ })), []);
22683
+ var onLoad = React__default['default'].useCallback( /*#__PURE__*/function () {
22684
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(value) {
22685
+ var arr, data, treeData;
22686
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
22687
+ while (1) {
22688
+ switch (_context12.prev = _context12.next) {
22689
+ case 0:
22690
+ _context12.next = 2;
22691
+ return controller.state.goodsListState.endowCode.onLoadTaxClassificationCode(value === null || value === void 0 ? void 0 : value.taxCategoryCode);
22540
22692
 
22541
- var _React$useState13 = React__default['default'].useState(0),
22542
- _React$useState14 = _slicedToArray(_React$useState13, 2),
22543
- favouredPolicyMark = _React$useState14[0],
22544
- setFavouredPolicyMark = _React$useState14[1]; // 确定
22693
+ case 2:
22694
+ arr = _context12.sent;
22695
+ data = arr.map(function (item) {
22696
+ return _objectSpread2(_objectSpread2({}, item), {}, {
22697
+ title: "".concat(item.productName, " ").concat(item.taxCategoryCode),
22698
+ key: item.taxCategoryCode
22699
+ });
22700
+ });
22701
+ treeData = optimizeTreeData(data);
22702
+
22703
+ if (value === null || value === void 0 ? void 0 : value.key) {
22704
+ setList(function (origin) {
22705
+ updateTreeData(origin, value.key, treeData);
22706
+ });
22707
+ } else {
22708
+ setList(treeData);
22709
+ }
22710
+
22711
+ return _context12.abrupt("return", []);
22712
+
22713
+ case 7:
22714
+ case "end":
22715
+ return _context12.stop();
22716
+ }
22717
+ }
22718
+ }, _callee12);
22719
+ }));
22720
+
22721
+ return function (_x9) {
22722
+ return _ref12.apply(this, arguments);
22723
+ };
22724
+ }(), []);
22725
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
22726
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
22727
+ while (1) {
22728
+ switch (_context13.prev = _context13.next) {
22729
+ case 0:
22730
+ _context13.next = 2;
22731
+ return onLoad();
22732
+
22733
+ case 2:
22734
+ setOpen(true);
22735
+
22736
+ case 3:
22737
+ case "end":
22738
+ return _context13.stop();
22739
+ }
22740
+ }
22741
+ }, _callee13);
22742
+ })), []);
22743
+ var onSelect = React__default['default'].useCallback(function (key, info) {
22744
+ actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
22745
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
22746
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
22747
+ while (1) {
22748
+ switch (_context14.prev = _context14.next) {
22749
+ case 0:
22750
+ s.value = info.node.taxCategoryCode;
22751
+
22752
+ case 1:
22753
+ case "end":
22754
+ return _context14.stop();
22755
+ }
22756
+ }
22757
+ }, _callee14);
22758
+ }));
22759
+
22760
+ return function (_x10) {
22761
+ return _ref14.apply(this, arguments);
22762
+ };
22763
+ }());
22764
+ actions.setFieldState('productName', /*#__PURE__*/function () {
22765
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
22766
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
22767
+ while (1) {
22768
+ switch (_context15.prev = _context15.next) {
22769
+ case 0:
22770
+ s.value = info.node.productName;
22771
+
22772
+ case 1:
22773
+ case "end":
22774
+ return _context15.stop();
22775
+ }
22776
+ }
22777
+ }, _callee15);
22778
+ }));
22779
+
22780
+ return function (_x11) {
22781
+ return _ref15.apply(this, arguments);
22782
+ };
22783
+ }());
22784
+ actions.setFieldState('shorthand', /*#__PURE__*/function () {
22785
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
22786
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
22787
+ while (1) {
22788
+ switch (_context16.prev = _context16.next) {
22789
+ case 0:
22790
+ s.value = info.node.shorthand;
22791
+
22792
+ case 1:
22793
+ case "end":
22794
+ return _context16.stop();
22795
+ }
22796
+ }
22797
+ }, _callee16);
22798
+ }));
22799
+
22800
+ return function (_x12) {
22801
+ return _ref16.apply(this, arguments);
22802
+ };
22803
+ }());
22804
+ actions.setFieldState('taxRate', /*#__PURE__*/function () {
22805
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(s) {
22806
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
22807
+ while (1) {
22808
+ switch (_context17.prev = _context17.next) {
22809
+ case 0:
22810
+ s.value = info.node.taxRate;
22811
+
22812
+ case 1:
22813
+ case "end":
22814
+ return _context17.stop();
22815
+ }
22816
+ }
22817
+ }, _callee17);
22818
+ }));
22819
+
22820
+ return function (_x13) {
22821
+ return _ref17.apply(this, arguments);
22822
+ };
22823
+ }());
22824
+ setOpen(false);
22825
+ }, [controller, actions]);
22826
+
22827
+ var optimizeTreeData = function optimizeTreeData(data) {
22828
+ return data.map(function (item) {
22829
+ return _objectSpread2(_objectSpread2({}, item), {}, {
22830
+ selectable: (item === null || item === void 0 ? void 0 : item.hzx) === 'N',
22831
+ isLeaf: (item === null || item === void 0 ? void 0 : item.hzx) === 'N'
22832
+ });
22833
+ });
22834
+ };
22835
+
22836
+ var updateTreeData = function updateTreeData(list, key, children) {
22837
+ return list.map(function (node) {
22838
+ if (node.key === key) {
22839
+ return _objectSpread2(_objectSpread2({}, node), {}, {
22840
+ children: children
22841
+ });
22842
+ }
22843
+
22844
+ if (node.children) {
22845
+ return _objectSpread2(_objectSpread2({}, node), {}, {
22846
+ children: updateTreeData(node.children, key, children)
22847
+ });
22848
+ }
22849
+
22850
+ return node;
22851
+ });
22852
+ };
22853
+
22854
+ return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(ktsComponentsAntdX3.Input, {
22855
+ readOnly: true,
22856
+ onClick: onClick,
22857
+ value: props.value
22858
+ }), React__default['default'].createElement(TaxClassificationModal, {
22859
+ list: list,
22860
+ open: open,
22861
+ onSelect: onSelect,
22862
+ onCancel: function onCancel() {
22863
+ setOpen(false);
22864
+ },
22865
+ onSearch: onSearch,
22866
+ onLoad: onLoad
22867
+ }));
22868
+ }, [controller]); // 是否享受优惠政策
22869
+
22870
+ var _React$useState17 = React__default['default'].useState(0),
22871
+ _React$useState18 = _slicedToArray(_React$useState17, 2),
22872
+ favouredPolicyMark = _React$useState18[0],
22873
+ setFavouredPolicyMark = _React$useState18[1]; // 确定
22545
22874
 
22546
22875
 
22547
22876
  var onSubmit = React__default['default'].useCallback(function (values) {
22548
22877
  controller.pipeline( /*#__PURE__*/function () {
22549
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
22878
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
22550
22879
  var endowCodeGood;
22551
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
22880
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
22552
22881
  while (1) {
22553
- switch (_context11.prev = _context11.next) {
22882
+ switch (_context18.prev = _context18.next) {
22554
22883
  case 0:
22555
22884
  endowCodeGood = s.goodsListState.endowCode.endowcodeGoodIndex.map(function (e) {
22556
22885
  return s.goodsListState.goodsMap.get(e);
@@ -22577,14 +22906,14 @@ var DrawerBody$3 = function DrawerBody(props) {
22577
22906
 
22578
22907
  case 4:
22579
22908
  case "end":
22580
- return _context11.stop();
22909
+ return _context18.stop();
22581
22910
  }
22582
22911
  }
22583
- }, _callee11);
22912
+ }, _callee18);
22584
22913
  }));
22585
22914
 
22586
- return function (_x9) {
22587
- return _ref11.apply(this, arguments);
22915
+ return function (_x14) {
22916
+ return _ref18.apply(this, arguments);
22588
22917
  };
22589
22918
  }())();
22590
22919
  }, [controller]);
@@ -22593,23 +22922,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22593
22922
  antd.FormEffectHooks.onFieldValueChange$('taxRate').subscribe(function (e) {
22594
22923
  setTaxRate(e.value);
22595
22924
  actions.setFieldState('taxFreeType', /*#__PURE__*/function () {
22596
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
22597
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
22925
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(s) {
22926
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
22598
22927
  while (1) {
22599
- switch (_context12.prev = _context12.next) {
22928
+ switch (_context19.prev = _context19.next) {
22600
22929
  case 0:
22601
22930
  if (e.value !== 0) s.value = undefined;
22602
22931
 
22603
22932
  case 1:
22604
22933
  case "end":
22605
- return _context12.stop();
22934
+ return _context19.stop();
22606
22935
  }
22607
22936
  }
22608
- }, _callee12);
22937
+ }, _callee19);
22609
22938
  }));
22610
22939
 
22611
- return function (_x10) {
22612
- return _ref12.apply(this, arguments);
22940
+ return function (_x15) {
22941
+ return _ref19.apply(this, arguments);
22613
22942
  };
22614
22943
  }());
22615
22944
  }); // 是否享受优惠政策
@@ -22617,23 +22946,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22617
22946
  antd.FormEffectHooks.onFieldValueChange$('favouredPolicyMark').subscribe(function (e) {
22618
22947
  setFavouredPolicyMark(e.value);
22619
22948
  actions.setFieldState('favouredPolicyName', /*#__PURE__*/function () {
22620
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
22621
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
22949
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(s) {
22950
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
22622
22951
  while (1) {
22623
- switch (_context13.prev = _context13.next) {
22952
+ switch (_context20.prev = _context20.next) {
22624
22953
  case 0:
22625
22954
  if (e.value === 0) s.value = undefined;
22626
22955
 
22627
22956
  case 1:
22628
22957
  case "end":
22629
- return _context13.stop();
22958
+ return _context20.stop();
22630
22959
  }
22631
22960
  }
22632
- }, _callee13);
22961
+ }, _callee20);
22633
22962
  }));
22634
22963
 
22635
- return function (_x11) {
22636
- return _ref13.apply(this, arguments);
22964
+ return function (_x16) {
22965
+ return _ref20.apply(this, arguments);
22637
22966
  };
22638
22967
  }());
22639
22968
  });
@@ -22646,7 +22975,7 @@ var DrawerBody$3 = function DrawerBody(props) {
22646
22975
  actions: actions,
22647
22976
  previewPlaceholder: " ",
22648
22977
  components: _objectSpread2(_objectSpread2({}, components), {}, {
22649
- showSearch: !!controller.state.goodsListState.endowCode.getTaxCategoryCodeTree ? ShowSearch2 : ShowSearch
22978
+ showSearch: !!controller.state.goodsListState.endowCode.onLoadTaxClassificationCode() ? ShowSearch3 : ShowSearch
22650
22979
  }),
22651
22980
  effects: effects
22652
22981
  }, React__default['default'].createElement(antd.FormButtonGroup, null, React__default['default'].createElement(antd.SchemaMarkupField, {
@@ -22659,6 +22988,12 @@ var DrawerBody$3 = function DrawerBody(props) {
22659
22988
  message: '请选择税收分类编码',
22660
22989
  required: true
22661
22990
  }]
22991
+ }), React__default['default'].createElement(antd.SchemaMarkupField, {
22992
+ name: "productName",
22993
+ type: "string",
22994
+ readOnly: true,
22995
+ default: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.productName,
22996
+ title: "\u7A0E\u6536\u5206\u7C7B\u540D\u79F0"
22662
22997
  }), React__default['default'].createElement(antd.SchemaMarkupField, {
22663
22998
  name: "shorthand",
22664
22999
  type: "string",
@@ -22733,23 +23068,23 @@ var DrawerBody$3 = function DrawerBody(props) {
22733
23068
  }, "\u786E\u5B9A"), React__default['default'].createElement(ktsComponentsAntdX3.Button, {
22734
23069
  onClick: function onClick() {
22735
23070
  controller.pipeline( /*#__PURE__*/function () {
22736
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
22737
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
23071
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(s) {
23072
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
22738
23073
  while (1) {
22739
- switch (_context14.prev = _context14.next) {
23074
+ switch (_context21.prev = _context21.next) {
22740
23075
  case 0:
22741
- return _context14.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
23076
+ return _context21.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
22742
23077
 
22743
23078
  case 1:
22744
23079
  case "end":
22745
- return _context14.stop();
23080
+ return _context21.stop();
22746
23081
  }
22747
23082
  }
22748
- }, _callee14);
23083
+ }, _callee21);
22749
23084
  }));
22750
23085
 
22751
- return function (_x12) {
22752
- return _ref14.apply(this, arguments);
23086
+ return function (_x17) {
23087
+ return _ref21.apply(this, arguments);
22753
23088
  };
22754
23089
  }())();
22755
23090
  }
@@ -23128,3 +23463,4 @@ var Digtal = function Digtal(props) {
23128
23463
  exports.Invoice = Invoice;
23129
23464
  exports.InvoiceController = InvoiceController;
23130
23465
  exports.InvoiceTypeModal = InvoiceTypeModal;
23466
+ exports.TaxClassificationModal = TaxClassificationModal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.78",
3
+ "version": "3.2.80",
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
  }