kts-component-invoice-operate 3.2.84 → 3.2.86

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
@@ -703,6 +703,18 @@ function styleInject(css, ref) {
703
703
  var css_248z = ".kts-invoice-operate {\n border: 1px solid #dcdcdc;\n font-size: 12px;\n}\n.kts-invoice-operate > * {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate > *:last-child {\n border-bottom: none;\n}\n.kts-invoice-operate-digtal {\n font-family: PingFang SC;\n font-size: 14px;\n}\n.kts-invoice-operate-digtal .kts-invoice-operate-digtal-cont {\n border: 2px solid #9F613E;\n}\n.kts-invoice-operate-digtal .kts-invoice-operate-digtal-cont > * {\n border-bottom: 2px solid #9F613E;\n}\n.kts-invoice-operate-digtal .kts-invoice-operate-digtal-cont > *:last-child {\n border-bottom: none;\n}\n";
704
704
  styleInject(css_248z);
705
705
 
706
+ var LineAttributeType;
707
+
708
+ (function (LineAttributeType) {
709
+ LineAttributeType[LineAttributeType["\u6B63\u5E38"] = 0] = "\u6B63\u5E38";
710
+ LineAttributeType[LineAttributeType["\u6298\u6263\u884C"] = 1] = "\u6298\u6263\u884C";
711
+ LineAttributeType[LineAttributeType["\u88AB\u6298\u6263\u884C"] = 2] = "\u88AB\u6298\u6263\u884C";
712
+ LineAttributeType[LineAttributeType["\u6298\u8BA9\u884C"] = 3] = "\u6298\u8BA9\u884C";
713
+ LineAttributeType[LineAttributeType["\u8D60\u54C1\u884C"] = 4] = "\u8D60\u54C1\u884C";
714
+ })(LineAttributeType || (LineAttributeType = {}));
715
+
716
+ var LineAttributeType$1 = LineAttributeType;
717
+
706
718
  var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
707
719
  _inherits(InvoiceControllerForm, _GreyReactBox);
708
720
 
@@ -811,7 +823,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
811
823
  var sum = chain$1(bignumber(0));
812
824
 
813
825
  _this3.state.goodsListState.goodsList.forEach(function (e) {
814
- if (!e) return;
826
+ if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
815
827
  sum = sum.add(bignumber(e.lineAmountIncludeTax || 0));
816
828
  });
817
829
 
@@ -823,7 +835,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
823
835
  var sum = chain$1(bignumber(0));
824
836
 
825
837
  _this3.state.goodsListState.goodsList.forEach(function (e) {
826
- if (!e) return;
838
+ if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
827
839
  sum = sum.add(bignumber(e.lineAmountExcludeTax || 0));
828
840
  });
829
841
 
@@ -835,7 +847,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
835
847
  var sum = chain$1(bignumber(0));
836
848
 
837
849
  _this3.state.goodsListState.goodsList.forEach(function (e) {
838
- if (!e) return;
850
+ if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
839
851
  sum = sum.add(bignumber(e.taxAmount || 0));
840
852
  });
841
853
 
@@ -967,18 +979,6 @@ var ImportGoods = /*#__PURE__*/_createClass(function ImportGoods() {
967
979
  }();
968
980
  });
969
981
 
970
- var LineAttributeType;
971
-
972
- (function (LineAttributeType) {
973
- LineAttributeType[LineAttributeType["\u6B63\u5E38"] = 0] = "\u6B63\u5E38";
974
- LineAttributeType[LineAttributeType["\u6298\u6263\u884C"] = 1] = "\u6298\u6263\u884C";
975
- LineAttributeType[LineAttributeType["\u88AB\u6298\u6263\u884C"] = 2] = "\u88AB\u6298\u6263\u884C";
976
- LineAttributeType[LineAttributeType["\u6298\u8BA9\u884C"] = 3] = "\u6298\u8BA9\u884C";
977
- LineAttributeType[LineAttributeType["\u8D60\u54C1\u884C"] = 4] = "\u8D60\u54C1\u884C";
978
- })(LineAttributeType || (LineAttributeType = {}));
979
-
980
- var LineAttributeType$1 = LineAttributeType;
981
-
982
982
  var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
983
983
  _classCallCheck(this, EndowCode);
984
984
 
