From 5f643caca0cb1904f0d44545ce064ed383333f57 Mon Sep 17 00:00:00 2001 From: wangxi <123456> Date: Fri, 11 Mar 2022 10:26:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/course/list/index.tsx | 4 +- web/src/pages/course/subject/index.tsx | 2 +- web/src/pages/dashboard/workplace/index.tsx | 3 +- web/src/pages/registration/index.tsx | 90 ++++++++++++--------- web/src/pages/registration/service.ts | 8 ++ 5 files changed, 63 insertions(+), 44 deletions(-) diff --git a/web/src/pages/course/list/index.tsx b/web/src/pages/course/list/index.tsx index 341190d..6760aa0 100644 --- a/web/src/pages/course/list/index.tsx +++ b/web/src/pages/course/list/index.tsx @@ -107,7 +107,7 @@ const CardList = () => { <> 学习进度: - percent === 100 ? '100%' : `${percent}%`} /> @@ -182,7 +182,7 @@ const CardList = () => {
{item?.course_name}
{item?.course_hours*60}分钟
- percent === 100 ? '100%' : `${percent}%`} />
diff --git a/web/src/pages/course/subject/index.tsx b/web/src/pages/course/subject/index.tsx index 83dfab6..884050f 100644 --- a/web/src/pages/course/subject/index.tsx +++ b/web/src/pages/course/subject/index.tsx @@ -77,7 +77,7 @@ const SubjectList = () => { percent === 100 ? '100%' : `${percent}%`} /> diff --git a/web/src/pages/dashboard/workplace/index.tsx b/web/src/pages/dashboard/workplace/index.tsx index ddac6bf..ee3a7e1 100644 --- a/web/src/pages/dashboard/workplace/index.tsx +++ b/web/src/pages/dashboard/workplace/index.tsx @@ -191,7 +191,8 @@ const Workplace: FC = () => { const { loading: lastexaminationLoading, data: examinationList } = useRequest( () => getExaminationList( { - person_id: cookie.load('person_id') + person_id: cookie.load('person_id'), + b_use:1 }), { formatResult: (result) => { return result.table_List; diff --git a/web/src/pages/registration/index.tsx b/web/src/pages/registration/index.tsx index 9f36fe7..0ab99cf 100644 --- a/web/src/pages/registration/index.tsx +++ b/web/src/pages/registration/index.tsx @@ -16,7 +16,7 @@ import ProCard from '@ant-design/pro-card'; import { Button, Col, message, Row } from 'antd'; import { PageContainer } from '@ant-design/pro-layout'; import ProDescriptions from '@ant-design/pro-descriptions'; -import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo } from './service'; +import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo,checkExaminationPersonID } from './service'; import cookie from 'react-cookies'; import styles from './index.less' @@ -85,12 +85,23 @@ export default () => { description: false, }} onFinish={async (values) => { - // console.log('values',values); - // console.log(formRef.current?.getFieldsValue()); - // await waitTime(2000); - setBaseInfo(values); - return true; - }} + try { + const info = await checkExaminationPersonID({ + examination_id:params.examination_id, + id_code:values.idCard + }); + setBaseInfo(values); + return true; + }catch (error) { + if(error.response){ + message.error(error.response.info); + }else { + message.error('填写失败,请重新填写!'); + } + return false; + } + + }} > @@ -126,14 +137,13 @@ export default () => { picker="month" fieldProps={{ format: 'YYYY-MM', - }} rules={[{ required: true, message: '请选择出生年月' }]} /> - + - + @@ -270,37 +280,37 @@ export default () => { // console.log(formRef.current?.getFieldsValue()); // 跳转到指定路由 try { - const success = await savePersonSignUpInfo({ - address:baseInfo?.address, - birthday:baseInfo?.birthday, - bureau_id:backInfo?.bureau_id, - bureau_name:backInfo?.bureau_name, - city_id:backInfo?.city_id, - city_name:backInfo?.city_name, - district_id:backInfo?.district_id, - district_name:backInfo?.district_name, - education:baseInfo?.qualifications, - examination_id:params.examination_id, - gender:baseInfo?.sex, - id_code:baseInfo?.idCard, - identity_id:backInfo?.identity_id, - major:baseInfo?.major, - person_id:backInfo?.person_id, - person_name:backInfo?.person_name, - province_id:backInfo?.province_id, - province_name:backInfo?.province_name, - subject:baseInfo?.subject, - tel:baseInfo?.contact, - university:baseInfo?.graduation, + const success = await savePersonSignUpInfo({ + address:baseInfo?.address, + birthday:baseInfo?.birthday, + bureau_id:backInfo?.bureau_id, + bureau_name:backInfo?.bureau_name, + city_id:backInfo?.city_id, + city_name:backInfo?.city_name, + district_id:backInfo?.district_id, + district_name:backInfo?.district_name, + education:baseInfo?.qualifications, + examination_id:params.examination_id, + gender:baseInfo?.sex, + id_code:baseInfo?.idCard, + identity_id:backInfo?.identity_id, + major:baseInfo?.major, + person_id:backInfo?.person_id, + person_name:backInfo?.person_name, + province_id:backInfo?.province_id, + province_name:backInfo?.province_name, + subject:baseInfo?.subject, + tel:baseInfo?.contact, + 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('报名失败'); - } + 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('报名失败'); + } } diff --git a/web/src/pages/registration/service.ts b/web/src/pages/registration/service.ts index 6fe6a79..18e13aa 100644 --- a/web/src/pages/registration/service.ts +++ b/web/src/pages/registration/service.ts @@ -50,3 +50,11 @@ export async function savePersonSignUpInfo(data: { [key: string]: any }, options ...(options || {}), }); } + +//身份证重复校验/dsideal_yy/zygh/training/person/checkExaminationPersonID +export async function checkExaminationPersonID(params: { +}) { + return request('/dsideal_yy/zygh/training/person/checkExaminationPersonID', { + params, + }); +}