kts-component-invoice-operate 3.2.0 → 3.2.2

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 (29) hide show
  1. package/dist/Invoice/Invoice-digtal/_test/importGoods/index.d.ts +3 -0
  2. package/dist/Invoice/Invoice-digtal/_test/importStakeholder/index.d.ts +4 -0
  3. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.d.ts +2 -1
  4. package/dist/Invoice/ui/digtal/Stakeholder/index.d.ts +5 -0
  5. package/dist/InvoiceTypeModal/index.d.ts +4 -2
  6. package/dist/index.esm.js +147 -52
  7. package/dist/index.js +147 -52
  8. package/package.json +1 -1
  9. package/src/Invoice/Invoice-digtal/_test/importGoods/index.tsx +471 -0
  10. package/src/Invoice/Invoice-digtal/_test/importStakeholder/index.tsx +17 -0
  11. package/src/Invoice/Invoice-digtal/index.md +6 -0
  12. package/src/Invoice/InvoiceController/fns/addGoodDiscountV2.ts +1 -1
  13. package/src/Invoice/index.tsx +8 -6
  14. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +15 -2
  15. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/svg/plus.svg +12 -0
  16. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +7 -2
  17. package/src/Invoice/ui/digtal/GoodsList/index.tsx +0 -1
  18. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +1 -2
  19. package/src/Invoice/ui/digtal/Stakeholder/index.tsx +25 -2
  20. package/src/Invoice/ui/digtal/Stakeholder/svg/plus.svg +12 -0
  21. package/src/InvoiceTypeModal/_test/easiest/index.tsx +0 -1
  22. package/src/InvoiceTypeModal/index.tsx +29 -8
  23. package/docs-dist/404.html +0 -33
  24. package/docs-dist/index.html +0 -33
  25. package/docs-dist/static/auto.a6cd905c.svg +0 -1
  26. package/docs-dist/static/magnifier.2b26be6e.svg +0 -1
  27. package/docs-dist/static/spot.42e620e1.svg +0 -1
  28. package/docs-dist/umi.css +0 -20
  29. package/docs-dist/umi.js +0 -1
@@ -7,6 +7,8 @@ import { Button, Col, Input, InputProps, Row } from 'kts-xui'
7
7
  import { FormComponentProps } from "kts-components-antd-x3/lib/form";
8
8
  import { ReactComponent as ArrowUpSvg } from './svg/arrowUp.svg';
9
9
  import { ReactComponent as ArrowDownSvg } from './svg/arrowDown.svg';
10
+ import { ReactComponent as PlusSvg } from './svg/plus.svg'
11
+ import InvoiceController from "../../../InvoiceController";
10
12
  import Invoice from "../../../../Invoice";
11
13
  import './index.less';
12
14
 
@@ -38,12 +40,18 @@ const formatCompanyName = (e: any) => {
38
40
  }
39
41
 
40
42
  export interface IStakeholder {
43
+
44
+ /** 是否显示导入按钮 */
45
+ isShowImportButton?: boolean;
46
+
47
+ /** 点击了 */
48
+ onClickImportButton?: (e: InvoiceController) => void
41
49
  }
42
50
 
43
51
  /** 干系人 */
44
52
  export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.create())(props => {
45
53
 
46
- const { form } = props;
54
+ const { form, isShowImportButton, onClickImportButton } = props;
47
55
 
48
56
  const [isExpand, setExpand] = React.useState(true);
49
57
 
@@ -91,7 +99,22 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
91
99
  {getFieldDecorator('buyerName', {
92
100
  rules: getRules('buyerName', RULES.companyName('购买方名称')),
93
101
  getValueFromEvent: formatCompanyName
94
- })(<MyInput readOnly={isReadOnly('buyerName')} placeholder="请输入" autoComplete="off" />)}
102
+ })(
103
+ <MyInput
104
+ readOnly={isReadOnly('buyerName')}
105
+ placeholder="请输入"
106
+ autoComplete="off"
107
+ suffix={
108
+ isShowImportButton === true &&
109
+ <Button
110
+ type='link'
111
+ style={{ padding: 0, width: 20 }}
112
+ icon={<Icon component={PlusSvg} />}
113
+ onClick={() => { onClickImportButton && onClickImportButton(controller) }}
114
+ />
115
+ }
116
+ />
117
+ )}
95
118
  </Form.Item>
96
119
  </Col>
