Commit 3dbcd5f9 by sunchao

模糊查询优化

parent fdc27da4
...@@ -151,24 +151,11 @@ ...@@ -151,24 +151,11 @@
</div> </div>
<div class="contentItem"> <div class="contentItem">
<span>辅导人</span> <span>辅导人</span>
<!-- <select [(ngModel)]="employQuery.mentorPractitionerId" class="form-control" (ngModelChange)="getName(2,employQuery.mentorPractitionerId);getPractitionerDetails(employQuery.mentorPractitionerId)" <div (click)="vagueSearch(1)">{{defalutMentor}}</div>
[disabled]="approveStatus!=null">
<option value=null>请选择</option>
<option [value]='practitionerInfo.id' *ngFor="let practitionerInfo of practitionerList">
{{practitionerInfo.name}}
</option>
</select> -->
<div (click)="vagueSearch()">请选择辅导人</div>
</div> </div>
<div class="contentItem"> <div class="contentItem">
<span>介绍人</span> <span>介绍人</span>
<select [(ngModel)]="employQuery.introducerPractitionerId" class="form-control" (ngModelChange)="getName(3,employQuery.introducerPractitionerId);" <div (click)="vagueSearch(2)">{{defalutIntroducer}}</div>
[disabled]="approveStatus!=null">
<option value=null>请选择</option>
<option [value]='practitionerInfo.id' *ngFor="let practitionerInfo of practitionerList">
{{practitionerInfo.name}}
</option>
</select>
</div> </div>
<div class="contentItem"> <div class="contentItem">
<span>体系名</span> <span>体系名</span>
...@@ -222,16 +209,15 @@ ...@@ -222,16 +209,15 @@
</ul> </ul>
</div> </div>
<div class="toastWrapper toast" *ngIf="selectedId===4;"> <div class="toastWrapper toast" *ngIf="toastFlag" (click)="toastFlag = false;">
</div> </div>
<!--辅导人介绍人选择框--> <!--辅导人介绍人选择框-->
<div class="editContainer" style="background: #efeff4;padding: 0;" *ngIf="selectedId===4;"> <div class="editContainer" style="background: #efeff4;padding: 0;" *ngIf="toastFlag">
<SearchBar [placeholder]="'搜索你的增员'" [maxLength]="8" <SearchBar [placeholder]="'搜索你的增员'" [maxLength]="8"
(onChange)="change($event)" (onChange)="change($event)"
></SearchBar> ></SearchBar>
<ul class="practitioner_con"> <ul class="practitioner_con">
<li *ngFor="let practitionerItem of practitionerListShow"> <li *ngFor="let practitionerItem of practitionerListShow" (click)="getNameParam(this.totastType,practitionerItem)">
{{practitionerItem.name}} {{practitionerItem.name}}
</li> </li>
</ul> </ul>
......
...@@ -49,6 +49,10 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -49,6 +49,10 @@ export class RecruitingDetailComponent implements OnInit {
//-2已填完,null未填完,-1拒绝0通过 //-2已填完,null未填完,-1拒绝0通过
approveStatus:any; approveStatus:any;
practitionerListShow:Array<any>; practitionerListShow:Array<any>;
defalutMentor:string = '请选择辅导人';
defalutIntroducer:string = '请选择介绍人';
totastType:any;
toastFlag:boolean = false;
constructor( constructor(
private activateRoute: ActivatedRoute, private activateRoute: ActivatedRoute,
public lifeCommonService: LifeCommonService, public lifeCommonService: LifeCommonService,
...@@ -454,7 +458,7 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -454,7 +458,7 @@ export class RecruitingDetailComponent implements OnInit {
this.toastDialog = true; this.toastDialog = true;
this.toastInfo = { this.toastInfo = {
status: 1, status: 1,
msg: 'S2级别下,辅导人不可以为空!', msg: 'S2级别下,辅导人不可以为空!',
timeout: 3000, timeout: 3000,
align: 'center' align: 'center'
}; };
...@@ -539,6 +543,52 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -539,6 +543,52 @@ export class RecruitingDetailComponent implements OnInit {
} }
} }
/**
* 辅导人介绍人模糊查询
* 1.辅导人
* 2.介绍人
* @param e
*/
getNameParam(type,e){
switch (type) {
case 1:
this.employQuery.mentorPractitionerId = e.id;
if(e){
for (const mentorInfo of this.practitionerList) {
if (e.id == mentorInfo.id) {
this.employQuery.mentor = mentorInfo.name;
this.defalutMentor = mentorInfo.name;
}
}
}else{
this.employQuery.mentor =
this.employQuery.subsystemId =
this.employQuery.subsystem =
this.employQuery.subsystemOwnerId =
this.employQuery.subsystemOwner =
this.employQuery.branchId =
this.employQuery.branch = null;
}
this.getPractitionerDetails(this.employQuery.mentorPractitionerId);
this.toastFlag = false;
return;
case 2:
this.employQuery.introducerPractitionerId = e.id;
if(e){
for (const introducer of this.practitionerList) {
if (e.id == introducer.id) {
this.employQuery.introducer = introducer.name;
this.defalutIntroducer = introducer.name;
}
}
}else{
this.employQuery.introducer = null;
}
this.toastFlag = false;
return;
}
}
queryWholeInfo(){ queryWholeInfo(){
this.myService.queryWholeInfo({hiringBasicInfoId:this.hiringBasicInfoId}).subscribe((res)=>{ this.myService.queryWholeInfo({hiringBasicInfoId:this.hiringBasicInfoId}).subscribe((res)=>{
if(res['success']){ if(res['success']){
...@@ -547,6 +597,24 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -547,6 +597,24 @@ export class RecruitingDetailComponent implements OnInit {
this.employQuery.name = this.editRecruiting.name; this.employQuery.name = this.editRecruiting.name;
this.employQuery.practitionerPotentialId = this.potentialId; this.employQuery.practitionerPotentialId = this.potentialId;
this.approveStatus = res['data']['hiringBasicInfo']['approveStatus']; this.approveStatus = res['data']['hiringBasicInfo']['approveStatus'];
if(membership.mentor){
this.defalutMentor = membership.mentor;
}else{
if(this.approveStatus == null){
this.defalutMentor = '请选择辅导人';
}else{
this.defalutMentor = '/';
}
}
if(membership.introducer){
this.defalutIntroducer = membership.introducer;
}else{
if(this.approveStatus == null){
this.defalutIntroducer = '请选择介绍人';
}else{
this.defalutIntroducer = '/';
}
}
}else{ }else{
this.toastDialog = true; this.toastDialog = true;
this.toastInfo = { this.toastInfo = {
...@@ -565,11 +633,22 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -565,11 +633,22 @@ export class RecruitingDetailComponent implements OnInit {
* 介绍人:2 * 介绍人:2
* **/ * **/
vagueSearch(type){ vagueSearch(type){
if(this.approveStatus !=null){
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '被邀请人已填完所有信息,不能更改邀请内容!',
timeout: 3000,
align: 'center'
};
return;
}
this.totastType = type;
this.toastFlag = true;
this.practitionerListShow = this.practitionerList;
} }
change(event){ change(event){
console.log(event)
this.practitionerListShow = this.practitionerList.filter((item)=>{ this.practitionerListShow = this.practitionerList.filter((item)=>{
if(item.name){ if(item.name){
return item.name.indexOf(event) !==-1; return item.name.indexOf(event) !==-1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment