Commit f64669d8 by sunchao

关联商机

parent 5b8afa93
...@@ -234,32 +234,36 @@ export class LifeCommonService { ...@@ -234,32 +234,36 @@ export class LifeCommonService {
//获取本周日期 //获取本周日期
makeDate() { makeDate() {
var date = new Date(); var date = new Date();
var year = date.getFullYear();
var month = date.getMonth(); var month = date.getMonth();
var week = date.getDay(); var week = date.getDay();
// if(week ==0){
// week = 7;
// }
var month = month + 1; var month = month + 1;
//获取今天是几号
var day = date.getDate(); var day = date.getDate();
// 本周内今天的前几天的数量 // 本周内今天的前几天的数量
var leftNum = week - 1; var leftNum = week;
// 本周内今天的后几天的数量 // 本周内今天的后几天的数量
var rightNum = 7 - week; var rightNum = 6 - week;
// 本周内今天的前几天 // 本周内今天的前几天
for (var i = 0; i < leftNum; i++) { for (var i = 1; i <= leftNum; i++) {
this.weekArr[i].week = week - (week - i) + 1; this.weekArr[i].week = week- i
if (i == 0) { this.weekArr[i].day = day - i;
this.weekArr[i].day = day - week; this.weekArr[i]['date'] = year + '-' + (month>9?month:'0'+month) + '-' + (day - i);
} else {
this.weekArr[i].day = day - (week - i) + 1;
}
} }
// 本周内今天的后几天 // 本周内今天的后几天
for (var i = 0; i < rightNum; i++) { for (var i = 1; i <= rightNum; i++) {
this.weekArr[i + week].week = week + i + 1; this.weekArr[i + week].week = week + i ;
this.weekArr[i + week].day = day + i + 1; this.weekArr[i + week].day = day + i ;
this.weekArr[i + week]['date'] = year + '-' + (month>9?month:'0'+month) + '-' + (day + i);
} }
// 今天 // 今天
this.weekArr[week - 1].week = week; this.weekArr[week].week = week;
this.weekArr[week - 1].day = day; this.weekArr[week].day = day;
this.weekArr[week - 1].selected = true; this.weekArr[week]['date'] = year + '-' + (month>9?month:'0'+month) + '-' + day;
this.weekArr[week].selected = true;
return this.weekArr; return this.weekArr;
} }
...@@ -283,7 +287,7 @@ export class LifeCommonService { ...@@ -283,7 +287,7 @@ export class LifeCommonService {
if(str==6){ if(str==6){
return '周六'; return '周六';
} }
if(str ==7){ if(str ==0){
return '周日'; return '周日';
} }
} }
......
<div class="todo_wrapper"> <div class="todo_wrapper">
<!-- <div Button (onClick)="showAlert()">customized buttons</div> -->
<div class="top"> <div class="top">
<div class="head"> <div class="head">
<h3 (click)="goBack()">&lt;</h3> <h3 (click)="goBack()">&lt;</h3>
<h3>新建日程</h3> <h3>新建日程</h3>
<div class="am-demo-page"> <div id="add_calendar_wrapper">
<List className="calendar-list" style="backgroundColor: 'white'"> <List className="calendar-list" style="backgroundColor: 'white'">
<ListItem [arrow]="'horizontal'" (onClick)="onClick_0()"> <ListItem (onClick)="clickCalendar()">
{{this.state.en ? '日历' : '日历'}} {{this.state.en ? '日历' : '日历'}}
</ListItem> </ListItem>
<ListItem *ngIf="this.state.startDate">
Time1: {{this.state.startDate.toLocaleString()}}
</ListItem>
<ListItem *ngIf="this.state.endDate">
Time2: {{this.state.endDate.toLocaleString()}}
</ListItem>
</List> </List>
<ng-template #_switch>
<Switch className="right" [checked]="!this.state.en" (onChange)="this.changeLanguage()"></Switch>
</ng-template>
<Calendar [(ngModel)]="this.state.date" <Calendar [(ngModel)]="this.state.date"
[locale]="this.state.en ? 'enUS' : 'zhCN'"
[enterDirection]="this.state.enterDirection"
[visible]="this.state.show" [visible]="this.state.show"
[getDateExtra]="this.state.getDateExtra" [getDateExtra]="this.state.getDateExtra"
[defaultDate]="this.state.now" [defaultDate]="this.state.now"
[minDate]="this.state.minDate"
[maxDate]="this.state.maxDate"
[pickTime]="this.state.pickTime" [pickTime]="this.state.pickTime"
[type]="this.state.type" [type]="this.state.type"
[rowSize]="this.state.rowSize" [rowSize]="this.state.rowSize"
...@@ -35,7 +23,6 @@ ...@@ -35,7 +23,6 @@
[onSelect]="this.state.onSelect" [onSelect]="this.state.onSelect"
(onCancel)="triggerCancel()" (onCancel)="triggerCancel()"
(onConfirm)="triggerConfirm($event)" (onConfirm)="triggerConfirm($event)"
(onSelectHasDisableDate)="triggerSelectHasDisableDate($event)"
></Calendar> ></Calendar>
</div> </div>
</div> </div>
...@@ -82,7 +69,7 @@ ...@@ -82,7 +69,7 @@
</div> </div>
<div class="footer">添加任务</div> <div class="footer">添加任务</div>
</div> </div>
<div class="link_totast_wrapper" *ngIf="linkToastFlag"> <!-- <div class="link_totast_wrapper" *ngIf="linkToastFlag">
<div class="link_mask"></div> <div class="link_mask"></div>
<div class="link_totast_content_wrapper"> <div class="link_totast_content_wrapper">
<div class="link_content"> <div class="link_content">
...@@ -99,4 +86,4 @@ ...@@ -99,4 +86,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
...@@ -12,6 +12,7 @@ ul,ol{ ...@@ -12,6 +12,7 @@ ul,ol{
align-items: center; align-items: center;
padding: 0 8px; padding: 0 8px;
margin-bottom: 8px; margin-bottom: 8px;
} }
.nav{ .nav{
display: flex; display: flex;
......
...@@ -2,25 +2,7 @@ import { Component, OnInit } from '@angular/core'; ...@@ -2,25 +2,7 @@ import { Component, OnInit } from '@angular/core';
import {MyService} from '../my.service'; import {MyService} from '../my.service';
import { ModalService, ToastService } from 'ng-zorro-antd-mobile'; import { ModalService, ToastService } from 'ng-zorro-antd-mobile';
import { Router } from "@angular/router"; import { Router } from "@angular/router";
const extra = { import {LifeCommonService} from '../../common/life-common.service';
'2017/07/15': { info: 'Disable', disable: true }
};
const now = new Date();
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 5)] = { info: 'Disable', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 6)] = { info: 'Disable', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 7)] = { info: 'Disable', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 8)] = { info: 'Disable', disable: true };
for (let key in extra) {
if (extra.hasOwnProperty(key)) {
let info = extra[key];
const date = new Date(key);
if (!Number.isNaN(+date) && !extra[+date]) {
extra[+date] = info;
}
}
}
@Component({ @Component({
selector: 'ydlife-add-task', selector: 'ydlife-add-task',
...@@ -34,18 +16,15 @@ export class AddTaskComponent implements OnInit { ...@@ -34,18 +16,15 @@ export class AddTaskComponent implements OnInit {
show: false, show: false,
pickTime: false, pickTime: false,
now: new Date(), now: new Date(),
type: 'range', type: 'one',
enterDirection: '', enterDirection: '',
rowSize: 'normal', rowSize: 'normal',
showShortcut: false, showShortcut: false,
infinite: true, infinite: true,
defaultValue: undefined, defaultValue: undefined,
minDate: new Date(+now - 5184000000), minDate: new Date(+new Date() - 5184000000),
maxDate: new Date(+now + 31536000000), maxDate: new Date(+new Date() + 31536000000),
onSelect: undefined, onSelect: undefined,
getDateExtra: date => {
return extra[+date];
}
} }
tabList:Array<any>; tabList:Array<any>;
tabType:string; tabType:string;
...@@ -60,7 +39,9 @@ export class AddTaskComponent implements OnInit { ...@@ -60,7 +39,9 @@ export class AddTaskComponent implements OnInit {
notice:string; notice:string;
linkToastFlag:boolean = false; linkToastFlag:boolean = false;
totastTitle:string; totastTitle:string;
constructor(private myService:MyService,private router: Router) { trackTime:any;
constructor(private myService:MyService,private router: Router,private _modal: ModalService, private _toast: ToastService,
public lifeCommonService:LifeCommonService) {
this.seasons = [ this.seasons = [
{label: '8:00',id:1}, {label: '8:00',id:1},
{label: '8:30',id:2}, {label: '8:30',id:2},
...@@ -101,7 +82,7 @@ export class AddTaskComponent implements OnInit { ...@@ -101,7 +82,7 @@ export class AddTaskComponent implements OnInit {
{name:'周六',isLongTermTask:false}, {name:'周六',isLongTermTask:false},
{name:'周日',isLongTermTask:false} {name:'周日',isLongTermTask:false}
]; ];
// console.log(this.router.getCurrentNavigation().extras.state)
} }
initPara() { initPara() {
...@@ -112,18 +93,13 @@ export class AddTaskComponent implements OnInit { ...@@ -112,18 +93,13 @@ export class AddTaskComponent implements OnInit {
date: null, date: null,
pickTime: false, pickTime: false,
now: new Date(), now: new Date(),
type: 'range', type: 'one',
rowSize: 'normal', rowSize: 'normal',
infinite: true, infinite: true,
enterDirection: '', enterDirection: '',
onSelect: undefined, onSelect: undefined,
showShortcut: false, showShortcut: false,
defaultValue: undefined, defaultValue: undefined,
minDate: new Date(+now - 5184000000),
maxDate: new Date(+now + 31536000000),
getDateExtra: date => {
return extra[+date];
}
} }
}; };
} }
...@@ -131,17 +107,44 @@ export class AddTaskComponent implements OnInit { ...@@ -131,17 +107,44 @@ export class AddTaskComponent implements OnInit {
ngOnInit() { ngOnInit() {
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.tabType = 'bizchance_promotion_action';
this.dropOptionsQuery(this.tabType) this.dropOptionsQuery(this.tabType);
//如果有缓存切换到缓存数据
if(JSON.parse(sessionStorage.getItem('pageDwellDtatus'))){
this.tabType = JSON.parse(sessionStorage.getItem('pageDwellDtatus'))['tabType'];
this.dropOptionsQuery(this.tabType);
this.mdDropOptionId = JSON.parse(sessionStorage.getItem('pageDwellDtatus'))['mdDropOptionId'];
}else{
this.tabType = 'bizchance_promotion_action';
this.mdDropOptionId = null;
}
} }
goBack(){ goBack(){
history.go(-1); history.go(-1);
} }
//判断是否选择同一个tab
selectTab(code,taskType){ selectTab(code,taskType){
this.tabType = code; let pageDwellDtatus = {};
this.taskType = taskType; if(this.tabType == code){
this.dropOptionsQuery(this.tabType); pageDwellDtatus = {
tabType:this.tabType,
mdDropOptionId:this.mdDropOptionId,
taskType:this.taskType
}
sessionStorage.setItem('pageDwellDtatus',JSON.stringify(pageDwellDtatus));
}else{
this.tabType = code;
this.taskType = taskType;
this.mdDropOptionId = null;
this.dropOptionsQuery(this.tabType);
pageDwellDtatus = {
tabType:this.tabType,
mdDropOptionId:null,
taskType:this.taskType
}
sessionStorage.setItem('pageDwellDtatus',JSON.stringify(pageDwellDtatus));
}
} }
dropOptionsQuery(code){ dropOptionsQuery(code){
...@@ -151,6 +154,7 @@ export class AddTaskComponent implements OnInit { ...@@ -151,6 +154,7 @@ export class AddTaskComponent implements OnInit {
} }
}) })
} }
onChange(result,type) { onChange(result,type) {
if(type===1){ if(type===1){
this.taskTimeFrom = result; this.taskTimeFrom = result;
...@@ -164,14 +168,37 @@ export class AddTaskComponent implements OnInit { ...@@ -164,14 +168,37 @@ export class AddTaskComponent implements OnInit {
selectTask(id){ selectTask(id){
this.mdDropOptionId=id; this.mdDropOptionId=id;
const pageDwellDtatus = {
tabType:this.tabType,
mdDropOptionId:this.mdDropOptionId,
taskType:this.taskType
}
sessionStorage.setItem('pageDwellDtatus',JSON.stringify(pageDwellDtatus));
if(this.tabType == 'bizchance_promotion_action' ){ if(this.tabType == 'bizchance_promotion_action' ){
this.linkToastFlag = true; // this.linkToastFlag = true;
this.totastTitle = '商机'; this.totastTitle = '商机';
} }
if(this.tabType == 'team_building_track'){ if(this.tabType == 'team_building_track'){
this.linkToastFlag = true; // this.linkToastFlag = true;
this.totastTitle = '增员'; this.totastTitle = '增员';
} }
ModalService.alert(`是否联系到${this.totastTitle}`, '', [
{ text: '否', onPress: () => this.linkToastFlag=false,
style: {
borderTop:'1px #ddd solid'
}
},
{ text: '是', onPress: () => this.jumpToLink(),
style: {
color: '#f8002e',
background: '',
borderLeft:'1px #ddd solid',
borderTop:'1px #ddd solid'
}
},
]);
} }
getValue(result) { getValue(result) {
let value = []; let value = [];
...@@ -183,10 +210,9 @@ export class AddTaskComponent implements OnInit { ...@@ -183,10 +210,9 @@ export class AddTaskComponent implements OnInit {
return value; return value;
} }
onClick_0() { clickCalendar(){
this.initPara(); this.initPara();
this.state.show = true; this.state.show = true;
this.state.type = 'one';
this.state.date = new Date(); this.state.date = new Date();
} }
...@@ -194,9 +220,25 @@ export class AddTaskComponent implements OnInit { ...@@ -194,9 +220,25 @@ export class AddTaskComponent implements OnInit {
this.state.show = false; this.state.show = false;
} }
triggerConfirm(value) {
const { startDate, endDate } = value;
this.state = {
...this.state,
...{ show: false, startDate, endDate }
};
this.triggerCancel();
this.trackTime = this.lifeCommonService.dateFormat(startDate,"yyyy-MM-dd")
console.log(this.trackTime);
}
jumpToLink(){ jumpToLink(){
if(this.tabType == 'bizchance_promotion_action'){ if(this.tabType == 'bizchance_promotion_action'){
this.router.navigate(['/linkbusiness']) this.router.navigate(['/linkbusiness'])
} }
if(this.tabType == 'team_building_track'){
this.router.navigate(['/linkrecruiting'])
}
} }
} }
...@@ -17,17 +17,18 @@ ...@@ -17,17 +17,18 @@
<div></div> <div></div>
</div> --> </div> -->
<div class="salesItem" *ngFor="let businessItem of showBusinessList" <div class="salesItem" *ngFor="let businessItem of showBusinessList"
(click)="isJumpToDetail(businessItem.opportunityId,businessItem.orderId,businessItem.leadsAssignedId)"> (click)="isJumpToDetail(businessItem.opportunityId,businessItem.orderId,businessItem.leadsAssignedId,businessItem)">
<div *ngIf="pageType=='business'" class="icon_bolck" [ngStyle]="{'background':businessItem.expertType=='1'? '#ddd' : 'none'}"> <div *ngIf="pageType=='business'" class="icon_bolck" [ngStyle]="{'background':businessItem.expertType=='1'? '#ddd' : 'none'}">
<span class="iconfont icon-xiansuo1" *ngIf="businessItem.expertType=='0'"></span> <span class="iconfont icon-xiansuo1" *ngIf="businessItem.expertType=='0'"></span>
<span class="iconfont icon-zhuanjia" style="color: #093d9b;" *ngIf="businessItem.expertType=='1'"></span> <span class="iconfont icon-zhuanjia" style="color: #093d9b;" *ngIf="businessItem.expertType=='1'"></span>
</div> </div>
<div *ngIf="pageType=='linkbusiness'" class="linkbusinessRadius"> <div *ngIf="pageType=='linkbusiness'" class="linkbusinessRadius">
<span class='circlebtn'></span> <span class='circlebtn' *ngIf="selectedBusiness?.leadsAssignedId != businessItem.leadsAssignedId"></span>
<img src="assets/images/gou_icon.png" style="position: absolute;width: 100%;" *ngIf="selectedBusiness?.leadsAssignedId == businessItem.leadsAssignedId">
</div> </div>
<div class="line"> <div class="line">
<div>姓名:{{businessItem.name}}</div> <div>姓名:{{businessItem.name}}</div>
<span class="iconfont icon-ar-r" style="font-size: 10px;position: relative; right: -2px;"></span> <span class="iconfont icon-ar-r" style="font-size: 10px;position: relative; right: -2px;" *ngIf="pageType=='business'"></span>
</div> </div>
<div class="line"> <div class="line">
<div> 手机号:{{businessItem.mobileNo}}</div> <div> 手机号:{{businessItem.mobileNo}}</div>
...@@ -39,10 +40,11 @@ ...@@ -39,10 +40,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="footer"> <div class="footer" *ngIf="pageType=='linkbusiness'" (click)="returnAddTask()">
确认 确认
</div> </div>
<div class="add" *ngIf="pageType=='business'"> <div class="add" *ngIf="pageType=='business'">
<i class="iconfont icon-jiahao" (click)="addBussiness()"></i> <i class="iconfont icon-jiahao" (click)="addBussiness()"></i>
</div> </div>
</div> </div>
\ No newline at end of file <ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
\ No newline at end of file
...@@ -2,15 +2,12 @@ import { Component, OnInit } from '@angular/core'; ...@@ -2,15 +2,12 @@ import { Component, OnInit } from '@angular/core';
import { MyService } from '../my.service'; import { MyService } from '../my.service';
import { LifeCommonService } from '../../common/life-common.service'; import { LifeCommonService } from '../../common/life-common.service';
import { Router , ActivatedRoute} from "@angular/router"; import { Router , ActivatedRoute} from "@angular/router";
import {Location} from '@angular/common';
@Component({ @Component({
selector: 'ydlife-my-business', selector: 'ydlife-my-business',
templateUrl: './my-business.component.html', templateUrl: './my-business.component.html',
styleUrls: ['./my-business.component.scss'], styleUrls: ['./my-business.component.scss'],
styles: [
`.am-demo-bd div{
border-bottom: none;
}
`]
}) })
export class MyBusinessComponent implements OnInit { export class MyBusinessComponent implements OnInit {
businessList: Array<any>; businessList: Array<any>;
...@@ -18,7 +15,11 @@ export class MyBusinessComponent implements OnInit { ...@@ -18,7 +15,11 @@ export class MyBusinessComponent implements OnInit {
pageType:any; pageType:any;
showBusinessList: Array<any>; showBusinessList: Array<any>;
isSelectFlag:boolean; isSelectFlag:boolean;
constructor(private myService: MyService, public lifeCommonService: LifeCommonService, private router: Router,private activatedRoute: ActivatedRoute) { selectedBusiness:any;
//控制弹框
toastDialog: boolean;
toastInfo: any;
constructor(private myService: MyService, public lifeCommonService: LifeCommonService, private router: Router,private activatedRoute: ActivatedRoute,private location:Location) {
this.pageType = this.activatedRoute.snapshot.data[0]['type']; this.pageType = this.activatedRoute.snapshot.data[0]['type'];
} }
...@@ -43,11 +44,16 @@ export class MyBusinessComponent implements OnInit { ...@@ -43,11 +44,16 @@ export class MyBusinessComponent implements OnInit {
this.router.navigate(['/business/0']); this.router.navigate(['/business/0']);
} }
isJumpToDetail(opportunityId,orderId,leadsAssignedId){ isJumpToDetail(opportunityId,orderId,leadsAssignedId,businessItem?:any){
if(this.pageType == 'business'){ if(this.pageType == 'business'){
this.router.navigate([`/business/${opportunityId}`], { queryParams: { orderId: orderId, leadsAssignedId: leadsAssignedId } }); this.router.navigate([`/business/${opportunityId}`], { queryParams: { orderId: orderId, leadsAssignedId: leadsAssignedId } });
}else{ }else{
return; if(!this.selectedBusiness){
this.selectedBusiness = businessItem;
}else{
this.selectedBusiness = undefined;
}
return;
} }
} }
...@@ -56,4 +62,20 @@ export class MyBusinessComponent implements OnInit { ...@@ -56,4 +62,20 @@ export class MyBusinessComponent implements OnInit {
return item.name.indexOf(event) !=-1; return item.name.indexOf(event) !=-1;
}) })
} }
returnAddTask(){
if(this.selectedBusiness){
const {leadsAssignedId,opportunityId}=this.selectedBusiness;
this.router.navigate(['/addtask/'], { queryParams: { customerId:opportunityId , referLeadsId: leadsAssignedId },state:this.selectedBusiness});
}else{
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg:'请选择您需要关联的商机!',
timeout: 3000,
align: 'center'
};
return;
}
}
} }
...@@ -42,7 +42,8 @@ const myRoutes: Routes = [ ...@@ -42,7 +42,8 @@ const myRoutes: Routes = [
{ path: 'business/:id', component: MyBusinessDetailComponent, canActivate: [AuthGuard] }, { path: 'business/:id', component: MyBusinessDetailComponent, canActivate: [AuthGuard] },
{ path: 'rank', component: SalesRankComponent, canActivate: [AuthGuard] }, { path: 'rank', component: SalesRankComponent, canActivate: [AuthGuard] },
{ path: 'teamRank', component: TeamRankComponent, canActivate: [AuthGuard] }, { path: 'teamRank', component: TeamRankComponent, canActivate: [AuthGuard] },
{ path: 'recruiting', component: RecruitingComponent, canActivate: [AuthGuard] }, { path: 'recruiting', component: RecruitingComponent, canActivate: [AuthGuard] ,data:[{type:'recruiting'}]},
{ path: 'linkrecruiting', component: RecruitingComponent, canActivate: [AuthGuard] ,data:[{type:'linkrecruiting'}]},
{ path: 'recruiting/:id', component: RecruitingDetailComponent, canActivate: [AuthGuard] }, { path: 'recruiting/:id', component: RecruitingDetailComponent, canActivate: [AuthGuard] },
{ path: 'thanks', component: ThanksComponent, canActivate: [AuthGuard] }, { path: 'thanks', component: ThanksComponent, canActivate: [AuthGuard] },
{ path: 'setting', component: MySettingComponent, canActivate: [AuthGuard] }, { path: 'setting', component: MySettingComponent, canActivate: [AuthGuard] },
......
...@@ -3,7 +3,27 @@ ...@@ -3,7 +3,27 @@
<div class="head"> <div class="head">
<h3 (click)="goBack()">&lt;</h3> <h3 (click)="goBack()">&lt;</h3>
<h3>今日任务</h3> <h3>今日任务</h3>
<div>日历</div> <div id="add_calendar_wrapper">
<List className="calendar-list" style="backgroundColor: 'white'">
<ListItem (onClick)="clickCalendar()">
{{this.state.en ? '日历' : '日历'}}
</ListItem>
</List>
<Calendar [(ngModel)]="this.state.date"
[visible]="this.state.show"
[getDateExtra]="this.state.getDateExtra"
[defaultDate]="this.state.now"
[pickTime]="this.state.pickTime"
[type]="this.state.type"
[rowSize]="this.state.rowSize"
[showShortcut]="this.state.showShortcut"
[infinite]="this.state.infinite"
[defaultValue]="this.state.defaultValue"
[onSelect]="this.state.onSelect"
(onCancel)="triggerCancel()"
(onConfirm)="triggerConfirm($event)"
></Calendar>
</div>
</div> </div>
<ul class="week"> <ul class="week">
<li *ngFor="let weekItem of weekArr;index as i;" [ngClass]="{'selected':weekItem.selected}" (click)="selectDay(weekItem)"> <li *ngFor="let weekItem of weekArr;index as i;" [ngClass]="{'selected':weekItem.selected}" (click)="selectDay(weekItem)">
...@@ -27,17 +47,22 @@ ...@@ -27,17 +47,22 @@
<div class="title">任务数量({{taskList.length}})</div> <div class="title">任务数量({{taskList.length}})</div>
<ul> <ul>
<li *ngFor="let taskItem of taskList"> <li *ngFor="let taskItem of taskList">
<span>{{taskItem.taskTimeFrom}} - {{taskItem.taskTimeEnd}}</span> <div class="content_wrapper">
<div class="todo_title"> <div class="content_card">
<span *ngIf="taskItem.taskImportantTag">(重要)</span> <span>{{taskItem.taskTimeFrom}} - {{taskItem.taskTimeEnd}}</span>
{{taskItem.mdDropOptionName}} <div class="todo_title">
<span *ngIf="taskItem.taskImportantTag">(重要)</span>
{{taskItem.mdDropOptionName}}
</div>
<div class="notice">{{taskItem.notice}}</div>
</div>
<div class="red" ></div>
</div> </div>
<div class="notice">{{taskItem.notice}}</div>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="addBtn" (click)="addTask()" [ngStyle]="{'background':taskList?.length? '#ff002b' : '#eb6100','bottom':taskList?.length?'4%':'-15%'}" [routerLink]="['/addtask']"> <div class="addBtn" [ngStyle]="{'background':taskList?.length? '#ff002b' : '#eb6100','bottom':taskList?.length?'4%':'-15%'}" [routerLink]="['/addtask']">
<i class="iconfont icon-jiahao" ></i> <i class="iconfont icon-jiahao" ></i>
</div> </div>
</div> </div>
......
...@@ -3,7 +3,8 @@ ul,ol{ ...@@ -3,7 +3,8 @@ ul,ol{
} }
.todo_wrapper{ .todo_wrapper{
.top{ .top{
margin-bottom: 20px; padding-bottom: 20px;
background: #fff;
.head{ .head{
display: flex; display: flex;
height: 50px; height: 50px;
...@@ -93,18 +94,35 @@ ul,ol{ ...@@ -93,18 +94,35 @@ ul,ol{
ul { ul {
margin-top: 15px; margin-top: 15px;
li{ li{
background: #fff;
padding: 8px 12px;
border-radius: 10px;
margin-bottom: 10px; margin-bottom: 10px;
.todo_title{ .content_wrapper{
font-size: 16px; position: relative;
color: #000; .content_card{
font-weight: bold; background: #fff;
margin: 3px auto; padding: 8px 12px;
} border-radius: 10px;
.notice{ position: relative;
color: #a0a0a0; z-index: 10;
.todo_title{
font-size: 16px;
color: #000;
font-weight: bold;
margin: 3px auto;
}
.notice{
color: #a0a0a0;
}
}
.red{
width: 90%;
height: 79%;
background-color: red;
position: absolute;
top: 12%;
margin-left: -1.5%;
z-index: 9;
border-radius: 8px;
}
} }
} }
......
...@@ -11,6 +11,23 @@ export class TodoListComponent implements OnInit { ...@@ -11,6 +11,23 @@ export class TodoListComponent implements OnInit {
weekArr: Array<any>; weekArr: Array<any>;
taskList:Array<any> = []; taskList:Array<any> = [];
taskTimeList:Array<any> = []; taskTimeList:Array<any> = [];
trackDate:string;
state: any = {
en: false,
date: null,
show: false,
pickTime: false,
now: new Date(),
type: 'one',
enterDirection: '',
rowSize: 'normal',
showShortcut: false,
infinite: true,
defaultValue: undefined,
minDate: new Date(+new Date() - 5184000000),
maxDate: new Date(+new Date() + 31536000000),
onSelect: undefined,
}
constructor(public lifeCommonService: LifeCommonService,private myService:MyService) { constructor(public lifeCommonService: LifeCommonService,private myService:MyService) {
this.taskTimeList = [ this.taskTimeList = [
{id:1,time:'8:00'}, {id:1,time:'8:00'},
...@@ -30,6 +47,11 @@ export class TodoListComponent implements OnInit { ...@@ -30,6 +47,11 @@ export class TodoListComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.weekArr = this.lifeCommonService.makeDate(); this.weekArr = this.lifeCommonService.makeDate();
for(let i=0;i<this.weekArr.length;i++){
if(this.weekArr[i]['selected'] == true){
this.trackDate = this.weekArr[i]['date'];
}
}
this.queryScheduleTrackList(); this.queryScheduleTrackList();
} }
...@@ -42,17 +64,62 @@ export class TodoListComponent implements OnInit { ...@@ -42,17 +64,62 @@ export class TodoListComponent implements OnInit {
this.weekArr[i].selected = false; this.weekArr[i].selected = false;
if(weekItem.day == this.weekArr[i]['day']){ if(weekItem.day == this.weekArr[i]['day']){
this.weekArr[i].selected = true; this.weekArr[i].selected = true;
this.trackDate = this.weekArr[i]['date'];
} }
} }
this.queryScheduleTrackList();
}
initPara() {
this.state = {
...this.state,
...{
show: false,
date: null,
pickTime: false,
now: new Date(),
type: 'one',
rowSize: 'normal',
infinite: true,
enterDirection: '',
onSelect: undefined,
showShortcut: false,
defaultValue: undefined,
}
};
}
clickCalendar(){
this.initPara();
this.state.show = true;
this.state.date = new Date();
}
triggerCancel() {
this.state.show = false;
} }
addTask(){ triggerConfirm(value) {
// this.taskList.push({time:'8:00-9:00',isImportant:true,taskTitle:'今天要完成的计划1',taskContent:'app界面和网页界面的设计'}); const { startDate, endDate } = value;
this.state = {
...this.state,
...{ show: false, startDate, endDate }
};
this.triggerCancel();
this.trackDate = this.lifeCommonService.dateFormat(startDate,"yyyy-MM-dd")
this.queryScheduleTrackList();
for(let i=0;i<this.weekArr.length;i++){
this.weekArr[i].selected = false;
if(this.trackDate == this.weekArr[i]['date']){
this.weekArr[i]['selected'] = true;
break;
}
}
} }
queryScheduleTrackList(){ queryScheduleTrackList(){
this.myService.queryScheduleTrackList({practitionerId:'1',trackDate:'2020-09-11'}).subscribe((res)=>{ this.myService.queryScheduleTrackList({practitionerId:'1',trackDate:this.trackDate}).subscribe((res)=>{
console.log(res)
if(res['success']){ if(res['success']){
this.taskList = res['data']; this.taskList = res['data'];
} }
......
...@@ -127,6 +127,15 @@ input::placeholder { ...@@ -127,6 +127,15 @@ input::placeholder {
} }
} }
#add_calendar_wrapper{
.am-list-body::before{
background-color: transparent;
}
.am-list-body::after{
background-color: transparent;
}
}
@keyframes slowUp { @keyframes slowUp {
0% { 0% {
-webkit-transform: translateY(100%); -webkit-transform: translateY(100%);
......
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