kts-component-invoice-operate 3.2.103 → 3.2.105

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
@@ -1823,111 +1823,170 @@ function mergeDetails(_x, _x2) {
1823
1823
  /** 计算单价(含税) */
1824
1824
 
1825
1825
  function _mergeDetails() {
1826
- _mergeDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, selectedGoodIndex) {
1827
- var goodsList, sum, p;
1828
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1826
+ _mergeDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(state, selectedGoodIndex) {
1827
+ var goodsList, grouping, merge, _merge;
1828
+
1829
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1829
1830
  while (1) {
1830
- switch (_context.prev = _context.next) {
1831
+ switch (_context2.prev = _context2.next) {
1831
1832
  case 0:
1832
- debugger;
1833
+ _merge = function _merge3() {
1834
+ _merge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(goodsList) {
1835
+ var selectedGoodIndex, sum, p;
1836
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1837
+ while (1) {
1838
+ switch (_context.prev = _context.next) {
1839
+ case 0:
1840
+ if (!(goodsList.length < 2)) {
1841
+ _context.next = 2;
1842
+ break;
1843
+ }
1833
1844
 
1834
- if (!(state.goodsListState.editGood || !selectedGoodIndex || selectedGoodIndex.length < 2)) {
1835
- _context.next = 3;
1836
- break;
1837
- }
1845
+ return _context.abrupt("return");
1838
1846
 
1839
- return _context.abrupt("return");
1847
+ case 2:
1848
+ selectedGoodIndex = goodsList.map(function (e) {
1849
+ return e.$index;
1850
+ });
1851
+ _context.prev = 3;
1852
+ // 创建合并后的商品对象
1853
+ sum = {
1854
+ $index: idGenerator(),
1855
+ lineAttribute: goodsList[0].lineAttribute
1856
+ }; // 存在税率不一样的明细,不能合并
1840
1857
 
1841
- case 3:
1842
- // const goodsList = state.goodsListState.selectedGoodIndex.map(e => state.goodsListState.goodsMap.get(e)).filter(e => !!e) as IGood[];
1843
- // const goodsList = state.goodsListState.goodsList.filter(e => state.goodsListState.selectedGoodIndex.indexOf(e.$index) >= 0)
1844
- goodsList = state.goodsListState.goodsList.filter(function (e) {
1845
- return selectedGoodIndex.indexOf(e.$index) >= 0;
1846
- });
1858
+ _context.next = 7;
1859
+ return checkTaxTate(goodsList);
1847
1860
 
1848
- if (!(goodsList.length < 2)) {
1849
- _context.next = 6;
1850
- break;
1851
- }
1861
+ case 7:
1862
+ _context.next = 9;
1863
+ return fillingInformationGood(goodsList, sum);
1852
1864
 
1853
- return _context.abrupt("return");
1865
+ case 9:
1866
+ sum = _context.sent;
1867
+ _context.next = 12;
1868
+ return mergeQuantity(goodsList);
1854
1869
 
1855
- case 6:
1856
- _context.prev = 6;
1857
- // 创建合并后的商品对象
1858
- sum = {
1859
- $index: idGenerator(),
1860
- lineAttribute: LineAttributeType$1.正常
1861
- }; // 存在税率不一样的明细,不能合并
1870
+ case 12:
1871
+ sum.quantity = _context.sent;
1872
+ _context.next = 15;
1873
+ return mergeLineAmountExcludeTax(goodsList);
1862
1874
 
1863
- _context.next = 10;
1864
- return checkTaxTate(goodsList);
1875
+ case 15:
1876
+ sum.lineAmountExcludeTax = _context.sent;
1877
+ _context.next = 18;
1878
+ return mergeLineAmountIncludeTax(goodsList);
1865
1879
 
1866
- case 10:
1867
- _context.next = 12;
1868
- return fillingInformationGood(goodsList, sum);
1880
+ case 18:
1881
+ sum.lineAmountIncludeTax = _context.sent;
1882
+ _context.next = 21;
1883
+ return calculatePriceExcludeTax(sum, state.calculatingDigits);
1884
+
1885
+ case 21:
1886
+ sum.priceExcludeTax = _context.sent;
1887
+ _context.next = 24;
1888
+ return calculatePriceIncludeTax(sum, state.calculatingDigits);
1889
+
1890
+ case 24:
1891
+ sum.priceIncludeTax = _context.sent;
1892
+ // 计算税额
1893
+ sum.taxAmount = mathjs.chain(mathjs.bignumber(sum.lineAmountIncludeTax)).subtract(mathjs.bignumber(sum.lineAmountExcludeTax)).done().toNumber(); // 校验数据 是否数量和金额是否同号
1894
+
1895
+ _context.next = 28;
1896
+ return checkSameNumber(sum);
1897
+
1898
+ case 28:
1899
+ p = state.goodsListState.goodsList.indexOf(goodsList[0]);
1900
+ state.goodsListState.goodsList = state.goodsListState.goodsList.filter(function (e) {
1901
+ return selectedGoodIndex.indexOf(e.$index) < 0;
1902
+ });
1903
+ state.goodsListState.goodsList.splice(p, 0, sum);
1904
+ state.goodsListState.goodsList = state.goodsListState.goodsList.filter(function (e) {
1905
+ return e.lineAmountExcludeTax !== 0;
1906
+ });
1907
+ state.goodsListState.goodsMap = new Map();
1908
+ state.goodsListState.goodsList.forEach(function (e) {
1909
+ state.goodsListState.goodsMap.set(e.$index, e);
1910
+ });
1911
+ state.goodsListState.selectedGoodIndex = [];
1912
+ _context.next = 40;
1913
+ break;
1869
1914
 
1870
- case 12:
1871
- sum = _context.sent;
1872
- _context.next = 15;
1873
- return mergeQuantity(goodsList);
1915
+ case 37:
1916
+ _context.prev = 37;
1917
+ _context.t0 = _context["catch"](3);
1918
+ showError(_context.t0);
1874
1919
 
1875
- case 15:
1876
- sum.quantity = _context.sent;
1877
- _context.next = 18;
1878
- return mergeLineAmountExcludeTax(goodsList);
1920
+ case 40:
1921
+ case "end":
1922
+ return _context.stop();
1923
+ }
1924
+ }
1925
+ }, _callee, null, [[3, 37]]);
1926
+ }));
1927
+ return _merge.apply(this, arguments);
1928
+ };
1879
1929
 
1880
- case 18:
1881
- sum.lineAmountExcludeTax = _context.sent;
1882
- _context.next = 21;
1883
- return mergeLineAmountIncludeTax(goodsList);
1930
+ merge = function _merge2(_x14) {
1931
+ return _merge.apply(this, arguments);
1932
+ };
1884
1933
 
1885
- case 21:
1886
- sum.lineAmountIncludeTax = _context.sent;
1887
- _context.next = 24;
1888
- return calculatePriceExcludeTax(sum, state.calculatingDigits);
1934
+ grouping = function _grouping(goodsList) {
1935
+ var grouped = {};
1936
+ goodsList.forEach(function (good) {
1937
+ var key = function () {
1938
+ switch (good.lineAttribute) {
1939
+ case LineAttributeType$1.折让行:
1940
+ return LineAttributeType$1.折让行;
1889
1941
 
1890
- case 24:
1891
- sum.priceExcludeTax = _context.sent;
1892
- _context.next = 27;
1893
- return calculatePriceIncludeTax(sum, state.calculatingDigits);
1942
+ case LineAttributeType$1.赠品行:
1943
+ return LineAttributeType$1.赠品行;
1894
1944
 
1895
- case 27:
1896
- sum.priceIncludeTax = _context.sent;
1897
- // 计算税额
1898
- sum.taxAmount = mathjs.chain(mathjs.bignumber(sum.lineAmountIncludeTax)).subtract(mathjs.bignumber(sum.lineAmountExcludeTax)).done().toNumber(); // 校验数据 是否数量和金额是否同号
1945
+ default:
1946
+ return LineAttributeType$1.正常;
1947
+ }
1948
+ }();
1899
1949
 
1900
- _context.next = 31;
1901
- return checkSameNumber(sum);
1950
+ if (!grouped[key]) {
1951
+ grouped[key] = [];
1952
+ }
1902
1953
 
1903
- case 31:
1904
- p = state.goodsListState.goodsList.indexOf(goodsList[0]);
1905
- state.goodsListState.goodsList = state.goodsListState.goodsList.filter(function (e) {
1906
- return selectedGoodIndex.indexOf(e.$index) < 0;
1907
- });
1908
- state.goodsListState.goodsList.splice(p, 0, sum);
1909
- state.goodsListState.goodsList = state.goodsListState.goodsList.filter(function (e) {
1910
- return e.lineAmountExcludeTax !== 0;
1911
- });
1912
- state.goodsListState.goodsMap = new Map();
1913
- state.goodsListState.goodsList.forEach(function (e) {
1914
- state.goodsListState.goodsMap.set(e.$index, e);
1954
+ grouped[key].push(_objectSpread2(_objectSpread2({}, good), {}, {
1955
+ lineAttribute: key
1956
+ }));
1957
+ });
1958
+ return Object.values(grouped);
1959
+ };
1960
+
1961
+ if (!(state.goodsListState.editGood || !selectedGoodIndex || selectedGoodIndex.length < 2)) {
1962
+ _context2.next = 5;
1963
+ break;
1964
+ }
1965
+
1966
+ return _context2.abrupt("return");
1967
+
1968
+ case 5:
1969
+ goodsList = state.goodsListState.goodsList.filter(function (e) {
1970
+ return selectedGoodIndex.indexOf(e.$index) >= 0;
1915
1971
  });
1916
- state.goodsListState.selectedGoodIndex = [];
1917
- _context.next = 43;
1918
- break;
1919
1972
 
1920
- case 40:
1921
- _context.prev = 40;
1922
- _context.t0 = _context["catch"](6);
1923
- showError(_context.t0);
1973
+ if (!(goodsList.length < 2)) {
1974
+ _context2.next = 8;
1975
+ break;
1976
+ }
1977
+
1978
+ return _context2.abrupt("return");
1924
1979
 
1925
- case 43:
1980
+ case 8:
1981
+ grouping(goodsList).forEach(merge);
1982
+ /** 分组 */
1983
+
1984
+ case 9:
1926
1985
  case "end":
1927
- return _context.stop();
1986
+ return _context2.stop();
1928
1987
  }
1929
1988
  }
1930
- }, _callee, null, [[6, 40]]);
1989
+ }, _callee2);
1931
1990
  }));
1932
1991
  return _mergeDetails.apply(this, arguments);
1933
1992
  }
@@ -1939,29 +1998,29 @@ function calculatePriceIncludeTax(_x3, _x4) {
1939
1998
 
1940
1999
 
1941
2000
  function _calculatePriceIncludeTax() {
1942
- _calculatePriceIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sum, calculatingDigits) {
2001
+ _calculatePriceIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sum, calculatingDigits) {
1943
2002
  var value;
1944
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2003
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1945
2004
  while (1) {
1946
- switch (_context2.prev = _context2.next) {
2005
+ switch (_context3.prev = _context3.next) {
1947
2006
  case 0:
1948
2007
  if (sum.quantity) {
1949
- _context2.next = 2;
2008
+ _context3.next = 2;
1950
2009
  break;
1951
2010
  }
1952
2011
 
1953
- return _context2.abrupt("return", undefined);
2012
+ return _context3.abrupt("return", undefined);
1954
2013
 
1955
2014
  case 2:
1956
2015
  value = mathjs.chain(mathjs.bignumber(sum.lineAmountIncludeTax)).divide(mathjs.bignumber(sum.quantity)).done().toNumber();
1957
- return _context2.abrupt("return", format15(value, calculatingDigits) || undefined);
2016
+ return _context3.abrupt("return", format15(value, calculatingDigits) || undefined);
1958
2017
 
1959
2018
  case 4:
1960
2019
  case "end":
1961
- return _context2.stop();
2020
+ return _context3.stop();
1962
2021
  }
1963
2022
  }
1964
- }, _callee2);
2023
+ }, _callee3);
1965
2024
  }));
