kts-component-invoice-operate 1.0.70 → 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
@@ -1523,7 +1523,7 @@ var Statistics = (function () {
1523
1523
  flex: 3,
1524
1524
  border: 'none'
1525
1525
  }
1526
- }, /*#__PURE__*/React.createElement("label", null, parseFloat(lineAmountIncludeTax).toFixed()), " b")));
1526
+ }, /*#__PURE__*/React.createElement("label", null, parseFloat(lineAmountIncludeTax).toFixed()))));
1527
1527
  });
1528
1528
 
1529
1529
  var AddRowButton = (function () {
@@ -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: {
@@ -4954,49 +4975,75 @@ var DrawerBody$2 = function DrawerBody() {
4954
4975
  },
4955
4976
  onRow: function onRow(record) {
4956
4977
  return {
4957
- onClick: function onClick(e) {
4958
- e.stopPropagation();
4978
+ onClick: function onClick() {
4959
4979
  controller.pipeline( /*#__PURE__*/function () {
4960
4980
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
4961
4981
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
4962
4982
  while (1) {
4963
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) {
4964
5011
  case 0:
4965
5012
  Object.keys(record).filter(function (e) {
4966
5013
  return !record[e] && record[e] !== 0;
4967
5014
  }).forEach(function (e) {
4968
5015
  delete record[e];
4969
5016
  });
4970
- _context2.next = 3;
5017
+ _context3.next = 3;
4971
5018
  return s.goodsListState.importGoods.verifyFn(record);
4972
5019
 
4973
5020
  case 3:
4974
- _context2.t0 = _context2.sent;
5021
+ _context3.t0 = _context3.sent;
4975
5022
 
4976
- if (!(_context2.t0 === false)) {
4977
- _context2.next = 6;
5023
+ if (!(_context3.t0 === false)) {
5024
+ _context3.next = 6;
4978
5025
  break;
4979
5026
  }
4980
5027
 
4981
- return _context2.abrupt("return");
5028
+ return _context3.abrupt("return");
4982
5029
 
4983
5030
  case 6:
4984
5031
  if (!(!s.goodsListState.editGood || !s.goodsListState.form)) {
4985
- _context2.next = 8;
5032
+ _context3.next = 8;
4986
5033
  break;
4987
5034
  }
4988
5035
 
4989
- return _context2.abrupt("return");
5036
+ return _context3.abrupt("return");
4990
5037
 
4991
5038
  case 8:
4992
5039
  s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
4993
5040
 
4994
5041
  if (s.goodsListState.editGood) {
4995
- _context2.next = 11;
5042
+ _context3.next = 11;
4996
5043
  break;
4997
5044
  }
4998
5045
 
4999
- return _context2.abrupt("return");
5046
+ return _context3.abrupt("return");
5000
5047
 
5001
5048
  case 11:
5002
5049
  if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
@@ -5014,14 +5061,14 @@ var DrawerBody$2 = function DrawerBody() {
5014
5061
 
5015
5062
  case 17:
5016
5063
  case "end":
5017
- return _context2.stop();
5064
+ return _context3.stop();
5018
5065
  }
5019
5066
  }
5020
- }, _callee2);
5067
+ }, _callee3);
5021
5068
  }));
5022
5069
 
5023
- return function (_x2) {
5024
- return _ref2.apply(this, arguments);
5070
+ return function (_x3) {
5071
+ return _ref3.apply(this, arguments);
5025
5072
  };
5026
5073
  }())();
5027
5074
  }
package/dist/index.js CHANGED
@@ -1532,7 +1532,7 @@ var Statistics = (function () {
1532
1532
  flex: 3,
1533
1533
  border: 'none'
1534
1534
  }
1535
- }, /*#__PURE__*/React__default['default'].createElement("label", null, parseFloat(lineAmountIncludeTax).toFixed()), " b")));
1535
+ }, /*#__PURE__*/React__default['default'].createElement("label", null, parseFloat(lineAmountIncludeTax).toFixed()))));
1536
1536
  });
1537
1537
 
