kts-component-invoice-operate 1.0.64 → 1.0.68
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/Invoice/tools/calculate/index.d.ts +5 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +1 -4
- package/dist/index.esm.js +52 -55
- package/dist/index.js +52 -55
- package/docs/index.md +1 -1
- package/docs-dist/umi.css +1 -1
- package/docs-dist/umi.js +1 -1
- package/package.json +1 -1
- package/src/Invoice/_test/importGoods/index.tsx +144 -18
- package/src/Invoice/tools/calculate/index.ts +31 -0
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +13 -32
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +3 -3
- package/src/Invoice/ui/GoodsList/index.tsx +3 -1
- package/src/Invoice/ui/GoodsList/ui/Statistics/index.tsx +11 -15
- package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +31 -23
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** 格式化 保留2位小数 */
|
|
2
|
+
export declare const format2: (value: number | string) => number | "";
|
|
3
|
+
/** 格式化 保留15位数字 */
|
|
4
|
+
export declare const format15: (value: number | string) => number | "";
|
|
5
|
+
export declare function quantityPriceIncludeTax(quantity?: number | string, priceIncludeTax?: number | string): number | undefined;
|
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
|
|
8
8
|
import InvoiceController, { IGood } from '../../../../../InvoiceController';
|
|
9
|
-
|
|
10
|
-
export declare const format2: (value: number | string) => number | "";
|
|
11
|
-
/** 格式化 保留15位数字 */
|
|
12
|
-
export declare const format15: (value: number | string) => number | "";
|
|
9
|
+
export { format2, format15 } from '../../../../../tools/calculate';
|
|
13
10
|
/** 数量改变了 */
|
|
14
11
|
export declare const onChangeQuantity: (...par: any[]) => void;
|
|
15
12
|
/** 单价(含税) */
|
package/dist/index.esm.js
CHANGED
|
@@ -1486,41 +1486,25 @@ var Statistics = (function () {
|
|
|
1486
1486
|
className: "kts-invoice-operate-goods-list-statistics-row"
|
|
1487
1487
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1488
1488
|
style: {
|
|
1489
|
-
width:
|
|
1490
|
-
}
|
|
1491
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
1492
|
-
style: {
|
|
1493
|
-
flex: 2
|
|
1494
|
-
}
|
|
1495
|
-
}, /*#__PURE__*/React.createElement("label", null, "\u5408\u8BA1")), /*#__PURE__*/React.createElement("div", {
|
|
1496
|
-
style: {
|
|
1497
|
-
width: 80
|
|
1498
|
-
}
|
|
1499
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
1500
|
-
style: {
|
|
1501
|
-
flex: 2
|
|
1489
|
+
width: 45
|
|
1502
1490
|
}
|
|
1503
1491
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1504
1492
|
style: {
|
|
1505
1493
|
flex: 1
|
|
1506
1494
|
}
|
|
1507
|
-
}, /*#__PURE__*/React.createElement("label", null,
|
|
1508
|
-
style: {
|
|
1509
|
-
width: 80
|
|
1510
|
-
}
|
|
1511
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
1495
|
+
}, /*#__PURE__*/React.createElement("label", null, "\u5408\u8BA1")), /*#__PURE__*/React.createElement("div", {
|
|
1512
1496
|
style: {
|
|
1513
|
-
|
|
1497
|
+
width: 119 + 70
|
|
1514
1498
|
}
|
|
1515
|
-
}, /*#__PURE__*/React.createElement("label", null,
|
|
1499
|
+
}, /*#__PURE__*/React.createElement("label", null, parseFloat(isTaxIncluded ? lineAmountIncludeTax : lineAmountExcludeTax).toFixed(2))), /*#__PURE__*/React.createElement("div", {
|
|
1516
1500
|
style: {
|
|
1517
|
-
width:
|
|
1501
|
+
width: 119 + 50 + 1
|
|
1518
1502
|
}
|
|
1519
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1503
|
+
}, /*#__PURE__*/React.createElement("label", null, parseFloat(taxAmount).toFixed(2)))), /*#__PURE__*/React.createElement("div", {
|
|
1520
1504
|
className: "kts-invoice-operate-goods-list-statistics-row"
|
|
1521
1505
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1522
1506
|
style: {
|
|
1523
|
-
width:
|
|
1507
|
+
width: 45
|
|
1524
1508
|
}
|
|
1525
1509
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1526
1510
|
style: {
|
|
@@ -1539,7 +1523,7 @@ var Statistics = (function () {
|
|
|
1539
1523
|
flex: 3,
|
|
1540
1524
|
border: 'none'
|
|
1541
1525
|
}
|
|
1542
|
-
}, /*#__PURE__*/React.createElement("label", null, lineAmountIncludeTax))));
|
|
1526
|
+
}, /*#__PURE__*/React.createElement("label", null, parseFloat(lineAmountIncludeTax).toFixed()))));
|
|
1543
1527
|
});
|
|
1544
1528
|
|
|
1545
1529
|
var AddRowButton = (function () {
|
|
@@ -2374,26 +2358,8 @@ var useAddDiscount = (function (goods) {
|
|
|
2374
2358
|
}, [onClick, goods.lineAttribute]);
|
|
2375
2359
|
});
|
|
2376
2360
|
|
|
2377
|
-
/** 延迟函数 */
|
|
2378
|
-
|
|
2379
|
-
var lazyFn$1 = function lazyFn(fn) {
|
|
2380
|
-
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
2381
|
-
var timer;
|
|
2382
|
-
return function () {
|
|
2383
|
-
for (var _len = arguments.length, par = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2384
|
-
par[_key] = arguments[_key];
|
|
2385
|
-
}
|
|
2386
|
-
|
|
2387
|
-
if (timer) return;
|
|
2388
|
-
timer = setTimeout(function () {
|
|
2389
|
-
timer = undefined;
|
|
2390
|
-
fn.apply(null, par);
|
|
2391
|
-
}, delayed);
|
|
2392
|
-
};
|
|
2393
|
-
};
|
|
2394
2361
|
/** 格式化 保留2位小数 */
|
|
2395
2362
|
|
|
2396
|
-
|
|
2397
2363
|
var format2 = function format2(value) {
|
|
2398
2364
|
if (value === Infinity) return '';
|
|
2399
2365
|
if ("".concat(value) === 'NaN') return '';
|
|
@@ -2408,9 +2374,36 @@ var format15 = function format15(value) {
|
|
|
2408
2374
|
if (typeof value === 'string') value = parseFloat(value);
|
|
2409
2375
|
var fractionDigits = 15 - value.toString().indexOf('.');
|
|
2410
2376
|
return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
|
|
2377
|
+
}; // 数量 + 单价(含税) => 金额(含税)
|
|
2378
|
+
|
|
2379
|
+
function quantityPriceIncludeTax(quantity, priceIncludeTax) {
|
|
2380
|
+
if (!quantity && quantity !== 0) return undefined;
|
|
2381
|
+
if (!priceIncludeTax && priceIncludeTax !== 0) return undefined;
|
|
2382
|
+
quantity = format15(quantity);
|
|
2383
|
+
priceIncludeTax = format15(priceIncludeTax);
|
|
2384
|
+
return evaluate("".concat(priceIncludeTax, " * ").concat(quantity));
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
/** 延迟函数 */
|
|
2388
|
+
|
|
2389
|
+
var lazyFn$1 = function lazyFn(fn) {
|
|
2390
|
+
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
2391
|
+
var timer;
|
|
2392
|
+
return function () {
|
|
2393
|
+
for (var _len = arguments.length, par = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2394
|
+
par[_key] = arguments[_key];
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
if (timer) return;
|
|
2398
|
+
timer = setTimeout(function () {
|
|
2399
|
+
timer = undefined;
|
|
2400
|
+
fn.apply(null, par);
|
|
2401
|
+
}, delayed);
|
|
2402
|
+
};
|
|
2411
2403
|
};
|
|
2412
2404
|
/** 数量改变了 */
|
|
2413
2405
|
|
|
2406
|
+
|
|
2414
2407
|
var onChangeQuantity = lazyFn$1(function (controller, form, record) {
|
|
2415
2408
|
form.validateFields( /*#__PURE__*/function () {
|
|
2416
2409
|
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(err, values) {
|
|
@@ -3706,7 +3699,7 @@ var useColumns = (function (form) {
|
|
|
3706
3699
|
style: {
|
|
3707
3700
|
padding: '0 10px'
|
|
3708
3701
|
}
|
|
3709
|
-
}, value);
|
|
3702
|
+
}, parseFloat(value).toFixed(2));
|
|
3710
3703
|
}
|
|
3711
3704
|
}
|
|
3712
3705
|
}, {
|
|
@@ -3743,7 +3736,7 @@ var useColumns = (function (form) {
|
|
|
3743
3736
|
style: {
|
|
3744
3737
|
padding: '0 10px'
|
|
3745
3738
|
}
|
|
3746
|
-
}, value);
|
|
3739
|
+
}, parseFloat(value).toFixed(2));
|
|
3747
3740
|
}
|
|
3748
3741
|
}
|
|
3749
3742
|
}, {
|
|
@@ -3807,7 +3800,7 @@ var useColumns = (function (form) {
|
|
|
3807
3800
|
style: {
|
|
3808
3801
|
padding: '0 10px'
|
|
3809
3802
|
}
|
|
3810
|
-
}, value);
|
|
3803
|
+
}, parseFloat(value).toFixed(2));
|
|
3811
3804
|
}
|
|
3812
3805
|
}
|
|
3813
3806
|
}, {
|
|
@@ -4331,7 +4324,9 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
4331
4324
|
|
|
4332
4325
|
React.useEffect(function () {
|
|
4333
4326
|
var click = function click() {
|
|
4334
|
-
|
|
4327
|
+
setTimeout(function () {
|
|
4328
|
+
controller.saveEditGood();
|
|
4329
|
+
});
|
|
4335
4330
|
};
|
|
4336
4331
|
|
|
4337
4332
|
window.addEventListener('click', click);
|
|
@@ -4966,43 +4961,44 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
4966
4961
|
while (1) {
|
|
4967
4962
|
switch (_context2.prev = _context2.next) {
|
|
4968
4963
|
case 0:
|
|
4964
|
+
debugger;
|
|
4969
4965
|
Object.keys(record).filter(function (e) {
|
|
4970
4966
|
return !record[e] && record[e] !== 0;
|
|
4971
4967
|
}).forEach(function (e) {
|
|
4972
4968
|
delete record[e];
|
|
4973
4969
|
});
|
|
4974
|
-
_context2.next =
|
|
4970
|
+
_context2.next = 4;
|
|
4975
4971
|
return s.goodsListState.importGoods.verifyFn(record);
|
|
4976
4972
|
|
|
4977
|
-
case
|
|
4973
|
+
case 4:
|
|
4978
4974
|
_context2.t0 = _context2.sent;
|
|
4979
4975
|
|
|
4980
4976
|
if (!(_context2.t0 === false)) {
|
|
4981
|
-
_context2.next =
|
|
4977
|
+
_context2.next = 7;
|
|
4982
4978
|
break;
|
|
4983
4979
|
}
|
|
4984
4980
|
|
|
4985
4981
|
return _context2.abrupt("return");
|
|
4986
4982
|
|
|
4987
|
-
case
|
|
4983
|
+
case 7:
|
|
4988
4984
|
if (!(!s.goodsListState.editGood || !s.goodsListState.form)) {
|
|
4989
|
-
_context2.next =
|
|
4985
|
+
_context2.next = 9;
|
|
4990
4986
|
break;
|
|
4991
4987
|
}
|
|
4992
4988
|
|
|
4993
4989
|
return _context2.abrupt("return");
|
|
4994
4990
|
|
|
4995
|
-
case
|
|
4991
|
+
case 9:
|
|
4996
4992
|
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
|
|
4997
4993
|
|
|
4998
4994
|
if (s.goodsListState.editGood) {
|
|
4999
|
-
_context2.next =
|
|
4995
|
+
_context2.next = 12;
|
|
5000
4996
|
break;
|
|
5001
4997
|
}
|
|
5002
4998
|
|
|
5003
4999
|
return _context2.abrupt("return");
|
|
5004
5000
|
|
|
5005
|
-
case
|
|
5001
|
+
case 12:
|
|
5006
5002
|
if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
|
|
5007
5003
|
s.goodsListState.editGood.priceIncludeTax = undefined;
|
|
5008
5004
|
s.goodsListState.editGood.priceExcludeTax = undefined;
|
|
@@ -5010,12 +5006,13 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
5010
5006
|
s.goodsListState.editGood.priceExcludeTax = getPriceExcludeTax(s.goodsListState.editGood, record);
|
|
5011
5007
|
}
|
|
5012
5008
|
|
|
5009
|
+
s.goodsListState.editGood.lineAmountIncludeTax = quantityPriceIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
|
|
5013
5010
|
s.goodsListState.editGood.itemName = getItemName(record);
|
|
5014
5011
|
s.goodsListState.form.setFieldsValue(s.goodsListState.editGood);
|
|
5015
5012
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
5016
5013
|
s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
|
|
5017
5014
|
|
|
5018
|
-
case
|
|
5015
|
+
case 18:
|
|
5019
5016
|
case "end":
|
|
5020
5017
|
return _context2.stop();
|
|
5021
5018
|
}
|
package/dist/index.js
CHANGED
|
@@ -1495,41 +1495,25 @@ var Statistics = (function () {
|
|
|
1495
1495
|
className: "kts-invoice-operate-goods-list-statistics-row"
|
|
1496
1496
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1497
1497
|
style: {
|
|
1498
|
-
width:
|
|
1499
|
-
}
|
|
1500
|
-
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1501
|
-
style: {
|
|
1502
|
-
flex: 2
|
|
1503
|
-
}
|
|
1504
|
-
}, /*#__PURE__*/React__default['default'].createElement("label", null, "\u5408\u8BA1")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1505
|
-
style: {
|
|
1506
|
-
width: 80
|
|
1507
|
-
}
|
|
1508
|
-
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1509
|
-
style: {
|
|
1510
|
-
flex: 2
|
|
1498
|
+
width: 45
|
|
1511
1499
|
}
|
|
1512
1500
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1513
1501
|
style: {
|
|
1514
1502
|
flex: 1
|
|
1515
1503
|
}
|
|
1516
|
-
}, /*#__PURE__*/React__default['default'].createElement("label", null,
|
|
1517
|
-
style: {
|
|
1518
|
-
width: 80
|
|
1519
|
-
}
|
|
1520
|
-
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1504
|
+
}, /*#__PURE__*/React__default['default'].createElement("label", null, "\u5408\u8BA1")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1521
1505
|
style: {
|
|
1522
|
-
|
|
1506
|
+
width: 119 + 70
|
|
1523
1507
|
}
|
|
1524
|
-
}, /*#__PURE__*/React__default['default'].createElement("label", null,
|
|
1508
|
+
}, /*#__PURE__*/React__default['default'].createElement("label", null, parseFloat(isTaxIncluded ? lineAmountIncludeTax : lineAmountExcludeTax).toFixed(2))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1525
1509
|
style: {
|
|
1526
|
-
width:
|
|
1510
|
+
width: 119 + 50 + 1
|
|
1527
1511
|
}
|
|
1528
|
-
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1512
|
+
}, /*#__PURE__*/React__default['default'].createElement("label", null, parseFloat(taxAmount).toFixed(2)))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1529
1513
|
className: "kts-invoice-operate-goods-list-statistics-row"
|
|
1530
1514
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1531
1515
|
style: {
|
|
1532
|
-
width:
|
|
1516
|
+
width: 45
|
|
1533
1517
|
}
|
|
1534
1518
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1535
1519
|
style: {
|
|
@@ -1548,7 +1532,7 @@ var Statistics = (function () {
|
|
|
1548
1532
|
flex: 3,
|
|
1549
1533
|
border: 'none'
|
|
1550
1534
|
}
|
|
1551
|
-
}, /*#__PURE__*/React__default['default'].createElement("label", null, lineAmountIncludeTax))));
|
|
1535
|
+
}, /*#__PURE__*/React__default['default'].createElement("label", null, parseFloat(lineAmountIncludeTax).toFixed()))));
|
|
1552
1536
|
});
|
|
1553
1537
|
|
|
1554
1538
|
var AddRowButton = (function () {
|
|
@@ -2383,26 +2367,8 @@ var useAddDiscount = (function (goods) {
|
|
|
2383
2367
|
}, [onClick, goods.lineAttribute]);
|
|
2384
2368
|
});
|
|
2385
2369
|
|
|
2386
|
-
/** 延迟函数 */
|
|
2387
|
-
|
|
2388
|
-
var lazyFn$1 = function lazyFn(fn) {
|
|
2389
|
-
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
2390
|
-
var timer;
|
|
2391
|
-
return function () {
|
|
2392
|
-
for (var _len = arguments.length, par = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2393
|
-
par[_key] = arguments[_key];
|
|
2394
|
-
}
|
|
2395
|
-
|
|
2396
|
-
if (timer) return;
|
|
2397
|
-
timer = setTimeout(function () {
|
|
2398
|
-
timer = undefined;
|
|
2399
|
-
fn.apply(null, par);
|
|
2400
|
-
}, delayed);
|
|
2401
|
-
};
|
|
2402
|
-
};
|
|
2403
2370
|
/** 格式化 保留2位小数 */
|
|
2404
2371
|
|
|
2405
|
-
|
|
2406
2372
|
var format2 = function format2(value) {
|
|
2407
2373
|
if (value === Infinity) return '';
|
|
2408
2374
|
if ("".concat(value) === 'NaN') return '';
|
|
@@ -2417,9 +2383,36 @@ var format15 = function format15(value) {
|
|
|
2417
2383
|
if (typeof value === 'string') value = parseFloat(value);
|
|
2418
2384
|
var fractionDigits = 15 - value.toString().indexOf('.');
|
|
2419
2385
|
return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
|
|
2386
|
+
}; // 数量 + 单价(含税) => 金额(含税)
|
|
2387
|
+
|
|
2388
|
+
function quantityPriceIncludeTax(quantity, priceIncludeTax) {
|
|
2389
|
+
if (!quantity && quantity !== 0) return undefined;
|
|
2390
|
+
if (!priceIncludeTax && priceIncludeTax !== 0) return undefined;
|
|
2391
|
+
quantity = format15(quantity);
|
|
2392
|
+
priceIncludeTax = format15(priceIncludeTax);
|
|
2393
|
+
return evaluate("".concat(priceIncludeTax, " * ").concat(quantity));
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
/** 延迟函数 */
|
|
2397
|
+
|
|
2398
|
+
var lazyFn$1 = function lazyFn(fn) {
|
|
2399
|
+
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
2400
|
+
var timer;
|
|
2401
|
+
return function () {
|
|
2402
|
+
for (var _len = arguments.length, par = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2403
|
+
par[_key] = arguments[_key];
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
if (timer) return;
|
|
2407
|
+
timer = setTimeout(function () {
|
|
2408
|
+
timer = undefined;
|
|
2409
|
+
fn.apply(null, par);
|
|
2410
|
+
}, delayed);
|
|
2411
|
+
};
|
|
2420
2412
|
};
|
|
2421
2413
|
/** 数量改变了 */
|
|
2422
2414
|
|
|
2415
|
+
|
|
2423
2416
|
var onChangeQuantity = lazyFn$1(function (controller, form, record) {
|
|
2424
2417
|
form.validateFields( /*#__PURE__*/function () {
|
|
2425
2418
|
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(err, values) {
|
|
@@ -3715,7 +3708,7 @@ var useColumns = (function (form) {
|
|
|
3715
3708
|
style: {
|
|
3716
3709
|
padding: '0 10px'
|
|
3717
3710
|
}
|
|
3718
|
-
}, value);
|
|
3711
|
+
}, parseFloat(value).toFixed(2));
|
|
3719
3712
|
}
|
|
3720
3713
|
}
|
|
3721
3714
|
}, {
|
|
@@ -3752,7 +3745,7 @@ var useColumns = (function (form) {
|
|
|
3752
3745
|
style: {
|
|
3753
3746
|
padding: '0 10px'
|
|
3754
3747
|
}
|
|
3755
|
-
}, value);
|
|
3748
|
+
}, parseFloat(value).toFixed(2));
|
|
3756
3749
|
}
|
|
3757
3750
|
}
|
|
3758
3751
|
}, {
|
|
@@ -3816,7 +3809,7 @@ var useColumns = (function (form) {
|
|
|
3816
3809
|
style: {
|
|
3817
3810
|
padding: '0 10px'
|
|
3818
3811
|
}
|
|
3819
|
-
}, value);
|
|
3812
|
+
}, parseFloat(value).toFixed(2));
|
|
3820
3813
|
}
|
|
3821
3814
|
}
|
|
3822
3815
|
}, {
|
|
@@ -4340,7 +4333,9 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
4340
4333
|
|
|
4341
4334
|
React__default['default'].useEffect(function () {
|
|
4342
4335
|
var click = function click() {
|
|
4343
|
-
|
|
4336
|
+
setTimeout(function () {
|
|
4337
|
+
controller.saveEditGood();
|
|
4338
|
+
});
|
|
4344
4339
|
};
|
|
4345
4340
|
|
|
4346
4341
|
window.addEventListener('click', click);
|
|
@@ -4975,43 +4970,44 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
4975
4970
|
while (1) {
|
|
4976
4971
|
switch (_context2.prev = _context2.next) {
|
|
4977
4972
|
case 0:
|
|
4973
|
+
debugger;
|
|
4978
4974
|
Object.keys(record).filter(function (e) {
|
|
4979
4975
|
return !record[e] && record[e] !== 0;
|
|
4980
4976
|
}).forEach(function (e) {
|
|
4981
4977
|
delete record[e];
|
|
4982
4978
|
});
|
|
4983
|
-
_context2.next =
|
|
4979
|
+
_context2.next = 4;
|
|
4984
4980
|
return s.goodsListState.importGoods.verifyFn(record);
|
|
4985
4981
|
|
|
4986
|
-
case
|
|
4982
|
+
case 4:
|
|
4987
4983
|
_context2.t0 = _context2.sent;
|
|
4988
4984
|
|
|
4989
4985
|
if (!(_context2.t0 === false)) {
|
|
4990
|
-
_context2.next =
|
|
4986
|
+
_context2.next = 7;
|
|
4991
4987
|
break;
|
|
4992
4988
|
}
|
|
4993
4989
|
|
|
4994
4990
|
return _context2.abrupt("return");
|
|
4995
4991
|
|
|
4996
|
-
case
|
|
4992
|
+
case 7:
|
|
4997
4993
|
if (!(!s.goodsListState.editGood || !s.goodsListState.form)) {
|
|
4998
|
-
_context2.next =
|
|
4994
|
+
_context2.next = 9;
|
|
4999
4995
|
break;
|
|
5000
4996
|
}
|
|
5001
4997
|
|
|
5002
4998
|
return _context2.abrupt("return");
|
|
5003
4999
|
|
|
5004
|
-
case
|
|
5000
|
+
case 9:
|
|
5005
5001
|
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
|
|
5006
5002
|
|
|
5007
5003
|
if (s.goodsListState.editGood) {
|
|
5008
|
-
_context2.next =
|
|
5004
|
+
_context2.next = 12;
|
|
5009
5005
|
break;
|
|
5010
5006
|
}
|
|
5011
5007
|
|
|
5012
5008
|
return _context2.abrupt("return");
|
|
5013
5009
|
|
|
5014
|
-
case
|
|
5010
|
+
case 12:
|
|
5015
5011
|
if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
|
|
5016
5012
|
s.goodsListState.editGood.priceIncludeTax = undefined;
|
|
5017
5013
|
s.goodsListState.editGood.priceExcludeTax = undefined;
|
|
@@ -5019,12 +5015,13 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
5019
5015
|
s.goodsListState.editGood.priceExcludeTax = getPriceExcludeTax(s.goodsListState.editGood, record);
|
|
5020
5016
|
}
|
|
5021
5017
|
|
|
5018
|
+
s.goodsListState.editGood.lineAmountIncludeTax = quantityPriceIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
|
|
5022
5019
|
s.goodsListState.editGood.itemName = getItemName(record);
|
|
5023
5020
|
s.goodsListState.form.setFieldsValue(s.goodsListState.editGood);
|
|
5024
5021
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
5025
5022
|
s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
|
|
5026
5023
|
|
|
5027
|
-
case
|
|
5024
|
+
case 18:
|
|
5028
5025
|
case "end":
|
|
5029
5026
|
return _context2.stop();
|
|
5030
5027
|
}
|