认证上传附件

issues25489
caishi 6 years ago
parent 533539c729
commit f56d073415

@ -44,6 +44,7 @@ class RealNameCertificationModal extends Component{
this.state={ this.state={
identity:"teacher", identity:"teacher",
departmentsName:undefined, departmentsName:undefined,
fileID:undefined,
filterSchoolList:undefined, filterSchoolList:undefined,
filterDepartments :undefined, filterDepartments :undefined,
school:undefined, school:undefined,
@ -269,7 +270,8 @@ class RealNameCertificationModal extends Component{
axios.post((url),{ axios.post((url),{
name:values.name || basicInfo.name, name:values.name || basicInfo.name,
gender:parseInt(values.sex), gender:parseInt(values.sex),
id_number:values.credentials id_number:values.credentials,
attachment_ids:[this.state.fileID]
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
this.props.showNotification("申请已提交,请等待审核!"); this.props.showNotification("申请已提交,请等待审核!");
@ -295,7 +297,8 @@ class RealNameCertificationModal extends Component{
school_id:this.state.school_id, school_id:this.state.school_id,
department_id:this.state.department_id, department_id:this.state.department_id,
identity:this.state.identity, identity:this.state.identity,
extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2 extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2,
attachment_ids:[this.state.fileID]
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
this.props.showNotification("申请已提交,请等待审核!"); this.props.showNotification("申请已提交,请等待审核!");
@ -328,19 +331,6 @@ class RealNameCertificationModal extends Component{
this.onSendOk() this.onSendOk()
} }
handleChange = (info) => {
if (info.file.status === 'uploading') {
this.setState({ loading: true });
return;
}
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => this.setState({
imageUrl,
loading: false,
}));
}
}
handleChange2 = (info) => { handleChange2 = (info) => {
if (info.file.status === 'uploading') { if (info.file.status === 'uploading') {
this.setState({ loading: true }); this.setState({ loading: true });
@ -348,9 +338,11 @@ class RealNameCertificationModal extends Component{
} }
if (info.file.status === 'done') { if (info.file.status === 'done') {
// Get this url from response in real world. // Get this url from response in real world.
console.log(info.file.response);
getBase64(info.file.originFileObj, imageUrl2 => this.setState({ getBase64(info.file.originFileObj, imageUrl2 => this.setState({
imageUrl2, imageUrl2,
loading: false, loading: false,
fileID:info.file.response && info.file.response.id
})); }));
} }
} }

Loading…
Cancel
Save