Commit 7026962a by sunchao

我的客户需求开发

parent 750f9af0
export class BusinessQuery { export class BusinessQuery {
constructor(public opportunityId?: any, constructor(
public age?: string, public opportunityId?: any,
public age?: any,
public name?: string, public name?: string,
public gender?: any, public gender?: any,
public mobileNo?: string, public mobileNo?: string,
......
<div class="customer_wrapper">
<ul class="customer_content" *ngFor="let customerItem of customerList;index as i;">
<img src="assets/images/man.png" alt="男" *ngIf="customerItem.gender=='男'">
<img src="assets/images/women.png" alt="女" *ngIf="customerItem.gender=='女'">
<li>
<span>姓名:{{customerItem.name}}</span>
</li>
<li >
<span>被保人关系:{{customerItem.relationType}}</span>
</li>
<li>
<span>生日:{{customerItem.birthDate}}</span>
</li>
<li>
<span>手机号:{{customerItem.mobileNo}}</span>
</li>
</ul>
</div>
.customer_wrapper{
color: #333;
position: relative;
.customer_content{
border-bottom: 1px #e2e2e2 solid;
padding: 10px 15px;
li{
display: flex;
justify-content: space-between;
align-items: center;
height: 35px;
margin-left: 55px;
}
img{
position: absolute;
width: 40px;
}
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CustomerRelationComponent } from './customer-relation.component';
describe('CustomerRelationComponent', () => {
let component: CustomerRelationComponent;
let fixture: ComponentFixture<CustomerRelationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CustomerRelationComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CustomerRelationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute,Router } from "@angular/router";
import { MyService } from '../my.service';
@Component({
selector: 'ydlife-customer-relation',
templateUrl: './customer-relation.component.html',
styleUrls: ['./customer-relation.component.scss']
})
export class CustomerRelationComponent implements OnInit {
customerList:Array<any>;
customerId:any;
constructor(private activatedRoute: ActivatedRoute,private myService:MyService) { }
ngOnInit() {
this.customerId = this.activatedRoute.snapshot.queryParams.customerId?this.activatedRoute.snapshot.queryParams.customerId:null;
this.queryCustomerInsuredList();
}
queryCustomerInsuredList(){
this.myService.queryCustomerInsuredList(this.customerId).subscribe((res)=>{
console.log(res)
if(res['success']){
this.customerList = res['data']['list'];
}
})
}
}
...@@ -97,8 +97,20 @@ export class MyBusinessDetailComponent implements OnInit { ...@@ -97,8 +97,20 @@ export class MyBusinessDetailComponent implements OnInit {
this.maleFlag = true; this.maleFlag = true;
this.femaleFlag = true; this.femaleFlag = true;
this.clickFlag = false; this.clickFlag = false;
//初始化新增 let myCustomerInfo = JSON.parse(localStorage.getItem('myCustomerInfo'))
this.editBusiness = new BusinessQuery("", "", "", 1, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", null); if(myCustomerInfo){
let birthDate,age;
if(myCustomerInfo.birthDate){
birthDate = myCustomerInfo.birthDate.split('-');
age=this.lifeCommonService.ages(birthDate[0],birthDate[1],birthDate[2]).age;
}else{
age = null;
}
this.editBusiness = new BusinessQuery("",age, myCustomerInfo.name, myCustomerInfo.gender=='女'?2:1, myCustomerInfo.mobileNo, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", null);
}else{
//初始化新增
this.editBusiness = new BusinessQuery("", "", "", 1, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", null);
}
this.selectTab(1); this.selectTab(1);
} else { } else {
this.clickFlag = true; this.clickFlag = true;
...@@ -436,7 +448,7 @@ export class MyBusinessDetailComponent implements OnInit { ...@@ -436,7 +448,7 @@ export class MyBusinessDetailComponent implements OnInit {
this.toastDialog = true; this.toastDialog = true;
this.toastInfo = { this.toastInfo = {
status: 1, status: 1,
msg: res['success'], msg: res['message'],
timeout: 3000, timeout: 3000,
align: 'center' align: 'center'
}; };
......
...@@ -42,6 +42,8 @@ export class MyBusinessComponent implements OnInit { ...@@ -42,6 +42,8 @@ export class MyBusinessComponent implements OnInit {
} }
addBussiness() { addBussiness() {
//清空从我的客户带过来的客户信息
localStorage.removeItem('myCustomerInfo')
this.router.navigate(['/business/0']); this.router.navigate(['/business/0']);
} }
......
...@@ -115,7 +115,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit { ...@@ -115,7 +115,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
title: '我的展业', title: '我的展业',
content: [ content: [
{ no: 12, subtitle: '销售保单', icon: 'policy', path: '', routerLink: '',showSubMenu:true }, { no: 12, subtitle: '销售保单', icon: 'policy', path: '', routerLink: '',showSubMenu:true },
{ no: 20, subtitle: '我的客户', icon: 'customer', path: '', routerLink: '',showSubMenu:true }, { no: 20, subtitle: '我的客户', icon: 'customer', path: '', routerLink: 'customer',showSubMenu:true },
// { no: 14, subtitle: '我的佣金', icon: 'commission', path: '', routerLink: '',showSubMenu:true }, // { no: 14, subtitle: '我的佣金', icon: 'commission', path: '', routerLink: '',showSubMenu:true },
{ no: 19, subtitle: '薪资单', icon: 'salary', path: '', routerLink: 'salary',showSubMenu:this.isShowSalay }, { no: 19, subtitle: '薪资单', icon: 'salary', path: '', routerLink: 'salary',showSubMenu:this.isShowSalay },
{ no: 21, subtitle: '公司制度', icon: 'management', path: '', routerLink: '',showSubMenu:true }, { no: 21, subtitle: '公司制度', icon: 'management', path: '', routerLink: '',showSubMenu:true },
......
<div class="customer_wrapper" *ngIf="policyList?.length>0">
<ul class="customer_content" *ngFor="let policyItem of policyList;index as i;"
[ngClass]="{isActive:policyItem.isValid == '有效'}" (click)="jumpToOrderdetail(policyItem.orderNo)">
<li>{{policyItem.productName?policyItem.productName:policyItem.planName}}</li>
<li>保单号:{{policyItem.policyNo}}</li>
<li>日期:{{policyItem.startDate | date:'yyyy.MM.dd'}} - {{policyItem.endDate | date:'yyyy.MM.dd'}}</li>
<img src="assets/images/orderStatus/valid_2.png" alt="有效中" *ngIf="policyItem.isValid == '有效'"/>
<img src="assets/images/orderStatus/invalid_2.png" alt="已失效" *ngIf="policyItem.isValid == '无效'"/>
</ul>
</div>
<div style="padding-top: 50%;font-size: 36px;text-align: center;" *ngIf="policyList?.length==0">
暂无保单
</div>
.customer_wrapper{
color: #333;
background: #fff;
.customer_content{
padding: 10px 15px;
background: #f1f1f1;
margin-bottom: 8px;
position: relative;
li{
display: flex;
justify-content: space-between;
align-items: center;
height: 30px;
}
img{
position: absolute;
right: 5%;
top: 14%;
width: 80px;
height: 80px;
}
}
.customer_content.isActive{
background: #f8eded;
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MyCustomerPolicyComponent } from './my-customer-policy.component';
describe('MyCustomerPolicyComponent', () => {
let component: MyCustomerPolicyComponent;
let fixture: ComponentFixture<MyCustomerPolicyComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyCustomerPolicyComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MyCustomerPolicyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute,Router } from "@angular/router";
import { MyService } from '../my.service';
@Component({
selector: 'ydlife-my-customer-policy',
templateUrl: './my-customer-policy.component.html',
styleUrls: ['./my-customer-policy.component.scss']
})
export class MyCustomerPolicyComponent implements OnInit {
policyList:Array<any>;
customerId:any;
constructor(private activatedRoute: ActivatedRoute,private myService:MyService,private router:Router) { }
ngOnInit() {
this.customerId = this.activatedRoute.snapshot.queryParams.customerId?this.activatedRoute.snapshot.queryParams.customerId:null;
this.queryPolicyListByHolderCustomerId();
}
queryPolicyListByHolderCustomerId(){
this.myService.queryPolicyListByHolderCustomerId({holderCustomerId:this.customerId,practitionerCustomerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['customerId']}).subscribe((res)=>{
if(res['success']){
this.policyList = res['data']['list'];
}
})
}
jumpToOrderdetail(orderNo) {
this.router.navigate(['/orderDetail'], { queryParams: { orderNo:orderNo } });
}
}
<div class="customer_wrapper">
<ul class="customer_content" *ngFor="let customerItem of customerList;index as i;">
<img src="assets/images/man.png" alt="男" *ngIf="customerItem.gender=='男'">
<img src="assets/images/women.png" alt="女" *ngIf="customerItem.gender=='女'">
<li>
<div>
<span *ngIf="customerItem.selected">姓名:</span>{{customerItem.name}}
<span *ngIf="!customerItem.selected">{{customerItem.mobileNo}}</span>
</div>
<div class="iconfont icon-ar-r" *ngIf="!customerItem.selected" (click)="customerItem.selected = true"></div>
<div class="iconfont icon-xiangxia" *ngIf="customerItem.selected" (click)="customerItem.selected = false"></div>
</li>
<li *ngIf="customerItem.selected">
<span>性别:{{customerItem.gender}}</span>
</li>
<li *ngIf="customerItem.selected">
<span>生日:{{customerItem.birthDate}}</span>
</li>
<li *ngIf="customerItem.selected">
<span>手机号:{{customerItem.mobileNo}}</span>
</li>
<li class="customer_btn" *ngIf="customerItem.selected">
<div (click)="jumpToRelation(customerItem.customerId)">
<img src="assets/images/pepple.png" alt="客户关系">
<span>客户关系</span>
</div>
<div (click)="jumpToPolicy(customerItem.customerId)">
<img src="assets/images/policy_01.png" alt="保单">
<span>查看保单</span>
</div>
<div (click)="addBussiness(customerItem)">
<img src="assets/images/add.png" alt="商机">
<span>添加商机</span>
</div>
</li>
</ul>
<div *ngIf="customerList?.length ==0"
style="text-align: center;padding-top: 50%;font-size: 36px;">暂无客户</div>
</div>
\ No newline at end of file
.customer_wrapper{
color: #333;
position: relative;
.customer_content{
border-bottom: 1px #e2e2e2 solid;
padding: 10px 15px;
li{
display: flex;
justify-content: space-between;
align-items: center;
height: 35px;
margin-left: 55px;
}
li.customer_btn{
div{
width: 30%;
height: 35px;
line-height: 35px;
border: 1px #1b5b99 solid;
border-radius: 8px;
color: #1b5b99;
margin-right: 5%;
text-align: center;
position: relative;
img{
width: 22px;
height: 22px;
left: 8px;
top: 5px;
}
span{
margin-left: 26px;
}
}
div:last-child{
margin-right: 0;
}
}
img{
position: absolute;
width: 40px;
}
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MyCustomerComponent } from './my-customer.component';
describe('MyCustomerComponent', () => {
let component: MyCustomerComponent;
let fixture: ComponentFixture<MyCustomerComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyCustomerComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MyCustomerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { MyService } from '../my.service';
import { ActivatedRoute,Router } from "@angular/router";
import { LifeCommonService } from "../../common/life-common.service";
import { ModalService, ToastService } from 'ng-zorro-antd-mobile';
@Component({
selector: 'ydlife-my-customer',
templateUrl: './my-customer.component.html',
styleUrls: ['./my-customer.component.scss']
})
export class MyCustomerComponent implements OnInit {
customerList:Array<any>;
practitionerId:any;
constructor(private _toast: ToastService,private activatedRoute: ActivatedRoute,
private router: Router,public lifeCommonService:LifeCommonService,
public myService:MyService) { }
ngOnInit() {
this.lifeCommonService.setTitle('我的客户');
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
// this.customerList = [
// {name:'王倩',mobileNo:'13112210000',gender:'女',birthDate:'1990-12-13'},
// {name:'张三',mobileNo:'13451511111',gender:'男',birthDate:'1987-01-08'},
// {name:'李四',mobileNo:'13451511122',gender:'男',birthDate:'1989-03-21'},
// ]
this.queryCustomerHolderList()
}
addBussiness(customerItem) {
localStorage.setItem('myCustomerInfo',JSON.stringify(customerItem))
this.router.navigate(['/business/0']);
}
jumpToRelation(customerId){
this.router.navigate(['/customer_relation'],{ queryParams: { customerId:customerId} });
}
jumpToPolicy(customerId){
this.router.navigate(['/customer_policy'],{ queryParams: { customerId:customerId} })
}
//我的客户
queryCustomerHolderList(){
this.myService.queryCustomerHolderList(this.practitionerId).subscribe((res)=>{
if(res['success']){
this.customerList = res['data']['list'];
}else{
this.customerList = [];
const toast = ToastService.show(res['message'], 0);
setTimeout(() => {
ToastService.hide();
}, 3000);
}
})
}
}
...@@ -58,6 +58,9 @@ import { ProductComponent } from './product/product.component'; ...@@ -58,6 +58,9 @@ import { ProductComponent } from './product/product.component';
import { ProductDataComponent } from "./product-data/product-data.component"; import { ProductDataComponent } from "./product-data/product-data.component";
import { CommissionComponent } from './commission/commission.component'; import { CommissionComponent } from './commission/commission.component';
import { FileListComponent } from './file-list/file-list.component'; import { FileListComponent } from './file-list/file-list.component';
import { MyCustomerComponent } from './my-customer/my-customer.component';
import { CustomerRelationComponent } from './customer-relation/customer-relation.component';
import { MyCustomerPolicyComponent } from './my-customer-policy/my-customer-policy.component';
const myRoutes: Routes = [ const myRoutes: Routes = [
{ path: '', component: MyCenterHomeComponent, canActivate: [AuthGuard], data: [{ title: '银盾保险经纪 - 工作台' }] }, { path: '', component: MyCenterHomeComponent, canActivate: [AuthGuard], data: [{ title: '银盾保险经纪 - 工作台' }] },
...@@ -122,7 +125,10 @@ const myRoutes: Routes = [ ...@@ -122,7 +125,10 @@ const myRoutes: Routes = [
{ path: 'product',component:ProductComponent,canActivate:[AuthGuard]}, { path: 'product',component:ProductComponent,canActivate:[AuthGuard]},
{ path: 'productData/:id',component:ProductDataComponent,canActivate:[AuthGuard]}, { path: 'productData/:id',component:ProductDataComponent,canActivate:[AuthGuard]},
{ path: 'commission',component:CommissionComponent,canActivate:[AuthGuard]}, { path: 'commission',component:CommissionComponent,canActivate:[AuthGuard]},
{ path: 'filelist',component:FileListComponent,canActivate:[AuthGuard]} { path: 'filelist',component:FileListComponent,canActivate:[AuthGuard]},
{ path: 'customer',component:MyCustomerComponent,canActivate:[AuthGuard]},
{ path: 'customer_relation',component:CustomerRelationComponent,canActivate:[AuthGuard]},
{ path: 'customer_policy',component:MyCustomerPolicyComponent,canActivate:[AuthGuard]}
]; ];
@NgModule({ @NgModule({
......
...@@ -71,9 +71,12 @@ import { ProductComponent } from './product/product.component'; ...@@ -71,9 +71,12 @@ import { ProductComponent } from './product/product.component';
import { ProductDataComponent } from './product-data/product-data.component'; import { ProductDataComponent } from './product-data/product-data.component';
import { CommissionComponent } from './commission/commission.component'; import { CommissionComponent } from './commission/commission.component';
import { FileListComponent } from './file-list/file-list.component'; import { FileListComponent } from './file-list/file-list.component';
import { MyCustomerComponent } from './my-customer/my-customer.component';
import { CustomerRelationComponent } from './customer-relation/customer-relation.component';
import { MyCustomerPolicyComponent } from './my-customer-policy/my-customer-policy.component';
@NgModule({ @NgModule({
declarations: [MyCenterHomeComponent, MkMaterialComponent, MkMaterialDetailComponent, FileUploadComponent, ImportantAnnouncementComponent, SalesDetailComponent, AnnouncementDetailComponent, MyBusinessComponent, MyBusinessDetailComponent, PickerComponent, MyToastComponent, SalesRankComponent, TeamRankComponent, RecruitingComponent, RecruitingDetailComponent, ThanksComponent, MySettingComponent, MySettingDetailComponent, MyNewsComponent, MyTargetComponent, TeamPanelComponent, SwitchNumberPipe, TeamSalesScoreComponent, ScoreDetailsComponent, BusinessCardComponent, OrderDetailComponent, SalaryComponent, TodoListComponent, AddTaskComponent, MedicalServiceComponent, InvitationComponent, RegisterComponent, EmployeeInfoComponent, EmployeeBasicInfoComponent, WorkExperienceComponent, PersonalPhotosComponent, EmployeeIdCardComponent, EmployeeEducationComponent, PersonalStatementComponent, SignatureComponent, EmployeeSubmitComponent, BankCardComponent, MemberDetailComponent, ApprovalListComponent, ApprovalCommentsComponent, ApprovalResultListComponent, MyApplicationComponent, SuggestionComponent, EmployeeSalaryComponent, HistoricalRankComponent, TeamAreaPanelComponent, ArticleComponent, ArticleDetailComponent, ArticleReadComponent,SalaryDetailComponent,SalaryFirstYearComponent,DetailModalComponent, ProductComponent, ProductDataComponent, CommissionComponent, FileListComponent], declarations: [MyCenterHomeComponent, MkMaterialComponent, MkMaterialDetailComponent, FileUploadComponent, ImportantAnnouncementComponent, SalesDetailComponent, AnnouncementDetailComponent, MyBusinessComponent, MyBusinessDetailComponent, PickerComponent, MyToastComponent, SalesRankComponent, TeamRankComponent, RecruitingComponent, RecruitingDetailComponent, ThanksComponent, MySettingComponent, MySettingDetailComponent, MyNewsComponent, MyTargetComponent, TeamPanelComponent, SwitchNumberPipe, TeamSalesScoreComponent, ScoreDetailsComponent, BusinessCardComponent, OrderDetailComponent, SalaryComponent, TodoListComponent, AddTaskComponent, MedicalServiceComponent, InvitationComponent, RegisterComponent, EmployeeInfoComponent, EmployeeBasicInfoComponent, WorkExperienceComponent, PersonalPhotosComponent, EmployeeIdCardComponent, EmployeeEducationComponent, PersonalStatementComponent, SignatureComponent, EmployeeSubmitComponent, BankCardComponent, MemberDetailComponent, ApprovalListComponent, ApprovalCommentsComponent, ApprovalResultListComponent, MyApplicationComponent, SuggestionComponent, EmployeeSalaryComponent, HistoricalRankComponent, TeamAreaPanelComponent, ArticleComponent, ArticleDetailComponent, ArticleReadComponent,SalaryDetailComponent,SalaryFirstYearComponent,DetailModalComponent, ProductComponent, ProductDataComponent, CommissionComponent, FileListComponent,MyCustomerComponent, CustomerRelationComponent, MyCustomerPolicyComponent],
imports: [ imports: [
CommonModule, CommonModule,
LifeCommonModule, LifeCommonModule,
......
...@@ -682,4 +682,34 @@ export class MyService { ...@@ -682,4 +682,34 @@ export class MyService {
return this.http return this.http
.post(url, JSON.stringify(param)); .post(url, JSON.stringify(param));
} }
//我的客户投保人列表列表
queryCustomerHolderList(practitionerId){
const url = this.ydapi + `/practitioner/queryCustomerHolderList/${practitionerId}`
return this.http.get(url).pipe((res)=>{
return res;
});
}
//客户关系接口
queryCustomerInsuredList(customerId){
const url = this.ydapi + `/practitioner/queryCustomerInsuredList/${customerId}`
return this.http.get(url).pipe((res)=>{
return res;
});
}
//客户保单查询接口
queryPolicyListByHolderCustomerId(param){
const url = this.ydapi + '/practitioner/queryPolicyListByHolderCustomerId';
return this.http
.post(url, JSON.stringify(param));
}
//保单详情接口
orderDetailQuery(param) {
const url = this.API + '/erp/orderDetailQuery';
return this.http.post(url, JSON.stringify(param));
}
} }
...@@ -15,13 +15,18 @@ export class OrderDetailComponent implements OnInit { ...@@ -15,13 +15,18 @@ export class OrderDetailComponent implements OnInit {
insuredInfos: Array<any>; insuredInfos: Array<any>;
policyFactorInfos: Array<any>; policyFactorInfos: Array<any>;
relation_id:string; relation_id:string;
orderDetail:any;
constructor(private myService: MyService, private activatedRoute: ActivatedRoute) { } constructor(private myService: MyService, private activatedRoute: ActivatedRoute) { }
ngOnInit() { ngOnInit() {
this.orderNo = this.activatedRoute.snapshot.queryParams.orderNo; this.orderNo = this.activatedRoute.snapshot.queryParams.orderNo;
this.policyNo = this.activatedRoute.snapshot.queryParams.policyNo; this.policyNo = this.activatedRoute.snapshot.queryParams.policyNo;
this.relation_id = this.activatedRoute.snapshot.queryParams.relation_id; this.relation_id = this.activatedRoute.snapshot.queryParams.relation_id;
this.policyInfoQuery(); if(this.relation_id){
this.policyInfoQuery();
}else{
this.orderQuery();
}
} }
policyInfoQuery() { policyInfoQuery() {
this.myService.policyInfoQuery({ orderNo: this.orderNo, platform: 2,policyNo:this.policyNo,relation_id:this.relation_id }).subscribe((res) => { this.myService.policyInfoQuery({ orderNo: this.orderNo, platform: 2,policyNo:this.policyNo,relation_id:this.relation_id }).subscribe((res) => {
...@@ -33,4 +38,40 @@ export class OrderDetailComponent implements OnInit { ...@@ -33,4 +38,40 @@ export class OrderDetailComponent implements OnInit {
} }
}) })
} }
orderQuery(){
this.myService.orderDetailQuery({orderNo:this.orderNo}).subscribe((res)=>{
if(res['success']){
this.orderDetail = res['data']['orderDetail'];
this.holderInfo = this.orderDetail['holderItem'];
this.insuredInfos = this.orderDetail['insureds'];
}
})
}
getChineseDate(str) {
if (str == "Y") {
return "年";
}
if (str == "M") {
return "月";
}
if (str == "D") {
return "日";
}
if (str == "A") {
return "岁";
}
return '';
}
getVehicleCategory(str) {
if (str == "01") {
return "客车";
}
if (str == "02") {
return "货车";
}
return str;
}
} }
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