kts-component-invoice-operate 3.0.3 → 3.0.4
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/index.d.ts +6 -2
- package/dist/index.esm.js +47 -20
- package/dist/index.js +47 -20
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +7 -3
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +14 -5
- package/src/Invoice/ui/GoodsList/hook/useOnRow/index.tsx +2 -1
- package/src/Invoice/ui/GoodsList/ui/AddRowButton/index.tsx +1 -0
- package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +3 -3
- package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +6 -2
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import GoodsListState from './GoodsListState';
|
|
2
2
|
import BuyerState from './BuyerState';
|
|
3
3
|
export default class InvoiceControllerState {
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 组件模式
|
|
6
|
+
* prefab 预制
|
|
7
|
+
* readOnly 只读
|
|
8
|
+
* */
|
|
9
|
+
model: 'default' | 'prefab' | 'readOnly';
|
|
6
10
|
/**
|
|
7
11
|
* 企业类型
|
|
8
12
|
* 01 一般纳税人
|
package/dist/index.esm.js
CHANGED
|
@@ -2126,6 +2126,7 @@ var AddRowButton = (function () {
|
|
|
2126
2126
|
}, _callee2);
|
|
2127
2127
|
})), [controller]);
|
|
2128
2128
|
if (model === 'prefab') return React.createElement(React.Fragment, null);
|
|
2129
|
+
if (model === 'readOnly') return React.createElement(React.Fragment, null);
|
|
2129
2130
|
return React.createElement(Button, {
|
|
2130
2131
|
onClick: onClick,
|
|
2131
2132
|
disabled: disabled
|
|
@@ -9392,6 +9393,11 @@ var useColumns = (function (form) {
|
|
|
9392
9393
|
var isTaxIncluded = controller.useMemo(function (e) {
|
|
9393
9394
|
return e.goodsListState.isTaxIncluded;
|
|
9394
9395
|
}, []);
|
|
9396
|
+
/** 组件模式 */
|
|
9397
|
+
|
|
9398
|
+
var model = controller.useMemo(function (e) {
|
|
9399
|
+
return e.model;
|
|
9400
|
+
}, []);
|
|
9395
9401
|
/** 是否显示我方 */
|
|
9396
9402
|
|
|
9397
9403
|
var isMyShow = controller.useMemo(function (e) {
|
|
@@ -9507,7 +9513,7 @@ var useColumns = (function (form) {
|
|
|
9507
9513
|
}
|
|
9508
9514
|
})), React.createElement("div", {
|
|
9509
9515
|
className: "kts-invoice-operate-goods-list-able-list-itemName-import"
|
|
9510
|
-
}, controller.getGoodsList && React.createElement(Tooltip, {
|
|
9516
|
+
}, controller.getGoodsList && model !== 'readOnly' && React.createElement(Tooltip, {
|
|
9511
9517
|
title: "\u70B9\u51FB\u4ECE\u5546\u54C1\u7BA1\u7406\u4E2D\u6DFB\u52A0\u5546\u54C1\u4FE1\u606F"
|
|
9512
9518
|
}, React.createElement(Button, {
|
|
9513
9519
|
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
@@ -9538,9 +9544,7 @@ var useColumns = (function (form) {
|
|
|
9538
9544
|
valueT: formatSearch(record.itemNameSelf, searchValue),
|
|
9539
9545
|
valueF: formatSearch(record.itemName, searchValue),
|
|
9540
9546
|
isMyShow: isMyShow
|
|
9541
|
-
});
|
|
9542
|
-
// <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
|
|
9543
|
-
// );
|
|
9547
|
+
});
|
|
9544
9548
|
}
|
|
9545
9549
|
}
|
|
9546
9550
|
}, {
|
|
@@ -10087,18 +10091,26 @@ var useColumns = (function (form) {
|
|
|
10087
10091
|
goods: record
|
|
10088
10092
|
});
|
|
10089
10093
|
}
|
|
10090
|
-
}]
|
|
10094
|
+
}] // 含税不含税
|
|
10095
|
+
.filter(function (e) {
|
|
10091
10096
|
if (isTaxIncluded) {
|
|
10092
10097
|
return !(e.key === 'priceExcludeTax' || e.key === 'lineAmountExcludeTax');
|
|
10093
10098
|
} else {
|
|
10094
10099
|
return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
|
|
10095
10100
|
}
|
|
10101
|
+
}) // 只读
|
|
10102
|
+
.filter(function (e) {
|
|
10103
|
+
if (model === 'readOnly') {
|
|
10104
|
+
return e.key !== 'operating';
|
|
10105
|
+
} else {
|
|
10106
|
+
return true;
|
|
10107
|
+
}
|
|
10096
10108
|
}).map(function (e) {
|
|
10097
10109
|
return _objectSpread2(_objectSpread2({}, e), {}, {
|
|
10098
10110
|
ellipsis: true
|
|
10099
10111
|
});
|
|
10100
10112
|
});
|
|
10101
|
-
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue]);
|
|
10113
|
+
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model]);
|
|
10102
10114
|
React.useEffect(function () {
|
|
10103
10115
|
if (!changeField) return;
|
|
10104
10116
|
var t = setTimeout(function () {
|
|
@@ -10300,34 +10312,42 @@ var useOnRow = (function () {
|
|
|
10300
10312
|
return _context2.abrupt("return");
|
|
10301
10313
|
|
|
10302
10314
|
case 2:
|
|
10315
|
+
if (!(model === 'readOnly')) {
|
|
10316
|
+
_context2.next = 4;
|
|
10317
|
+
break;
|
|
10318
|
+
}
|
|
10319
|
+
|
|
10320
|
+
return _context2.abrupt("return");
|
|
10321
|
+
|
|
10322
|
+
case 4:
|
|
10303
10323
|
editGood = controller.state.goodsListState.editGood;
|
|
10304
10324
|
|
|
10305
10325
|
if (!(record.lineAttribute !== LineAttributeType$1.正常)) {
|
|
10306
|
-
_context2.next =
|
|
10326
|
+
_context2.next = 7;
|
|
10307
10327
|
break;
|
|
10308
10328
|
}
|
|
10309
10329
|
|
|
10310
10330
|
return _context2.abrupt("return");
|
|
10311
10331
|
|
|
10312
|
-
case
|
|
10332
|
+
case 7:
|
|
10313
10333
|
if (!editGood) {
|
|
10314
|
-
_context2.next =
|
|
10334
|
+
_context2.next = 16;
|
|
10315
10335
|
break;
|
|
10316
10336
|
}
|
|
10317
10337
|
|
|
10318
10338
|
if (!(editGood.$index === record.$index)) {
|
|
10319
|
-
_context2.next =
|
|
10339
|
+
_context2.next = 10;
|
|
10320
10340
|
break;
|
|
10321
10341
|
}
|
|
10322
10342
|
|
|
10323
10343
|
return _context2.abrupt("return");
|
|
10324
10344
|
|
|
10325
|
-
case 8:
|
|
10326
|
-
_context2.next = 10;
|
|
10327
|
-
return controller.saveEditGood();
|
|
10328
|
-
|
|
10329
10345
|
case 10:
|
|
10330
10346
|
_context2.next = 12;
|
|
10347
|
+
return controller.saveEditGood();
|
|
10348
|
+
|
|
10349
|
+
case 12:
|
|
10350
|
+
_context2.next = 14;
|
|
10331
10351
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
10332
10352
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10333
10353
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -10357,15 +10377,15 @@ var useOnRow = (function () {
|
|
|
10357
10377
|
};
|
|
10358
10378
|
}())();
|
|
10359
10379
|
|
|
10360
|
-
case
|
|
10361
|
-
_context2.next =
|
|
10380
|
+
case 14:
|
|
10381
|
+
_context2.next = 18;
|
|
10362
10382
|
break;
|
|
10363
10383
|
|
|
10364
|
-
case
|
|
10365
|
-
_context2.next =
|
|
10384
|
+
case 16:
|
|
10385
|
+
_context2.next = 18;
|
|
10366
10386
|
return controller.setEditGood(record);
|
|
10367
10387
|
|
|
10368
|
-
case
|
|
10388
|
+
case 18:
|
|
10369
10389
|
case "end":
|
|
10370
10390
|
return _context2.stop();
|
|
10371
10391
|
}
|
|
@@ -10775,6 +10795,9 @@ var coolingFn = (function () {
|
|
|
10775
10795
|
|
|
10776
10796
|
var useEndowCodeButton = (function () {
|
|
10777
10797
|
var controller = Invoice.useInvoiceController();
|
|
10798
|
+
var model = controller.useMemo(function (s) {
|
|
10799
|
+
return s.model;
|
|
10800
|
+
}, []);
|
|
10778
10801
|
/** 是否禁用 */
|
|
10779
10802
|
|
|
10780
10803
|
var disabled = controller.useMemo(function (s) {
|
|
@@ -10852,6 +10875,7 @@ var useEndowCodeButton = (function () {
|
|
|
10852
10875
|
}, _callee2);
|
|
10853
10876
|
})), [controller]);
|
|
10854
10877
|
var menuItem = React.useMemo(function () {
|
|
10878
|
+
if (model === 'readOnly') return React.createElement(React.Fragment, null);
|
|
10855
10879
|
return React.createElement(Menu.Item, {
|
|
10856
10880
|
key: "2",
|
|
10857
10881
|
onClick: onClick,
|
|
@@ -10859,6 +10883,7 @@ var useEndowCodeButton = (function () {
|
|
|
10859
10883
|
}, "\u6279\u91CF\u8D4B\u7801");
|
|
10860
10884
|
}, [onClick, disabled]);
|
|
10861
10885
|
var button = React.useMemo(function () {
|
|
10886
|
+
if (model === 'readOnly') return React.createElement(React.Fragment, null);
|
|
10862
10887
|
return React.createElement(Button, {
|
|
10863
10888
|
onClick: onClick,
|
|
10864
10889
|
disabled: disabled
|
|
@@ -10923,14 +10948,16 @@ var useDelRowButton = (function () {
|
|
|
10923
10948
|
}, [controller]);
|
|
10924
10949
|
var menuItem = React.useMemo(function () {
|
|
10925
10950
|
if (model === 'prefab') return React.createElement(React.Fragment, null);
|
|
10951
|
+
if (model === 'readOnly') return React.createElement(React.Fragment, null);
|
|
10926
10952
|
return React.createElement(Menu.Item, {
|
|
10927
10953
|
key: "1",
|
|
10928
10954
|
onClick: onClick,
|
|
10929
10955
|
disabled: disabled
|
|
10930
|
-
}, "\u5220\u9664\u884C");
|
|
10956
|
+
}, " \u5220\u9664\u884C ");
|
|
10931
10957
|
}, [model, onClick, disabled]);
|
|
10932
10958
|
var button = React.useMemo(function () {
|
|
10933
10959
|
if (model === 'prefab') return React.createElement(React.Fragment, null);
|
|
10960
|
+
if (model === 'readOnly') return React.createElement(React.Fragment, null);
|
|
10934
10961
|
return React.createElement(Button, {
|
|
10935
10962
|
onClick: onClick,
|
|
10936
10963
|
disabled: disabled
|
package/dist/index.js
CHANGED
|
@@ -2136,6 +2136,7 @@ var AddRowButton = (function () {
|
|
|
2136
2136
|
}, _callee2);
|
|
2137
2137
|
})), [controller]);
|
|
2138
2138
|
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
2139
|
+
if (model === 'readOnly') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
2139
2140
|
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
2140
2141
|
onClick: onClick,
|
|
2141
2142
|
disabled: disabled
|
|
@@ -9402,6 +9403,11 @@ var useColumns = (function (form) {
|
|
|
9402
9403
|
var isTaxIncluded = controller.useMemo(function (e) {
|
|
9403
9404
|
return e.goodsListState.isTaxIncluded;
|
|
9404
9405
|
}, []);
|
|
9406
|
+
/** 组件模式 */
|
|
9407
|
+
|
|
9408
|
+
var model = controller.useMemo(function (e) {
|
|
9409
|
+
return e.model;
|
|
9410
|
+
}, []);
|
|
9405
9411
|
/** 是否显示我方 */
|
|
9406
9412
|
|
|
9407
9413
|
var isMyShow = controller.useMemo(function (e) {
|
|
@@ -9517,7 +9523,7 @@ var useColumns = (function (form) {
|
|
|
9517
9523
|
}
|
|
9518
9524
|
})), React__default['default'].createElement("div", {
|
|
9519
9525
|
className: "kts-invoice-operate-goods-list-able-list-itemName-import"
|
|
9520
|
-
}, controller.getGoodsList && React__default['default'].createElement(ktsComponentsAntdX3.Tooltip, {
|
|
9526
|
+
}, controller.getGoodsList && model !== 'readOnly' && React__default['default'].createElement(ktsComponentsAntdX3.Tooltip, {
|
|
9521
9527
|
title: "\u70B9\u51FB\u4ECE\u5546\u54C1\u7BA1\u7406\u4E2D\u6DFB\u52A0\u5546\u54C1\u4FE1\u606F"
|
|
9522
9528
|
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
9523
9529
|
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
@@ -9548,9 +9554,7 @@ var useColumns = (function (form) {
|
|
|
9548
9554
|
valueT: formatSearch(record.itemNameSelf, searchValue),
|
|
9549
9555
|
valueF: formatSearch(record.itemName, searchValue),
|
|
9550
9556
|
isMyShow: isMyShow
|
|
9551
|
-
});
|
|
9552
|
-
// <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
|
|
9553
|
-
// );
|
|
9557
|
+
});
|
|
9554
9558
|
}
|
|
9555
9559
|
}
|
|
9556
9560
|
}, {
|
|
@@ -10097,18 +10101,26 @@ var useColumns = (function (form) {
|
|
|
10097
10101
|
goods: record
|
|
10098
10102
|
});
|
|
10099
10103
|
}
|
|
10100
|
-
}]
|
|
10104
|
+
}] // 含税不含税
|
|
10105
|
+
.filter(function (e) {
|
|
10101
10106
|
if (isTaxIncluded) {
|
|
10102
10107
|
return !(e.key === 'priceExcludeTax' || e.key === 'lineAmountExcludeTax');
|
|
10103
10108
|
} else {
|
|
10104
10109
|
return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
|
|
10105
10110
|
}
|
|
10111
|
+
}) // 只读
|
|
10112
|
+
.filter(function (e) {
|
|
10113
|
+
if (model === 'readOnly') {
|
|
10114
|
+
return e.key !== 'operating';
|
|
10115
|
+
} else {
|
|
10116
|
+
return true;
|
|
10117
|
+
}
|
|
10106
10118
|
}).map(function (e) {
|
|
10107
10119
|
return _objectSpread2(_objectSpread2({}, e), {}, {
|
|
10108
10120
|
ellipsis: true
|
|
10109
10121
|
});
|
|
10110
10122
|
});
|
|
10111
|
-
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue]);
|
|
10123
|
+
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model]);
|
|
10112
10124
|
React__default['default'].useEffect(function () {
|
|
10113
10125
|
if (!changeField) return;
|
|
10114
10126
|
var t = setTimeout(function () {
|
|
@@ -10310,34 +10322,42 @@ var useOnRow = (function () {
|
|
|
10310
10322
|
return _context2.abrupt("return");
|
|
10311
10323
|
|
|
10312
10324
|
case 2:
|
|
10325
|
+
if (!(model === 'readOnly')) {
|
|
10326
|
+
_context2.next = 4;
|
|
10327
|
+
break;
|
|
10328
|
+
}
|
|
10329
|
+
|
|
10330
|
+
return _context2.abrupt("return");
|
|
10331
|
+
|
|
10332
|
+
case 4:
|
|
10313
10333
|
editGood = controller.state.goodsListState.editGood;
|
|
10314
10334
|
|
|
10315
10335
|
if (!(record.lineAttribute !== LineAttributeType$1.正常)) {
|
|
10316
|
-
_context2.next =
|
|
10336
|
+
_context2.next = 7;
|
|
10317
10337
|
break;
|
|
10318
10338
|
}
|
|
10319
10339
|
|
|
10320
10340
|
return _context2.abrupt("return");
|
|
10321
10341
|
|
|
10322
|
-
case
|
|
10342
|
+
case 7:
|
|
10323
10343
|
if (!editGood) {
|
|
10324
|
-
_context2.next =
|
|
10344
|
+
_context2.next = 16;
|
|
10325
10345
|
break;
|
|
10326
10346
|
}
|
|
10327
10347
|
|
|
10328
10348
|
if (!(editGood.$index === record.$index)) {
|
|
10329
|
-
_context2.next =
|
|
10349
|
+
_context2.next = 10;
|
|
10330
10350
|
break;
|
|
10331
10351
|
}
|
|
10332
10352
|
|
|
10333
10353
|
return _context2.abrupt("return");
|
|
10334
10354
|
|
|
10335
|
-
case 8:
|
|
10336
|
-
_context2.next = 10;
|
|
10337
|
-
return controller.saveEditGood();
|
|
10338
|
-
|
|
10339
10355
|
case 10:
|
|
10340
10356
|
_context2.next = 12;
|
|
10357
|
+
return controller.saveEditGood();
|
|
10358
|
+
|
|
10359
|
+
case 12:
|
|
10360
|
+
_context2.next = 14;
|
|
10341
10361
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
10342
10362
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10343
10363
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -10367,15 +10387,15 @@ var useOnRow = (function () {
|
|
|
10367
10387
|
};
|
|
10368
10388
|
}())();
|
|
10369
10389
|
|
|
10370
|
-
case
|
|
10371
|
-
_context2.next =
|
|
10390
|
+
case 14:
|
|
10391
|
+
_context2.next = 18;
|
|
10372
10392
|
break;
|
|
10373
10393
|
|
|
10374
|
-
case
|
|
10375
|
-
_context2.next =
|
|
10394
|
+
case 16:
|
|
10395
|
+
_context2.next = 18;
|
|
10376
10396
|
return controller.setEditGood(record);
|
|
10377
10397
|
|
|
10378
|
-
case
|
|
10398
|
+
case 18:
|
|
10379
10399
|
case "end":
|
|
10380
10400
|
return _context2.stop();
|
|
10381
10401
|
}
|
|
@@ -10785,6 +10805,9 @@ var coolingFn = (function () {
|
|
|
10785
10805
|
|
|
10786
10806
|
var useEndowCodeButton = (function () {
|
|
10787
10807
|
var controller = Invoice.useInvoiceController();
|
|
10808
|
+
var model = controller.useMemo(function (s) {
|
|
10809
|
+
return s.model;
|
|
10810
|
+
}, []);
|
|
10788
10811
|
/** 是否禁用 */
|
|
10789
10812
|
|
|
10790
10813
|
var disabled = controller.useMemo(function (s) {
|
|
@@ -10862,6 +10885,7 @@ var useEndowCodeButton = (function () {
|
|
|
10862
10885
|
}, _callee2);
|
|
10863
10886
|
})), [controller]);
|
|
10864
10887
|
var menuItem = React__default['default'].useMemo(function () {
|
|
10888
|
+
if (model === 'readOnly') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10865
10889
|
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
10866
10890
|
key: "2",
|
|
10867
10891
|
onClick: onClick,
|
|
@@ -10869,6 +10893,7 @@ var useEndowCodeButton = (function () {
|
|
|
10869
10893
|
}, "\u6279\u91CF\u8D4B\u7801");
|
|
10870
10894
|
}, [onClick, disabled]);
|
|
10871
10895
|
var button = React__default['default'].useMemo(function () {
|
|
10896
|
+
if (model === 'readOnly') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10872
10897
|
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10873
10898
|
onClick: onClick,
|
|
10874
10899
|
disabled: disabled
|
|
@@ -10933,14 +10958,16 @@ var useDelRowButton = (function () {
|
|
|
10933
10958
|
}, [controller]);
|
|
10934
10959
|
var menuItem = React__default['default'].useMemo(function () {
|
|
10935
10960
|
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10961
|
+
if (model === 'readOnly') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10936
10962
|
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
10937
10963
|
key: "1",
|
|
10938
10964
|
onClick: onClick,
|
|
10939
10965
|
disabled: disabled
|
|
10940
|
-
}, "\u5220\u9664\u884C");
|
|
10966
|
+
}, " \u5220\u9664\u884C ");
|
|
10941
10967
|
}, [model, onClick, disabled]);
|
|
10942
10968
|
var button = React__default['default'].useMemo(function () {
|
|
10943
10969
|
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10970
|
+
if (model === 'readOnly') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10944
10971
|
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10945
10972
|
onClick: onClick,
|
|
10946
10973
|
disabled: disabled
|
package/package.json
CHANGED
|
@@ -3,9 +3,13 @@ import BuyerState from './BuyerState';
|
|
|
3
3
|
|
|
4
4
|
export default class InvoiceControllerState {
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* 组件模式
|
|
8
|
+
* prefab 预制
|
|
9
|
+
* readOnly 只读
|
|
10
|
+
* */
|
|
11
|
+
model: 'default' | 'prefab' | 'readOnly' = 'default';
|
|
12
|
+
|
|
9
13
|
/**
|
|
10
14
|
* 企业类型
|
|
11
15
|
* 01 一般纳税人
|
|
@@ -27,6 +27,9 @@ export default (form: WrappedFormUtils) => {
|
|
|
27
27
|
/** 是否含税 */
|
|
28
28
|
const isTaxIncluded = controller.useMemo(e => e.goodsListState.isTaxIncluded, []);
|
|
29
29
|
|
|
30
|
+
/** 组件模式 */
|
|
31
|
+
const model = controller.useMemo(e => e.model, []);
|
|
32
|
+
|
|
30
33
|
/** 是否显示我方 */
|
|
31
34
|
const isMyShow = controller.useMemo(e => e.goodsListState.isMyShow, []);
|
|
32
35
|
|
|
@@ -92,7 +95,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
92
95
|
/>,
|
|
93
96
|
)}
|
|
94
97
|
<div className="kts-invoice-operate-goods-list-able-list-itemName-import">
|
|
95
|
-
{controller.getGoodsList && (
|
|
98
|
+
{controller.getGoodsList && model !== 'readOnly' && (
|
|
96
99
|
<Tooltip title="点击从商品管理中添加商品信息">
|
|
97
100
|
<Button
|
|
98
101
|
onClick={controller.pipeline(async s => { s.goodsListState.importGoods.isVisibleDrawer = true })}
|
|
@@ -113,9 +116,6 @@ export default (form: WrappedFormUtils) => {
|
|
|
113
116
|
isMyShow={isMyShow}
|
|
114
117
|
/>
|
|
115
118
|
)
|
|
116
|
-
// return (
|
|
117
|
-
// <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
|
|
118
|
-
// );
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
},
|
|
@@ -475,6 +475,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
475
475
|
render: (_value: string, record: IGood) => <RowMenu key={record.lineAttribute} goods={record} />,
|
|
476
476
|
},
|
|
477
477
|
]
|
|
478
|
+
// 含税不含税
|
|
478
479
|
.filter((e) => {
|
|
479
480
|
if (isTaxIncluded) {
|
|
480
481
|
return !(e.key === 'priceExcludeTax' || e.key === 'lineAmountExcludeTax');
|
|
@@ -482,13 +483,21 @@ export default (form: WrappedFormUtils) => {
|
|
|
482
483
|
return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
|
|
483
484
|
}
|
|
484
485
|
})
|
|
486
|
+
// 只读
|
|
487
|
+
.filter(e => {
|
|
488
|
+
if (model === 'readOnly') {
|
|
489
|
+
return e.key !== 'operating';
|
|
490
|
+
} else {
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
})
|
|
485
494
|
.map((e) => {
|
|
486
495
|
return {
|
|
487
496
|
...e,
|
|
488
497
|
ellipsis: true,
|
|
489
498
|
};
|
|
490
499
|
}) as any[];
|
|
491
|
-
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue]);
|
|
500
|
+
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model]);
|
|
492
501
|
|
|
493
502
|
React.useEffect(() => {
|
|
494
503
|
if (!changeField) return;
|
|
@@ -15,7 +15,8 @@ export default () => {
|
|
|
15
15
|
|
|
16
16
|
const onClick = React.useCallback(
|
|
17
17
|
async (record: IGood) => {
|
|
18
|
-
if (model === 'prefab') return
|
|
18
|
+
if (model === 'prefab') return;
|
|
19
|
+
if (model === 'readOnly') return;
|
|
19
20
|
|
|
20
21
|
const editGood = controller.state.goodsListState.editGood;
|
|
21
22
|
if (record.lineAttribute !== LineAttributeType.正常) return;
|
|
@@ -45,17 +45,17 @@ export default () => {
|
|
|
45
45
|
const menuItem = React.useMemo(() => {
|
|
46
46
|
|
|
47
47
|
if (model === 'prefab') return <></>;
|
|
48
|
+
if (model === 'readOnly') return <></>;
|
|
48
49
|
|
|
49
50
|
return (
|
|
50
|
-
<Menu.Item key="1" onClick={onClick} disabled={disabled}>
|
|
51
|
-
删除行
|
|
52
|
-
</Menu.Item>
|
|
51
|
+
<Menu.Item key="1" onClick={onClick} disabled={disabled}> 删除行 </Menu.Item>
|
|
53
52
|
)
|
|
54
53
|
}, [model, onClick, disabled])
|
|
55
54
|
|
|
56
55
|
const button = React.useMemo(() => {
|
|
57
56
|
|
|
58
57
|
if (model === 'prefab') return <></>;
|
|
58
|
+
if (model === 'readOnly') return <></>;
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
61
|
<Button onClick={onClick} disabled={disabled} >批量删除</Button>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Invoice from '../../../../../../';
|
|
3
|
-
import { message
|
|
3
|
+
import { message, Menu, Button } from 'kts-components-antd-x3';
|
|
4
4
|
import coolingFn from '../../../../../../tools/coolingFn';
|
|
5
5
|
|
|
6
6
|
export default () => {
|
|
7
|
+
|
|
7
8
|
const controller = Invoice.useInvoiceController();
|
|
8
9
|
|
|
10
|
+
const model = controller.useMemo(s => s.model, []);
|
|
11
|
+
|
|
9
12
|
/** 是否禁用 */
|
|
10
13
|
const disabled = controller.useMemo((s) => {
|
|
11
14
|
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
@@ -34,7 +37,7 @@ export default () => {
|
|
|
34
37
|
}, [controller]);
|
|
35
38
|
|
|
36
39
|
const menuItem = React.useMemo(() => {
|
|
37
|
-
|
|
40
|
+
if (model === 'readOnly') return <></>;
|
|
38
41
|
return (
|
|
39
42
|
<Menu.Item key="2" onClick={onClick} disabled={disabled}>
|
|
40
43
|
批量赋码
|
|
@@ -43,6 +46,7 @@ export default () => {
|
|
|
43
46
|
}, [onClick, disabled])
|
|
44
47
|
|
|
45
48
|
const button = React.useMemo(() => {
|
|
49
|
+
if (model === 'readOnly') return <></>;
|
|
46
50
|
return (
|
|
47
51
|
<Button onClick={onClick} disabled={disabled}>
|
|
48
52
|
批量赋码
|