This commit is contained in:
Surendiran 2023-05-10 18:23:06 +05:30
parent 176a12c13c
commit b72f9d7804
14 changed files with 220 additions and 66 deletions

View File

@ -29,7 +29,7 @@
<!-- <mat-expansion-panel>
<mat-expansion-panel-header > -->
<!-- <div class="example-container mat-elevation-z8 "> -->
<table mat-table [dataSource]="appointmentListSource" #mytable class="my-table mat-elevation-z8 len-table">
<table mat-table [dataSource]="appointmentListSource" #mytable class="my-table mat-elevation-z8 len-table" *ngIf="!recordStatus">
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef class="font-color mat-no"> S.No</th>
<td mat-cell *matCellDef="let row" class="element-spc"> {{row.index+1 }}</td>
@ -61,10 +61,7 @@
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef class="font-color mat-mob"> Status </th>
<td mat-cell *matCellDef="let row" class="element-spc" [ngClass]="{
'positive' :row.status == 'Booked',
'negative' : row.status != 'Booked'
}"> {{row.status}}</td>
<td mat-cell *matCellDef="let row" class="element-spc" [ngClass]="{'positive' :row.status == 'Booked','negative' : row.status != 'Booked','cancelStatus' : row.status == 'Cancel'}"> {{row.status}}</td>
</ng-container>
<ng-container matColumnDef="action">
@ -83,10 +80,10 @@
<!-- <table mat-table [dataSource]="appointmentListSource" matSort *ngIf="appointmentListLength > 0" class="my-table mat-elevation-z8 len-table"> -->
<!-- ID Column -->
<ng-container matColumnDef="id">
<!-- <ng-container matColumnDef="id">
<mat-header-cell *matHeaderCellDef mat-sort-header> S.No </mat-header-cell>
<mat-cell *matCellDef="let row; let i = index;"> {{row.index+1}} </mat-cell>
</ng-container>
</ng-container> -->
<!--
<ng-container matColumnDef="ClientName">

View File

@ -117,11 +117,16 @@ tr.mat-header-row {
}
.positive {
color: green;
font-weight: bold;
color: green;
font-weight: bold;
}
.negative {
color: rgb(230, 174, 21);
font-weight: bold;
color: rgb(230, 174, 21);
font-weight: bold;
}
.cancelStatus {
color: red;
font-weight: bold;
}

View File

