kts-component-invoice-operate 3.2.181-17 → 3.2.181-19

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
  }
@@ -2,6 +2,6 @@ import { IGood } from '../../../../../../../../../InvoiceController';
2
2
  declare const _default: (goods: IGood) => {
3
3
  key: string;
4
4
  title: string;
5
- onClick: () => void;
5
+ disabled: () => void;
6
6
  } | undefined;
7
7
  export default _default;
package/dist/index.esm.js CHANGED
@@ -11118,6 +11118,8 @@ function SvgSpot(props) {
11118
11118
  }
11119
11119
 
11120
11120
  var useDelItem = (function (goods) {
11121
+ var _goods$referenceLines;
11122
+
11121
11123
  var controller = Invoice.useInvoiceController();
11122
11124
  var model = controller.useMemo(function (s) {
11123
11125
  return s.model;
@@ -11129,6 +11131,10 @@ var useDelItem = (function (goods) {
11129
11131
  controller.delGood(goods.$index);
11130
11132
  }, [controller, goods.$index]);
11131
11133
 
11134
+ 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) {
11135
+ return undefined;
11136
+ }
11137
+
11132
11138
  if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
11133
11139
  return undefined;
11134
11140
  }
@@ -11144,7 +11150,7 @@ var useDelItem = (function (goods) {
11144
11150
  return {
11145
11151
  key: 'delItem',
11146
11152
  title: '删除',
11147
- onClick: onClick
11153
+ disabled: onClick
11148
11154
  }; // return React.useMemo(() => {
11149
11155
  // return <Menu.Item key="delItem" onClick={onClick}><Text strong type="danger">删除</Text></Menu.Item>
11150
11156
  // }, [onClick])
package/dist/index.js CHANGED
@@ -11128,6 +11128,8 @@ function SvgSpot(props) {
11128
11128
  }
11129
11129
 
11130
11130
  var useDelItem = (function (goods) {
11131
+ var _goods$referenceLines;
11132
+
11131
11133
  var controller = Invoice.useInvoiceController();
11132
11134
  var model = controller.useMemo(function (s) {
11133
11135
  return s.model;
@@ -11139,6 +11141,10 @@ var useDelItem = (function (goods) {
11139
11141
  controller.delGood(goods.$index);
11140
11142
  }, [controller, goods.$index]);
11141
11143
 
11144
+ 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) {
11145
+ return undefined;
11146
+ }
11147
+
11142
11148
  if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
11143
11149
  return undefined;
11144
11150
  }
@@ -11154,7 +11160,7 @@ var useDelItem = (function (goods) {
11154
11160
  return {
11155
11161
  key: 'delItem',
11156
11162
  title: '删除',
11157
- onClick: onClick
11163
+ disabled: onClick
11158
11164
  }; // return React.useMemo(() => {
11159
11165
  // return <Menu.Item key="delItem" onClick={onClick}><Text strong type="danger">删除</Text></Menu.Item>
11160
11166
  // }, [onClick])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.181-17",
3
+ "version": "3.2.181-19",
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
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  // import { Menu, Typography } from 'kts-components-antd-x3';
3
3
  import { IGood, LineAttributeType } from '../../../../../../../../../InvoiceController';
4
- import Invoice from '../../../../../../../../..';
4
+ import Invoice from '../../../../../../../../..';
5
5
 
6
6
  // const { Text } = Typography;
7
7
 
@@ -15,7 +15,11 @@ export default (goods: IGood) => {
15
15
 
16
16
  const onClick = React.useCallback(() => {
17
17
  controller.delGood(goods.$index);
18
- }, [controller, goods.$index]);
18
+ }, [controller, goods.$index]);
19
+
20
+ if (goods.lineAttribute === LineAttributeType.正常 && goods?.referenceLines && goods?.referenceLines?.length > 0 ) {
21
+ return undefined;
22
+ }
19
23
 
20
24
  if (goods.lineAttribute === LineAttributeType.被折扣行) {
21
25
  return undefined;
@@ -32,6 +36,7 @@ export default (goods: IGood) => {
32
36
  return {
33
37
  key:'delItem',
34
38
  title:'删除',
39
+ disabled:
35
40
  onClick,
36
41
  }
37
42