kts-component-invoice-operate 1.0.67 → 1.0.71

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
@@ -4908,6 +4908,19 @@ var ImportGoodsDrawer = (function () {
4908
4908
  };
4909
4909
  }())();
4910
4910
  }, [controller]);
4911
+ React.useEffect(function () {
4912
+ setTimeout(function () {
4913
+ console.log(window.document.querySelector('.ktsAnt3x-drawer'));
4914
+
4915
+ if (visible) {
4916
+ var _window$document$quer;
4917
+
4918
+ (_window$document$quer = window.document.querySelector('.ktsAnt3x-drawer')) === null || _window$document$quer === void 0 ? void 0 : _window$document$quer.addEventListener('click', function (e) {// debugger
4919
+ // e.stopPropagation();
4920
+ }, true);
4921
+ }
4922
+ });
4923
+ }, [visible]);
4911
4924
  return /*#__PURE__*/React.createElement(Drawer, {
4912
4925
  title: "\u5546\u54C1\u5217\u8868",
4913
4926
  placement: "right",
@@ -4915,7 +4928,10 @@ var ImportGoodsDrawer = (function () {
4915
4928
  destroyOnClose: true,
4916
4929
  width: 983,
4917
4930
  onClose: onClose,
4918
- visible: visible
4931
+ visible: visible,
4932
+ getContainer: function getContainer() {
4933
+ return window.document.querySelector('.kts-invoice-operate-goods-list-able');
4934
+ }
4919
4935
  }, topExpand && /*#__PURE__*/React.createElement("div", {
4920
4936
  style: {
4921
4937
  marginBottom: 10
@@ -4934,6 +4950,11 @@ var DrawerBody$2 = function DrawerBody() {
4934
4950
  var pagination = controller.useMemo(function (s) {
4935
4951
  return s.goodsListState.importGoods.pagination;
4936
4952
  }, []);
4953
+
4954
+ var _React$useState = React.useState(controller.state.goodsListState.editGood),
4955
+ _React$useState2 = _slicedToArray(_React$useState, 1),
4956
+ editGood = _React$useState2[0];
4957
+
4937
4958
  React.useEffect(function () {
4938
4959
  controller.getGoodsList && controller.getGoodsList({
4939
4960
  pagination: {
@@ -4960,42 +4981,69 @@ var DrawerBody$2 = function DrawerBody() {
4960
4981
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
4961
4982
  while (1) {
4962
4983
  switch (_context2.prev = _context2.next) {
4984
+ case 0:
4985
+ if (!s.goodsListState.editGood) {
4986
+ _context2.next = 2;
4987
+ break;
4988
+ }
4989
+
4990
+ return _context2.abrupt("return");
4991
+
4992
+ case 2:
4993
+ s.goodsListState.editGood = editGood;
4994
+
4995
+ case 3:
4996
+ case "end":
4997
+ return _context2.stop();
4998
+ }
4999
+ }
5000
+ }, _callee2);
5001
+ }));
5002
+
5003
+ return function (_x2) {
5004
+ return _ref2.apply(this, arguments);
5005
+ };
5006
+ }(), /*#__PURE__*/function () {
5007
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(s) {
5008
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
5009
+ while (1) {
5010
+ switch (_context3.prev = _context3.next) {
4963
5011
  case 0:
4964
5012
  Object.keys(record).filter(function (e) {
4965
5013
  return !record[e] && record[e] !== 0;
4966
5014
  }).forEach(function (e) {
4967
5015
  delete record[e];
4968
5016
  });
4969
- _context2.next = 3;
5017
+ _context3.next = 3;
4970
5018
  return s.goodsListState.importGoods.verifyFn(record);
4971
5019
 
4972
5020
  case 3:
4973
- _context2.t0 = _context2.sent;
5021
+ _context3.t0 = _context3.sent;
4974
5022
 
4975
- if (!(_context2.t0 === false)) {
4976
- _context2.next = 6;
5023
+ if (!(_context3.t0 === false)) {
5024
+ _context3.next = 6;
4977
5025
  break;
4978
5026
  }
4979
5027
 
4980
- return _context2.abrupt("return");
5028
+ return _context3.abrupt("return");
4981
5029
 
4982
5030
  case 6:
4983
5031
  if (!(!s.goodsListState.editGood || !s.goodsListState.form)) {
4984
- _context2.next = 8;
5032
+ _context3.next = 8;
4985
5033
  break;
4986
5034
  }
4987
5035
 
4988
- return _context2.abrupt("return");
5036
+ return _context3.abrupt("return");
4989
5037
 
4990
5038
  case 8:
4991
5039
  s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
4992
5040
 
4993
5041
  if (s.goodsListState.editGood) {
4994
- _context2.next = 11;
5042
+ _context3.next = 11;
4995
5043
  break;
4996
5044
  }
4997
5045
 
4998
- return _context2.abrupt("return");
5046
+ return _context3.abrupt("return");
4999
5047
 
5000
5048
  case 11:
5001
5049
  if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
@@ -5013,14 +5061,14 @@ var DrawerBody$2 = function DrawerBody() {
5013
5061
 
5014
5062
  case 17:
5015
5063
  case "end":
5016
- return _context2.stop();
5064
+ return _context3.stop();
5017
5065
  }
5018
5066
  }
5019
- }, _callee2);
5067
+ }, _callee3);
5020
5068
  }));
5021
5069
 
5022
- return function (_x2) {
5023
- return _ref2.apply(this, arguments);
5070
+ return function (_x3) {
5071
+ return _ref3.apply(this, arguments);
5024
5072
  };
5025
5073
  }())();
5026
5074
  }
package/dist/index.js CHANGED
@@ -4917,6 +4917,19 @@ var ImportGoodsDrawer = (function () {
4917
4917
  };
4918
4918
  }())();
4919
4919
  }, [controller]);
