kts-component-invoice-operate 3.2.159 → 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.
@@ -8,6 +8,10 @@ export default class AutoComplete {
8
8
  onBuyerNameSearch?: (searchText: string) => Promise<any[]>;
9
9
  /** 统一社会信用代码/纳税人识别号 */
10
10
  onBuyerTaxIdSearch?: (searchText: string) => Promise<any[]>;
11
+ /** 销售方名称自动补全 */
12
+ onSupplierNameSearch?: (searchText: string) => Promise<any[]>;
13
+ /** 统一社会信用代码/纳税人识别号 */
14
+ onSupplierTaxIdSearch?: (searchText: string) => Promise<any[]>;
11
15
  /** 商品编码自动补全 */
12
16
  onItemCodeSearch?: (searchText: string, itemName: any) => Promise<any[]>;
13
17
  }
@@ -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
@@ -1200,6 +1200,8 @@ var AutoComplete = /*#__PURE__*/_createClass(function AutoComplete() {
1200
1200
  this.onItemNameBlur = void 0;
1201
1201
  this.onBuyerNameSearch = void 0;
1202
1202
  this.onBuyerTaxIdSearch = void 0;
1203
+ this.onSupplierNameSearch = void 0;
1204
+ this.onSupplierTaxIdSearch = void 0;
1203
1205
  this.onItemCodeSearch = void 0;
1204
1206
  });
1205
1207
 
@@ -18089,7 +18091,7 @@ function BuyerNameInput$2(props) {
18089
18091
  case 2:
18090
18092
  _context.prev = 2;
18091
18093
 
18092
- if (!(fieldName === 'buyerName' || fieldName === 'supplierName')) {
18094
+ if (!(fieldName === 'buyerName')) {
18093
18095
  _context.next = 12;
18094
18096
  break;
18095
18097
  }
@@ -18108,12 +18110,12 @@ function BuyerNameInput$2(props) {
18108
18110
  (0, _context.t0)(_context.t1);
18109
18111
 
18110
18112
  case 10:
18111
- _context.next = 19;
18113
+ _context.next = 37;
18112
18114
  break;
18113
18115
 
18114
18116
  case 12:
18115
- if (!(fieldName === 'buyerTaxId' || fieldName === 'supplierTaxId')) {
18116
- _context.next = 19;
18117
+ if (!(fieldName === 'buyerTaxId')) {
18118
+ _context.next = 21;
18117
18119
  break;
18118
18120
  }
18119
18121
 
@@ -18131,21 +18133,67 @@ function BuyerNameInput$2(props) {
18131
18133
  (0, _context.t2)(_context.t3);
18132
18134
 
18133
18135
  case 19:
18134
- _context.next = 25;
18136
+ _context.next = 37;
18135
18137
  break;
18136
18138
 
18137
18139
  case 21:
18138
- _context.prev = 21;
18139
- _context.t4 = _context["catch"](2);
18140
+ if (!(fieldName === 'supplierName')) {
18141
+ _context.next = 30;
18142
+ break;
18143
+ }
18144
+
18145
+ if (!autoComplete.onSupplierNameSearch) {
18146
+ _context.next = 28;
18147
+ break;
18148
+ }
18149
+
18150
+ _context.t4 = setOptions;
18151
+ _context.next = 26;
18152
+ return autoComplete.onSupplierNameSearch(searchText);
18153
+
18154
+ case 26:
18155
+ _context.t5 = _context.sent;
18156
+ (0, _context.t4)(_context.t5);
18157
+
18158
+ case 28:
18159
+ _context.next = 37;
18160
+ break;
18161
+
18162
+ case 30:
18163
+ if (!(fieldName === 'supplierTaxId')) {
18164
+ _context.next = 37;
18165
+ break;
18166
+ }
18167
+
18168
+ if (!autoComplete.onSupplierTaxIdSearch) {
18169
+ _context.next = 37;
18170
+ break;
18171
+ }
18172
+
18173
+ _context.t6 = setOptions;
18174
+ _context.next = 35;
18175
+ return autoComplete.onSupplierTaxIdSearch(searchText);
18176
+
18177
+ case 35:
18178
+ _context.t7 = _context.sent;
18179
+ (0, _context.t6)(_context.t7);
18180
+
18181
+ case 37:
18182
+ _context.next = 43;
18183
+ break;
18184
+
18185
+ case 39:
18186
+ _context.prev = 39;
18187
+ _context.t8 = _context["catch"](2);
18140
18188
  setOptions([]);
18141
- throw _context.t4;
18189
+ throw _context.t8;
18142
18190
 
18143
- case 25:
18191
+ case 43:
18144
18192
  case "end":
18145
18193
  return _context.stop();
18146
18194
  }
18147
18195
  }
18148
- }, _callee, null, [[2, 21]]);
18196
+ }, _callee, null, [[2, 39]]);
18149
18197
  }));
