kts-component-invoice-operate 3.2.59 → 3.2.61

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.js CHANGED
@@ -1003,6 +1003,7 @@ var Drag = /*#__PURE__*/_createClass(function Drag() {
1003
1003
  this.isStart = false;
1004
1004
  this.current = void 0;
1005
1005
  this.container = void 0;
1006
+ this.site = void 0;
1006
1007
  });
1007
1008
 
1008
1009
  var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
@@ -10173,7 +10174,7 @@ function Search() {
10173
10174
  });
10174
10175
  }
10175
10176
 
10176
- var css_248z$5 = ".kts-invoice-operate-goods-list-itemName-drag-container {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 9999;\n}\n";
10177
+ var css_248z$5 = ".kts-invoice-operate-goods-list-itemName-drag-container-u {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-u::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 9999;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-d {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-d::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n bottom: 0;\n z-index: 9999;\n}\n";
10177
10178
  styleInject(css_248z$5);
10178
10179
 
10179
10180
  function TableRow(props) {
@@ -10182,9 +10183,18 @@ function TableRow(props) {
10182
10183
  var goodsMap = controller.useMemo(function (s) {
10183
10184
  return s.goodsListState.goodsMap;
10184
10185
  }, []);
10186
+ /** 当前拖动中的货品索引 */
10187
+
10185
10188
  var current = controller.useMemo(function (s) {
10186
10189
  return s.goodsListState.drag.current;
10187
10190
  }, []);
10191
+ /** 当前拖动中的货品索引 */
10192
+
10193
+ var site = controller.useMemo(function (s) {
10194
+ return s.goodsListState.drag.site;
10195
+ }, []);
10196
+ /** 准备插入的货物索引 */
10197
+
10188
10198
  var container = controller.useMemo(function (s) {
10189
10199
  return s.goodsListState.drag.container;
10190
10200
  }, []);
@@ -10218,7 +10228,7 @@ function TableRow(props) {
10218
10228
  bottom: 0
10219
10229
  }
10220
10230
  })) : React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
10221
- className: classNames__default['default'](props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container' : undefined)
10231
+ className: classNames__default['default'](props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
10222
10232
  }));
10223
10233
  }
10224
10234
 