@ -45,7 +45,7 @@ export class AppoinmentsListComponent implements OnInit {
pageIndex = 0;
pageSize = 5;
pageEvent: PageEvent;
appoinmentsList: any[] = [];
appoinmentsList: any = [];
private apiUrl = environment.apiEndpoint;
// dataSource: any;
public appointmentListSource:any = new MatTableDataSource();
@ -115,12 +115,14 @@ export class AppoinmentsListComponent implements OnInit {
getPractitioner(selectedPractititoner){
console.log(selectedPractititoner)
this.appoinmentsList=[]
// {"busId":abc123,userId:"2"} or param = {"busId":abc123}
let param = {"busId": selectedPractititoner.busId,"userId":selectedPractititoner.id}
this.getAppoinmentsList(param)
}
getAppoinmentsList(param) {
this.appoinmentsList=[]
let user_role = localStorage.getItem('user_role');
// let param
// if(user_role != 'FRONTDESK'){

View File

@ -2,9 +2,11 @@
<h5 mat-dialog-title> <strong>{{action}} Business</strong>
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="close()"
><mat-icon>close</mat-icon></button></h5>
<div mat-dialog-content class="my-table">
<form [formGroup]="form" (ngSubmit)="submit()">
<ng-scrollbar class="scrollHV">
<div mat-dialog-content class="my-table">
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Name</mat-label>
@ -74,10 +76,8 @@
</div>
</div>
<ng-template #elseTemplate>
Sure to delete <b>{{local_data.name}}</b>?
</ng-template>
<div mat-dialog-actions>
<button mat-button type="submit" class="mat-green" mat-raised-button >{{action}}</button>
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
@ -85,6 +85,12 @@
</ng-scrollbar>
</form>
</div>
<ng-template #elseTemplate>
Sure to delete <b>{{local_data.name}}</b>?
</ng-template>
<notifier-container></notifier-container>
<!-- </mat-card> -->

View File

@ -1,4 +1,4 @@
<mat-card class="settings-panel" >
<!-- <mat-card class="settings-panel" > -->
<h5 mat-dialog-title> <strong>{{action}} Users</strong>
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="close()"
><mat-icon>close</mat-icon></button></h5>
@ -110,6 +110,6 @@
Sure to delete <b>{{local_data.name}}</b>?
</ng-template>
</mat-card>
<!-- </mat-card> -->
<notifier-container></notifier-container>

View File

@ -12,14 +12,14 @@
// margin-left: 6rem;
float: right;
}
::ng-deep .mat-card.settings-panel {
position: inherit;
bottom: 0px;
right: 0px;
width: 350px;
z-index: 9;
top: 58px;
}
// ::ng-deep .mat-card.settings-panel {
// position: inherit;
// bottom: 0px;
// right: 0px;
// width: 350px;
// z-index: 9;
// top: 58px;
// }
::ng-deep body .mat-card {
box-shadow:none!important;

View File

@ -15,19 +15,15 @@
</mat-form-field> -->
<mat-form-field appearance="outline" style="width:20%;margin-left: 5%;">
<!-- <mat-form-field appearance="outline" style="width:20%;margin-left: 5%;">
<mat-label>Role</mat-label>
<mat-select placeholder="Select Business" formControlName="businessselect" required>
<mat-option value="All" (click)="applyFilter(null)">All</mat-option>
<mat-option value="SADMIN" (click)="applyFilter('SADMIN')">SADMIN</mat-option>
<mat-option value="PRACTITIONER"(click)="applyFilter('PRACTITIONER')"> PRACTITIONER</mat-option>
<mat-option value="BADMIN" (click)="applyFilter('BADMIN')">BADMIN</mat-option>
</mat-select>
</mat-form-field>
</mat-select>
</mat-form-field> -->
<button mat-button (click)="openDialog('Add',{})" class="button">Add Users</button>
<!-- <div class="example-container mat-elevation-z8 "> -->
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">

View File

@ -10,6 +10,7 @@ import { UserService } from '../user-service/user.service';
import { environment } from 'environments/environment';
import { BusinessService } from 'app/appoinment/business/business-service/business.service';
import { PractAssignServiceComponent } from '../pract-assign-service/pract-assign-service.component';
import { filter } from 'd3';
export interface UsersData {
id: number;
@ -76,6 +77,24 @@ export class UserListComponent implements OnInit {
this.getUsersList()
this.getBusinessList()
}
ngAfterViewInit() {
console.log(this.usersList,this.paginator)
this.usersList.paginator = this.paginator;
this.usersList.paginator = this.paginator;
console.log(this.usersList,this.paginator)
//this.usersList.sort = this.sort;
}
applyFilter(filterValue: string) {
console.log(filterValue)
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
this.usersList.filter = filterValue;
console.log(this.usersList)
}
getUsersList() {
let userRole = localStorage.getItem('user_role')
let param;
@ -108,7 +127,8 @@ export class UserListComponent implements OnInit {
}
},error => this.isLoading = false);
}
}
getBusinessList() {
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._bus.getBusinessListDetails().subscribe(res => {
@ -127,27 +147,29 @@ export class UserListComponent implements OnInit {
// hashPassword(password: string){
// return "*".repeat(6)
// }
ngAfterViewInit() {
console.log(this.usersList,this.paginator)
this.usersList.paginator = this.paginator;
this.usersList.paginator = this.paginator;
console.log(this.usersList,this.paginator)
//this.usersList.sort = this.sort;
}
applyFilter(filterValue: string) {
console.log(filterValue)
if(filterValue == null){
this.usersList.filter = null;
}else{
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
this.usersList.filter = filterValue;
console.log(this.usersList)
}
}
// roleFilter(param){
// this.getUsersList()
// if(param == 'BADMIN'){
// console.log(this.usersList['data'])
// let userList:any = this.usersList['data']
// this.usersList['data'] = userList.filter(val => val.role == 'BADMIN')
// console.log(this.usersList['data'])
// } else if(param == 'FRONTDESK'){
// console.log(this.usersList['data'])
// let userList:any = this.usersList['data']
// this.usersList['data'] = userList.filter(val => val.role == 'FRONTDESK')
// console.log(this.usersList['data'])
// } else if(param == 'SADMIN'){
// console.log(this.usersList['data'])
// let userList:any = this.usersList['data']
// this.usersList['data'] = userList.filter(val => val.role == 'SADMIN')
// console.log(this.usersList['data'])
// } else if(param == null){
// this.getUsersList()
// }
// }
pageChange(e) {
console.log(e);
@ -190,7 +212,7 @@ export class UserListComponent implements OnInit {
}
obj.action = action;
const dialogRef = this.dialog.open(AddUserComponent, {
// width: '30%',
width: '30%',
height: '100%',
// maxWidth: '38vw',
position: { right: '0' },
@ -218,6 +240,7 @@ export class UserListComponent implements OnInit {
}
formAddUpdateAndDelete(result,row_obj,action,obj){
console.log(result,row_obj)
let formValue = []
if(result.event == 'Add'){
@ -276,12 +299,21 @@ export class UserListComponent implements OnInit {
} else if(result == 'Delete'){
this.notifierService.notify('success', 'User Deleted Successfully');
}
if(action == 'Update' && result.role == 'PRACTITIONER'){
this.openAssignService(res['data'].id,action,obj)
}else if(result.role == 'PRACTITIONER'){
this.openAssignService(res['data'].id,'',res['data'].userName)
let loginUser = localStorage.getItem('user_role')
if(loginUser == 'FRONTDESK'){
if(result.role == 'PRACTITIONER'){
console.log('PRACTITIONER')
if(action == 'Update'){
console.log('Update')
this.openAssignService(res['data'].id,action,obj)
}else {
console.log('Update')
this.openAssignService(res['data'].id,'',res['data'].userName)
}
}
}
}
else{
this.notifierService.notify('warning', res.message);

View File

@ -1,7 +1,7 @@
<mat-toolbar>
<div fxLayout="row wrap" style="padding:15px 0px;">
<div fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" fxLayoutAlign="start center">
<button (click)="backRedireact()" mat-icon-button class="backStyle" aria-label="Example icon button with a home icon">
<button (click)="bookedDetails()" mat-icon-button class="backStyle" aria-label="Example icon button with a home icon">
<mat-icon>keyboard_backspace</mat-icon>
</button>
</div>
@ -14,6 +14,60 @@
</mat-toolbar>
<ng-scrollbar class="scrollHV">
<div class="container mt-1">
<mat-card class="pad radius" *ngIf="bookedDetails.length != 0">
<div fxLayout="row wrap" fxLayoutAlign="center center">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20" fxLayoutAlign="center center">
<div fxLayout="row wrap" fxLayoutAlign="center center">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<h5 class="heading"><img src="assets/images/person.svg" alt="Avatar" class="img"> Practitioner</h5>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<p class="bookedDetails">Dr. {{bookedDetails.doctor}}</p>
</div>
</div>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20" fxLayoutAlign="center center">
<div fxLayout="row wrap" fxLayoutAlign="center center">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<h5 class="heading"><img src="assets/images/information.svg" alt="Avatar" class="img"> Service</h5>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<p class="bookedDetails">{{bookedDetails.service}} ({{bookedDetails.duration}}Mins)</p>
</div>
</div>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20" fxLayoutAlign="center center">
<div fxLayout="row wrap" fxLayoutAlign="center center">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<h5 class="heading"><img src="assets/images/Languages.svg" alt="Avatar" class="img"> Date</h5>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<p class="bookedDetails">{{bookedDetails.date | date:'longDate'}}</p>
</div>
</div>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20" fxLayoutAlign="center center">
<div fxLayout="row wrap" fxLayoutAlign="center center">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<h5 class="heading"><img src="assets/images/Time-Icon.svg" alt="Avatar" class="img"> Slot Time</h5>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<p class="bookedDetails">{{bookedDetails.time | date:'shortTime'}}</p>
</div>
</div>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20" fxLayoutAlign="center center">
<div fxLayout="row wrap" fxLayoutAlign="center center">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<h5 class="heading"><img src="assets/images/Location.svg" alt="Avatar" class="img"> Fees</h5>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
<p class="bookedDetails"><span class="ex" style="font-size: 17px;padding-bottom: 10px;line-height: 17px;">&#x20b9;</span> {{bookedDetails.amount}}</p>
</div>
</div>
</div>
</div>
</mat-card>
<div fxLayout="row wrap" fxLayoutAlign="center">
<div class="column mat-width" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<mat-card class="p-2 radius">

View File

@ -91,4 +91,22 @@ mat-toolbar{
}
.mat-toolbar-single-row {
display: block !important;
}
.heading{
margin: 0;
color: #227f6e;
}
.pad{
padding: 10px !important;
}
.bookedDetails{
padding: 0;
margin: 10px;
color: #959595;
font-size: 16px;
}
.img{
width: 20px;
// margin-right: 1.5rem;
vertical-align: top !important;
}

View File

@ -39,7 +39,14 @@ export class CustomerInfoComponent implements OnInit {
noChangeNo: any = 0;
private apiUrl = environment.apiEndpoint;
logo: any;
bookedDetails: any = [];
constructor(public dialog: MatDialog,private router: Router,private formBuilder: FormBuilder,public _cus:EndUserService, private ngZone: NgZone) {
this._cus.bookedDetails_observable$.subscribe((res) => {
console.log('booked2', res);
this.bookedDetails = res
console.log(this.bookedDetails)
})
// firebase.initializeApp(config)
}

View File

@ -9,7 +9,8 @@ import { catchError } from 'rxjs/operators';
})
export class EndUserService {
public bookedDetails:BehaviorSubject<any> = new BehaviorSubject<any>([]);
public bookedDetails_observable$ = this.bookedDetails.asObservable();
public appointmentBooked:BehaviorSubject<any> = new BehaviorSubject<any>([]);
public appointmentBooked_observable$ = this.appointmentBooked.asObservable();
public summmarylist:BehaviorSubject<any> = new BehaviorSubject<any>([]);

View File

@ -290,9 +290,32 @@ if(this.getHours.length != 0){
console.log( this.slot_array)
localStorage.setItem("slotData",JSON.stringify(this.slot_array))
let URL = this.router.url;
console.log( JSON.parse(localStorage.getItem("slotData")))
this.router.navigate([URL+"/cus"])
console.log(JSON.parse(localStorage.getItem("slotData")))
let duration
let fees
if(this.serviceMapdetails[0].duration.length>0 ){
duration = this.serviceMapdetails[0].duration[0].durationNew
fees = this.serviceMapdetails[0].duration[0].fees
} else{
duration = this.serviceMapdetails[0].service[0].duration
fees = this.serviceMapdetails[0].service[0].fees
}
console.log(this.doctor,this.servicesName.servicesName,this.days[this.clicks],this.slotTime,this.serviceMapdetails[0].service[0].fees)
let bookedDetails = {
"doctor" : this.doctor,
"service": this.servicesName.servicesName,
"duration": duration,
"date":this.days[this.clicks],
"time":this.slotTime,
"amount": fees
}
console.log(bookedDetails)
this.end_user.bookedDetails.next(bookedDetails)
this.router.navigate([URL+"/cus"])
}
checkBooked(param){
// console.log(param, this.bookedAppointment)
this.bookedAppointmentSlot

View File

@ -26,5 +26,18 @@ export const environment = {
appId: "1:513912226817:web:eebcec6f7c6407a1dd2c00",
measurementId: "G-48RM8BFRFK"
},
// web:{
// client_id:"1070360493694-f47l99s7bjqf7of1n7amgkg3mfk7l425.apps.googleusercontent.com",
// project_id:"neon-nexus-386307",
// auth_uri:"https://accounts.google.com/o/oauth2/auth",
// token_uri:"https://oauth2.googleapis.com/token",
// auth_provider_x509_cert_url:"https://www.googleapis.com/oauth2/v1/certs",
// client_secret:"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",
// redirect_uris:["http://localhost:4200"],
// javascript_origins:["http://localhost:4200"]
// }
};
}