18150
18198
 
18151
18199
  return function (_x) {
@@ -23234,6 +23282,13 @@ function InvoiceTypeModal(props) {
23234
23282
  });
23235
23283
  setValues(form.getFieldsValue());
23236
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]);
23237
23292
  React.useEffect(function () {
23238
23293
  if (props.open) {
23239
23294
  var values = {
@@ -23295,7 +23350,8 @@ function InvoiceTypeModal(props) {
23295
23350
  allowClear: true,
23296
23351
  placeholder: "\u8BF7\u9009\u62E9\uFF08\u5FC5\u586B\u9879\uFF09",
23297
23352
  disabled: disableds.indexOf('invoiceType') >= 0,
23298
- options: props.invoiceTypeOptions
23353
+ options: props.invoiceTypeOptions,
23354
+ onChange: onInvoiceTypeChange
23299
23355
  }))), /*#__PURE__*/React.createElement(Col, {
23300
23356
  span: 12
23301
23357
  }, /*#__PURE__*/React.createElement(Form$1.Item, {
package/dist/index.js CHANGED
@@ -1210,6 +1210,8 @@ var AutoComplete = /*#__PURE__*/_createClass(function AutoComplete() {
1210
1210
  this.onItemNameBlur = void 0;
1211
1211
  this.onBuyerNameSearch = void 0;
1212
1212
  this.onBuyerTaxIdSearch = void 0;
1213
+ this.onSupplierNameSearch = void 0;
1214
+ this.onSupplierTaxIdSearch = void 0;
1213
1215
  this.onItemCodeSearch = void 0;
1214
1216
  });
1215
1217
 
@@ -18099,7 +18101,7 @@ function BuyerNameInput$2(props) {
18099
18101
  case 2:
18100
18102
  _context.prev = 2;
18101
18103
 
18102
- if (!(fieldName === 'buyerName' || fieldName === 'supplierName')) {
18104
+ if (!(fieldName === 'buyerName')) {
18103
18105
  _context.next = 12;
18104
18106
  break;
18105
18107
  }
@@ -18118,12 +18120,12 @@ function BuyerNameInput$2(props) {
18118
18120
  (0, _context.t0)(_context.t1);
18119
18121
 
18120
18122
  case 10:
18121
- _context.next = 19;
18123
+ _context.next = 37;
18122
18124
  break;
18123
18125
 
18124
18126
  case 12:
18125
- if (!(fieldName === 'buyerTaxId' || fieldName === 'supplierTaxId')) {
18126
- _context.next = 19;
18127
+ if (!(fieldName === 'buyerTaxId')) {
18128
+ _context.next = 21;
18127
18129
  break;
18128
18130
  }
18129
18131
 
@@ -18141,21 +18143,67 @@ function BuyerNameInput$2(props) {
18141
18143
  (0, _context.t2)(_context.t3);
18142
18144
 
18143
18145
  case 19:
18144
- _context.next = 25;
18146
+ _context.next = 37;
18145
18147
  break;
18146
18148
 
18147
18149
  case 21:
18148
- _context.prev = 21;
18149
- _context.t4 = _context["catch"](2);
18150
+ if (!(fieldName === 'supplierName')) {
18151
+ _context.next = 30;
18152
+ break;
18153
+ }
18154
+
18155
+ if (!autoComplete.onSupplierNameSearch) {
18156
+ _context.next = 28;
18157
+ break;
18158
+ }
18159
+
18160
+ _context.t4 = setOptions;
18161
+ _context.next = 26;
18162
+ return autoComplete.onSupplierNameSearch(searchText);
18163
+
18164
+ case 26:
18165
+ _context.t5 = _context.sent;
18166
+ (0, _context.t4)(_context.t5);
18167
+
18168
+ case 28:
18169
+ _context.next = 37;
18170
+ break;
18171
+
18172
+ case 30:
18173
+ if (!(fieldName === 'supplierTaxId')) {
18174
+ _context.next = 37;
18175
+ break;
18176
+ }
18177
+
18178
+ if (!autoComplete.onSupplierTaxIdSearch) {
18179
+ _context.next = 37;
18180
+ break;
18181
+ }
18182
+
18183
+ _context.t6 = setOptions;
18184
+ _context.next = 35;
18185
+ return autoComplete.onSupplierTaxIdSearch(searchText);
18186
+
18187
+ case 35:
18188
+ _context.t7 = _context.sent;
18189
+ (0, _context.t6)(_context.t7);
18190
+
18191
+ case 37:
18192
+ _context.next = 43;
18193
+ break;
18194
+
18195
+ case 39:
18196
+ _context.prev = 39;
18197
+ _context.t8 = _context["catch"](2);
18150
18198
  setOptions([]);
18151
- throw _context.t4;
18199
+ throw _context.t8;
18152
18200
 
18153
- case 25:
18201
+ case 43:
18154
18202
  case "end":
18155
18203
  return _context.stop();
18156
18204
  }
18157
18205
  }
18158
- }, _callee, null, [[2, 21]]);
18206
+ }, _callee, null, [[2, 39]]);
18159
18207
  }));
