|
|
@ -18,6 +18,8 @@ import { PageContainer } from '@ant-design/pro-layout';
|
|
|
|
import ProDescriptions from '@ant-design/pro-descriptions';
|
|
|
|
import ProDescriptions from '@ant-design/pro-descriptions';
|
|
|
|
import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo } from './service';
|
|
|
|
import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo } from './service';
|
|
|
|
import cookie from 'react-cookies';
|
|
|
|
import cookie from 'react-cookies';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import styles from './index.less'
|
|
|
|
const waitTime = (time: number = 100) => {
|
|
|
|
const waitTime = (time: number = 100) => {
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
@ -42,7 +44,6 @@ export default () => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},{
|
|
|
|
},{
|
|
|
|
formatResult: (result) => {
|
|
|
|
formatResult: (result) => {
|
|
|
|
console.log('result',result);
|
|
|
|
|
|
|
|
setBackInfo(result.table_List);
|
|
|
|
setBackInfo(result.table_List);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -56,14 +57,13 @@ export default () => {
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<PageContainer content={''} extraContent={''}>
|
|
|
|
<PageContainer content={''} extraContent={''}>
|
|
|
|
<ProCard>
|
|
|
|
<ProCard className={styles.registration}>
|
|
|
|
<StepsForm<{
|
|
|
|
<StepsForm<{
|
|
|
|
name: string;
|
|
|
|
name: string;
|
|
|
|
}>
|
|
|
|
}>
|
|
|
|
formRef={formRef}
|
|
|
|
formRef={formRef}
|
|
|
|
|
|
|
|
style={{textAlign:'center'}}
|
|
|
|
onFinish={async () => {
|
|
|
|
onFinish={async () => {
|
|
|
|
const data = await waitTime(1000);
|
|
|
|
|
|
|
|
message.success('提交成功');
|
|
|
|
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
formProps={{
|
|
|
|
formProps={{
|
|
|
|
layout: "horizontal",
|
|
|
|
layout: "horizontal",
|
|
|
@ -83,9 +83,9 @@ export default () => {
|
|
|
|
description: false,
|
|
|
|
description: false,
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
onFinish={async (values) => {
|
|
|
|
onFinish={async (values) => {
|
|
|
|
console.log('values',values);
|
|
|
|
// console.log('values',values);
|
|
|
|
console.log(formRef.current?.getFieldsValue());
|
|
|
|
// console.log(formRef.current?.getFieldsValue());
|
|
|
|
await waitTime(2000);
|
|
|
|
// await waitTime(2000);
|
|
|
|
setBaseInfo(values);
|
|
|
|
setBaseInfo(values);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}}
|
|
|
|
}}
|
|
|
@ -126,9 +126,9 @@ export default () => {
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
rules={[{ required: true, message: '请选择出生年月' }]}
|
|
|
|
rules={[{ required: true, message: '请选择出生年月' }]}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<ProFormText name="idCard" label="身份证号" width="sm" rules={[{ required: true, message: '请输入正确身份证号' }]}/>
|
|
|
|
<ProFormText name="idCard" label="身份证号" width="sm" rules={[{ required: true, message: '请输入身份证号' },{len:18,message:'请输入18位身份证号'},{pattern:/^[0-9]+$/,message:'只允许输入数字'}]}/>
|
|
|
|
<ProFormText name="address" label="家庭地址" rules={[{ required: true, message: '请输入家庭地址' }]}/>
|
|
|
|
<ProFormText name="address" label="家庭地址" rules={[{ required: true, message: '请输入家庭地址' }]}/>
|
|
|
|
<ProFormText name="contact" label="联系方式" width="lg" placeholder="联系方式" rules={[{ required: true, message: '请输入联系方式' }]} />
|
|
|
|
<ProFormText name="contact" label="联系方式" width="lg" placeholder="联系方式" rules={[{ required: true, message: '请输入联系方式' },{len:11,message:'请输入11位联系方式'},{pattern:/^[0-9]+$/,message:'只允许输入数字'}]} />
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col lg={12} md={12} sm={24}>
|
|
|
|
<Col lg={12} md={12} sm={24}>
|
|
|
|
<ProFormText name="org" label="所在学校" width="md" placeholder="请填写" value={backInfo?.bureau_name} disabled />
|
|
|
|
<ProFormText name="org" label="所在学校" width="md" placeholder="请填写" value={backInfo?.bureau_name} disabled />
|
|
|
@ -219,7 +219,7 @@ export default () => {
|
|
|
|
//actionRef={actionRef}
|
|
|
|
//actionRef={actionRef}
|
|
|
|
request={async (value) => {
|
|
|
|
request={async (value) => {
|
|
|
|
const data = await queryExaminationRule({
|
|
|
|
const data = await queryExaminationRule({
|
|
|
|
examination_id: 1
|
|
|
|
examination_id: 2
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
setTestInfo(data.bean);
|
|
|
|
setTestInfo(data.bean);
|
|
|
@ -258,6 +258,7 @@ export default () => {
|
|
|
|
onFinish={async () => {
|
|
|
|
onFinish={async () => {
|
|
|
|
// console.log(formRef.current?.getFieldsValue());
|
|
|
|
// console.log(formRef.current?.getFieldsValue());
|
|
|
|
// 跳转到指定路由
|
|
|
|
// 跳转到指定路由
|
|
|
|
|
|
|
|
try {
|
|
|
|
const success = await savePersonSignUpInfo({
|
|
|
|
const success = await savePersonSignUpInfo({
|
|
|
|
address:baseInfo?.address,
|
|
|
|
address:baseInfo?.address,
|
|
|
|
birthday:baseInfo?.birthday,
|
|
|
|
birthday:baseInfo?.birthday,
|
|
|
@ -268,7 +269,7 @@ export default () => {
|
|
|
|
district_id:backInfo?.district_id,
|
|
|
|
district_id:backInfo?.district_id,
|
|
|
|
district_name:backInfo?.district_name,
|
|
|
|
district_name:backInfo?.district_name,
|
|
|
|
education:baseInfo?.qualifications,
|
|
|
|
education:baseInfo?.qualifications,
|
|
|
|
examination_id:1,
|
|
|
|
examination_id:2,
|
|
|
|
gender:baseInfo?.sex,
|
|
|
|
gender:baseInfo?.sex,
|
|
|
|
id_code:baseInfo?.idCard,
|
|
|
|
id_code:baseInfo?.idCard,
|
|
|
|
identity_id:backInfo?.identity_id,
|
|
|
|
identity_id:backInfo?.identity_id,
|
|
|
@ -281,31 +282,30 @@ export default () => {
|
|
|
|
tel:baseInfo?.contact,
|
|
|
|
tel:baseInfo?.contact,
|
|
|
|
university:baseInfo?.graduation,
|
|
|
|
university:baseInfo?.graduation,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
const msg=testInfo.examination_start_time+','+testInfo.examination_end_time+','+testInfo.examination_name+','+success.admission_number;
|
|
|
|
|
|
|
|
history.push( '/registration/success/'+msg);
|
|
|
|
|
|
|
|
}catch (error) {
|
|
|
|
|
|
|
|
if(error.response){
|
|
|
|
|
|
|
|
message.error(error.response.info);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
message.error('报名失败');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log('success',success);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
|
|
|
|
const msg='你已报名'+testInfo.examination_start_time+'-'+testInfo.examination_end_time+' '+testInfo.examination_name+',准考证号是'+success.admission_number+',请准时参加考试!';
|
|
|
|
|
|
|
|
const info=JSON.stringify(msg)
|
|
|
|
|
|
|
|
// console.log('msg',msg);
|
|
|
|
|
|
|
|
// console.log('info',info);
|
|
|
|
|
|
|
|
history.push( '/registration/success/'+info);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// history.push('/registration/success');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// const msg='你已报名'+testInfo.examination_start_time+'-'+testInfo.examination_end_time+' '+testInfo.examination_name+',准考证号是'+',请准时参加考试!';
|
|
|
|
|
|
|
|
// const info=JSON.stringify(msg);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// console.log('info',info);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// const aa=Base64.byteLength(info);
|
|
|
|
|
|
|
|
// console.log('msg',msg);
|
|
|
|
|
|
|
|
// // console.log('info',info);
|
|
|
|
|
|
|
|
// console.log('aa',aa)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log('success',success);
|
|
|
|
|
|
|
|
// if (success.success) {
|
|
|
|
|
|
|
|
// // const msg='你已报名'+testInfo.examination_start_time+'-'+testInfo.examination_end_time+' '+testInfo.examination_name+',准考证号是'+success.admission_number+',请准时参加考试!';
|
|
|
|
|
|
|
|
// const msg=testInfo.examination_start_time+','+testInfo.examination_end_time+','+testInfo.examination_name+','+success.admission_number;
|
|
|
|
|
|
|
|
// // const info=JSON.stringify(msg)
|
|
|
|
|
|
|
|
// console.log('mag',msg);
|
|
|
|
|
|
|
|
// history.push( '/registration/success/'+msg);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
|
|
// message.config('报名失败!')
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// return true;
|
|
|
|
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
@ -316,14 +316,6 @@ export default () => {
|
|
|
|
column={1}
|
|
|
|
column={1}
|
|
|
|
//actionRef={actionRef}
|
|
|
|
//actionRef={actionRef}
|
|
|
|
request={async () => {
|
|
|
|
request={async () => {
|
|
|
|
// console.log('testInfo---',testInfo)
|
|
|
|
|
|
|
|
// console.log('baseInfo----',baseInfo)
|
|
|
|
|
|
|
|
// return Promise.resolve({
|
|
|
|
|
|
|
|
// success: true,
|
|
|
|
|
|
|
|
// data: {
|
|
|
|
|
|
|
|
// last_id:testInfo.id,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
extra={false}
|
|
|
|
extra={false}
|
|
|
|
>
|
|
|
|
>
|
|
|
|