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

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',
@@ -13797,7 +13800,7 @@ var useColumns = (function (form) {
13797
13800
  style: {
13798
13801
  padding: '0 10px'
13799
13802
  }
13800
- }, value, "%");
13803
+ }, isDutyFree(record) ? '免税' : "".concat(value, "%"));
13801
13804
  }
13802
13805
  }
13803
13806
  }, {
@@ -13821,7 +13824,7 @@ var useColumns = (function (form) {
13821
13824
  style: {
13822
13825
  padding: '0 10px'
13823
13826
  }
13824
- }, parseFloat(value).toFixed(2));
13827
+ }, isDutyFree(record) ? '***' : parseFloat(value).toFixed(2));
13825
13828
  }
13826
13829
  }
13827
13830
  }, {
@@ -14098,6 +14101,13 @@ function dcoding(v) {
14098
14101
  return e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '';
14099
14102
  }).join('');
14100
14103
  }
14104
+ /** 是否免税 */
14105
+
14106
+
14107
+ function isDutyFree(record) {
14108
+ console.log(record);
14109
+ return record.taxFreeType === 1 && record.favouredPolicyName === '免税';
14110
+ }
14101
14111
 
14102
14112
  var useOnRow = (function () {
14103
14113
  /** 控制器 */
@@ -15603,52 +15613,68 @@ function useSalesGifts() {
15603
15613
  while (1) {
15604
15614
  switch (_context.prev = _context.next) {
15605
15615
  case 0:
15616
+ _context.next = 2;
15617
+ return controller.saveEditGood();
15618
+
15619
+ case 2:
15620
+ _context.next = 4;
15621
+ return controller.wait();
15622
+
15623
+ case 4:
15624
+ if (!controller.state.goodsListState.editGood) {
15625
+ _context.next = 6;
15626
+ break;
15627
+ }
15628
+
15629
+ return _context.abrupt("return");
15630
+
15631
+ case 6:
15606
15632
  _iterator = _createForOfIteratorHelper(giveaways);
15607
- _context.prev = 1;
15633
+ _context.prev = 7;
15608
15634
 
15609
15635
  _iterator.s();
15610
15636
 
15611
- case 3:
15637
+ case 9:
15612
15638
  if ((_step = _iterator.n()).done) {
15613
- _context.next = 10;
15639
+ _context.next = 16;
15614
15640
  break;
15615
15641
  }
15616
15642
 
15617
15643
  g = _step.value;
15618
15644
  g.lineAttribute = LineAttributeType$1.正常;
15619
- _context.next = 8;
15645
+ _context.next = 14;
15620
15646
  return controller.addGoodDiscountV2([{
15621
15647
  $index: g.$index,
15622
15648
  discolineAmountunt: g.lineAmountIncludeTax || 0
15623
15649
  }]);
15624
15650
 
15625
- case 8:
15626
- _context.next = 3;
15651
+ case 14:
15652
+ _context.next = 9;
15627
15653
  break;
15628
15654
 
15629
- case 10:
15630
- _context.next = 15;
15655
+ case 16:
15656
+ _context.next = 21;
15631
15657
  break;
15632
15658
 
15633
- case 12:
15634
- _context.prev = 12;
15635
- _context.t0 = _context["catch"](1);
15659
+ case 18:
15660
+ _context.prev = 18;
15661
+ _context.t0 = _context["catch"](7);
15636
15662
 
15637
15663
  _iterator.e(_context.t0);
15638
15664
 
15639
- case 15:
15640
- _context.prev = 15;
15665
+ case 21:
15666
+ _context.prev = 21;
15641
15667
 
15642
15668
  _iterator.f();
15643
15669
 
15644
- return _context.finish(15);
15670
+ return _context.finish(21);
15645
15671
 
15646
- case 18:
15672
+ case 24:
15647
15673
  case "end":
15648
15674
  return _context.stop();
15649
15675
  }
15650
15676
  }
15651
- }, _callee, null, [[1, 12, 15, 18]]);
15677
+ }, _callee, null, [[7, 18, 21, 24]]);
15652
15678
  })), [controller, giveaways]);
15653
15679
  var onClickManual = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
15654
15680
  var _controller$state$goo, goodsMap, _selectedGoodIndex, _giveaways, _iterator2, _step2, g;
