Commit 98df0791 by sunchao

添加日程成功跳回列表页&编辑日程

parent e3079b4b
...@@ -9,8 +9,8 @@ export class TrackQuery { ...@@ -9,8 +9,8 @@ export class TrackQuery {
public referPotentialId?:string, public referPotentialId?:string,
public taskImportantTag?:any, public taskImportantTag?:any,
public isActive?:any, public isActive?:any,
public taskTimeFrom?:Array<any>[], public taskTimeFrom?:Array<any>,
public taskTimeEnd?:Array<any>[], public taskTimeEnd?:Array<any>,
//任务长期固定 //任务长期固定
public taskRoutineAtweek7?:number, public taskRoutineAtweek7?:number,
public taskRoutineAtweek6?:number, public taskRoutineAtweek6?:number,
......
...@@ -35,11 +35,12 @@ export class AddTaskComponent implements OnInit { ...@@ -35,11 +35,12 @@ export class AddTaskComponent implements OnInit {
seasons:Array<any>; seasons:Array<any>;
longTermList:Array<any>; longTermList:Array<any>;
linkToastFlag:boolean = false; linkToastFlag:boolean = false;
taskInfo:any;
constructor(private myService:MyService,private router: Router,private _modal: ModalService, private _toast: ToastService, constructor(private myService:MyService,private router: Router,private _modal: ModalService, private _toast: ToastService,
public lifeCommonService:LifeCommonService,private activateRoute:ActivatedRoute) { public lifeCommonService:LifeCommonService,private activateRoute:ActivatedRoute) {
this.seasons = [ this.seasons = [
{label: '8:00',value:1},{label: '8:30',value:2}, {label: '08:00',value:1},{label: '08:30',value:2},
{label: '9:00',value:3},{label: '9:30', value:4}, {label: '09:00',value:3},{label: '09:30', value:4},
{label: '10:00',value:5},{label: '10:30',value:6}, {label: '10:00',value:5},{label: '10:30',value:6},
{label: '11:00',value:7},{label: '11:30',value:8}, {label: '11:00',value:7},{label: '11:30',value:8},
{label: '12:00',value:9},{label: '12:30',value:10}, {label: '12:00',value:9},{label: '12:30',value:10},
...@@ -55,6 +56,7 @@ export class AddTaskComponent implements OnInit { ...@@ -55,6 +56,7 @@ export class AddTaskComponent implements OnInit {
{label: '22:00',value:29},{label: '22:30',value:30} {label: '22:00',value:29},{label: '22:30',value:30}
]; ];
// console.log(this.router.getCurrentNavigation().extras.state) // console.log(this.router.getCurrentNavigation().extras.state)
this.taskInfo = this.router.getCurrentNavigation().extras.state;
} }
initPara() { initPara() {
...@@ -79,10 +81,25 @@ export class AddTaskComponent implements OnInit { ...@@ -79,10 +81,25 @@ export class AddTaskComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.addTrack.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']; this.addTrack.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
this.tabList = [{code:'bizchance_promotion_action',name:'营销',taskType:1},{code:'team_building_track',name:'增员',taskType:2},{code:'pep_schedule_task_others',name:'其他',taskType:3}]; this.tabList = [{code:'bizchance_promotion_action',name:'营销',taskType:1},{code:'team_building_track',name:'增员',taskType:2},{code:'pep_schedule_task_others',name:'其他',taskType:3}];
this.tabType = 'bizchance_promotion_action'; this.addTrack.referLeadsId = this.activateRoute.snapshot.queryParams['referLeadsId'];
this.addTrack.taskType = 1; this.addTrack.referPotentialId = this.activateRoute.snapshot.queryParams['referPotentialId'];
this.addTrack.customerId = this.activateRoute.snapshot.queryParams['customerId'];
//查询
if(this.taskInfo){
for(let i=0;i<this.tabList.length;i++){
if(this.taskInfo.taskType == this.tabList[i]['taskType']){
this.tabType = this.tabList[i]['code'];
this.addTrack.taskType = this.tabList[i]['taskType'];
this.dropOptionsQuery(this.tabType); this.dropOptionsQuery(this.tabType);
//如果有缓存切换到缓存数据 }
}
this.addTrack = {
...this.taskInfo,
taskTimeFrom:[this.taskInfo.taskTimeFrom],
taskTimeEnd: [this.taskInfo.taskTimeEnd]
};
}else{
//商机页或者增员页跳转过来如果有缓存切换到缓存数据
if(JSON.parse(sessionStorage.getItem('pageDwellDtatus'))){ if(JSON.parse(sessionStorage.getItem('pageDwellDtatus'))){
this.tabType = JSON.parse(sessionStorage.getItem('pageDwellDtatus'))['tabType']; this.tabType = JSON.parse(sessionStorage.getItem('pageDwellDtatus'))['tabType'];
this.addTrack.taskType = JSON.parse(sessionStorage.getItem('pageDwellDtatus'))['taskType']; this.addTrack.taskType = JSON.parse(sessionStorage.getItem('pageDwellDtatus'))['taskType'];
...@@ -91,9 +108,11 @@ export class AddTaskComponent implements OnInit { ...@@ -91,9 +108,11 @@ export class AddTaskComponent implements OnInit {
this.addTrack.mdDropOptionId = JSON.parse(sessionStorage.getItem('pageDwellDtatus'))['mdDropOptionId']; this.addTrack.mdDropOptionId = JSON.parse(sessionStorage.getItem('pageDwellDtatus'))['mdDropOptionId'];
}, 300); }, 300);
}else{ }else{
//新增
this.addTrack.mdDropOptionId = null;
this.tabType = 'bizchance_promotion_action'; this.tabType = 'bizchance_promotion_action';
this.addTrack.taskType = 1; this.addTrack.taskType = 1;
this.addTrack.mdDropOptionId = null; this.dropOptionsQuery(this.tabType);
} }
//如果有日程时间就取缓存没有就默认当天 //如果有日程时间就取缓存没有就默认当天
if(sessionStorage.getItem('trackTime')){ if(sessionStorage.getItem('trackTime')){
...@@ -101,13 +120,14 @@ export class AddTaskComponent implements OnInit { ...@@ -101,13 +120,14 @@ export class AddTaskComponent implements OnInit {
}else{ }else{
this.addTrack.trackTime = dayjs().format('YYYY-MM-DD'); this.addTrack.trackTime = dayjs().format('YYYY-MM-DD');
} }
this.addTrack.referLeadsId = this.activateRoute.snapshot.queryParams['referLeadsId']; this.addTrack.taskTimeFrom = ['08:30'];
this.addTrack.referPotentialId = this.activateRoute.snapshot.queryParams['referPotentialId']; this.addTrack.taskTimeEnd = ['08:30'];
this.addTrack.customerId = this.activateRoute.snapshot.queryParams['customerId']; }
} }
goBack(){ goBack(){
history.go(-1); // history.go(-1);
this.router.navigate(['/todo'])
} }
//判断是否选择同一个tab //判断是否选择同一个tab
...@@ -158,7 +178,6 @@ export class AddTaskComponent implements OnInit { ...@@ -158,7 +178,6 @@ export class AddTaskComponent implements OnInit {
if(type===2){ if(type===2){
this.addTrack.taskTimeEnd = result; this.addTrack.taskTimeEnd = result;
} }
console.log(this.addTrack.taskTimeFrom,this.addTrack.taskTimeEnd);
} }
selectTask(id){ selectTask(id){
...@@ -267,7 +286,6 @@ export class AddTaskComponent implements OnInit { ...@@ -267,7 +286,6 @@ export class AddTaskComponent implements OnInit {
} }
clickAddTask(){ clickAddTask(){
console.log(this.addTrack)
if(!this.addTrack.mdDropOptionId){ if(!this.addTrack.mdDropOptionId){
const toast = ToastService.show('请选择您要添加的日程分类!', 0); const toast = ToastService.show('请选择您要添加的日程分类!', 0);
setTimeout(() => { setTimeout(() => {
...@@ -293,14 +311,26 @@ export class AddTaskComponent implements OnInit { ...@@ -293,14 +311,26 @@ export class AddTaskComponent implements OnInit {
...this.addTrack, ...this.addTrack,
taskImportantTag:this.addTrack.taskImportantTag?1:0, taskImportantTag:this.addTrack.taskImportantTag?1:0,
isActive:1, isActive:1,
taskTimeFrom:this.addTrack.taskTimeFrom[0]['label'], taskTimeFrom:this.addTrack.taskTimeFrom[0]['label']?this.addTrack.taskTimeFrom[0]['label']:this.addTrack.taskTimeFrom[0],
taskTimeEnd:this.addTrack.taskTimeEnd[0]['label'] taskTimeEnd:this.addTrack.taskTimeEnd[0]['label']?this.addTrack.taskTimeEnd[0]['label']:this.addTrack.taskTimeEnd[0]
}
if(trackAdded.taskTimeFrom == trackAdded.taskTimeEnd){
const toast = ToastService.show('任务起始时间不能等于结束时间!', 0);
setTimeout(() => {
ToastService.hide();
}, 3000);
return;
} }
this.myService.addScheduleTrack(trackAdded).subscribe((res)=>{ this.myService.addScheduleTrack(trackAdded).subscribe((res)=>{
const toast = ToastService.show(`${res['message']}`, 0); const toast = ToastService.show(`${res['message']}`, 0);
setTimeout(() => { setTimeout(() => {
ToastService.hide(); ToastService.hide();
}, 3000); }, 3000);
setTimeout(()=>{
if(res['success']){
this.router.navigate(['/todo'])
}
},3000)
}) })
} }
} }
...@@ -67,7 +67,8 @@ export class MyBusinessComponent implements OnInit { ...@@ -67,7 +67,8 @@ export class MyBusinessComponent implements OnInit {
returnAddTask(){ returnAddTask(){
if(this.selectedBusiness){ if(this.selectedBusiness){
const {leadsAssignedId,opportunityId}=this.selectedBusiness; const {leadsAssignedId,opportunityId}=this.selectedBusiness;
this.router.navigate(['/addtask/'], { queryParams: { customerId:opportunityId , referLeadsId: leadsAssignedId },state:this.selectedBusiness}); // this.router.navigate(['/addtask/'], { queryParams: { customerId:opportunityId , referLeadsId: leadsAssignedId },state:this.selectedBusiness});
this.router.navigate(['/addtask/'], { queryParams: { customerId:opportunityId , referLeadsId: leadsAssignedId }});
}else{ }else{
this.toastDialog = true; this.toastDialog = true;
this.toastInfo = { this.toastInfo = {
......
...@@ -173,9 +173,7 @@ ...@@ -173,9 +173,7 @@
<img style="border-radius: 10px;width: 48%;margin-right: 10px;" src="assets/images/yindunvipmember.jpg" <img style="border-radius: 10px;width: 48%;margin-right: 10px;" src="assets/images/yindunvipmember.jpg"
(click)="jumpUrl()"> (click)="jumpUrl()">
<!-- <img style="border-radius: 10px;width: 48%;" src="assets/images/yindunvipmember.jpg" (click)="jumpUrl()"> --> <!-- <img style="border-radius: 10px;width: 48%;" src="assets/images/yindunvipmember.jpg" (click)="jumpUrl()"> -->
</div> </div>
<div class="health_wrapper" style="padding: 12px 10px 12px 10px;"> <div class="health_wrapper" style="padding: 12px 10px 12px 10px;">
<h3 style="margin-bottom: 0;">我的设置 <h3 style="margin-bottom: 0;">我的设置
<span i class="iconfont icon-ar-r" style="font-size:18px;float: right;" routerLink="setting"></span> <span i class="iconfont icon-ar-r" style="font-size:18px;float: right;" routerLink="setting"></span>
......
...@@ -82,7 +82,8 @@ export class RecruitingComponent implements OnInit { ...@@ -82,7 +82,8 @@ export class RecruitingComponent implements OnInit {
returnAddTask(){ returnAddTask(){
if(this.selectedRecruiting){ if(this.selectedRecruiting){
const {potentialId}=this.selectedRecruiting; const {potentialId}=this.selectedRecruiting;
this.router.navigate(['/addtask/'], { queryParams: { referPotentialId: potentialId },state:this.selectedRecruiting}); // this.router.navigate(['/addtask/'], { queryParams: { referPotentialId: potentialId },state:this.selectedRecruiting});
this.router.navigate(['/addtask/'], { queryParams: { referPotentialId: potentialId }});
}else{ }else{
this.toastDialog = true; this.toastDialog = true;
this.toastInfo = { this.toastInfo = {
......
...@@ -17,20 +17,18 @@ export class ScoreDetailsComponent implements OnInit { ...@@ -17,20 +17,18 @@ export class ScoreDetailsComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.selectedTime = 'D'; this.selectedTime = 'D';
this.queryPEPScoreDetail('D');
if(this.activateRoute.snapshot.paramMap.get('practitionerId')){ if(this.activateRoute.snapshot.paramMap.get('practitionerId')){
this.practitionerId = Number(this.activateRoute.snapshot.paramMap.get('practitionerId')); this.practitionerId = Number(this.activateRoute.snapshot.paramMap.get('practitionerId'));
}else{ }else{
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']; this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
} }
this.queryPEPScoreDetail('D');
} }
//销售活动量详情D-天 W-周 M-月 //销售活动量详情D-天 W-周 M-月
queryPEPScoreDetail(time) { queryPEPScoreDetail(time) {
this.selectedTime = time; this.selectedTime = time;
const practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']; this.myService.queryPEPScoreDetail({ practitionerId: this.practitionerId, time: this.selectedTime }).subscribe((res) => {
this.myService.queryPEPScoreDetail({ practitionerId: practitionerId, time: this.selectedTime }).subscribe((res) => {
if (res['success']) { if (res['success']) {
this.salesScoreDetails = res['data']['detail']; this.salesScoreDetails = res['data']['detail'];
this.chartOption ={ this.chartOption ={
...@@ -49,18 +47,18 @@ export class ScoreDetailsComponent implements OnInit { ...@@ -49,18 +47,18 @@ export class ScoreDetailsComponent implements OnInit {
{ {
name: 'PEP得分', name: 'PEP得分',
type: 'pie', type: 'pie',
radius: ['20%', '40%'], radius: ['25%', '45%'],
avoidLabelOverlap: true, avoidLabelOverlap: true,
label: { label: {
show: true, show: true,
position: 'outside', position: 'outside',
//显示的标签的内容 //显示的标签的内容
formatter: "{b}:{c}分", formatter: "{b}:{c}分 ({d}%)",
}, },
emphasis: { emphasis: {
label: { label: {
show: true, show: true,
fontSize: '18', fontSize: '14',
fontWeight: 'bold' fontWeight: 'bold'
} }
}, },
......
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
*ngIf="personalList?.length <=0"> *ngIf="personalList?.length <=0">
暂无战队成员,努力去增员吧 暂无战队成员,努力去增员吧
</div> </div>
<ul *ngFor="let personalItem of personalList;index as i;"> <ul *ngFor="let personalItem of personalList;index as i;" [routerLink]="['/scoreDeatil',personalItem.practitionerId]">
<li><span> {{i + 1}} </span> <li><span> {{i + 1}} </span>
{{personalItem.name}}</li> {{personalItem.name}}</li>
<li class="day">{{personalItem.dayScore}}</li> <li class="day">{{personalItem.dayScore}}</li>
<li>{{personalItem.weekScore}}</li> <li>{{personalItem.weekScore}}</li>
<li>{{personalItem.monthScore}}</li> <li>{{personalItem.monthScore}}</li>
<li>{{personalItem.rate}}</li> <li>{{personalItem.rate}}</li>
<li><i class="iconfont icon-ar-r" style="color: #A4A4A4FF;font-size: 12px;" [routerLink]="['/scoreDeatil',personalItem.practitionerId]"></i></li> <li><i class="iconfont icon-ar-r" style="color: #A4A4A4FF;font-size: 12px;" ></i></li>
</ul> </ul>
</div> </div>
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
<div class="taskContent"> <div class="taskContent">
<div class="title">任务数量({{taskList?.length}})</div> <div class="title">任务数量({{taskList?.length}})</div>
<ul> <ul>
<li *ngFor="let taskItem of taskList" (click)="deleteScheduleTrackById(taskItem.id)"> <li *ngFor="let taskItem of taskList" >
<div class="content_wrapper"> <div class="content_wrapper">
<div class="content_card"> <div class="content_card" (click)="editeTask(taskItem,'edit')">
<span>{{taskItem.taskTimeFrom}} - {{taskItem.taskTimeEnd}}</span> <span>{{taskItem.taskTimeFrom}} - {{taskItem.taskTimeEnd}}</span>
<div class="todo_title"> <div class="todo_title">
<span *ngIf="taskItem.taskImportantTag==1">(重要)</span> <span *ngIf="taskItem.taskImportantTag==1">(重要)</span>
...@@ -58,7 +58,9 @@ ...@@ -58,7 +58,9 @@
<div class="notice">{{taskItem.notice}}</div> <div class="notice">{{taskItem.notice}}</div>
</div> </div>
<div class="red" *ngIf="taskItem.taskImportantTag==1"></div> <div class="red" *ngIf="taskItem.taskImportantTag==1"></div>
<div class="iconfont icon-shanchu1" (click)="editeTask(taskItem,'delete')"></div>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
......
...@@ -122,6 +122,13 @@ ul,ol{ ...@@ -122,6 +122,13 @@ ul,ol{
z-index: 9; z-index: 9;
border-radius: 8px; border-radius: 8px;
} }
.iconfont{
position: absolute;
right: 5px;
z-index: 20;
font-size: 24px;
top: 35%;
}
} }
} }
......
...@@ -3,6 +3,7 @@ import { LifeCommonService } from '../../common/life-common.service'; ...@@ -3,6 +3,7 @@ import { LifeCommonService } from '../../common/life-common.service';
import {MyService} from '../my.service'; import {MyService} from '../my.service';
import * as dayjs from 'dayjs'; import * as dayjs from 'dayjs';
import { ModalService, ToastService } from 'ng-zorro-antd-mobile'; import { ModalService, ToastService } from 'ng-zorro-antd-mobile';
import { Router,ActivatedRoute } from "@angular/router";
@Component({ @Component({
selector: 'ydlife-todo-list', selector: 'ydlife-todo-list',
...@@ -31,7 +32,8 @@ export class TodoListComponent implements OnInit { ...@@ -31,7 +32,8 @@ export class TodoListComponent implements OnInit {
onSelect: undefined, onSelect: undefined,
} }
practitionerId:number; practitionerId:number;
constructor(public lifeCommonService: LifeCommonService,private myService:MyService,private _modal: ModalService, private _toast: ToastService) { constructor(public lifeCommonService: LifeCommonService,private myService:MyService,
private _modal: ModalService, private _toast: ToastService,private router:Router) {
this.taskTimeList = [ this.taskTimeList = [
{id:1,time:'8:00'}, {id:1,time:'8:00'},
{id:2,time:'9:00'}, {id:2,time:'9:00'},
...@@ -53,17 +55,23 @@ export class TodoListComponent implements OnInit { ...@@ -53,17 +55,23 @@ export class TodoListComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
//进页面清除上次缓存的时间
sessionStorage.removeItem("trackTime");
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']; this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
this.weekArr = this.lifeCommonService.makeDate(); this.weekArr = this.lifeCommonService.makeDate();
if(sessionStorage.getItem('trackTime')){
this.trackTime = sessionStorage.getItem('trackTime');
this.weekArr = this.lifeCommonService.makeDate(this.trackTime);
}else{
//初始化追踪时间为今天 //初始化追踪时间为今天
this.trackTime = dayjs().format('YYYY-MM-DD'); this.trackTime = dayjs().format('YYYY-MM-DD');
}
this.queryScheduleTrackList(); this.queryScheduleTrackList();
} }
goBack(){ goBack(){
history.go(-1) // history.go(-1)
//离开页面清除上次缓存的时间
sessionStorage.removeItem("trackTime");
this.router.navigate(['/my']);
} }
selectDay(weekItem){ selectDay(weekItem){
...@@ -129,11 +137,11 @@ export class TodoListComponent implements OnInit { ...@@ -129,11 +137,11 @@ export class TodoListComponent implements OnInit {
} }
//删除日程 //删除日程
deleteScheduleTrackById(scheduleTrackId){ deleteScheduleTrackById(taskItem){
ModalService.alert('删除该项日程', '', [ ModalService.alert('删除该项日程', '', [
{ text: '取消', onPress: () => console.log('取消') }, { text: '取消', onPress: () => console.log('取消') },
{ text: '确定', onPress: () => { text: '确定', onPress: () =>
this.myService.deleteScheduleTrackById({scheduleTrackId:scheduleTrackId}).subscribe((res)=>{ this.myService.deleteScheduleTrackById({scheduleTrackId:taskItem.id,taskType:taskItem.taskType}).subscribe((res)=>{
if(res['success']){ if(res['success']){
this.queryScheduleTrackList(); this.queryScheduleTrackList();
}else{ }else{
...@@ -146,4 +154,12 @@ export class TodoListComponent implements OnInit { ...@@ -146,4 +154,12 @@ export class TodoListComponent implements OnInit {
} }
]); ]);
} }
editeTask(taskInfo,type){
if(type == 'edit'){
this.router.navigate(['/addtask'], {state:taskInfo})
}else{
this.deleteScheduleTrackById(taskInfo);
}
}
} }
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