1966
2025
  return _calculatePriceIncludeTax.apply(this, arguments);
1967
2026
  }
@@ -1973,29 +2032,29 @@ function calculatePriceExcludeTax(_x5, _x6) {
1973
2032
 
1974
2033
 
1975
2034
  function _calculatePriceExcludeTax() {
1976
- _calculatePriceExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sum, calculatingDigits) {
2035
+ _calculatePriceExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sum, calculatingDigits) {
1977
2036
  var value;
1978
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2037
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1979
2038
  while (1) {
1980
- switch (_context3.prev = _context3.next) {
2039
+ switch (_context4.prev = _context4.next) {
1981
2040
  case 0:
1982
2041
  if (sum.quantity) {
1983
- _context3.next = 2;
2042
+ _context4.next = 2;
1984
2043
  break;
1985
2044
  }
1986
2045
 
1987
- return _context3.abrupt("return", undefined);
2046
+ return _context4.abrupt("return", undefined);
1988
2047
 
1989
2048
  case 2:
1990
2049
  value = format15(mathjs.chain(mathjs.bignumber(sum.lineAmountExcludeTax)).divide(mathjs.bignumber(sum.quantity)).done().toNumber());
1991
- return _context3.abrupt("return", format15(value, calculatingDigits) || undefined);
2050
+ return _context4.abrupt("return", format15(value, calculatingDigits) || undefined);
1992
2051
 
1993
2052
  case 5:
1994
2053
  case "end":
1995
- return _context3.stop();
2054
+ return _context4.stop();
1996
2055
  }
1997
2056
  }
1998
- }, _callee3);
2057
+ }, _callee4);
1999
2058
  }));
