kts-component-invoice-operate 3.2.156-1 → 3.2.156-3

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.
@@ -32,6 +32,7 @@ export default interface IGood {
32
32
  priceExcludeTax?: number;
33
33
  /** 类型 0 正常行, 1 折扣行 2 被折扣行 */
34
34
  lineAttribute: LineAttributeType;
35
+ referenceLines?: any[];
35
36
  /** 金额(含税) */
36
37
  lineAmountIncludeTax?: number;
37
38
  /** 金额(不含税) */
@@ -24,6 +24,8 @@ export default class GoodsListState {
24
24
  isAddRow: boolean;
25
25
  /** 是否可以删除行 */
26
26
  isRemRow: boolean;
27
+ /** 批量删除按钮 */
28
+ isBatchRemRow: boolean;
27
29
  /** 是否含税 */
28
30
  isTaxIncluded: boolean;
29
31
  /**
package/dist/index.esm.js CHANGED
@@ -1098,6 +1098,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1098
1098
  this.isAddDiscount = void 0;
1099
1099
  this.isAddRow = true;
1100
1100
  this.isRemRow = true;
1101
+ this.isBatchRemRow = true;
1101
1102
  this.isTaxIncluded = true;
1102
1103
  this.calculateType = '3';
1103
1104
  this.isMyShow = false;
@@ -10768,6 +10769,8 @@ function SvgSpot(props) {
10768
10769
  }
10769
10770
 
10770
10771
  var useDelItem = (function (goods) {
10772
+ var _goods$referenceLines;
10773
+
10771
10774
  var controller = Invoice.useInvoiceController();
10772
10775
  var model = controller.useMemo(function (s) {
10773
10776
  return s.model;
@@ -10779,6 +10782,10 @@ var useDelItem = (function (goods) {
10779
10782
  controller.delGood(goods.$index);
10780
10783
  }, [controller, goods.$index]);
10781
10784
 
10785
+ if (goods.lineAttribute === LineAttributeType$1.正常 && (goods === null || goods === void 0 ? void 0 : goods.referenceLines) && (goods === null || goods === void 0 ? void 0 : (_goods$referenceLines = goods.referenceLines) === null || _goods$referenceLines === void 0 ? void 0 : _goods$referenceLines.length) > 0) {
10786
+ return undefined;
10787
+ }
10788
+
10782
10789
  if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
10783
10790
  return undefined;
10784
10791
  }
@@ -14976,6 +14983,9 @@ var useDelRowButton = (function () {
14976
14983
  var isRemRow = controller.useMemo(function (s) {
14977
14984
  return s.goodsListState.isRemRow;
14978
14985
  }, []);
14986
+ var isBatchRemRow = controller.useMemo(function (s) {
14987
+ return s.goodsListState.isBatchRemRow;
14988
+ }, []);
14979
14989
  /** 是否禁用 */
14980
14990
 
14981
14991
  var disabled = controller.useMemo(function (s) {
@@ -15032,6 +15042,7 @@ var useDelRowButton = (function () {
15032
15042
  }, " \u5220\u9664\u884C ");
15033
15043
  }, [model, onClick, disabled]);
15034
15044
  var button = React.useMemo(function () {
15045
+ if (isBatchRemRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
15035
15046
  if (isRemRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
15036
15047
  if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
15037
15048
  if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -15039,7 +15050,7 @@ var useDelRowButton = (function () {
15039
15050
  onClick: onClick,
15040
15051
  disabled: disabled
15041
15052
  }, "\u6279\u91CF\u5220\u9664");
15042
- }, [model, onClick, disabled, isRemRow]);
15053
+ }, [model, onClick, disabled, isRemRow, isBatchRemRow]);
15043
15054
  return {
15044
15055
  button: button,
15045
15056
  menuItem: menuItem
package/dist/index.js CHANGED
@@ -1108,6 +1108,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1108
1108
  this.isAddDiscount = void 0;
1109
1109
  this.isAddRow = true;
1110
1110
  this.isRemRow = true;
1111
+ this.isBatchRemRow = true;
1111
1112
  this.isTaxIncluded = true;
1112
1113
  this.calculateType = '3';
1113
1114
  this.isMyShow = false;
@@ -10778,6 +10779,8 @@ function SvgSpot(props) {
10778
10779
  }
10779
10780
 
10780
10781
  var useDelItem = (function (goods) {
10782
+ var _goods$referenceLines;
10783
+
10781
10784
  var controller = Invoice.useInvoiceController();
10782
10785
  var model = controller.useMemo(function (s) {
10783
10786
  return s.model;
@@ -10789,6 +10792,10 @@ var useDelItem = (function (goods) {
10789
10792
  controller.delGood(goods.$index);
10790
10793
  }, [controller, goods.$index]);
10791
10794
 
10795
+ if (goods.lineAttribute === LineAttributeType$1.正常 && (goods === null || goods === void 0 ? void 0 : goods.referenceLines) && (goods === null || goods === void 0 ? void 0 : (_goods$referenceLines = goods.referenceLines) === null || _goods$referenceLines === void 0 ? void 0 : _goods$referenceLines.length) > 0) {
10796
+ return undefined;
10797
+ }
10798
+
10792
10799
  if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
10793
10800
  return undefined;
10794
10801
  }
@@ -14986,6 +14993,9 @@ var useDelRowButton = (function () {
14986
14993
  var isRemRow = controller.useMemo(function (s) {
14987
14994
  return s.goodsListState.isRemRow;
14988
14995
  }, []);
14996
+ var isBatchRemRow = controller.useMemo(function (s) {
14997
+ return s.goodsListState.isBatchRemRow;
14998
+ }, []);
14989
14999
  /** 是否禁用 */
14990
15000
 
14991
15001
  var disabled = controller.useMemo(function (s) {
@@ -15042,6 +15052,7 @@ var useDelRowButton = (function () {
15042
15052
  }, " \u5220\u9664\u884C ");
15043
15053
  }, [model, onClick, disabled]);
15044
15054
  var button = React__default['default'].useMemo(function () {
15055
+ if (isBatchRemRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
15045
15056
  if (isRemRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
15046
15057
  if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
15047
15058
  if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
@@ -15049,7 +15060,7 @@ var useDelRowButton = (function () {
15049
15060
  onClick: onClick,
15050
15061
  disabled: disabled
15051
15062
  }, "\u6279\u91CF\u5220\u9664");
15052
- }, [model, onClick, disabled, isRemRow]);
15063
+ }, [model, onClick, disabled, isRemRow, isBatchRemRow]);
15053
15064
  return {
15054
15065
  button: button,
15055
15066
  menuItem: menuItem
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.156-1",
3
+ "version": "3.2.156-3",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -49,6 +49,8 @@ export default interface IGood {
49
49
  /** 类型 0 正常行, 1 折扣行 2 被折扣行 */
50
50
  lineAttribute: LineAttributeType;
51
51
 
52
+ referenceLines?: any[];
53
+
52
54
  /** 金额(含税) */
53
55
  lineAmountIncludeTax?: number;
54
56
 
@@ -33,6 +33,8 @@ export default class GoodsListState {
33
33
  /** 是否可以删除行 */
34
34
  isRemRow = true;
35
35
 
36
+ /** 批量删除按钮 */
37
+ isBatchRemRow = true;
36
38
  /** 是否含税 */
37
39
  isTaxIncluded = true;
38
40
 
@@ -16,7 +16,9 @@ export default (goods: IGood) => {
16
16
  const onClick = React.useCallback(() => {
17
17
  controller.delGood(goods.$index);
18
18
  }, [controller, goods.$index]);
19
-
19
+ if (goods.lineAttribute === LineAttributeType.正常 && goods?.referenceLines && goods?.referenceLines?.length > 0 ) {
20
+ return undefined;
21
+ }
20
22
  if (goods.lineAttribute === LineAttributeType.被折扣行) {
21
23
  return undefined;
22
24
  }
@@ -11,6 +11,8 @@ export default () => {
11
11
 
12
12
  const isRemRow = controller.useMemo(s => s.goodsListState.isRemRow, []);
13
13
 
14
+ const isBatchRemRow = controller.useMemo(s => s.goodsListState.isBatchRemRow, []);
15
+
14
16
  /** 是否禁用 */
15
17
  const disabled = controller.useMemo((s) => {
16
18
  if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
@@ -55,7 +57,7 @@ export default () => {
55
57
  }, [model, onClick, disabled])
56
58
 
57
59
  const button = React.useMemo(() => {
58
-
60
+ if (isBatchRemRow === false) return <></>;
59
61
  if (isRemRow === false) return <></>;
60
62
  if (model === 'prefab') return <></>;
61
63
  if (model === 'readOnly') return <></>;
@@ -63,7 +65,7 @@ export default () => {
63
65
  return (
64
66
  <Button onClick={onClick} disabled={disabled} >批量删除</Button>
65
67
  )
66
- }, [model, onClick, disabled, isRemRow])
68
+ }, [model, onClick, disabled, isRemRow, isBatchRemRow])
67
69
 
68
70
  return { button, menuItem };
69
71
  };