kts-component-invoice-operate 3.2.260 → 3.2.261

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.
@@ -1,5 +1,5 @@
1
1
 
2
- import React from 'react';
2
+ import React, { useCallback } from 'react';
3
3
  import Icon from '@ant-design/icons';
4
4
  import { decorator } from "grey-react-box";
5
5
  import { Form } from "kts-components-antd-x3";
@@ -14,6 +14,8 @@ import InvoiceController from "../../../InvoiceController";
14
14
  import Invoice from "../../../../Invoice";
15
15
  import './index.less';
16
16
  import classNames from 'classnames';
17
+ import CardSelect from '../../components/CardSelect';
18
+ import NationalSelect from '../../components/NationalSelect';
17
19
 
18
20
  const RULES = {
19
21
  companyName: (label: string) => [
@@ -66,6 +68,9 @@ export interface IStakeholder {
66
68
  /** 是否可以选择自然人 */
67
69
  isNaturalPerson?: boolean;
68
70
 
71
+ /** 是否是自然人标志 */
72
+ naturalPersonFlag?: any;
73
+
69
74
  /** 是否展开 */
70
75
  isExpand?: boolean;
71
76
 
@@ -88,6 +93,13 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
88
93
 
89
94
  const [isExpand, setExpand] = React.useState(typeof props.isExpand === 'boolean' ? props.isExpand : true);
90
95
 
96
+ const [naturalPersonFlag, setNaturalPersonFlag] = React.useState(props.naturalPersonFlag ? props.naturalPersonFlag : 'COMPANY');
97
+
98
+ const [validateStatus, setStatus] = React.useState<any>('');
99
+ const [errorInfo, setInfo] = React.useState('');
100
+ const [nation, setNationStatue] = React.useState<any>('');
101
+ const [nationInfo, setNation] = React.useState('');
102
+
91
103
  const { getFieldDecorator } = form;
92
104
 
93
105
  const controller = Invoice.useInvoiceController();
@@ -137,216 +149,521 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
137
149
  setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
138
150
  }, [props.isExpand])
139
151
 
140
- return (
141
- <div className={classNames("kts-invoice-operate-invoice-digtal-stakeholder", { readOnly: readOnly })} >
142
- <div>
143
- {'购买方信息'.split('').map(e => <span>{e}</span>)}
144
- {
145
- // !readOnly &&
146
- <Icon
147
- className="digtal-stakeholder-expand-button"
148
- component={isExpand ? ArrowUpSvg : ArrowDownSvg}
149
- onClick={onExpand}
150
- />
152
+ React.useEffect(() => {
153
+ setNaturalPersonFlag(props.naturalPersonFlag ? props.naturalPersonFlag : 'COMPANY');
154
+ }, [props.naturalPersonFlag])
155
+
156
+ const onChangeType = React.useCallback(
157
+ (value: string) => {
158
+ const buyerTaxId = form?.getFieldValue("buyerTaxId");
159
+ const certificateNumber = form?.getFieldValue("certificateNumber");
160
+ const nationality = form?.getFieldValue("nationality");
161
+ if (value === "201") {
162
+ // 当“自然人证件类型”选择“201:居民身份证”时,校验是否为“156:中国’
163
+ form?.setFieldsValue({ nationality: "156" });
164
+ setNationStatue('');
165
+ setNation('');
166
+ if (buyerTaxId !== certificateNumber) {
167
+ setStatus('error');
168
+ setInfo('证件号码应与购方税号保持一致')
151
169
  }
152
- </div>
153
- <div>
154
- <div style={{ marginTop: 20 }} className='natural-person-flag' >
170
+ } else if (value === "210") {
171
+ if (value.startsWith("M")) {
172
+ //如果“证件号码”以M开头,"国籍(或地区头,)”必须为“446:中国澳门”;校验证件号码必须以H或M开头
173
+ if (nationality !== '446') {
174
+ setNationStatue('error');
175
+ setNation('请选择正确的国籍');
176
+ } else {
177
+ setNationStatue('');
178
+ setNation('');
179
+ }
180
+
181
+ } else if (value.startsWith("H")) {
182
+ //如果“证件号码”以H开国籍(或地区)”必须为“344:中国香港”;
183
+ if (nationality !== '344') {
184
+ setNationStatue('error');
185
+ setNation('请选择正确的国籍');
186
+ } else {
187
+ setNationStatue('');
188
+ setNation('');
189
+ }
190
+
191
+ } else {
192
+ setStatus('error');
193
+ setInfo('请输入正确的证件号码')
194
+ }
195
+ } else if (value === "237") {
196
+ if (value.startsWith("810000")) {
197
+ if (nationality !== '344') {
198
+ setNationStatue('error');
199
+ setNation('请选择正确的国籍');
200
+ } else {
201
+ setNationStatue('');
202
+ setNation('');
203
+ }
204
+
205
+ } else if (value.startsWith("820000")) {
206
+ if (nationality !== '446') {
207
+ setNationStatue('error');
208
+ setNation('请选择正确的国籍');
209
+ } else {
210
+ setNationStatue('');
211
+ setNation('');
212
+ }
213
+
214
+
215
+ } else {
216
+ setStatus('error');
217
+ setInfo('请输入正确的证件号码')
218
+ return Promise.reject("请输入正确的证件号码");
219
+ }
220
+ } else if (value === "227") {
221
+
222
+ // 当“自然人证件类型”选择“227:中华人民共和国护照”时,校验是否为“156:中国
223
+ form?.setFieldsValue({ nationality: "156" });
224
+
225
+ } else if (value === "213" || value === "238") {
226
+ // 当“自然人证件类型”选择“213:台湾居民来往大陆通行证”时,校验是否为”158:中国台湾”
227
+ // 当“自然人证件类型”选择“238:中华人民共和国台湾居民居住证”时,校验是否为“ 158:中国台湾”
228
+ form?.setFieldsValue({ nationality: "158" });
229
+ }
230
+ },
231
+ [form]
232
+ );
233
+ /** 校验证件号码*/
234
+ const validateIDCode = useCallback(
235
+ (_: any, value: string) => {
236
+ if (!value) {
237
+ setStatus('error');
238
+ setInfo('请输入正确的证件号码')
239
+ return Promise.resolve();
240
+ }
241
+
242
+ const idtype = form?.getFieldValue("certificateType");
243
+ const nationality = form?.getFieldValue("nationality");
244
+ if (idtype === "210") {
245
+ // 当“自然人证件类型”选择“210:港澳居民来往内地通行证”时,
246
+
247
+
248
+ if (value.startsWith("M")) {
249
+ //如果“证件号码”以M开头,"国籍(或地区头,)”必须为“446:中国澳门”;校验证件号码必须以H或M开头
250
+ if (nationality !== '446') {
251
+ setNationStatue('error');
252
+ setNation('请选择正确的国籍');
253
+ } else {
254
+ setNationStatue('');
255
+ setNation('');
256
+ }
257
+
258
+ } else if (value.startsWith("H")) {
259
+ //如果“证件号码”以H开国籍(或地区)”必须为“344:中国香港”;
260
+ if (nationality !== '344') {
261
+ setNationStatue('error');
262
+ setNation('请选择正确的国籍');
263
+ } else {
264
+ setNationStatue('');
265
+ setNation('');
266
+ }
267
+
268
+ } else {
269
+ setStatus('error');
270
+ setInfo('请输入正确的证件号码')
271
+ return Promise.reject("请输入正确的证件号码");
272
+ }
273
+ } else if (idtype === "237") {
274
+ //当“自然人证件类型”选择“237:中华人民共和国港澳居民居住证”时,校验证件号码必须以810000或820000开头,如果“证件号码”以810000开头,必须为“344:中国香国籍(或地区))港”;如果“证件号码”以820000开头,国籍(或地区)必须为“446:中国澳门”
275
+ if (value.startsWith("810000")) {
276
+ if (nationality !== '344') {
277
+ setNationStatue('error');
278
+ setNation('请选择正确的国籍');
279
+ } else {
280
+ setNationStatue('');
281
+ setNation('');
282
+ }
283
+
284
+ } else if (value.startsWith("820000")) {
285
+ if (nationality !== '446') {
286
+ setNationStatue('error');
287
+ setNation('请选择正确的国籍');
288
+ } else {
289
+ setNationStatue('');
290
+ setNation('');
291
+ }
292
+
293
+
294
+ } else {
295
+ setStatus('error');
296
+ setInfo('请输入正确的证件号码')
297
+ return Promise.reject("请输入正确的证件号码");
298
+ }
299
+ }
300
+ // 当“销售方自然人证件类型”填写“201:居民身份证”,“销售方纳税人识别号”必须与“销售方自然人证件号码”完全一致
301
+ if (idtype === "201") {
302
+ const buyerTaxId = form?.getFieldValue("buyerTaxId");
303
+ if (value !== buyerTaxId) {
304
+ setStatus('error');
305
+ setInfo('证件号码应与购方税号保持一致')
306
+ return Promise.reject("证件号码应与购方税号保持一致");
307
+ } else if (value === buyerTaxId) {
308
+ setStatus('');
309
+ setInfo('')
310
+ }
311
+ }
312
+ setStatus('');
313
+ setInfo('')
314
+ return Promise.resolve();
315
+ },
316
+ [form]
317
+ );
318
+ const validateIDCode2 = useCallback(
319
+ (e: any) => {
320
+ const value = e.target.value;
321
+ // if (!value) {
322
+ // setStatus('');
323
+ // setInfo('')
324
+ // }
325
+
326
+ const idtype = form?.getFieldValue("certificateType");
327
+
328
+ // // 当“自然人证件类型”填写“201:居民身份证”,“购买方纳税人识别号”必须与“自然人证件号码”完全一致
329
+ if (idtype === "201") {
330
+ const certificateNumber = form?.getFieldValue("certificateNumber");
331
+ console.log(value, certificateNumber)
332
+ if (value !== certificateNumber) {
333
+ setStatus('error');
334
+ setInfo('证件号码应与购方税号保持一致')
335
+ } else {
336
+ setStatus('');
337
+ setInfo('')
338
+ }
339
+ }
340
+ },
341
+ [form]
342
+ );
343
+ const validateNationality = useCallback(
344
+ (_: any, value: string) => {
345
+ if (!value) {
346
+ setNationStatue('error');
347
+ setNation('请选择正确的国籍');
348
+ return Promise.resolve();
349
+ }
350
+ const idtype = form?.getFieldValue("certificateType");
351
+ const idcode = form?.getFieldValue("certificateNumber");
352
+ console.log(value, idtype, idcode)
353
+ if (idtype === "201" || idtype === "227") {
354
+ // 当“自然人证件类型”选择“201:居民身份证”时,校验是否为“156:中国’
355
+ // 当“自然人证件类型”选择“227:中华人民共和国护照”时,校验是否为“156:中国
356
+ if (value !== "156") {
357
+ setNationStatue('error');
358
+ setNation('请选择正确的国籍');
359
+ return Promise.reject("请选择正确的国籍");
360
+ }
361
+ } else if (idtype === "213" || idtype === "238") {
362
+ // 当“自然人证件类型”选择“213:台湾居民来往大陆通行证”时,校验是否为”158:中国台湾”
363
+ // 当“自然人证件类型”选择“238:中华人民共和国台湾居民居住证”时,校验是否为“ 158:中国台湾”
364
+ if (value !== "158") {
365
+ setNationStatue('error');
366
+ setNation('请选择正确的国籍');
367
+ return Promise.reject("请选择正确的国籍");
368
+ }
369
+ } else if (idtype === "210") {
370
+ //当“自然人证件类型”选择“210:港澳居民来往内地通行证”时,如果“证件号码”以H开国籍(或地区)”必须为“344:中国香港”;如果“证件号码”以M开头,"国籍(或地区头,)”必须为“446:中国澳门”;
371
+ let r = false;
372
+ if (idcode) {
373
+ if (idcode.startsWith("M") && value === "446") {
374
+ r = true;
375
+ } else if (idcode.startsWith("H") && value === "344") {
376
+ r = true;
377
+ }
378
+ } else if (value === "344" || value === "446") {
379
+ r = true;
380
+ }
381
+ if (!r) {
382
+ setNationStatue('error');
383
+ setNation('请选择正确的国籍');
384
+ return Promise.reject("请选择正确的国籍");
385
+ }
386
+ } else if (idtype === "237") {
387
+ //当“自然人证件类型”选择“237:中华人民共和国港澳居民居住证”时,校验证件号码必须以810000或820000开头,如果“证件号码”以810000开头,必须为“344:中国香国籍(或地区))港”;如果“证件号码”以820000开头,国籍(或地区)必须为“446:中国澳门”
388
+ let r = false;
389
+ if (idcode) {
390
+ if (idcode.startsWith("820000") && value === "446") {
391
+ r = true;
392
+ } else if (idcode.startsWith("810000") && value === "344") {
393
+ r = true;
394
+ }
395
+ } else if (value === "344" || value === "446") {
396
+ r = true;
397
+ }
398
+ if (!r) {
399
+ setNationStatue('error');
400
+ setNation('请选择正确的国籍');
401
+ return Promise.reject("请选择正确的国籍");
402
+ }
403
+ }
404
+ setNationStatue('');
405
+ setNation('');
406
+ return Promise.resolve();
407
+ },
408
+ [form]
409
+ );
410
+
411
+ return (
412
+ <>
413
+ <div className={classNames("kts-invoice-operate-invoice-digtal-stakeholder", { readOnly: readOnly })} >
414
+ <div>
415
+ {'购买方信息'.split('').map(e => <span>{e}</span>)}
155
416
  {
156
- props.isNaturalPerson === true &&
157
- <Form.Item colon={false}>
158
- {getFieldDecorator('naturalPersonFlag', {
159
- })(
160
- <NaturalPersonFlag readOnly={isReadOnly('naturalPersonFlag')} />
161
- )}
162
- </Form.Item>
417
+ // !readOnly &&
418
+ <Icon
419
+ className="digtal-stakeholder-expand-button"
420
+ component={isExpand ? ArrowUpSvg : ArrowDownSvg}
421
+ onClick={onExpand}
422
+ />
163
423
  }
164
424
  </div>
165
- <Form className="digtal-stakeholder-form" >
166
- <Row gutter={[16, 0]}>
167
- <Col span={24} >
168
- <Form.Item label='名称' colon={false}>
169
- {getFieldDecorator('buyerName', {
170
- rules: getRules('buyerName', RULES.companyName('购买方名称')),
425
+ <div>
426
+ <div style={{ marginTop: 20 }} className='natural-person-flag' >
427
+ {
428
+ props.isNaturalPerson === true &&
429
+ <Form.Item colon={false}>
430
+ {getFieldDecorator('naturalPersonFlag', {
171
431
  })(
172
- <BuyerNameInput
173
- myform={form}
174
- fieldName='buyerName'
175
- readOnly={isReadOnly('buyerName')}
176
- placeholder="请输入名称"
177
- autoComplete="off"
178
- suffix={
179
- isShowImportButton === true &&
180
- <Button
181
- type='link'
182
- style={{ padding: 0, width: 20, height: '100%' }}
183
- icon={<Icon component={PlusSvg} />}
184
- onClick={() => { onClickImportButton && onClickImportButton(controller) }}
185
- />
186
- }
187
- />
432
+ <NaturalPersonFlag readOnly={isReadOnly('naturalPersonFlag')} onChange={setNaturalPersonFlag} />
188
433
  )}
189
434
  </Form.Item>
190
- </Col>
435
+ }
436
+ </div>
437
+ <Form className="digtal-stakeholder-form" >
438
+ <Row gutter={[16, 0]}>
439
+ <Col span={24} >
440
+ <Form.Item label='名称' colon={false}>
441
+ {getFieldDecorator('buyerName', {
442
+ rules: getRules('buyerName', RULES.companyName('购买方名称')),
443
+ })(
444
+ <BuyerNameInput
445
+ myform={form}
446
+ fieldName='buyerName'
447
+ readOnly={isReadOnly('buyerName')}
448
+ placeholder="请输入名称"
449
+ autoComplete="off"
450
+ suffix={
451
+ isShowImportButton === true &&
452
+ <Button
453
+ type='link'
454
+ style={{ padding: 0, width: 20, height: '100%' }}
455
+ icon={<Icon component={PlusSvg} />}
456
+ onClick={() => { onClickImportButton && onClickImportButton(controller) }}
457
+ />
458
+ }
459
+ />
460
+ )}
461
+ </Form.Item>
462
+ </Col>
191
463
 
192
- <Col span={24} >
193
- <Form.Item label='统一社会信用代码/纳税人识别号' colon={false}>
194
- {getFieldDecorator('buyerTaxId', {
195
- rules: getRules('buyerTaxId', [{ required: !isVatNormal, message: '购买方纳税人识别号必填' }, ...RULES.taxId('购买方纳税人识别号')])
196
- })(
197
- <BuyerNameInput
198
- myform={form}
199
- fieldName='buyerTaxId'
200
- readOnly={isReadOnly('buyerTaxId')}
201
- placeholder="请输入统一社会信用代码/纳税人识别号"
202
- autoComplete="off"
203
- />
204
- )}
205
- </Form.Item>
206
- </Col>
464
+ <Col span={24} >
465
+ <Form.Item label='统一社会信用代码/纳税人识别号' colon={false}>
466
+ {getFieldDecorator('buyerTaxId', {
467
+ rules: getRules('buyerTaxId', [{ required: !isVatNormal, message: '购买方纳税人识别号必填' }, ...RULES.taxId('购买方纳税人识别号')])
468
+ })(
469
+ <BuyerNameInput
470
+ myform={form}
471
+ onChange={validateIDCode2}
472
+ fieldName='buyerTaxId'
473
+ readOnly={isReadOnly('buyerTaxId')}
474
+ placeholder="请输入统一社会信用代码/纳税人识别号"
475
+ autoComplete="off"
476
+ />
477
+ )}
478
+ </Form.Item>
479
+ </Col>
207
480
 
208
- <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
209
- <Form.Item label='购买方地址' colon={false}>
210
- {getFieldDecorator('buyerAddress', {
211
- rules: getRules('buyerAddress', [{ max: 100, message: '购买方地址内容超长' }])
212
- })(<MyInput readOnly={isReadOnly('buyerAddress')} placeholder="请输入购买方地址" autoComplete="off" />)}
213
- </Form.Item>
214
- </Col>
481
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
482
+ <Form.Item label='购买方地址' colon={false}>
483
+ {getFieldDecorator('buyerAddress', {
484
+ rules: getRules('buyerAddress', [{ max: 100, message: '购买方地址内容超长' }])
485
+ })(<MyInput readOnly={isReadOnly('buyerAddress')} placeholder="请输入购买方地址" autoComplete="off" />)}
486
+ </Form.Item>
487
+ </Col>
215
488
 
216
- <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
217
- <Form.Item label='电话' colon={false} className='telephone'>
218
- {getFieldDecorator('buyerPhone', {
219
- rules: getRules('buyerPhone', RULES.buyerTelPhone('购买方电话'))
220
- })(<MyInput readOnly={isReadOnly('buyerPhone')} placeholder="请输入电话" autoComplete="off" />)}
221
- </Form.Item>
222
- </Col>
223
- {(props.leqi) &&
224
- <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
225
- <Form.Item colon={false}>
226
- {getFieldDecorator('buyerAddressPhoneFlag', {
227
- valuePropName: 'checked',
228
- })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly2('buyerAddressPhoneFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
489
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
490
+ <Form.Item label='电话' colon={false} className='telephone'>
491
+ {getFieldDecorator('buyerPhone', {
492
+ rules: getRules('buyerPhone', RULES.buyerTelPhone('购买方电话'))
493
+ })(<MyInput readOnly={isReadOnly('buyerPhone')} placeholder="请输入电话" autoComplete="off" />)}
494
+ </Form.Item>
495
+ </Col>
496
+ {(props.leqi) &&
497
+ <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
498
+ <Form.Item colon={false}>
499
+ {getFieldDecorator('buyerAddressPhoneFlag', {
500
+ valuePropName: 'checked',
501
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly2('buyerAddressPhoneFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
502
+ </Form.Item>
503
+ </Col>
504
+ }
505
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
506
+ <Form.Item label='购买方开户银行' colon={false}>
507
+ {getFieldDecorator('buyerBank', {
508
+ rules: getRules('buyerBank', RULES.bankName('购买方开户银行'))
509
+ })(<MyInput readOnly={isReadOnly('buyerBank')} placeholder="请输入购买方开户银行" autoComplete="off" />)}
229
510
  </Form.Item>
230
511
  </Col>
231
- }
232
- <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
233
- <Form.Item label='购买方开户银行' colon={false}>
234
- {getFieldDecorator('buyerBank', {
235
- rules: getRules('buyerBank', RULES.bankName('购买方开户银行'))
236
- })(<MyInput readOnly={isReadOnly('buyerBank')} placeholder="请输入购买方开户银行" autoComplete="off" />)}
237
- </Form.Item>
238
- </Col>
239
512
 
240
- <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
241
- <Form.Item label='银行账号' colon={false}>
242
- {getFieldDecorator('buyerAccount', {
243
- rules: getRules('buyerAccount', RULES.bankAccount('购买方银行账号'))
244
- })(<MyInput readOnly={isReadOnly('buyerAccount')} placeholder="请输入银行账号" autoComplete="off" />)}
245
- </Form.Item>
246
- </Col>
247
- {(props.leqi) &&
248
- <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
249
- <Form.Item colon={false}>
250
- {getFieldDecorator('buyerBankAccountFlag', {
251
- valuePropName: 'checked',
252
- })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly2('buyerBankAccountFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
513
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
514
+ <Form.Item label='银行账号' colon={false}>
515
+ {getFieldDecorator('buyerAccount', {
516
+ rules: getRules('buyerAccount', RULES.bankAccount('购买方银行账号'))
517
+ })(<MyInput readOnly={isReadOnly('buyerAccount')} placeholder="请输入银行账号" autoComplete="off" />)}
518
+ </Form.Item>
519
+ </Col>
520
+ {(props.leqi) &&
521
+ <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
522
+ <Form.Item colon={false}>
523
+ {getFieldDecorator('buyerBankAccountFlag', {
524
+ valuePropName: 'checked',
525
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly2('buyerBankAccountFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
526
+ </Form.Item>
527
+ </Col>
528
+ }
529
+ </Row>
530
+ </Form>
531
+ </div>
532
+ <div>
533
+ {'销售方信息'.split('').map(e => <span>{e}</span>)}
534
+ {
535
+ // !readOnly &&
536
+ <Icon
537
+ className="digtal-stakeholder-expand-button"
538
+ component={isExpand ? ArrowUpSvg : ArrowDownSvg}
539
+ onClick={onExpand}
540
+ />
541
+ }
542
+ </div>
543
+ <div>
544
+ {
545
+ !readOnly && props.lineCredit &&
546
+ <div style={{ marginTop: 20 }} >
547
+ <Tooltip trigger="click" title={props.lineCredit} >
548
+ <Button type="link" style={{ padding: `0px 8px` }} >查看当前可用授信额度</Button>
549
+ </Tooltip>
550
+ </div>
551
+ }
552
+ <Form className="digtal-stakeholder-form" >
553
+ <Row gutter={[16, 0]}>
554
+ <Col span={24} >
555
+ <Form.Item label='名称' colon={false}>
556
+ {getFieldDecorator('supplierName', {
557
+ rules: getRules('supplierName', RULES.companyName('销售方名称')),
558
+ getValueFromEvent: formatCompanyName
559
+ })(<MyInput readOnly={isReadOnly('supplierName')} placeholder="请输入名称" autoComplete="off" />)}
253
560
  </Form.Item>
254
561
  </Col>
255
- }
256
- </Row>
257
- </Form>
258
- </div>
259
- <div>
260
- {'销售方信息'.split('').map(e => <span>{e}</span>)}
261
- {
262
- // !readOnly &&
263
- <Icon
264
- className="digtal-stakeholder-expand-button"
265
- component={isExpand ? ArrowUpSvg : ArrowDownSvg}
266
- onClick={onExpand}
267
- />
268
- }
269
- </div>
270
- <div>
271
- {
272
- !readOnly && props.lineCredit &&
273
- <div style={{ marginTop: 20 }} >
274
- <Tooltip trigger="click" title={props.lineCredit} >
275
- <Button type="link" style={{ padding: `0px 8px` }} >查看当前可用授信额度</Button>
276
- </Tooltip>
277
- </div>
278
- }
279
- <Form className="digtal-stakeholder-form" >
280
- <Row gutter={[16, 0]}>
281
- <Col span={24} >
282
- <Form.Item label='名称' colon={false}>
283
- {getFieldDecorator('supplierName', {
284
- rules: getRules('supplierName', RULES.companyName('销售方名称')),
285
- getValueFromEvent: formatCompanyName
286
- })(<MyInput readOnly={isReadOnly('supplierName')} placeholder="请输入名称" autoComplete="off" />)}
287
- </Form.Item>
288
- </Col>
289
562
 
290
- <Col span={24} >
291
- <Form.Item label='统一社会信用代码/纳税人识别号' colon={false}>
292
- {getFieldDecorator('supplierTaxId', {
293
- rules: getRules('supplierTaxId', [{ required: true, message: '销售方纳税人识别号必填' }, ...RULES.taxId('销售方纳税人识别号')])
294
- })(<MyInput readOnly={isReadOnly('supplierTaxId')} placeholder="请输入统一社会信用代码/纳税人识别号" autoComplete="off" />)}
295
- </Form.Item>
296
- </Col>
563
+ <Col span={24} >
564
+ <Form.Item label='统一社会信用代码/纳税人识别号' colon={false}>
565
+ {getFieldDecorator('supplierTaxId', {
566
+ rules: getRules('supplierTaxId', [{ required: true, message: '销售方纳税人识别号必填' }, ...RULES.taxId('销售方纳税人识别号')])
567
+ })(<MyInput readOnly={isReadOnly('supplierTaxId')} placeholder="请输入统一社会信用代码/纳税人识别号" autoComplete="off" />)}
568
+ </Form.Item>
569
+ </Col>
297
570
 
298
- <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
299
- <Form.Item label='销售方地址' colon={false}>
300
- {getFieldDecorator('sellerAddress', {
301
- rules: getRules('sellerAddress', [{ max: 300, message: '销售方地址内容超长' }])
302
- })(<MyInput readOnly={isReadOnly('sellerAddress')} placeholder="请输入销售方地址" autoComplete="off" />)}
303
- </Form.Item>
304
- </Col>
571
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
572
+ <Form.Item label='销售方地址' colon={false}>
573
+ {getFieldDecorator('sellerAddress', {
574
+ rules: getRules('sellerAddress', [{ max: 300, message: '销售方地址内容超长' }])
575
+ })(<MyInput readOnly={isReadOnly('sellerAddress')} placeholder="请输入销售方地址" autoComplete="off" />)}
576
+ </Form.Item>
577
+ </Col>
305
578
 
306
- <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
307
- <Form.Item label='电话' colon={false} className='telephone' >
308
- {getFieldDecorator('sellerPhone', {
309
- rules: getRules('sellerPhone', RULES.sellerTelPhone('销售方电话'))
310
- })(<MyInput readOnly={isReadOnly('sellerPhone')} placeholder="请输入电话" autoComplete="off" />)}
311
- </Form.Item>
312
- </Col>
313
- {(props.leqi) &&
314
- <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
315
- <Form.Item colon={false}>
316
- {getFieldDecorator('sellerAddressPhoneFlag', {
317
- valuePropName: 'checked',
318
- })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly2('sellerAddressPhoneFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
579
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
580
+ <Form.Item label='电话' colon={false} className='telephone' >
581
+ {getFieldDecorator('sellerPhone', {
582
+ rules: getRules('sellerPhone', RULES.sellerTelPhone('销售方电话'))
583
+ })(<MyInput readOnly={isReadOnly('sellerPhone')} placeholder="请输入电话" autoComplete="off" />)}
584
+ </Form.Item>
585
+ </Col>
586
+ {(props.leqi) &&
587
+ <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
588
+ <Form.Item colon={false}>
589
+ {getFieldDecorator('sellerAddressPhoneFlag', {
590
+ valuePropName: 'checked',
591
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly2('sellerAddressPhoneFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
592
+ </Form.Item>
593
+ </Col>
594
+ }
595
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
596
+ <Form.Item label='销售方开户银行' colon={false}>
597
+ {getFieldDecorator('sellerBank', {
598
+ rules: getRules('sellerBank', RULES.bankName('销售方开户银行'))
599
+ })(<MyInput readOnly={isReadOnly('sellerBank')} placeholder="请输入销售方开户银行" autoComplete="off" />)}
319
600
  </Form.Item>
320
601
  </Col>
321
- }
322
- <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
323
- <Form.Item label='销售方开户银行' colon={false}>
324
- {getFieldDecorator('sellerBank', {
325
- rules: getRules('sellerBank', RULES.bankName('销售方开户银行'))
326
- })(<MyInput readOnly={isReadOnly('sellerBank')} placeholder="请输入销售方开户银行" autoComplete="off" />)}
327
- </Form.Item>
328
- </Col>
329
602
 
330
- <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
331
- <Form.Item label='银行账号' colon={false}>
332
- {getFieldDecorator('sellerAccount', {
333
- rules: getRules('sellerAccount', RULES.bankAccount('销售方银行账号'))
334
- })(<MyInput readOnly={isReadOnly('sellerAccount')} placeholder="请输入银行账号" autoComplete="off" />)}
335
- </Form.Item>
336
- </Col>
337
- {(props.leqi) &&
338
- <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
339
- <Form.Item colon={false}>
340
- {getFieldDecorator('sellerBankAccountFlag', {
341
- valuePropName: 'checked',
342
- })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly2('sellerBankAccountFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
603
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
604
+ <Form.Item label='银行账号' colon={false}>
605
+ {getFieldDecorator('sellerAccount', {
606
+ rules: getRules('sellerAccount', RULES.bankAccount('销售方银行账号'))
607
+ })(<MyInput readOnly={isReadOnly('sellerAccount')} placeholder="请输入银行账号" autoComplete="off" />)}
343
608
  </Form.Item>
344
609
  </Col>
345
- }
346
- </Row>
347
- </Form>
610
+ {(props.leqi) &&
611
+ <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
612
+ <Form.Item colon={false}>
613
+ {getFieldDecorator('sellerBankAccountFlag', {
614
+ valuePropName: 'checked',
615
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly2('sellerBankAccountFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
616
+ </Form.Item>
617
+ </Col>
618
+ }
619
+ </Row>
620
+ </Form>
621
+ </div>
348
622
  </div>
349
- </div>
623
+ {
624
+ naturalPersonFlag === 'NATURAL' &&
625
+ <div className='kts-invoice-operate-invoice-digtal-payinfo'>
626
+ <Form className="digtal-stakeholder-form" style={{ width: '100%' }}>
627
+ <Row gutter={[16, 0]}>
628
+ <Col span={5} >
629
+ <Form.Item label='自然人购买方补充信息' colon={false} >
630
+
631
+ </Form.Item>
632
+ </Col>
633
+ {/* <label>自然人销售方补充信息</label> */}
634
+ <Col span={6} >
635
+ <Form.Item label='证件类型' colon={false} >
636
+ {getFieldDecorator('certificateType', {
637
+ rules: [{ required: true, message: '数据必填' }]
638
+ })(<CardSelect onChange={onChangeType} readOnly={isReadOnly('certificateType')} placeholder="数据必填" autoComplete="off" />)}
639
+ </Form.Item>
640
+ </Col>
641
+ <Col span={7} >
642
+ <Form.Item label='证件号码' colon={false} validateStatus={validateStatus} help={errorInfo}>
643
+ {getFieldDecorator('certificateNumber', {
644
+ rules: [{ required: true, message: '数据必填' }, { max: 30, message: `内容超长` }, { validator: validateIDCode },]
645
+ })(<MyInput readOnly={isReadOnly('certificateNumber')} placeholder="数据必填" autoComplete="off" />)}
646
+ </Form.Item>
647
+ </Col>
648
+ <Col span={6} >
649
+ <Form.Item label='国籍(或地区)' colon={false} validateStatus={nation} help={nationInfo}>
650
+ {getFieldDecorator('nationality', {
651
+ rules: [{ required: true, message: '数据必填' }, { validator: validateNationality }]
652
+ })(<NationalSelect showSearch={true}
653
+ optionFilterProp="children"
654
+ filterOption={(input: any, option: any) => {
655
+ if (option) {
656
+ return option.label?.indexOf(input) >= 0;
657
+ }
658
+ return false;
659
+ }} readOnly={isReadOnly('nationality')} placeholder="数据必填" autoComplete="off" />)}
660
+ </Form.Item>
661
+ </Col>
662
+ </Row>
663
+ </Form>
664
+ </div>
665
+ }
666
+ </>
350
667
  )
351
668
  })
352
669