@@ -15658,70 +15684,86 @@ function useSalesGifts() {
15658
15684
  switch (_context2.prev = _context2.next) {
15659
15685
  case 0:
15660
15686
  _context2.prev = 0;
15687
+ _context2.next = 3;
15688
+ return controller.saveEditGood();
15689
+
15690
+ case 3:
15691
+ _context2.next = 5;
15692
+ return controller.wait();
15693
+
15694
+ case 5:
15695
+ if (!controller.state.goodsListState.editGood) {
15696
+ _context2.next = 7;
15697
+ break;
15698
+ }
15699
+
15700
+ return _context2.abrupt("return");
15701
+
15702
+ case 7:
15661
15703
  _controller$state$goo = controller.state.goodsListState, goodsMap = _controller$state$goo.goodsMap, _selectedGoodIndex = _controller$state$goo.selectedGoodIndex;
15662
15704
  _giveaways = _selectedGoodIndex.map(function (e) {
15663
15705
  return goodsMap.get(e);
15664
15706
  }).filter(function (e) {
15665
15707
  return !!e;
15666
15708
  });
15667
- _context2.next = 5;
15709
+ _context2.next = 11;
15668
15710
  return checkLineAttribute(_giveaways);
15669
15711
 
15670
- case 5:
15712
+ case 11:
15671
15713
  _iterator2 = _createForOfIteratorHelper(_giveaways);
15672
- _context2.prev = 6;
15714
+ _context2.prev = 12;
15673
15715
 
15674
15716
  _iterator2.s();
15675
15717
 
15676
- case 8:
15718
+ case 14:
15677
15719
  if ((_step2 = _iterator2.n()).done) {
15678
- _context2.next = 14;
15720
+ _context2.next = 20;
15679
15721
  break;
15680
15722
  }
15681
15723
 
15682
15724
  g = _step2.value;
15683
- _context2.next = 12;
15725
+ _context2.next = 18;
15684
15726
  return controller.addGoodDiscountV2([{
15685
15727
  $index: g.$index,
15686
15728
  discolineAmountunt: g.lineAmountIncludeTax || 0
15687
15729
  }]);
15688
15730
 
15689
- case 12:
15690
- _context2.next = 8;
15731
+ case 18:
15732
+ _context2.next = 14;
15691
15733
  break;
15692
15734
 
15693
- case 14:
15694
- _context2.next = 19;
15735
+ case 20:
15736
+ _context2.next = 25;
15695
15737
  break;
15696
15738
 
15697
- case 16:
15698
- _context2.prev = 16;
15699
- _context2.t0 = _context2["catch"](6);
15739
+ case 22:
15740
+ _context2.prev = 22;
15741
+ _context2.t0 = _context2["catch"](12);
15700
15742
 
15701
15743
  _iterator2.e(_context2.t0);
15702
15744
 
15703
- case 19:
15704
- _context2.prev = 19;
15745
+ case 25:
15746
+ _context2.prev = 25;
15705
15747
 
15706
15748
  _iterator2.f();
15707
15749
 
15708
- return _context2.finish(19);
15750
+ return _context2.finish(25);
15709
15751
 
15710
- case 22:
15752
+ case 28:
15711
15753
  controller.state.goodsListState.selectedGoodIndex = [];
15712
- _context2.next = 27;
15754
+ _context2.next = 33;
15713
15755
  break;
15714
15756
 
15715
- case 25:
15716
- _context2.prev = 25;
15757
+ case 31:
15758
+ _context2.prev = 31;
15717
15759
  _context2.t1 = _context2["catch"](0);
15718
15760
 
15719
- case 27:
15761
+ case 33:
15720
15762
  case "end":
15721
15763
  return _context2.stop();
15722
15764
  }
15723
15765
  }
15724
- }, _callee2, null, [[0, 25], [6, 16, 19, 22]]);
15766
+ }, _callee2, null, [[0, 31], [12, 22, 25, 28]]);
15725
15767
  })), [controller]);
15726
15768
  var items = React.useMemo(function () {
15727
15769
  return [{
@@ -20603,7 +20645,7 @@ var useColumns$1 = (function (form) {
20603
20645
  }, {
20604
20646
  title: /*#__PURE__*/React.createElement(TitleText$1, {
20605
20647
  required: true
20606
- }, "\u7A0E\u7387%"),
20648
+ }, "\u7A0E\u7387"),
20607
20649
  dataIndex: 'taxRate',
20608
20650
  key: 'taxRate',
20609
20651
  align: 'right',
@@ -20641,7 +20683,7 @@ var useColumns$1 = (function (form) {
20641
20683
  style: {
20642
20684
  padding: '0 10px'
20643
20685
  }
20644
- }, value, "%");
20686
+ }, isDutyFree$1(record) ? '免税' : "".concat(value, "%"));
20645
20687
  }
20646
20688
  }
