kts-component-invoice-operate 3.0.8 → 3.0.10
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/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +1 -1
- package/dist/index.esm.js +95 -84
- package/dist/index.js +95 -84
- package/docs-dist/umi.css +19 -19
- package/package.json +1 -1
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +2 -1
- package/src/Invoice/ui/GoodsList/hook/useOnRow/index.tsx +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -2417,103 +2417,110 @@ var useAddDiscount = (function (goods) {
|
|
|
2417
2417
|
}, []);
|
|
2418
2418
|
/** 点击了 添加折扣行 按钮 */
|
|
2419
2419
|
|
|
2420
|
-
var onClick = React.useCallback( /*#__PURE__*/
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2420
|
+
var onClick = React.useCallback( /*#__PURE__*/function () {
|
|
2421
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
2422
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2423
|
+
while (1) {
|
|
2424
|
+
switch (_context2.prev = _context2.next) {
|
|
2425
|
+
case 0:
|
|
2426
|
+
e.stopPropagation();
|
|
2427
|
+
_context2.next = 3;
|
|
2428
|
+
return controller.wait();
|
|
2427
2429
|
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2430
|
+
case 3:
|
|
2431
|
+
_context2.next = 5;
|
|
2432
|
+
return controller.saveEditGood();
|
|
2431
2433
|
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2434
|
+
case 5:
|
|
2435
|
+
_context2.next = 7;
|
|
2436
|
+
return controller.run( /*#__PURE__*/function () {
|
|
2437
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2438
|
+
var err, key;
|
|
2439
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2440
|
+
while (1) {
|
|
2441
|
+
switch (_context.prev = _context.next) {
|
|
2442
|
+
case 0:
|
|
2443
|
+
if (!s.goodsListState.form) {
|
|
2444
|
+
_context.next = 11;
|
|
2445
|
+
break;
|
|
2446
|
+
}
|
|
2445
2447
|
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
+
err = s.goodsListState.form.getFieldsError();
|
|
2449
|
+
_context.t0 = _regeneratorRuntime().keys(err);
|
|
2448
2450
|
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2451
|
+
case 3:
|
|
2452
|
+
if ((_context.t1 = _context.t0()).done) {
|
|
2453
|
+
_context.next = 11;
|
|
2454
|
+
break;
|
|
2455
|
+
}
|
|
2454
2456
|
|
|
2455
|
-
|
|
2457
|
+
key = _context.t1.value;
|
|
2456
2458
|
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2459
|
+
if (err[key]) {
|
|
2460
|
+
_context.next = 7;
|
|
2461
|
+
break;
|
|
2462
|
+
}
|
|
2461
2463
|
|
|
2462
|
-
|
|
2464
|
+
return _context.abrupt("continue", 3);
|
|
2463
2465
|
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2466
|
+
case 7:
|
|
2467
|
+
message.error(err[key][0]);
|
|
2468
|
+
return _context.abrupt("return");
|
|
2467
2469
|
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
+
case 11:
|
|
2471
|
+
goods = s.goodsListState.goodsMap.get(goods.$index);
|
|
2470
2472
|
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2473
|
+
if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
|
|
2474
|
+
_context.next = 15;
|
|
2475
|
+
break;
|
|
2476
|
+
}
|
|
2475
2477
|
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2478
|
+
message.error({
|
|
2479
|
+
content: '零税率需要设置免税类型,请在赋码中设置!',
|
|
2480
|
+
key: '零税率需要设置免税类型,请在赋码中设置!'
|
|
2481
|
+
});
|
|
2482
|
+
return _context.abrupt("return");
|
|
2481
2483
|
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2484
|
+
case 15:
|
|
2485
|
+
if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
|
|
2486
|
+
_context.next = 18;
|
|
2487
|
+
break;
|
|
2488
|
+
}
|
|
2487
2489
|
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2490
|
+
message.error({
|
|
2491
|
+
content: '金额为0不能添加折扣行',
|
|
2492
|
+
key: '金额为0不能添加折扣行'
|
|
2493
|
+
});
|
|
2494
|
+
return _context.abrupt("return");
|
|
2493
2495
|
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
+
case 18:
|
|
2497
|
+
s.goodsListState.discountGoodIndex = [goods.$index];
|
|
2496
2498
|
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2499
|
+
case 19:
|
|
2500
|
+
case "end":
|
|
2501
|
+
return _context.stop();
|
|
2502
|
+
}
|
|
2500
2503
|
}
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
}));
|
|
2504
|
+
}, _callee);
|
|
2505
|
+
}));
|
|
2504
2506
|
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2507
|
+
return function (_x2) {
|
|
2508
|
+
return _ref2.apply(this, arguments);
|
|
2509
|
+
};
|
|
2510
|
+
}());
|
|
2509
2511
|
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2512
|
+
case 7:
|
|
2513
|
+
case "end":
|
|
2514
|
+
return _context2.stop();
|
|
2515
|
+
}
|
|
2513
2516
|
}
|
|
2514
|
-
}
|
|
2515
|
-
}
|
|
2516
|
-
|
|
2517
|
+
}, _callee2);
|
|
2518
|
+
}));
|
|
2519
|
+
|
|
2520
|
+
return function (_x) {
|
|
2521
|
+
return _ref.apply(this, arguments);
|
|
2522
|
+
};
|
|
2523
|
+
}(), [controller, goods.$index]);
|
|
2517
2524
|
|
|
2518
2525
|
if (goods.lineAttribute !== LineAttributeType$1.正常) {
|
|
2519
2526
|
return undefined;
|
|
@@ -10418,7 +10425,7 @@ var useOnRow = (function () {
|
|
|
10418
10425
|
|
|
10419
10426
|
case 7:
|
|
10420
10427
|
if (!editGood) {
|
|
10421
|
-
_context2.next =
|
|
10428
|
+
_context2.next = 18;
|
|
10422
10429
|
break;
|
|
10423
10430
|
}
|
|
10424
10431
|
|
|
@@ -10435,6 +10442,10 @@ var useOnRow = (function () {
|
|
|
10435
10442
|
|
|
10436
10443
|
case 12:
|
|
10437
10444
|
_context2.next = 14;
|
|
10445
|
+
return controller.wait();
|
|
10446
|
+
|
|
10447
|
+
case 14:
|
|
10448
|
+
_context2.next = 16;
|
|
10438
10449
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
10439
10450
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10440
10451
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -10464,15 +10475,15 @@ var useOnRow = (function () {
|
|
|
10464
10475
|
};
|
|
10465
10476
|
}())();
|
|
10466
10477
|
|
|
10467
|
-
case
|
|
10468
|
-
_context2.next =
|
|
10478
|
+
case 16:
|
|
10479
|
+
_context2.next = 20;
|
|
10469
10480
|
break;
|
|
10470
10481
|
|
|
10471
|
-
case
|
|
10472
|
-
_context2.next =
|
|
10482
|
+
case 18:
|
|
10483
|
+
_context2.next = 20;
|
|
10473
10484
|
return controller.setEditGood(record);
|
|
10474
10485
|
|
|
10475
|
-
case
|
|
10486
|
+
case 20:
|
|
10476
10487
|
case "end":
|
|
10477
10488
|
return _context2.stop();
|
|
10478
10489
|
}
|
package/dist/index.js
CHANGED
|
@@ -2427,103 +2427,110 @@ var useAddDiscount = (function (goods) {
|
|
|
2427
2427
|
}, []);
|
|
2428
2428
|
/** 点击了 添加折扣行 按钮 */
|
|
2429
2429
|
|
|
2430
|
-
var onClick = React__default['default'].useCallback( /*#__PURE__*/
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2430
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/function () {
|
|
2431
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
2432
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2433
|
+
while (1) {
|
|
2434
|
+
switch (_context2.prev = _context2.next) {
|
|
2435
|
+
case 0:
|
|
2436
|
+
e.stopPropagation();
|
|
2437
|
+
_context2.next = 3;
|
|
2438
|
+
return controller.wait();
|
|
2437
2439
|
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2440
|
+
case 3:
|
|
2441
|
+
_context2.next = 5;
|
|
2442
|
+
return controller.saveEditGood();
|
|
2441
2443
|
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2444
|
+
case 5:
|
|
2445
|
+
_context2.next = 7;
|
|
2446
|
+
return controller.run( /*#__PURE__*/function () {
|
|
2447
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2448
|
+
var err, key;
|
|
2449
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2450
|
+
while (1) {
|
|
2451
|
+
switch (_context.prev = _context.next) {
|
|
2452
|
+
case 0:
|
|
2453
|
+
if (!s.goodsListState.form) {
|
|
2454
|
+
_context.next = 11;
|
|
2455
|
+
break;
|
|
2456
|
+
}
|
|
2455
2457
|
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
+
err = s.goodsListState.form.getFieldsError();
|
|
2459
|
+
_context.t0 = _regeneratorRuntime().keys(err);
|
|
2458
2460
|
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2461
|
+
case 3:
|
|
2462
|
+
if ((_context.t1 = _context.t0()).done) {
|
|
2463
|
+
_context.next = 11;
|
|
2464
|
+
break;
|
|
2465
|
+
}
|
|
2464
2466
|
|
|
2465
|
-
|
|
2467
|
+
key = _context.t1.value;
|
|
2466
2468
|
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2469
|
+
if (err[key]) {
|
|
2470
|
+
_context.next = 7;
|
|
2471
|
+
break;
|
|
2472
|
+
}
|
|
2471
2473
|
|
|
2472
|
-
|
|
2474
|
+
return _context.abrupt("continue", 3);
|
|
2473
2475
|
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2476
|
+
case 7:
|
|
2477
|
+
ktsComponentsAntdX3.message.error(err[key][0]);
|
|
2478
|
+
return _context.abrupt("return");
|
|
2477
2479
|
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
+
case 11:
|
|
2481
|
+
goods = s.goodsListState.goodsMap.get(goods.$index);
|
|
2480
2482
|
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2483
|
+
if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
|
|
2484
|
+
_context.next = 15;
|
|
2485
|
+
break;
|
|
2486
|
+
}
|
|
2485
2487
|
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2488
|
+
ktsComponentsAntdX3.message.error({
|
|
2489
|
+
content: '零税率需要设置免税类型,请在赋码中设置!',
|
|
2490
|
+
key: '零税率需要设置免税类型,请在赋码中设置!'
|
|
2491
|
+
});
|
|
2492
|
+
return _context.abrupt("return");
|
|
2491
2493
|
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2494
|
+
case 15:
|
|
2495
|
+
if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
|
|
2496
|
+
_context.next = 18;
|
|
2497
|
+
break;
|
|
2498
|
+
}
|
|
2497
2499
|
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2500
|
+
ktsComponentsAntdX3.message.error({
|
|
2501
|
+
content: '金额为0不能添加折扣行',
|
|
2502
|
+
key: '金额为0不能添加折扣行'
|
|
2503
|
+
});
|
|
2504
|
+
return _context.abrupt("return");
|
|
2503
2505
|
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
+
case 18:
|
|
2507
|
+
s.goodsListState.discountGoodIndex = [goods.$index];
|
|
2506
2508
|
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2509
|
+
case 19:
|
|
2510
|
+
case "end":
|
|
2511
|
+
return _context.stop();
|
|
2512
|
+
}
|
|
2510
2513
|
}
|
|
2511
|
-
}
|
|
2512
|
-
}
|
|
2513
|
-
}));
|
|
2514
|
+
}, _callee);
|
|
2515
|
+
}));
|
|
2514
2516
|
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2517
|
+
return function (_x2) {
|
|
2518
|
+
return _ref2.apply(this, arguments);
|
|
2519
|
+
};
|
|
2520
|
+
}());
|
|
2519
2521
|
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2522
|
+
case 7:
|
|
2523
|
+
case "end":
|
|
2524
|
+
return _context2.stop();
|
|
2525
|
+
}
|
|
2523
2526
|
}
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
+
}, _callee2);
|
|
2528
|
+
}));
|
|
2529
|
+
|
|
2530
|
+
return function (_x) {
|
|
2531
|
+
return _ref.apply(this, arguments);
|
|
2532
|
+
};
|
|
2533
|
+
}(), [controller, goods.$index]);
|
|
2527
2534
|
|
|
2528
2535
|
if (goods.lineAttribute !== LineAttributeType$1.正常) {
|
|
2529
2536
|
return undefined;
|
|
@@ -10428,7 +10435,7 @@ var useOnRow = (function () {
|
|
|
10428
10435
|
|
|
10429
10436
|
case 7:
|
|
10430
10437
|
if (!editGood) {
|
|
10431
|
-
_context2.next =
|
|
10438
|
+
_context2.next = 18;
|
|
10432
10439
|
break;
|
|
10433
10440
|
}
|
|
10434
10441
|
|
|
@@ -10445,6 +10452,10 @@ var useOnRow = (function () {
|
|
|
10445
10452
|
|
|
10446
10453
|
case 12:
|
|
10447
10454
|
_context2.next = 14;
|
|
10455
|
+
return controller.wait();
|
|
10456
|
+
|
|
10457
|
+
case 14:
|
|
10458
|
+
_context2.next = 16;
|
|
10448
10459
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
10449
10460
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10450
10461
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -10474,15 +10485,15 @@ var useOnRow = (function () {
|
|
|
10474
10485
|
};
|
|
10475
10486
|
}())();
|
|
10476
10487
|
|
|
10477
|
-
case
|
|
10478
|
-
_context2.next =
|
|
10488
|
+
case 16:
|
|
10489
|
+
_context2.next = 20;
|
|
10479
10490
|
break;
|
|
10480
10491
|
|
|
10481
|
-
case
|
|
10482
|
-
_context2.next =
|
|
10492
|
+
case 18:
|
|
10493
|
+
_context2.next = 20;
|
|
10483
10494
|
return controller.setEditGood(record);
|
|
10484
10495
|
|
|
10485
|
-
case
|
|
10496
|
+
case 20:
|
|
10486
10497
|
case "end":
|
|
10487
10498
|
return _context2.stop();
|
|
10488
10499
|
}
|