kts-component-invoice-operate 3.2.71 → 3.2.73

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 CHANGED
@@ -4,7 +4,7 @@ import GreyReactBox, { decorator } from 'grey-react-box';
4
4
  import { chain as chain$1, bignumber, create, all } from 'mathjs';
5
5
  import { message, Form, Input, Icon as Icon$1, Tag as Tag$1, Select, Button, Tooltip, Switch as Switch$1, Typography, Menu, Dropdown, AutoComplete as AutoComplete$2, Spin, Checkbox, Drawer, Descriptions, Empty, Divider, Popover as Popover$1, Table as Table$1, Tree, Modal as Modal$1, Row as Row$1, Col as Col$1 } from 'kts-components-antd-x3';
6
6
  import { v4 } from 'uuid';
7
- import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Dropdown as Dropdown$1, Row, Col, Button as Button$1, Tooltip as Tooltip$1, Input as Input$1, Select as Select$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal } from 'kts-xui';
7
+ import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Popover, Dropdown as Dropdown$1, Row, Col, Button as Button$1, Tooltip as Tooltip$1, Checkbox as Checkbox$1, Input as Input$1, Select as Select$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal } from 'kts-xui';
8
8
  import classNames from 'classnames';
9
9
  import { Table } from 'kts-components-antd-x4-v4';
10
10
  import { render } from 'react-dom';
@@ -16295,6 +16295,13 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
16295
16295
  gutter: [16, 0]
16296
16296
  }, React.createElement(Col, {
16297
16297
  span: 24
16298
+ }, React.createElement(Form.Item, {
16299
+ label: "\u8D2D\u4E70\u65B9\u4FE1\u606F",
16300
+ colon: false
16301
+ }, getFieldDecorator('naturalPersonFlag', {})(React.createElement(NaturalPersonFlag, {
16302
+ readOnly: isReadOnly('naturalPersonFlag')
16303
+ })))), React.createElement(Col, {
16304
+ span: 24
16298
16305
  }, React.createElement(Form.Item, {
16299
16306
  label: "\u540D\u79F0",
16300
16307
  colon: false
@@ -16310,7 +16317,8 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
16310
16317
  type: 'link',
16311
16318
  style: {
16312
16319
  padding: 0,
16313
- width: 20
16320
+ width: 20,
16321
+ height: '100%'
16314
16322
  },
16315
16323
  icon: React.createElement(Icon, {
16316
16324
  component: SvgPlus
@@ -16477,6 +16485,27 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
16477
16485
  })))))))));
16478
16486
  });
16479
16487
 
16488
+ function NaturalPersonFlag(props) {
16489
+ var _React$useState3 = React.useState(props.value || 'COMPANY'),
16490
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
16491
+ value = _React$useState4[0],
16492
+ setValue = _React$useState4[1];
16493
+
16494
+ var onChange = React.useCallback(function (e) {
16495
+ if (props.readOnly) return;
16496
+ setValue(e.target.checked ? 'NATURAL' : 'COMPANY');
16497
+ props.onChange && props.onChange(e.target.checked ? 'NATURAL' : 'COMPANY');
16498
+ }, [props.onChange, props.readOnly]);
16499
+ React.useEffect(function () {
16500
+ setValue(props.value || 'COMPANY');
16501
+ }, [props.value]);
16502
+ return React.createElement(Checkbox$1, {
16503
+ disabled: props.readOnly,
16504
+ checked: value === 'NATURAL',
16505
+ onChange: onChange
16506
+ }, "\u662F\u5426\u5F00\u7968\u7ED9\u81EA\u7136\u4EBA");
16507
+ }
16508
+
16480
16509
  function BuyerNameInput$1(props) {
16481
16510
  var fieldName = props.fieldName,
16482
16511
  form = props.myform;
package/dist/index.js CHANGED
@@ -16305,6 +16305,13 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
16305
16305
  gutter: [16, 0]
16306
16306
  }, React__default['default'].createElement(ktsXui.Col, {
16307
16307
  span: 24
16308
+ }, React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
16309
+ label: "\u8D2D\u4E70\u65B9\u4FE1\u606F",
16310
+ colon: false
16311
+ }, getFieldDecorator('naturalPersonFlag', {})(React__default['default'].createElement(NaturalPersonFlag, {
16312
+ readOnly: isReadOnly('naturalPersonFlag')
16313
+ })))), React__default['default'].createElement(ktsXui.Col, {
16314
+ span: 24
16308
16315
  }, React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
16309
16316
  label: "\u540D\u79F0",
16310
16317
  colon: false
@@ -16320,7 +16327,8 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
16320
16327
  type: 'link',
16321
16328
  style: {
16322
16329
  padding: 0,
16323
- width: 20
16330
+ width: 20,
16331
+ height: '100%'
16324
16332
  },
16325
16333
  icon: React__default['default'].createElement(Icon, {
16326
16334
  component: SvgPlus
@@ -16487,6 +16495,27 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
16487
16495
  })))))))));
