kts-component-invoice-operate 2.0.18 → 2.0.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -109,6 +109,7 @@ export default async (state: InvoiceControllerState, options?: IOptions) => {
109
109
  taxClassificationCode: good.taxClassificationCode,
110
110
  taxRate: good.taxRate,
111
111
  itemName:good.itemName,
112
+ itemNameSelf:good.itemNameSelf,
112
113
  discountGroup,
113
114
  lineAmountIncludeTax,
114
115
  lineAmountExcludeTax,
@@ -459,11 +459,11 @@ const components = {
459
459
 
460
460
  /** 提取简称 */
461
461
  const getShorthand = (value?: string) => {
462
- if (!value) return undefined;
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 undefined;
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: 50,
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 { Menu, message, Typography } from 'kts-components-antd-x3';
2
+ import { Button } from 'kts-components-antd-x3';
3
3
  import Invoice from '../../../../../../../../';
4
- import { IGood, LineAttributeType } from '../../../../../../../../InvoiceController';
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
- <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
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
 
@@ -27,11 +27,11 @@ export default (props: { goods: IGood }) => {
27
27
 
28
28
  const itemList = React.useMemo(() => {
29
29
  const arr: any[] = [];
30
-
31
- model !=='prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
32
- arr.push(addComparison); // 添加商品对照
33
- endowCode && arr.push(endowCode); // 赋码
34
- model !=='prefab' && delItem && arr.push(delItem); // 删除
30
+
31
+ model !== 'prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
32
+ arr.push(addComparison); // 添加商品对照
33
+ // endowCode && arr.push(endowCode); // 赋码
34
+ model !== 'prefab' && delItem && arr.push(delItem); // 删除
35
35
 
36
36
  if (!goodsMenuExpand || goodsMenuExpand.length === 0) return arr;
37
37
 
@@ -52,10 +52,13 @@ export default (props: { goods: IGood }) => {
52
52
  }
53
53
 
54
54
  return (
55
- <Dropdown overlay={<Menu>{itemList}</Menu>} trigger={['click']}>
56
- <Button className="kts-invoice-operate-goods-list-columns-row-menu ant-btn-icon-only" type="link">
57
- <Icon component={SpotSvg} />
58
- </Button>
59
- </Dropdown>
55
+ <span>
56
+ {endowCode}
57
+ <Dropdown overlay={<Menu>{itemList}</Menu>} trigger={['click']}>
58
+ <Button className="kts-invoice-operate-goods-list-columns-row-menu ant-btn-icon-only" type="link">
59
+ <Icon component={SpotSvg} />
60
+ </Button>
61
+ </Dropdown>
62
+ </span>
60
63
  );
61
64
  };