kts-component-invoice-operate 3.2.158 → 3.2.160

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
  }
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
 
@@ -17838,7 +17840,9 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
17838
17840
  required: true,
17839
17841
  message: '销售方纳税人识别号必填'
17840
17842
  }].concat(_toConsumableArray(RULES$1.taxId('销售方纳税人识别号'))))
17841
- })( /*#__PURE__*/React.createElement(MyInput$2, {
17843
+ })( /*#__PURE__*/React.createElement(BuyerNameInput$2, {
17844
+ myform: form,
17845
+ fieldName: 'supplierTaxId',
17842
17846
  readOnly: isReadOnly('supplierTaxId'),
17843
17847
  placeholder: "\u8BF7\u8F93\u5165\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801/\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
17844
17848
  autoComplete: "off"
@@ -18106,12 +18110,12 @@ function BuyerNameInput$2(props) {
18106
18110
  (0, _context.t0)(_context.t1);
18107
18111
 
18108
18112
  case 10:
18109
- _context.next = 19;
18113
+ _context.next = 37;
18110
18114
  break;
18111
18115
 
18112
18116
  case 12:
18113
18117
  if (!(fieldName === 'buyerTaxId')) {
18114
- _context.next = 19;
18118
+ _context.next = 21;
18115
18119
  break;
18116
18120
  }
18117
18121
 
@@ -18129,21 +18133,67 @@ function BuyerNameInput$2(props) {
18129
18133
  (0, _context.t2)(_context.t3);
18130
18134
 
18131
18135
  case 19:
18132
- _context.next = 25;
18136
+ _context.next = 37;
18133
18137
  break;
18134
18138
 
18135
18139
  case 21:
18136
- _context.prev = 21;
18137
- _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);
18138
18188
  setOptions([]);
18139
- throw _context.t4;
18189
+ throw _context.t8;
18140
18190
 
18141
- case 25:
18191
+ case 43:
18142
18192
  case "end":
18143
18193
  return _context.stop();
18144
18194
  }
18145
18195
  }
18146
- }, _callee, null, [[2, 21]]);
18196
+ }, _callee, null, [[2, 39]]);
18147
18197
  }));
18148
18198
 
18149
18199
  return function (_x) {
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
 
@@ -17848,7 +17850,9 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
17848
17850
  required: true,
17849
17851
  message: '销售方纳税人识别号必填'
17850
17852
  }].concat(_toConsumableArray(RULES$1.taxId('销售方纳税人识别号'))))
17851
- })( /*#__PURE__*/React__default['default'].createElement(MyInput$2, {
17853
+ })( /*#__PURE__*/React__default['default'].createElement(BuyerNameInput$2, {
17854
+ myform: form,
17855
+ fieldName: 'supplierTaxId',
17852
17856
  readOnly: isReadOnly('supplierTaxId'),
17853
17857
  placeholder: "\u8BF7\u8F93\u5165\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801/\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
17854
17858
  autoComplete: "off"
@@ -18116,12 +18120,12 @@ function BuyerNameInput$2(props) {
18116
18120
  (0, _context.t0)(_context.t1);
18117
18121
 
18118
18122
  case 10:
18119
- _context.next = 19;
18123
+ _context.next = 37;
18120
18124
  break;
18121
18125
 
18122
18126
  case 12:
18123
18127
  if (!(fieldName === 'buyerTaxId')) {
18124
- _context.next = 19;
18128
+ _context.next = 21;
18125
18129
  break;
18126
18130
  }
18127
18131
 
@@ -18139,21 +18143,67 @@ function BuyerNameInput$2(props) {
18139
18143
  (0, _context.t2)(_context.t3);
18140
18144
 
18141
18145
  case 19:
18142
- _context.next = 25;
18146
+ _context.next = 37;
18143
18147
  break;
18144
18148
 
18145
18149
  case 21:
18146
- _context.prev = 21;
18147
- _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);
18148
18198
  setOptions([]);
18149
- throw _context.t4;
18199
+ throw _context.t8;
18150
18200
 
18151
- case 25:
18201
+ case 43:
18152
18202
  case "end":
18153
18203
  return _context.stop();
18154
18204
  }
18155
18205
  }
18156
- }, _callee, null, [[2, 21]]);
18206
+ }, _callee, null, [[2, 39]]);
18157
18207
  }));
