kts-component-invoice-operate 3.2.129 → 3.2.130-1

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
@@ -916,9 +916,12 @@ var ImportGoods = /*#__PURE__*/_createClass(function ImportGoods() {
916
916
  dataIndex: 'unit',
917
917
  key: 'unit'
918
918
  }, {
919
- title: '税率(%)',
919
+ title: '税率',
920
920
  dataIndex: 'taxRate',
921
- key: 'taxRate'
921
+ key: 'taxRate',
922
+ render: function render(text) {
923
+ return text || text === 0 ? "".concat(text, "%") : '';
924
+ }
922
925
  }, {
923
926
  title: '单价(含税)',
924
927
  dataIndex: 'priceIncludeTax',
@@ -13757,7 +13760,7 @@ var useColumns = (function (form) {
13757
13760
  }, {
13758
13761
  title: /*#__PURE__*/React.createElement(TitleText, {
13759
13762
  required: true
13760
- }, "\u7A0E\u7387%"),
13763
+ }, "\u7A0E\u7387"),
13761
13764
  dataIndex: 'taxRate',
13762
13765
  key: 'taxRate',
13763
13766
  align: 'right',
@@ -15603,52 +15606,68 @@ function useSalesGifts() {
15603
15606
  while (1) {
15604
15607
  switch (_context.prev = _context.next) {
15605
15608
  case 0:
15609
+ _context.next = 2;
15610
+ return controller.saveEditGood();
15611
+
15612
+ case 2:
15613
+ _context.next = 4;
15614
+ return controller.wait();
15615
+
15616
+ case 4:
15617
+ if (!controller.state.goodsListState.editGood) {
15618
+ _context.next = 6;
15619
+ break;
15620
+ }
15621
+
15622
+ return _context.abrupt("return");
15623
+
15624
+ case 6:
15606
15625
  _iterator = _createForOfIteratorHelper(giveaways);
15607
- _context.prev = 1;
15626
+ _context.prev = 7;
15608
15627
 
15609
15628
  _iterator.s();
15610
15629
 
15611
- case 3:
15630
+ case 9:
15612
15631
  if ((_step = _iterator.n()).done) {
15613
- _context.next = 10;
15632
+ _context.next = 16;
15614
15633
  break;
15615
15634
  }
15616
15635
 
15617
15636
  g = _step.value;
15618
15637
  g.lineAttribute = LineAttributeType$1.正常;
15619
- _context.next = 8;
15638
+ _context.next = 14;
15620
15639
  return controller.addGoodDiscountV2([{
15621
15640
  $index: g.$index,
15622
15641
  discolineAmountunt: g.lineAmountIncludeTax || 0
15623
15642
  }]);
15624
15643
 
15625
- case 8:
15626
- _context.next = 3;
15644
+ case 14:
15645
+ _context.next = 9;
15627
15646
  break;
15628
15647
 
15629
- case 10:
15630
- _context.next = 15;
15648
+ case 16:
15649
+ _context.next = 21;
15631
15650
  break;
15632
15651
 
15633
- case 12:
15634
- _context.prev = 12;
15635
- _context.t0 = _context["catch"](1);
15652
+ case 18:
15653
+ _context.prev = 18;
15654
+ _context.t0 = _context["catch"](7);
15636
15655
 
15637
15656
  _iterator.e(_context.t0);
15638
15657
 
15639
- case 15:
15640
- _context.prev = 15;
15658
+ case 21:
15659
+ _context.prev = 21;
15641
15660
 
15642
15661
  _iterator.f();
15643
15662
 
15644
- return _context.finish(15);
15663
+ return _context.finish(21);
15645
15664
 
15646
- case 18:
15665
+ case 24:
15647
15666
  case "end":
15648
15667
  return _context.stop();
15649
15668
  }
15650
15669
  }
15651
- }, _callee, null, [[1, 12, 15, 18]]);
15670
+ }, _callee, null, [[7, 18, 21, 24]]);
15652
15671
  })), [controller, giveaways]);