@@ -9773,6 +9773,8 @@ var Statistics = (function () {
9773
9773
 
9774
9774
  var err = (_s$goodsListState$for = (_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.getFieldsError()) !== null && _s$goodsListState$for !== void 0 ? _s$goodsListState$for : {};
9775
9775
  s.goodsListState.goodsList.forEach(function (e) {
9776
+ if (e.lineAttribute === LineAttributeType$1.赠品行) return;
9777
+
9776
9778
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
9777
9779
  if (!err.lineAmountIncludeTax) {
9778
9780
  sum = sum.add(bignumber(editGood.lineAmountIncludeTax || 0));
@@ -9797,6 +9799,8 @@ var Statistics = (function () {
9797
9799
 
9798
9800
  var err = (_s$goodsListState$for3 = (_s$goodsListState$for4 = s.goodsListState.form) === null || _s$goodsListState$for4 === void 0 ? void 0 : _s$goodsListState$for4.getFieldsError()) !== null && _s$goodsListState$for3 !== void 0 ? _s$goodsListState$for3 : {};
9799
9801
  s.goodsListState.goodsList.forEach(function (e) {
9802
+ if (e.lineAttribute === LineAttributeType$1.赠品行) return;
9803
+
9800
9804
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
9801
9805
  if (!err.lineAmountExcludeTax) {
9802
9806
  sum = sum.add(bignumber(editGood.lineAmountExcludeTax || 0));
@@ -9818,6 +9822,8 @@ var Statistics = (function () {
9818
9822
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
9819
9823
 
9820
9824
  s.goodsListState.goodsList.forEach(function (e) {
9825
+ if (e.lineAttribute === LineAttributeType$1.赠品行) return;
9826
+
9821
9827
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
9822
9828
  sum = sum.add(bignumber(editGood.taxAmount || 0));
9823
9829
  } else {
@@ -10536,24 +10542,15 @@ var useEndowCode = (function (goods) {
10536
10542
  }, _callee);
10537
10543
  })), [controller, goods]);
10538
10544
 
10539
- if (goods.lineAttribute === LineAttributeType$1.折让行) {
10545
+ if ([LineAttributeType$1.正常, LineAttributeType$1.被折扣行, LineAttributeType$1.折扣行].indexOf(goods.lineAttribute) >= 0) {
10546
+ return {
10547
+ key: 'endowCode',
10548
+ title: '赋码',
10549
+ onClick: onClick
10550
+ };
10551
+ } else {
10540
10552
  return undefined;
10541
10553
  }
10542
-
10543
- return {
10544
- key: 'endowCode',
10545
- title: '赋码',
10546
- onClick: onClick
10547
- }; // return React.useMemo(() => {
10548
- // return (
10549
- // <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
10550
- // );
10551
- // }, [goods.lineAttribute, onClick])
10552
- // return React.useMemo(() => {
10553
- // return (
10554
- // <Button key="endowCode" type="link" onClick={onClick} >赋码</Button>
10555
- // );
10556
- // }, [goods.lineAttribute, onClick])
10557
10554
  });
10558
10555
 
10559
10556
  var css_248z$6 = ".ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:focus,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu {\n font-size: 16px;\n color: #000;\n text-align: center;\n padding: 0;\n}\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu.ktsAnt3x-dropdown-open {\n background: #ebebeb;\n border-radius: 9999px;\n}\n";
@@ -14704,11 +14701,11 @@ function useMergeDetails() {
14704
14701
  var items = React.useMemo(function () {
14705
14702
  return [{
14706
14703
  key: '0',
14707
- label: '自动合并',
14704
+ label: '处理全部行',
14708
14705
  onClick: onClickAuto
14709
14706
  }, {
14710
14707
  key: '1',
14711
- label: '手动合并',
14708
+ label: '处理选中行',
14712
14709
  disabled: selectedGoodIndex.length <= 1,
14713
14710
  onClick: onClickManual
14714
14711
  }];
@@ -15149,12 +15146,12 @@ function useSalesGifts() {
15149
15146
  var items = React.useMemo(function () {
15150
15147
  return [{
15151
15148
  key: '0',
15152
- label: '自动转换',
15149
+ label: '处理全部行',
15153
15150
  disabled: giveaways.length <= 0,
15154
15151
  onClick: onClickAuto
15155
15152
  }, {
15156
15153
  key: '1',
15157
- label: '手动转换',
15154
+ label: '处理选中行',
15158
15155
  disabled: selectedGoodIndex.length <= 0,
15159
15156
  onClick: onClickManual
15160
15157
  }];
package/dist/index.js CHANGED
@@ -713,6 +713,18 @@ function styleInject(css, ref) {
713
713
  var css_248z = ".kts-invoice-operate {\n border: 1px solid #dcdcdc;\n font-size: 12px;\n}\n.kts-invoice-operate > * {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate > *:last-child {\n border-bottom: none;\n}\n.kts-invoice-operate-digtal {\n font-family: PingFang SC;\n font-size: 14px;\n}\n.kts-invoice-operate-digtal .kts-invoice-operate-digtal-cont {\n border: 2px solid #9F613E;\n}\n.kts-invoice-operate-digtal .kts-invoice-operate-digtal-cont > * {\n border-bottom: 2px solid #9F613E;\n}\n.kts-invoice-operate-digtal .kts-invoice-operate-digtal-cont > *:last-child {\n border-bottom: none;\n}\n";
714
714
  styleInject(css_248z);
715
715
 
716
+ var LineAttributeType;
717
+
718
+ (function (LineAttributeType) {
719
+ LineAttributeType[LineAttributeType["\u6B63\u5E38"] = 0] = "\u6B63\u5E38";
720
+ LineAttributeType[LineAttributeType["\u6298\u6263\u884C"] = 1] = "\u6298\u6263\u884C";
721
+ LineAttributeType[LineAttributeType["\u88AB\u6298\u6263\u884C"] = 2] = "\u88AB\u6298\u6263\u884C";
722
+ LineAttributeType[LineAttributeType["\u6298\u8BA9\u884C"] = 3] = "\u6298\u8BA9\u884C";
723
+ LineAttributeType[LineAttributeType["\u8D60\u54C1\u884C"] = 4] = "\u8D60\u54C1\u884C";
724
+ })(LineAttributeType || (LineAttributeType = {}));
725
+
726
+ var LineAttributeType$1 = LineAttributeType;
727
+
716
728
  var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
717
729
  _inherits(InvoiceControllerForm, _GreyReactBox);
718
730
 
@@ -821,7 +833,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
821
833
  var sum = mathjs.chain(mathjs.bignumber(0));
822
834
 
823
835
  _this3.state.goodsListState.goodsList.forEach(function (e) {
824
- if (!e) return;
836
+ if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
825
837
  sum = sum.add(mathjs.bignumber(e.lineAmountIncludeTax || 0));
826
838
  });
827
839
 
@@ -833,7 +845,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
833
845
  var sum = mathjs.chain(mathjs.bignumber(0));
834
846
 
835
847
  _this3.state.goodsListState.goodsList.forEach(function (e) {
836
- if (!e) return;
848
+ if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
837
849
  sum = sum.add(mathjs.bignumber(e.lineAmountExcludeTax || 0));
838
850
  });
839
851
 
@@ -845,7 +857,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
845
857
  var sum = mathjs.chain(mathjs.bignumber(0));
846
858
 
847
859
  _this3.state.goodsListState.goodsList.forEach(function (e) {
848
- if (!e) return;
860
+ if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
849
861
  sum = sum.add(mathjs.bignumber(e.taxAmount || 0));
850
862
  });
851
863
 
@@ -977,18 +989,6 @@ var ImportGoods = /*#__PURE__*/_createClass(function ImportGoods() {
977
989
  }();
978
990
  });
979
991
 
980
- var LineAttributeType;
981
-
982
- (function (LineAttributeType) {
983
- LineAttributeType[LineAttributeType["\u6B63\u5E38"] = 0] = "\u6B63\u5E38";
984
- LineAttributeType[LineAttributeType["\u6298\u6263\u884C"] = 1] = "\u6298\u6263\u884C";
985
- LineAttributeType[LineAttributeType["\u88AB\u6298\u6263\u884C"] = 2] = "\u88AB\u6298\u6263\u884C";
986
- LineAttributeType[LineAttributeType["\u6298\u8BA9\u884C"] = 3] = "\u6298\u8BA9\u884C";
987
- LineAttributeType[LineAttributeType["\u8D60\u54C1\u884C"] = 4] = "\u8D60\u54C1\u884C";
988
- })(LineAttributeType || (LineAttributeType = {}));
989
-
990
- var LineAttributeType$1 = LineAttributeType;
991
-
992
992
  var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
993
993
  _classCallCheck(this, EndowCode);
994
994
 
@@ -9783,6 +9783,8 @@ var Statistics = (function () {
9783
9783
 
9784
9784
  var err = (_s$goodsListState$for = (_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.getFieldsError()) !== null && _s$goodsListState$for !== void 0 ? _s$goodsListState$for : {};
9785
9785
  s.goodsListState.goodsList.forEach(function (e) {
9786
+ if (e.lineAttribute === LineAttributeType$1.赠品行) return;
9787
+
9786
9788
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
9787
9789
  if (!err.lineAmountIncludeTax) {
9788
9790
  sum = sum.add(mathjs.bignumber(editGood.lineAmountIncludeTax || 0));
@@ -9807,6 +9809,8 @@ var Statistics = (function () {
9807
9809
 
9808
9810
  var err = (_s$goodsListState$for3 = (_s$goodsListState$for4 = s.goodsListState.form) === null || _s$goodsListState$for4 === void 0 ? void 0 : _s$goodsListState$for4.getFieldsError()) !== null && _s$goodsListState$for3 !== void 0 ? _s$goodsListState$for3 : {};
9809
9811
  s.goodsListState.goodsList.forEach(function (e) {
9812
+ if (e.lineAttribute === LineAttributeType$1.赠品行) return;
9813
+
9810
9814
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
9811
9815
  if (!err.lineAmountExcludeTax) {
9812
9816
  sum = sum.add(mathjs.bignumber(editGood.lineAmountExcludeTax || 0));
@@ -9828,6 +9832,8 @@ var Statistics = (function () {
9828
9832
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
9829
9833
 
9830
9834
  s.goodsListState.goodsList.forEach(function (e) {
9835
+ if (e.lineAttribute === LineAttributeType$1.赠品行) return;
9836
+
9831
9837
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
9832
9838
  sum = sum.add(mathjs.bignumber(editGood.taxAmount || 0));
9833
9839
  } else {
@@ -10546,24 +10552,15 @@ var useEndowCode = (function (goods) {
10546
10552
  }, _callee);
10547
10553
  })), [controller, goods]);
10548
10554
 
10549
- if (goods.lineAttribute === LineAttributeType$1.折让行) {
10555
+ if ([LineAttributeType$1.正常, LineAttributeType$1.被折扣行, LineAttributeType$1.折扣行].indexOf(goods.lineAttribute) >= 0) {
10556
+ return {
10557
+ key: 'endowCode',
10558
+ title: '赋码',
10559
+ onClick: onClick
10560
+ };
10561
+ } else {
10550
10562
  return undefined;
10551
10563
  }
10552
-
10553
- return {
10554
- key: 'endowCode',
10555
- title: '赋码',
10556
- onClick: onClick
10557
- }; // return React.useMemo(() => {
10558
- // return (
10559
- // <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
10560
- // );
10561
- // }, [goods.lineAttribute, onClick])
10562
- // return React.useMemo(() => {
10563
- // return (
10564
- // <Button key="endowCode" type="link" onClick={onClick} >赋码</Button>
10565
- // );
10566
- // }, [goods.lineAttribute, onClick])
10567
10564
  });
10568
10565
 
10569
10566
  var css_248z$6 = ".ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:focus,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu {\n font-size: 16px;\n color: #000;\n text-align: center;\n padding: 0;\n}\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu.ktsAnt3x-dropdown-open {\n background: #ebebeb;\n border-radius: 9999px;\n}\n";
@@ -14714,11 +14711,11 @@ function useMergeDetails() {
14714
14711
  var items = React__default['default'].useMemo(function () {
14715
14712
  return [{
14716
14713
  key: '0',
14717
- label: '自动合并',
14714
+ label: '处理全部行',
14718
14715
  onClick: onClickAuto
14719
14716
  }, {
14720
14717
  key: '1',
14721
- label: '手动合并',
14718
+ label: '处理选中行',
14722
14719
  disabled: selectedGoodIndex.length <= 1,
14723
14720
  onClick: onClickManual
14724
14721
  }];
@@ -15159,12 +15156,12 @@ function useSalesGifts() {
15159
15156
  var items = React__default['default'].useMemo(function () {
15160
15157
  return [{
15161
15158
  key: '0',
15162
- label: '自动转换',
15159
+ label: '处理全部行',
15163
15160
  disabled: giveaways.length <= 0,
15164
15161
  onClick: onClickAuto
15165
15162
  }, {
15166
15163
  key: '1',
15167
- label: '手动转换',
15164
+ label: '处理选中行',
15168
15165
  disabled: selectedGoodIndex.length <= 0,
15169
15166
  onClick: onClickManual
15170
15167
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.84",
3
+ "version": "3.2.86",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -3,6 +3,7 @@ import GreyReactBox from 'grey-react-box';
3
3
  import { chain, bignumber } from 'mathjs';
4
4
  import InvoiceControllerState from '../InvoiceControllerState';
5
5
  import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
6
+ import LineAttributeType from '../InvoiceControllerState/GoodsListState/LineAttributeType';
6
7
 
7
8
  export default class InvoiceControllerForm extends GreyReactBox<InvoiceControllerState> {
8
9
  /** form 字典 */
@@ -40,7 +41,7 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
40
41
  if (this.state.goodsListState.form) {
41
42
  try {
42
43
  await this.state.goodsListState.form?.validateFields()
43
- } catch (error:any) {
44
+ } catch (error: any) {
44
45
  _errors.set('goodsList', error.errors);
45
46
  }
46
47
  }
@@ -51,7 +52,7 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
51
52
  _values.set('lineAmountIncludeTax', (() => {
52
53
  let sum = chain(bignumber(0));
53
54
  this.state.goodsListState.goodsList.forEach(e => {
54
- if (!e) return;
55
+ if (!e || e.lineAttribute === LineAttributeType.赠品行) return;
55
56
  sum = sum.add(bignumber(e.lineAmountIncludeTax || 0));
56
57
  });
57
58
  return sum.done().toNumber();
@@ -61,7 +62,7 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
61
62
  _values.set('lineAmountExcludeTax', (() => {
62
63
  let sum = chain(bignumber(0));
63
64
  this.state.goodsListState.goodsList.forEach(e => {
64
- if (!e) return;
65
+ if (!e || e.lineAttribute === LineAttributeType.赠品行) return;
65
66
  sum = sum.add(bignumber(e.lineAmountExcludeTax || 0));
66
67
  });
67
68
  return sum.done().toNumber();
@@ -71,7 +72,7 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
71
72
  _values.set('taxAmount', (() => {
72
73
  let sum = chain(bignumber(0));
73
74
  this.state.goodsListState.goodsList.forEach((e) => {
74
- if (!e) return;
75
+ if (!e || e.lineAttribute === LineAttributeType.赠品行) return;
75
76
  sum = sum.add(bignumber(e.taxAmount || 0));
76
77
  });
77
78
  return sum.done().toNumber();
@@ -259,7 +259,32 @@ const lines: any[] = [
259
259
  "referenceLines": null,
260
260
  "version": 0,
261
261
  taxAmount:1
262
- }
262
+ },
263
+ {
264
+ "serialNumber": "1714491422279110656",
265
+ "lineNumber": 3,
266
+ "taxCode": "3070401000000000000",
267
+ "taxName": "信息技术服务",
268
+ "specification": null,
269
+ "itemName": "技术服务费",
270
+ "itemCode": null,
271
+ "unit": "套",
272
+ "quantity": 1,
273
+ "taxRate": 0.06,
274
+ "priceExcludeTax": 2,
275
+ "priceIncludeTax": 2.12,
276
+ "amountTax": 0.12,
277
+ "lineAmountExcludeTax": 5,
278
+ "lineAmountIncludeTax": 5.3,
279
+ "lineAttribute": LineAttributeType.赠品行,
280
+ "discountGroup": null,
281
+ "favouredPolicyMark": false,
282
+ "favouredPolicyName": null,
283
+ "zeroTaxRateFlag": null,
284
+ "referenceLines": null,
285
+ "version": 0,
286
+ taxAmount:1
287
+ }
263
288
  ]
264
289
 
265
290
  const moke = [
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- // import { Button } from 'kts-components-antd-x3';
3
2
  import Invoice from '../../../../../../../../..';
4
- import { IGood, LineAttributeType } from '../../../../../../../../../InvoiceController';
5
3
  import { endowCode } from '../../../../autoFillFn';
4
+ import { IGood, LineAttributeType } from '../../../../../../../../../InvoiceController';
6
5
 
7
6
  // const { Text } = Typography;
8
7
 
@@ -14,25 +13,13 @@ export default (goods: IGood) => {
14
13
  endowCode(controller, goods);
15
14
  }, [controller, goods]);
16
15
 
17
- if (goods.lineAttribute === LineAttributeType.折让行) {
18
- return undefined;
19
- }
20
-
21
- return {
22
- key: 'endowCode',
23
- title: '赋码',
24
- onClick,
16
+ if ([LineAttributeType.正常, LineAttributeType.被折扣行, LineAttributeType.折扣行].indexOf(goods.lineAttribute) >= 0) {
17
+ return {
18
+ key: 'endowCode',
19
+ title: '赋码',
20
+ onClick,
21
+ }
22
+ } else {
23
+ return undefined
25
24
  }
26
-
27
- // return React.useMemo(() => {
28
- // return (
29
- // <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
30
- // );
31
- // }, [goods.lineAttribute, onClick])
32
-
33
- // return React.useMemo(() => {
34
- // return (
35
- // <Button key="endowCode" type="link" onClick={onClick} >赋码</Button>
36
- // );
37
- // }, [goods.lineAttribute, onClick])
38
25
  };
@@ -36,11 +36,11 @@ export default function useMergeDetails() {
36
36
  return [
37
37
  {
38
38
  key: '0',
39
- label: '自动合并',
39
+ label: '处理全部行',
40
40
  onClick: onClickAuto,
41
41
  }, {
42
42
  key: '1',
43
- label: '手动合并',
43
+ label: '处理选中行',
44
44
  disabled: selectedGoodIndex.length <= 1,
45
45
  onClick: onClickManual,
46
46
  },
@@ -46,12 +46,12 @@ export default function useSalesGifts() {
46
46
  return [
47
47
  {
48
48
  key: '0',
49
- label: '自动转换',
49
+ label: '处理全部行',
50
50
  disabled: giveaways.length <= 0,
51
51
  onClick: onClickAuto,
52
52
  }, {
53
53
  key: '1',
54
- label: '手动转换',
54
+ label: '处理选中行',
55
55
  disabled: selectedGoodIndex.length <= 0,
56
56
  onClick: onClickManual,
57
57
  },
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { } from 'kts-components-antd-x3';
3
3
  import { chain, bignumber } from 'mathjs';
4
+ import { LineAttributeType } from '../../../../../../Invoice/InvoiceController';
4
5
  import Invoice from '../../../../..';
5
6
  import './index.less';
6
7
 
@@ -23,6 +24,7 @@ export default () => {
23
24
  const err = s.goodsListState.form?.getFieldsError() ?? {};
24
25
 
25
26
  s.goodsListState.goodsList.forEach((e) => {
27
+ if (e.lineAttribute === LineAttributeType.赠品行) return;
26
28
  if (e.$index === editGood?.$index) {
27
29
  if (!err.lineAmountIncludeTax) {
28
30
  sum = sum.add(bignumber(editGood.lineAmountIncludeTax || 0));
@@ -45,6 +47,7 @@ export default () => {
45
47
  const err = s.goodsListState.form?.getFieldsError() ?? {};
46
48
 
47
49
  s.goodsListState.goodsList.forEach((e) => {
50
+ if (e.lineAttribute === LineAttributeType.赠品行) return;
48
51
  if (e.$index === editGood?.$index) {
49
52
  if (!err.lineAmountExcludeTax) {
50
53
  sum = sum.add(bignumber(editGood.lineAmountExcludeTax || 0));
@@ -65,6 +68,7 @@ export default () => {
65
68
  let sum = chain(bignumber(0));
66
69
  const editGood = s.goodsListState.editGood; // 正在编辑的货物
67
70
  s.goodsListState.goodsList.forEach((e) => {
71
+ if (e.lineAttribute === LineAttributeType.赠品行) return;
68
72
  if (e.$index === editGood?.$index) {
69
73
  sum = sum.add(bignumber(editGood.taxAmount || 0));
70
74
  } else {
@@ -34,7 +34,7 @@ const Main = decorator<ISellerProps, ISellerProps & FormComponentProps>(Form.cre
34
34
  const controller = Invoice.useInvoiceController();
35
35
 
36
36
  /** 控制器 */
37
- const model = controller.useMemo(s => s.model, [])
37
+ const model = controller.useMemo(s => s.model, []);
38
38
 
39
39
  /** 注册 form 对象 */
40
40
  controller.useForm('seller', form);