kts-component-invoice-operate 2.0.18 → 2.0.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.
- package/dist/index.esm.js +24 -22
- package/dist/index.js +24 -22
- package/docs-dist/404.html +33 -0
- package/docs-dist/index.html +33 -0
- package/docs-dist/static/auto.a6cd905c.svg +1 -0
- package/docs-dist/static/magnifier.2b26be6e.svg +1 -0
- package/docs-dist/static/spot.42e620e1.svg +1 -0
- package/docs-dist/umi.css +21 -0
- package/docs-dist/umi.js +1 -0
- package/package.json +1 -1
- package/src/Invoice/ui/EndowCodeDrawer/index.tsx +2 -2
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +1 -1
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +10 -4
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +16 -11
package/package.json
CHANGED
|
@@ -459,11 +459,11 @@ const components = {
|
|
|
459
459
|
|
|
460
460
|
/** 提取简称 */
|
|
461
461
|
const getShorthand = (value?: string) => {
|
|
462
|
-
if (!value) return
|
|
462
|
+
if (!value) return ' ';
|
|
463
463
|
const arr = value.match(/\*[^*]+\*/);
|
|
464
464
|
if (arr) {
|
|
465
465
|
return arr[0].split('*')[1];
|
|
466
466
|
} else {
|
|
467
|
-
return
|
|
467
|
+
return ' ';
|
|
468
468
|
}
|
|
469
469
|
};
|
|
@@ -473,7 +473,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
473
473
|
title: '操作',
|
|
474
474
|
dataIndex: 'operating',
|
|
475
475
|
key: 'operating',
|
|
476
|
-
width:
|
|
476
|
+
width: 120,
|
|
477
477
|
align: 'center',
|
|
478
478
|
render: (_value: string, record: IGood) => <RowMenu key={record.lineAttribute} goods={record} />,
|
|
479
479
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Button } from 'kts-components-antd-x3';
|
|
3
3
|
import Invoice from '../../../../../../../../';
|
|
4
|
-
import { IGood
|
|
4
|
+
import { IGood } from '../../../../../../../../InvoiceController';
|
|
5
5
|
import { endowCode } from '../../../../autoFillFn';
|
|
6
6
|
|
|
7
|
-
const { Text } = Typography;
|
|
7
|
+
// const { Text } = Typography;
|
|
8
8
|
|
|
9
9
|
export default (goods: IGood) => {
|
|
10
10
|
|
|
@@ -14,9 +14,15 @@ export default (goods: IGood) => {
|
|
|
14
14
|
endowCode(controller, goods);
|
|
15
15
|
}, [controller, goods]);
|
|
16
16
|
|
|
17
|
+
// return React.useMemo(() => {
|
|
18
|
+
// return (
|
|
19
|
+
// <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
|
|
20
|
+
// );
|
|
21
|
+
// }, [goods.lineAttribute, onClick])
|
|
22
|
+
|
|
17
23
|
return React.useMemo(() => {
|
|
18
24
|
return (
|
|
19
|
-
<
|
|
25
|
+
<Button key="endowCode" type="link" onClick={onClick} >赋码</Button>
|
|
20
26
|
);
|
|
21
27
|
}, [goods.lineAttribute, onClick])
|
|
22
28
|
};
|
|
@@ -13,10 +13,10 @@ export default (props: { goods: IGood }) => {
|
|
|
13
13
|
|
|
14
14
|
const controller = Invoice.useInvoiceController();
|
|
15
15
|
|
|
16
|
-
const model = controller.useMemo(s=>s.model, [])
|
|
16
|
+
const model = controller.useMemo(s => s.model, [])
|
|
17
17
|
|
|
18
18
|
/** 是否能添加折扣行 */
|
|
19
|
-
const isAddDiscount = controller.useMemo(s=>s.goodsListState.isAddDiscount, [])
|
|
19
|
+
const isAddDiscount = controller.useMemo(s => s.goodsListState.isAddDiscount, [])
|
|
20
20
|
|
|
21
21
|
const goodsMenuExpand = controller.useMemo(s => s.goodsListState.goodsMenuExpand, []);
|
|
22
22
|
|
|
@@ -25,13 +25,15 @@ export default (props: { goods: IGood }) => {
|
|
|
25
25
|
const endowCode = useEndowCode(props.goods);
|
|
26
26
|
const addComparison = useAddComparison(props.goods);
|
|
27
27
|
|
|
28
|
+
|
|
29
|
+
|
|
28
30
|
const itemList = React.useMemo(() => {
|
|
29
31
|
const arr: any[] = [];
|
|
30
|
-
|
|
31
|
-
model !=='prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
32
|
+
|
|
33
|
+
model !== 'prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
32
34
|
arr.push(addComparison); // 添加商品对照
|
|
33
|
-
endowCode && arr.push(endowCode); // 赋码
|
|
34
|
-
model !=='prefab' && delItem && arr.push(delItem);
|
|
35
|
+
// endowCode && arr.push(endowCode); // 赋码
|
|
36
|
+
model !== 'prefab' && delItem && arr.push(delItem); // 删除
|
|
35
37
|
|
|
36
38
|
if (!goodsMenuExpand || goodsMenuExpand.length === 0) return arr;
|
|
37
39
|
|
|
@@ -52,10 +54,13 @@ export default (props: { goods: IGood }) => {
|
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
return (
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
<span>
|
|
58
|
+
{endowCode}
|
|
59
|
+
<Dropdown overlay={<Menu>{itemList}</Menu>} trigger={['click']}>
|
|
60
|
+
<Button className="kts-invoice-operate-goods-list-columns-row-menu ant-btn-icon-only" type="link">
|
|
61
|
+
<Icon component={SpotSvg} />
|
|
62
|
+
</Button>
|
|
63
|
+
</Dropdown>
|
|
64
|
+
</span>
|
|
60
65
|
);
|
|
61
66
|
};
|