18160
18208
 
18161
18209
  return function (_x) {
@@ -23244,6 +23292,13 @@ function InvoiceTypeModal(props) {
23244
23292
  });
23245
23293
  setValues(form.getFieldsValue());
23246
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]);
23247
23302
  React__default['default'].useEffect(function () {
23248
23303
  if (props.open) {
23249
23304
  var values = {
@@ -23305,7 +23360,8 @@ function InvoiceTypeModal(props) {
23305
23360
  allowClear: true,
23306
23361
  placeholder: "\u8BF7\u9009\u62E9\uFF08\u5FC5\u586B\u9879\uFF09",
23307
23362
  disabled: disableds.indexOf('invoiceType') >= 0,
23308
- options: props.invoiceTypeOptions
23363
+ options: props.invoiceTypeOptions,
23364
+ onChange: onInvoiceTypeChange
23309
23365
  }))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
23310
23366
  span: 12
23311
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.159",
3
+ "version": "3.2.161",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -15,6 +15,12 @@ export default class AutoComplete {
15
15
  /** 统一社会信用代码/纳税人识别号 */
16
16
  onBuyerTaxIdSearch?: (searchText: string) => Promise<any[]>;
17
17
 
18
+ /** 销售方名称自动补全 */
19
+ onSupplierNameSearch?: (searchText: string) => Promise<any[]>;
20
+
21
+ /** 统一社会信用代码/纳税人识别号 */
22
+ onSupplierTaxIdSearch?: (searchText: string) => Promise<any[]>;
23
+
18
24
  /** 商品编码自动补全 */
19
25
  onItemCodeSearch?: (searchText: string, itemName: any) => Promise<any[]>;
20
26
  }
@@ -372,14 +372,22 @@ function BuyerNameInput(props: InputProps & { fieldName: string; myform: Wrapped
372
372
  const onSearch = React.useCallback(async (searchText: string) => {
373
373
  await Discontinue.start();
374
374
  try {
375
- if (fieldName === 'buyerName' || fieldName === 'supplierName') {
375
+ if (fieldName === 'buyerName' ) {
376
376
  if (autoComplete.onBuyerNameSearch) {
377
377
  setOptions(await autoComplete.onBuyerNameSearch(searchText));
378
378
  }
379
- } else if (fieldName === 'buyerTaxId' || fieldName === 'supplierTaxId') {
379
+ } else if (fieldName === 'buyerTaxId' ) {
380
380
  if (autoComplete.onBuyerTaxIdSearch) {
381
381
  setOptions(await autoComplete.onBuyerTaxIdSearch(searchText));
382
382
  }
383
+ }else if(fieldName === 'supplierName'){
384
+ if (autoComplete.onSupplierNameSearch) {
385
+ setOptions(await autoComplete.onSupplierNameSearch(searchText));
386
+ }
387
+ }else if(fieldName === 'supplierTaxId'){
388
+ if (autoComplete.onSupplierTaxIdSearch) {
389
+ setOptions(await autoComplete.onSupplierTaxIdSearch(searchText));
390
+ }
383
391
  }
384
392
 
385
393
  } catch (error) {
@@ -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>