Commit a22c4e4d by sunchao

我的商机基本信息

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