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.
@@ -2,6 +2,6 @@ import { IGood } from '../../../../../../../../InvoiceController';
2
2
  declare const _default: (goods: IGood) => {
3
3
  key: string;
4
4
  title: string;
5
- onClick: () => Promise<void>;
5
+ onClick: (e: any) => Promise<void>;
6
6
  } | undefined;
7
7
  export default _default;
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__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2421
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2422
- while (1) {
2423
- switch (_context2.prev = _context2.next) {
2424
- case 0:
2425
- _context2.next = 2;
2426
- return controller.wait();
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
- case 2:
2429
- _context2.next = 4;
2430
- return controller.saveEditGood();
2430
+ case 3:
2431
+ _context2.next = 5;
2432
+ return controller.saveEditGood();
2431
2433
 
2432
- case 4:
2433
- _context2.next = 6;
2434
- return controller.run( /*#__PURE__*/function () {
2435
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2436
- var err, key;
2437
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2438
- while (1) {
2439
- switch (_context.prev = _context.next) {
2440
- case 0:
2441
- if (!s.goodsListState.form) {
2442
- _context.next = 11;
2443
- break;
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
- err = s.goodsListState.form.getFieldsError();
2447
- _context.t0 = _regeneratorRuntime().keys(err);
2448
+ err = s.goodsListState.form.getFieldsError();
2449
+ _context.t0 = _regeneratorRuntime().keys(err);
2448
2450
 
2449
- case 3:
2450
- if ((_context.t1 = _context.t0()).done) {
2451
- _context.next = 11;
2452
- break;
2453
- }
2451
+ case 3:
2452
+ if ((_context.t1 = _context.t0()).done) {
2453
+ _context.next = 11;
2454
+ break;
2455
+ }
2454
2456
 
2455
- key = _context.t1.value;
2457
+ key = _context.t1.value;
2456
2458
 
2457
- if (err[key]) {
2458
- _context.next = 7;
2459
- break;
2460
- }
2459
+ if (err[key]) {
2460
+ _context.next = 7;
2461
+ break;
2462
+ }
2461
2463
 
2462
- return _context.abrupt("continue", 3);
2464
+ return _context.abrupt("continue", 3);
2463
2465
 
2464
- case 7:
2465
- message.error(err[key][0]);
2466
- return _context.abrupt("return");
2466
+ case 7:
2467
+ message.error(err[key][0]);
2468
+ return _context.abrupt("return");
2467
2469
 
2468
- case 11:
2469
- goods = s.goodsListState.goodsMap.get(goods.$index);
2470
+ case 11:
2471
+ goods = s.goodsListState.goodsMap.get(goods.$index);
2470
2472
 
2471
- if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
2472
- _context.next = 15;
2473
- break;
2474
- }
2473
+ if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
2474
+ _context.next = 15;
2475
+ break;
2476
+ }
2475
2477
 
2476
- message.error({
2477
- content: '零税率需要设置免税类型,请在赋码中设置!',
2478
- key: '零税率需要设置免税类型,请在赋码中设置!'
2479
- });
2480
- return _context.abrupt("return");
2478
+ message.error({
2479
+ content: '零税率需要设置免税类型,请在赋码中设置!',
2480
+ key: '零税率需要设置免税类型,请在赋码中设置!'
2481
+ });
2482
+ return _context.abrupt("return");
2481
2483
 
2482
- case 15:
2483
- if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
2484
- _context.next = 18;
2485
- break;
2486
- }
2484
+ case 15:
2485
+ if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
2486
+ _context.next = 18;
2487
+ break;
2488
+ }
2487
2489
 
2488
- message.error({
2489
- content: '金额为0不能添加折扣行',
2490
- key: '金额为0不能添加折扣行'
2491
- });
2492
- return _context.abrupt("return");
2490
+ message.error({
2491
+ content: '金额为0不能添加折扣行',
2492
+ key: '金额为0不能添加折扣行'
2493
+ });
2494
+ return _context.abrupt("return");
2493
2495
 
2494
- case 18:
2495
- s.goodsListState.discountGoodIndex = [goods.$index];
2496
+ case 18:
2497
+ s.goodsListState.discountGoodIndex = [goods.$index];
2496
2498
 
2497
- case 19:
2498
- case "end":
2499
- return _context.stop();
2499
+ case 19:
2500
+ case "end":
2501
+ return _context.stop();
2502
+ }
2500
2503
  }
2501
- }
2502
- }, _callee);
2503
- }));
2504
+ }, _callee);
2505
+ }));
2504
2506
 
2505
- return function (_x) {
2506
- return _ref2.apply(this, arguments);
2507
- };
2508
- }());
2507
+ return function (_x2) {
2508
+ return _ref2.apply(this, arguments);
2509
+ };
2510
+ }());
2509
2511
 
2510
- case 6:
2511
- case "end":
2512
- return _context2.stop();
2512
+ case 7:
2513
+ case "end":
2514
+ return _context2.stop();
2515
+ }
2513
2516
  }
2514
- }
2515
- }, _callee2);
2516
- })), [controller, goods.$index]);
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 = 16;
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 14:
10468
- _context2.next = 18;
10478
+ case 16:
10479
+ _context2.next = 20;
10469
10480
  break;
10470
10481
 
10471
- case 16:
10472
- _context2.next = 18;
10482
+ case 18:
10483
+ _context2.next = 20;
10473
10484
  return controller.setEditGood(record);
10474
10485
 
