解决岗位管理biug

This commit is contained in:
red-deng-deng 2021-11-24 13:33:25 +08:00
parent 32b755ef33
commit efe0d7a950
1 changed files with 29 additions and 5 deletions

View File

@ -43,11 +43,14 @@ export default class station extends React.Component{
if(placeholder=='公司'){
this.setState({'companyBtn':true,companyName:1});
this.getCompanyFn();
this.getDepartmentFn(this.state.company_id);
this.getDepartmentFn(this.state.companyName);
}else if(placeholder=='部门'){
this.setState({'departmentBtn':true});
this.getDepartmentFn(this.state.company_id);
this.getDepartmentFn(this.state.companyName);
if(this.state.departmentName){
this.getDepartmentJobFn(this.state.departmentName);
}
}else if(placeholder=='岗位'){
this.setState({'postBtn':true});
@ -127,6 +130,11 @@ export default class station extends React.Component{
});
}else if(placeholder=='部门'){
if(!this.state.companyName){
Notify.clear()
Notify.error('请选择归属公司');
return false;
}
let dinfo={
department_name:iptval,
company_id:this.state.companyName
@ -145,6 +153,11 @@ export default class station extends React.Component{
}).catch(err=>{
});
}else if(placeholder=='岗位'){
if(!this.state.departmentName){
Notify.clear()
Notify.error('请选择归属部门');
return false;
}
let pinfo={
job_name:iptval,
department_id:this.state.departmentName
@ -474,14 +487,25 @@ export default class station extends React.Component{
this.setState({departmentData:[]});
this.setState({post:[]});
this.setState({companyName:null});
}else if(disbtn=='departmentBtn'){
flag=this.state.departmentBtn;
place="部门"
this.setState({post:[]});
this.setState({departmentName:null});
if(!this.state.companyName){
Notify.clear();
Notify.warn('请先补全公司信息!');
return;
}
}else if(disbtn=='postBtn'){
flag=this.state.postBtn;
place="岗位"
if(!this.state.departmentName){
Notify.clear();
Notify.warn('请先补全归属部门信息!');
return;
}
}
if(flag){
if( place=="岗位"&&this.state.departmentData.length<1){
@ -495,7 +519,7 @@ export default class station extends React.Component{
let addipt=document.createElement('div');
addipt.className=disbtn+" newitem";
addipt.innerHTML=`
<input maxLength="20" placeholder=请输入新增${place} onKeydown={window["mystation"].sureFn(event,this,'${place}')} />
<input maxLength="20"placeholder=请输入新增${place} onKeydown={window["mystation"].sureFn(event,this,'${place}')} />
<p><span class="del" onClick={window["mystation"].saveFn(this,'${place}')}>取消</span><span class="operation" onClick={window["mystation"].editFn(this,'${place}')}></span></p>
`;
nextDom.appendChild(addipt);
@ -578,7 +602,7 @@ export default class station extends React.Component{
}
</div>
)
}):<div className="nullempty">暂无数据请添加吧</div>
}):(this.state.departmentName?<div className="nullempty">暂无数据请添加吧</div>:null)
}
</div>
</div>