kts-component-invoice-operate 3.2.169 → 3.2.170

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.
package/dist/index.esm.js CHANGED
@@ -24931,14 +24931,15 @@ var DrawerBody$3 = function DrawerBody(props) {
24931
24931
  // s.value = info.node.taxRate
24932
24932
  // }
24933
24933
  // });
24934
+ var node = info.node || info;
24934
24935
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
24935
24936
  var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
24936
24937
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
24937
24938
  while (1) {
24938
24939
  switch (_context12.prev = _context12.next) {
24939
24940
  case 0:
24940
- if (info.taxCategoryCode) {
24941
- s.value = info.taxCategoryCode;
24941
+ if (node.taxCategoryCode) {
24942
+ s.value = node.taxCategoryCode;
24942
24943
  }
24943
24944
 
24944
24945
  case 1:
@@ -24959,8 +24960,8 @@ var DrawerBody$3 = function DrawerBody(props) {
24959
24960
  while (1) {
24960
24961
  switch (_context13.prev = _context13.next) {
24961
24962
  case 0:
24962
- if (info.shorthand) {
24963
- s.value = info.shorthand;
24963
+ if (node.shorthand) {
24964
+ s.value = node.shorthand;
24964
24965
  }
24965
24966
 
24966
24967
  case 1:
@@ -24978,24 +24979,26 @@ var DrawerBody$3 = function DrawerBody(props) {
24978
24979
  setOpen(false);
24979
24980
  }, [controller, actions]);
24980
24981
  var onSelect = React.useCallback(function (key, info) {
24982
+ var node = info.node || info;
24983
+
24981
24984
  if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
24982
- var _info$node$taxRateLis;
24985
+ var _node$taxRateList;
24983
24986
 
24984
- if ((_info$node$taxRateLis = info.node.taxRateList) === null || _info$node$taxRateLis === void 0 ? void 0 : _info$node$taxRateLis.length) {
24985
- setGoodsTaxRateList(info.node.taxRateList);
24987
+ if ((_node$taxRateList = node.taxRateList) === null || _node$taxRateList === void 0 ? void 0 : _node$taxRateList.length) {
24988
+ setGoodsTaxRateList(node.taxRateList);
24986
24989
  }
24987
24990
 
24988
24991
  if (!readOnlyTaxRate) {
24989
24992
  actions.setFieldState('taxRate', /*#__PURE__*/function () {
24990
24993
  var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
24991
- var _info$node$taxRateLis2;
24994
+ var _node$taxRateList2;
24992
24995
 
24993
24996
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
24994
24997
  while (1) {
24995
24998
  switch (_context14.prev = _context14.next) {
24996
24999
  case 0:
24997
- if (info.node.taxRateList && ((_info$node$taxRateLis2 = info.node.taxRateList) === null || _info$node$taxRateLis2 === void 0 ? void 0 : _info$node$taxRateLis2.length) === 1) {
24998
- s.value = info.node.taxRateList[0];
25000
+ if (node.taxRateList && ((_node$taxRateList2 = node.taxRateList) === null || _node$taxRateList2 === void 0 ? void 0 : _node$taxRateList2.length) === 1) {
25001
+ s.value = node.taxRateList[0];
24999
25002
  } else {
25000
25003
  s.value = undefined;
25001
25004
  }
@@ -25678,7 +25681,7 @@ var css_248z$t = ".taxdetailsbox {\n display: flex;\n justify-content: flex-st
25678
25681
  styleInject(css_248z$t);
25679
25682
 
25680
25683
  function TaxClassificationModal(props) {
25681
- var _props$info2, _props$info3;
25684
+ var _props$info6;
25682
25685
 
25683
25686
  var _Form$useForm = Form$1.useForm(),
25684
25687
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -25758,6 +25761,16 @@ function TaxClassificationModal(props) {
25758
25761
  });
25759
25762
  };
25760
25763
 
25764
+ React.useEffect(function () {
25765
+ var _props$info2, _props$info3, _props$info4, _props$info5;
25766
+
25767
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form.getFieldsValue()), {}, {
25768
+ taxCategoryCode: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.taxCategoryCode,
25769
+ productName: props === null || props === void 0 ? void 0 : (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.productName,
25770
+ shorthand: props === null || props === void 0 ? void 0 : (_props$info4 = props.info) === null || _props$info4 === void 0 ? void 0 : _props$info4.shorthand,
25771
+ desc: props === null || props === void 0 ? void 0 : (_props$info5 = props.info) === null || _props$info5 === void 0 ? void 0 : _props$info5.desc
25772
+ }));
25773
+ }, [props === null || props === void 0 ? void 0 : (_props$info6 = props.info) === null || _props$info6 === void 0 ? void 0 : _props$info6.key]);
25761
25774
  return /*#__PURE__*/React.createElement(Drawer$1, {
25762
25775
  title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
25763
25776
  placement: "right",
@@ -25803,16 +25816,10 @@ function TaxClassificationModal(props) {
25803
25816
  }))), /*#__PURE__*/React.createElement(Card, {
25804
25817
  className: "taxrightbox"
25805
25818
  }, /*#__PURE__*/React.createElement(Form$1, _objectSpread2(_objectSpread2({
25806
- form: form,
25807
- key: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.key
25819
+ form: form
25808
25820
  }, layout), {}, {
25809
25821
  initialValues: props.info
25810
25822
  }), /*#__PURE__*/React.createElement(Form$1.Item, {
25811
- rules: [{
25812
- required: true,
25813
- message: '请勾选税收分类编码'
25814
- }],
25815
- initialValue: (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.taxCategoryCode,
25816
25823
  name: "taxCategoryCode",
25817
25824
  label: "\u7F16\u7801"
25818
25825
  }, /*#__PURE__*/React.createElement(FormReadOnly, null)), /*#__PURE__*/React.createElement(Form$1.Item, {
package/dist/index.js CHANGED
@@ -24941,14 +24941,15 @@ var DrawerBody$3 = function DrawerBody(props) {
24941
24941
  // s.value = info.node.taxRate
24942
24942
  // }
24943
24943
  // });
24944
+ var node = info.node || info;
24944
24945
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
24945
24946
  var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
24946
24947
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
24947
24948
  while (1) {
24948
24949
  switch (_context12.prev = _context12.next) {
24949
24950
  case 0:
24950
- if (info.taxCategoryCode) {
24951
- s.value = info.taxCategoryCode;
24951
+ if (node.taxCategoryCode) {
24952
+ s.value = node.taxCategoryCode;
24952
24953
  }
24953
24954
 
24954
24955
  case 1:
@@ -24969,8 +24970,8 @@ var DrawerBody$3 = function DrawerBody(props) {
24969
24970
  while (1) {
24970
24971
  switch (_context13.prev = _context13.next) {
24971
24972
  case 0:
24972
- if (info.shorthand) {
24973
- s.value = info.shorthand;
24973
+ if (node.shorthand) {
24974
+ s.value = node.shorthand;
24974
24975
  }
24975
24976
 
24976
24977
  case 1:
@@ -24988,24 +24989,26 @@ var DrawerBody$3 = function DrawerBody(props) {
24988
24989
  setOpen(false);
24989
24990
  }, [controller, actions]);
24990
24991
  var onSelect = React__default['default'].useCallback(function (key, info) {
24992
+ var node = info.node || info;
24993
+
24991
24994
  if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
24992
- var _info$node$taxRateLis;
24995
+ var _node$taxRateList;
24993
24996
 
24994
- if ((_info$node$taxRateLis = info.node.taxRateList) === null || _info$node$taxRateLis === void 0 ? void 0 : _info$node$taxRateLis.length) {
24995
- setGoodsTaxRateList(info.node.taxRateList);
24997
+ if ((_node$taxRateList = node.taxRateList) === null || _node$taxRateList === void 0 ? void 0 : _node$taxRateList.length) {
24998
+ setGoodsTaxRateList(node.taxRateList);
24996
24999
  }
24997
25000
 
24998
25001
  if (!readOnlyTaxRate) {
24999
25002
  actions.setFieldState('taxRate', /*#__PURE__*/function () {
25000
25003
  var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
25001
- var _info$node$taxRateLis2;
25004
+ var _node$taxRateList2;
25002
25005
 
25003
25006
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
25004
25007
  while (1) {
25005
25008
  switch (_context14.prev = _context14.next) {
25006
25009
  case 0:
25007
- if (info.node.taxRateList && ((_info$node$taxRateLis2 = info.node.taxRateList) === null || _info$node$taxRateLis2 === void 0 ? void 0 : _info$node$taxRateLis2.length) === 1) {
25008
- s.value = info.node.taxRateList[0];
25010
+ if (node.taxRateList && ((_node$taxRateList2 = node.taxRateList) === null || _node$taxRateList2 === void 0 ? void 0 : _node$taxRateList2.length) === 1) {
25011
+ s.value = node.taxRateList[0];
25009
25012
  } else {
25010
25013
  s.value = undefined;
25011
25014
  }
@@ -25688,7 +25691,7 @@ var css_248z$t = ".taxdetailsbox {\n display: flex;\n justify-content: flex-st
25688
25691
  styleInject(css_248z$t);
25689
25692
 
25690
25693
  function TaxClassificationModal(props) {
25691
- var _props$info2, _props$info3;
25694
+ var _props$info6;
25692
25695
 
25693
25696
  var _Form$useForm = ktsXui.Form.useForm(),
25694
25697
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -25768,6 +25771,16 @@ function TaxClassificationModal(props) {
25768
25771
  });
25769
25772
  };
25770
25773
 
25774
+ React__default['default'].useEffect(function () {
25775
+ var _props$info2, _props$info3, _props$info4, _props$info5;
25776
+
25777
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form.getFieldsValue()), {}, {
25778
+ taxCategoryCode: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.taxCategoryCode,
25779
+ productName: props === null || props === void 0 ? void 0 : (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.productName,
25780
+ shorthand: props === null || props === void 0 ? void 0 : (_props$info4 = props.info) === null || _props$info4 === void 0 ? void 0 : _props$info4.shorthand,
25781
+ desc: props === null || props === void 0 ? void 0 : (_props$info5 = props.info) === null || _props$info5 === void 0 ? void 0 : _props$info5.desc
25782
+ }));
25783
+ }, [props === null || props === void 0 ? void 0 : (_props$info6 = props.info) === null || _props$info6 === void 0 ? void 0 : _props$info6.key]);
25771
25784
  return /*#__PURE__*/React__default['default'].createElement(ktsXui.Drawer, {
25772
25785
  title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
25773
25786
  placement: "right",
@@ -25813,16 +25826,10 @@ function TaxClassificationModal(props) {
25813
25826
  }))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Card, {
25814
25827
  className: "taxrightbox"
25815
25828
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.Form, _objectSpread2(_objectSpread2({
25816
- form: form,
25817
- key: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.key
25829
+ form: form
25818
25830
  }, layout), {}, {
25819
25831
  initialValues: props.info
25820
25832
  }), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
25821
- rules: [{
25822
- required: true,
25823
- message: '请勾选税收分类编码'
25824
- }],
25825
- initialValue: (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.taxCategoryCode,
25826
25833
  name: "taxCategoryCode",
25827
25834
  label: "\u7F16\u7801"
25828
25835
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null)), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.169",
3
+ "version": "3.2.170",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -379,30 +379,31 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
379
379
  // s.value = info.node.taxRate
380
380
  // }
381
381
  // });
382
-
382
+ let node = info.node || info;
383
383
  actions.setFieldState('taxClassificationCode', async s => {
384
- if(info.taxCategoryCode) {
385
- s.value = info.taxCategoryCode
384
+ if(node.taxCategoryCode) {
385
+ s.value = node.taxCategoryCode
386
386
  }
387
387
  });
388
388
 
389
389
  actions.setFieldState('shorthand', async (s) => {
390
- if (info.shorthand){
391
- s.value = info.shorthand
390
+ if (node.shorthand){
391
+ s.value = node.shorthand
392
392
  }
393
393
  });
394
394
  setOpen(false);
395
395
  }, [controller, actions]);
396
396
 
397
397
  const onSelect = React.useCallback((key: any, info: any) => {
398
+ let node = info.node || info;
398
399
  if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
399
- if (info.node.taxRateList?.length) {
400
- setGoodsTaxRateList(info.node.taxRateList);
400
+ if (node.taxRateList?.length) {
401
+ setGoodsTaxRateList(node.taxRateList);
401
402
  }
402
403
  if (!readOnlyTaxRate) {
403
404
  actions.setFieldState('taxRate', async s => {
404
- if (info.node.taxRateList && info.node.taxRateList?.length === 1) {
405
- s.value = info.node.taxRateList[0]
405
+ if (node.taxRateList && node.taxRateList?.length === 1) {
406
+ s.value = node.taxRateList[0]
406
407
  } else {
407
408
  s.value = undefined
408
409
  }
@@ -79,7 +79,16 @@ export default function TaxClassificationModal(props: TaxClassificationProps) {
79
79
  }).catch(errorInfo => {
80
80
  console.log('errorInfo', errorInfo);
81
81
  });
82
- }
82
+ }
83
+ React.useEffect(() => {
84
+ form.setFieldsValue({
85
+ ...form.getFieldsValue(),
86
+ taxCategoryCode: props?.info?.taxCategoryCode,
87
+ productName: props?.info?.productName,
88
+ shorthand: props?.info?.shorthand,
89
+ desc: props?.info?.desc,
90
+ })
91
+ },[props?.info?.key])
83
92
  return (
84
93
  <Drawer
85
94
  title="商品和服务税收分类编码"
@@ -123,8 +132,8 @@ export default function TaxClassificationModal(props: TaxClassificationProps) {
123
132
  </Form.Item>
124
133
  </Form>
125
134
  <Card className="taxrightbox">
126
- <Form form={form} key={props?.info?.key} {...layout} initialValues={props.info} >
127
- <Form.Item rules={[{ required: true, message: '请勾选税收分类编码' }, ]} initialValue={props.info?.taxCategoryCode} name={"taxCategoryCode"} label="编码">
135
+ <Form form={form} {...layout} initialValues={props.info} >
136
+ <Form.Item name={"taxCategoryCode"} label="编码">
128
137
  <FormReadOnly />
129
138
  </Form.Item>
130
139
  <Form.Item name={"productName"} label="货物和劳务名称">