Commit f438abb8 by Chao Sun

增员增加修改&商机新增字段&排查pc微信一直刷新的问题

parent 2903365a
......@@ -68,27 +68,30 @@ export class AppComponent implements OnInit, OnDestroy {
if (res['data']['currentVersion']) {
this.currentVersion = res['data']['currentVersion'];
}
//如果本地没有版本号刷新并设置缓存
if (!localStorage.getItem('Version')) {
this.isNeedAlert = true;
this.dialogInfo = {
title: null,
content: { value: '检测到新版本', align: 'center' },
footer: [{ value: '更新', routerLink: '', className: 'weui-dialog__btn_primary' }],
};
} else {
const Version = localStorage.getItem('Version');
//如果缓存有版本号对比本地和接口版本
if (Version != this.currentVersion) {
//只在微信端判断缓存
if (this.lifeCommonService.checkDeviceType() === '3') {
//如果本地没有版本号刷新并设置缓存
if (!localStorage.getItem('Version')) {
this.isNeedAlert = true;
this.dialogInfo = {
title: null,
content: { value: '检测到新版本', align: 'center' },
footer: [{ value: '更新', routerLink: '', className: 'weui-dialog__btn_primary' }],
};
} else {
const Version = localStorage.getItem('Version');
//如果缓存有版本号对比本地和接口版本
if (Version != this.currentVersion) {
this.isNeedAlert = true;
this.dialogInfo = {
title: null,
content: { value: '检测到新版本', align: 'center' },
footer: [{ value: '更新', routerLink: '', className: 'weui-dialog__btn_primary' }],
};
}
}
}
})
}
}
......@@ -61,6 +61,7 @@ export class LifeCommonService {
checkDeviceType() {
let deviceType = null;
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
deviceType = '3';
} else {
......@@ -170,4 +171,10 @@ export class LifeCommonService {
return MOBILE_REGEXP.test(no);
}
getFileName(str) {
let strArr = str.split('?');
let k = strArr[0], appU = k.split('/');
let L = appU[appU.length - 1];
return L;
}
}
export class BusinessQuery {
constructor(public opportunityId?: string,
constructor(public opportunityId?: any,
public age?: string,
public name?: string,
public gender?: any,
......@@ -19,7 +19,10 @@ export class BusinessQuery {
public pieces?: any,
public remark?: any,
public assignedPractitionerId?: any,
public timeToClose?: any) {
public sourceFrom?: any,
public timeToClose?: any,
public leadsAssignedId?: any
) {
}
......
......@@ -6,17 +6,15 @@ export class RecruitingQuery {
public mobileNo?: string,
public wechatId?: string,
public qqId?: string,
public otherContacts?: string,
public othersContacts?: string,
public educationLevel?: string,
public resourceDropMasterId?: string,
public introducer?: string,
public tag?: string,
public remark?: string,
public ossPathResume?: string,
public assignedId?: string,
public operateUserId?: string,
public potentialId?: string,
public practitionerId?: any
public potentialId?: any,
public practitionerId?: any,
public createdAt?: any
) {
}
}
\ No newline at end of file
......@@ -89,34 +89,36 @@
<div class="wrapper_item">
<div class="contentItem">
<span>预计FYP</span>
<input class="form-control" type="text" placeholder="{{readonlyFlag ?'暂无预计FYP':'请输入预计FYP'}}"
<input class="form-control" type="number" placeholder="{{readonlyFlag ?'暂无预计FYP':'请输入预计FYP'}}"
[disabled]="readonlyFlag" [(ngModel)]="editBusiness.fyp" />
</div>
<div class="contentItem">
<span>预计FYC</span>
<input class="form-control" type="text" placeholder="{{readonlyFlag ?'暂无预计FYC':'请输入预计FYP'}}"
<input class="form-control" type="number" placeholder="{{readonlyFlag ?'暂无预计FYC':'请输入预计FYC'}}"
[disabled]="readonlyFlag" [(ngModel)]="editBusiness.fyc" />
</div>
<div class="contentItem">
<span>预计成交件数</span>
<input class="form-control" type="text" placeholder="{{readonlyFlag ?'暂无预计件数':'请输入预计件数'}}"
<input class="form-control" type="number" placeholder="{{readonlyFlag ?'暂无预计件数':'请输入预计件数'}}"
[disabled]="readonlyFlag" [(ngModel)]="editBusiness.pieces" />
</div>
<div class="contentItem">
<span>预计成交时间</span>
<input class="form-control" type="text" placeholder="{{readonlyFlag ?'暂无预计成交时间':'请输入预计成交时间'}}"
<input class="form-control" type="date" placeholder="{{readonlyFlag ?'暂无预计成交时间':'请输入预计成交时间'}}"
[disabled]="readonlyFlag" [(ngModel)]="editBusiness.timeToClose" />
</div>
</div>
<div class="wrapper_item">
<div class="contentItem">
<span>商机来源</span>
<select name="businessSourceId" id="businessSourceId" class="form-control" [disabled]="readonlyFlag">
<select *ngIf="opportunityId==0" name="businessSourceId" id="businessSourceId" class="form-control"
[(ngModel)]="editBusiness.sourceFrom" [disabled]="readonlyFlag">
<option value="">{{readonlyFlag ?'暂无商机来源':'请选择商机来源'}}</option>
<option *ngFor="let businessSourceItem of businessSourceList" value="businessSourceItem.id">
<option *ngFor="let businessSourceItem of businessSourceList" [value]="businessSourceItem.id">
{{businessSourceItem.dropOptionName}}</option>
</select>
<!--<input class="form-control" type="text" [(ngModel)]="editBusiness.sourceChannel" disabled />-->
<input *ngIf="opportunityId!=0" class="form-control" type="text" [(ngModel)]="editBusiness.sourceChannel"
disabled placeholder="{{editBusiness.sourceChannel ?editBusiness.sourceChannel:'暂无商机来源'}}" />
</div>
<div class="contentItem">
<span>商机时间</span>
......
......@@ -43,7 +43,7 @@
color: #fff;
background: #0767bf;
text-align: center;
bottom: 0;
bottom: 50px;
left: 42%;
}
.contentDetail {
......
......@@ -57,7 +57,7 @@ export class MyBusinessDetailComponent implements OnInit {
maleFlag: boolean;
isShow: boolean;
//线索id
leadsAssignedId: string;
leadsAssignedId: any;
//控制tab可不可点
clickFlag: boolean;
......@@ -95,7 +95,7 @@ export class MyBusinessDetailComponent implements OnInit {
this.femaleFlag = true;
this.clickFlag = false;
//初始化新增
this.editBusiness = new BusinessQuery("", "", "", 1, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
this.editBusiness = new BusinessQuery("", "", "", 1, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", null);
this.selectTab(1);
} else {
this.clickFlag = true;
......@@ -131,8 +131,8 @@ export class MyBusinessDetailComponent implements OnInit {
ownOpportunityDetailQuery() {
const detailParam = {
opportunityId: this.opportunityId,
orderId: this.orderId,
opportunityId: this.opportunityId ? Number(this.opportunityId) : null,
orderId: this.orderId ? Number(this.orderId) : null,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
}
this.myService.ownOpportunityDetailQuery(detailParam).subscribe((res) => {
......@@ -155,6 +155,15 @@ export class MyBusinessDetailComponent implements OnInit {
this.maleFlag = false;
}
}
if (!this.editBusiness.bloodTypeId) {
this.editBusiness.bloodTypeId = '';
}
if (!this.editBusiness.zodiacTypeId) {
this.editBusiness.zodiacTypeId = '';
}
if (!this.editBusiness.sourceFrom) {
this.editBusiness.sourceFrom = '';
}
if (this.opportunityCustomerTags.length > 0) {
for (let i = 0; i < this.opportunityCustomerTags.length; i++) {
for (let j = 0; j < this.tagList.length; j++) {
......@@ -275,7 +284,7 @@ export class MyBusinessDetailComponent implements OnInit {
}
const OVERZERO_REG = /^[0-9]*[1-9][0-9]*$/;
if (this.editBusiness.age) {
if (!OVERZERO_REG.test(this.editBusiness.age)) {
if (OVERZERO_REG.test(this.editBusiness.age)) {
if (parseInt(this.editBusiness.age) > 100) {
this.toastDialog = true;
this.toastInfo = {
......@@ -285,29 +294,114 @@ export class MyBusinessDetailComponent implements OnInit {
align: 'center'
};
return;
} else {
}
} else {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '年龄只能输入正整数!',
timeout: 3000,
align: 'center'
};
return;
}
}
if (this.editBusiness.fyp) {
const fypArr = this.editBusiness.fyp.toString().split('.');
if (fypArr.length - 1 == 1) {
if (fypArr[0].length > 10) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '预计fyp只能输入最多10位整数!',
timeout: 3000,
align: 'center'
};
return;
}
if (fypArr[1].length > 3) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '预计fyp只能输入最多2位小数!',
timeout: 3000,
align: 'center'
};
return;
}
} else if (fypArr.length - 1 > 1) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: 'fyp不能输入多个小数点!',
timeout: 3000,
align: 'center'
};
return;
}
}
if (this.editBusiness.fyc) {
const fycArr = this.editBusiness.fyc.toString().split('.');
if (fycArr.length - 1 == 1) {
if (fycArr[0].length > 10) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '年龄只能输入正整数!',
msg: '预计fyc只能输入最多10位整数!',
timeout: 3000,
align: 'center'
};
return;
}
if (fycArr[1].length > 3) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '预计fyc只能输入最多2位小数!',
timeout: 3000,
align: 'center'
};
return;
}
} else if (fycArr.length - 1 > 1) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: 'fyc不能输入多个小数点!',
timeout: 3000,
align: 'center'
};
return;
}
}
if (this.editBusiness.pieces) {
if (!OVERZERO_REG.test(this.editBusiness.pieces)) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '预计件数只能输入正整数!',
timeout: 3000,
align: 'center'
};
return;
}
}
this.editBusiness = {
...this.editBusiness,
leadsAssignedId: this.leadsAssignedId ? Number(this.leadsAssignedId) : null,
opportunityId: this.opportunityId ? Number(this.opportunityId) : null,
opportunityCustomerTags: newTag ? newTag : [],
assignedPractitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo')).practitionerId
assignedPractitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo')).practitionerId,
fyp: this.editBusiness.fyp ? Number(this.editBusiness.fyp) : null,
fyc: this.editBusiness.fyc ? Number(this.editBusiness.fyc) : null,
sourceFrom: this.editBusiness.sourceFrom ? Number(this.editBusiness.sourceFrom) : null
}
this.myService.ownOpportunityBasicInformationSave(this.editBusiness).subscribe((res) => {
if (res['success']) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '修改成功!',
msg: Number(this.opportunityId) == 0 ? '新增成功!' : '修改成功!',
timeout: 3000,
align: 'center'
};
......@@ -329,14 +423,15 @@ export class MyBusinessDetailComponent implements OnInit {
if (res['data']['opportunityId'] && res['data']['leadsAssignedId']) {
this.opportunityId = res['data']['opportunityId'];
this.leadsAssignedId = res['data']['leadsAssignedId'];
this.router.navigate([`/business${this.opportunityId}`], { queryParams: { leadsAssignedId: this.leadsAssignedId } });
this.router.navigate([`/business/${this.opportunityId}`], { queryParams: { leadsAssignedId: this.leadsAssignedId }, replaceUrl: true });
this.clickFlag = true;
}
}
this.ownOpportunityDetailQuery();
}
})
}
ownOpportunityRecordSave() {
const oppDate = new Date(this.opportunityRecordNoticeDate + ' 23:59:59').getTime();
const createDate = new Date(this.editBusiness.opportunityDate).getTime();
......@@ -396,10 +491,10 @@ export class MyBusinessDetailComponent implements OnInit {
salesNotice: this.salesNotice,
isActive: 1,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
opportunityId: this.opportunityId,
mdDropOptionId: this.opportunityRecordId,
opportunityId: this.opportunityId ? Number(this.opportunityId) : null,
mdDropOptionId: this.opportunityRecordId ? Number(this.opportunityRecordId) : null,
noticeDate: this.opportunityRecordNoticeDate,
leadsAssignedId: this.leadsAssignedId
leadsAssignedId: this.leadsAssignedId ? Number(this.leadsAssignedId) : null
}
this.myService.ownOpportunityRecordSave(param).subscribe(res => {
if (res['success']) {
......
......@@ -166,7 +166,7 @@ export class MyService {
//新增增员接口
recruit(param) {
const url = this.ydapi + '/practitioner/recruitTrackQuery';
const url = this.ydapi + '/practitioner/recruit';
return this.http
.post(url, JSON.stringify(param));
}
......@@ -189,4 +189,11 @@ export class MyService {
const url = this.API + '/metadata/educationLevelQuery';
return this.http.get(url);
}
//增员列表查询
recruitListQuery(param) {
const url = this.ydapi + '/practitioner/recruitListQuery';
return this.http
.post(url, JSON.stringify(param));
}
}
......@@ -20,7 +20,7 @@
<div class="contentItem">
<span>年龄</span>
<input class="form-control" type="text" placeholder="{{readonlyFlag ?'暂无年龄信息':'请输入年龄'}}"
[(ngModel)]="editRecruiting.age" [disabled]="readonlyFlag" />
[(ngModel)]="editRecruiting.age" [disabled]="readonlyFlag" (blur)="inputBlur()" />
</div>
<div class="contentItem">
<span>性别</span>
......@@ -37,24 +37,24 @@
</div>
<div class="contentItem">
<span><sub>*</sub>手机</span>
<a *ngIf="this.id!=0" style="text-decoration:none;color: #333;margin-right: 16px;"
<a *ngIf="this.potentialId!=0" style="text-decoration:none;color: #333;margin-right: 16px;"
href="tel:{{editRecruiting.mobileNo}}">
<i class="iconfont icon-dianhua" style="color: #e10d0d;"></i>
{{editRecruiting.mobileNo}}
</a>
<input class="form-control" type="text" maxlength="11" [(ngModel)]="editRecruiting.mobileNo" *ngIf="this.id==0"
placeholder="请输入手机号" />
<input *ngIf="this.potentialId==0" class="form-control" type="text" maxlength="11"
[(ngModel)]="editRecruiting.mobileNo" placeholder="请输入手机号" (blur)="inputBlur()" />
</div>
<div class="contentItem">
<span>微信</span>
<input class="form-control" type="text" placeholder="{{readonlyFlag ?'暂无微信':'请输入微信'}}"
[(ngModel)]="editRecruiting.weChat" [disabled]="readonlyFlag" (blur)="inputBlur()" />
[(ngModel)]="editRecruiting.wechatId" [disabled]="readonlyFlag" (blur)="inputBlur()" />
</div>
<div class="contentItem">
<span>其他联系</span>
<input class="form-control" type="text" placeholder="{{readonlyFlag ?'暂无其他联系方式':'请输入其他联系方式'}}"
[(ngModel)]="editRecruiting.otherContacts" [disabled]="readonlyFlag" (blur)="inputBlur()" />
[(ngModel)]="editRecruiting.othersContacts" [disabled]="readonlyFlag" (blur)="inputBlur()" />
</div>
<div class="contentItem">
<span>学历</span>
......@@ -78,13 +78,12 @@
</div>
<div class="contentItem" *ngIf="this.id!=0">
<span>增员创建时间</span>
<input class="form-control" type="text" placeholder="增员创建时间" [(ngModel)]="editRecruiting.opportunityDate"
disabled />
<input class="form-control" type="text" placeholder="增员创建时间" [(ngModel)]="editRecruiting.createdAt" disabled />
</div>
<div class="contentItem" *ngIf="this.id!=0">
<span>增员状态</span>
<div style="padding: 6px 15px;padding: 6px 15px;color: #e10d0d;font-weight: bold;">
{{editRecruiting.mdDropOptionId}}</div>
{{editRecruiting.trackStatus}}</div>
</div>
<div class="contentItem">
<span>备注</span>
......@@ -93,16 +92,19 @@
</div>
</div>
</div>
<div class="content" *ngIf="selectedId===2">
<div style="text-align: center;font-size: 16px;margin-top: 10px;"
*ngIf="opportunitySurveyAnswersList?.length==0 || !opportunitySurveyAnswersList">
<div class="content" *ngIf="selectedId===2" style="text-align: center;font-size: 16px;margin-top: 10px;">
<div *ngIf="!this.editRecruiting.ossPathResume">
暂无简历</div>
<a [href]="this.editRecruiting.ossPathResume">
{{this.lifeCommonService.getFileName(this.editRecruiting.ossPathResume)}}
</a>
</div>
<div class="content" *ngIf="selectedId===3;">
<ul class="recordLists">
<li *ngFor="let recruitTrackInfoItem of recruitTrackInfoList">
<div style="display: flex;justify-content: space-between;">
<div class="updatedAt">{{recruitTrackInfoItem.createAt}}</div>
<div class="updatedAt">
{{recruitTrackInfoItem.trackTime?recruitTrackInfoItem.trackTime:recruitTrackInfoItem.createAt}}</div>
<div class="opportunityRecordItem">{{recruitTrackInfoItem.trackStatus}}</div>
</div>
<div class="salesNotice">{{recruitTrackInfoItem.notice}}</div>
......@@ -122,7 +124,7 @@
<div style="position:relative">
<select name="businessStatus" (onChange)="inputBlur()" id="businessStatus" class="form-control"
[(ngModel)]="trackStatusId">
<option value="null">请选择</option>
<option value="">请选择</option>
<option *ngFor="let recruitingStatusItem of recruitingStatusList" value="{{recruitingStatusItem.id}}">
{{recruitingStatusItem.dropOptionName}}
</option>
......@@ -131,15 +133,17 @@
</div>
</div>
<div>
<div>备注{{notice}}</div>
<div>备注</div>
<div><input type="text" id="remark" class="form-control" placeholder="输入备注信息" [(ngModel)]="notice"
(blur)="inputBlur()"></div>
</div>
<!-- <div>
<div>
<div>跟进时间</div>
<div><input style="-webkit-appearance: none;" id="time" class="form-control" type="date"
[(ngModel)]="opportunityRecordNoticeDate" (blur)="inputBlur()"></div>
</div> -->
<div>
<input style="-webkit-appearance: none;" id="time" class="form-control" type="date" [(ngModel)]="trackTime"
(blur)="inputBlur()">
</div>
</div>
<ul class="footer">
<li (click)="addRecruitTrack()">确定</li>
<li (click)="this.isShow = false;">取消</li>
......
......@@ -40,7 +40,8 @@
color: #fff;
background: #0767bf;
text-align: center;
bottom: 30px;
bottom: 50px;
left: 42%;
}
.contentDetail {
margin-top: 15px;
......
......@@ -12,7 +12,7 @@ import { RecruitingQuery } from '../../domain/recruitingQuery';
export class RecruitingDetailComponent implements OnInit {
editRecruiting: RecruitingQuery = new RecruitingQuery();
//潜在增员的id
id: string;
potentialId: any;
titleList: Array<any>;
selectedId: number;
......@@ -36,6 +36,8 @@ export class RecruitingDetailComponent implements OnInit {
toastInfo: any;
recruitTrackInfoList: Array<any>;
resourceList: Array<any>;
trackTime: any;
status: any;
constructor(
private activateRoute: ActivatedRoute,
public lifeCommonService: LifeCommonService,
......@@ -49,34 +51,43 @@ export class RecruitingDetailComponent implements OnInit {
}
ngOnInit() {
this.id = this.activateRoute.snapshot.paramMap.get('id');
console.log(this.id)
//潜在增员id
this.potentialId = Number(this.activateRoute.snapshot.paramMap.get('id'));
//状态
this.status = this.activateRoute.snapshot.queryParams['status'];
this.dropOptionsQuery(1);
this.educationLevelQuery();
if (Number(this.id) === 0) {
if (this.potentialId === 0) {
this.readonlyFlag = false;
this.sexFlag = true;
this.maleFlag = true;
this.femaleFlag = true;
this.clickFlag = false;
this.editRecruiting = new RecruitingQuery('', 1, '', '', '', '', '', '', '', null, '', '', '', '', '');
this.editRecruiting = new RecruitingQuery('', 1, '', '', '', '', '', '', '', null, '', '', '', '');
this.selectTab(1);
} else {
this.clickFlag = true;
this.selectTab(1);
this.editRecruiting.resourceDropMasterId = ''
}
//获取基本信息
this.recruitListQuery()
}
selectTab(id) {
if (this.clickFlag == true) {
this.selectedId = id;
if (this.selectedId === 3) {
//初始化
this.trackStatusId = '';
//跟进列表查询
this.recruitTrackQuery();
//招募来源列表
this.dropOptionsQuery(2);
}
if (this.selectedId === 1 || this.selectedId === 2) {
this.recruitListQuery()
}
} else {
this.selectedId = 1;
}
......@@ -98,7 +109,7 @@ export class RecruitingDetailComponent implements OnInit {
//查询跟进记录
recruitTrackQuery() {
const param = {
potentialId: 26,
potentialId: this.potentialId ? this.potentialId : null,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
}
this.myService.recruitTrackQuery(param).subscribe((res) => {
......@@ -109,7 +120,6 @@ export class RecruitingDetailComponent implements OnInit {
})
}
//跟进状态列表type=2跟进状态type=1招募列表
dropOptionsQuery(type) {
if (type === 1) {
......@@ -122,7 +132,7 @@ export class RecruitingDetailComponent implements OnInit {
}
if (type === 2) {
//跟进状态列表
this.myService.dropOptionsQuery({ code: 'team_biulding_track' }).subscribe((res) => {
this.myService.dropOptionsQuery({ code: 'team_building_track' }).subscribe((res) => {
if (res['success']) {
this.recruitingStatusList = res['data']['dropMasterInfoList']['0']['dropOptionsInfoList'];
}
......@@ -147,7 +157,8 @@ export class RecruitingDetailComponent implements OnInit {
saveInfo() {
this.editRecruiting = {
...this.editRecruiting,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
potentialId: this.potentialId ? this.potentialId : null
}
console.log(JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'])
if (!this.editRecruiting.name) {
......@@ -171,7 +182,30 @@ export class RecruitingDetailComponent implements OnInit {
};
return;
}
}
const OVERZERO_REG = /^[0-9]*[1-9][0-9]*$/;
if (this.editRecruiting.age) {
if (OVERZERO_REG.test(this.editRecruiting.age)) {
if (parseInt(this.editRecruiting.age) > 100) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '年龄不能大于三位数!',
timeout: 3000,
align: 'center'
};
return;
}
} else {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '年龄只能输入正整数!',
timeout: 3000,
align: 'center'
};
return;
}
}
if (!this.editRecruiting.mobileNo) {
this.toastDialog = true;
......@@ -195,14 +229,12 @@ export class RecruitingDetailComponent implements OnInit {
return;
}
}
console.log(this.editRecruiting)
this.myService.recruit(this.editRecruiting).subscribe((res) => {
console.log(res)
if (res['success']) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '添加增员对象成功!',
msg: Number(this.potentialId) == 0 ? '添加增员对象成功!' : '修改成功!',
timeout: 3000,
align: 'center'
};
......@@ -219,13 +251,15 @@ export class RecruitingDetailComponent implements OnInit {
} else {
this.sexFlag = false;
}
//新增的时候要刷新页面
if (Number(this.id) == 0) {
if (res['data']['opportunityId'] && res['data']['leadsAssignedId']) {
this.id = res['data']['opportunityId'];
this.router.navigate([`/recruiting${this.id}`]);
//新增的时候要刷新页面replaceUrl: true更新路由后不把当前状态计入历史
if (this.potentialId === 0) {
if (res['data']['potentialId']) {
this.potentialId = Number(res['data']['potentialId']);
this.router.navigate([`/recruiting/${this.potentialId}`], { replaceUrl: true });
this.clickFlag = true;
}
}
this.recruitListQuery();
} else {
this.toastDialog = true;
this.toastInfo = {
......@@ -240,15 +274,57 @@ export class RecruitingDetailComponent implements OnInit {
//新增增员跟进记录
addRecruitTrack() {
const oppDate = new Date(this.trackTime + ' 23:59:59').getTime();
const createDate = new Date(this.editRecruiting.createdAt).getTime();
// if (nowDate < oppDate) {
// this.toastDialog = true;
// this.toastInfo = {
// status: 1,
// msg: '跟进时间不能大于当前时间!',
// timeout: 3000,
// align: 'center'
// };
// return;
// }
if (oppDate < createDate) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '跟进时间不能在增员时间之前!',
timeout: 3000,
align: 'center'
};
return;
}
if (!this.trackStatusId) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '请选择跟进状态!',
timeout: 3000,
align: 'center'
};
return;
}
if (!this.trackTime) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '跟进时间不能为空!',
timeout: 3000,
align: 'center'
};
return;
}
const RecruitTrackParam = {
potentialId: 26,//测试先写死小小仙女
potentialId: this.potentialId,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
notice: this.notice,
trackStatusId: this.trackStatusId
trackStatusId: this.trackStatusId,
trackTime: this.trackTime
}
console.log(this.notice)
this.myService.addRecruitTrack(RecruitTrackParam).subscribe((res) => {
console.log(res)
if (res['success']) {
this.toastDialog = true;
this.toastInfo = {
......@@ -269,4 +345,39 @@ export class RecruitingDetailComponent implements OnInit {
}
})
}
//查询基本信息
recruitListQuery() {
const listParam = {
status: null,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo')).practitionerId
}
this.myService.recruitListQuery(listParam).subscribe((res) => {
if (res['success']) {
if (res['data']['practitionerPotentialInfoList']) {
const list = res['data']['practitionerPotentialInfoList'];
for (let i = 0; i < list.length; i++) {
if (this.potentialId == list[i]['potentialId']) {
this.editRecruiting = list[i];
if (!this.editRecruiting.gender) {
this.sexFlag = false;
} else {
this.sexFlag = true;
if (this.editRecruiting.gender == 1) {
this.maleFlag = true;
this.femaleFlag = false;
} else {
this.femaleFlag = true;
this.maleFlag = false;
}
}
if (!this.editRecruiting.resourceDropMasterId) {
this.editRecruiting.resourceDropMasterId = '';
}
}
}
}
}
})
}
}
......@@ -11,7 +11,7 @@
<div class="salesContent">
<div style="text-align: center;margin: 20px auto;font-size: 20px;" *ngIf="businessList?.length==0">暂无商机</div>
<div class="salesItem" *ngFor="let recruitingItem of recruitingList"
[routerLink]="['/recruiting',recruitingItem.id]">
[routerLink]="['/recruiting',recruitingItem.potentialId]" [queryParams]="{status:selectedId}">
<div class="icon_bolck"><span class="iconfont icon-tuanduiguanlisvg"></span></div>
<div class="line">
<div>姓名:{{recruitingItem.name}}</div>
......@@ -20,11 +20,11 @@
</div>
<div class="line">
<div> 手机号:{{recruitingItem.mobileNo}}</div>
<div>{{recruitingItem.status}}</div>
<div>{{recruitingItem.trackStatus}}</div>
</div>
<div class="line">
<div>招募来源:{{recruitingItem.sources}}</div>
<div>{{recruitingItem.date}}</div>
<div>招募来源:{{recruitingItem.resourceDropMasterName}}</div>
<div>{{recruitingItem.createdAt}}</div>
</div>
</div>
</div>
......
......@@ -80,10 +80,11 @@
color: #fff;
background: #0767bf;
text-align: center;
bottom: 30px;
font-size: 28px;
// color: #ff5933;
font-weight: bold;
bottom: 50px;
left: 42%;
}
}
}
\ No newline at end of file
......@@ -17,23 +17,29 @@ export class RecruitingComponent implements OnInit {
this.titleList = [
{ id: 1, name: '待跟进' },
{ id: 2, name: '跟进中' },
{ id: 4, name: '已报聘' },
]
this.recruitingList = [
{ id: 1, name: '月亮', mobileNo: '18100000000', sources: 'boss直聘', status: '有意向', date: '2020-01-12' },
{ id: 2, name: '太阳', mobileNo: '18100000001', sources: '拉钩网', status: '有意向', date: '2020-01-12' },
{ id: 3, name: '星星', mobileNo: '18100000002', sources: '拉钩网', status: '考虑加入', date: '2020-01-12' },
{ id: 3, name: '已报聘' },
]
this.selectTab(1)
}
addMember() {
this.router.navigate(['/recruiting/0']);
}
selectTab(id) {
console.log(id)
this.selectedId = id;
this.recruitListQuery(id)
}
//1-待跟进,2-跟进中,3-已完成
recruitListQuery(type) {
const listParam = {
status: type,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo')).practitionerId
}
this.myService.recruitListQuery(listParam).subscribe((res) => {
if (res['success']) {
this.recruitingList = res['data']['practitionerPotentialInfoList']
}
})
}
}
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