2000
2059
  return _calculatePriceExcludeTax.apply(this, arguments);
2001
2060
  }
@@ -2007,24 +2066,24 @@ function mergeLineAmountIncludeTax(_x7) {
2007
2066
 
2008
2067
 
2009
2068
  function _mergeLineAmountIncludeTax() {
2010
- _mergeLineAmountIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(goodsList) {
2069
+ _mergeLineAmountIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(goodsList) {
2011
2070
  var sum;
2012
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2071
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2013
2072
  while (1) {
2014
- switch (_context4.prev = _context4.next) {
2073
+ switch (_context5.prev = _context5.next) {
2015
2074
  case 0:
2016
2075
  sum = mathjs.chain(mathjs.bignumber(0));
2017
2076
  goodsList.forEach(function (e) {
2018
2077
  sum = sum.add(mathjs.bignumber(e.lineAmountIncludeTax || 0));
2019
2078
  });
2020
- return _context4.abrupt("return", sum.done().toNumber());
2079
+ return _context5.abrupt("return", sum.done().toNumber());
2021
2080
 
2022
2081
  case 3:
2023
2082
  case "end":
2024
- return _context4.stop();
2083
+ return _context5.stop();
2025
2084
  }
2026
2085
  }
2027
- }, _callee4);
2086
+ }, _callee5);
2028
2087
  }));
2029
2088
  return _mergeLineAmountIncludeTax.apply(this, arguments);
2030
2089
  }
@@ -2036,24 +2095,24 @@ function mergeLineAmountExcludeTax(_x8) {
2036
2095
 
2037
2096
 
2038
2097
  function _mergeLineAmountExcludeTax() {
2039
- _mergeLineAmountExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(goodsList) {
2098
+ _mergeLineAmountExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(goodsList) {
2040
2099
  var sum;
2041
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2100
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2042
2101
  while (1) {
2043
- switch (_context5.prev = _context5.next) {
2102
+ switch (_context6.prev = _context6.next) {
2044
2103
  case 0:
2045
2104
  sum = mathjs.chain(mathjs.bignumber(0));
2046
2105
  goodsList.forEach(function (e) {
2047
2106
  sum = sum.add(mathjs.bignumber(e.lineAmountExcludeTax || 0));
2048
2107
  });
2049
- return _context5.abrupt("return", sum.done().toNumber());
2108
+ return _context6.abrupt("return", sum.done().toNumber());
2050
2109
 
2051
2110
  case 3:
2052
2111
  case "end":
2053
- return _context5.stop();
2112
+ return _context6.stop();
2054
2113
  }
2055
2114
  }
2056
- }, _callee5);
2115
+ }, _callee6);
2057
2116
  }));
2058
2117
  return _mergeLineAmountExcludeTax.apply(this, arguments);
2059
2118
  }
@@ -2065,24 +2124,24 @@ function mergeQuantity(_x9) {
2065
2124
 
2066
2125
 
2067
2126
  function _mergeQuantity() {
2068
- _mergeQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(goodsList) {
2127
+ _mergeQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(goodsList) {
2069
2128
  var sum;
2070
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2129
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2071
2130
  while (1) {
2072
- switch (_context6.prev = _context6.next) {
2131
+ switch (_context7.prev = _context7.next) {
2073
2132
  case 0:
2074
2133
  sum = mathjs.chain(mathjs.bignumber(0));
2075
2134
  goodsList.forEach(function (e) {
2076
2135
  sum = sum.add(mathjs.bignumber(e.quantity || 0));
2077
2136
  });
2078
- return _context6.abrupt("return", sum.done().toNumber() || undefined);
2137
+ return _context7.abrupt("return", sum.done().toNumber() || undefined);
2079
2138
 
2080
2139
  case 3:
2081
2140
  case "end":
2082
- return _context6.stop();
2141
+ return _context7.stop();
2083
2142
  }
2084
2143
  }
2085
- }, _callee6);
2144
+ }, _callee7);
2086
2145
  }));
2087
2146
  return _mergeQuantity.apply(this, arguments);
2088
2147
  }
@@ -2094,26 +2153,26 @@ function fillingInformationGood(_x10, _x11) {
2094
2153
 
2095
2154
 
2096
2155
  function _fillingInformationGood() {
2097
- _fillingInformationGood = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(goodsList, sum) {
2156
+ _fillingInformationGood = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(goodsList, sum) {
2098
2157
  var goods;
2099
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2158
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2100
2159
  while (1) {
2101
- switch (_context7.prev = _context7.next) {
2160
+ switch (_context8.prev = _context8.next) {
2102
2161
  case 0:
2103
2162
  sum = _objectSpread2({}, sum);
2104
2163
  goods = goodsList[findMaxIndex(goodsList.map(function (e) {
2105
2164
  return e.lineAmountIncludeTax || 0;
2106
2165
  }))];
2107
- return _context7.abrupt("return", _objectSpread2(_objectSpread2({}, goods), {}, {
2108
- lineAttribute: LineAttributeType$1.正常
2166
+ return _context8.abrupt("return", _objectSpread2(_objectSpread2({}, goods), {}, {
2167
+ lineAttribute: sum.lineAttribute
2109
2168
  }));
2110
2169
 
2111
2170
  case 3:
2112
2171
  case "end":
2113
- return _context7.stop();
2172
+ return _context8.stop();
2114
2173
  }
2115
2174
  }
2116
- }, _callee7);
2175
+ }, _callee8);
2117
2176
  }));
2118
2177
  return _fillingInformationGood.apply(this, arguments);
2119
2178
  }
@@ -2125,23 +2184,23 @@ function checkTaxTate(_x12) {
2125
2184
 
2126
2185
 
2127
2186
  function _checkTaxTate() {
2128
- _checkTaxTate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(goodsList) {
2187
+ _checkTaxTate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(goodsList) {
2129
2188
  var tax, i;
2130
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2189
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2131
2190
  while (1) {
2132
- switch (_context8.prev = _context8.next) {
2191
+ switch (_context9.prev = _context9.next) {
2133
2192
  case 0:
2134
2193
  tax = goodsList[0].taxRate;
2135
2194
  i = 1;
2136
2195
 
2137
2196
  case 2:
2138
2197
  if (!(i < goodsList.length)) {
2139
- _context8.next = 8;
2198
+ _context9.next = 8;
2140
2199
  break;
2141
2200
  }
2142
2201
 
2143
2202
  if (!(tax !== goodsList[i].taxRate)) {
2144
- _context8.next = 5;
2203
+ _context9.next = 5;
2145
2204
  break;
2146
2205
  }
2147
2206
 
@@ -2149,15 +2208,15 @@ function _checkTaxTate() {
2149
2208
 
2150
2209
  case 5:
2151
2210
  i++;
2152
- _context8.next = 2;
2211
+ _context9.next = 2;
2153
2212
  break;
2154
2213
 
2155
2214
  case 8:
2156
2215
  case "end":
2157
- return _context8.stop();
2216
+ return _context9.stop();
2158
2217
  }
2159
2218
  }
2160
- }, _callee8);
2219
+ }, _callee9);
2161
2220
  }));
2162
2221
  return _checkTaxTate.apply(this, arguments);
2163
2222
  }
