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