Commit f72b29eb by Chao Sun

商机基本信息保存

parent 3865ab71
......@@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --host 192.168.68.102",
"start": "ng serve --host 192.168.1.25",
"build": "ng build -c=dev --prod",
"test": "ng test",
"lint": "ng lint",
......
<div id="toast" *ngIf="toastHidden">
<div class="weui-mask_transparent"></div>
<div class="weui-toast">
<!--<i class="weui-icon_toast icon icon-checkmark-rounded" [ngClass]="{'icon-additional':toastInfo.status===0}"></i>-->
<p class="weui-toast__content" [ngStyle]="{'text-align':toastInfo.align}">{{toastInfo.msg}}</p>
</div>
</div>
\ No newline at end of file
.weui-mask_transparent {
position: fixed;
z-index: 1000;
top: 0;
right: 0;
left: 0;
bottom: 0;
}
.weui-toast {
position: fixed;
z-index: 5000;
width: 9.8em;
min-height: 7.6em;
padding: 0 0.7em;
top: 180px;
left: 50%;
margin-left: -4.9em;
background: rgba(17, 17, 17, 0.7);
text-align: justify;
border-radius: 5px;
color: #FFFFFF;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.weui-toast__content {
padding: 0 0 15px;
width: 100%;
word-break: break-all;
text-align: justify;
}
.weui-icon_toast {
margin: 22px 0 0;
display: block;
}
.icon-checkmark-rounded:before {
color: #fff;
font-size: 34px;
display: block;
margin-bottom: 10px;
}
.icon-additional:before {
transform: rotate(38deg);
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ToastComponent } from './toast.component';
describe('ToastComponent', () => {
let component: ToastComponent;
let fixture: ComponentFixture<ToastComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ToastComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ToastComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import { Router } from "@angular/router";
@Component({
selector: 'ydlife-toast',
templateUrl: './toast.component.html',
styleUrls: ['./toast.component.scss']
})
export class ToastComponent implements OnInit {
@Input() toastInfo: any;
@Input() routerLink: any;
toastHidden: boolean;
constructor(private router: Router) {
// autoHidden 是否自动消失
this.toastInfo = {
status: 1,
msg: '已完成',
timeout: 3000,
autoHidden: 1,
align: 'justify'
};
this.toastHidden = true;
}
ngOnInit() {
if (this.toastInfo.autoHidden == 0) {
if (this.routerLink) {
this.toastHidden = false;
this.router.navigate(['/' + this.routerLink]);
}
} else {
setTimeout(() => {
this.toastHidden = false;
if (this.routerLink) {
this.router.navigate(['/' + this.routerLink]);
}
}, this.toastInfo.timeout)
}
}
ngOnChanges() {
this.toastHidden = true;
setTimeout(() => {
this.toastHidden = false;
if (this.routerLink) {
this.router.navigate(['/' + this.routerLink]);
}
}, this.toastInfo.timeout)
}
}
export class BusinessQuery {
constructor(
public opportunityId?: string,
public birthdate?: string,
public age?: string,
public name?: string,
public gender?: string,
public mobileNo?: string,
public weChat?: string,
public otherContacts?: string,
public sourceChannel?: string,
public provinceId?: string,
public provinceName?: string,
public cityId?: string,
public cityName?: string,
public address?: string,
public opportunityDate?: string,
public opportunityCustomerTags?: any
) {
}
}
\ No newline at end of file
......@@ -57,7 +57,7 @@
<div class="contentItem">
<span>城市</span>
<input class="form-control" type="text" placeholder="城市" [(ngModel)]="editBusiness.address"
[disabled]="readonlyFlag" (click)="selectedArea()" />
[disabled]="readonlyFlag" />
</div>
<div class="contentItem">
......@@ -78,7 +78,7 @@
<div class="tagWrapper">
<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>
......@@ -90,6 +90,9 @@
<div class="questionContent">{{surveyItem.optionName}}</div>
</div>
</div>
<div class="content" *ngIf="selected===4">
<div>暂无方案</div>
</div>
<div class="content" *ngIf="selectedId===3">
<div class="add">+</div>
<ul class="record" style="margin-top: 15px;">
......@@ -104,3 +107,4 @@
</ul>
</div>
</div>
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
\ No newline at end of file
......@@ -30,7 +30,7 @@
position: absolute;
right: 10px;
font-size: 24px;
top: -15px;
top: -5px;
}
.contentDetail{
margin-top: 15px;
......
......@@ -17,20 +17,27 @@ export class MyBusinessDetailComponent implements OnInit {
opportunityId: string;
opportunitySurveyAnswersList: Array<any>;
tagList: Array<any>;
editBusiness: BusinessQuery = new BusinessQuery('1', null, null, null, null, null, null, null, null, null, null, null, null, null)
editBusiness: BusinessQuery = new BusinessQuery()
businessStatusList: Array<any>;
cityFlag: boolean;
provinceList: Array<any>;
provinces: Array<any>;
//返回的标签列表
opportunityCustomerTags:Array<any>;
opportunityRecordInfos:Array<any>;
opportunityCustomerTags: Array<any>;
opportunityRecordInfos: Array<any>;
//是否可以跳转预览方案
isCompletedQuestionnaire: any;
//控制弹框
toastDialog: boolean;
toastInfo: any;
constructor(private activateRoute: ActivatedRoute, private myService: MyService,
public lifeCommonService: LifeCommonService) {
this.titleList = [
{ id: 1, name: '基本信息' },
{ id: 2, name: '咨询服务' },
{ id: 2, name: '咨询问卷' },
{ id: 4, name: '咨询预览' },
{ id: 3, name: '商机跟进' }
]
}
......@@ -50,6 +57,13 @@ export class MyBusinessDetailComponent implements OnInit {
selectTab(id) {
this.selectedId = id;
if (id === 4) {
if (this.isCompletedQuestionnaire == 1) {
// window.location.href = `https://${window.location.host}/customizedPlanList/${this.opportunityId}?orderId=${this.orderId}`
window.location.href = `https://${window.location.host}/customizedPlanList/2?orderId=8373`
}
}
}
ownOpportunityDetailQuery() {
......@@ -64,18 +78,18 @@ export class MyBusinessDetailComponent implements OnInit {
practitionerId: 1
}
this.myService.ownOpportunityDetailQuery(detailParam).subscribe((res) => {
if (res['success']) {
this.opportunitySurveyAnswersList = res['data']['opportunityConsultationInfo']['opportunitySurveyAnswersList']
this.editBusiness = res['data']['opportunityBasicInformationInfo'];
this.opportunityCustomerTags= res['data']['opportunityBasicInformationInfo']['opportunityCustomerTags']
this.opportunityCustomerTags = res['data']['opportunityBasicInformationInfo']['opportunityCustomerTags']
this.opportunityRecordInfos = res['data']['opportunityRecordInfos'];
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.isCompletedQuestionnaire = res['data']['opportunityConsultationInfo']['isCompletedQuestionnaire'];
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{
} else {
this.tagList[j].selected = false;
}
}
......@@ -99,12 +113,12 @@ export class MyBusinessDetailComponent implements OnInit {
//选标签
selectTag(tagItem) {
this.tagList.forEach((item,idx)=>{
if(tagItem.id == item.id){
this.tagList[idx].selected=!tagItem.selected
this.tagList.forEach((item, idx) => {
if (tagItem.id == item.id) {
this.tagList[idx].selected = !tagItem.selected
}
})
this.editBusiness.opportunityCustomerTags = this.tagList.filter((item)=>{
this.editBusiness.opportunityCustomerTags = this.tagList.filter((item) => {
return item.selected == true;
})
......@@ -123,18 +137,30 @@ export class MyBusinessDetailComponent implements OnInit {
})
}
saveInfo(){
const newTag = this.editBusiness.opportunityCustomerTags.map((item)=>{
saveInfo() {
const newTag = this.editBusiness.opportunityCustomerTags.map((item) => {
return {
tagId:item.id?item.id:item.tagId,
tagName:item.tagName
tagId: item.id ? item.id : item.tagId,
tagName: item.tagName
}
})
this.editBusiness = {
...this.editBusiness,
opportunityCustomerTags:newTag
opportunityCustomerTags: newTag
}
console.log(this.editBusiness)
this.myService.ownOpportunityBasicInformationSave(this.editBusiness).subscribe((res) => {
console.log(res)
if (res['success']) {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '修改成功!',
timeout: 300000,
align: 'center'
};
}
console.log(this.editBusiness )
})
}
}
......@@ -13,8 +13,9 @@ import { AnnouncementDetailComponent } from './announcement-detail/announcement-
import { MyBusinessComponent } from './my-business/my-business.component';
import { MyBusinessDetailComponent } from './my-business-detail/my-business-detail.component';
import { PickerComponent } from '../common/picker/picker.component';
import { ToastComponent } from '../common/toast/toast.component';
@NgModule({
declarations: [MyCenterHomeComponent, MkMaterialComponent, MkMaterialDetailComponent, FileUploadComponent, ImportantAnnouncementComponent, SalesDetailComponent, AnnouncementDetailComponent, MyBusinessComponent, MyBusinessDetailComponent, PickerComponent],
declarations: [MyCenterHomeComponent, MkMaterialComponent, MkMaterialDetailComponent, FileUploadComponent, ImportantAnnouncementComponent, SalesDetailComponent, AnnouncementDetailComponent, MyBusinessComponent, MyBusinessDetailComponent, PickerComponent, ToastComponent],
imports: [
CommonModule,
LifeCommonModule,
......
......@@ -92,6 +92,13 @@ export class MyService {
});
}
//商机基本信息保存
ownOpportunityBasicInformationSave(param) {
const url = this.API + "/practitioner/ownOpportunityBasicInformationSave";
return this.http.post(url, JSON.stringify(param)).pipe(res => {
return res;
});
}
//获取省份
provinceqry(param) {
const url = this.API + "/partner/provinceqry";
......@@ -112,4 +119,6 @@ export class MyService {
});
}
}
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