kts-component-invoice-operate 3.2.160 → 3.2.161

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.
@@ -22,6 +22,8 @@ export interface IInvoiceTypeModalProps {
22
22
  onCancel?: () => void;
23
23
  /** 切换了 开票种类 */
24
24
  onChange?: (e: 'digital' | 'taxation') => void;
25
+ /** 切换了 发票类型 */
26
+ onInvoiceTypeChange?: (e: any) => void;
25
27
  /** 禁用列表 */
26
28
  disableds?: ('billingType' | 'invoiceType' | 'business')[];
27
29
  /** 选择票类 选项 */
package/dist/index.esm.js CHANGED
@@ -23282,6 +23282,13 @@ function InvoiceTypeModal(props) {
23282
23282
  });
23283
23283
  setValues(form.getFieldsValue());
23284
23284
  }, [props.onChange, form]);
23285
+ var onInvoiceTypeChange = React.useCallback(function (e) {
23286
+ props.onInvoiceTypeChange && props.onInvoiceTypeChange(e.target.value);
23287
+ form.setFieldsValue({
23288
+ business: null
23289
+ });
23290
+ setValues(form.getFieldsValue());
23291
+ }, [props.onInvoiceTypeChange, form]);
23285
23292
  React.useEffect(function () {
23286
23293
  if (props.open) {
23287
23294
  var values = {
@@ -23343,7 +23350,8 @@ function InvoiceTypeModal(props) {
23343
23350
  allowClear: true,
23344
23351
  placeholder: "\u8BF7\u9009\u62E9\uFF08\u5FC5\u586B\u9879\uFF09",
23345
23352
  disabled: disableds.indexOf('invoiceType') >= 0,
23346
- options: props.invoiceTypeOptions
23353
+ options: props.invoiceTypeOptions,
23354
+ onChange: onInvoiceTypeChange
23347
23355
  }))), /*#__PURE__*/React.createElement(Col, {
23348
23356
  span: 12
23349
23357
  }, /*#__PURE__*/React.createElement(Form$1.Item, {
package/dist/index.js CHANGED
@@ -23292,6 +23292,13 @@ function InvoiceTypeModal(props) {
23292
23292
  });
23293
23293
  setValues(form.getFieldsValue());
23294
23294
  }, [props.onChange, form]);
23295
+ var onInvoiceTypeChange = React__default['default'].useCallback(function (e) {
23296
+ props.onInvoiceTypeChange && props.onInvoiceTypeChange(e.target.value);
23297
+ form.setFieldsValue({
23298
+ business: null
23299
+ });
23300
+ setValues(form.getFieldsValue());
23301
+ }, [props.onInvoiceTypeChange, form]);
23295
23302
  React__default['default'].useEffect(function () {
23296
23303
  if (props.open) {
23297
23304
  var values = {
@@ -23353,7 +23360,8 @@ function InvoiceTypeModal(props) {
23353
23360
  allowClear: true,
23354
23361
  placeholder: "\u8BF7\u9009\u62E9\uFF08\u5FC5\u586B\u9879\uFF09",
23355
23362
  disabled: disableds.indexOf('invoiceType') >= 0,
23356
- options: props.invoiceTypeOptions
23363
+ options: props.invoiceTypeOptions,
23364
+ onChange: onInvoiceTypeChange
23357
23365
  }))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
23358
23366
  span: 12
23359
23367
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.160",
3
+ "version": "3.2.161",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -19,7 +19,7 @@ export interface IFormValues {
19
19
  export interface IInvoiceTypeModalProps {
20
20
 
21
21
  /** 是否禁用 */
22
- isDisabled?:boolean;
22
+ isDisabled?: boolean;
23
23
 
24
24
  /** 窗口标题 */
25
25
  modalTitle?: string;
@@ -35,6 +35,9 @@ export interface IInvoiceTypeModalProps {
35
35
 
36
36
  /** 切换了 开票种类 */
37
37
  onChange?: (e: 'digital' | 'taxation') => void;
38
+
39
+ /** 切换了 发票类型 */
40
+ onInvoiceTypeChange?: (e: any) => void;
38
41
 
39
42
  /** 禁用列表 */
40
43
  disableds?: ('billingType' | 'invoiceType' | 'business')[];
@@ -73,7 +76,11 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
73
76
  form.setFieldsValue({ invoiceType: null, business: null });
74
77
  setValues(form.getFieldsValue());
75
78
  }, [props.onChange, form])
76
-
79
+ const onInvoiceTypeChange = React.useCallback(e => {
80
+ props.onInvoiceTypeChange && props.onInvoiceTypeChange(e.target.value);
81
+ form.setFieldsValue({ business: null });
82
+ setValues(form.getFieldsValue());
83
+ }, [props.onInvoiceTypeChange, form])
77
84
  React.useEffect(() => {
78
85
  if (props.open) {
79
86
  const values = {
@@ -132,6 +139,7 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
132
139
  placeholder="请选择(必填项)"
133
140
  disabled={disableds.indexOf('invoiceType') >= 0}
134
141
  options={props.invoiceTypeOptions}
142
+ onChange={onInvoiceTypeChange}
135
143
  />
136
144
  </Form.Item>
137
145
  </Col>