@@ -2169,23 +2228,23 @@ function checkSameNumber(_x13) {
2169
2228
 
2170
2229
 
2171
2230
  function _checkSameNumber() {
2172
- _checkSameNumber = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(good) {
2231
+ _checkSameNumber = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(good) {
2173
2232
  var content, _content;
2174
2233
 
2175
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2234
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2176
2235
  while (1) {
2177
- switch (_context9.prev = _context9.next) {
2236
+ switch (_context10.prev = _context10.next) {
2178
2237
  case 0:
2179
2238
  if (good.quantity) {
2180
- _context9.next = 2;
2239
+ _context10.next = 2;
2181
2240
  break;
2182
2241
  }
2183
2242
 
2184
- return _context9.abrupt("return");
2243
+ return _context10.abrupt("return");
2185
2244
 
2186
2245
  case 2:
2187
2246
  if (!(!good.lineAmountExcludeTax && good.lineAmountExcludeTax !== 0)) {
2188
- _context9.next = 6;
2247
+ _context10.next = 6;
2189
2248
  break;
2190
2249
  }
2191
2250
 
@@ -2198,11 +2257,11 @@ function _checkSameNumber() {
2198
2257
 
2199
2258
  case 6:
2200
2259
  if (!(good.quantity >= 0 && good.lineAmountExcludeTax >= 0 || good.lineAmountExcludeTax === 0 || good.quantity < 0 && good.lineAmountExcludeTax < 0)) {
2201
- _context9.next = 10;
2260
+ _context10.next = 10;
2202
2261
  break;
2203
2262
  }
2204
2263
 
2205
- return _context9.abrupt("return");
2264
+ return _context10.abrupt("return");
2206
2265
 
2207
2266
  case 10:
2208
2267
  _content = '合并失败,合并后“数量”和“金额”必须同时为正数或同时为负数。';
@@ -2214,10 +2273,10 @@ function _checkSameNumber() {
2214
2273
 
2215
2274
  case 13:
2216
2275
  case "end":
2217
- return _context9.stop();
2276
+ return _context10.stop();
2218
2277
  }
2219
2278
  }
2220
- }, _callee9);
2279
+ }, _callee10);
2221
2280
  }));
2222
2281
  return _checkSameNumber.apply(this, arguments);
2223
2282
  }
