Commit d5c42d67 by sunchao

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

parent c3b21447
......@@ -556,4 +556,11 @@ export class MyService {
.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 @@
<div class="contentDetail employ">
<div class="contentItem">
<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 class="contentItem">
<span>报聘职级</span>
<select [(ngModel)]="employQuery.mdDropOptionId" class="form-control" (ngModelChange)="getName(1,employQuery.mdDropOptionId)"
[disabled]="approveStatus!=null">
<option value=null>请选择</option>
[disabled]="approveStatus!=null && approveStatus!=-1">
<option [value]=null>请选择</option>
<option [value]='levelInfos.id' *ngFor="let levelInfos of practitionerLevelInfos">
{{levelInfos.dropOptionCode}} {{levelInfos.dropOptionName}}
</option>
......@@ -151,11 +151,11 @@
</div>
<div class="contentItem">
<span>辅导人</span>
<div (click)="vagueSearch(1)">{{defalutMentor}}</div>
<div (click)="vagueSearch(1)" style="padding-right: 12px;">{{defalutMentor}}</div>
</div>
<div class="contentItem">
<span>介绍人</span>
<div (click)="vagueSearch(2)">{{defalutIntroducer}}</div>
<div (click)="vagueSearch(2)" style="padding-right: 12px;">{{defalutIntroducer}}</div>
</div>
<div class="contentItem">
<span>体系名</span>
......@@ -167,7 +167,16 @@
</div>
<div class="contentItem">
<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>
......@@ -217,13 +226,13 @@
(onChange)="change($event)"
></SearchBar>
<ul class="practitioner_con">
<li (click)="getNameParam(this.totastType,null)"></li>
<li *ngFor="let practitionerItem of practitionerListShow" (click)="getNameParam(this.totastType,practitionerItem)">
{{practitionerItem.name}}
</li>
</ul>
</div>
</div>
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
\ No newline at end of file
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
<ydlife-alert *ngIf="isNeedAlert" [dialogInfo]="dialogInfo" (popInfo)="getPopInfo()"></ydlife-alert>
\ No newline at end of file
......@@ -129,6 +129,9 @@
padding: 10px 0;
border-bottom: 1px #e8e8e8 solid;
margin: 0 8px 0 8px;
.form-control{
margin: 0;
}
}
.tagWrapper {
display: flex;
......
......@@ -53,6 +53,9 @@ export class RecruitingDetailComponent implements OnInit {
defalutIntroducer:string = '请选择介绍人';
totastType:any;
toastFlag:boolean = false;
isNeedAlert: boolean;
dialogInfo: any;
branchList:Array<any>;
constructor(
private activateRoute: ActivatedRoute,
public lifeCommonService: LifeCommonService,
......@@ -74,9 +77,9 @@ export class RecruitingDetailComponent implements OnInit {
//状态
this.status = this.activateRoute.snapshot.queryParams['status'];
this.hiringBasicInfoId = this.activateRoute.snapshot.queryParams['hiringBasicInfoId']?this.activateRoute.snapshot.queryParams['hiringBasicInfoId']:null;
this.dropOptionsQuery(1);
this.educationLevelQuery();
this.organizationQuery();
if (this.potentialId === 0) {
this.readonlyFlag = false;
this.sexFlag = true;
......@@ -92,10 +95,23 @@ export class RecruitingDetailComponent implements OnInit {
}
//获取基本信息
this.recruitListQuery();
if(this.hiringBasicInfoId){
this.queryWholeInfo();
}
}
selectTab(id) {
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;
if (this.selectedId === 3) {
//初始化
......@@ -455,16 +471,16 @@ export class RecruitingDetailComponent implements OnInit {
saveMembership(){
if(this.employQuery.mdDropOptionId != 30){
if(!this.employQuery.mentorPractitionerId || !this.employQuery.mentor){
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: 'S2级别以下,辅导人不可以为空!',
timeout: 3000,
align: 'center'
};
this.openPopInfo('S2级别以下,辅导人不可以为空!')
return;
}
}else{
if(this.employQuery.mentorPractitionerId || this.employQuery.mentor){
this.openPopInfo('S2级别不需要选择辅导人!')
return;
}
}
this.employQuery = {
...this.employQuery,
hiringBasicInfoId:this.approveStatus=='-1'?null:this.hiringBasicInfoId,
......@@ -477,7 +493,7 @@ export class RecruitingDetailComponent implements OnInit {
}else{
alert(res['message']);
}
})
});
}
invite(){
......@@ -489,8 +505,7 @@ export class RecruitingDetailComponent implements OnInit {
* @param e
* @param type
* 1.职级
* 2.辅导人
* 3.介绍人
* 2.分公司
*/
getName(type,e){
if(e == 'null'){
......@@ -505,41 +520,35 @@ export class RecruitingDetailComponent implements OnInit {
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{
this.employQuery.mdDropOptionName = null;
}
return;
// case 2:
// this.employQuery.mentorPractitionerId = e;
// if(e){
// for (const mentorInfo of this.practitionerList) {
// if (e == mentorInfo.id) {
// this.employQuery.mentor = 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;
// }
// 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;
case 2:
this.employQuery.branchId = e;
if(e){
for(const branchItem of this.branchList){
if(e == branchItem.insurerBranchId){
this.employQuery.branch = branchItem.branchName;
}
}
}else{
this.employQuery.branchId =
this.employQuery.branch = null;
}
return;
}
}
......@@ -552,15 +561,17 @@ export class RecruitingDetailComponent implements OnInit {
getNameParam(type,e){
switch (type) {
case 1:
this.employQuery.mentorPractitionerId = e.id;
if(e){
this.employQuery.mentorPractitionerId = e.id;
for (const mentorInfo of this.practitionerList) {
if (e.id == mentorInfo.id) {
this.employQuery.mentor = mentorInfo.name;
this.defalutMentor = mentorInfo.name;
}
}
this.getPractitionerDetails(this.employQuery.mentorPractitionerId);
}else{
this.employQuery.mentorPractitionerId =
this.employQuery.mentor =
this.employQuery.subsystemId =
this.employQuery.subsystem =
......@@ -568,13 +579,13 @@ export class RecruitingDetailComponent implements OnInit {
this.employQuery.subsystemOwner =
this.employQuery.branchId =
this.employQuery.branch = null;
this.defalutMentor = '/';
}
this.getPractitionerDetails(this.employQuery.mentorPractitionerId);
this.toastFlag = false;
return;
case 2:
this.employQuery.introducerPractitionerId = e.id;
if(e){
this.employQuery.introducerPractitionerId = e.id;
for (const introducer of this.practitionerList) {
if (e.id == introducer.id) {
this.employQuery.introducer = introducer.name;
......@@ -583,6 +594,7 @@ export class RecruitingDetailComponent implements OnInit {
}
}else{
this.employQuery.introducer = null;
this.defalutIntroducer = '/';
}
this.toastFlag = false;
return;
......@@ -633,17 +645,11 @@ export class RecruitingDetailComponent implements OnInit {
* 介绍人:2
* **/
vagueSearch(type){
if(this.approveStatus !=null){
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '被邀请人已填完所有信息,不能更改邀请内容!',
timeout: 3000,
align: 'center'
};
return;
}
this.totastType = type;
if(type ==1 && this.employQuery.mdDropOptionId == 30){
this.openPopInfo('S2级别不需要选择辅导人!')
return;
}
this.toastFlag = true;
this.practitionerListShow = this.practitionerList;
}
......@@ -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