kts-component-invoice-operate 3.2.155 → 3.2.157

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.
Files changed (31) hide show
  1. package/dist/Invoice/InvoiceController/index.d.ts +2 -0
  2. package/dist/Invoice/index.d.ts +2 -0
  3. package/dist/Invoice/ui/digtal/StakeFarmerholder/index.d.ts +20 -0
  4. package/dist/index.esm.js +806 -226
  5. package/dist/index.js +806 -226
  6. package/docs-dist/umi.css +1 -1
  7. package/docs-dist/umi.js +1 -1
  8. package/package.json +1 -1
  9. package/src/Invoice/Invoice-digtal/_test/easiest/index.tsx +1 -0
  10. package/src/Invoice/InvoiceController/index.ts +2 -0
  11. package/src/Invoice/_test/children/index.tsx +12 -0
  12. package/src/Invoice/index.tsx +4 -0
  13. package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +3 -2
  14. package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/Expand/index.tsx +10 -6
  15. package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/dist/index.js +32 -0
  16. package/src/Invoice/ui/default/GoodsList/ui/TableRow/index.less +12 -1
  17. package/src/Invoice/ui/default/GoodsList/ui/TableRow/index.tsx +19 -5
  18. package/src/Invoice/ui/default/GoodsList/ui/TableVirtual/index.tsx +0 -1
  19. package/src/Invoice/ui/digtal/RealEstateInfo/index.tsx +6 -8
  20. package/src/Invoice/ui/digtal/StakeFarmerholder/index.less +100 -0
  21. package/src/Invoice/ui/digtal/StakeFarmerholder/index.tsx +398 -0
  22. package/src/Invoice/ui/digtal/StakeFarmerholder/svg/arrowDown.svg +3 -0
  23. package/src/Invoice/ui/digtal/StakeFarmerholder/svg/arrowUp.svg +3 -0
  24. package/src/Invoice/ui/digtal/StakeFarmerholder/svg/plus.svg +12 -0
  25. package/docs-dist/static/I001.4ff48f20.svg +0 -1
  26. package/docs-dist/static/I002.38b94da1.svg +0 -1
  27. /package/docs-dist/static/{arrowDown.22c7885c.svg → arrowDown.a1cbf0d8.svg} +0 -0
  28. /package/docs-dist/static/{arrowUp.d707a3e4.svg → arrowUp.4c482054.svg} +0 -0
  29. /package/docs-dist/static/{fork.43eb4ffa.svg → fork.5431267d.svg} +0 -0
  30. /package/docs-dist/static/{plus.384f41d9.svg → plus.44013ce3.svg} +0 -0
  31. /package/docs-dist/static/{plus.0e60e9ea.svg → plus.4fd1af30.svg} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.155",