15653
15672
  var onClickManual = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
15654
15673
  var _controller$state$goo, goodsMap, _selectedGoodIndex, _giveaways, _iterator2, _step2, g;
@@ -15658,70 +15677,86 @@ function useSalesGifts() {
15658
15677
  switch (_context2.prev = _context2.next) {
15659
15678
  case 0:
15660
15679
  _context2.prev = 0;
15680
+ _context2.next = 3;
15681
+ return controller.saveEditGood();
15682
+
15683
+ case 3:
15684
+ _context2.next = 5;
15685
+ return controller.wait();
15686
+
15687
+ case 5:
15688
+ if (!controller.state.goodsListState.editGood) {
15689
+ _context2.next = 7;
15690
+ break;
15691
+ }
15692
+
15693
+ return _context2.abrupt("return");
15694
+
15695
+ case 7:
15661
15696
  _controller$state$goo = controller.state.goodsListState, goodsMap = _controller$state$goo.goodsMap, _selectedGoodIndex = _controller$state$goo.selectedGoodIndex;
15662
15697
  _giveaways = _selectedGoodIndex.map(function (e) {
15663
15698
  return goodsMap.get(e);
15664
15699
  }).filter(function (e) {
15665
15700
  return !!e;
15666
15701
  });
15667
- _context2.next = 5;
15702
+ _context2.next = 11;
15668
15703
  return checkLineAttribute(_giveaways);
15669
15704
 
15670
- case 5:
15705
+ case 11:
15671
15706
  _iterator2 = _createForOfIteratorHelper(_giveaways);
15672
- _context2.prev = 6;
15707
+ _context2.prev = 12;
15673
15708
 
15674
15709
  _iterator2.s();
15675
15710
 
15676
- case 8:
15711
+ case 14:
15677
15712
  if ((_step2 = _iterator2.n()).done) {
15678
- _context2.next = 14;
15713
+ _context2.next = 20;
15679
15714
  break;
15680
15715
  }
15681
15716
 
15682
15717
  g = _step2.value;
15683
- _context2.next = 12;
15718
+ _context2.next = 18;
15684
15719
  return controller.addGoodDiscountV2([{
15685
15720
  $index: g.$index,
15686
15721
  discolineAmountunt: g.lineAmountIncludeTax || 0
15687
15722
  }]);
15688
15723
 
15689
- case 12:
15690
- _context2.next = 8;
15724
+ case 18:
15725
+ _context2.next = 14;
15691
15726
  break;
15692
15727
 
15693
- case 14:
15694
- _context2.next = 19;
15728
+ case 20:
15729
+ _context2.next = 25;
15695
15730
  break;
15696
15731
 
15697
- case 16:
15698
- _context2.prev = 16;
15699
- _context2.t0 = _context2["catch"](6);
15732
+ case 22:
15733
+ _context2.prev = 22;
15734
+ _context2.t0 = _context2["catch"](12);
15700
15735
 
15701
15736
  _iterator2.e(_context2.t0);
15702
15737
 
15703
- case 19:
15704
- _context2.prev = 19;
15738
+ case 25:
15739
+ _context2.prev = 25;
15705
15740
 
15706
15741
  _iterator2.f();
15707
15742
 
15708
- return _context2.finish(19);
15743
+ return _context2.finish(25);
15709
15744
 
15710
- case 22:
15745
+ case 28:
15711
15746
  controller.state.goodsListState.selectedGoodIndex = [];
15712
- _context2.next = 27;
15747
+ _context2.next = 33;
15713
15748
  break;
15714
15749
 
15715
- case 25:
15716
- _context2.prev = 25;
15750
+ case 31:
15751
+ _context2.prev = 31;
15717
15752
  _context2.t1 = _context2["catch"](0);
15718
15753
 
15719
- case 27:
15754
+ case 33:
15720
15755
  case "end":
15721
15756
  return _context2.stop();
15722
15757
  }
15723
15758
  }