16488
16496
  });
16489
16497
 
16498
+ function NaturalPersonFlag(props) {
16499
+ var _React$useState3 = React__default['default'].useState(props.value || 'COMPANY'),
16500
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
16501
+ value = _React$useState4[0],
16502
+ setValue = _React$useState4[1];
16503
+
16504
+ var onChange = React__default['default'].useCallback(function (e) {
16505
+ if (props.readOnly) return;
16506
+ setValue(e.target.checked ? 'NATURAL' : 'COMPANY');
16507
+ props.onChange && props.onChange(e.target.checked ? 'NATURAL' : 'COMPANY');
16508
+ }, [props.onChange, props.readOnly]);
16509
+ React__default['default'].useEffect(function () {
16510
+ setValue(props.value || 'COMPANY');
16511
+ }, [props.value]);
16512
+ return React__default['default'].createElement(ktsXui.Checkbox, {
16513
+ disabled: props.readOnly,
16514
+ checked: value === 'NATURAL',
16515
+ onChange: onChange
16516
+ }, "\u662F\u5426\u5F00\u7968\u7ED9\u81EA\u7136\u4EBA");
16517
+ }
16518
+
16490
16519
  function BuyerNameInput$1(props) {
16491
16520
  var fieldName = props.fieldName,
16492
16521
  form = props.myform;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.71",
3
+ "version": "3.2.73",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -114,14 +114,14 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
114
114
  <div>
115
115
  <Form className="digtal-stakeholder-form" >
116
116
  <Row gutter={[16, 0]}>
117
- {/* <Col span={24} >
117
+ <Col span={24} >
118
118
  <Form.Item label='购买方信息' colon={false}>
119
119
  {getFieldDecorator('naturalPersonFlag', {
120
120
  })(
121
121
  <NaturalPersonFlag readOnly={isReadOnly('naturalPersonFlag')} />
122
122
  )}
123
123
  </Form.Item>
124
- </Col> */}
124
+ </Col>
125
125
 
126
126
  <Col span={24} >
127
127
  <Form.Item label='名称' colon={false}>
@@ -138,7 +138,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
138
138
  isShowImportButton === true &&
139
139
  <Button
140
140
  type='link'
141
- style={{ padding: 0, width: 20 }}
141
+ style={{ padding: 0, width: 20, height: '100%' }}
142
142
  icon={<Icon component={PlusSvg} />}
143
143
  onClick={() => { onClickImportButton && onClickImportButton(controller) }}
144
144
  />
@@ -286,27 +286,28 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
286
286
  })
287
287
 
288
288
  function NaturalPersonFlag(props: {
289
- value?: 0 | 1,
290
- onChange?: (e: 0 | 1) => void
289
+ // NATURAL("自然人"), COMPANY("非自然人");
290
+ value?: 'COMPANY' | 'NATURAL',
291
+ onChange?: (e: 'COMPANY' | 'NATURAL') => void
291
292
  readOnly?: boolean;
292
293
  }) {
293
294
 
294
- const [value, setValue] = React.useState(props.value || 0);
295
+ const [value, setValue] = React.useState(props.value || 'COMPANY');
295
296
 
296
297
  const onChange = React.useCallback((e: CheckboxChangeEvent) => {
297
298
  if (props.readOnly) return;
298
- setValue(e.target.checked ? 1 : 0);
299
- props.onChange && props.onChange(e.target.checked ? 1 : 0);
299
+ setValue(e.target.checked ? 'NATURAL' : 'COMPANY');
300
+ props.onChange && props.onChange(e.target.checked ? 'NATURAL' : 'COMPANY');
300
301
  }, [props.onChange, props.readOnly])
301
302
 
302
303
  React.useEffect(() => {
303
- setValue(props.value || 0)
304
+ setValue(props.value || 'COMPANY')
304
305
  }, [props.value])
305
306
 
306
307
  return (
307
308
  <Checkbox
308
309
  disabled={props.readOnly}
309
- checked={value === 1}
310
+ checked={value === 'NATURAL'}
310
311
  onChange={onChange}
311
312
  >
312
313
  是否开票给自然人