3
+ "version": "3.2.157",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -6,6 +6,7 @@ export default () => {
6
6
  return (
7
7
  <Invoice
8
8
  invoiceType='digtal'
9
+ stakeholder={<Invoice.StakeFarmerholder/>}
9
10
  invoiceHeader={
10
11
  <Invoice.InvoiceHeader
11
12
  title='自定义'
@@ -82,4 +82,6 @@ export default class InvoiceController extends InvoiceControllerForm {
82
82
  /** 获取货物的税率可选列表, 如果没传taxClassificationCode,返回undefined */
83
83
  getGoodsTaxRateList?: (taxClassificationCode: string) => Promise<number[] | undefined | null>;
84
84
 
85
+ /** 商品列表配置器 */
86
+ setColumnsConfig?: (columns: any[]) => any[];
85
87
  }
@@ -9,8 +9,20 @@ export default () => {
9
9
  const invoiceController = React.useMemo(() => new Invoice.InvoiceController(), [])
10
10
 
11
11
  React.useEffect(() => {
12
+ invoiceController.setColumnsConfig = e => {
13
+ const l = [...e];
14
+ l.splice(-1, 0, {
15
+ title: '扩展',
16
+ dataIndex: 'zk',
17
+ key: 'zk',
18
+ align: 'right',
19
+ });
20
+ return l;
21
+ };
22
+
12
23
  setTimeout(() => {
13
24
  invoiceController.run(async s => {
25
+ s.goodsListState.columnshide = Array.from(new Set([...s.goodsListState.columnshide, 'lineAttribute']))
14
26
  s.goodsListState.goodsList = lines.map(e => ({ $index: idGenerator(), ...e }));
15
27
  })
16
28
  }, 1000)
@@ -15,6 +15,7 @@ import Sign from './ui/default/Sign';
15
15
 
16
16
  import InvoiceHeaderDigtal from './ui/digtal/InvoiceHeader';
17
17
  import Stakeholder from './ui/digtal/Stakeholder';
18
+ import StakeFarmerholder from './ui/digtal/StakeFarmerholder';
18
19
  import SignDigtal from './ui/digtal/Sign';
19
20
  import GoodsListDigtal from './ui/digtal/GoodsList';
20
21
  import RealEstateInfo from './ui/digtal/RealEstateInfo';
@@ -85,6 +86,9 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
85
86
 
86
87
  /** 干系人(数电) */
87
88
  static readonly Stakeholder = Stakeholder;
89
+
90
+ /** 农产品干系人(数电) */
91
+ static readonly StakeFarmerholder = StakeFarmerholder;
88
92
 
89
93
  /** 落款(数电) */
90
94
  static readonly SignDigtal = SignDigtal;
@@ -103,7 +103,7 @@ export default (form: WrappedFormUtils) => {
103
103
  {
104
104
  title: ' ',
105
105
  key: 'expand',
106
- width: 40,
106
+ width: 50,
107
107
  align: 'center',
108
108
  render: (_: any, record: IGood) => <Expand record={record} />
109
109
  },
@@ -612,7 +612,8 @@ export default (form: WrappedFormUtils) => {
612
612
  };
613
613
  }) as any[];
614
614
  }, [isTaxIncluded, editGood, goodsList, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
615
- return columns;
615
+
616
+ return controller.setColumnsConfig ? controller.setColumnsConfig(columns) : columns;
616
617
  };
617
618
 
618
619
  /** 字段 */
@@ -26,25 +26,29 @@ export default function Expand(props: IExpandProps) {
26
26
  return (
27
27
  <Button
28
28
  type='text'
29
- style={{ width: 'auto', color: "#0074ff" }}
30
- icon={<Icon component={I002Svg} />}
29
+ style={{ width: 'auto', color: "#0074ff", padding:0 }}
30
+ // icon={<Icon component={I002Svg} />}
31
31
  onClick={controller.pipeline(async (s, e) => {
32
32
  e?.stopPropagation()
33
33
  s.goodsListState.expandedRowKeys = s.goodsListState.expandedRowKeys.filter(e => e !== record.$index)
34
34
  })}
35
- />
35
+ >
36
+ 收起
37
+ </Button>
36
38
  )
37
39
  } else {
38
40
  return (
39
41
  <Button
40
42
  type='text'
41
- style={{ width: 'auto', color: "#0074ff" }}
42
- icon={<Icon component={I001Svg} />}
43
+ style={{ width: 'auto', color: "#0074ff", padding:0 }}
44
+ // icon={<Icon component={I001Svg} />}
43
45
  onClick={controller.pipeline(async (s, e) => {
44
46
  e?.stopPropagation()
45
47
  s.goodsListState.expandedRowKeys = [...s.goodsListState.expandedRowKeys, record.$index]
46
48
  })}
47
- />
49
+ >
50
+ 展开
51
+ </Button>
48
52
  )
49
53
  }
50
54
  } else {
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ var react_1 = require("react");
4
+ // import { Menu, Typography } from 'kts-components-antd-x3';
5
+ var InvoiceController_1 = require("../../../../../../../../../InvoiceController");
6
+ var __1 = require("../../../../../../../../..");
7
+ // const { Text } = Typography;
8
+ exports["default"] = (function (goods) {
9
+ var controller = __1["default"].useInvoiceController();
10
+ var model = controller.useMemo(function (s) { return s.model; }, []);
11
+ var isRemRow = controller.useMemo(function (s) { return s.goodsListState.isRemRow; }, []);
12
+ var onClick = react_1["default"].useCallback(function () {
13
+ controller.delGood(goods.$index);
14
+ }, [controller, goods.$index]);
15
+ if (goods.lineAttribute === InvoiceController_1.LineAttributeType.被折扣行) {
16
+ return undefined;
17
+ }
18
+ if (isRemRow === false) {
19
+ return undefined;
20
+ }
21
+ if (!(model !== 'prefab')) {
22
+ return undefined;
23
+ }
24
+ return {
25
+ key: 'delItem',
26
+ title: '删除',
27
+ onClick: onClick
28
+ };
29
+ // return React.useMemo(() => {
30
+ // return <Menu.Item key="delItem" onClick={onClick}><Text strong type="danger">删除</Text></Menu.Item>
31
+ // }, [onClick])
32
+ });
@@ -26,4 +26,15 @@
26
26
  bottom : 0;
27
27
  z-index : 9999;
28
28
  }
29
- }
29
+ }
30
+
31
+ .ktsAntX-table .ktsAntX-table-row.ktsAntX-table-row-level-0.kts-invoice-operate-goods-expanded .ktsAntX-table-cell-ellipsis,
32
+ .ktsAntX-table .ktsAntX-table-row.ktsAntX-table-row-level-0.kts-invoice-operate-goods-expanded {
33
+ background: #f0f0f0;
34
+ }
35
+
36
+ .ktsAntX-table .ktsAntX-table-row.ktsAntX-table-row-level-0.kts-invoice-operate-goods-expanded-level-1 .ktsAntX-table-cell-ellipsis,
37
+ .ktsAntX-table .ktsAntX-table-row.ktsAntX-table-row-level-0.kts-invoice-operate-goods-expanded-level-1{
38
+ background: #f6f6f6;
39
+ }
40
+
@@ -10,18 +10,21 @@ export default function TableRow(props: any) {
10
10
 
11
11
  const controller = Invoice.useInvoiceController();
12
12
 
13
- const goodsMap = controller.useMemo(s => s.goodsListState.goodsMap, [])
13
+ const goodsMap = controller.useMemo(s => s.goodsListState.goodsMap, []);
14
+
15
+ /** 子级展开的货物 */
16
+ const expandedRowKeys = controller.useMemo(s => s.goodsListState.expandedRowKeys, []);
14
17
 
15
18
  /** 当前拖动中的货品索引 */
16
- const current = controller.useMemo(s => s.goodsListState.drag.current, [])
19
+ const current = controller.useMemo(s => s.goodsListState.drag.current, []);
17
20
 
18
21
  /** 当前拖动中的货品索引 */
19
- const site = controller.useMemo(s => s.goodsListState.drag.site, [])
22
+ const site = controller.useMemo(s => s.goodsListState.drag.site, []);
20
23
 
21
24
  /** 准备插入的货物索引 */
22
- const container = controller.useMemo(s => s.goodsListState.drag.container, [])
25
+ const container = controller.useMemo(s => s.goodsListState.drag.container, []);
23
26
 
24
- const good = React.useMemo(() => goodsMap?.get(rowKey), [rowKey, goodsMap])
27
+ const good = React.useMemo(() => goodsMap?.get(rowKey), [rowKey, goodsMap]);
25
28
 
26
29
  const discount = React.useMemo(() => {
27
30
  const i = good;
@@ -36,6 +39,16 @@ export default function TableRow(props: any) {
36
39
  }
37
40
  }, [good, goodsMap])
38
41
 
42
+ /** 扩展行样式 */
43
+ const expandedRow = React.useMemo(() => {
44
+ if (expandedRowKeys.indexOf(rowKey) > -1) return 'kts-invoice-operate-goods-expanded';
45
+
46
+ if (expandedRowKeys.map(e => goodsMap.get(e)).map(e => e?.children).flat(1).map(e => e?.$index).indexOf(rowKey) > -1)
47
+ return 'kts-invoice-operate-goods-expanded-level-1';
48
+
49
+ return undefined;
50
+ }, [rowKey, expandedRowKeys, good])
51
+
39
52
  return (
40
53
  rowKey === current && current
41
54
  ? (
@@ -48,6 +61,7 @@ export default function TableRow(props: any) {
48
61
  className={classnames(
49
62
  props.className,
50
63
  discount,
64
+ expandedRow,
51
65
  (rowKey === container && current)
52
66
  ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site
53
67
  : undefined
@@ -4,7 +4,6 @@ import Invoice from '../../../../..';
4
4
  import { TableManual, TableProps } from "kts-xui";
5
5
  import { Table } from 'kts-components-antd-x4-v4';
6
6
  import './index.less';
7
- import { e } from "mathjs";
8
7
 
9
8
  export default function <T extends object = any>(props: TableProps<T>) {
10
9
 
@@ -50,14 +50,12 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
50
50
  })(
51
51
  readOnly
52
52
  ? (<MyArrString />)
53
- : (
54
- <Cascader
55
- style={{ width: '100%' }}
56
- options={props.realEstateAddressOptions}
57
- fieldNames={props.realEstateAddressFieldNames}
58
- placeholder="请选择省市区县"
59
- />
60
- )
53
+ : (<Cascader
54
+ style={{ width: '100%' }}
55
+ options={props.realEstateAddressOptions}
56
+ fieldNames={props.realEstateAddressFieldNames}
57
+ placeholder="请选择省市区县"
58
+ />)
61
59
  )}
62
60
  </Form.Item>
63
61
  </Col>
@@ -0,0 +1,100 @@
1
+ .kts-invoice-operate-invoice-digtal-stakeholder {
2
+
3
+ display: flex;
4
+
5
+ .digtal-stakeholder-expand-button {
6
+ cursor: pointer;
7
+ }
8
+
9
+ &>div {
10
+ border-right: 2px solid #9F613E;
11
+
12
+ &:nth-child(even) {
13
+ flex : 1;
14
+ display : flex;
15
+ flex-direction : column;
16
+ justify-content: end;
17
+ }
18
+
19
+ &:nth-child(odd) {
20
+ flex : none;
21
+ text-align : center;
22
+ color : #9F613E;
23
+ display : flex;
24
+ flex-direction : column;
25
+ justify-content: center;
26
+ justify-items : center;
27
+ padding : 0 4px;
28
+ }
29
+
30
+ &:last-child {
31
+ border-right: none;
32
+ }
33
+ }
34
+
35
+ .digtal-stakeholder-form {
36
+
37
+ padding: 12px 10px 5px;
38
+
39
+ .ktsAntX-col {
40
+ margin-bottom: 15px;
41
+ }
42
+
43
+ .ktsAnt3x-row.ktsAnt3x-form-item {
44
+ display : flex;
45
+ margin-bottom: 0;
46
+
47
+ .ktsAnt3x-form-item-label {
48
+ flex : none;
49
+ font-weight: 500;
50
+ line-height: 29px;
51
+
52
+ label {
53
+ color: #9F603D;
54
+ }
55
+ }
56
+
57
+ .ktsAnt3x-form-item-control {
58
+ line-height: 1.4;
59
+
60
+ .digtal-stakeholder-form-text {
61
+ word-break : break-all;
62
+ line-height: 29px;
63
+ }
64
+ }
65
+
66
+ .ktsAnt3x-form-item-control-wrapper {
67
+ flex: 1;
68
+ }
69
+ }
70
+ }
71
+
72
+ .natural-person-flag {
73
+
74
+ padding: 0 8px;
75
+
76
+ .ktsAnt3x-form-item-control {
77
+ line-height: 32px
78
+ }
79
+
80
+ .ktsAnt3x-row.ktsAnt3x-form-item {
81
+ margin-bottom: 0
82
+ }
83
+ }
84
+ }
85
+
86
+ .kts-invoice-operate-invoice-digtal-stakeholder.readOnly {
87
+ &>div:nth-child(even) {
88
+ justify-content: start;
89
+ }
90
+
91
+ .digtal-stakeholder-form .ktsAnt3x-row.ktsAnt3x-form-item .ktsAnt3x-form-item-label {
92
+ line-height: 1.4;
93
+ }
94
+
95
+ .digtal-stakeholder-form .ktsAnt3x-row.ktsAnt3x-form-item .ktsAnt3x-form-item-control {
96
+ .digtal-stakeholder-form-text {
97
+ line-height: 1.4;
98
+ }
99
+ }
100
+ }