调整选择学校问题

develop
杨树明 5 years ago
parent 078c37cbda
commit a003c241e0

@ -137,7 +137,7 @@ class AccountBasic extends Component {
handleSubmit = () => { handleSubmit = () => {
this.props.form.validateFieldsAndScroll({ force: true }, (err, values) => { this.props.form.validateFieldsAndScroll({ force: true }, (err, values) => {
console.log(values);
let {basicInfo}=this.props; let {basicInfo}=this.props;
if(!err ){ if(!err ){
if (!this.state.school_id) { if (!this.state.school_id) {
@ -283,7 +283,7 @@ class AccountBasic extends Component {
getDepartments=(e,flag)=>{ getDepartments=(e,flag)=>{
let arr=this.state.schoolList.filter(function(item){ let arr=this.state.schoolList.filter(function(item){
if(item.name.indexOf(e) > -1){ if(item.name===e){
return item.name; return item.name;
} }
}); });

@ -8,10 +8,10 @@ class AccountBasicEditItem extends Component {
constructor(props){ constructor(props){
super(props); super(props);
} }
render(){ render(){
let { let {
professionalFlag , professionalFlag ,
getFieldDecorator , getFieldDecorator ,
identity , identity ,
filterSchoolList , filterSchoolList ,
@ -32,7 +32,7 @@ class AccountBasicEditItem extends Component {
{getFieldDecorator('job', { {getFieldDecorator('job', {
rules: [{ rules: [{
initialValue:"teacher", initialValue:"teacher",
required: true, required: true,
message: '请先选择职业', message: '请先选择职业',
}], }],
})( })(
@ -45,7 +45,7 @@ class AccountBasicEditItem extends Component {
</ConditionToolTip> </ConditionToolTip>
</Form.Item> </Form.Item>
{ {
identity && identity=="student" && identity && identity=="student" &&
<Form.Item <Form.Item
label="" label=""
className="formItemInline fl" className="formItemInline fl"
@ -55,7 +55,7 @@ class AccountBasicEditItem extends Component {
<ConditionToolTip title={() => (<div><p>已提交职业认证</p><p><a href="/account/certification" className="color-blue"></a></p></div>)} condition= { professionalFlag }> <ConditionToolTip title={() => (<div><p>已提交职业认证</p><p><a href="/account/certification" className="color-blue"></a></p></div>)} condition= { professionalFlag }>
{getFieldDecorator('student_No', { {getFieldDecorator('student_No', {
rules: [{ rules: [{
required: true, required: true,
message: '请先输入学号', message: '请先输入学号',
}], }],
})( })(
@ -65,7 +65,7 @@ class AccountBasicEditItem extends Component {
</Form.Item> </Form.Item>
} }
{ {
identity && identity=="teacher" && identity && identity=="teacher" &&
<Form.Item <Form.Item
label="" label=""
className="formItemInline fl" className="formItemInline fl"
@ -75,7 +75,7 @@ class AccountBasicEditItem extends Component {
{getFieldDecorator('job1', { {getFieldDecorator('job1', {
rules: [{ rules: [{
initialValue:"教授", initialValue:"教授",
required: true, required: true,
message: '请先选择职称', message: '请先选择职称',
}], }],
})( })(
@ -90,7 +90,7 @@ class AccountBasicEditItem extends Component {
</Form.Item> </Form.Item>
} }
{ {
identity && identity=="professional" && identity && identity=="professional" &&
<Form.Item <Form.Item
label="" label=""
className="formItemInline fl mb0" className="formItemInline fl mb0"
@ -100,7 +100,7 @@ class AccountBasicEditItem extends Component {
{getFieldDecorator('job2', { {getFieldDecorator('job2', {
rules: [{ rules: [{
initialValue:"企业管理者", initialValue:"企业管理者",
required: true, required: true,
message: '请先选择职称', message: '请先选择职称',
}], }],
})( })(
@ -125,7 +125,7 @@ class AccountBasicEditItem extends Component {
rules: [{ rules: [{
// initialValue: this.state.cityDefaultValue, // initialValue: this.state.cityDefaultValue,
// type: 'array', // type: 'array',
required: true, required: true,
message: '请先选择学校/单位', message: '请先选择学校/单位',
// 做不了输入时和submit时都会执行这里 // 做不了输入时和submit时都会执行这里
@ -136,20 +136,20 @@ class AccountBasicEditItem extends Component {
// } // }
// callback('请先选择学校/单位'); // callback('请先选择学校/单位');
// } // }
}], }],
})( })(
<AutoComplete width={400} showSearch onSearch={this.props.filterList} onChange={this.props.changeList} disabled={professionalFlag}> <AutoComplete width={400} showSearch onSearch={this.props.filterList} onChange={this.props.changeList} disabled={professionalFlag}>
{ {
filterSchoolList && filterSchoolList.map((item,key)=>{ filterSchoolList && filterSchoolList.map((item,key)=>{
return(<Option value={item.name} key={item.id}>{item.name}</Option>) return(<Option value={item.name} key={key} id={item.id}>{item.name}</Option>)
}) })
} }
</AutoComplete> </AutoComplete>
)} )}
</ConditionToolTip> </ConditionToolTip>
</Form.Item> </Form.Item>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school && {!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}> <div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span> <span>
@ -158,7 +158,7 @@ class AccountBasicEditItem extends Component {
</span> </span>
</div> </div>
} }
<Form.Item <Form.Item
label="院系/部门" label="院系/部门"
className="formItemInline mb0" className="formItemInline mb0"
@ -169,7 +169,7 @@ class AccountBasicEditItem extends Component {
rules: [{ rules: [{
// initialValue: this.state.cityDefaultValue, // initialValue: this.state.cityDefaultValue,
// type: 'array', // type: 'array',
required: true, required: true,
message: '请先选择院系/部门', message: '请先选择院系/部门',
// validator: (rule, value, callback) => { // validator: (rule, value, callback) => {
// if (this.this_department_id) { // if (this.this_department_id) {
@ -188,14 +188,14 @@ class AccountBasicEditItem extends Component {
) )
}) })
} }
</AutoComplete> </AutoComplete>
)} )}
</ConditionToolTip> </ConditionToolTip>
</Form.Item> </Form.Item>
{ {
filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 ) filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 )
|| (departmentsName == '' && ! department_id || (departmentsName == '' && ! department_id
&& (!departments || departments.length == 0) )) && && (!departments || departments.length == 0) )) &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}> <div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span> <span>
<span style={{color: '#CDCDCD'}}>{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}</span> <span style={{color: '#CDCDCD'}}>{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}</span>

Loading…
Cancel
Save