kts-component-invoice-operate 3.0.9 → 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/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;
|
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;
|
package/package.json
CHANGED
|
@@ -16,7 +16,8 @@ export default (goods: IGood) => {
|
|
|
16
16
|
const isAddDiscount = controller.useMemo(s => s.goodsListState.isAddDiscount, [])
|
|
17
17
|
|
|
18
18
|
/** 点击了 添加折扣行 按钮 */
|
|
19
|
-
const onClick = React.useCallback(async
|
|
19
|
+
const onClick = React.useCallback(async e => {
|
|
20
|
+
e.stopPropagation()
|
|
20
21
|
await controller.wait();
|
|
21
22
|
await controller.saveEditGood();
|
|
22
23
|
await controller.run(async s => {
|