4920
+ React__default['default'].useEffect(function () {
4921
+ setTimeout(function () {
4922
+ console.log(window.document.querySelector('.ktsAnt3x-drawer'));
4923
+
4924
+ if (visible) {
4925
+ var _window$document$quer;
4926
+
4927
+ (_window$document$quer = window.document.querySelector('.ktsAnt3x-drawer')) === null || _window$document$quer === void 0 ? void 0 : _window$document$quer.addEventListener('click', function (e) {// debugger
4928
+ // e.stopPropagation();
4929
+ }, true);
4930
+ }
4931
+ });
4932
+ }, [visible]);
4920
4933
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Drawer, {
4921
4934
  title: "\u5546\u54C1\u5217\u8868",
4922
4935
  placement: "right",
@@ -4924,7 +4937,10 @@ var ImportGoodsDrawer = (function () {
4924
4937
  destroyOnClose: true,
4925
4938
  width: 983,
4926
4939
  onClose: onClose,
4927
- visible: visible
4940
+ visible: visible,
4941
+ getContainer: function getContainer() {
4942
+ return window.document.querySelector('.kts-invoice-operate-goods-list-able');
4943
+ }
4928
4944
  }, topExpand && /*#__PURE__*/React__default['default'].createElement("div", {
4929
4945
  style: {
4930
4946
  marginBottom: 10
@@ -4943,6 +4959,11 @@ var DrawerBody$2 = function DrawerBody() {
4943
4959
  var pagination = controller.useMemo(function (s) {
4944
4960
  return s.goodsListState.importGoods.pagination;
4945
4961
  }, []);
4962
+
4963
+ var _React$useState = React__default['default'].useState(controller.state.goodsListState.editGood),
4964
+ _React$useState2 = _slicedToArray(_React$useState, 1),
4965
+ editGood = _React$useState2[0];
4966
+
4946
4967
  React__default['default'].useEffect(function () {
4947
4968
  controller.getGoodsList && controller.getGoodsList({
4948
4969
  pagination: {
@@ -4969,42 +4990,69 @@ var DrawerBody$2 = function DrawerBody() {
4969
4990
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
4970
4991
  while (1) {
4971
4992
  switch (_context2.prev = _context2.next) {
4993
+ case 0:
4994
+ if (!s.goodsListState.editGood) {
4995
+ _context2.next = 2;
4996
+ break;
4997
+ }
4998
+
4999
+ return _context2.abrupt("return");
5000
+
5001
+ case 2:
5002
+ s.goodsListState.editGood = editGood;
5003
+
5004
+ case 3:
5005
+ case "end":
5006
+ return _context2.stop();
5007
+ }
5008
+ }
5009
+ }, _callee2);
5010
+ }));
5011
+
5012
+ return function (_x2) {
5013
+ return _ref2.apply(this, arguments);
5014
+ };
5015
+ }(), /*#__PURE__*/function () {
5016
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(s) {
5017
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
5018
+ while (1) {
5019
+ switch (_context3.prev = _context3.next) {
4972
5020
  case 0:
4973
5021
  Object.keys(record).filter(function (e) {
4974
5022
  return !record[e] && record[e] !== 0;
4975
5023
  }).forEach(function (e) {
4976
5024
  delete record[e];
4977
5025
  });
4978
- _context2.next = 3;
5026
+ _context3.next = 3;
4979
5027
  return s.goodsListState.importGoods.verifyFn(record);
4980
5028
 
4981
5029
  case 3:
4982
- _context2.t0 = _context2.sent;
5030
+ _context3.t0 = _context3.sent;
4983
5031
 
4984
- if (!(_context2.t0 === false)) {
4985
- _context2.next = 6;
5032
+ if (!(_context3.t0 === false)) {
5033
+ _context3.next = 6;
4986
5034
  break;
4987
5035
  }
4988
5036
 
4989
- return _context2.abrupt("return");
5037
+ return _context3.abrupt("return");
4990
5038
 
4991
5039
  case 6:
4992
5040
  if (!(!s.goodsListState.editGood || !s.goodsListState.form)) {
4993
- _context2.next = 8;
5041
+ _context3.next = 8;
4994
5042
  break;
4995
5043
  }
4996
5044
 
4997
- return _context2.abrupt("return");
5045
+ return _context3.abrupt("return");
4998
5046
 
4999
5047
  case 8:
5000
5048
  s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
5001
5049
 
5002
5050
  if (s.goodsListState.editGood) {
5003
- _context2.next = 11;
5051
+ _context3.next = 11;
5004
5052
  break;
5005
5053
  }
5006
5054
 
5007
- return _context2.abrupt("return");
5055
+ return _context3.abrupt("return");
5008
5056
 
5009
5057
  case 11:
5010
5058
  if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
@@ -5022,14 +5070,14 @@ var DrawerBody$2 = function DrawerBody() {
5022
5070
 
5023
5071
  case 17:
5024
5072
  case "end":
5025
- return _context2.stop();
5073
+ return _context3.stop();
5026
5074
  }
5027
5075
  }
5028
- }, _callee2);
5076
+ }, _callee3);
5029
5077
  }));
5030
5078
 
5031
- return function (_x2) {
5032
- return _ref2.apply(this, arguments);
5079
+ return function (_x3) {
5080
+ return _ref3.apply(this, arguments);
5033
5081
  };
5034
5082
  }())();
5035
5083
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "1.0.67",
3
+ "version": "1.0.71",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -139,7 +139,7 @@ const getMok = async (current: number = 1) => {
139
139
  "specification": "苹果一号",
140
140
  "spuCode": "6000000040810519",
141
141
  "status": 1,
142
- "taxCategoryCode": "1100101020200000000",
142
+ // "taxCategoryCode": "1100101020200000000",
143
143
  "taxExemptionType": "",
144
144
  "taxId": 5,
145
145
  "taxRate": 3,
@@ -48,9 +48,7 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
48
48
  React.useEffect(() => {
49
49
  controller.pipeline(async (s) => {
50
50
  s.goodsListState.goodsMap = new Map();
51
- goodsList.forEach((e) => {
52
- s.goodsListState.goodsMap.set(e.$index, e);
53
- });
51
+ goodsList.forEach((e) => { s.goodsListState.goodsMap.set(e.$index, e); });
54
52
  })();
55
53
  }, [goodsList, controller]);
56
54
 
@@ -23,6 +23,19 @@ export default () => {
23
23
  controller.pipeline(async s => { s.goodsListState.importGoods.isVisibleDrawer = false })();
24
24
  }, [controller]);
25
25
 
26
+ React.useEffect(() => {
27
+ setTimeout(() => {
28
+ console.log(window.document.querySelector('.ktsAnt3x-drawer'))
29
+ if (visible) {
30
+ window.document.querySelector('.ktsAnt3x-drawer')?.addEventListener('click', e => {
31
+ // debugger
32
+ // e.stopPropagation();
33
+ }, true)
34
+ } else {
35
+ }
36
+ });
37
+ }, [visible])
38
+
26
39
  return (
27
40
  <Drawer
28
41
  title="商品列表"
@@ -32,9 +45,10 @@ export default () => {
32
45
  width={983}
33
46
  onClose={onClose}
34
47
  visible={visible}
48
+ getContainer={() => window.document.querySelector('.kts-invoice-operate-goods-list-able') as any}
35
49
  >
36
50
  {topExpand &&
37
- <div style={{ marginBottom: 10 }} >
51
+ <div style={{ marginBottom: 10 }} >
38
52
  {topExpand}
39
53
  </div>}
40
54
  <DrawerBody />
@@ -51,6 +65,8 @@ const DrawerBody = () => {
51
65
 
52
66
  const pagination = controller.useMemo(s => s.goodsListState.importGoods.pagination, []);
53
67
 
68
+ const [editGood] = React.useState(controller.state.goodsListState.editGood);
69
+
54
70
  React.useEffect(() => {
55
71
  controller.getGoodsList &&
56
72
  controller.getGoodsList({ pagination: { current: 1 } });
@@ -70,10 +86,15 @@ const DrawerBody = () => {
70
86
  return {
71
87
  onClick: () => {
72
88
  controller.pipeline(
73
- async (s) => {
89
+ async s => {
90
+ if(s.goodsListState.editGood) return;
91
+ s.goodsListState.editGood = editGood;
92
+ },
93
+ async s => {
74
94
  Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
75
95
 
76
96
  if (await s.goodsListState.importGoods.verifyFn(record) === false) return;
97
+
77
98
  if (!s.goodsListState.editGood || !s.goodsListState.form) return;
78
99
 
79
100
  s.goodsListState.editGood = { ...s.goodsListState.editGood, ...record };
@@ -91,7 +112,7 @@ const DrawerBody = () => {
91
112
 
92
113
  s.goodsListState.form.setFieldsValue(s.goodsListState.editGood as any);
93
114
  s.goodsListState.importGoods.isVisibleDrawer = false;
94
-
115
+
95
116
  s.goodsListState.isTaxIncluded
96
117
  ? updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
97
118
  : updateUnitPriceTax(controller, s.goodsListState.form, record)