20647
20689
  }, {
@@ -20665,7 +20707,7 @@ var useColumns$1 = (function (form) {
20665
20707
  style: {
20666
20708
  padding: '0 10px'
20667
20709
  }
20668
- }, parseFloat(value).toFixed(2));
20710
+ }, isDutyFree$1(record) ? '***' : parseFloat(value).toFixed(2));
20669
20711
  }
20670
20712
  }
20671
20713
  } // {
@@ -20869,6 +20911,13 @@ function dcoding$1(v) {
20869
20911
  return e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '';
20870
20912
  }).join('');
20871
20913
  }
20914
+ /** 是否免税 */
20915
+
20916
+
20917
+ function isDutyFree$1(record) {
20918
+ console.log(record);
20919
+ return record.taxFreeType === 1 && record.favouredPolicyName === '免税';
20920
+ }
20872
20921
 
20873
20922
  var MyItemNameStyle = {
20874
20923
  padding: '0px 10px',
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',
@@ -13807,7 +13810,7 @@ var useColumns = (function (form) {
13807
13810
  style: {
13808
13811
  padding: '0 10px'
13809
13812
  }
13810
- }, value, "%");
13813
+ }, isDutyFree(record) ? '免税' : "".concat(value, "%"));
13811
13814
  }
13812
13815
  }
13813
13816
  }, {
@@ -13831,7 +13834,7 @@ var useColumns = (function (form) {
13831
13834
  style: {
13832
13835
  padding: '0 10px'
13833
13836
  }
13834
- }, parseFloat(value).toFixed(2));
13837
+ }, isDutyFree(record) ? '***' : parseFloat(value).toFixed(2));
13835
13838
  }
13836
13839
  }
13837
13840
  }, {
@@ -14108,6 +14111,13 @@ function dcoding(v) {
14108
14111
  return e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '';
14109
14112
  }).join('');
14110
14113
  }
14114
+ /** 是否免税 */
14115
+
14116
+
14117
+ function isDutyFree(record) {
14118
+ console.log(record);
14119
+ return record.taxFreeType === 1 && record.favouredPolicyName === '免税';
14120
+ }
14111
14121
 
14112
14122
  var useOnRow = (function () {
14113
14123
  /** 控制器 */
@@ -15613,52 +15623,68 @@ function useSalesGifts() {
15613
15623
  while (1) {
15614
15624
  switch (_context.prev = _context.next) {
15615
15625
  case 0:
15626
+ _context.next = 2;
15627
+ return controller.saveEditGood();
15628
+
15629
+ case 2:
15630
+ _context.next = 4;
15631
+ return controller.wait();
15632
+
15633
+ case 4:
15634
+ if (!controller.state.goodsListState.editGood) {
15635
+ _context.next = 6;
15636
+ break;
15637
+ }
15638
+
15639
+ return _context.abrupt("return");
15640
+
15641
+ case 6:
15616
15642
  _iterator = _createForOfIteratorHelper(giveaways);
15617
- _context.prev = 1;
15643
+ _context.prev = 7;
15618
15644
 
15619
15645
  _iterator.s();
15620
15646
 
15621
- case 3:
15647
+ case 9:
15622
15648
  if ((_step = _iterator.n()).done) {
15623
- _context.next = 10;
15649
+ _context.next = 16;
15624
15650
  break;
15625
15651
  }
15626
15652
 
15627
15653
  g = _step.value;
15628
15654
  g.lineAttribute = LineAttributeType$1.正常;
15629
- _context.next = 8;
15655
+ _context.next = 14;
15630
15656
  return controller.addGoodDiscountV2([{
15631
15657
  $index: g.$index,
15632
15658
  discolineAmountunt: g.lineAmountIncludeTax || 0
15633
15659
  }]);
15634
15660
 
15635
- case 8:
15636
- _context.next = 3;
15661
+ case 14:
15662
+ _context.next = 9;
15637
15663
  break;
15638
15664
 
15639
- case 10:
15640
- _context.next = 15;
15665
+ case 16:
15666
+ _context.next = 21;
15641
15667
  break;
15642
15668
 
15643
- case 12:
15644
- _context.prev = 12;
15645
- _context.t0 = _context["catch"](1);
15669
+ case 18:
15670
+ _context.prev = 18;
15671
+ _context.t0 = _context["catch"](7);
15646
15672
 
15647
15673
  _iterator.e(_context.t0);
15648
15674
 
15649
- case 15:
15650
- _context.prev = 15;
15675
+ case 21:
15676
+ _context.prev = 21;
15651
15677
 
15652
15678
  _iterator.f();
15653
15679
 
15654
- return _context.finish(15);
15680
+ return _context.finish(21);
15655
15681
 
15656
- case 18:
15682
+ case 24:
15657
15683
  case "end":
15658
15684
  return _context.stop();
15659
15685
  }
15660
15686
  }
15661
- }, _callee, null, [[1, 12, 15, 18]]);
15687
+ }, _callee, null, [[7, 18, 21, 24]]);
15662
15688
  })), [controller, giveaways]);
