kts-component-invoice-operate 3.2.104 → 3.2.106
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 +207 -149
- package/dist/index.js +207 -149
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/fns/importGoodsDrawer.ts +2 -2
- package/src/Invoice/InvoiceController/fns/mergeDetails.ts +76 -43
- package/src/Invoice/_test/endowCode/index.tsx +118 -118
- package/src/Invoice/_test/importGoods/index.tsx +68 -32
package/dist/index.esm.js
CHANGED
|
@@ -1813,111 +1813,170 @@ function mergeDetails(_x, _x2) {
|
|
|
1813
1813
|
/** 计算单价(含税) */
|
|
1814
1814
|
|
|
1815
1815
|
function _mergeDetails() {
|
|
1816
|
-
_mergeDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1817
|
-
var goodsList,
|
|
1818
|
-
|
|
1816
|
+
_mergeDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(state, selectedGoodIndex) {
|
|
1817
|
+
var goodsList, grouping, merge, _merge;
|
|
1818
|
+
|
|
1819
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1819
1820
|
while (1) {
|
|
1820
|
-
switch (
|
|
1821
|
+
switch (_context2.prev = _context2.next) {
|
|
1821
1822
|
case 0:
|
|
1822
|
-
|
|
1823
|
+
_merge = function _merge3() {
|
|
1824
|
+
_merge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(goodsList) {
|
|
1825
|
+
var selectedGoodIndex, sum, p;
|
|
1826
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1827
|
+
while (1) {
|
|
1828
|
+
switch (_context.prev = _context.next) {
|
|
1829
|
+
case 0:
|
|
1830
|
+
if (!(goodsList.length < 2)) {
|
|
1831
|
+
_context.next = 2;
|
|
1832
|
+
break;
|
|
1833
|
+
}
|
|
1823
1834
|
|
|
1824
|
-
|
|
1825
|
-
_context.next = 3;
|
|
1826
|
-
break;
|
|
1827
|
-
}
|
|
1835
|
+
return _context.abrupt("return");
|
|
1828
1836
|
|
|
1829
|
-
|
|
1837
|
+
case 2:
|
|
1838
|
+
selectedGoodIndex = goodsList.map(function (e) {
|
|
1839
|
+
return e.$index;
|
|
1840
|
+
});
|
|
1841
|
+
_context.prev = 3;
|
|
1842
|
+
// 创建合并后的商品对象
|
|
1843
|
+
sum = {
|
|
1844
|
+
$index: idGenerator(),
|
|
1845
|
+
lineAttribute: goodsList[0].lineAttribute
|
|
1846
|
+
}; // 存在税率不一样的明细,不能合并
|
|
1830
1847
|
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
// const goodsList = state.goodsListState.goodsList.filter(e => state.goodsListState.selectedGoodIndex.indexOf(e.$index) >= 0)
|
|
1834
|
-
goodsList = state.goodsListState.goodsList.filter(function (e) {
|
|
1835
|
-
return selectedGoodIndex.indexOf(e.$index) >= 0;
|
|
1836
|
-
});
|
|
1848
|
+
_context.next = 7;
|
|
1849
|
+
return checkTaxTate(goodsList);
|
|
1837
1850
|
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
}
|
|
1851
|
+
case 7:
|
|
1852
|
+
_context.next = 9;
|
|
1853
|
+
return fillingInformationGood(goodsList, sum);
|
|
1842
1854
|
|
|
1843
|
-
|
|
1855
|
+
case 9:
|
|
1856
|
+
sum = _context.sent;
|
|
1857
|
+
_context.next = 12;
|
|
1858
|
+
return mergeQuantity(goodsList);
|
|
1844
1859
|
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
$index: idGenerator(),
|
|
1850
|
-
lineAttribute: LineAttributeType$1.正常
|
|
1851
|
-
}; // 存在税率不一样的明细,不能合并
|
|
1860
|
+
case 12:
|
|
1861
|
+
sum.quantity = _context.sent;
|
|
1862
|
+
_context.next = 15;
|
|
1863
|
+
return mergeLineAmountExcludeTax(goodsList);
|
|
1852
1864
|
|
|
1853
|
-
|
|
1854
|
-
|
|
1865
|
+
case 15:
|
|
1866
|
+
sum.lineAmountExcludeTax = _context.sent;
|
|
1867
|
+
_context.next = 18;
|
|
1868
|
+
return mergeLineAmountIncludeTax(goodsList);
|
|
1855
1869
|
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1870
|
+
case 18:
|
|
1871
|
+
sum.lineAmountIncludeTax = _context.sent;
|
|
1872
|
+
_context.next = 21;
|
|
1873
|
+
return calculatePriceExcludeTax(sum, state.calculatingDigits);
|
|
1874
|
+
|
|
1875
|
+
case 21:
|
|
1876
|
+
sum.priceExcludeTax = _context.sent;
|
|
1877
|
+
_context.next = 24;
|
|
1878
|
+
return calculatePriceIncludeTax(sum, state.calculatingDigits);
|
|
1879
|
+
|
|
1880
|
+
case 24:
|
|
1881
|
+
sum.priceIncludeTax = _context.sent;
|
|
1882
|
+
// 计算税额
|
|
1883
|
+
sum.taxAmount = chain$1(bignumber(sum.lineAmountIncludeTax)).subtract(bignumber(sum.lineAmountExcludeTax)).done().toNumber(); // 校验数据 是否数量和金额是否同号
|
|
1884
|
+
|
|
1885
|
+
_context.next = 28;
|
|
1886
|
+
return checkSameNumber(sum);
|
|
1887
|
+
|
|
1888
|
+
case 28:
|
|
1889
|
+
p = state.goodsListState.goodsList.indexOf(goodsList[0]);
|
|
1890
|
+
state.goodsListState.goodsList = state.goodsListState.goodsList.filter(function (e) {
|
|
1891
|
+
return selectedGoodIndex.indexOf(e.$index) < 0;
|
|
1892
|
+
});
|
|
1893
|
+
state.goodsListState.goodsList.splice(p, 0, sum);
|
|
1894
|
+
state.goodsListState.goodsList = state.goodsListState.goodsList.filter(function (e) {
|
|
1895
|
+
return e.lineAmountExcludeTax !== 0;
|
|
1896
|
+
});
|
|
1897
|
+
state.goodsListState.goodsMap = new Map();
|
|
1898
|
+
state.goodsListState.goodsList.forEach(function (e) {
|
|
1899
|
+
state.goodsListState.goodsMap.set(e.$index, e);
|
|
1900
|
+
});
|
|
1901
|
+
state.goodsListState.selectedGoodIndex = [];
|
|
1902
|
+
_context.next = 40;
|
|
1903
|
+
break;
|
|
1859
1904
|
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1905
|
+
case 37:
|
|
1906
|
+
_context.prev = 37;
|
|
1907
|
+
_context.t0 = _context["catch"](3);
|
|
1908
|
+
showError(_context.t0);
|
|
1864
1909
|
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1910
|
+
case 40:
|
|
1911
|
+
case "end":
|
|
1912
|
+
return _context.stop();
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
}, _callee, null, [[3, 37]]);
|
|
1916
|
+
}));
|
|
1917
|
+
return _merge.apply(this, arguments);
|
|
1918
|
+
};
|
|
1869
1919
|
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
return mergeLineAmountIncludeTax(goodsList);
|
|
1920
|
+
merge = function _merge2(_x14) {
|
|
1921
|
+
return _merge.apply(this, arguments);
|
|
1922
|
+
};
|
|
1874
1923
|
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1924
|
+
grouping = function _grouping(goodsList) {
|
|
1925
|
+
var grouped = {};
|
|
1926
|
+
goodsList.forEach(function (good) {
|
|
1927
|
+
var key = function () {
|
|
1928
|
+
switch (good.lineAttribute) {
|
|
1929
|
+
case LineAttributeType$1.折让行:
|
|
1930
|
+
return LineAttributeType$1.折让行;
|
|
1879
1931
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
_context.next = 27;
|
|
1883
|
-
return calculatePriceIncludeTax(sum, state.calculatingDigits);
|
|
1932
|
+
case LineAttributeType$1.赠品行:
|
|
1933
|
+
return LineAttributeType$1.赠品行;
|
|
1884
1934
|
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1935
|
+
default:
|
|
1936
|
+
return LineAttributeType$1.正常;
|
|
1937
|
+
}
|
|
1938
|
+
}();
|
|
1889
1939
|
|
|
1890
|
-
|
|
1891
|
-
|
|
1940
|
+
if (!grouped[key]) {
|
|
1941
|
+
grouped[key] = [];
|
|
1942
|
+
}
|
|
1892
1943
|
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1944
|
+
grouped[key].push(_objectSpread2(_objectSpread2({}, good), {}, {
|
|
1945
|
+
lineAttribute: key
|
|
1946
|
+
}));
|
|
1947
|
+
});
|
|
1948
|
+
return Object.values(grouped);
|
|
1949
|
+
};
|
|
1950
|
+
|
|
1951
|
+
if (!(state.goodsListState.editGood || !selectedGoodIndex || selectedGoodIndex.length < 2)) {
|
|
1952
|
+
_context2.next = 5;
|
|
1953
|
+
break;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
return _context2.abrupt("return");
|
|
1957
|
+
|
|
1958
|
+
case 5:
|
|
1959
|
+
goodsList = state.goodsListState.goodsList.filter(function (e) {
|
|
1960
|
+
return selectedGoodIndex.indexOf(e.$index) >= 0;
|
|
1905
1961
|
});
|
|
1906
|
-
state.goodsListState.selectedGoodIndex = [];
|
|
1907
|
-
_context.next = 43;
|
|
1908
|
-
break;
|
|
1909
1962
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1963
|
+
if (!(goodsList.length < 2)) {
|
|
1964
|
+
_context2.next = 8;
|
|
1965
|
+
break;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
return _context2.abrupt("return");
|
|
1914
1969
|
|
|
1915
|
-
case
|
|
1970
|
+
case 8:
|
|
1971
|
+
grouping(goodsList).forEach(merge);
|
|
1972
|
+
/** 分组 */
|
|
1973
|
+
|
|
1974
|
+
case 9:
|
|
1916
1975
|
case "end":
|
|
1917
|
-
return
|
|
1976
|
+
return _context2.stop();
|
|
1918
1977
|
}
|
|
1919
1978
|
}
|
|
1920
|
-
},
|
|
1979
|
+
}, _callee2);
|
|
1921
1980
|
}));
|
|
1922
1981
|
return _mergeDetails.apply(this, arguments);
|
|
1923
1982
|
}
|
|
@@ -1929,29 +1988,29 @@ function calculatePriceIncludeTax(_x3, _x4) {
|
|
|
1929
1988
|
|
|
1930
1989
|
|
|
1931
1990
|
function _calculatePriceIncludeTax() {
|
|
1932
|
-
_calculatePriceIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1991
|
+
_calculatePriceIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sum, calculatingDigits) {
|
|
1933
1992
|
var value;
|
|
1934
|
-
return _regeneratorRuntime().wrap(function
|
|
1993
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1935
1994
|
while (1) {
|
|
1936
|
-
switch (
|
|
1995
|
+
switch (_context3.prev = _context3.next) {
|
|
1937
1996
|
case 0:
|
|
1938
1997
|
if (sum.quantity) {
|
|
1939
|
-
|
|
1998
|
+
_context3.next = 2;
|
|
1940
1999
|
break;
|
|
1941
2000
|
}
|
|
1942
2001
|
|
|
1943
|
-
return
|
|
2002
|
+
return _context3.abrupt("return", undefined);
|
|
1944
2003
|
|
|
1945
2004
|
case 2:
|
|
1946
2005
|
value = chain$1(bignumber(sum.lineAmountIncludeTax)).divide(bignumber(sum.quantity)).done().toNumber();
|
|
1947
|
-
return
|
|
2006
|
+
return _context3.abrupt("return", format15(value, calculatingDigits) || undefined);
|
|
1948
2007
|
|
|
1949
2008
|
case 4:
|
|
1950
2009
|
case "end":
|
|
1951
|
-
return
|
|
2010
|
+
return _context3.stop();
|
|
1952
2011
|
}
|
|
1953
2012
|
}
|
|
1954
|
-
},
|
|
2013
|
+
}, _callee3);
|
|
1955
2014
|
}));
|
|
1956
2015
|
return _calculatePriceIncludeTax.apply(this, arguments);
|
|
1957
2016
|
}
|
|
@@ -1963,29 +2022,29 @@ function calculatePriceExcludeTax(_x5, _x6) {
|
|
|
1963
2022
|
|
|
1964
2023
|
|
|
1965
2024
|
function _calculatePriceExcludeTax() {
|
|
1966
|
-
_calculatePriceExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2025
|
+
_calculatePriceExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sum, calculatingDigits) {
|
|
1967
2026
|
var value;
|
|
1968
|
-
return _regeneratorRuntime().wrap(function
|
|
2027
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1969
2028
|
while (1) {
|
|
1970
|
-
switch (
|
|
2029
|
+
switch (_context4.prev = _context4.next) {
|
|
1971
2030
|
case 0:
|
|
1972
2031
|
if (sum.quantity) {
|
|
1973
|
-
|
|
2032
|
+
_context4.next = 2;
|
|
1974
2033
|
break;
|
|
1975
2034
|
}
|
|
1976
2035
|
|
|
1977
|
-
return
|
|
2036
|
+
return _context4.abrupt("return", undefined);
|
|
1978
2037
|
|
|
1979
2038
|
case 2:
|
|
1980
2039
|
value = format15(chain$1(bignumber(sum.lineAmountExcludeTax)).divide(bignumber(sum.quantity)).done().toNumber());
|
|
1981
|
-
return
|
|
2040
|
+
return _context4.abrupt("return", format15(value, calculatingDigits) || undefined);
|
|
1982
2041
|
|
|
1983
2042
|
case 5:
|
|
1984
2043
|
case "end":
|
|
1985
|
-
return
|
|
2044
|
+
return _context4.stop();
|
|
1986
2045
|
}
|
|
1987
2046
|
}
|
|
1988
|
-
},
|
|
2047
|
+
}, _callee4);
|
|
1989
2048
|
}));
|
|
1990
2049
|
return _calculatePriceExcludeTax.apply(this, arguments);
|
|
1991
2050
|
}
|
|
@@ -1997,24 +2056,24 @@ function mergeLineAmountIncludeTax(_x7) {
|
|
|
1997
2056
|
|
|
1998
2057
|
|
|
1999
2058
|
function _mergeLineAmountIncludeTax() {
|
|
2000
|
-
_mergeLineAmountIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2059
|
+
_mergeLineAmountIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(goodsList) {
|
|
2001
2060
|
var sum;
|
|
2002
|
-
return _regeneratorRuntime().wrap(function
|
|
2061
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2003
2062
|
while (1) {
|
|
2004
|
-
switch (
|
|
2063
|
+
switch (_context5.prev = _context5.next) {
|
|
2005
2064
|
case 0:
|
|
2006
2065
|
sum = chain$1(bignumber(0));
|
|
2007
2066
|
goodsList.forEach(function (e) {
|
|
2008
2067
|
sum = sum.add(bignumber(e.lineAmountIncludeTax || 0));
|
|
2009
2068
|
});
|
|
2010
|
-
return
|
|
2069
|
+
return _context5.abrupt("return", sum.done().toNumber());
|
|
2011
2070
|
|
|
2012
2071
|
case 3:
|
|
2013
2072
|
case "end":
|
|
2014
|
-
return
|
|
2073
|
+
return _context5.stop();
|
|
2015
2074
|
}
|
|
2016
2075
|
}
|
|
2017
|
-
},
|
|
2076
|
+
}, _callee5);
|
|
2018
2077
|
}));
|
|
2019
2078
|
return _mergeLineAmountIncludeTax.apply(this, arguments);
|
|
2020
2079
|
}
|
|
@@ -2026,24 +2085,24 @@ function mergeLineAmountExcludeTax(_x8) {
|
|
|
2026
2085
|
|
|
2027
2086
|
|
|
2028
2087
|
function _mergeLineAmountExcludeTax() {
|
|
2029
|
-
_mergeLineAmountExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2088
|
+
_mergeLineAmountExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(goodsList) {
|
|
2030
2089
|
var sum;
|
|
2031
|
-
return _regeneratorRuntime().wrap(function
|
|
2090
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
2032
2091
|
while (1) {
|
|
2033
|
-
switch (
|
|
2092
|
+
switch (_context6.prev = _context6.next) {
|
|
2034
2093
|
case 0:
|
|
2035
2094
|
sum = chain$1(bignumber(0));
|
|
2036
2095
|
goodsList.forEach(function (e) {
|
|
2037
2096
|
sum = sum.add(bignumber(e.lineAmountExcludeTax || 0));
|
|
2038
2097
|
});
|
|
2039
|
-
return
|
|
2098
|
+
return _context6.abrupt("return", sum.done().toNumber());
|
|
2040
2099
|
|
|
2041
2100
|
case 3:
|
|
2042
2101
|
case "end":
|
|
2043
|
-
return
|
|
2102
|
+
return _context6.stop();
|
|
2044
2103
|
}
|
|
2045
2104
|
}
|
|
2046
|
-
},
|
|
2105
|
+
}, _callee6);
|
|
2047
2106
|
}));
|
|
2048
2107
|
return _mergeLineAmountExcludeTax.apply(this, arguments);
|
|
2049
2108
|
}
|
|
@@ -2055,24 +2114,24 @@ function mergeQuantity(_x9) {
|
|
|
2055
2114
|
|
|
2056
2115
|
|
|
2057
2116
|
function _mergeQuantity() {
|
|
2058
|
-
_mergeQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2117
|
+
_mergeQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(goodsList) {
|
|
2059
2118
|
var sum;
|
|
2060
|
-
return _regeneratorRuntime().wrap(function
|
|
2119
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
2061
2120
|
while (1) {
|
|
2062
|
-
switch (
|
|
2121
|
+
switch (_context7.prev = _context7.next) {
|
|
2063
2122
|
case 0:
|
|
2064
2123
|
sum = chain$1(bignumber(0));
|
|
2065
2124
|
goodsList.forEach(function (e) {
|
|
2066
2125
|
sum = sum.add(bignumber(e.quantity || 0));
|
|
2067
2126
|
});
|
|
2068
|
-
return
|
|
2127
|
+
return _context7.abrupt("return", sum.done().toNumber() || undefined);
|
|
2069
2128
|
|
|
2070
2129
|
case 3:
|
|
2071
2130
|
case "end":
|
|
2072
|
-
return
|
|
2131
|
+
return _context7.stop();
|
|
2073
2132
|
}
|
|
2074
2133
|
}
|
|
2075
|
-
},
|
|
2134
|
+
}, _callee7);
|
|
2076
2135
|
}));
|
|
2077
2136
|
return _mergeQuantity.apply(this, arguments);
|
|
2078
2137
|
}
|
|
@@ -2084,26 +2143,26 @@ function fillingInformationGood(_x10, _x11) {
|
|
|
2084
2143
|
|
|
2085
2144
|
|
|
2086
2145
|
function _fillingInformationGood() {
|
|
2087
|
-
_fillingInformationGood = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2146
|
+
_fillingInformationGood = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(goodsList, sum) {
|
|
2088
2147
|
var goods;
|
|
2089
|
-
return _regeneratorRuntime().wrap(function
|
|
2148
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
2090
2149
|
while (1) {
|
|
2091
|
-
switch (
|
|
2150
|
+
switch (_context8.prev = _context8.next) {
|
|
2092
2151
|
case 0:
|
|
2093
2152
|
sum = _objectSpread2({}, sum);
|
|
2094
2153
|
goods = goodsList[findMaxIndex(goodsList.map(function (e) {
|
|
2095
2154
|
return e.lineAmountIncludeTax || 0;
|
|
2096
2155
|
}))];
|
|
2097
|
-
return
|
|
2098
|
-
lineAttribute:
|
|
2156
|
+
return _context8.abrupt("return", _objectSpread2(_objectSpread2({}, goods), {}, {
|
|
2157
|
+
lineAttribute: sum.lineAttribute
|
|
2099
2158
|
}));
|
|
2100
2159
|
|
|
2101
2160
|
case 3:
|
|
2102
2161
|
case "end":
|
|
2103
|
-
return
|
|
2162
|
+
return _context8.stop();
|
|
2104
2163
|
}
|
|
2105
2164
|
}
|
|
2106
|
-
},
|
|
2165
|
+
}, _callee8);
|
|
2107
2166
|
}));
|
|
2108
2167
|
return _fillingInformationGood.apply(this, arguments);
|
|
2109
2168
|
}
|
|
@@ -2115,23 +2174,23 @@ function checkTaxTate(_x12) {
|
|
|
2115
2174
|
|
|
2116
2175
|
|
|
2117
2176
|
function _checkTaxTate() {
|
|
2118
|
-
_checkTaxTate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2177
|
+
_checkTaxTate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(goodsList) {
|
|
2119
2178
|
var tax, i;
|
|
2120
|
-
return _regeneratorRuntime().wrap(function
|
|
2179
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
2121
2180
|
while (1) {
|
|
2122
|
-
switch (
|
|
2181
|
+
switch (_context9.prev = _context9.next) {
|
|
2123
2182
|
case 0:
|
|
2124
2183
|
tax = goodsList[0].taxRate;
|
|
2125
2184
|
i = 1;
|
|
2126
2185
|
|
|
2127
2186
|
case 2:
|
|
2128
2187
|
if (!(i < goodsList.length)) {
|
|
2129
|
-
|
|
2188
|
+
_context9.next = 8;
|
|
2130
2189
|
break;
|
|
2131
2190
|
}
|
|
2132
2191
|
|
|
2133
2192
|
if (!(tax !== goodsList[i].taxRate)) {
|
|
2134
|
-
|
|
2193
|
+
_context9.next = 5;
|
|
2135
2194
|
break;
|
|
2136
2195
|
}
|
|
2137
2196
|
|
|
@@ -2139,15 +2198,15 @@ function _checkTaxTate() {
|
|
|
2139
2198
|
|
|
2140
2199
|
case 5:
|
|
2141
2200
|
i++;
|
|
2142
|
-
|
|
2201
|
+
_context9.next = 2;
|
|
2143
2202
|
break;
|
|
2144
2203
|
|
|
2145
2204
|
case 8:
|
|
2146
2205
|
case "end":
|
|
2147
|
-
return
|
|
2206
|
+
return _context9.stop();
|
|
2148
2207
|
}
|
|
2149
2208
|
}
|
|
2150
|
-
},
|
|
2209
|
+
}, _callee9);
|
|
2151
2210
|
}));
|
|
2152
2211
|
return _checkTaxTate.apply(this, arguments);
|
|
2153
2212
|
}
|
|
@@ -2159,23 +2218,23 @@ function checkSameNumber(_x13) {
|
|
|
2159
2218
|
|
|
2160
2219
|
|
|
2161
2220
|
function _checkSameNumber() {
|
|
2162
|
-
_checkSameNumber = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2221
|
+
_checkSameNumber = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(good) {
|
|
2163
2222
|
var content, _content;
|
|
2164
2223
|
|
|
2165
|
-
return _regeneratorRuntime().wrap(function
|
|
2224
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
2166
2225
|
while (1) {
|
|
2167
|
-
switch (
|
|
2226
|
+
switch (_context10.prev = _context10.next) {
|
|
2168
2227
|
case 0:
|
|
2169
2228
|
if (good.quantity) {
|
|
2170
|
-
|
|
2229
|
+
_context10.next = 2;
|
|
2171
2230
|
break;
|
|
2172
2231
|
}
|
|
2173
2232
|
|
|
2174
|
-
return
|
|
2233
|
+
return _context10.abrupt("return");
|
|
2175
2234
|
|
|
2176
2235
|
case 2:
|
|
2177
2236
|
if (!(!good.lineAmountExcludeTax && good.lineAmountExcludeTax !== 0)) {
|
|
2178
|
-
|
|
2237
|
+
_context10.next = 6;
|
|
2179
2238
|
break;
|
|
2180
2239
|
}
|
|
2181
2240
|
|
|
@@ -2188,11 +2247,11 @@ function _checkSameNumber() {
|
|
|
2188
2247
|
|
|
2189
2248
|
case 6:
|
|
2190
2249
|
if (!(good.quantity >= 0 && good.lineAmountExcludeTax >= 0 || good.lineAmountExcludeTax === 0 || good.quantity < 0 && good.lineAmountExcludeTax < 0)) {
|
|
2191
|
-
|
|
2250
|
+
_context10.next = 10;
|
|
2192
2251
|
break;
|
|
2193
2252
|
}
|
|
2194
2253
|
|
|
2195
|
-
return
|
|
2254
|
+
return _context10.abrupt("return");
|
|
2196
2255
|
|
|
2197
2256
|
case 10:
|
|
2198
2257
|
_content = '合并失败,合并后“数量”和“金额”必须同时为正数或同时为负数。';
|
|
@@ -2204,10 +2263,10 @@ function _checkSameNumber() {
|
|
|
2204
2263
|
|
|
2205
2264
|
case 13:
|
|
2206
2265
|
case "end":
|
|
2207
|
-
return
|
|
2266
|
+
return _context10.stop();
|
|
2208
2267
|
}
|
|
2209
2268
|
}
|
|
2210
|
-
},
|
|
2269
|
+
}, _callee10);
|
|
2211
2270
|
}));
|
|
2212
2271
|
return _checkSameNumber.apply(this, arguments);
|
|
2213
2272
|
}
|
|
@@ -9305,27 +9364,26 @@ var importGoodsDrawer = /*#__PURE__*/(function () {
|
|
|
9305
9364
|
}));
|
|
9306
9365
|
} else {
|
|
9307
9366
|
s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
|
|
9308
|
-
}
|
|
9367
|
+
} // s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
9309
9368
|
|
|
9310
|
-
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
9311
9369
|
|
|
9312
9370
|
if (!s.goodsListState.isTaxIncluded) {
|
|
9313
|
-
_context.next =
|
|
9371
|
+
_context.next = 29;
|
|
9314
9372
|
break;
|
|
9315
9373
|
}
|
|
9316
9374
|
|
|
9317
|
-
_context.next =
|
|
9375
|
+
_context.next = 27;
|
|
9318
9376
|
return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
|
|
9319
9377
|
|
|
9320
|
-
case
|
|
9321
|
-
_context.next =
|
|
9378
|
+
case 27:
|
|
9379
|
+
_context.next = 31;
|
|
9322
9380
|
break;
|
|
9323
9381
|
|
|
9324
|
-
case
|
|
9325
|
-
_context.next =
|
|
9382
|
+
case 29:
|
|
9383
|
+
_context.next = 31;
|
|
9326
9384
|
return updateUnitPriceTax(controller, s.goodsListState.form, record);
|
|
9327
9385
|
|
|
9328
|
-
case
|
|
9386
|
+
case 31:
|
|
9329
9387
|
case "end":
|
|
9330
9388
|
return _context.stop();
|
|
9331
9389
|
}
|