@@ -12040,64 +12050,57 @@ function Drag$1(props) {
12040
12050
  var currentGood = controller.state.goodsListState.goodsList.filter(function (e) {
12041
12051
  return e.$index === record.$index;
12042
12052
  })[0];
12043
- mounting(React__default['default'].createElement(DragDiv, _objectSpread2({}, currentGood))); // 监听移动
12044
-
12053
+ mounting(React__default['default'].createElement(DragDiv, _objectSpread2({}, currentGood)));
12045
12054
  rowList.forEach(function (e) {
12046
- e.addEventListener('mouseover', onMouseover);
12055
+ e.addEventListener('mousemove', onMousemove);
12047
12056
  });
12048
12057
 
12049
- function onMouseover(e) {
12058
+ function onMousemove(e) {
12050
12059
  controller.run( /*#__PURE__*/function () {
12051
12060
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
12052
- var _getRow, _getRow$dataset;
12061
+ var _rowDom$dataset;
12053
12062
 
12054
- var container, currentGood, row, currentIndex, containerIndex, _currentIndex, _containerIndex, t;
12063
+ var rowDom, container, row, currentGood, currentIndex, containerIndex, _currentIndex, _containerIndex, t, rect, mouseY;
12055
12064
 
12056
12065
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
12057
12066
  while (1) {
12058
12067
  switch (_context2.prev = _context2.next) {
12059
12068
  case 0:
12060
- container = s.goodsListState.drag.container = (_getRow = getRow(e.target)) === null || _getRow === void 0 ? void 0 : (_getRow$dataset = _getRow.dataset) === null || _getRow$dataset === void 0 ? void 0 : _getRow$dataset.rowKey;
12069
+ rowDom = getRow(e.target);
12070
+ container = s.goodsListState.drag.container = rowDom === null || rowDom === void 0 ? void 0 : (_rowDom$dataset = rowDom.dataset) === null || _rowDom$dataset === void 0 ? void 0 : _rowDom$dataset.rowKey;
12071
+ /** 准备插入的货物 */
12072
+
12073
+ row = s.goodsListState.goodsMap.get(container);
12061
12074
 
12062
- if (container) {
12063
- _context2.next = 3;
12075
+ if (row) {
12076
+ _context2.next = 5;
12064
12077
  break;
12065
12078
  }
12066
12079
 
12067
12080
  return _context2.abrupt("return");
12068
12081
 
12069
- case 3:
12082
+ case 5:
12070
12083
  if (!(container === s.goodsListState.drag.current)) {
12071
- _context2.next = 6;
12084
+ _context2.next = 7;
12072
12085
  break;
12073
12086
  }
12074
12087
 
12075
- s.goodsListState.drag.container = undefined;
12076
- return _context2.abrupt("return");
12088
+ return _context2.abrupt("return", s.goodsListState.drag.container = undefined);
12077
12089
 
12078
- case 6:
12090
+ case 7:
12091
+ /** 当前拖动中的货品 */
12079
12092
  currentGood = s.goodsListState.drag.current && s.goodsListState.goodsMap.get(s.goodsListState.drag.current);
12080
12093
 
12081
12094
  if (currentGood) {
12082
- _context2.next = 9;
12095
+ _context2.next = 10;
12083
12096
  break;
12084
12097
  }
12085
12098
 
12086
12099
  return _context2.abrupt("return");
12087
12100
 
12088
- case 9:
12089
- row = s.goodsListState.goodsMap.get(container);
12090
-
12091
- if (row) {
12092
- _context2.next = 12;
12093
- break;
12094
- }
12095
-
12096
- return _context2.abrupt("return");
12097
-
12098
- case 12:
12101
+ case 10:
12099
12102
  if (!(currentGood.lineAttribute === LineAttributeType$1.折扣行)) {
12100
- _context2.next = 18;
12103
+ _context2.next = 15;
12101
12104
  break;
12102
12105
  }
12103
12106
 
@@ -12109,16 +12112,15 @@ function Drag$1(props) {
12109
12112
  }).indexOf(row.$index);
12110
12113
 
12111
12114
  if (!(currentIndex - 1 === containerIndex)) {
12112
- _context2.next = 18;
12115
+ _context2.next = 15;
12113
12116
  break;
12114
12117
  }
12115
12118
 
12116
- s.goodsListState.drag.container = undefined;
12117
- return _context2.abrupt("return");
12119
+ return _context2.abrupt("return", s.goodsListState.drag.container = undefined);
12118
12120
 
12119
- case 18:
12121
+ case 15:
12120
12122
  if (!(currentGood.lineAttribute === LineAttributeType$1.被折扣行)) {
12121
- _context2.next = 24;
12123
+ _context2.next = 20;
12122
12124
  break;
12123
12125
  }
12124
12126
 
@@ -12130,23 +12132,29 @@ function Drag$1(props) {
12130
12132
  }).indexOf(row.$index);
12131
12133
 
12132
12134
  if (!(_currentIndex + 1 === _containerIndex)) {
12133
- _context2.next = 24;
12135
+ _context2.next = 20;
12134
12136
  break;
12135
12137
  }
12136
12138
 
12137
- s.goodsListState.drag.container = undefined;
12138
- return _context2.abrupt("return");
12139
+ return _context2.abrupt("return", s.goodsListState.drag.container = undefined);
12139
12140
 
12140
- case 24:
12141
+ case 20:
12141
12142
  // 折扣行 拖动的 相当于 自己的 被折扣行
12142
12143
  if (row.lineAttribute === LineAttributeType$1.折扣行) {
12143
12144
  t = s.goodsListState.goodsList.map(function (e) {
12144
12145
  return e.$index;
12145
12146
  }).indexOf(container) - 1;
12146
12147
  s.goodsListState.drag.container = s.goodsListState.goodsList[t].$index;
12148
+ s.goodsListState.drag.site = 'u';
12149
+ } else if (row.lineAttribute === LineAttributeType$1.被折扣行) {
12150
+ s.goodsListState.drag.site = 'd';
12151
+ } else {
12152
+ rect = rowDom.getBoundingClientRect();
12153
+ mouseY = e.clientY - rect.top;
12154
+ s.goodsListState.drag.site = mouseY > 15 ? 'd' : 'u';
12147
12155
  }
12148
12156
 
12149
- case 25:
12157
+ case 21:
12150
12158
  case "end":
12151
12159
  return _context2.stop();
12152
12160
  }
@@ -12199,7 +12207,7 @@ function Drag$1(props) {
12199
12207
  }());
12200
12208
  window.removeEventListener('mouseup', onMouseup);
12201
12209
  rowList.forEach(function (e) {
12202
- e.removeEventListener('mouseover', onMouseover);
12210
+ e.removeEventListener('mousemove', onMousemove);
12203
12211
  }); // window.document.body.removeChild(rowDiv);
12204
12212
  } // 开始插入
12205
12213
 
@@ -12208,13 +12216,13 @@ function Drag$1(props) {
12208
12216
  mounting(React__default['default'].createElement(React__default['default'].Fragment, null));
12209
12217
  controller.run( /*#__PURE__*/function () {
12210
12218
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
12211
- var _s$goodsListState$dra, container, current, goodsList, goodsMap, _currentGood, currentIndex, moveGoods;
12219
+ var _s$goodsListState$dra, container, current, site, goodsList, goodsMap, _currentGood, currentIndex, moveGoods;
12212
12220
 
12213
12221
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
12214
12222
  while (1) {
12215
12223
  switch (_context4.prev = _context4.next) {
12216
12224
  case 0:
12217
- _s$goodsListState$dra = s.goodsListState.drag, container = _s$goodsListState$dra.container, current = _s$goodsListState$dra.current;
12225
+ _s$goodsListState$dra = s.goodsListState.drag, container = _s$goodsListState$dra.container, current = _s$goodsListState$dra.current, site = _s$goodsListState$dra.site;
12218
12226
 
12219
12227
  if (!(!container || !current)) {
12220
12228
  _context4.next = 3;
@@ -12247,9 +12255,11 @@ function Drag$1(props) {
12247
12255
  var g = s.goodsListState.goodsList.filter(function (e) {
12248
12256
  return moveGoods.indexOf(e.$index) < 0;
12249
12257
  });
12250
- var t = g.map(function (e) {
12258
+ var t = site === 'u' ? g.map(function (e) {
12259
+ return e.$index;
12260
+ }).indexOf(container) : g.map(function (e) {
12251
12261
  return e.$index;
12252
- }).indexOf(container);
12262
+ }).indexOf(container) + 1;
12253
12263
  var m = moveGoods.map(function (e) {
12254
12264
  return goodsMap.get(e);
12255
12265
  }).filter(function (e) {
@@ -16759,7 +16769,7 @@ function Search$1() {
16759
16769
  });
16760
16770
  }
16761
16771
 
16762
- var css_248z$l = ".kts-invoice-operate-goods-list-itemName-drag-container {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 9999;\n}\n";
16772
+ var css_248z$l = ".kts-invoice-operate-goods-list-itemName-drag-container-u {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-u::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 9999;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-d {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-d::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n bottom: 0;\n z-index: 9999;\n}\n";
16763
16773
  styleInject(css_248z$l);
16764
16774
 
16765
16775
  function TableRow$1(props) {
@@ -16768,6 +16778,11 @@ function TableRow$1(props) {
16768
16778
  var goodsMap = controller.useMemo(function (s) {
16769
16779
  return s.goodsListState.goodsMap;
16770
16780
  }, []);
16781
+ /** 当前拖动中的货品索引 */
16782
+
16783
+ var site = controller.useMemo(function (s) {
16784
+ return s.goodsListState.drag.site;
16785
+ }, []);
16771
16786
  var current = controller.useMemo(function (s) {
16772
16787
  return s.goodsListState.drag.current;
16773
16788
  }, []);
@@ -16799,8 +16814,9 @@ function TableRow$1(props) {
16799
16814
  position: 'absolute',
16800
16815
  bottom: 0
16801
16816
  }
16802
- })) : React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
16803
- className: classNames__default['default'](props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container' : '')
16817
+ })) : // <tr {...props} className={classnames(props.className, discount, (rowKey === container && current) ? 'kts-invoice-operate-goods-list-itemName-drag-container' : '')} />
16818
+ React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
16819
+ className: classNames__default['default'](props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
16804
16820
  }));
16805
16821
  }
16806
16822
 
@@ -17995,6 +18011,12 @@ styleInject(css_248z$n);
17995
18011
 
17996
18012
  function Drag$2(props) {
17997
18013
  var record = props.record;
18014
+
18015
+ var _React$useState = React__default['default'].useState(false),
18016
+ _React$useState2 = _slicedToArray(_React$useState, 2),
18017
+ open = _React$useState2[0],
18018
+ setOpen = _React$useState2[1];
18019
+
17998
18020
  var controller = Invoice.useInvoiceController();
17999
18021
  var editGood = controller.useMemo(function (s) {
18000
18022
  return s.goodsListState.editGood;
@@ -18003,7 +18025,7 @@ function Drag$2(props) {
18003
18025
  return !!editGood;
18004
18026
  }, [editGood]);
18005
18027
  var onMouseDown = React__default['default'].useCallback(function () {
18006
- if (!controller || !record) return;
18028
+ if (!controller || !record || disabled) return;
18007
18029
  controller.run( /*#__PURE__*/function () {
18008
18030
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
18009
18031
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -18028,64 +18050,57 @@ function Drag$2(props) {
18028
18050
  var currentGood = controller.state.goodsListState.goodsList.filter(function (e) {
18029
18051
  return e.$index === record.$index;
18030
18052
  })[0];
18031
- mounting(React__default['default'].createElement(DragDiv$1, _objectSpread2({}, currentGood))); // 监听移动
18032
-
18053
+ mounting(React__default['default'].createElement(DragDiv$1, _objectSpread2({}, currentGood)));
18033
18054
  rowList.forEach(function (e) {
18034
- e.addEventListener('mouseover', onMouseover);
18055
+ e.addEventListener('mousemove', onMousemove);
18035
18056
  });
18036
18057
 
18037
- function onMouseover(e) {
18058
+ function onMousemove(e) {
18038
18059
  controller.run( /*#__PURE__*/function () {
18039
18060
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
18040
- var _getRow, _getRow$dataset;
18061
+ var _rowDom$dataset;
18041
18062
 
18042
- var container, currentGood, row, currentIndex, containerIndex, _currentIndex, _containerIndex, t;
18063
+ var rowDom, container, row, currentGood, currentIndex, containerIndex, _currentIndex, _containerIndex, t, rect, mouseY;
18043
18064
 
18044
18065
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
18045
18066
  while (1) {
18046
18067
  switch (_context2.prev = _context2.next) {
18047
18068
  case 0:
18048
- container = s.goodsListState.drag.container = (_getRow = getRow(e.target)) === null || _getRow === void 0 ? void 0 : (_getRow$dataset = _getRow.dataset) === null || _getRow$dataset === void 0 ? void 0 : _getRow$dataset.rowKey;
18069
+ rowDom = getRow(e.target);
18070
+ container = s.goodsListState.drag.container = rowDom === null || rowDom === void 0 ? void 0 : (_rowDom$dataset = rowDom.dataset) === null || _rowDom$dataset === void 0 ? void 0 : _rowDom$dataset.rowKey;
18071
+ /** 准备插入的货物 */
18072
+
18073
+ row = s.goodsListState.goodsMap.get(container);
18049
18074
 
18050
- if (container) {
18051
- _context2.next = 3;
18075
+ if (row) {
18076
+ _context2.next = 5;
18052
18077
  break;
18053
18078
  }
18054
18079
 
18055
18080
  return _context2.abrupt("return");
18056
18081
 
18057
- case 3:
18082
+ case 5:
18058
18083
  if (!(container === s.goodsListState.drag.current)) {
18059
- _context2.next = 6;
18084
+ _context2.next = 7;
18060
18085
  break;
18061
18086
  }
18062
18087
 
18063
- s.goodsListState.drag.container = undefined;
18064
- return _context2.abrupt("return");
18088
+ return _context2.abrupt("return", s.goodsListState.drag.container = undefined);
18065
18089
 
18066
- case 6:
18090
+ case 7:
18091
+ /** 当前拖动中的货品 */
18067
18092
  currentGood = s.goodsListState.drag.current && s.goodsListState.goodsMap.get(s.goodsListState.drag.current);
18068
18093
 
18069
18094
  if (currentGood) {
18070
- _context2.next = 9;
18095
+ _context2.next = 10;
18071
18096
  break;
18072
18097
  }
18073
18098
 
18074
18099
  return _context2.abrupt("return");
18075
18100
 
18076
- case 9:
18077
- row = s.goodsListState.goodsMap.get(container);
18078
-
18079
- if (row) {
18080
- _context2.next = 12;
18081
- break;
18082
- }
18083
-
18084
- return _context2.abrupt("return");
18085
-
18086
- case 12:
18101
+ case 10:
18087
18102
  if (!(currentGood.lineAttribute === LineAttributeType$1.折扣行)) {
18088
- _context2.next = 18;
18103
+ _context2.next = 15;
18089
18104
  break;
18090
18105
  }
18091
18106
 
@@ -18097,16 +18112,15 @@ function Drag$2(props) {
18097
18112
  }).indexOf(row.$index);
18098
18113
 
18099
18114
  if (!(currentIndex - 1 === containerIndex)) {
18100
- _context2.next = 18;
18115
+ _context2.next = 15;
18101
18116
  break;
18102
18117
  }
18103
18118
 
18104
- s.goodsListState.drag.container = undefined;
18105
- return _context2.abrupt("return");
18119
+ return _context2.abrupt("return", s.goodsListState.drag.container = undefined);
18106
18120
 
18107
- case 18:
18121
+ case 15:
18108
18122
  if (!(currentGood.lineAttribute === LineAttributeType$1.被折扣行)) {
18109
- _context2.next = 24;
18123
+ _context2.next = 20;
18110
18124
  break;
18111
18125
  }
18112
18126
 
@@ -18118,23 +18132,29 @@ function Drag$2(props) {
18118
18132
  }).indexOf(row.$index);
18119
18133
 
18120
18134
  if (!(_currentIndex + 1 === _containerIndex)) {
18121
- _context2.next = 24;
18135
+ _context2.next = 20;
18122
18136
  break;
18123
18137
  }
18124
18138
 
18125
- s.goodsListState.drag.container = undefined;
18126
- return _context2.abrupt("return");
18139
+ return _context2.abrupt("return", s.goodsListState.drag.container = undefined);
18127
18140
 
18128
- case 24:
18141
+ case 20:
18129
18142
  // 折扣行 拖动的 相当于 自己的 被折扣行
18130
18143
  if (row.lineAttribute === LineAttributeType$1.折扣行) {
18131
18144
  t = s.goodsListState.goodsList.map(function (e) {
18132
18145
  return e.$index;
18133
18146
  }).indexOf(container) - 1;
18134
18147
  s.goodsListState.drag.container = s.goodsListState.goodsList[t].$index;
18148
+ s.goodsListState.drag.site = 'u';
18149
+ } else if (row.lineAttribute === LineAttributeType$1.被折扣行) {
18150
+ s.goodsListState.drag.site = 'd';
18151
+ } else {
18152
+ rect = rowDom.getBoundingClientRect();
18153
+ mouseY = e.clientY - rect.top;
18154
+ s.goodsListState.drag.site = mouseY > 25 ? 'd' : 'u';
18135
18155
  }
18136
18156
 
18137
- case 25:
18157
+ case 21:
18138
18158
  case "end":
18139
18159
  return _context2.stop();
18140
18160
  }
@@ -18187,7 +18207,7 @@ function Drag$2(props) {
18187
18207
  }());
18188
18208
  window.removeEventListener('mouseup', onMouseup);
18189
18209
  rowList.forEach(function (e) {
18190
- e.removeEventListener('mouseover', onMouseover);
18210
+ e.removeEventListener('mousemove', onMousemove);
18191
18211
  }); // window.document.body.removeChild(rowDiv);
18192
18212
  } // 开始插入
18193
18213
 
@@ -18196,13 +18216,13 @@ function Drag$2(props) {
18196
18216
  mounting(React__default['default'].createElement(React__default['default'].Fragment, null));
18197
18217
  controller.run( /*#__PURE__*/function () {
18198
18218
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
18199
- var _s$goodsListState$dra, container, current, goodsList, goodsMap, _currentGood, currentIndex, moveGoods;
18219
+ var _s$goodsListState$dra, container, current, site, goodsList, goodsMap, _currentGood, currentIndex, moveGoods;
18200
18220
 
18201
18221
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
18202
18222
  while (1) {
18203
18223
  switch (_context4.prev = _context4.next) {
18204
18224
  case 0:
18205
- _s$goodsListState$dra = s.goodsListState.drag, container = _s$goodsListState$dra.container, current = _s$goodsListState$dra.current;
18225
+ _s$goodsListState$dra = s.goodsListState.drag, container = _s$goodsListState$dra.container, current = _s$goodsListState$dra.current, site = _s$goodsListState$dra.site;
18206
18226
 
18207
18227
  if (!(!container || !current)) {
18208
18228
  _context4.next = 3;
@@ -18235,9 +18255,11 @@ function Drag$2(props) {
18235
18255
  var g = s.goodsListState.goodsList.filter(function (e) {
18236
18256
  return moveGoods.indexOf(e.$index) < 0;
18237
18257
  });
18238
- var t = g.map(function (e) {
18258
+ var t = site === 'u' ? g.map(function (e) {
18259
+ return e.$index;
18260
+ }).indexOf(container) : g.map(function (e) {
18239
18261
  return e.$index;
18240
- }).indexOf(container);
18262
+ }).indexOf(container) + 1;
18241
18263
  var m = moveGoods.map(function (e) {
18242
18264
  return goodsMap.get(e);
18243
18265
  }).filter(function (e) {
@@ -18268,33 +18290,44 @@ function Drag$2(props) {
18268
18290
  };
18269
18291
  }());
18270
18292
  }
18271
- }, [controller, record]);
18272
- return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
18273
- type: 'link',
18274
- style: {
18275
- padding: 0
18276
- },
18277
- disabled: disabled,
18278
- onMouseDown: onMouseDown,
18279
- onClick: function onClick(e) {
18280
- e.stopPropagation();
18281
- },
18282
- className: "kts-invoice-operate-goods-list-itemName-drag"
18283
- }, React__default['default'].createElement(Icon, {
18284
- component: SvgI001$1
18285
- }));
18293
+ }, [controller, record, disabled]);
18294
+ var renderButton = React__default['default'].useMemo(function () {
18295
+ return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
18296
+ type: 'link',
18297
+ style: {
18298
+ padding: 0
18299
+ },
18300
+ onMouseDown: onMouseDown,
18301
+ onClick: function onClick(e) {
18302
+ e.stopPropagation();
18303
+ },
18304
+ className: "kts-invoice-operate-goods-list-itemName-drag",
18305
+ onMouseOver: controller.saveEditGood
18306
+ }, React__default['default'].createElement(Icon, {
18307
+ component: SvgI001$1
18308
+ }));
18309
+ }, [onMouseDown, controller]);
18310
+
18311
+ if (disabled) {
18312
+ return React__default['default'].createElement(ktsXui.Popover, {
18313
+ content: '您还有未编辑完成的商品',
18314
+ trigger: 'focus'
18315
+ }, renderButton);
18316
+ } else {
18317
+ return renderButton;
18318
+ }
18286
18319
  }
18287
18320
 
18288
18321
  function DragDiv$1(props) {
18289
- var _React$useState = React__default['default'].useState(0),
18290
- _React$useState2 = _slicedToArray(_React$useState, 2),
18291
- x = _React$useState2[0],
18292
- setX = _React$useState2[1];
18293
-
18294
- var _React$useState3 = React__default['default'].useState(-110),
18322
+ var _React$useState3 = React__default['default'].useState(0),
18295
18323
  _React$useState4 = _slicedToArray(_React$useState3, 2),
18296
- y = _React$useState4[0],
18297
- setY = _React$useState4[1];
18324
+ x = _React$useState4[0],
18325
+ setX = _React$useState4[1];
18326
+
18327
+ var _React$useState5 = React__default['default'].useState(-110),
18328
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
18329
+ y = _React$useState6[0],
18330
+ setY = _React$useState6[1];
18298
18331
 
18299
18332
  var div = React__default['default'].useMemo(function () {
18300
18333
  return window.document.querySelector("[data-row-key=\"".concat(props.$index, "\"]"));
@@ -18309,7 +18342,7 @@ function DragDiv$1(props) {
18309
18342
 
18310
18343
  React__default['default'].useEffect(function () {
18311
18344
  function onMousemove(e) {
18312
- setY(e.clientY - 25);
18345
+ setY(e.clientY - 15);
18313
18346
  }
18314
18347
  window.addEventListener('mousemove', onMousemove);
18315
18348
  return function () {
@@ -21324,16 +21357,17 @@ var DrawerBody$2 = function DrawerBody() {
21324
21357
  // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
21325
21358
  record.quantity = undefined;
21326
21359
  record.lineAmountExcludeTax = undefined;
21327
- record.lineAmountIncludeTax = undefined;
21328
- record.itemModelName = undefined;
21329
- record.itemModelNameSelf = undefined; // 中间数据
21360
+ record.lineAmountIncludeTax = undefined; // 中间数据
21330
21361
 
21331
21362
  between = _objectSpread2({}, record);
21332
21363
  between.itemName = getItemName(record, s.goodsListState.editGood);
21333
21364
  between.itemCode = getItemCode(record, s.goodsListState.editGood);
21334
21365
  between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
21335
21366
 
21336
- editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
21367
+ editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), {}, {
21368
+ itemModelName: undefined,
21369
+ itemModelNameSelf: undefined
21370
+ }, between);
21337
21371
 
21338
21372
  if (editGood.taxRate) {
21339
21373
  editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
@@ -21366,22 +21400,22 @@ var DrawerBody$2 = function DrawerBody() {
21366
21400
  s.goodsListState.importGoods.isVisibleDrawer = false;
21367
21401
 
21368
21402
  if (!s.goodsListState.isTaxIncluded) {
21369
- _context2.next = 28;
21403
+ _context2.next = 26;
21370
21404
  break;
21371
21405
  }
21372
21406
 
21373
- _context2.next = 26;
21407
+ _context2.next = 24;
21374
21408
  return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
21375
21409
 
21376
- case 26:
21377
- _context2.next = 30;
21410
+ case 24:
21411
+ _context2.next = 28;
21378
21412
  break;
21379
21413
 
21380
- case 28:
21381
- _context2.next = 30;
21414
+ case 26:
21415
+ _context2.next = 28;
21382
21416
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
21383
21417
 
21384
- case 30:
21418
+ case 28:
21385
21419
  case "end":
21386
21420
  return _context2.stop();
21387
21421
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.59",
3
+ "version": "3.2.61",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -10,4 +10,7 @@ export default class Drag {
10
10
 
11
11
  /** 准备插入的货物索引 */
12
12
  container?: string;
13
+
14
+ /** 插入位置 */
15
+ site?: 'u' | 'd'
13
16
  }
@@ -53,7 +53,7 @@ export default () => {
53
53
  <Switch checkedChildren="预制" unCheckedChildren="默认" onChange={e => { e ? setController(controller2) : setController(controller1) }} ></Switch>
54
54
  <Button onClick={controller.pipeline(async s => { s.goodsListState.endowCode.getReadOnlyTaxRate = s.goodsListState.endowCode.readOnlyTaxRateMap.DRAFT })} >税率(草稿)</Button>
55
55
  <Button onClick={controller.pipeline(async s => { s.goodsListState.endowCode.getReadOnlyTaxRate = () => true })} >税率(预制)</Button>
56
- <Invoice controller={controller} />
56
+ <Invoice controller={controller} invoiceType='digtal' />
57
57
  </div>
58
58
  );
59
59
  };