Commit e86e85ea by Sweet Zhang

我的商机增加出生日期

parent bb65fed9
......@@ -9,7 +9,7 @@
</div>
<div class="weui-dialog__ft">
<a href="javascript:;" class="weui-dialog__btn" [ngClass]="footer.className"
*ngFor="let footer of dialogInfo.footer" (click)="sendInfo()">{{footer.value}}</a>
*ngFor="let footer of dialogInfo.footer" (click)="sendInfo(footer.value)">{{footer.value}}</a>
</div>
</div>
</div>
......
......@@ -21,7 +21,7 @@ export class AlertComponent implements OnInit {
ngOnInit() {
}
sendInfo() {
this.popInfo.emit();
sendInfo(e) {
this.popInfo.emit(e);
}
}
......@@ -26,7 +26,8 @@ export class BusinessQuery {
public expertType?: any,
public expertPractitionerId?: any,
public expertPractitionerName?: any,
public mdDropOptionName?: any
public mdDropOptionName?: any,
public birthDate?: any,
) {
......
......@@ -19,9 +19,24 @@
[(ngModel)]="editBusiness.name" [disabled]="readonlyFlag" (blur)="inputBlur()" />
</div>
<div class="contentItem">
<span>出生日期</span>
<div>
<ListItem
DatePicker
[mode]="'date'"
[disabled]="readonlyFlag"
[maxDate] = "today"
[(ngModel)]="editBusiness.birthDate"
(onOk)="onOk($event)">
<Brief *ngIf="!readonlyFlag">{{editBusiness.birthDate ? (editBusiness.birthDate | date:'yyyy-MM-dd') : '请输入出生日期'}}</Brief>
<Brief *ngIf="readonlyFlag">{{editBusiness.birthDate ? (editBusiness.birthDate | date:'yyyy-MM-dd') : '暂无出生日期信息'}}</Brief>
</ListItem>
</div>
</div>
<div class="contentItem">
<span>年龄</span>
<input class="form-control" type="text" placeholder="{{readonlyFlag ?'暂无年龄信息':'请输入年龄'}}"
[(ngModel)]="editBusiness.age" [disabled]="readonlyFlag" (blur)="inputBlur()" />
[(ngModel)]="editBusiness.age" [disabled]="readonlyFlag || editBusiness.birthDate" (blur)="inputBlur()" />
</div>
<div class="contentItem">
<span>性别</span>
......
......@@ -69,6 +69,7 @@ export class MyBusinessDetailComponent implements OnInit {
deviceType:number;
// 获取经纪人信息
lifeCustomerInfo:any;
today:Date = new Date();
constructor(private activateRoute: ActivatedRoute, private myService: MyService,
public lifeCommonService: LifeCommonService, private router: Router, ) {
this.titleList = [
......@@ -133,6 +134,12 @@ export class MyBusinessDetailComponent implements OnInit {
}
// 日期选择
onOk(e){
console.log(e)
this.editBusiness.age = this.lifeCommonService.ages(e.getFullYear(),e.getMonth() +1,e.getDate()).age;
}
//改为编辑状态出现男女选项
editInfo() {
this.readonlyFlag = false;
......@@ -419,7 +426,8 @@ export class MyBusinessDetailComponent implements OnInit {
assignedPractitionerId: this.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
sourceFrom: this.editBusiness.sourceFrom ? Number(this.editBusiness.sourceFrom) : null,
birthDate:this.editBusiness.birthDate ? this.lifeCommonService.dateFormat(this.editBusiness.birthDate,'yyyy-MM-dd') : null
}
this.myService.ownOpportunityBasicInformationSave(this.editBusiness).subscribe((res) => {
if (res['success']) {
......
......@@ -38,6 +38,12 @@
<div>商机来源:{{businessItem.opportunityFrom}}</div>
<div>{{(businessItem.opportunityDate).substr(0,10)}}</div>
</div>
<div class="line">
<div></div>
<div><span (click)="del(businessItem.leadsAssignedId)">
<i class="iconfont icon-shanchu" style="color: red;font-size: 16px;"></i>
</span></div>
</div>
</div>
</div>
<div class="footer" *ngIf="pageType=='linkbusiness'" (click)="returnAddTask()">
......@@ -47,4 +53,7 @@
<i class="iconfont icon-jiahao" (click)="addBussiness()"></i>
</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="isDelFlag" [dialogInfo]="dialogInfo" (popInfo)="popInfo($event)"></ydlife-alert>
\ No newline at end of file
......@@ -19,6 +19,10 @@ export class MyBusinessComponent implements OnInit {
//控制弹框
toastDialog: boolean;
toastInfo: any;
// 是否要删除
isDelFlag:boolean = false;
selectedOpportunityId:string;
dialogInfo:any;
constructor(private myService: MyService, public lifeCommonService: LifeCommonService, private router: Router,private activatedRoute: ActivatedRoute,private location:Location) {
this.pageType = this.activatedRoute.snapshot.data[0]['type'];
}
......@@ -27,6 +31,39 @@ export class MyBusinessComponent implements OnInit {
this.ownOpportunityQuery();
}
del(e){
event.stopPropagation();
this.isDelFlag = true;
this.selectedOpportunityId = e;
this.dialogInfo = {
title: null,
content: {value: '确认要删除此商机吗?', align: 'center'},
footer: [{value: '取消', routerLink: '', className: 'weui-dialog__btn_primary'},{value: '确定', routerLink: '', className: ''}],
};
}
popInfo(e){
this.isDelFlag = false;
if(e==='确定'){
this.deleteOpportunity();
}
}
// 删除商机
deleteOpportunity(){
this.myService.deleteOpportunity({opportunityId:this.selectedOpportunityId,practitionerId:JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']}).subscribe(res=>{
this.isDelFlag = true;
this.dialogInfo = {
title: null,
content: {value: res['message'], align: 'center'},
footer: [{value: '我知道了', routerLink: '', className: 'weui-dialog__btn_primary'}],
};
if(res['success']){
this.ownOpportunityQuery();
}
})
}
ownOpportunityQuery() {
const brokerCustomerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['customerId'];
const brokerPractitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
......
......@@ -861,6 +861,12 @@ export class MyService {
// 积分规则信息
queryIntegralRuleList(){
const url = this.API + "/integral/queryIntegralRuleList";
return this.http.post(url,JSON.stringify({isActive:1}))
return this.http.post(url,JSON.stringify({isActive:1, integralType:1}))
}
// 删除商机
deleteOpportunity(params){
const url = this.ydapi + "/practitioner/deleteOpportunity";
return this.http.post(url,JSON.stringify(params))
}
}
......@@ -293,4 +293,7 @@ footer.fixed{
}
.am-list-item{
background-color: #f9f9f9;
}
.contentItem .am-list-item{
background-color: #fff;
}
\ No newline at end of file
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