From d20b47191db4d6f027450e08fc89b5870934bac3 Mon Sep 17 00:00:00 2001 From: Surendiran Date: Thu, 8 Jun 2023 18:38:09 +0530 Subject: [PATCH] dashboard changes --- .../app/dashboard/dashboard.component.html | 198 +++++------------- .../app/dashboard/dashboard.component.scss | 15 +- .../src/app/dashboard/dashboard.component.ts | 69 +++++- 3 files changed, 128 insertions(+), 154 deletions(-) diff --git a/ng-seed/src/app/dashboard/dashboard.component.html b/ng-seed/src/app/dashboard/dashboard.component.html index 42cfb75..be85462 100644 --- a/ng-seed/src/app/dashboard/dashboard.component.html +++ b/ng-seed/src/app/dashboard/dashboard.component.html @@ -1,4 +1,4 @@ - +
@@ -296,168 +296,74 @@
--> - - - +

Appointments

- - -
-
-
Gopi
-
7896541230
+

Today

+ + + +
+ +
+
{{appoinment.customer[0].cusName}}
+
{{appoinment.customer[0].phoneNo}}
-
-
30/12/2023, 3:00pm
-
Status
+
+
{{appoinment.status}}
+
{{appoinment.appoinmentSlots[0] | date:'dd/MM/yyyy h:mm a'}}
+
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
+
- - -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
+

Tomorrow

+ + +
+
+
{{appoinment.customer[0].cusName}}
+
{{appoinment.customer[0].phoneNo}}
+
+
+
{{appoinment.status}}
+
{{appoinment.appoinmentSlots[0] | date:'dd/MM/yyyy h:mm a'}}
+ +
+
+
-
- - -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
-
- -
-

hello

-
+
+ +

Later

+ + +
+
+
{{appoinment.customer[0].cusName}}
+
{{appoinment.customer[0].phoneNo}}
+
+
+
{{appoinment.status}}
+
{{appoinment.appoinmentSlots[0] | date:'dd/MM/yyyy h:mm a'}}
+ +
+
+
-
--> + -
\ No newline at end of file + \ No newline at end of file diff --git a/ng-seed/src/app/dashboard/dashboard.component.scss b/ng-seed/src/app/dashboard/dashboard.component.scss index bb10581..cb63dbc 100644 --- a/ng-seed/src/app/dashboard/dashboard.component.scss +++ b/ng-seed/src/app/dashboard/dashboard.component.scss @@ -669,9 +669,9 @@ h3 { } .service { - background: #fff; - margin: 20px; - padding: 20px; + background: #f1f1f1; + margin: 10px; + // padding: 20px; border-radius: 4px; text-align: center; -webkit-box-flex: 1; @@ -765,5 +765,10 @@ h3 { display: flex; align-items: center; } - - +section mat-card{ + background: linear-gradient(58deg, #009688, #673ab7); + color: #fff; + border-radius: 4px 4px; + font-size: 14px; +} + diff --git a/ng-seed/src/app/dashboard/dashboard.component.ts b/ng-seed/src/app/dashboard/dashboard.component.ts index b530a9d..1eb7e79 100644 --- a/ng-seed/src/app/dashboard/dashboard.component.ts +++ b/ng-seed/src/app/dashboard/dashboard.component.ts @@ -5,6 +5,7 @@ import { MatIconRegistry } from '@angular/material/icon'; import { DomSanitizer } from '@angular/platform-browser'; import * as moment from 'moment'; import { CurrencyPipe, DatePipe } from '@angular/common'; +import { AppointmentsService } from 'app/appoinment/appoinments/appointments-service/appointments.service'; @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', @@ -13,7 +14,7 @@ import { CurrencyPipe, DatePipe } from '@angular/common'; }) export class DashboardComponent { private currencyPipe1:CurrencyPipe - + public single: any[]; public multi: any[]; public showXAxis = true; @@ -330,8 +331,12 @@ messages: Object[] = [{ currency: any = 'INR'; countAndRevenue: boolean = false; currencyHtmlCode: any; - - constructor(private currencySymbol: CurrencyPipe,public _dash:DashboardService,private matIconRegistry: MatIconRegistry,private domSanitizer: DomSanitizer) { + appoinmentsList:any =[]; + appointmentListLength:any =[] + appoinmentsListToday:any=[]; + appoinmentsListTomorrow:any =[]; + appoinmentsListLater:any =[]; + constructor(public _app:AppointmentsService,private currencySymbol: CurrencyPipe,public _dash:DashboardService,private matIconRegistry: MatIconRegistry,private domSanitizer: DomSanitizer) { // this.fetch((data) => { this.rows = data; }); Object.assign(this, {single, multi}) this.matIconRegistry.addSvgIcon( @@ -354,6 +359,7 @@ messages: Object[] = [{ let user_role = localStorage.getItem('user_role') let param if(user_role == 'PRACTITIONER'){ + this.getAppoinmentsList() param = {'user_id':localStorage.getItem('user_id'),'busId':localStorage.getItem('busId')} }else{ param = {'busId':localStorage.getItem('busId')} @@ -652,4 +658,61 @@ messages: Object[] = [{ return spanElement.innerHTML; } + + + getAppoinmentsList() { + this.appoinmentsList=[] + let user_role = localStorage.getItem('user_role'); + let param = {"busId": localStorage.getItem('busId'),"userId":localStorage.getItem('user_id')} + console.log(param) + this._app.getAppoinmentsListDetails(param).subscribe(res => { + + if (res.status == 200) { + + this.appoinmentsList = res.data; + this.appoinmentsList.forEach(element => { + console.log(element) + element.appoinmentSlots = JSON.parse(element.appoinmentSlots) + }); + var startDate:any = new Date(); + startDate = startDate.toISOString().slice(0, 10); + this.appoinmentsList.forEach(element => { + + if(element.appoinmentDate == startDate){ + this.appoinmentsListToday.push(element) + } + + }); + // this.appoinmentsListToday = this.appoinmentsList.filter(val => val.appoinmentDate == startDate ) + // this.appoinmentsList = appoinmentsListToday + localStorage.setItem('busId', res.data[0].busId + ) + var startDate1:any = new Date(); + startDate1.setDate(startDate1.getDate() + 1); + let Tomorrow = startDate1.toISOString().slice(0, 10) + console.log(Tomorrow) + this.appoinmentsList.forEach(element => { + + if(element.appoinmentDate == Tomorrow){ + this.appoinmentsListTomorrow.push(element) + } + + }); + + this.appoinmentsList.forEach(element => { + + if(element.appoinmentDate != Tomorrow && element.appoinmentDate != startDate ){ + this.appoinmentsListLater.push(element) + } + + }); + console.log(this.appoinmentsListLater) + + // this.appoinmentsListTomorrow= this.appoinmentsList.filter(val => val.appoinmentDate == Yesterday ) + this.appointmentListLength = res.data.length; + console.log(this.appointmentListLength) + } + }) + +} }