18158
18208
 
18159
18209
  return function (_x) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.158",
3
+ "version": "3.2.160",
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
  }
@@ -142,25 +142,25 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
142
142
  rules: getRules('supplierName', RULES.companyName('销售方名称')),
143
143
  // getValueFromEvent: formatCompanyName
144
144
  })
145
- // (<MyInput readOnly={isReadOnly('supplierName')} placeholder="请输入名称" autoComplete="off" />)
146
- (
147
- <BuyerNameInput
148
- myform={form}
149
- fieldName='supplierName'
150
- readOnly={isReadOnly('supplierName')}
151
- placeholder="请输入名称"
152
- autoComplete="off"
153
- suffix={
154
- isShowImportButton === true &&
155
- <Button
156
- type='link'
157
- style={{ padding: 0, width: 20, height: '100%' }}
158
- icon={<Icon component={PlusSvg} />}
159
- onClick={() => { onClickImportButton && onClickImportButton(controller) }}
160
- />
161
- }
162
- />
163
- )
145
+ // (<MyInput readOnly={isReadOnly('supplierName')} placeholder="请输入名称" autoComplete="off" />)
146
+ (
147
+ <BuyerNameInput
148
+ myform={form}
149
+ fieldName='supplierName'
150
+ readOnly={isReadOnly('supplierName')}
151
+ placeholder="请输入名称"
152
+ autoComplete="off"
153
+ suffix={
154
+ isShowImportButton === true &&
155
+ <Button
156
+ type='link'
157
+ style={{ padding: 0, width: 20, height: '100%' }}
158
+ icon={<Icon component={PlusSvg} />}
159
+ onClick={() => { onClickImportButton && onClickImportButton(controller) }}
160
+ />
161
+ }
162
+ />
163
+ )
164
164
  }
165
165
  </Form.Item>
166
166
  </Col>
@@ -169,7 +169,16 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
169
169
  <Form.Item label='统一社会信用代码/纳税人识别号' colon={false}>
170
170
  {getFieldDecorator('supplierTaxId', {
171
171
  rules: getRules('supplierTaxId', [{ required: true, message: '销售方纳税人识别号必填' }, ...RULES.taxId('销售方纳税人识别号')])
172
- })(<MyInput readOnly={isReadOnly('supplierTaxId')} placeholder="请输入统一社会信用代码/纳税人识别号" autoComplete="off" />)}
172
+ })
173
+ // (<MyInput readOnly={isReadOnly('supplierTaxId')} placeholder="请输入统一社会信用代码/纳税人识别号" autoComplete="off" />)
174
+ (<BuyerNameInput
175
+ myform={form}
176
+ fieldName='supplierTaxId'
177
+ readOnly={isReadOnly('supplierTaxId')}
178
+ placeholder="请输入统一社会信用代码/纳税人识别号"
179
+ autoComplete="off"
180
+ />)
181
+ }
173
182
  </Form.Item>
174
183
  </Col>
175
184
 
@@ -363,14 +372,22 @@ function BuyerNameInput(props: InputProps & { fieldName: string; myform: Wrapped
363
372
  const onSearch = React.useCallback(async (searchText: string) => {
364
373
  await Discontinue.start();
365
374
  try {
366
- if (fieldName === 'buyerName') {
375
+ if (fieldName === 'buyerName' ) {
367
376
  if (autoComplete.onBuyerNameSearch) {
368
377
  setOptions(await autoComplete.onBuyerNameSearch(searchText));
369
378
  }
370
- } else if (fieldName === 'buyerTaxId') {
379
+ } else if (fieldName === 'buyerTaxId' ) {
371
380
  if (autoComplete.onBuyerTaxIdSearch) {
372
381
  setOptions(await autoComplete.onBuyerTaxIdSearch(searchText));
373
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
+ }
374
391
  }
375
392
 
376
393
  } catch (error) {