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.
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +1 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +2 -0
- package/dist/index.esm.js +12 -1
- package/dist/index.js +12 -1
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +2 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +2 -0
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +3 -1
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +4 -2
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
package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx
CHANGED
|
@@ -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
|
};
|