97
120
 
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 16 15" fill="none">
2
+ <g clip-path="url(#clip0_715_360)">
3
+ <path d="M8 14.5312C4.11687 14.5312 0.96875 11.3831 0.96875 7.5C0.96875 3.61687 4.11687 0.46875 8 0.46875C11.8831 0.46875 15.0312 3.61687 15.0312 7.5C15.0312 11.3831 11.8831 14.5312 8 14.5312ZM8 13.5938C11.3656 13.5938 14.0938 10.8656 14.0938 7.5C14.0938 4.13438 11.3656 1.40625 8 1.40625C4.63438 1.40625 1.90625 4.13438 1.90625 7.5C1.90625 10.8656 4.63438 13.5938 8 13.5938Z"/>
4
+ <path d="M4.25 7.96875C4.12568 7.96875 4.00645 7.91936 3.91854 7.83146C3.83064 7.74355 3.78125 7.62432 3.78125 7.5C3.78125 7.37568 3.83064 7.25645 3.91854 7.16854C4.00645 7.08064 4.12568 7.03125 4.25 7.03125H11.75C11.8743 7.03125 11.9935 7.08064 12.0815 7.16854C12.1694 7.25645 12.2188 7.37568 12.2188 7.5C12.2188 7.62432 12.1694 7.74355 12.0815 7.83146C11.9935 7.91936 11.8743 7.96875 11.75 7.96875H4.25Z"/>
5
+ <path d="M7.53125 3.75C7.53125 3.62568 7.58064 3.50645 7.66854 3.41854C7.75645 3.33064 7.87568 3.28125 8 3.28125C8.12432 3.28125 8.24355 3.33064 8.33146 3.41854C8.41936 3.50645 8.46875 3.62568 8.46875 3.75V11.25C8.46875 11.3743 8.41936 11.4935 8.33146 11.5815C8.24355 11.6694 8.12432 11.7188 8 11.7188C7.87568 11.7188 7.75645 11.6694 7.66854 11.5815C7.58064 11.4935 7.53125 11.3743 7.53125 11.25V3.75Z"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0_715_360">
9
+ <rect width="15" height="15" transform="translate(0.5)"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>
@@ -11,7 +11,6 @@ export default () => {
11
11
  <Button onClick={() => { setOpen(true) }} >打开</Button>
12
12
  <InvoiceTypeModal
13
13
  open={open}
14
- disableds={['business']}
15
14
  onOk={e => console.log(e)}
16
15
  onCancel={() => { setOpen(false) }}
17
16
  defaultBusiness='1'
@@ -10,10 +10,10 @@ export interface IFormValues {
10
10
  billingType: 'digital' | 'taxation';
11
11
 
12
12
  /** 特定业务 */
13
- business: any;
13
+ business?: any;
14
14
 
15
15
  /** 选择票类 */
16
- invoiceType: any;
16
+ invoiceType?: any;
17
17
  }
18
18
 
19
19
  export interface IInvoiceTypeModalProps {
@@ -30,6 +30,9 @@ export interface IInvoiceTypeModalProps {
30
30
  /** 点击了取消 */
31
31
  onCancel?: () => void;
32
32
 
33
+ /** 切换了 开票种类 */
34
+ onChange?: (e: 'digital' | 'taxation') => void;
35
+
33
36
  /** 禁用列表 */
34
37
  disableds?: ('billingType' | 'invoiceType' | 'business')[];
35
38
 
@@ -53,6 +56,8 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
53
56
 
54
57
  const { disableds = [] } = props;
55
58
 
59
+ const [formValues, setValues] = React.useState<IFormValues>({ billingType: props.defaultBillingType || 'digital' });
60
+
56
61
  const [form] = Form.useForm<IFormValues>();
57
62
 
58
63
  const onConfirm = React.useCallback(async () => {
@@ -62,12 +67,15 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
62
67
 
63
68
  React.useEffect(() => {
64
69
  if (props.open) {
65
- form.resetFields();
66
- form.setFieldsValue({
70
+ const values = {
67
71
  billingType: props.defaultBillingType || 'digital',
68
72
  invoiceType: props.defaultInvoiceType,
69
73
  business: props.defaultBusiness,
70
- })
74
+ }
75
+
76
+ form.resetFields();
77
+ form.setFieldsValue(values);
78
+ setValues(values);
71
79
  }
72
80
  }, [props.open, props.defaultBillingType, props.defaultBusiness, props.defaultInvoiceType, form])
73
81
 
@@ -80,7 +88,12 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
80
88
  okText='确定'
81
89
  cancelText='取消'
82
90
  >
83
- <Form form={form} layout="vertical" style={{ paddingTop: 20 }} >
91
+ <Form
92
+ form={form}
93
+ layout="vertical"
94
+ style={{ paddingTop: 20 }}
95
+ onValuesChange={(_, e) => { setValues(e) }}
96
+ >
84
97
  <Row gutter={[16, 16]}>
85
98
  <Col span={24} >
86
99
  <Form.Item name='billingType' >
@@ -89,6 +102,7 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
89
102
  className="goods-list-digtal-reselect-invoice-typeModal-radio"
90
103
  optionType="button"
91
104
  disabled={disableds.indexOf('billingType') >= 0}
105
+ onChange={e => { props.onChange && props.onChange(e.target.value) }}
92
106
  options={[
93
107
  { label: '数电发票', value: 'digital' },
94
108
  { label: '税控发票', value: 'taxation' },
@@ -98,9 +112,15 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
98
112
  </Col>
99
113
 
100
114
  <Col span={12} >
101
- <Form.Item name='invoiceType' label="选择票类" >
115
+ <Form.Item
116
+ name='invoiceType'
117
+ label="选择票类"
118
+ rules={[{ required: true, message: '选择票类必填' }]}
119
+ >
102
120
  <Select
103
121
  size='large'
122
+ allowClear
123
+ placeholder="请选择(非必填项)"
104
124
  disabled={disableds.indexOf('invoiceType') >= 0}
105
125
  options={props.invoiceTypeOptions}
106
126
  />
@@ -111,7 +131,8 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
111
131
  <Form.Item name='business' label="特定业务">
112
132
  <Select
113
133
  size='large'
114
- disabled={disableds.indexOf('business') >= 0}
134
+ allowClear
135
+ disabled={disableds.indexOf('business') >= 0 || !formValues.invoiceType}
115
136
  options={props.businessOptions}
116
137
  />
117
138
  </Form.Item>
@@ -1,33 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta
6
- name="viewport"
7
- content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
8
- />
9
- <link rel="stylesheet" href="/docs-dist/umi.css" />
10
- <script>
11
- window.routerBase = "/";
12
- </script>
13
- <script>
14
- //! umi version: 3.5.27
15
- </script>
16
- <script>
17
- !(function () {
18
- var e = localStorage.getItem("dumi:prefers-color"),
19
- t = window.matchMedia("(prefers-color-scheme: dark)").matches,
20
- r = ["light", "dark", "auto"];
21
- document.documentElement.setAttribute(
22
- "data-prefers-color",
23
- e === r[2] ? (t ? r[1] : r[0]) : r.indexOf(e) > -1 ? e : r[0]
24
- );
25
- })();
26
- </script>
27
- </head>
28
- <body>
29
- <div id="root"></div>
30
-
31
- <script src="/docs-dist/umi.js"></script>
32
- </body>
33
- </html>
@@ -1,33 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta
6
- name="viewport"
7
- content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
8
- />
9
- <link rel="stylesheet" href="/docs-dist/umi.css" />
10
- <script>
11
- window.routerBase = "/";
12
- </script>
13
- <script>
14
- //! umi version: 3.5.27
15
- </script>
16
- <script>
17
- !(function () {
18
- var e = localStorage.getItem("dumi:prefers-color"),
19
- t = window.matchMedia("(prefers-color-scheme: dark)").matches,
20
- r = ["light", "dark", "auto"];
21
- document.documentElement.setAttribute(
22
- "data-prefers-color",
23
- e === r[2] ? (t ? r[1] : r[0]) : r.indexOf(e) > -1 ? e : r[0]
24
- );
25
- })();
26
- </script>
27
- </head>
28
- <body>
29
- <div id="root"></div>
30
-
31
- <script src="/docs-dist/umi.js"></script>
32
- </body>
33
- </html>
@@ -1 +0,0 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1586510245354" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4976" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M510.677 83.529c60.891 0 119.75 13.191 174.046 38.055l-40.087 70.028 202.97-1.016-101.99-175.063-35.52 61.909c-61.908-29.433-129.903-44.657-199.419-44.657-257.266 0-466.833 209.566-466.833 466.833 0 93.368 27.4 183.69 79.668 261.326l42.116-28.415c-46.684-69.012-71.039-149.183-71.039-232.91 0-229.355 186.729-416.09 416.088-416.09z m425.225 223.774l-46.175 20.802c24.356 53.788 37.039 111.637 37.039 171.512 0 229.358-186.73 416.089-416.089 416.089-46.684 0-92.351-7.608-135.99-22.832l34-65.968-202.468 10.148 110.116 170.5 35.52-69.012c50.738 18.777 104.526 27.908 159.33 27.908 257.265 0 466.832-209.567 466.832-466.833-0.507-66.98-14.715-131.93-42.115-192.314z m0 0" p-id="4977"></path><path d="M317.096 1023.06L192.387 829.965 421.78 818.47l-36.039 69.924c40.06 12.971 82.045 19.543 124.936 19.543 225.147 0 408.317-183.17 408.317-408.317 0-58.417-12.23-115.043-36.348-168.305l-3.212-7.094 60.343-27.186 3.203 7.059c27.889 61.462 42.292 127.226 42.81 195.467 0 261.757-212.908 474.664-474.606 474.664-54.211 0-106.5-8.76-155.546-26.05l-38.54 74.885zM220.05 844.143l95.524 147.906 32.521-63.187 6.458 2.39c49.176 18.198 101.874 27.425 156.632 27.425 253.126 0 459.06-205.933 459.06-459.06-0.48-63.377-13.353-124.59-38.275-182.018l-32.013 14.422c22.95 53.205 34.582 109.55 34.582 167.595 0 233.719-190.143 423.862-423.862 423.862-47.682 0-94.297-7.828-138.55-23.266l-8.448-2.948 31.914-61.92-175.543 8.8z m-98.64-72.405l-4.345-6.455C64.08 686.583 36.071 594.717 36.071 499.617c0-261.698 212.907-474.605 474.605-474.605 68.724 0 134.705 14.25 196.232 42.368L745.564 0.005 861.09 198.301l-229.898 1.151 42.514-74.27c-51.835-22.486-106.64-33.88-163.03-33.88-225.147 0-408.317 183.17-408.317 408.316 0 82.11 24.104 161.145 69.705 228.556l4.36 6.445-55.014 37.12zM510.677 40.557c-253.126 0-459.06 205.934-459.06 459.06 0 89.396 25.578 175.828 74.053 250.495l29.221-19.715c-44.563-68.554-68.074-148.169-68.074-230.78 0-233.717 190.143-423.861 423.861-423.861 61.471 0 121.117 13.04 177.283 38.76l7.738 3.543-37.618 65.714 176.044-0.882-88.458-151.83-32.41 56.489-6.498-3.09C645.482 55.329 579.51 40.558 510.677 40.558z" p-id="4978"></path><path d="M320.113 320.409h383.973v63.55H320.113z m0.184 127.952H704.27v63.55H320.297z m-0.184 127.803h383.973v63.55H320.113z" p-id="4979"></path></svg>
@@ -1 +0,0 @@
1
- <svg t="1656901778998" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9253" width="200" height="200"><path d="M985.781333 918.594133 820.773333 765.5264c27.3728-32.973867 49.6544-69.5776 66.436267-109.258667 22.933333-54.218667 34.561067-111.7952 34.561067-171.1296 0-59.333333-11.627733-116.910933-34.561067-171.1296-22.142933-52.354133-53.837867-99.365333-94.200533-139.729067S705.633067 102.222933 653.28 80.08c-54.218667-22.933333-111.7952-34.561067-171.1296-34.561067S365.240533 57.147733 311.021867 80.08c-52.354133 22.142933-99.365333 53.8368-139.729067 94.200533s-72.0576 87.374933-94.200533 139.729067c-22.932267 54.218667-34.56 111.7952-34.56 171.1296 0 59.3344 11.627733 116.910933 34.56 171.1296 22.144 52.354133 53.837867 99.365333 94.200533 139.729067s87.374933 72.0576 139.729067 94.200533c54.218667 22.932267 111.7952 34.56 171.1296 34.56s116.910933-11.627733 171.1296-34.56c45.352533-19.181867 86.686933-45.543467 123.172267-78.487467L942.256 965.514667c6.16 5.714133 13.966933 8.539733 21.755733 8.539733 8.593067 0 17.163733-3.441067 23.467733-10.237867C999.4976 950.8608 998.738133 930.612267 985.781333 918.594133zM482.151467 860.7584c-207.117867 0-375.620267-168.5024-375.620267-375.620267 0-207.1168 168.5024-375.6192 375.620267-375.6192S857.770667 278.021333 857.770667 485.138133C857.770667 692.256 689.268267 860.7584 482.151467 860.7584z" p-id="9254"></path></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574652728953" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4119" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M512 512m-96 0a1.5 1.5 0 1 0 192 0 1.5 1.5 0 1 0-192 0Z" p-id="4120"></path><path d="M512 96.64m-96 0a1.5 1.5 0 1 0 192 0 1.5 1.5 0 1 0-192 0Z" p-id="4121"></path><path d="M512 927.36m-96 0a1.5 1.5 0 1 0 192 0 1.5 1.5 0 1 0-192 0Z" p-id="4122"></path></svg>