kts-component-invoice-operate 3.2.156-4 → 3.2.156-6

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.
@@ -56,4 +56,5 @@ export default interface IGood {
56
56
  productName?: string;
57
57
  /** 孩子 */
58
58
  children?: IGood[];
59
+ referenceLines?: any[];
59
60
  }
@@ -24,6 +24,7 @@ export default class GoodsListState {
24
24
  isAddRow: boolean;
25
25
  /** 是否可以删除行 */
26
26
  isRemRow: boolean;
27
+ isBatchRemRow: boolean;
27
28
  /** 是否含税 */
28
29
  isTaxIncluded: boolean;
29
30
  /**
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 = false;
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
  }
@@ -13522,6 +13529,9 @@ var useDelRowButton = (function () {
13522
13529
  var isRemRow = controller.useMemo(function (s) {
13523
13530
  return s.goodsListState.isRemRow;
13524
13531
  }, []);
13532
+ var isBatchRemRow = controller.useMemo(function (s) {
13533
+ return s.goodsListState.isBatchRemRow;
13534
+ }, []);
13525
13535
  /** 是否禁用 */
13526
13536
 
13527
13537
  var disabled = controller.useMemo(function (s) {
@@ -13578,6 +13588,7 @@ var useDelRowButton = (function () {
13578
13588
  }, " \u5220\u9664\u884C ");
13579
13589
  }, [model, onClick, disabled]);
13580
13590
  var button = React.useMemo(function () {
13591
+ if (isBatchRemRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
13581
13592
  if (isRemRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
13582
13593
  if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
13583
13594
  if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -13585,7 +13596,7 @@ var useDelRowButton = (function () {
13585
13596
  onClick: onClick,
13586
13597
  disabled: disabled
13587
13598
  }, "\u6279\u91CF\u5220\u9664");
13588
- }, [model, onClick, disabled, isRemRow]);
13599
+ }, [model, onClick, disabled, isRemRow, isBatchRemRow]);
13589
13600
  return {
13590
13601
  button: button,
13591
13602
  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 = false;
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
  }
@@ -13532,6 +13539,9 @@ var useDelRowButton = (function () {
13532
13539
  var isRemRow = controller.useMemo(function (s) {
13533
13540
  return s.goodsListState.isRemRow;
13534
13541
  }, []);
13542
+ var isBatchRemRow = controller.useMemo(function (s) {
13543
+ return s.goodsListState.isBatchRemRow;
13544
+ }, []);
13535
13545
  /** 是否禁用 */
13536
13546
 
13537
13547
  var disabled = controller.useMemo(function (s) {
@@ -13588,6 +13598,7 @@ var useDelRowButton = (function () {
13588
13598
  }, " \u5220\u9664\u884C ");
13589
13599
  }, [model, onClick, disabled]);
13590
13600
  var button = React__default['default'].useMemo(function () {
13601
+ if (isBatchRemRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
13591
13602
  if (isRemRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
13592
13603
  if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
13593
13604
  if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
@@ -13595,7 +13606,7 @@ var useDelRowButton = (function () {
13595
13606
  onClick: onClick,
13596
13607
  disabled: disabled
13597
13608
  }, "\u6279\u91CF\u5220\u9664");
13598
- }, [model, onClick, disabled, isRemRow]);
13609
+ }, [model, onClick, disabled, isRemRow, isBatchRemRow]);
13599
13610
  return {
13600
13611
  button: button,
13601
13612
  menuItem: menuItem
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.156-4",
3
+ "version": "3.2.156-6",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -84,4 +84,6 @@ export default interface IGood {
84
84
 
85
85
  /** 孩子 */
86
86
  children?: IGood[];
87
+
88
+ referenceLines?: any[];
87
89
  }
@@ -33,6 +33,7 @@ export default class GoodsListState {
33
33
  /** 是否可以删除行 */
34
34
  isRemRow = true;
35
35
 
36
+ isBatchRemRow = false;
36
37
  /** 是否含税 */
37
38
  isTaxIncluded = true;
38
39
 
@@ -17,11 +17,14 @@ export default (goods: IGood) => {
17
17
  controller.delGood(goods.$index);
18
18
  }, [controller, goods.$index]);
19
19
 
20
+ if (goods.lineAttribute === LineAttributeType.正常 && goods?.referenceLines && goods?.referenceLines?.length > 0) {
21
+ return undefined;
22
+ }
20
23
  if (goods.lineAttribute === LineAttributeType.被折扣行) {
21
24
  return undefined;
22
25
  }
23
26
 
24
- if(isRemRow === false) {
27
+ if (isRemRow === false) {
25
28
  return undefined;
26
29
  }
27
30
 
@@ -30,8 +33,8 @@ export default (goods: IGood) => {
30
33
  }
31
34
 
32
35
  return {
33
- key:'delItem',
34
- title:'删除',
36
+ key: 'delItem',
37
+ title: '删除',
35
38
  onClick,
36
39
  }
37
40
 
@@ -10,7 +10,7 @@ export default () => {
10
10
  const model = controller.useMemo(s => s.model, []);
11
11
 
12
12
  const isRemRow = controller.useMemo(s => s.goodsListState.isRemRow, []);
13
-
13
+ const isBatchRemRow = controller.useMemo(s => s.goodsListState.isBatchRemRow, []);
14
14
  /** 是否禁用 */
15
15
  const disabled = controller.useMemo((s) => {
16
16
  if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
@@ -55,7 +55,7 @@ export default () => {
55
55
  }, [model, onClick, disabled])
56
56
 
57
57
  const button = React.useMemo(() => {
58
-
58
+ if (isBatchRemRow === false) return <></>;
59
59
  if (isRemRow === false) return <></>;
60
60
  if (model === 'prefab') return <></>;
61
61
  if (model === 'readOnly') return <></>;
@@ -63,7 +63,7 @@ export default () => {
63
63
  return (
64
64
  <Button onClick={onClick} disabled={disabled} >批量删除</Button>
65
65
  )
66
- }, [model, onClick, disabled, isRemRow])
66
+ }, [model, onClick, disabled, isRemRow, isBatchRemRow])
67
67
 
68
68
  return { button, menuItem };
69
69
  };