Commit 637975d7 by Chao Sun

商机保存后跳转

parent ed769d62
......@@ -137,7 +137,8 @@
<div class="contentItem">
<span>备注</span>
<div style="padding: 6px 15px;padding: 6px 15px;">
<input class="form-control" type="text" [(ngModel)]="editBusiness.remark" disabled placeholder="备注信息" />
<input class="form-control" type="text" [disabled]="readonlyFlag" [(ngModel)]="editBusiness.remark"
placeholder="备注信息" />
</div>
</div>
</div>
......
.wrapper {
padding-bottom: 40px;
select {
-webkit-appearance: none;
border: none;
......@@ -42,7 +43,7 @@
color: #fff;
background: #0767bf;
text-align: center;
bottom: 30px;
bottom: 0;
left: 42%;
}
.contentDetail {
......@@ -70,11 +71,6 @@
display: flex;
flex-wrap: wrap;
}
select{
option.gray{
color: #ccc;
}
}
.sexWrapper {
display: flex;
width: 60%;
......
import { Component, OnInit, AfterViewInit } from '@angular/core';
import { MyService } from '../my.service';
import { ActivatedRoute } from "@angular/router";
import { ActivatedRoute, Router } from "@angular/router";
import { BusinessQuery } from '../../domain/businessQuery';
import { LifeCommonService } from '../../common/life-common.service';
......@@ -62,7 +62,7 @@ export class MyBusinessDetailComponent implements OnInit {
clickFlag: boolean;
constructor(private activateRoute: ActivatedRoute, private myService: MyService,
public lifeCommonService: LifeCommonService) {
public lifeCommonService: LifeCommonService, private router: Router, ) {
this.titleList = [
{ id: 1, name: '基本信息' },
{ id: 2, name: '咨询问卷' },
......@@ -73,7 +73,9 @@ export class MyBusinessDetailComponent implements OnInit {
ngOnInit() {
this.orderId = this.activateRoute.snapshot.queryParams['orderId'];
//商机对应的客户id
this.opportunityId = this.activateRoute.snapshot.paramMap.get('id');
//商机id
this.leadsAssignedId = this.activateRoute.snapshot.queryParams['leadsAssignedId'];
this.opportunityRecordId = null;
this.tagQuery();
......@@ -226,6 +228,51 @@ export class MyBusinessDetailComponent implements OnInit {
}
})
}
if (!this.editBusiness.name) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '姓名不能为空!',
timeout: 3000,
align: 'center'
};
return;
} else {
this.editBusiness.name = this.editBusiness.name.trim();
if (!this.lifeCommonService.nameValid(this.editBusiness.name)) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '不要乱输姓名哦!',
timeout: 3000,
align: 'center'
};
return;
}
}
if (!this.editBusiness.mobileNo) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '手机号不能为空!',
timeout: 3000,
align: 'center'
};
return;
} else {
this.editBusiness.mobileNo = this.editBusiness.mobileNo.trim()
if (!this.lifeCommonService.mobileNoValid(this.editBusiness.mobileNo)) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '输入手机号码错误',
timeout: 3000,
align: 'center'
};
return;
}
}
const OVERZERO_REG = /^[0-9]*[1-9][0-9]*$/;
if (this.editBusiness.age) {
if (!OVERZERO_REG.test(this.editBusiness.age)) {
......@@ -248,7 +295,6 @@ export class MyBusinessDetailComponent implements OnInit {
};
return;
}
}
}
this.editBusiness = {
......@@ -278,6 +324,14 @@ export class MyBusinessDetailComponent implements OnInit {
} else {
this.sexFlag = false;
}
//新增的时候要刷新页面
if (Number(this.opportunityId) == 0) {
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 } });
}
}
}
})
}
......
......@@ -13,7 +13,6 @@ export class MyBusinessComponent implements OnInit {
ngOnInit() {
this.ownOpportunityQuery()
}
ownOpportunityQuery() {
......
......@@ -60,7 +60,7 @@
<span>学历</span>
<select class="form-control" [(ngModel)]="editRecruiting.educationLevel" [disabled]="readonlyFlag"
style=" direction: rtl;">
<option value=''>请选择学历</option>
<option value=''>{{readonlyFlag ?'暂无学历信息':'请选择学历'}}</option>
<option *ngFor="let educationLevelItem of educationLevelList" [value]="educationLevelItem.id">
{{educationLevelItem.name}}
</option>
......@@ -70,7 +70,7 @@
<span>招募来源</span>
<select class="form-control" [(ngModel)]="editRecruiting.resourceDropMasterId" [disabled]="readonlyFlag"
style=" direction: rtl;">
<option value=''>请选择招募来源</option>
<option value="">{{readonlyFlag ?'暂无招募来源':'请选择招募来源'}}</option>
<option *ngFor="let resourceItem of resourceList" [value]="resourceItem.id">
{{resourceItem.dropOptionName}}
</option>
......
......@@ -100,6 +100,10 @@
.contentItem:last-child {
border-bottom: none;
}
select.form-control[disabled] {
background-color: transparent;
color: #999;
}
}
.tagWrapper {
display: flex;
......
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from "@angular/router";
import { ActivatedRoute, Router } from "@angular/router";
import { LifeCommonService } from '../../common/life-common.service';
import { MyService } from '../my.service';
import { RecruitingQuery } from '../../domain/recruitingQuery';
......@@ -39,7 +39,8 @@ export class RecruitingDetailComponent implements OnInit {
constructor(
private activateRoute: ActivatedRoute,
public lifeCommonService: LifeCommonService,
private myService: MyService) {
private myService: MyService,
private router: Router) {
this.titleList = [
{ id: 1, name: '基本信息' },
{ id: 2, name: '简历' },
......@@ -63,6 +64,7 @@ export class RecruitingDetailComponent implements OnInit {
} else {
this.clickFlag = true;
this.selectTab(1);
this.editRecruiting.resourceDropMasterId = ''
}
}
......@@ -204,6 +206,26 @@ export class RecruitingDetailComponent implements OnInit {
timeout: 3000,
align: 'center'
};
this.readonlyFlag = true;
if (this.editRecruiting.gender) {
this.sexFlag = true;
if (this.editRecruiting.gender == '1') {
this.maleFlag = true;
this.femaleFlag = false;
} else {
this.femaleFlag = true;
this.maleFlag = false;
}
} 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}`]);
}
}
} else {
this.toastDialog = true;
this.toastInfo = {
......
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