15724
- }, _callee2, null, [[0, 25], [6, 16, 19, 22]]);
15759
+ }, _callee2, null, [[0, 31], [12, 22, 25, 28]]);
15725
15760
  })), [controller]);
15726
15761
  var items = React.useMemo(function () {
15727
15762
  return [{
@@ -20603,7 +20638,7 @@ var useColumns$1 = (function (form) {
20603
20638
  }, {
20604
20639
  title: /*#__PURE__*/React.createElement(TitleText$1, {
20605
20640
  required: true
20606
- }, "\u7A0E\u7387%"),
20641
+ }, "\u7A0E\u7387"),
20607
20642
  dataIndex: 'taxRate',
20608
20643
  key: 'taxRate',
20609
20644
  align: 'right',
package/dist/index.js CHANGED
@@ -926,9 +926,12 @@ var ImportGoods = /*#__PURE__*/_createClass(function ImportGoods() {
926
926
  dataIndex: 'unit',
927
927
  key: 'unit'
928
928
  }, {
929
- title: '税率(%)',
929
+ title: '税率',
930
930
  dataIndex: 'taxRate',
931
- key: 'taxRate'
931
+ key: 'taxRate',
932
+ render: function render(text) {
933
+ return text || text === 0 ? "".concat(text, "%") : '';
934
+ }
932
935
  }, {
933
936
  title: '单价(含税)',
934
937
  dataIndex: 'priceIncludeTax',
@@ -13767,7 +13770,7 @@ var useColumns = (function (form) {
13767
13770
  }, {
13768
13771
  title: /*#__PURE__*/React__default['default'].createElement(TitleText, {
13769
13772
  required: true
13770
- }, "\u7A0E\u7387%"),
13773
+ }, "\u7A0E\u7387"),
13771
13774
  dataIndex: 'taxRate',
13772
13775
  key: 'taxRate',
13773
13776
  align: 'right',
@@ -15613,52 +15616,68 @@ function useSalesGifts() {
15613
15616
  while (1) {
15614
15617
  switch (_context.prev = _context.next) {
15615
15618
  case 0:
15619
+ _context.next = 2;
15620
+ return controller.saveEditGood();
15621
+
15622
+ case 2:
15623
+ _context.next = 4;
15624
+ return controller.wait();
15625
+
15626
+ case 4:
15627
+ if (!controller.state.goodsListState.editGood) {
15628
+ _context.next = 6;
15629
+ break;
15630
+ }
15631
+
15632
+ return _context.abrupt("return");
15633
+
15634
+ case 6:
15616
15635
  _iterator = _createForOfIteratorHelper(giveaways);
15617
- _context.prev = 1;
15636
+ _context.prev = 7;
15618
15637
 
15619
15638
  _iterator.s();
15620
15639
 
15621
- case 3:
15640
+ case 9:
15622
15641
  if ((_step = _iterator.n()).done) {
15623
- _context.next = 10;
15642
+ _context.next = 16;
15624
15643
  break;
15625
15644
  }
15626
15645
 
15627
15646
  g = _step.value;
15628
15647
  g.lineAttribute = LineAttributeType$1.正常;
15629
- _context.next = 8;
15648
+ _context.next = 14;
15630
15649
  return controller.addGoodDiscountV2([{
15631
15650
  $index: g.$index,
15632
15651
  discolineAmountunt: g.lineAmountIncludeTax || 0
15633
15652
  }]);
15634
15653
 
15635
- case 8:
15636
- _context.next = 3;
15654
+ case 14:
15655
+ _context.next = 9;
15637
15656
  break;
15638
15657
 
15639
- case 10:
15640
- _context.next = 15;
15658
+ case 16:
15659
+ _context.next = 21;
15641
15660
  break;
15642
15661
 
15643
- case 12:
15644
- _context.prev = 12;
15645
- _context.t0 = _context["catch"](1);
15662
+ case 18:
15663
+ _context.prev = 18;
15664
+ _context.t0 = _context["catch"](7);
15646
15665
 
15647
15666
  _iterator.e(_context.t0);
15648
15667
 
15649
- case 15:
15650
- _context.prev = 15;
15668
+ case 21:
15669
+ _context.prev = 21;
15651
15670
 
15652
15671
  _iterator.f();
15653
15672
 
15654
- return _context.finish(15);
15673
+ return _context.finish(21);
15655
15674
 
15656
- case 18:
15675
+ case 24:
15657
15676
  case "end":
15658
15677
  return _context.stop();
15659
15678
  }
15660
15679
  }
15661
- }, _callee, null, [[1, 12, 15, 18]]);
15680
+ }, _callee, null, [[7, 18, 21, 24]]);
15662
15681
  })), [controller, giveaways]);
