Commit d5c42d67 by sunchao

邀请人为S2级别时分公司可选,辅导人不可选

parent c3b21447
...@@ -556,4 +556,11 @@ export class MyService { ...@@ -556,4 +556,11 @@ export class MyService {
.post(url, JSON.stringify(param)); .post(url, JSON.stringify(param));
} }
// 查询分公司
organizationQuery(organizationInfo) {
const url = this.API + "/erp/organizationQuery";
return this.http
.post(url, JSON.stringify(organizationInfo));
}
} }
...@@ -137,13 +137,13 @@ ...@@ -137,13 +137,13 @@
<div class="contentDetail employ"> <div class="contentDetail employ">
<div class="contentItem"> <div class="contentItem">
<span>被邀请人</span> <span>被邀请人</span>
<input type="text" [(ngModel)]="this.employQuery.name" class="form-control" [disabled]="approveStatus!=null" /> <input type="text" [(ngModel)]="this.employQuery.name" class="form-control" [disabled]="approveStatus!=null && approveStatus!=-1" />
</div> </div>
<div class="contentItem"> <div class="contentItem">
<span>报聘职级</span> <span>报聘职级</span>
<select [(ngModel)]="employQuery.mdDropOptionId" class="form-control" (ngModelChange)="getName(1,employQuery.mdDropOptionId)" <select [(ngModel)]="employQuery.mdDropOptionId" class="form-control" (ngModelChange)="getName(1,employQuery.mdDropOptionId)"
[disabled]="approveStatus!=null"> [disabled]="approveStatus!=null && approveStatus!=-1">
<option value=null>请选择</option> <option [value]=null>请选择</option>
<option [value]='levelInfos.id' *ngFor="let levelInfos of practitionerLevelInfos"> <option [value]='levelInfos.id' *ngFor="let levelInfos of practitionerLevelInfos">
{{levelInfos.dropOptionCode}} {{levelInfos.dropOptionName}} {{levelInfos.dropOptionCode}} {{levelInfos.dropOptionName}}
</option> </option>
...@@ -151,11 +151,11 @@ ...@@ -151,11 +151,11 @@
</div> </div>
<div class="contentItem"> <div class="contentItem">
<span>辅导人</span> <span>辅导人</span>
<div (click)="vagueSearch(1)">{{defalutMentor}}</div> <div (click)="vagueSearch(1)" style="padding-right: 12px;">{{defalutMentor}}</div>
</div> </div>
<div class="contentItem"> <div class="contentItem">
<span>介绍人</span> <span>介绍人</span>
<div (click)="vagueSearch(2)">{{defalutIntroducer}}</div> <div (click)="vagueSearch(2)" style="padding-right: 12px;">{{defalutIntroducer}}</div>
</div> </div>
<div class="contentItem"> <div class="contentItem">
<span>体系名</span> <span>体系名</span>
...@@ -167,7 +167,16 @@ ...@@ -167,7 +167,16 @@
</div> </div>
<div class="contentItem"> <div class="contentItem">
<span>分公司</span> <span>分公司</span>
<div><input type="text" [(ngModel)]="employQuery.branch" class="form-control" disabled/></div> <div *ngIf="employQuery.mdDropOptionId != 30">
<input type="text" [(ngModel)]="employQuery.branch" class="form-control" disabled/>
</div>
<select class="form-control" *ngIf="employQuery.mdDropOptionId == 30" [(ngModel)]="employQuery.branchId" (ngModelChange)="getName(2,employQuery.branchId)"
[disabled]="approveStatus!=null && approveStatus!=-1" >
<option [value]=null>请选择</option>
<option [value]="branchItem.insurerBranchId" *ngFor="let branchItem of branchList">
{{branchItem.branchName}}
</option>
</select>
</div> </div>
</div> </div>
</div> </div>
...@@ -217,13 +226,13 @@ ...@@ -217,13 +226,13 @@
(onChange)="change($event)" (onChange)="change($event)"
></SearchBar> ></SearchBar>
<ul class="practitioner_con"> <ul class="practitioner_con">
<li (click)="getNameParam(this.totastType,null)"></li>
<li *ngFor="let practitionerItem of practitionerListShow" (click)="getNameParam(this.totastType,practitionerItem)"> <li *ngFor="let practitionerItem of practitionerListShow" (click)="getNameParam(this.totastType,practitionerItem)">
{{practitionerItem.name}} {{practitionerItem.name}}
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast> <ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
\ No newline at end of file <ydlife-alert *ngIf="isNeedAlert" [dialogInfo]="dialogInfo" (popInfo)="getPopInfo()"></ydlife-alert>
\ No newline at end of file
...@@ -129,6 +129,9 @@ ...@@ -129,6 +129,9 @@
padding: 10px 0; padding: 10px 0;
border-bottom: 1px #e8e8e8 solid; border-bottom: 1px #e8e8e8 solid;
margin: 0 8px 0 8px; margin: 0 8px 0 8px;
.form-control{
margin: 0;
}
} }
.tagWrapper { .tagWrapper {
display: flex; display: flex;
......
...@@ -53,6 +53,9 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -53,6 +53,9 @@ export class RecruitingDetailComponent implements OnInit {
defalutIntroducer:string = '请选择介绍人'; defalutIntroducer:string = '请选择介绍人';
totastType:any; totastType:any;
toastFlag:boolean = false; toastFlag:boolean = false;
isNeedAlert: boolean;
dialogInfo: any;
branchList:Array<any>;
constructor( constructor(
private activateRoute: ActivatedRoute, private activateRoute: ActivatedRoute,
public lifeCommonService: LifeCommonService, public lifeCommonService: LifeCommonService,
...@@ -74,9 +77,9 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -74,9 +77,9 @@ export class RecruitingDetailComponent implements OnInit {
//状态 //状态
this.status = this.activateRoute.snapshot.queryParams['status']; this.status = this.activateRoute.snapshot.queryParams['status'];
this.hiringBasicInfoId = this.activateRoute.snapshot.queryParams['hiringBasicInfoId']?this.activateRoute.snapshot.queryParams['hiringBasicInfoId']:null; this.hiringBasicInfoId = this.activateRoute.snapshot.queryParams['hiringBasicInfoId']?this.activateRoute.snapshot.queryParams['hiringBasicInfoId']:null;
this.dropOptionsQuery(1); this.dropOptionsQuery(1);
this.educationLevelQuery(); this.educationLevelQuery();
this.organizationQuery();
if (this.potentialId === 0) { if (this.potentialId === 0) {
this.readonlyFlag = false; this.readonlyFlag = false;
this.sexFlag = true; this.sexFlag = true;
...@@ -92,10 +95,23 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -92,10 +95,23 @@ export class RecruitingDetailComponent implements OnInit {
} }
//获取基本信息 //获取基本信息
this.recruitListQuery(); this.recruitListQuery();
if(this.hiringBasicInfoId){
this.queryWholeInfo();
}
} }
selectTab(id) { selectTab(id) {
if (this.clickFlag == true) { if (this.clickFlag == true) {
if(id === 4){
console.log(this.approveStatus)
if(this.approveStatus == -2 || this.approveStatus == 0){
this.openPopInfo(`${this.employQuery.name}已经提交所有报聘信息,不用重复邀请!`)
return;
}
}
this.selectedId = id; this.selectedId = id;
if (this.selectedId === 3) { if (this.selectedId === 3) {
//初始化 //初始化
...@@ -455,16 +471,16 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -455,16 +471,16 @@ export class RecruitingDetailComponent implements OnInit {
saveMembership(){ saveMembership(){
if(this.employQuery.mdDropOptionId != 30){ if(this.employQuery.mdDropOptionId != 30){
if(!this.employQuery.mentorPractitionerId || !this.employQuery.mentor){ if(!this.employQuery.mentorPractitionerId || !this.employQuery.mentor){
this.toastDialog = true; this.openPopInfo('S2级别以下,辅导人不可以为空!')
this.toastInfo = { return;
status: 1, }
msg: 'S2级别以下,辅导人不可以为空!', }else{
timeout: 3000, if(this.employQuery.mentorPractitionerId || this.employQuery.mentor){
align: 'center' this.openPopInfo('S2级别不需要选择辅导人!')
};
return; return;
} }
} }
this.employQuery = { this.employQuery = {
...this.employQuery, ...this.employQuery,
hiringBasicInfoId:this.approveStatus=='-1'?null:this.hiringBasicInfoId, hiringBasicInfoId:this.approveStatus=='-1'?null:this.hiringBasicInfoId,
...@@ -477,7 +493,7 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -477,7 +493,7 @@ export class RecruitingDetailComponent implements OnInit {
}else{ }else{
alert(res['message']); alert(res['message']);
} }
}) });
} }
invite(){ invite(){
...@@ -489,8 +505,7 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -489,8 +505,7 @@ export class RecruitingDetailComponent implements OnInit {
* @param e * @param e
* @param type * @param type
* 1.职级 * 1.职级
* 2.辅导人 * 2.分公司
* 3.介绍人
*/ */
getName(type,e){ getName(type,e){
if(e == 'null'){ if(e == 'null'){
...@@ -505,41 +520,35 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -505,41 +520,35 @@ export class RecruitingDetailComponent implements OnInit {
this.employQuery.mdDropOptionName = level.dropOptionName; this.employQuery.mdDropOptionName = level.dropOptionName;
} }
} }
//如果报聘职级是s2,清空辅导人、体系、体系负责人
if(e == 30){
this.employQuery.mentorPractitionerId =
this.employQuery.mentor =
this.employQuery.subsystemId =
this.employQuery.subsystem =
this.employQuery.subsystemOwnerId =
this.employQuery.subsystemOwner =
this.employQuery.branchId =
this.employQuery.branch = null;
this.defalutMentor = '/';
}
}else{ }else{
this.employQuery.mdDropOptionName = null; this.employQuery.mdDropOptionName = null;
} }
return; return;
// case 2: case 2:
// this.employQuery.mentorPractitionerId = e; this.employQuery.branchId = e;
// if(e){ if(e){
// for (const mentorInfo of this.practitionerList) { for(const branchItem of this.branchList){
// if (e == mentorInfo.id) { if(e == branchItem.insurerBranchId){
// this.employQuery.mentor = mentorInfo.name; this.employQuery.branch = branchItem.branchName;
// } }
// } }
// }else{ }else{
// this.employQuery.mentor = this.employQuery.branchId =
// this.employQuery.subsystemId = this.employQuery.branch = null;
// this.employQuery.subsystem = }
// this.employQuery.subsystemOwnerId = return;
// this.employQuery.subsystemOwner =
// this.employQuery.branchId =
// this.employQuery.branch = null;
// }
// return;
// case 3:
// this.employQuery.introducerPractitionerId = e;
// if(e){
// for (const introducer of this.practitionerList) {
// if (e == introducer.id) {
// this.employQuery.introducer = introducer.name;
// }
// }
// }else{
// this.employQuery.introducer = null;
// }
// return;
} }
} }
...@@ -552,15 +561,17 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -552,15 +561,17 @@ export class RecruitingDetailComponent implements OnInit {
getNameParam(type,e){ getNameParam(type,e){
switch (type) { switch (type) {
case 1: case 1:
this.employQuery.mentorPractitionerId = e.id;
if(e){ if(e){
this.employQuery.mentorPractitionerId = e.id;
for (const mentorInfo of this.practitionerList) { for (const mentorInfo of this.practitionerList) {
if (e.id == mentorInfo.id) { if (e.id == mentorInfo.id) {
this.employQuery.mentor = mentorInfo.name; this.employQuery.mentor = mentorInfo.name;
this.defalutMentor = mentorInfo.name; this.defalutMentor = mentorInfo.name;
} }
} }
this.getPractitionerDetails(this.employQuery.mentorPractitionerId);
}else{ }else{
this.employQuery.mentorPractitionerId =
this.employQuery.mentor = this.employQuery.mentor =
this.employQuery.subsystemId = this.employQuery.subsystemId =
this.employQuery.subsystem = this.employQuery.subsystem =
...@@ -568,13 +579,13 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -568,13 +579,13 @@ export class RecruitingDetailComponent implements OnInit {
this.employQuery.subsystemOwner = this.employQuery.subsystemOwner =
this.employQuery.branchId = this.employQuery.branchId =
this.employQuery.branch = null; this.employQuery.branch = null;
this.defalutMentor = '/';
} }
this.getPractitionerDetails(this.employQuery.mentorPractitionerId);
this.toastFlag = false; this.toastFlag = false;
return; return;
case 2: case 2:
this.employQuery.introducerPractitionerId = e.id;
if(e){ if(e){
this.employQuery.introducerPractitionerId = e.id;
for (const introducer of this.practitionerList) { for (const introducer of this.practitionerList) {
if (e.id == introducer.id) { if (e.id == introducer.id) {
this.employQuery.introducer = introducer.name; this.employQuery.introducer = introducer.name;
...@@ -583,6 +594,7 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -583,6 +594,7 @@ export class RecruitingDetailComponent implements OnInit {
} }
}else{ }else{
this.employQuery.introducer = null; this.employQuery.introducer = null;
this.defalutIntroducer = '/';
} }
this.toastFlag = false; this.toastFlag = false;
return; return;
...@@ -633,17 +645,11 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -633,17 +645,11 @@ 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.totastType = type;
if(type ==1 && this.employQuery.mdDropOptionId == 30){
this.openPopInfo('S2级别不需要选择辅导人!')
return;
}
this.toastFlag = true; this.toastFlag = true;
this.practitionerListShow = this.practitionerList; this.practitionerListShow = this.practitionerList;
} }
...@@ -655,4 +661,28 @@ export class RecruitingDetailComponent implements OnInit { ...@@ -655,4 +661,28 @@ export class RecruitingDetailComponent implements OnInit {
} }
}) })
} }
// 打开弹窗
openPopInfo(message) {
this.isNeedAlert = true;
this.dialogInfo = {
title: null,
content: { value: message, align: 'center' },
footer: [{ value: '我知道了', routerLink: '', className: 'weui-dialog__btn_primary' }],
};
}
// 关闭弹窗
getPopInfo() {
this.isNeedAlert = false;
}
organizationQuery(){
this.myService.organizationQuery({insurerId: 888}).subscribe((res)=>{
console.log(res)
if(res['success']){
this.branchList = res['data']['insurerInfoList'][0]['insurerBranchInfoList'];
}
})
}
} }
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