15663
15689
  var onClickManual = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
15664
15690
  var _controller$state$goo, goodsMap, _selectedGoodIndex, _giveaways, _iterator2, _step2, g;
@@ -15668,70 +15694,86 @@ function useSalesGifts() {
15668
15694
  switch (_context2.prev = _context2.next) {
15669
15695
  case 0:
15670
15696
  _context2.prev = 0;
15697
+ _context2.next = 3;
15698
+ return controller.saveEditGood();
15699
+
15700
+ case 3:
15701
+ _context2.next = 5;
15702
+ return controller.wait();
15703
+
15704
+ case 5:
15705
+ if (!controller.state.goodsListState.editGood) {
15706
+ _context2.next = 7;
15707
+ break;
15708
+ }
15709
+
15710
+ return _context2.abrupt("return");
15711
+
15712
+ case 7:
15671
15713
  _controller$state$goo = controller.state.goodsListState, goodsMap = _controller$state$goo.goodsMap, _selectedGoodIndex = _controller$state$goo.selectedGoodIndex;
15672
15714
  _giveaways = _selectedGoodIndex.map(function (e) {
15673
15715
  return goodsMap.get(e);
15674
15716
  }).filter(function (e) {
15675
15717
  return !!e;
15676
15718
  });
15677
- _context2.next = 5;
15719
+ _context2.next = 11;
15678
15720
  return checkLineAttribute(_giveaways);
15679
15721
 
15680
- case 5:
15722
+ case 11:
15681
15723
  _iterator2 = _createForOfIteratorHelper(_giveaways);
15682
- _context2.prev = 6;
15724
+ _context2.prev = 12;
15683
15725
 
15684
15726
  _iterator2.s();
15685
15727
 
15686
- case 8:
15728
+ case 14:
15687
15729
  if ((_step2 = _iterator2.n()).done) {
15688
- _context2.next = 14;
15730
+ _context2.next = 20;
15689
15731
  break;
15690
15732
  }
15691
15733
 
15692
15734
  g = _step2.value;
15693
- _context2.next = 12;
15735
+ _context2.next = 18;
15694
15736
  return controller.addGoodDiscountV2([{
15695
15737
  $index: g.$index,
15696
15738
  discolineAmountunt: g.lineAmountIncludeTax || 0
15697
15739
  }]);
15698
15740
 
15699
- case 12:
15700
- _context2.next = 8;
15741
+ case 18:
15742
+ _context2.next = 14;
15701
15743
  break;
15702
15744
 
15703
- case 14:
15704
- _context2.next = 19;
15745
+ case 20:
15746
+ _context2.next = 25;
15705
15747
  break;
15706
15748
 
15707
- case 16:
15708
- _context2.prev = 16;
15709
- _context2.t0 = _context2["catch"](6);
15749
+ case 22:
15750
+ _context2.prev = 22;
15751
+ _context2.t0 = _context2["catch"](12);
15710
15752
 
15711
15753
  _iterator2.e(_context2.t0);
15712
15754
 
15713
- case 19:
15714
- _context2.prev = 19;
15755
+ case 25:
15756
+ _context2.prev = 25;
15715
15757
 
15716
15758
  _iterator2.f();
15717
15759
 
15718
- return _context2.finish(19);
15760
+ return _context2.finish(25);
15719
15761
 
15720
- case 22:
15762
+ case 28:
15721
15763
  controller.state.goodsListState.selectedGoodIndex = [];
15722
- _context2.next = 27;
15764
+ _context2.next = 33;
15723
15765
  break;
15724
15766
 
15725
- case 25:
15726
- _context2.prev = 25;
15767
+ case 31:
15768
+ _context2.prev = 31;
15727
15769
  _context2.t1 = _context2["catch"](0);
15728
15770
 
15729
- case 27:
15771
+ case 33:
15730
15772
  case "end":
15731
15773
  return _context2.stop();
15732
15774
  }
15733
15775
  }
15734
- }, _callee2, null, [[0, 25], [6, 16, 19, 22]]);
15776
+ }, _callee2, null, [[0, 31], [12, 22, 25, 28]]);
15735
15777
  })), [controller]);