@@ -17728,11 +17787,73 @@ function ItemNameInput$1(props) {
17728
17787
  options = _React$useState2[0],
17729
17788
  setOptions = _React$useState2[1];
17730
17789
 
17790
+ var _React$useState3 = React__default['default'].useState(null),
17791
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
17792
+ selectLine = _React$useState4[0],
17793
+ setSelectLine = _React$useState4[1];
17794
+
17731
17795
  var onChange = React__default['default'].useCallback(function (e) {
17732
17796
  var event = _objectSpread2({}, e);
17733
17797
 
17734
17798
  props.onChange && props.onChange(event);
17735
17799
  }, []);
17800
+ var onBlur = React__default['default'].useCallback( /*#__PURE__*/function () {
17801
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
17802
+ var taxCategoryData, params;
17803
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
17804
+ while (1) {
17805
+ switch (_context.prev = _context.next) {
17806
+ case 0:
17807
+ _context.prev = 0;
17808
+
17809
+ if (!autoComplete.onItemNameBlur) {
17810
+ _context.next = 8;
17811
+ break;
17812
+ }
17813
+
17814
+ if (selectLine === null || selectLine === void 0 ? void 0 : selectLine.shorthand) {
17815
+ _context.next = 7;
17816
+ break;
17817
+ }
17818
+
17819
+ _context.next = 5;
17820
+ return autoComplete.onItemNameBlur(searchText);
17821
+
17822
+ case 5:
17823
+ taxCategoryData = _context.sent;
17824
+
17825
+ if (taxCategoryData && taxCategoryData[0]) {
17826
+ params = _objectSpread2(_objectSpread2({}, props.editGood), {}, {
17827
+ taxClassificationCode: taxCategoryData[0].taxCategoryCode,
17828
+ shorthand: taxCategoryData[0].shorthand
17829
+ });
17830
+ controller.importGoodsDrawer(params);
17831
+ }
17832
+
17833
+ case 7:
17834
+ setSelectLine(null);
17835
+
17836
+ case 8:
17837
+ _context.next = 13;
17838
+ break;
17839
+
17840
+ case 10:
17841
+ _context.prev = 10;
17842
+ _context.t0 = _context["catch"](0);
17843
+ throw _context.t0;
17844
+
17845
+ case 13:
17846
+ case "end":
17847
+ return _context.stop();
17848
+ }
17849
+ }
17850
+ }, _callee, null, [[0, 10]]);
17851
+ }));
17852
+
17853
+ return function (_x) {
17854
+ return _ref.apply(this, arguments);
17855
+ };
17856
+ }(), [autoComplete.onItemNameBlur, selectLine, props.editGood]);
17736
17857
  var onChangeAutoComplete = React__default['default'].useCallback(function (itemName) {
17737
17858
  var record = options.filter(function (e) {
17738
17859
  return e.itemName === itemName;
@@ -17741,49 +17862,49 @@ function ItemNameInput$1(props) {
17741
17862
  controller.importGoodsDrawer(record);
17742
17863
  }, [options, controller]);
17743
17864
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
17744
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
17865
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(searchText) {
17745
17866
  var list;
17746
- return _regeneratorRuntime().wrap(function _callee$(_context) {
17867
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
17747
17868
  while (1) {
17748
- switch (_context.prev = _context.next) {
17869
+ switch (_context2.prev = _context2.next) {
17749
17870
  case 0:
17750
- _context.prev = 0;
17871
+ _context2.prev = 0;
17751
17872
 
17752
17873
  if (!autoComplete.onItemNameSearch) {
17753
- _context.next = 9;
17874
+ _context2.next = 9;
17754
17875
  break;
17755
17876
  }
17756
17877
 
17757
- _context.t0 = _toConsumableArray;
17758
- _context.next = 5;
17878
+ _context2.t0 = _toConsumableArray;
17879
+ _context2.next = 5;
17759
17880
  return autoComplete.onItemNameSearch(searchText);
17760
17881
 
17761
17882
  case 5:
17762
- _context.t1 = _context.sent;
17763
- list = (0, _context.t0)(_context.t1);
17883
+ _context2.t1 = _context2.sent;
17884
+ list = (0, _context2.t0)(_context2.t1);
17764
17885
  console.log('===> list', list);
17765
17886
  setOptions(list);
17766
17887
 
17767
17888
  case 9:
17768
- _context.next = 15;
17889
+ _context2.next = 15;
17769
17890
  break;
17770
17891
 
17771
17892
  case 11:
17772
- _context.prev = 11;
17773
- _context.t2 = _context["catch"](0);
17893
+ _context2.prev = 11;
17894
+ _context2.t2 = _context2["catch"](0);
17774
17895
  setOptions([]);
17775
- throw _context.t2;
17896
+ throw _context2.t2;
17776
17897
 
17777
17898
  case 15:
17778
17899
  case "end":
17779
- return _context.stop();
17900
+ return _context2.stop();
17780
17901
  }
17781
17902
  }
17782
- }, _callee, null, [[0, 11]]);
17903
+ }, _callee2, null, [[0, 11]]);
17783
17904
  }));
17784
17905
 
17785
- return function (_x) {
17786
- return _ref.apply(this, arguments);
17906
+ return function (_x2) {
17907
+ return _ref2.apply(this, arguments);
17787
17908
  };
17788
17909
  }(), [autoComplete.onItemNameSearch]);
17789
17910
  console.log('===> options', options);
@@ -17808,7 +17929,8 @@ function ItemNameInput$1(props) {
17808
17929
  height: '100%'
17809
17930
  },
17810
17931
  onChange: onChange,
17811
- suffix: props.suffix
17932
+ suffix: props.suffix,
17933
+ onBlur: onBlur
17812
17934
  })));
17813
17935
  }
17814
17936
 
@@ -19399,6 +19521,7 @@ var useColumns$1 = (function (form) {
19399
19521
  }()
19400
19522
  }])
19401
19523
  })(React__default['default'].createElement(ItemNameInput$1, {
19524
+ editGood: editGood,
19402
19525
  shorthand: editGood.shorthand,
19403
19526
  suffix: React__default['default'].createElement(ktsXui.Tooltip, {
19404
19527
  title: "\u70B9\u51FB\u4ECE\u5546\u54C1\u7BA1\u7406\u4E2D\u6DFB\u52A0\u5546\u54C1\u4FE1\u606F"