15663
15682
  var onClickManual = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
15664
15683
  var _controller$state$goo, goodsMap, _selectedGoodIndex, _giveaways, _iterator2, _step2, g;
@@ -15668,70 +15687,86 @@ function useSalesGifts() {
15668
15687
  switch (_context2.prev = _context2.next) {
15669
15688
  case 0:
15670
15689
  _context2.prev = 0;
15690
+ _context2.next = 3;
15691
+ return controller.saveEditGood();
15692
+
15693
+ case 3:
15694
+ _context2.next = 5;
15695
+ return controller.wait();
15696
+
15697
+ case 5:
15698
+ if (!controller.state.goodsListState.editGood) {
15699
+ _context2.next = 7;
15700
+ break;
15701
+ }
15702
+
15703
+ return _context2.abrupt("return");
15704
+
15705
+ case 7:
15671
15706
  _controller$state$goo = controller.state.goodsListState, goodsMap = _controller$state$goo.goodsMap, _selectedGoodIndex = _controller$state$goo.selectedGoodIndex;
15672
15707
  _giveaways = _selectedGoodIndex.map(function (e) {
15673
15708
  return goodsMap.get(e);
15674
15709
  }).filter(function (e) {
15675
15710
  return !!e;
15676
15711
  });
15677
- _context2.next = 5;
15712
+ _context2.next = 11;
15678
15713
  return checkLineAttribute(_giveaways);
15679
15714
 
15680
- case 5:
15715
+ case 11:
15681
15716
  _iterator2 = _createForOfIteratorHelper(_giveaways);
15682
- _context2.prev = 6;
15717
+ _context2.prev = 12;
15683
15718
 
15684
15719
  _iterator2.s();
15685
15720
 
15686
- case 8:
15721
+ case 14:
15687
15722
  if ((_step2 = _iterator2.n()).done) {
15688
- _context2.next = 14;
15723
+ _context2.next = 20;
15689
15724
  break;
15690
15725
  }
15691
15726
 
15692
15727
  g = _step2.value;
15693
- _context2.next = 12;
15728
+ _context2.next = 18;
15694
15729
  return controller.addGoodDiscountV2([{
15695
15730
  $index: g.$index,
15696
15731
  discolineAmountunt: g.lineAmountIncludeTax || 0
15697
15732
  }]);
15698
15733
 
15699
- case 12:
15700
- _context2.next = 8;
15734
+ case 18:
15735
+ _context2.next = 14;
15701
15736
  break;
15702
15737
 
15703
- case 14:
15704
- _context2.next = 19;
15738
+ case 20:
15739
+ _context2.next = 25;
15705
15740
  break;
15706
15741
 
15707
- case 16:
15708
- _context2.prev = 16;
15709
- _context2.t0 = _context2["catch"](6);
15742
+ case 22:
15743
+ _context2.prev = 22;
15744
+ _context2.t0 = _context2["catch"](12);
15710
15745
 
15711
15746
  _iterator2.e(_context2.t0);
15712
15747
 
15713
- case 19:
15714
- _context2.prev = 19;
15748
+ case 25:
15749
+ _context2.prev = 25;
15715
15750
 
15716
15751
  _iterator2.f();
15717
15752
 
15718
- return _context2.finish(19);
15753
+ return _context2.finish(25);
15719
15754
 
15720
- case 22:
15755
+ case 28:
15721
15756
  controller.state.goodsListState.selectedGoodIndex = [];
15722
- _context2.next = 27;
15757
+ _context2.next = 33;
15723
15758
  break;
15724
15759
 
15725
- case 25:
15726
- _context2.prev = 25;
15760
+ case 31:
15761
+ _context2.prev = 31;
15727
15762
  _context2.t1 = _context2["catch"](0);
15728
15763
 
15729
- case 27:
15764
+ case 33:
15730
15765
  case "end":
15731
15766
  return _context2.stop();
15732
15767
  }
15733
15768
  }
