kts-component-invoice-operate 3.2.37 → 3.2.39

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
@@ -1731,10 +1731,9 @@ function _mergeDetails() {
1731
1731
  return _context.abrupt("return");
1732
1732
 
1733
1733
  case 2:
1734
- goodsList = state.goodsListState.selectedGoodIndex.map(function (e) {
1735
- return state.goodsListState.goodsMap.get(e);
1736
- }).filter(function (e) {
1737
- return !!e;
1734
+ // const goodsList = state.goodsListState.selectedGoodIndex.map(e => state.goodsListState.goodsMap.get(e)).filter(e => !!e) as IGood[];
1735
+ goodsList = state.goodsListState.goodsList.filter(function (e) {
1736
+ return state.goodsListState.selectedGoodIndex.indexOf(e.$index) >= 0;
1738
1737
  });
1739
1738
 
1740
1739
  if (!(goodsList.length < 2)) {
@@ -1798,21 +1797,21 @@ function _mergeDetails() {
1798
1797
  state.goodsListState.goodsMap.set(e.$index, e);
1799
1798
  });
1800
1799
  state.goodsListState.selectedGoodIndex = [];
1801
- _context.next = 41;
1800
+ _context.next = 40;
1802
1801
  break;
1803
1802
 
1804
- case 37:
1805
- _context.prev = 37;
1803
+ case 36:
1804
+ _context.prev = 36;
1806
1805
  _context.t0 = _context["catch"](5);
1807
1806
  debugger;
1808
1807
  showError(_context.t0);
1809
1808
 
1810
- case 41:
1809
+ case 40:
1811
1810
  case "end":
1812
1811
  return _context.stop();
1813
1812
  }
1814
1813
  }
1815
- }, _callee, null, [[5, 37]]);
1814
+ }, _callee, null, [[5, 36]]);
1816
1815
  }));
1817
1816
  return _mergeDetails.apply(this, arguments);
1818
1817
  }
@@ -14447,7 +14446,7 @@ function useMergeDetails() {
14447
14446
  onClick: onClick,
14448
14447
  disabled: selectedGoodIndex.length <= 1
14449
14448
  }, "\u5408\u5E76\u660E\u7EC6");
14450
- }, [selectedGoodIndex.length]);
14449
+ }, [selectedGoodIndex.length, isMergeDetails]);
14451
14450
  return {
14452
14451
  /** 按钮 */
14453
14452
  button: button
package/dist/index.js CHANGED
@@ -1741,10 +1741,9 @@ function _mergeDetails() {
1741
1741
  return _context.abrupt("return");
1742
1742
 
1743
1743
  case 2:
1744
- goodsList = state.goodsListState.selectedGoodIndex.map(function (e) {
1745
- return state.goodsListState.goodsMap.get(e);
1746
- }).filter(function (e) {
1747
- return !!e;
1744
+ // const goodsList = state.goodsListState.selectedGoodIndex.map(e => state.goodsListState.goodsMap.get(e)).filter(e => !!e) as IGood[];
1745
+ goodsList = state.goodsListState.goodsList.filter(function (e) {
1746
+ return state.goodsListState.selectedGoodIndex.indexOf(e.$index) >= 0;
1748
1747
  });
1749
1748
 
1750
1749
  if (!(goodsList.length < 2)) {
@@ -1808,21 +1807,21 @@ function _mergeDetails() {
1808
1807
  state.goodsListState.goodsMap.set(e.$index, e);
1809
1808
  });
1810
1809
  state.goodsListState.selectedGoodIndex = [];
1811
- _context.next = 41;
1810
+ _context.next = 40;
1812
1811
  break;
1813
1812
 
1814
- case 37:
1815
- _context.prev = 37;
1813
+ case 36:
1814
+ _context.prev = 36;
1816
1815
  _context.t0 = _context["catch"](5);
1817
1816
  debugger;
1818
1817
  showError(_context.t0);
1819
1818
 
1820
- case 41:
1819
+ case 40:
1821
1820
  case "end":
1822
1821
  return _context.stop();
1823
1822
  }
1824
1823
  }
1825
- }, _callee, null, [[5, 37]]);
1824
+ }, _callee, null, [[5, 36]]);
1826
1825
  }));
1827
1826
  return _mergeDetails.apply(this, arguments);
1828
1827
  }
@@ -14457,7 +14456,7 @@ function useMergeDetails() {
14457
14456
  onClick: onClick,
14458
14457
  disabled: selectedGoodIndex.length <= 1
14459
14458
  }, "\u5408\u5E76\u660E\u7EC6");
14460
- }, [selectedGoodIndex.length]);
14459
+ }, [selectedGoodIndex.length, isMergeDetails]);
14461
14460
  return {
14462
14461
  /** 按钮 */
14463
14462
  button: button
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.37",
3
+ "version": "3.2.39",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -7,7 +7,8 @@ import { IGood, InvoiceControllerState, LineAttributeType } from '..';
7
7
  export default async function mergeDetails(state: InvoiceControllerState) {
8
8
  if (state.goodsListState.editGood) return;
9
9
 
10
- const goodsList = state.goodsListState.selectedGoodIndex.map(e => state.goodsListState.goodsMap.get(e)).filter(e => !!e) as IGood[];
10
+ // const goodsList = state.goodsListState.selectedGoodIndex.map(e => state.goodsListState.goodsMap.get(e)).filter(e => !!e) as IGood[];
11
+ const goodsList = state.goodsListState.goodsList.filter(e => state.goodsListState.selectedGoodIndex.indexOf(e.$index) >= 0)
11
12
  if (goodsList.length < 2) return;
12
13
 
13
14
  try {
@@ -37,8 +38,8 @@ export default async function mergeDetails(state: InvoiceControllerState) {
37
38
 
38
39
  // 计算税额
39
40
  sum.taxAmount = chain(bignumber(sum.lineAmountIncludeTax)).subtract(bignumber(sum.lineAmountExcludeTax)).done().toNumber()
40
-
41
- const p = state.goodsListState.goodsList.indexOf(goodsList[0]);9
41
+
42
+ const p = state.goodsListState.goodsList.indexOf(goodsList[0]);
42
43
  state.goodsListState.goodsList = state.goodsListState.goodsList.filter(e => state.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0);
43
44
  state.goodsListState.goodsList.splice(p, 0, sum);
44
45
  state.goodsListState.goodsMap = new Map();
@@ -28,7 +28,7 @@ export default function useMergeDetails() {
28
28
  合并明细
29
29
  </Button>
30
30
  )
31
- }, [selectedGoodIndex.length])
31
+ }, [selectedGoodIndex.length, isMergeDetails])
32
32
 
33
33
  return {
34
34
  /** 按钮 */