10475
- case 18:
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__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2431
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2432
- while (1) {
2433
- switch (_context2.prev = _context2.next) {
2434
- case 0:
2435
- _context2.next = 2;
2436
- return controller.wait();
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
- case 2:
2439
- _context2.next = 4;
2440
- return controller.saveEditGood();
2440
+ case 3:
2441
+ _context2.next = 5;
2442
+ return controller.saveEditGood();
2441
2443
 
2442
- case 4:
2443
- _context2.next = 6;
2444
- return controller.run( /*#__PURE__*/function () {
2445
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2446
- var err, key;
2447
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2448
- while (1) {
2449
- switch (_context.prev = _context.next) {
2450
- case 0:
2451
- if (!s.goodsListState.form) {
2452
- _context.next = 11;
2453
- break;
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
- err = s.goodsListState.form.getFieldsError();
2457
- _context.t0 = _regeneratorRuntime().keys(err);
2458
+ err = s.goodsListState.form.getFieldsError();
2459
+ _context.t0 = _regeneratorRuntime().keys(err);
2458
2460
 
2459
- case 3:
2460
- if ((_context.t1 = _context.t0()).done) {
2461
- _context.next = 11;
2462
- break;
2463
- }
2461
+ case 3:
2462
+ if ((_context.t1 = _context.t0()).done) {
2463
+ _context.next = 11;
2464
+ break;
2465
+ }
2464
2466
 
2465
- key = _context.t1.value;
2467
+ key = _context.t1.value;
2466
2468
 
2467
- if (err[key]) {
2468
- _context.next = 7;
2469
- break;
2470
- }
2469
+ if (err[key]) {
2470
+ _context.next = 7;
2471
+ break;
2472
+ }
2471
2473
 
2472
- return _context.abrupt("continue", 3);
2474
+ return _context.abrupt("continue", 3);
2473
2475
 
2474
- case 7:
2475
- ktsComponentsAntdX3.message.error(err[key][0]);
2476
- return _context.abrupt("return");
2476
+ case 7:
2477
+ ktsComponentsAntdX3.message.error(err[key][0]);
2478
+ return _context.abrupt("return");
2477
2479
 
2478
- case 11:
2479
- goods = s.goodsListState.goodsMap.get(goods.$index);
2480
+ case 11:
2481
+ goods = s.goodsListState.goodsMap.get(goods.$index);
2480
2482
 
2481
- if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
2482
- _context.next = 15;
2483
- break;
2484
- }
2483
+ if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
2484
+ _context.next = 15;
2485
+ break;
2486
+ }
2485
2487
 
2486
- ktsComponentsAntdX3.message.error({
2487
- content: '零税率需要设置免税类型,请在赋码中设置!',
2488
- key: '零税率需要设置免税类型,请在赋码中设置!'
2489
- });
2490
- return _context.abrupt("return");
2488
+ ktsComponentsAntdX3.message.error({
2489
+ content: '零税率需要设置免税类型,请在赋码中设置!',
2490
+ key: '零税率需要设置免税类型,请在赋码中设置!'
2491
+ });
2492
+ return _context.abrupt("return");
2491
2493
 
2492
- case 15:
2493
- if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
2494
- _context.next = 18;
2495
- break;
2496
- }
2494
+ case 15:
2495
+ if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
2496
+ _context.next = 18;
2497
+ break;
2498
+ }
2497
2499
 
2498
- ktsComponentsAntdX3.message.error({
2499
- content: '金额为0不能添加折扣行',
2500
- key: '金额为0不能添加折扣行'
2501
- });
2502
- return _context.abrupt("return");
2500
+ ktsComponentsAntdX3.message.error({
2501
+ content: '金额为0不能添加折扣行',
2502
+ key: '金额为0不能添加折扣行'
2503
+ });
2504
+ return _context.abrupt("return");
2503
2505
 
2504
- case 18:
2505
- s.goodsListState.discountGoodIndex = [goods.$index];
2506
+ case 18:
2507
+ s.goodsListState.discountGoodIndex = [goods.$index];
2506
2508
 
2507
- case 19:
2508
- case "end":
2509
- return _context.stop();
2509
+ case 19:
2510
+ case "end":
2511
+ return _context.stop();
2512
+ }
2510
2513
  }
2511
- }
2512
- }, _callee);
2513
- }));
2514
+ }, _callee);
2515
+ }));
2514
2516
 
2515
- return function (_x) {
2516
- return _ref2.apply(this, arguments);
2517
- };
2518
- }());
2517
+ return function (_x2) {
2518
+ return _ref2.apply(this, arguments);
2519
+ };
2520
+ }());
2519
2521
 
2520
- case 6:
2521
- case "end":
2522
- return _context2.stop();
2522
+ case 7:
2523
+ case "end":
2524
+ return _context2.stop();
2525
+ }
2523
2526
  }
2524
- }
2525
- }, _callee2);
2526
- })), [controller, goods.$index]);
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 = 16;
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 14:
10478
- _context2.next = 18;
10488
+ case 16:
10489
+ _context2.next = 20;
10479
10490
  break;
10480
10491
 
10481
- case 16:
10482
- _context2.next = 18;
10492
+ case 18:
10493
+ _context2.next = 20;
10483
10494
  return controller.setEditGood(record);
10484
10495
 
10485
- case 18:
10496
+ case 20:
10486
10497
  case "end":
10487
10498
  return _context2.stop();
10488
10499
  }