15736
15778
  var items = React__default['default'].useMemo(function () {
15737
15779
  return [{
@@ -20613,7 +20655,7 @@ var useColumns$1 = (function (form) {
20613
20655
  }, {
20614
20656
  title: /*#__PURE__*/React__default['default'].createElement(TitleText$1, {
20615
20657
  required: true
20616
- }, "\u7A0E\u7387%"),
20658
+ }, "\u7A0E\u7387"),
20617
20659
  dataIndex: 'taxRate',
20618
20660
  key: 'taxRate',
20619
20661
  align: 'right',
@@ -20651,7 +20693,7 @@ var useColumns$1 = (function (form) {
20651
20693
  style: {
20652
20694
  padding: '0 10px'
20653
20695
  }
20654
- }, value, "%");
20696
+ }, isDutyFree$1(record) ? '免税' : "".concat(value, "%"));
20655
20697
  }
20656
20698
  }
20657
20699
  }, {
@@ -20675,7 +20717,7 @@ var useColumns$1 = (function (form) {
20675
20717
  style: {
20676
20718
  padding: '0 10px'
20677
20719
  }
20678
- }, parseFloat(value).toFixed(2));
20720
+ }, isDutyFree$1(record) ? '***' : parseFloat(value).toFixed(2));
20679
20721
  }
20680
20722
  }
20681
20723
  } // {
@@ -20879,6 +20921,13 @@ function dcoding$1(v) {
20879
20921
  return e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '';
20880
20922
  }).join('');
20881
20923
  }
20924
+ /** 是否免税 */
20925
+
20926
+
20927
+ function isDutyFree$1(record) {
20928
+ console.log(record);
20929
+ return record.taxFreeType === 1 && record.favouredPolicyName === '免税';
20930
+ }
20882
20931
 
20883
20932
  var MyItemNameStyle = {
20884
20933
  padding: '0px 10px',
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-2",
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',
@@ -514,7 +514,7 @@ export default (form: WrappedFormUtils) => {
514
514
  </Form.Item>
515
515
  );
516
516
  } else {
517
- return <span style={{ padding: '0 10px' }}>{value}%</span>;
517
+ return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '免税' : `${value}%`}</span>;
518
518
  }
519
519
  },
520
520
  },
@@ -531,7 +531,7 @@ export default (form: WrappedFormUtils) => {
531
531
  rules: getReplenishRules('taxAmount'),
532
532
  })(<MyDiv loading={isCipher(changeField, 'taxAmount')} />);
533
533
  } else {
534
- return <span style={{ padding: '0 10px' }}>{parseFloat(value).toFixed(2)}</span>;
534
+ return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' : parseFloat(value).toFixed(2)}</span>;
535
535
  }
536
536
  },
537
537
  },
@@ -686,3 +686,9 @@ function ucoding(v: string): string {
686
686
  function dcoding(v: string): string {
687
687
  return v.split('U').map(e => e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '').join('');
688
688
  }
689
+
690
+ /** 是否免税 */
691
+ function isDutyFree(record: IGood): boolean {
692
+ console.log(record);
693
+ return (record.taxFreeType as any) === 1 && record.favouredPolicyName === '免税';
694
+ }
@@ -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',
@@ -484,7 +484,7 @@ export default (form: WrappedFormUtils) => {
484
484
  </Form.Item>
485
485
  );
486
486
  } else {
487
- return <span style={{ padding: '0 10px' }}>{value}%</span>;
487
+ return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '免税' : `${value}%`}</span>;
488
488
  }
489
489
  },
490
490
  },
@@ -501,7 +501,7 @@ export default (form: WrappedFormUtils) => {
501
501
  rules: getReplenishRules('taxAmount'),
502
502
  })(<MyDiv loading={isCipher(changeField, 'taxAmount')} />);
503
503
  } else {
504
- return <span style={{ padding: '0 10px' }}>{parseFloat(value).toFixed(2)}</span>;
504
+ return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' : parseFloat(value).toFixed(2)}</span>;
505
505
  }
506
506
  },
507
507
  },
@@ -639,6 +639,12 @@ function dcoding(v: string): string {
639
639
  return v.split('U').map(e => e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '').join('');
640
640
  }
641
641
 
642
+ /** 是否免税 */
643
+ function isDutyFree(record: IGood): boolean {
644
+ console.log(record);
645
+ return (record.taxFreeType as any) === 1 && record.favouredPolicyName === '免税';
646
+ }
647
+
642
648
  const MyItemNameStyle: any = {
643
649
  padding: '0px 10px',
644
650
  whiteSpace: 'nowrap',