Commit a22c4e4d by sunchao

我的商机基本信息

parent be1732aa
......@@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --host 192.168.1.25",
"start": "ng serve --host 192.168.68.102",
"build": "ng build -c=dev --prod",
"test": "ng test",
"lint": "ng lint",
......
......@@ -26,10 +26,10 @@
<span>性别</span>
<div class="sexWrapper">
<button class="form-control sex" [ngClass]="{'sexBtn':editBusiness?.gender=='1'}"
(click)="selectedGender('1')">
(click)="selectedGender('1')" [disabled]="readonlyFlag">
</button>
<button class="form-control sex" [ngClass]="{'sexBtn':editBusiness?.gender=='2'}"
(click)="selectedGender('2')"></button>
(click)="selectedGender('2')" [disabled]="readonlyFlag"></button>
</div>
</div>
<div class="contentItem">
......@@ -69,16 +69,16 @@
<span>商机状态</span>
<div>{{lifeCommonService.checkStr(editBusiness.mdDropOptionId)}} </div>
</div>
<div class="contentItem">
<!-- <div class="contentItem">
<span>标签</span>
<input class="form-control" type="text" placeholder="标签" [(ngModel)]="editBusiness.name"
[disabled]="readonlyFlag" />
</div>
</div> -->
</div>
<div class="tagWrapper">
<div style="width: 100%;">请选择客户标签</div>
<div style="width: 100%;">标签</div>
<div class="tagContent" *ngFor="let tagItem of tagList" (click)="selectTag(tagItem)"
[ngClass]="{selected:tagItem.selected}">
[ngClass]="{selected:tagItem.selected}" >
{{tagItem.tagName}}
</div>
</div>
......@@ -98,7 +98,4 @@
<li>备注</li>
</ul>
</div>
<ydlife-picker *ngIf="cityFlag" [provinceLists]="provinces" [limitStep]="areaLimitStep"
(selectedArea)="getAreaInfo($event,1)"></ydlife-picker>
</div>
\ No newline at end of file
import { Component, OnInit, Output, Input, EventEmitter } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { MyService } from '../my.service';
import { ActivatedRoute } from "@angular/router";
import { BusinessQuery } from '../../domain/businessQuery';
......@@ -9,7 +9,6 @@ import { LifeCommonService } from '../../common/life-common.service';
styleUrls: ['./my-business-detail.component.scss']
})
export class MyBusinessDetailComponent implements OnInit {
@Output() sendRemoveScrollContent = new EventEmitter();
titleList: Array<any>;
selectedId: number;
surveyAnswersList: Array<any>;
......@@ -23,6 +22,8 @@ export class MyBusinessDetailComponent implements OnInit {
cityFlag: boolean;
provinceList: Array<any>;
provinces: Array<any>;
//返回的标签列表
opportunityCustomerTags:Array<any>;
constructor(private activateRoute: ActivatedRoute, private myService: MyService,
public lifeCommonService: LifeCommonService) {
this.titleList = [
......@@ -35,16 +36,11 @@ export class MyBusinessDetailComponent implements OnInit {
ngOnInit() {
this.orderId = this.activateRoute.snapshot.queryParams['orderId'];
this.opportunityId = this.activateRoute.snapshot.paramMap.get('id');
this.tagQuery();
this.selectTab(1);
this.ownOpportunityDetailQuery();
this.tagQuery();
this.dropOptionsQuery();
// 获取省份
this.myService.provinceqry({ insurerId: 11 }).subscribe(res => {
if (res['success']) {
this.provinces = res['data'].provinceList;
}
})
}
editInfo() {
......@@ -67,32 +63,50 @@ export class MyBusinessDetailComponent implements OnInit {
practitionerId: 1
}
this.myService.ownOpportunityDetailQuery(detailParam).subscribe((res) => {
console.log(res)
if (res['success']) {
this.opportunitySurveyAnswersList = res['data']['opportunityConsultationInfo']['opportunitySurveyAnswersList']
this.editBusiness = res['data']['opportunityBasicInformationInfo']
this.editBusiness = res['data']['opportunityBasicInformationInfo'];
this.opportunityCustomerTags= res['data']['opportunityBasicInformationInfo']['opportunityCustomerTags']
if(this.opportunityCustomerTags.length>0){
for(let i=0;i<this.opportunityCustomerTags.length;i++){
for(let j=0;j<this.tagList.length;j++){
if(this.opportunityCustomerTags[i]['tagId'] ==this.tagList[j]['id']){
this.tagList[j].selected = true;
}else{
this.tagList[j].selected = false;
}
}
}
console.log(this.tagList)
}
} else {
this.opportunitySurveyAnswersList = [];
}
})
}
saveInfo() {
}
tagQuery() {
this.myService.tagQuery({ tagType: 2, isActive: 1 }).subscribe((res) => {
if (res['success']) {
this.tagList = res['data']['tagVOs'];
}
})
}
//选标签
selectTag(tagItem) {
tagItem.selected = !tagItem.selected;
console.log(tagItem)
this.tagList.forEach((item,idx)=>{
if(tagItem.id == item.id){
this.tagList[idx].selected=!tagItem.selected
}
})
this.editBusiness.opportunityCustomerTags = this.tagList.filter((item)=>{
return item.selected == true;
})
}
//选男女
......@@ -102,29 +116,24 @@ export class MyBusinessDetailComponent implements OnInit {
//商机状态
dropOptionsQuery() {
this.myService.dropOptionsQuery({ code: 'bizchance_promotion_action' }).subscribe((res) => {
console.log(res)
if (res['success']) {
this.businessStatusList = res['data']['dropMasterInfoList']['0']['dropOptionsInfoList'];
}
})
}
// 选择地址信息
selectedArea() {
this.sendRemoveScrollContent.emit(1);
this.cityFlag = true;
saveInfo(){
const newTag = this.editBusiness.opportunityCustomerTags.map((item)=>{
return {
tagId:item.id?item.id:item.tagId,
tagName:item.tagName
}
})
// 获取地址信息
getAreaInfo(e, type) {
this.sendRemoveScrollContent.emit(0);
this.cityFlag = false;
this.editBusiness = {
...this.editBusiness,
opportunityCustomerTags:newTag
}
console.log(this.editBusiness )
}
}
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