1538
1538
  var AddRowButton = (function () {
@@ -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: {
@@ -4963,49 +4984,75 @@ var DrawerBody$2 = function DrawerBody() {
4963
4984
  },
4964
4985
  onRow: function onRow(record) {
4965
4986
  return {
4966
- onClick: function onClick(e) {
4967
- e.stopPropagation();
4987
+ onClick: function onClick() {
4968
4988
  controller.pipeline( /*#__PURE__*/function () {
4969
4989
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
4970
4990
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
4971
4991
  while (1) {
4972
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) {
4973
5020
  case 0:
4974
5021
  Object.keys(record).filter(function (e) {
4975
5022
  return !record[e] && record[e] !== 0;
4976
5023
  }).forEach(function (e) {
4977
5024
  delete record[e];
4978
5025
  });
4979
- _context2.next = 3;
5026
+ _context3.next = 3;
4980
5027
  return s.goodsListState.importGoods.verifyFn(record);
4981
5028
 
4982
5029
  case 3:
4983
- _context2.t0 = _context2.sent;
5030
+ _context3.t0 = _context3.sent;
4984
5031
 
4985
- if (!(_context2.t0 === false)) {
4986
- _context2.next = 6;
5032
+ if (!(_context3.t0 === false)) {
5033
+ _context3.next = 6;
4987
5034
  break;
4988
5035
  }
4989
5036
 
4990
- return _context2.abrupt("return");
5037
+ return _context3.abrupt("return");
4991
5038
 
4992
5039
  case 6:
4993
5040
  if (!(!s.goodsListState.editGood || !s.goodsListState.form)) {
4994
- _context2.next = 8;
5041
+ _context3.next = 8;
4995
5042
  break;
4996
5043
  }
4997
5044
 
4998
- return _context2.abrupt("return");
5045
+ return _context3.abrupt("return");
4999
5046
 
5000
5047
  case 8:
5001
5048
  s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
5002
5049
 
5003
5050
  if (s.goodsListState.editGood) {
5004
- _context2.next = 11;
5051
+ _context3.next = 11;
5005
5052
  break;
5006
5053
  }
5007
5054
 
5008
- return _context2.abrupt("return");
5055
+ return _context3.abrupt("return");
5009
5056
 
5010
5057
  case 11:
5011
5058
  if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
@@ -5023,14 +5070,14 @@ var DrawerBody$2 = function DrawerBody() {
5023
5070
 
5024
5071
  case 17:
5025
5072
  case "end":
5026
- return _context2.stop();
5073
+ return _context3.stop();
5027
5074
  }
5028
5075
  }
5029
- }, _callee2);
5076
+ }, _callee3);
5030
5077
  }));
5031
5078
 
5032
- return function (_x2) {
5033
- return _ref2.apply(this, arguments);
5079
+ return function (_x3) {
5080
+ return _ref3.apply(this, arguments);
5034
5081
  };
5035
5082
  }())();
5036
5083
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "1.0.70",
3
+ "version": "1.0.71",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -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
 
@@ -82,7 +82,7 @@ export default () => {
82
82
  <label>(小写)</label>
83
83
  </div>
84
84
  <div style={{ flex: 3, border: 'none' }}>
85
- <label>{parseFloat(lineAmountIncludeTax).toFixed()}</label> b
85
+ <label>{parseFloat(lineAmountIncludeTax).toFixed()}</label>
86
86
  </div>
87
87
  </div>
88
88
  </div>
@@ -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 } });
@@ -68,36 +84,40 @@ const DrawerBody = () => {
68
84
  }}
69
85
  onRow={(record) => {
70
86
  return {
71
- onClick: e => {
72
- e.stopPropagation();
73
- controller.pipeline(async (s) => {
74
-
75
- Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
76
-
77
- if (await s.goodsListState.importGoods.verifyFn(record) === false) return;
78
-
79
- if (!s.goodsListState.editGood || !s.goodsListState.form) return;
80
-
81
- s.goodsListState.editGood = { ...s.goodsListState.editGood, ...record };
82
- if (!s.goodsListState.editGood) return;
83
-
84
- if (`${s.goodsListState.editGood.priceIncludeTax}` === '0') {
85
- s.goodsListState.editGood.priceIncludeTax = undefined;
86
- s.goodsListState.editGood.priceExcludeTax = undefined;
87
- } else {
88
- s.goodsListState.editGood.priceExcludeTax = getPriceExcludeTax(s.goodsListState.editGood, record) as number;
87
+ onClick: () => {
88
+ controller.pipeline(
89
+ async s => {
90
+ if(s.goodsListState.editGood) return;
91
+ s.goodsListState.editGood = editGood;
92
+ },
93
+ async s => {
94
+ Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
95
+
96
+ if (await s.goodsListState.importGoods.verifyFn(record) === false) return;
97
+
98
+ if (!s.goodsListState.editGood || !s.goodsListState.form) return;
99
+
100
+ s.goodsListState.editGood = { ...s.goodsListState.editGood, ...record };
101
+ if (!s.goodsListState.editGood) return;
102
+
103
+ if (`${s.goodsListState.editGood.priceIncludeTax}` === '0') {
104
+ s.goodsListState.editGood.priceIncludeTax = undefined;
105
+ s.goodsListState.editGood.priceExcludeTax = undefined;
106
+ } else {
107
+ s.goodsListState.editGood.priceExcludeTax = getPriceExcludeTax(s.goodsListState.editGood, record) as number;
108
+ }
109
+
110
+ s.goodsListState.editGood.lineAmountIncludeTax = quantityPriceIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
111
+ s.goodsListState.editGood.itemName = getItemName(record);
112
+
113
+ s.goodsListState.form.setFieldsValue(s.goodsListState.editGood as any);
114
+ s.goodsListState.importGoods.isVisibleDrawer = false;
115
+
116
+ s.goodsListState.isTaxIncluded
117
+ ? updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
118
+ : updateUnitPriceTax(controller, s.goodsListState.form, record)
89
119
  }
90
-
91
- s.goodsListState.editGood.lineAmountIncludeTax = quantityPriceIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
92
- s.goodsListState.editGood.itemName = getItemName(record);
93
-
94
- s.goodsListState.form.setFieldsValue(s.goodsListState.editGood as any);
95
- s.goodsListState.importGoods.isVisibleDrawer = false;
96
-
97
- s.goodsListState.isTaxIncluded
98
- ? updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
99
- : updateUnitPriceTax(controller, s.goodsListState.form, record)
100
- })();
120
+ )();
101
121
  },
102
122
  };
103
123
  }}