dashboard issue fix
This commit is contained in:
parent
c8e4b175bb
commit
9d3a83df3f
BIN
ng-seed/Appointment_Frontend_Build.zip
Normal file
BIN
ng-seed/Appointment_Frontend_Build.zip
Normal file
Binary file not shown.
@ -16,6 +16,8 @@ export class AppComponent {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(window.location.href)
|
||||
console.log(window.location.pathname)
|
||||
console.log(window.location.origin)
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,8 @@ import { environment } from 'environments/environment';
|
||||
import Swal from 'sweetalert2';
|
||||
import { AppointmentsService } from '../appointments-service/appointments.service';
|
||||
import { DialogBoxComponent } from '../dialog-box/dialog-box.component';
|
||||
import { Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DashboardService } from 'app/dashboard/dashboard.service';
|
||||
export interface UsersData {
|
||||
busId: number;
|
||||
appoinmentTime: string;
|
||||
@ -59,9 +60,20 @@ export class AppoinmentsListComponent implements OnInit {
|
||||
consultants: any = [];
|
||||
selectPractitioner:any = [];
|
||||
user_role: any=[];
|
||||
constructor(private router: Router,private notifierService: NotifierService,public dialog: MatDialog, public _app:AppointmentsService) { }
|
||||
constructor(private router: Router,private notifierService: NotifierService,public dialog: MatDialog, public _app:AppointmentsService,public _dash:DashboardService) {
|
||||
|
||||
let go_appointment = localStorage.getItem('go_appointment')
|
||||
console.log(go_appointment)
|
||||
if(go_appointment == '0'){
|
||||
let dataVal = localStorage.getItem('go_appointment_data')
|
||||
console.log(dataVal)
|
||||
this.openDialog('Update',JSON.parse(dataVal))
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
this.recordStatus=false;
|
||||
this.user_role = localStorage.getItem('user_role');
|
||||
if(this.user_role != 'FRONTDESK'){
|
||||
@ -269,6 +281,8 @@ export class AppoinmentsListComponent implements OnInit {
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
console.log(result)
|
||||
if(result.data == 0){
|
||||
localStorage.removeItem('go_appointment_data')
|
||||
localStorage.setItem('go_appointment','1')
|
||||
if(this.user_role != 'FRONTDESK'){
|
||||
let param ={"busId":localStorage.getItem('busId'),"userId":localStorage.getItem('user_id')}
|
||||
console.log(param)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!-- <mat-card class="settings-panel" > -->
|
||||
<h5 mat-dialog-title> <strong>{{action}} Appoinment</strong>
|
||||
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="close()"
|
||||
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="closeDialog()"
|
||||
><mat-icon>close</mat-icon></button></h5>
|
||||
<form [formGroup]="form" (ngSubmit)="submit()">
|
||||
<ng-scrollbar class="scrollHV">
|
||||
|
||||
@ -121,13 +121,15 @@ export class DialogBoxComponent implements OnInit {
|
||||
this.local_data = {...data};
|
||||
this.action = this.local_data.action;
|
||||
this.frontDeskChoosedPractiID = this.local_data['ServicesMapDetail.userId']
|
||||
// // console.log(this.frontDeskChoosedPractiID)
|
||||
console.log(this.local_data)
|
||||
}
|
||||
get f(){
|
||||
return this.form.controls;
|
||||
}
|
||||
|
||||
closeDialog(){
|
||||
localStorage.removeItem('go_appointment_data')
|
||||
localStorage.setItem('go_appointment','1')
|
||||
this.dialogRef.close({event:'Cancel'});
|
||||
}
|
||||
onSelectFile(event) {
|
||||
@ -139,10 +141,7 @@ export class DialogBoxComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
close() {
|
||||
// // console.log(this.form.value);
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
|
||||
// toggle() {
|
||||
// this.show = !this.show;
|
||||
@ -502,6 +501,8 @@ export class DialogBoxComponent implements OnInit {
|
||||
}else{
|
||||
this.notifierService.notify('success', 'Appointment Added Successfully');
|
||||
}
|
||||
localStorage.removeItem('go_appointment_data')
|
||||
localStorage.setItem('go_appointment','1')
|
||||
let param = {data:0,response:res}
|
||||
this.dialogRef.close(param);
|
||||
this.isSubmitting = false;
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div fxLayout="row" style="padding: 10px;">
|
||||
<div fxLayout="row" style="padding: 10px;color: #3abba3;background-color: #fff;">
|
||||
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" fxLayoutAlign="center center" class="p-gap" style=" border-right: 1px solid rgba(0, 0, 0, 0.12);display: block !important;">
|
||||
<div class="card-block text-center">
|
||||
<div class="row">
|
||||
@ -75,7 +75,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div fxLayout="row" style="padding: 10px;">
|
||||
<div fxLayout="row" style="padding: 10px;color: cadetblue;background-color: #fff;">
|
||||
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" fxLayoutAlign="center center" class="p-gap" style=" border-right: 1px solid rgba(0, 0, 0, 0.12);display: block !important;">
|
||||
<div class="card-block text-center">
|
||||
<div class="row">
|
||||
@ -139,7 +139,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div fxLayout="row" style="padding: 10px;">
|
||||
<div fxLayout="row" style="padding: 10px;color: darksalmon;background-color: #fff;">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center" class="p-gap" style="display: block !important;">
|
||||
<div class="card-block text-center">
|
||||
<div class="row">
|
||||
@ -400,7 +400,7 @@
|
||||
<div class="service service2">
|
||||
<h4>Today</h4>
|
||||
<ng-scrollbar class="scrollHV service" *ngIf="user_role == 'PRACTITIONER'">
|
||||
<mat-card *ngFor="let appoinment of appoinmentsListToday; index as i;">
|
||||
<mat-card *ngFor="let appoinment of appoinmentsListToday; index as i;" (click)="goToBookedAppointment(appoinment)">
|
||||
|
||||
<div fxLayout="row wrap" style="padding-top: 8px;padding-bottom: 8px;">
|
||||
|
||||
@ -422,7 +422,7 @@
|
||||
<div class="service service2">
|
||||
<h4>Tomorrow</h4>
|
||||
<ng-scrollbar class="scrollHV service" >
|
||||
<mat-card *ngFor="let appoinment of appoinmentsListTomorrow; index as i;">
|
||||
<mat-card *ngFor="let appoinment of appoinmentsListTomorrow; index as i;" (click)="goToBookedAppointment(appoinment)">
|
||||
<div fxLayout="row wrap" style="padding-top: 8px;padding-bottom: 8px;">
|
||||
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
|
||||
<div style="text-align: start;margin-left: 10px"><span > {{appoinment.customer[0].cusName}}</span></div>
|
||||
@ -442,7 +442,7 @@
|
||||
|
||||
<h4>Later</h4>
|
||||
<ng-scrollbar class="scrollHV service">
|
||||
<mat-card *ngFor="let appoinment of appoinmentsListLater; index as i;">
|
||||
<mat-card *ngFor="let appoinment of appoinmentsListLater; index as i;" (click)="goToBookedAppointment(appoinment)">
|
||||
<div fxLayout="row wrap" style="padding-top: 8px;padding-bottom: 8px;">
|
||||
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
|
||||
<div style="text-align: start;margin-left: 10px"><span > {{appoinment.customer[0].cusName}}</span></div>
|
||||
|
||||
@ -6,6 +6,7 @@ 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';
|
||||
import { Router } from '@angular/router';
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
templateUrl: './dashboard.component.html',
|
||||
@ -338,7 +339,7 @@ messages: Object[] = [{
|
||||
appoinmentsListToday:any=[];
|
||||
appoinmentsListTomorrow:any =[];
|
||||
appoinmentsListLater:any =[];
|
||||
constructor(public _app:AppointmentsService,private currencySymbol: CurrencyPipe,public _dash:DashboardService,private matIconRegistry: MatIconRegistry,private domSanitizer: DomSanitizer) {
|
||||
constructor(private router:Router,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(
|
||||
@ -648,7 +649,7 @@ messages: Object[] = [{
|
||||
|
||||
//Start Line Chart
|
||||
let lineParams
|
||||
if(user_role == 'BIZADMIN'){
|
||||
if(user_role != 'PRACTITIONER'){
|
||||
lineParams = {'busId':localStorage.getItem('busId'),'fromDate':startDate,'toDate':EndDate}
|
||||
}
|
||||
this.getLineChartData(lineParams)
|
||||
@ -736,4 +737,14 @@ messages: Object[] = [{
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
goToBookedAppointment(params){
|
||||
console.log(params)
|
||||
localStorage.setItem('go_appointment','0');
|
||||
localStorage.setItem('go_appointment_data',JSON.stringify(params))
|
||||
// this._dash.passAppointmentDetails.next(params)
|
||||
this.router.navigate(['/appointments'])
|
||||
// this.router.navigate(['/appointments', params])
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,13 +1,17 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from 'environments/environment';
|
||||
import { Observable } from 'rxjs';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DashboardService {
|
||||
private apiUrl = environment.apiEndpoint;
|
||||
|
||||
public passAppointmentDetails:BehaviorSubject<any> = new BehaviorSubject<any>([]);
|
||||
public passAppointmentDetails_observable$ = this.passAppointmentDetails.asObservable();
|
||||
|
||||
constructor(private _http: HttpClient) { }
|
||||
// generateotp(email): Observable<any> {
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
<div style=" text-align: center;">
|
||||
|
||||
<h3 >Your appointment has been successfully Booked On.</h3>
|
||||
<h3 >Your appointment has been successfully Booked.</h3>
|
||||
|
||||
<p style="color:rgb(13, 218, 13)">
|
||||
Thank You..! Your order status is {{resPayment.response_message}}.
|
||||
|
||||
@ -8,7 +8,7 @@ export const environment = {
|
||||
|
||||
//EndUser URL
|
||||
endUserUrl: window.location.origin+'/appointment/#/booking/',
|
||||
mailUrl:window.location.origin,
|
||||
mailUrl:window.location.origin+'/appointment',
|
||||
payment_api_key :'4cb964d4-9ef4-4a25-8f85-a2a13f43cbba',
|
||||
payment_mode:'TEST',
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ export const environment = {
|
||||
production: false,
|
||||
environmentName: 'Testing Environment',//Localhost Environment.
|
||||
// apiEndpoint:'http://venbainfotech.com:5000/api/',
|
||||
// apiEndpoint:'http://192.168.1.14:8080/api/',
|
||||
apiEndpoint:'https://dev.venbait.in/appointments/api/',
|
||||
apiEndpoint:'http://192.168.1.29:8080/api/',
|
||||
// apiEndpoint:'https://dev.venbait.in/appointments/api/',
|
||||
|
||||
//EndUser URL
|
||||
endUserUrl: window.location.origin+'/#/booking/',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user