15734
- }, _callee2, null, [[0, 25], [6, 16, 19, 22]]);
15769
+ }, _callee2, null, [[0, 31], [12, 22, 25, 28]]);
15735
15770
  })), [controller]);
15736
15771
  var items = React__default['default'].useMemo(function () {
15737
15772
  return [{
@@ -20613,7 +20648,7 @@ var useColumns$1 = (function (form) {
20613
20648
  }, {
20614
20649
  title: /*#__PURE__*/React__default['default'].createElement(TitleText$1, {
20615
20650
  required: true
20616
- }, "\u7A0E\u7387%"),
20651
+ }, "\u7A0E\u7387"),
20617
20652
  dataIndex: 'taxRate',
20618
20653
  key: 'taxRate',
20619
20654
  align: 'right',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.129",
3
+ "version": "3.2.130-1",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -37,9 +37,10 @@ export default class ImportGoods<ColumnType = any> {
37
37
  key: 'unit',
38
38
  },
39
39
  {
40
- title: '税率(%)',
40
+ title: '税率',
41
41
  dataIndex: 'taxRate',
42
42
  key: 'taxRate',
43
+ render: text => text || text === 0 ? `${text}%` : ''
43
44
  },
44
45
  {
45
46
  title: '单价(含税)',
@@ -475,7 +475,7 @@ export default (form: WrappedFormUtils) => {
475
475
  },
476
476
  },
477
477
  {
478
- title: <TitleText required >税率%</TitleText>,
478
+ title: <TitleText required >税率</TitleText>,
479
479
  dataIndex: 'taxRate',
480
480
  key: 'taxRate',
481
481
  align: 'right',
@@ -19,6 +19,9 @@ export default function useSalesGifts() {
19
19
  const giveaways = React.useMemo(() => goodsList.filter(e => e.lineAttribute === LineAttributeType.赠品行), [goodsList])
20
20
 
21
21
  const onClickAuto = React.useCallback(async () => {
22
+ await controller.saveEditGood();
23
+ await controller.wait();
24
+ if (controller.state.goodsListState.editGood) return;
22
25
  for (let g of giveaways) {
23
26
  g.lineAttribute = LineAttributeType.正常;
24
27
  await controller.addGoodDiscountV2([{ $index: g.$index, discolineAmountunt: g.lineAmountIncludeTax || 0 }]);
@@ -27,6 +30,9 @@ export default function useSalesGifts() {
27
30
 
28
31
  const onClickManual = React.useCallback(async () => {
29
32
  try {
33
+ await controller.saveEditGood();
34
+ await controller.wait();
35
+ if (controller.state.goodsListState.editGood) return;
30
36
  const { goodsMap, selectedGoodIndex } = controller.state.goodsListState;
31
37
  const giveaways = selectedGoodIndex.map(e => goodsMap.get(e) as IGood).filter(e => !!e);
32
38
 
@@ -445,7 +445,7 @@ export default (form: WrappedFormUtils) => {
445
445
  },
446
446
  },
447
447
  {
448
- title: <TitleText required >税率%</TitleText>,
448
+ title: <TitleText required >税率</TitleText>,
449
449
  dataIndex: 'taxRate',
450
450
  key: 'taxRate',
451
451
  align: 'right',