working hours
This commit is contained in:
parent
88b6bbb27c
commit
7de8e09ad7
Binary file not shown.
@ -41,7 +41,7 @@
|
||||
|
||||
<ng-container matColumnDef="datetime">
|
||||
<th mat-header-cell *matHeaderCellDef class="font-color th-mat"> Date and Time </th>
|
||||
<td mat-cell *matCellDef="let row"> {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots[0] | date:'shortTime'}} </td>
|
||||
<td mat-cell *matCellDef="let row"> {{row.appoinmentDate | date:'dd-MMM-YYYY'}}<br> {{row.appoinmentSlots[0] | date:'shortTime'}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="phoneNo">
|
||||
@ -54,10 +54,10 @@
|
||||
<td mat-cell *matCellDef="let row" class="element-spc"> {{row.customer[0].email}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="address">
|
||||
<!-- <ng-container matColumnDef="address">
|
||||
<th mat-header-cell *matHeaderCellDef class="font-color"> Client Address </th>
|
||||
<td mat-cell *matCellDef="let row" class="element-spc"> {{row.customer[0].address_1}} {{row.customer[0].city}} {{row.customer[0].state}}</td>
|
||||
</ng-container>
|
||||
</ng-container> -->
|
||||
|
||||
<ng-container matColumnDef="status">
|
||||
<th mat-header-cell *matHeaderCellDef class="font-color mat-mob"> Status </th>
|
||||
|
||||
@ -33,7 +33,7 @@ export interface UsersData {
|
||||
export class AppoinmentsListComponent implements OnInit {
|
||||
|
||||
push: any;
|
||||
displayedColumns: string[] = ['id','ClientName','datetime','phoneNo','email','address','status', 'action'];
|
||||
displayedColumns: string[] = ['id','ClientName','datetime','phoneNo','email','status', 'action'];
|
||||
public appointmentListLength: number;
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<div class="popup-button">
|
||||
<!-- <span class="buttons cancel" (click)="close()">Cancel</span> -->
|
||||
<button type="button"class="buttons cancel" (click)="close()" >Cancel</button>
|
||||
<button type="submit"class="buttons add" (click)="save()" >Save</button>
|
||||
<button type="submit"class="buttons add">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</mat-card>
|
||||
@ -25,31 +25,25 @@ export class AppointmentAddcustomerComponent implements OnInit {
|
||||
public myError = (controlName: string, errorName: string) =>{
|
||||
return this.form.controls[controlName].hasError(errorName);
|
||||
}
|
||||
save(){
|
||||
|
||||
}
|
||||
close(){
|
||||
|
||||
}
|
||||
submit(){
|
||||
|
||||
console.log(this.form.value)
|
||||
submit(){
|
||||
console.log(this.form.value)
|
||||
let form ={
|
||||
"cusName":this.form.value.name,
|
||||
"email":this.form.value.email,
|
||||
"phoneNo":this.form.value.phoneNo,
|
||||
"busId":localStorage.getItem('busId')
|
||||
|
||||
|
||||
|
||||
let form ={
|
||||
"cusName":this.form.value.name,
|
||||
"email":this.form.value.email,
|
||||
"phoneNo":this.form.value.phoneNo,
|
||||
"busId":localStorage.getItem('busId')
|
||||
|
||||
}
|
||||
this._cus.addFormDetails(form).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
this.childButtonEvent.emit(res);
|
||||
// this._app.customerlist.next(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
this._cus.addFormDetails(form).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
this.childButtonEvent.emit(res);
|
||||
// this._app.customerlist.next(res)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
</mat-form-field> -->
|
||||
|
||||
|
||||
<mat-form-field appearance="outline" class="mate">
|
||||
<!-- <mat-form-field appearance="outline" class="mate">
|
||||
<mat-label>Choose a date</mat-label>
|
||||
<mat-datepicker #picker4></mat-datepicker>
|
||||
<mat-datepicker-toggle matPrefix [for]="picker4"></mat-datepicker-toggle>
|
||||
@ -71,24 +71,28 @@
|
||||
<mat-form-field appearance="outline" class="mate date-marge" (click)="toggle()" id="bt">
|
||||
<mat-label>Choose a Time</mat-label>
|
||||
<input matInput placeholder="Select Time" name="week" [readonly]="!form.get('service').value" formControlName="appoinmentTime">
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
|
||||
<mat-card class="cardDesign" *ngIf="show">
|
||||
<mat-card class="cardDesign">
|
||||
<div class="innerdivs navStyle" fxLayoutAlign="center center">
|
||||
<button type="button" mat-raised-button (click)="goToSlotBooking2()" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_left</mat-icon></button><span style="width: 150px;text-align: center;">{{check(days) | date:'longDate'}}</span><button mat-raised-button type="button" (click)="goToSlotBooking()" *ngIf="clicks < 5" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_right</mat-icon></button>
|
||||
<button type="button" mat-raised-button (click)="goToSlotBooking2()" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_left</mat-icon></button><span style="width: 150px;text-align: center;">{{check(days) | date:'longDate'}}</span><button mat-raised-button type="button" (click)="goToSlotBooking()" *ngIf="clicks < advanced_slot_days" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_right</mat-icon></button>
|
||||
</div>
|
||||
<div class="innerdivs2" >
|
||||
<!-- <button *ngFor="let slot of slots;let i=index" mat-raised-button class="mr-1 mt-1 hoverButton" [ngClass]="{'primary':slotIndex != i,'clickedSlot':slotIndex == i } " (click)="toggleActive($event,slot,i)" >{{slot | date:'shortTime'}}</button> -->
|
||||
<button type="button" *ngFor="let slot of slots;let i=index" mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" (click)="toggleActive($event,slot,i)">{{slot | date:'shortTime'}}</button>
|
||||
<!-- <button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >09:45am</button>
|
||||
<button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >10:00am</button>
|
||||
<button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >10:15am</button>
|
||||
<button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >10:30am</button>
|
||||
<button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >10:45am</button>
|
||||
<button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >11:00am</button>
|
||||
<button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >11:15am</button>
|
||||
<button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >11:30am</button>
|
||||
<button mat-raised-button class="mr-1 mt-1 hoverButton buttontimeline" >11:45am</button> -->
|
||||
<div class="innerdivs2" >
|
||||
<ng-scrollbar class="scrollHV2" *ngIf="slots.length != 0">
|
||||
<button type="button" *ngFor="let slot of slots;let i=index" mat-raised-button mat-button-sm class="mr-1 mt-1 hoverButton" [ngClass]="{'primary':slotIndex != i,'clickedSlot':slotIndex == i }" (click)="toggleActive($event,slot,i)">{{slot | date:'shortTime'}}</button>
|
||||
</ng-scrollbar>
|
||||
<div *ngIf="slots.length == 0">
|
||||
<div fxLayout="row" class="flexCard">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
|
||||
<div><img src="assets/images/service.png" width="300" height="300"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" class="flexCard">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
|
||||
<h3 class="noAssignedService">No Slots Available</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
|
||||
@ -135,10 +139,11 @@
|
||||
Sure to delete <b>{{local_data.cusName}}</b>?
|
||||
</ng-template>
|
||||
</div>
|
||||
</ng-scrollbar>
|
||||
</ng-scrollbar>
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button type="submit" class="mat-green" mat-raised-button >{{action}}</button>
|
||||
<button mat-button (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<notifier-container></notifier-container>
|
||||
@ -99,6 +99,9 @@ $tem-color : #217e69;
|
||||
.scrollHV {
|
||||
height: calc(100vh - 190px);
|
||||
}
|
||||
.scrollHV2 {
|
||||
height: calc(100vh - 462px);
|
||||
}
|
||||
.notes{
|
||||
margin-left: 7.5rem;
|
||||
margin-top: 2rem;
|
||||
@ -249,4 +252,23 @@ $tem-color : #217e69;
|
||||
}
|
||||
.pad{
|
||||
padding: 20px !important;
|
||||
}
|
||||
}
|
||||
.clickedSlot{
|
||||
color: white !important;
|
||||
background-color: brown !important;
|
||||
cursor: pointer !important;
|
||||
width: auto;
|
||||
}
|
||||
.bookedSlot{
|
||||
background-color: darkgrey;
|
||||
color: white;
|
||||
width: 6rem;
|
||||
cursor: no-drop !important;
|
||||
}
|
||||
.primary{
|
||||
background-color: #00866e00;
|
||||
color: brown;
|
||||
width: auto;
|
||||
border: 1px solid brown;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -30,7 +30,7 @@ export interface UsersData {
|
||||
styleUrls: ['./dialog-box.component.scss']
|
||||
})
|
||||
export class DialogBoxComponent implements OnInit {
|
||||
public show:boolean = false;
|
||||
// public show:boolean = false;
|
||||
public buttonName:any = 'Show';
|
||||
form: FormGroup;
|
||||
// fileToUpload: any;
|
||||
@ -104,6 +104,9 @@ export class DialogBoxComponent implements OnInit {
|
||||
user_role: string;
|
||||
consultants: any = [];
|
||||
Status:any = [{id:1,value:"Consult"},{id:2,value:"Attend"},{id:1,value:"No Show"},{id:1,value:"Cancel"}]
|
||||
advanced_slot_days: any;
|
||||
slotIndex: any;
|
||||
findSlotIndex: any;
|
||||
constructor(private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder, public _cus:CustomersService,
|
||||
public dialogRef: MatDialogRef<DialogBoxComponent>,public _api:ConsultantService, public _con:ConsultantService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: UsersData,public _app:AppointmentsService,public end_user:EndUserService) {
|
||||
@ -111,18 +114,14 @@ export class DialogBoxComponent implements OnInit {
|
||||
this.local_data = {...data};
|
||||
this.action = this.local_data.action;
|
||||
|
||||
|
||||
this.advanced_slot_days = parseInt(localStorage.getItem('advanced_slot_days'))-1
|
||||
console.log(this.advanced_slot_days)
|
||||
|
||||
}
|
||||
get f(){
|
||||
return this.form.controls;
|
||||
}
|
||||
doAction(){
|
||||
let tmp = this.form.value
|
||||
tmp.id = this.local_data.id
|
||||
this.dialogRef.close({event:this.action,data:tmp});
|
||||
console.log(this.form.value);
|
||||
console.log(this.action,this.local_data)
|
||||
}
|
||||
|
||||
closeDialog(){
|
||||
this.dialogRef.close({event:'Cancel'});
|
||||
}
|
||||
@ -140,14 +139,14 @@ export class DialogBoxComponent implements OnInit {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
toggle() {
|
||||
this.show = !this.show;
|
||||
// Change the name of the button.
|
||||
if(this.show)
|
||||
this.buttonName = "Hide";
|
||||
else
|
||||
this.buttonName = "Show";
|
||||
}
|
||||
// toggle() {
|
||||
// this.show = !this.show;
|
||||
// // Change the name of the button.
|
||||
// if(this.show)
|
||||
// this.buttonName = "Hide";
|
||||
// else
|
||||
// this.buttonName = "Show";
|
||||
// }
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
@ -163,7 +162,7 @@ export class DialogBoxComponent implements OnInit {
|
||||
|
||||
this.user_role = localStorage.getItem('user_role');
|
||||
let tmp=[]
|
||||
for(let i=0;i<=5;i++){
|
||||
for(let i=0;i<=this.advanced_slot_days;i++){
|
||||
var someDate = new Date();
|
||||
someDate.setDate(someDate.getDate() + i); //number of days to add, e.x. 15 days
|
||||
var dateFormated = someDate.toISOString().substr(0,10);
|
||||
@ -171,7 +170,8 @@ export class DialogBoxComponent implements OnInit {
|
||||
tmp.push(dateFormated)
|
||||
}
|
||||
console.log(tmp)
|
||||
this.days= tmp
|
||||
this.days= tmp
|
||||
// this.getslotData()
|
||||
this.getSlots()
|
||||
if(this.user_role != 'FRONTDESK'){
|
||||
let userId = localStorage.getItem('user_id')
|
||||
@ -197,7 +197,8 @@ export class DialogBoxComponent implements OnInit {
|
||||
appoinmentSlots: new FormControl('', [Validators.required]),
|
||||
|
||||
});
|
||||
console.log(this.local_data, this.selects)
|
||||
console.log(this.local_data, this.selects)
|
||||
// this.findSlotIndex = this.local_data.appoinmentSlots
|
||||
// this.local_data.forEach(element => {
|
||||
if(this.local_data.hasOwnProperty('action')){
|
||||
|
||||
@ -233,10 +234,51 @@ export class DialogBoxComponent implements OnInit {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public myError = (controlName: string, errorName: string) =>{
|
||||
return this.form.controls[controlName].hasError(errorName);
|
||||
}
|
||||
|
||||
// getslotData(){
|
||||
|
||||
// let findAppointmentDate = this.local_data.appoinmentDate
|
||||
// this.days.forEach(element => {
|
||||
// console.log(element)
|
||||
// if(element == findAppointmentDate){
|
||||
// this.days.indexOf(element)
|
||||
// console.log(this.days.indexOf(element))
|
||||
// this.clicks = this.days.indexOf(element)
|
||||
// }
|
||||
// });
|
||||
|
||||
// let options:any = { weekday: 'long'};
|
||||
// var prnDt = new Date(this.days[ this.clicks]).toLocaleTimeString('en-us', options);
|
||||
// var formatDate = prnDt.split(" ")
|
||||
// console.log(formatDate)
|
||||
|
||||
// this.dayName = formatDate[0]
|
||||
// let userId = localStorage.getItem('user_id')
|
||||
// let params ={"id":userId , "day": this.dayName , "addcount": this.clicks}
|
||||
|
||||
// this.end_user.getSlots(params).subscribe(res => {
|
||||
// if (res.status == 200) {
|
||||
// console.log(res)
|
||||
// let data = res['data'];
|
||||
// this.slots = data
|
||||
// this.slots.forEach(element => {
|
||||
// console.log(element)
|
||||
// if(element == this.findSlotIndex[0]){
|
||||
// this.slots.indexOf(element)
|
||||
// console.log(this.slots.indexOf(element))
|
||||
// this.slotIndex = this.slots.indexOf(element)
|
||||
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
getCosultantList() {
|
||||
let param ={"busId": localStorage.getItem('busId')}
|
||||
console.log(param)
|
||||
@ -258,7 +300,12 @@ export class DialogBoxComponent implements OnInit {
|
||||
}
|
||||
|
||||
submit(){
|
||||
console.log(this.form.value);
|
||||
|
||||
console.log(this.form.value,this.slotsResult,this.days[this.clicks]);
|
||||
// if (!this.form.valid) {
|
||||
// return;
|
||||
// }
|
||||
console.log(this.form.value,this.slotsResult,this.days[this.clicks]);
|
||||
|
||||
let paramsmap= {
|
||||
"serviceId": ""+this.ServiceId+"",
|
||||
@ -271,7 +318,7 @@ export class DialogBoxComponent implements OnInit {
|
||||
let paramsData:any= {
|
||||
"busId": localStorage.getItem('busId'),
|
||||
"cusId": this.customerId,
|
||||
"appoinmentDate": this.form.value.appoinmentDate,
|
||||
"appoinmentDate": this.days[this.clicks],
|
||||
"appoinmentTime": this.form.value.appoinmentTime,
|
||||
"serviceMap":serviceMap,
|
||||
"appoinmentSlots": this.slotsResult,
|
||||
@ -304,9 +351,10 @@ export class DialogBoxComponent implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
goToSlotBooking(){
|
||||
goToSlotBooking(i){
|
||||
console.log(i)
|
||||
// this.days[]
|
||||
if(this.clicks <5){
|
||||
if(this.clicks <this.advanced_slot_days){
|
||||
this.clicks += 1;
|
||||
}
|
||||
console.log( this.clicks)
|
||||
@ -326,6 +374,15 @@ export class DialogBoxComponent implements OnInit {
|
||||
console.log(res)
|
||||
let data = res['data'];
|
||||
this.slots = data
|
||||
// this.slots.forEach(element => {
|
||||
// console.log(element)
|
||||
// if(element == this.findSlotIndex[0]){
|
||||
// this.slots.indexOf(element)
|
||||
// console.log(this.slots.indexOf(element))
|
||||
// this.slotIndex = this.slots.indexOf(element)
|
||||
|
||||
// }
|
||||
// });
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -383,7 +440,7 @@ export class DialogBoxComponent implements OnInit {
|
||||
this.slot_array =[];
|
||||
// debugger;
|
||||
// // event.preventDefault();
|
||||
// this.slotIndex = i
|
||||
this.slotIndex = i
|
||||
// this.slotTime = param
|
||||
let resultDate = new DatePipe('en-US').transform(param, 'shortTime')
|
||||
this.form.controls['appoinmentTime'].setValue(resultDate)
|
||||
@ -413,7 +470,7 @@ export class DialogBoxComponent implements OnInit {
|
||||
let result = filteredTimes.pop();
|
||||
console.log(result);
|
||||
this.slotsResult = filteredTimes
|
||||
this.show = false;
|
||||
// this.show = false;
|
||||
// this.slots.forEach(element => {
|
||||
// if(element <date2){
|
||||
// console.log(element);
|
||||
|
||||
@ -50,6 +50,12 @@
|
||||
<mat-error *ngIf="myError('city', 'required')">City is required</mat-error>
|
||||
<mat-error *ngIf="myError('city', 'maxlength')">Limit exceed</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<mat-label>Type Of Currency</mat-label>
|
||||
<input placeholder=" City" matInput [(ngModel)]="local_data.currency" formControlName="currency">
|
||||
<mat-error *ngIf="myError('currency', 'required')">City is required</mat-error>
|
||||
<!-- <mat-error *ngIf="myError('currency', 'maxlength')">Limit exceed</mat-error> -->
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<input placeholder="Working Hrs" matInput formControlName="workingHrsJson">
|
||||
<mat-error *ngIf="myError('workingHrsJson', 'required')">Working Hrs is required</mat-error>
|
||||
@ -74,7 +80,7 @@
|
||||
</ng-template>
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button type="submit" class="mat-green" mat-raised-button >{{action}}</button>
|
||||
<button mat-button (click)="closeDialog()" >Cancel</button>
|
||||
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
</ng-scrollbar>
|
||||
|
||||
|
||||
@ -93,6 +93,7 @@ export class AddBusinessComponent implements OnInit {
|
||||
busName: new FormControl('', [Validators.required]),
|
||||
address: new FormControl('', [Validators.required, Validators.maxLength(100)]),
|
||||
city: new FormControl('', [Validators.required]),
|
||||
currency: new FormControl('',[Validators.required]),
|
||||
state: new FormControl('', [Validators.required]),
|
||||
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
||||
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
||||
@ -130,6 +131,7 @@ export class AddBusinessComponent implements OnInit {
|
||||
this.formData.append('address', tmp.address);
|
||||
this.formData.append('state', tmp.state);
|
||||
this.formData.append('city', tmp.city);
|
||||
this.formData.append('currency',tmp.currency)
|
||||
console.log(this.formData)
|
||||
this.dialogRef.close({event:this.action,data:this.formData,admincheck:tmp.admin_checked});
|
||||
// console.log(this.form.value);
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
<h5 mat-dialog-title> <strong>Add Skills</strong>
|
||||
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="close()"
|
||||
><mat-icon>close</mat-icon></button></h5>
|
||||
<!-- <form [formGroup]="userForm" (ngSubmit)="send(userForm.value)" style="padding: 0px !important">
|
||||
<div ngFor="let skill of getPhonesFormControls(); let i = index">
|
||||
<mat-form-field class="example-full-width">
|
||||
<mat-label>Skills {{i}}</mat-label>
|
||||
<input type="text" matInput placeholder="Skills" [formControlName]="skill" required>
|
||||
</mat-form-field>
|
||||
<button (click)="removeSkills(i)" type="button" mat-mini-fab color="warn">
|
||||
<mat-icon>remove</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button (click)="addSkills()" type="button" mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
{{userForm.value | json}}
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button type="submit" class="mat-green" mat-raised-button >Add</button>
|
||||
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
</form> -->
|
||||
|
||||
<form [formGroup]="userForm" (ngSubmit)="send(userForm.value)">
|
||||
<ng-scrollbar class="scrollHV">
|
||||
<div *ngFor="let phone of getPhonesFormControls(); let i = index">
|
||||
<mat-form-field class="example-full-width" style="width: 85%;">
|
||||
<mat-label>Skills {{i}}</mat-label>
|
||||
<input type="text" matInput placeholder="Skills" [formControl]="phone" required>
|
||||
</mat-form-field>
|
||||
<!-- <input [formControl]="phone" type="text"> -->
|
||||
<button type="button" mat-mini-fab color="warn" (click)="removeSkills(i)"><mat-icon>remove</mat-icon></button>
|
||||
</div>
|
||||
|
||||
<div style="text-align: end;"><button type="button" mat-mini-fab color="warn" (click)="addSkills()"> <mat-icon>add</mat-icon></button></div>
|
||||
</ng-scrollbar>
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button type="submit" class="mat-green" mat-raised-button >Add</button>
|
||||
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
.scrollHV {
|
||||
height: calc(100vh - 169px);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AddSkillsComponent } from './add-skills.component';
|
||||
|
||||
describe('AddSkillsComponent', () => {
|
||||
let component: AddSkillsComponent;
|
||||
let fixture: ComponentFixture<AddSkillsComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ AddSkillsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AddSkillsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,78 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-skills',
|
||||
templateUrl: './add-skills.component.html',
|
||||
styleUrls: ['./add-skills.component.scss']
|
||||
})
|
||||
export class AddSkillsComponent implements OnInit {
|
||||
|
||||
userForm: FormGroup;
|
||||
findSkillsIndex: any;
|
||||
constructor(private formBuilder: FormBuilder, public dialog: MatDialog, private fb: FormBuilder,public dialogRef: MatDialogRef<AddSkillsComponent>,@Inject(MAT_DIALOG_DATA) public data) {
|
||||
console.log(data)
|
||||
|
||||
|
||||
let test = {
|
||||
"skills": data
|
||||
}
|
||||
|
||||
this.userForm = this.fb.group({
|
||||
skills: this.fb.array([
|
||||
this.fb.control(null)
|
||||
])
|
||||
})
|
||||
|
||||
if(data.length>1){
|
||||
|
||||
for(let i=1;i<=data.length-1;i++){
|
||||
//this.addFilterToFiltersFormArray2(i)
|
||||
//this.Select2 = true;
|
||||
this.addSkills()
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
this.userForm.patchValue(test)
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
}
|
||||
|
||||
|
||||
addSkills(): void {
|
||||
(this.userForm.get('skills') as FormArray).push(
|
||||
this.fb.control(null)
|
||||
);
|
||||
}
|
||||
|
||||
removeSkills(index) {
|
||||
(this.userForm.get('skills') as FormArray).removeAt(index);
|
||||
}
|
||||
|
||||
getPhonesFormControls(): AbstractControl[] {
|
||||
return (<FormArray> this.userForm.get('skills')).controls
|
||||
}
|
||||
|
||||
send(values) {
|
||||
console.log(values);
|
||||
this.dialogRef.close(values);
|
||||
}
|
||||
|
||||
|
||||
closeDialog(){
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
close() {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,6 +14,8 @@ import { ConsultantSettingComponent } from './consultant-setting/consultant-sett
|
||||
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
||||
import { UnavailabilityComponent } from './unavailability/unavailability.component';
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
import { AddSkillsComponent } from './add-skills/add-skills.component';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
|
||||
|
||||
const customNotifierOptions: NotifierOptions = {
|
||||
@ -63,7 +65,8 @@ const customNotifierOptions: NotifierOptions = {
|
||||
EditWorkingHoursComponent,
|
||||
ExtraWorkingHoursComponent,
|
||||
AssignServiceComponent,
|
||||
UnavailabilityComponent
|
||||
UnavailabilityComponent,
|
||||
AddSkillsComponent
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
@ -73,7 +76,7 @@ const customNotifierOptions: NotifierOptions = {
|
||||
MatSidenavModule,
|
||||
SharedModule,
|
||||
MatFormFieldModule,
|
||||
NotifierModule.withConfig(customNotifierOptions),
|
||||
NotifierModule.withConfig(customNotifierOptions),MatInputModule
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
@ -15,8 +15,11 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<ng-scrollbar class="scrollHV2">
|
||||
<div fxLayout="row wrap mt-2 mb-2" class="flexRow">
|
||||
|
||||
<div fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap" *ngFor="let consultant of consultants | searchFilter:filterdata : 'consultants'">
|
||||
|
||||
<div class="consultant-list-card card-inner-circle-orange" (click)="redirectToSetting(consultant)">
|
||||
<!-- <div class="consultant-content"> -->
|
||||
<div class="pad-wrap" >
|
||||
@ -69,8 +72,10 @@
|
||||
</div> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ng-scrollbar>
|
||||
</div>
|
||||
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap">
|
||||
<app-summary></app-summary>
|
||||
@ -178,14 +183,14 @@
|
||||
<input type="text" matInput placeholder="Qualification" [(ngModel)]="qualification">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<!-- <div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Designation <span style="margin-left: 3.7rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.designtion}}</a>
|
||||
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
<mat-label>Designation</mat-label>
|
||||
<input type="text" matInput placeholder="Designation" [(ngModel)]="designtion">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Experience <span style="margin-left: 5rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.exp}}</a>
|
||||
@ -195,22 +200,29 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>No of Slot Days <span style="margin-left: 2rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.slotDays}}</a>
|
||||
<label>Advanced Booking Allowed Days <span style="margin-left: 2rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.days}}</a>
|
||||
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
<mat-label>No of Slot Days</mat-label>
|
||||
<input type="text" matInput placeholder="Experience" [(ngModel)]="slotDays">
|
||||
<input type="text" matInput placeholder="Experience" [(ngModel)]="days">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Skills <span style="margin-left: 4rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.skills}}</a>
|
||||
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
<mat-list>
|
||||
<mat-list-item *ngFor="let skill of skills">{{skill ? "* "+skill:"" }}</mat-list-item>
|
||||
<mat-list-item><button mat-mini-fab color="warn" type="button" *ngIf="isEditable == true" (click)="addSkills()"><mat-icon>add</mat-icon></button></mat-list-item>
|
||||
</mat-list>
|
||||
<!-- <div *ngFor="let skill of skills">
|
||||
<span style="padding: 5px;" *ngIf="isEditable == false">{{skill}},</span>
|
||||
</div>-->
|
||||
|
||||
<!-- <mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
<mat-label>Skills</mat-label>
|
||||
<mat-select [(ngModel)]="skills" multiple>
|
||||
<mat-option *ngFor="let skillsDetails of skillsOption" [value]="skillsDetails.name">{{skillsDetails.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Caption <span style="margin-left: 4rem;">-</span></label>
|
||||
|
||||
@ -585,7 +585,7 @@ box-sizing: border-box;
|
||||
line-height: 15px;
|
||||
}
|
||||
.scrollHV {
|
||||
height: calc(100vh - 200px);
|
||||
height: calc(100vh - 240px);
|
||||
}
|
||||
::ng-deep .mat-form-field-infix {
|
||||
height: 50px!important;
|
||||
@ -638,3 +638,6 @@ content: "\20B9";
|
||||
|
||||
|
||||
|
||||
.scrollHV2{
|
||||
height: calc(100vh - 305px);
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
import { LocationStrategy } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
@ -11,6 +11,8 @@ import { ConsultantService } from '../consultant-service/consultant.service';
|
||||
import { EditWorkingHoursComponent } from '../edit-working-hours/edit-working-hours.component';
|
||||
import { ExtraWorkingHoursComponent } from '../extra-working-hours/extra-working-hours.component';
|
||||
import { UnavailabilityComponent } from '../unavailability/unavailability.component';
|
||||
import { AddSkillsComponent } from '../add-skills/add-skills.component';
|
||||
import { json } from 'd3';
|
||||
|
||||
@Component({
|
||||
selector: 'app-consultant-setting',
|
||||
@ -43,11 +45,10 @@ export class ConsultantSettingComponent implements OnInit {
|
||||
"languages": null,
|
||||
"workingHours": JSON.stringify([{"sunday":{"hours":[{"startTime":"09:30 am","endTime":"06:00 pm","day":"sunday","value":null}],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"tuesday","value":null}],"breaks":[]}},{"wednesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"wednesday","value":null}],"breaks":[]}},{"thursday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"thursday","value":null}],"breaks":[]}},{"friday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"friday","value":null}],"breaks":[]}},{"saturday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"saturday","value":null}],"breaks":[]}}]),
|
||||
// "dob": null,
|
||||
"designtion": null,
|
||||
// "designtion": null,
|
||||
"gender": null,
|
||||
"description":null,
|
||||
"skills": [],
|
||||
"slotDays":null,
|
||||
"skills": [],
|
||||
"caption": null,
|
||||
"isActive": "1",
|
||||
|
||||
@ -66,12 +67,12 @@ export class ConsultantSettingComponent implements OnInit {
|
||||
caption:any = [];
|
||||
// dob: any=[];
|
||||
languages: any=[];
|
||||
designtion: any=[];
|
||||
slotDays: any = [];
|
||||
// designtion: any=[];
|
||||
days: any = [];
|
||||
exp: any=[];
|
||||
qualification: any=[];
|
||||
id: any;
|
||||
public end_User_Url = environment.endUserUrl;
|
||||
public end_User_Url = environment.endUserUrl;
|
||||
endUserURL: any;
|
||||
userRole:any=[];
|
||||
genderOption:any = [{'name':'Male'},{'name':'Female'}]
|
||||
@ -81,7 +82,9 @@ export class ConsultantSettingComponent implements OnInit {
|
||||
consultants: any = [];
|
||||
frontDeskHidden: any = 0;
|
||||
frontDeskPractdetails: any = [];
|
||||
constructor(private notifierService: NotifierService,private formBuilder: FormBuilder, public dialog: MatDialog, public _con:ConsultantService, private fb: FormBuilder, public _api:ConsultantService,private locationStrategy: LocationStrategy) {}
|
||||
constructor(private notifierService: NotifierService,private formBuilder: FormBuilder, public dialog: MatDialog, public _con:ConsultantService, private fb: FormBuilder, public _api:ConsultantService,private locationStrategy: LocationStrategy) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
@ -119,7 +122,9 @@ getCosultantList() {
|
||||
this._con.getCosultantListDetails(param).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
console.log(res.data)
|
||||
this.consultants = res.data;
|
||||
this.consultants = res.data;
|
||||
this.consultants = this.consultants.filter(val => val.role == 'PRACTITIONER')
|
||||
console.log(this.consultants)
|
||||
}
|
||||
else{
|
||||
this.consultants=[];
|
||||
@ -233,8 +238,7 @@ unavailability(action,obj) {
|
||||
"languages": null,
|
||||
"workingHours": JSON.stringify( [{"sunday":{"hours":[],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[],"breaks":[]}},{"wednesday":{"hours":[],"breaks":[]}},{"thursday":{"hours":[],"breaks":[]}},{"friday":{"hours":[],"breaks":[]}},{"saturday":{"hours":[],"breaks":[]}}]),
|
||||
// "dob": null,
|
||||
"designtion": null,
|
||||
"slotDays": null,
|
||||
// "designtion": null,
|
||||
"gender": null,
|
||||
"description":null,
|
||||
"skills": [],
|
||||
@ -287,8 +291,8 @@ unavailability(action,obj) {
|
||||
this.exp=this.practitionerdetails.exp
|
||||
this.languages=this.practitionerdetails.languages
|
||||
this.qualification=this.practitionerdetails.qualification
|
||||
this.designtion=this.practitionerdetails.designtion
|
||||
this.slotDays = this.practitionerdetails.slotDays
|
||||
// this.designtion=this.practitionerdetails.designtion
|
||||
this.days = this.practitionerdetails.days
|
||||
console.log(this.gender)
|
||||
|
||||
// this.workinghours = this.practitionerdetails.workingHours
|
||||
@ -478,12 +482,12 @@ unavailability(action,obj) {
|
||||
// "fees": "800",
|
||||
"languages": this.languages,
|
||||
// "dob": this.dob,
|
||||
"designtion": this.qualification,
|
||||
"slotDays": this.slotDays,
|
||||
// "designtion": this.qualification,
|
||||
"days": this.days,
|
||||
"gender": this.gender,
|
||||
"workingHours": JSON.stringify( tmp),
|
||||
"workingHours": JSON.stringify(tmp),
|
||||
"description": this.description,
|
||||
"skills": JSON.stringify(this.skills),
|
||||
"skills":this.skills,
|
||||
"caption": this.caption,
|
||||
"userName": this.userName,
|
||||
"practitionerId":userid
|
||||
@ -510,6 +514,31 @@ unavailability(action,obj) {
|
||||
|
||||
}
|
||||
|
||||
addSkills(){
|
||||
const dialogRef = this.dialog.open(AddSkillsComponent, {
|
||||
width: '30%',
|
||||
height: '100%',
|
||||
// maxWidth: '38vw',
|
||||
position: { right: '0' },
|
||||
// disableClose: true ,
|
||||
// panelClass: 'custom-dialog-container',
|
||||
|
||||
data: this.skills
|
||||
});
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
console.log(result)
|
||||
|
||||
console.log(this.skills)
|
||||
if(result != undefined){
|
||||
this.skills = result.skills
|
||||
this.notifierService.notify('success', 'Skills Added Successfully');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
copyToClipBoard(message) {
|
||||
this.copiedKey = 1
|
||||
console.log(message)
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
</div>
|
||||
<ng-scrollbar class="scrollHV">
|
||||
|
||||
<form [formGroup]="dynamicForm">
|
||||
<div formArrayName="filters">
|
||||
<form [formGroup]="dynamicForm1">
|
||||
<div formArrayName="filters1">
|
||||
<div *ngFor="let filter of filtersFormArray.controls; let i = index;">
|
||||
<div [formGroupName]="i" class="container">
|
||||
<div class="dis-flexs">
|
||||
@ -29,8 +29,8 @@
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime" [disabled]="Select1 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
<mat-option (click)="hiddenSelectedTime2(i,selectFilterTimeDropdown,1)"
|
||||
*ngFor="let startTime of fliterTimeSelect2(selectFilterTimeDropdown,i)"
|
||||
[value]="startTime">
|
||||
{{ startTime }}
|
||||
</mat-option>
|
||||
@ -42,8 +42,8 @@
|
||||
placeholder="Select Time"
|
||||
#apiField
|
||||
formControlName="endTime" [disabled]="Select1 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
<mat-option (click)="hiddenSelectedTime(i,selectFilterTimeDropdown,1)"
|
||||
*ngFor="let endTime of fliterTimeSelect3(selectFilterTimeDropdown,i)"
|
||||
[value]="endTime">
|
||||
{{ endTime }}
|
||||
</mat-option>
|
||||
@ -57,14 +57,13 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="addFilterToFiltersFormArray()">
|
||||
add
|
||||
</mat-icon>
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="removeFilterFromFiltersFormArray(i)">
|
||||
delete
|
||||
</mat-icon>
|
||||
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray(i)" [disabled]="Select1 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">add</mat-icon>
|
||||
</button>
|
||||
<button (click)="removeFilterFromFiltersFormArray(i)" [disabled]="Select1 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">delete</mat-icon>
|
||||
</button>
|
||||
<!-- <a *ngIf="i == 0" (click)="applyToAll(1,selectFilterTimeDropdown)">Apply to All</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -101,9 +100,9 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime" [disabled]="Select2 !=true">
|
||||
formControlName="startTime" [disabled]="Select2 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
*ngFor="let startTime of fliterTimeSelect2(selectFilterTimeDropdown2,i)" (click)="hiddenSelectedTime2(i,selectFilterTimeDropdown2,2)"
|
||||
[value]="startTime">
|
||||
{{ startTime }}
|
||||
</mat-option>
|
||||
@ -116,7 +115,7 @@
|
||||
#apiField
|
||||
formControlName="endTime" [disabled]="Select2 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
*ngFor="let endTime of fliterTimeSelect3(selectFilterTimeDropdown2,i)" (click)="hiddenSelectedTime(i,selectFilterTimeDropdown2,2)"
|
||||
[value]="endTime">
|
||||
{{ endTime }}
|
||||
</mat-option>
|
||||
@ -130,14 +129,13 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="addFilterToFiltersFormArray2()">
|
||||
add
|
||||
</mat-icon>
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="removeFilterFromFiltersFormArray2(i)">
|
||||
delete
|
||||
</mat-icon>
|
||||
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray2(i)" [disabled]="Select2 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">add</mat-icon>
|
||||
</button>
|
||||
<button (click)="removeFilterFromFiltersFormArray2(i)" [disabled]="Select2 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">delete</mat-icon>
|
||||
</button>
|
||||
<!-- <a *ngIf="i == 0" (click)="applyToAll(2,selectFilterTimeDropdown2)">Apply to All</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -176,7 +174,7 @@
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime" [disabled]="Select3 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
*ngFor="let startTime of fliterTimeSelect2(selectFilterTimeDropdown3,i)" (click)="hiddenSelectedTime2(i,selectFilterTimeDropdown3,3)"
|
||||
[value]="startTime">
|
||||
{{ startTime }}
|
||||
</mat-option>
|
||||
@ -189,7 +187,7 @@
|
||||
#apiField
|
||||
formControlName="endTime" [disabled]="Select3 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
*ngFor="let endTime of fliterTimeSelect3(selectFilterTimeDropdown3,i)" (click)="hiddenSelectedTime(i,selectFilterTimeDropdown3,3)"
|
||||
[value]="endTime">
|
||||
{{ endTime }}
|
||||
</mat-option>
|
||||
@ -203,14 +201,13 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="addFilterToFiltersFormArray3()">
|
||||
add
|
||||
</mat-icon>
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="removeFilterFromFiltersFormArray3(i)">
|
||||
delete
|
||||
</mat-icon>
|
||||
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray3(i)" [disabled]="Select3 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">add</mat-icon>
|
||||
</button>
|
||||
<button (click)="removeFilterFromFiltersFormArray3(i)" [disabled]="Select3 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">delete</mat-icon>
|
||||
</button>
|
||||
<!-- <a *ngIf="i == 0" (click)="applyToAll(3,selectFilterTimeDropdown3)">Apply to All</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -249,7 +246,7 @@
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime" [disabled]="Select4 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
*ngFor="let startTime of fliterTimeSelect2(selectFilterTimeDropdown4,i)" (click)="hiddenSelectedTime2(i,selectFilterTimeDropdown4,4)"
|
||||
[value]="startTime">
|
||||
{{ startTime }}
|
||||
</mat-option>
|
||||
@ -262,7 +259,7 @@
|
||||
#apiField
|
||||
formControlName="endTime" [disabled]="Select4 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
*ngFor="let endTime of fliterTimeSelect3(selectFilterTimeDropdown4,i)" (click)="hiddenSelectedTime(i,selectFilterTimeDropdown4,4)"
|
||||
[value]="endTime">
|
||||
{{ endTime }}
|
||||
</mat-option>
|
||||
@ -276,14 +273,13 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="addFilterToFiltersFormArray4()">
|
||||
add
|
||||
</mat-icon>
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="removeFilterFromFiltersFormArray4(i)">
|
||||
delete
|
||||
</mat-icon>
|
||||
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray4(i)" [disabled]="Select4 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">add</mat-icon>
|
||||
</button>
|
||||
<button (click)="removeFilterFromFiltersFormArray4(i)" [disabled]="Select4 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">delete</mat-icon>
|
||||
</button>
|
||||
<!-- <a *ngIf="i == 0" (click)="applyToAll(4,selectFilterTimeDropdown4)">Apply to All</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -322,7 +318,7 @@
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime" [disabled]="Select5 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
*ngFor="let startTime of fliterTimeSelect2(selectFilterTimeDropdown5,i)" (click)="hiddenSelectedTime2(i,selectFilterTimeDropdown5,5)"
|
||||
[value]="startTime">
|
||||
{{ startTime }}
|
||||
</mat-option>
|
||||
@ -335,7 +331,7 @@
|
||||
#apiField
|
||||
formControlName="endTime" [disabled]="Select5 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
*ngFor="let endTime of fliterTimeSelect3(selectFilterTimeDropdown5,i)" (click)="hiddenSelectedTime(i,selectFilterTimeDropdown5,5)"
|
||||
[value]="endTime">
|
||||
{{ endTime }}
|
||||
</mat-option>
|
||||
@ -349,14 +345,13 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="addFilterToFiltersFormArray5()">
|
||||
add
|
||||
</mat-icon>
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="removeFilterFromFiltersFormArray5(i)">
|
||||
delete
|
||||
</mat-icon>
|
||||
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray5(i)" [disabled]="Select5 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">add</mat-icon>
|
||||
</button>
|
||||
<button (click)="removeFilterFromFiltersFormArray5(i)" [disabled]="Select5 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">delete</mat-icon>
|
||||
</button>
|
||||
<!-- <a *ngIf="i == 0" (click)="applyToAll(5,selectFilterTimeDropdown5)">Apply to All</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -395,7 +390,7 @@
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime" [disabled]="Select6 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
*ngFor="let startTime of fliterTimeSelect2(selectFilterTimeDropdown6,i)" (click)="hiddenSelectedTime2(i,selectFilterTimeDropdown6,6)"
|
||||
[value]="startTime">
|
||||
{{ startTime }}
|
||||
</mat-option>
|
||||
@ -408,7 +403,7 @@
|
||||
#apiField
|
||||
formControlName="endTime" [disabled]="Select6 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
*ngFor="let endTime of fliterTimeSelect3(selectFilterTimeDropdown6,i)" (click)="hiddenSelectedTime(i,selectFilterTimeDropdown6,6)"
|
||||
[value]="endTime">
|
||||
{{ endTime }}
|
||||
</mat-option>
|
||||
@ -422,14 +417,13 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="addFilterToFiltersFormArray6()">
|
||||
add
|
||||
</mat-icon>
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="removeFilterFromFiltersFormArray6(i)">
|
||||
delete
|
||||
</mat-icon>
|
||||
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray6(i)" [disabled]="Select6 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">add</mat-icon>
|
||||
</button>
|
||||
<button (click)="removeFilterFromFiltersFormArray6(i)" [disabled]="Select6 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">delete</mat-icon>
|
||||
</button>
|
||||
<!-- <a *ngIf="i == 0" (click)="applyToAll(6,selectFilterTimeDropdown6)">Apply to All</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -468,7 +462,7 @@
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime" [disabled]="Select7 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
*ngFor="let startTime of fliterTimeSelect2(selectFilterTimeDropdown7,i)" (click)="hiddenSelectedTime2(i,selectFilterTimeDropdown7,7)"
|
||||
[value]="startTime">
|
||||
{{ startTime }}
|
||||
</mat-option>
|
||||
@ -481,7 +475,7 @@
|
||||
#apiField
|
||||
formControlName="endTime" [disabled]="Select7 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
*ngFor="let endTime of fliterTimeSelect3(selectFilterTimeDropdown7,i)" (click)="hiddenSelectedTime(i,selectFilterTimeDropdown7,7)"
|
||||
[value]="endTime">
|
||||
{{ endTime }}
|
||||
</mat-option>
|
||||
@ -495,14 +489,13 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="addFilterToFiltersFormArray7()">
|
||||
add
|
||||
</mat-icon>
|
||||
<mat-icon class="deleteRow"
|
||||
(click)="removeFilterFromFiltersFormArray7(i)">
|
||||
delete
|
||||
</mat-icon>
|
||||
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray7(i)" [disabled]="Select7 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">add</mat-icon>
|
||||
</button>
|
||||
<button (click)="removeFilterFromFiltersFormArray7(i)" [disabled]="Select7 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
|
||||
<mat-icon class="deleteRow">delete</mat-icon>
|
||||
</button>
|
||||
<!-- <a *ngIf="i == 0" (click)="applyToAll(7,selectFilterTimeDropdown7)">Apply to All</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
margin-left: 1rem;
|
||||
margin-top: 1.5rem;
|
||||
// color: #FFF;
|
||||
color: #111;
|
||||
// color: #111;
|
||||
cursor: pointer;
|
||||
// &:hover {
|
||||
// cursor: pointer;
|
||||
@ -143,3 +143,7 @@ mat-checkbox{
|
||||
.mat-dialog-container{
|
||||
padding: 24px 0px 0px 0px !important;
|
||||
}
|
||||
.container{ a:hover {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import { ConsultantService } from "../consultant-service/consultant.service";
|
||||
styleUrls: ["./edit-working-hours.component.scss"],
|
||||
})
|
||||
export class EditWorkingHoursComponent implements OnInit {
|
||||
startTimes = [
|
||||
startTimes:any = [
|
||||
"09:00 am",
|
||||
"09:30 am",
|
||||
"10:00 am",
|
||||
@ -19,8 +19,7 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
"11:00 am",
|
||||
"11:30 am",
|
||||
"12:00 pm",
|
||||
"12:30 pm",
|
||||
"01:00 pm",
|
||||
"12:30 pm",
|
||||
"01:00 pm",
|
||||
"01:30 pm",
|
||||
"02:00 pm",
|
||||
@ -48,8 +47,7 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
"11:30 am",
|
||||
"12:00 pm",
|
||||
"12:30 pm",
|
||||
"01:00 pm",
|
||||
"01:00 pm",
|
||||
"01:00 pm",
|
||||
"01:30 pm",
|
||||
"02:00 pm",
|
||||
"02:30 pm",
|
||||
@ -76,17 +74,17 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
"Friday",
|
||||
"Saturday",
|
||||
];
|
||||
seedData = [{ day: "Sunday", startTime: "09:00 am", endTime: "09:30 am" }];
|
||||
seedData = [{ day: "Sunday", startTime: "09:00 am", endTime: "06:00 pm" }];
|
||||
|
||||
Select1: any = true;
|
||||
Select2: any = true;
|
||||
Select3: any = true;
|
||||
Select4: any = true;
|
||||
Select5: any = true;
|
||||
Select6: any = true;
|
||||
Select7: any = true;
|
||||
Select1: any = false;
|
||||
Select2: any = false;
|
||||
Select3: any = false;
|
||||
Select4: any = false;
|
||||
Select5: any = false;
|
||||
Select6: any = false;
|
||||
Select7: any = false;
|
||||
|
||||
dynamicForm: FormGroup;
|
||||
dynamicForm1: FormGroup;
|
||||
dynamicForm2: FormGroup;
|
||||
dynamicForm3: FormGroup;
|
||||
dynamicForm4: FormGroup;
|
||||
@ -99,6 +97,13 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
practitioner:any =[];
|
||||
// timing: any[] = ['09:00am','09:30am','10:00am','10:30am','11:00am','11:30am','12:00am','12:30am','01:00pm','01:00pm','01:30pm', '02:00pm', '02:30pm', '03:00pm', '03:30pm', '04:00pm', '04:30pm', '05:00pm', '05:30pm', '06:00pm', '06:30pm', '07:00pm', '07:30pm', '08:00pm','08:30pm', '09:00pm',]
|
||||
doctor:any=[];
|
||||
selectFilterTimeDropdown: any=[];
|
||||
selectFilterTimeDropdown2: any=[];
|
||||
selectFilterTimeDropdown3: any=[];
|
||||
selectFilterTimeDropdown4: any=[];
|
||||
selectFilterTimeDropdown5: any=[];
|
||||
selectFilterTimeDropdown6: any=[];
|
||||
selectFilterTimeDropdown7: any=[];
|
||||
constructor(private notifierService: NotifierService,
|
||||
public dialogRef: MatDialogRef<EditWorkingHoursComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data,
|
||||
@ -131,6 +136,14 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
// }
|
||||
|
||||
ngOnInit() {
|
||||
this.selectFilterTimeDropdown.push([[this.startTimes],[this.endTimes]])
|
||||
this.selectFilterTimeDropdown2.push([[this.startTimes],[this.endTimes]])
|
||||
this.selectFilterTimeDropdown3.push([[this.startTimes],[this.endTimes]])
|
||||
this.selectFilterTimeDropdown4.push([[this.startTimes],[this.endTimes]])
|
||||
this.selectFilterTimeDropdown5.push([[this.startTimes],[this.endTimes]])
|
||||
this.selectFilterTimeDropdown6.push([[this.startTimes],[this.endTimes]])
|
||||
this.selectFilterTimeDropdown7.push([[this.startTimes],[this.endTimes]])
|
||||
console.log(this.selectFilterTimeDropdown)
|
||||
this.doctor = JSON.parse(localStorage.getItem('practitioner'))
|
||||
console.log (this.doctor)
|
||||
this.datainputForm = this.fb.group({
|
||||
@ -139,8 +152,8 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
dropDownTest1: "",
|
||||
});
|
||||
|
||||
this.dynamicForm = this.fb.group({
|
||||
filters: this.fb.array([]),
|
||||
this.dynamicForm1 = this.fb.group({
|
||||
filters1: this.fb.array([]),
|
||||
});
|
||||
this.dynamicForm2 = this.fb.group({
|
||||
filters2: this.fb.array([]),
|
||||
@ -169,28 +182,49 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
this.seedFiltersFormArray7();
|
||||
//setInterval(() => {
|
||||
|
||||
|
||||
let sunday ={filters :this.data[0].sunday.hours }
|
||||
for(let i=0;i<=this.data[0].sunday.hours.length-1;i++){
|
||||
this.addFilterToFiltersFormArray()
|
||||
this.dynamicForm.patchValue(sunday)
|
||||
}
|
||||
console.log(this.data)
|
||||
let sunday ={filters1 :this.data[0].sunday.hours }
|
||||
if(this.data[0].sunday.hours.length>1){
|
||||
console.log('length')
|
||||
for(let i=1;i<=this.data[0].sunday.hours.length-1;i++){
|
||||
this.addFilterToFiltersFormArray(i)
|
||||
this.Select1 = true;
|
||||
}
|
||||
}else {
|
||||
if(this.data[0].sunday.hours.length == 1){
|
||||
console.log('else length')
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
this.Select1 = true;
|
||||
}
|
||||
}
|
||||
this.dynamicForm1.patchValue(sunday)
|
||||
|
||||
// if(this.data[0].sunday.hours.length>1){
|
||||
|
||||
// }
|
||||
this.dynamicForm.patchValue(sunday)
|
||||
// this.dynamicForm.patchValue(sunday)
|
||||
|
||||
// this.data[1].monday.hours.forEach(element => {
|
||||
// element.value = null
|
||||
|
||||
// });
|
||||
let monday ={filters2 :this.data[1].monday.hours }
|
||||
for(let i=0;i<=this.data[1].monday.hours.length-2;i++){
|
||||
console.log(monday)
|
||||
this.addFilterToFiltersFormArray2()
|
||||
this.dynamicForm2.patchValue(monday)
|
||||
}
|
||||
this.dynamicForm2.patchValue(monday)
|
||||
console.log(this.data[1].monday.hours.length)
|
||||
if(this.data[1].monday.hours.length>1){
|
||||
console.log('length')
|
||||
for(let i=1;i<=this.data[1].monday.hours.length-1;i++){
|
||||
this.addFilterToFiltersFormArray2(i)
|
||||
this.Select2 = true;
|
||||
}
|
||||
}else {
|
||||
if(this.data[1].monday.hours.length == 1){
|
||||
console.log('else length')
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
this.Select2 = true;
|
||||
}
|
||||
}
|
||||
this.dynamicForm2.patchValue(monday)
|
||||
// this.dynamicForm2.patchValue(monday)
|
||||
// if(this.data[1].monday.hours.length>1){
|
||||
// this.addFilterToFiltersFormArray2()
|
||||
// }
|
||||
@ -200,61 +234,106 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
// if(this.data[2].tuesday.hours.length>1){
|
||||
// this.addFilterToFiltersFormArray3()
|
||||
// }
|
||||
for(let i=0;i<=this.data[2].tuesday.hours.length-2;i++){
|
||||
// console.log(monday)
|
||||
this.addFilterToFiltersFormArray3()
|
||||
this.dynamicForm3.patchValue(tuesday)
|
||||
}
|
||||
if(this.data[2].tuesday.hours.length>1){
|
||||
console.log('length')
|
||||
for(let i=1;i<=this.data[2].tuesday.hours.length-1;i++){
|
||||
this.addFilterToFiltersFormArray3(i)
|
||||
this.Select3 = true;
|
||||
}
|
||||
}else {
|
||||
if(this.data[2].tuesday.hours.length == 1){
|
||||
console.log('else length')
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
this.Select3 = true;
|
||||
}
|
||||
}
|
||||
this.dynamicForm3.patchValue(tuesday)
|
||||
|
||||
// this.dynamicForm3.patchValue(tuesday)
|
||||
|
||||
let wednesday ={filters4 :this.data[3].wednesday.hours }
|
||||
// if(this.data[3].wednesday.hours.length>1){
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
// }
|
||||
for(let i=0;i<=this.data[3].wednesday.hours.length-2;i++){
|
||||
// }
|
||||
// console.log(monday)
|
||||
this.addFilterToFiltersFormArray4()
|
||||
|
||||
this.dynamicForm4.patchValue(wednesday)
|
||||
}
|
||||
this.dynamicForm4.patchValue(wednesday)
|
||||
let thursday ={filters5 :this.data[4].thursday.hours }
|
||||
if(this.data[3].wednesday.hours.length>1){
|
||||
console.log('length')
|
||||
for(let i=1;i<=this.data[3].wednesday.hours.length-1;i++){
|
||||
this.addFilterToFiltersFormArray4(i)
|
||||
this.Select4 = true;
|
||||
}
|
||||
}else {
|
||||
if(this.data[3].wednesday.hours.length == 1){
|
||||
console.log('else length')
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
this.Select4 = true;
|
||||
}
|
||||
}
|
||||
this.dynamicForm4.patchValue(wednesday)
|
||||
|
||||
// this.dynamicForm4.patchValue(wednesday)
|
||||
let thursday ={filters5 :this.data[4].thursday.hours }
|
||||
// if(this.data[4].thursday.hours.length>1){
|
||||
// this.addFilterToFiltersFormArray5()
|
||||
// }
|
||||
for(let i=0;i<=this.data[4].thursday.hours.length-2;i++){
|
||||
// console.log(monday)
|
||||
this.addFilterToFiltersFormArray5()
|
||||
|
||||
this.dynamicForm5.patchValue(thursday)
|
||||
if(this.data[4].thursday.hours.length>1){
|
||||
console.log('length')
|
||||
for(let i=1;i<=this.data[4].thursday.hours.length-1;i++){
|
||||
this.addFilterToFiltersFormArray5(i)
|
||||
this.Select5 = true;
|
||||
}
|
||||
this.dynamicForm5.patchValue(thursday)
|
||||
}else {
|
||||
if(this.data[4].thursday.hours.length == 1){
|
||||
console.log('else length')
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
this.Select5 = true;
|
||||
}
|
||||
}
|
||||
this.dynamicForm5.patchValue(thursday)
|
||||
|
||||
// this.dynamicForm5.patchValue(thursday)
|
||||
// this.dynamicForm5.patchValue(thursday)
|
||||
let friday ={filters6 :this.data[5].friday.hours }
|
||||
// if(this.data[5].friday.hours.length>1){
|
||||
// this.addFilterToFiltersFormArray6()
|
||||
// }
|
||||
for(let i=0;i<=this.data[5].friday.hours.length-2;i++){
|
||||
// console.log(monday)
|
||||
this.addFilterToFiltersFormArray6()
|
||||
|
||||
|
||||
this.dynamicForm6.patchValue(friday)
|
||||
if(this.data[5].friday.hours.length>1){
|
||||
console.log('length')
|
||||
for(let i=1;i<=this.data[5].friday.hours.length-1;i++){
|
||||
this.addFilterToFiltersFormArray6(i)
|
||||
this.Select6 = true;
|
||||
}
|
||||
|
||||
this.dynamicForm6.patchValue(friday)
|
||||
}else {
|
||||
if(this.data[5].friday.hours.length == 1){
|
||||
console.log('else length')
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
this.Select6 = true;
|
||||
}
|
||||
}
|
||||
this.dynamicForm6.patchValue(friday)
|
||||
|
||||
|
||||
// this.dynamicForm6.patchValue(friday)
|
||||
let saturday ={filters7 :this.data[6].saturday.hours }
|
||||
// if(this.data[6].saturday.hours.length>1){
|
||||
// this.addFilterToFiltersFormArray7()
|
||||
// }
|
||||
for(let i=0;i<=this.data[6].saturday.hours.length-2;i++){
|
||||
// console.log(monday)
|
||||
this.addFilterToFiltersFormArray7()
|
||||
|
||||
|
||||
this.dynamicForm7.patchValue(saturday)
|
||||
if(this.data[6].saturday.hours.length>1){
|
||||
console.log('length')
|
||||
for(let i=1;i<=this.data[6].saturday.hours.length-1;i++){
|
||||
this.addFilterToFiltersFormArray7(i)
|
||||
this.Select7 = true;
|
||||
}
|
||||
this.dynamicForm7.patchValue(saturday)
|
||||
}else {
|
||||
if(this.data[6].saturday.hours.length == 1){
|
||||
console.log('else length')
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
this.Select7 = true;
|
||||
}
|
||||
}
|
||||
this.dynamicForm7.patchValue(saturday)
|
||||
|
||||
// this.dynamicForm7.patchValue(saturday)
|
||||
// this.dynamicForm7.patchValue(saturday)
|
||||
|
||||
// }, 2000);
|
||||
@ -356,26 +435,121 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
addFilterToFiltersFormArray() {
|
||||
addFilterToFiltersFormArray(i) {
|
||||
this.filtersFormArray.push(this.createFilterGroup());
|
||||
// this.hiddenSelectedTime(i)
|
||||
let index = this.startTimes.indexOf(this.dynamicForm1.value.filters1[i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this.dynamicForm1.value.filters1[i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
// if(this.selectFilterTimeDropdown.length){
|
||||
this.selectFilterTimeDropdown.push([[filteredTimes],[filteredTimes2]])
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
addFilterToFiltersFormArray2() {
|
||||
this.filtersFormArray2.push(this.createFilterGroup2());
|
||||
addFilterToFiltersFormArray2(i) {
|
||||
this.filtersFormArray2.push(this.createFilterGroup());
|
||||
|
||||
let index = this.startTimes.indexOf(this.dynamicForm2.value.filters2[i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this.dynamicForm2.value.filters2[i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
// if(this.selectFilterTimeDropdown.length){
|
||||
this.selectFilterTimeDropdown2.push([[filteredTimes],[filteredTimes2]])
|
||||
|
||||
}
|
||||
addFilterToFiltersFormArray3() {
|
||||
addFilterToFiltersFormArray3(i) {
|
||||
this.filtersFormArray3.push(this.createFilterGroup());
|
||||
// this.hiddenSelectedTime(i)
|
||||
let index = this.startTimes.indexOf(this.dynamicForm3.value.filters3[i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this.dynamicForm3.value.filters3[i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
// if(this.selectFilterTimeDropdown.length){
|
||||
this.selectFilterTimeDropdown3.push([[filteredTimes],[filteredTimes2]])
|
||||
// }
|
||||
|
||||
}
|
||||
addFilterToFiltersFormArray4() {
|
||||
addFilterToFiltersFormArray4(i) {
|
||||
this.filtersFormArray4.push(this.createFilterGroup());
|
||||
// this.hiddenSelectedTime(i)
|
||||
let index = this.startTimes.indexOf(this.dynamicForm4.value.filters4[i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this.dynamicForm4.value.filters4[i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
// if(this.selectFilterTimeDropdown.length){
|
||||
this.selectFilterTimeDropdown4.push([[filteredTimes],[filteredTimes2]])
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
addFilterToFiltersFormArray5() {
|
||||
addFilterToFiltersFormArray5(i) {
|
||||
this.filtersFormArray5.push(this.createFilterGroup());
|
||||
// this.hiddenSelectedTime(i)
|
||||
let index = this.startTimes.indexOf(this.dynamicForm5.value.filters5[i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this.dynamicForm5.value.filters5[i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
// if(this.selectFilterTimeDropdown.length){
|
||||
this.selectFilterTimeDropdown5.push([[filteredTimes],[filteredTimes2]])
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
addFilterToFiltersFormArray6() {
|
||||
addFilterToFiltersFormArray6(i) {
|
||||
this.filtersFormArray6.push(this.createFilterGroup());
|
||||
// this.hiddenSelectedTime(i)
|
||||
let index = this.startTimes.indexOf(this.dynamicForm6.value.filters6[i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this.dynamicForm6.value.filters6[i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
// if(this.selectFilterTimeDropdown.length){
|
||||
this.selectFilterTimeDropdown6.push([[filteredTimes],[filteredTimes2]])
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
addFilterToFiltersFormArray7() {
|
||||
addFilterToFiltersFormArray7(i) {
|
||||
this.filtersFormArray7.push(this.createFilterGroup());
|
||||
// this.hiddenSelectedTime(i)
|
||||
let index = this.startTimes.indexOf(this.dynamicForm7.value.filters7[i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this.dynamicForm7.value.filters7[i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
// if(this.selectFilterTimeDropdown.length){
|
||||
this.selectFilterTimeDropdown7.push([[filteredTimes],[filteredTimes2]])
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
removeFilterFromFiltersFormArray(index) {
|
||||
@ -411,7 +585,7 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
save() {
|
||||
this.Answer = [];
|
||||
let tmp = [
|
||||
this.dynamicForm.value,
|
||||
this.dynamicForm1.value,
|
||||
this.dynamicForm2.value,
|
||||
this.dynamicForm3.value,
|
||||
this.dynamicForm4.value,
|
||||
@ -422,7 +596,7 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
console.log(tmp);
|
||||
if (this.Select1 == true) {
|
||||
this.Answer.push( {sunday: {
|
||||
hours:this.dynamicForm.value.filters,
|
||||
hours:this.dynamicForm1.value.filters1,
|
||||
|
||||
breaks: [],
|
||||
}});
|
||||
@ -535,7 +709,7 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
}
|
||||
|
||||
get filtersFormArray() {
|
||||
return <FormArray>this.dynamicForm.get("filters");
|
||||
return <FormArray>this.dynamicForm1.get("filters1");
|
||||
}
|
||||
get filtersFormArray2() {
|
||||
return <FormArray>this.dynamicForm2.get("filters2");
|
||||
@ -583,11 +757,178 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
showOptions(event: MatCheckboxChange, value): void {
|
||||
console.log(event.checked, value);
|
||||
if (value == "sunday" && event.checked == true) {
|
||||
this.Answer.push(this.dynamicForm.value);
|
||||
this.Answer.push(this.dynamicForm1.value);
|
||||
}
|
||||
|
||||
|
||||
// this.form['value'].admin_checked = event.checked
|
||||
// console.log(this.form['value'].admin_checked)
|
||||
}
|
||||
|
||||
fliterTimeSelect(endTimes,startTimes,i){
|
||||
// console.log(endTimes,startTimes,i)
|
||||
const currentTime = startTimes[i]; // Get the current time
|
||||
//console.log(currentTime)
|
||||
const filteredTimes = endTimes.filter(time => time > currentTime);
|
||||
//console.log(filteredTimes)
|
||||
return filteredTimes
|
||||
|
||||
// let dd = [[endTimes],[startTimes]]
|
||||
// console.log(dd)
|
||||
|
||||
}
|
||||
|
||||
fliterTimeSelect2(data , i)
|
||||
{
|
||||
//console.log(data[i][0])
|
||||
return data[i][0][0]
|
||||
}
|
||||
|
||||
fliterTimeSelect3(data , i)
|
||||
{
|
||||
//console.log(data[i])
|
||||
return data[i][1][0]
|
||||
}
|
||||
|
||||
hiddenSelectedTime(i,selectFilterTimeDropdown,num){
|
||||
|
||||
console.log('222',this['dynamicForm'+num].value['filters'+num])
|
||||
|
||||
let index = this.startTimes.indexOf(this['dynamicForm'+num].value['filters'+num][i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this['dynamicForm'+num].value['filters'+num][i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
// if(this.selectFilterTimeDropdown.length){
|
||||
// this.selectFilterTimeDropdown.push([[filteredTimes],[filteredTimes2]])
|
||||
// }
|
||||
console.log(i,filteredTimes,filteredTimes2, selectFilterTimeDropdown )
|
||||
|
||||
selectFilterTimeDropdown[i+1][0][0] = filteredTimes
|
||||
// this.selectFilterTimeDropdown.push([[filteredTimes],[filteredTimes2]])
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
hiddenSelectedTime2(i,selectFilterTimeDropdown,num){
|
||||
console.log('111',this['dynamicForm'+num].value)
|
||||
|
||||
|
||||
|
||||
let index = this.startTimes.indexOf(this['dynamicForm'+num].value['filters'+num][i].endTime);
|
||||
let index2 = this.startTimes.indexOf(this['dynamicForm'+num].value['filters'+num][i].startTime);
|
||||
// const filteredTimes = this.startTimes.filter(function(item) {
|
||||
// return this.startTimes.indexOf(item) > index
|
||||
// });
|
||||
|
||||
const filteredTimes = this.startTimes.filter(time => this.startTimes.indexOf(time) > index);
|
||||
const filteredTimes2 = this.endTimes.filter(time => this.endTimes.indexOf(time) > index2);
|
||||
selectFilterTimeDropdown[i][1][0] = filteredTimes2
|
||||
// console.log(this.selectFilterTimeDropdown[i][1][0],filteredTimes2)
|
||||
console.log(this.startTimes,filteredTimes,filteredTimes2, this.selectFilterTimeDropdown)
|
||||
}
|
||||
|
||||
applyToAll(i,param){
|
||||
|
||||
// this.seedFiltersFormArray();
|
||||
// this.seedFiltersFormArray2();
|
||||
// this.seedFiltersFormArray3();
|
||||
// this.seedFiltersFormArray4();
|
||||
// this.seedFiltersFormArray5();
|
||||
// this.seedFiltersFormArray6();
|
||||
// this.seedFiltersFormArray7();
|
||||
|
||||
console.log(i,param)
|
||||
let num = i
|
||||
this.selectFilterTimeDropdown = param
|
||||
this.selectFilterTimeDropdown2 = param
|
||||
this.selectFilterTimeDropdown3 = param
|
||||
this.selectFilterTimeDropdown4 = param
|
||||
this.selectFilterTimeDropdown5 = param
|
||||
this.selectFilterTimeDropdown6 = param
|
||||
this.selectFilterTimeDropdown7 = param
|
||||
console.log(this['dynamicForm'+num].value['filters'+num])
|
||||
|
||||
let sunday ={filters1 :this['dynamicForm'+num].value['filters'+num] }
|
||||
let monday ={filters2 :this['dynamicForm'+num].value['filters'+num] }
|
||||
let tuesday ={filters3 :this['dynamicForm'+num].value['filters'+num] }
|
||||
let wednesday ={filters4 :this['dynamicForm'+num].value['filters'+num] }
|
||||
let thursday ={filters5 :this['dynamicForm'+num].value['filters'+num] }
|
||||
let friday ={filters6:this['dynamicForm'+num].value['filters'+num] }
|
||||
let saturday ={filters7 :this['dynamicForm'+num].value['filters'+num] }
|
||||
|
||||
if(this['dynamicForm'+num].value['filters'+num].length>1){
|
||||
console.log('length')
|
||||
for(let j=1;j<=this['dynamicForm'+num].value['filters'+num].length-1;j++){
|
||||
if(i != 1){
|
||||
console.log('1')
|
||||
this.filtersFormArray.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 2){
|
||||
console.log('2')
|
||||
this.filtersFormArray2.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 3){
|
||||
console.log('3')
|
||||
this.filtersFormArray3.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 4){
|
||||
console.log('4')
|
||||
this.filtersFormArray4.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 5){
|
||||
console.log('5')
|
||||
this.filtersFormArray5.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 6){
|
||||
console.log('6')
|
||||
this.filtersFormArray6.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 7){
|
||||
console.log('7')
|
||||
this.filtersFormArray7.push(this.createFilterGroup());
|
||||
}
|
||||
|
||||
// this.filtersFormArray2.push(this.createFilterGroup());
|
||||
// this.filtersFormArray3.push(this.createFilterGroup());
|
||||
// this.filtersFormArray4.push(this.createFilterGroup());
|
||||
// this.filtersFormArray5.push(this.createFilterGroup());
|
||||
// this.filtersFormArray6.push(this.createFilterGroup());
|
||||
// this.filtersFormArray7.push(this.createFilterGroup());
|
||||
|
||||
// this.Select7 = true;
|
||||
}
|
||||
}else {
|
||||
if(this['dynamicForm'+num].value['filters'+num].length == 1){
|
||||
console.log('else length')
|
||||
// this.addFilterToFiltersFormArray4()
|
||||
this.Select7 = true;
|
||||
}
|
||||
}
|
||||
this.dynamicForm1.patchValue(sunday)
|
||||
this.dynamicForm2.patchValue(monday)
|
||||
this.dynamicForm3.patchValue(tuesday)
|
||||
this.dynamicForm4.patchValue(wednesday)
|
||||
this.dynamicForm5.patchValue(thursday)
|
||||
this.dynamicForm6.patchValue(friday)
|
||||
this.dynamicForm7.patchValue(saturday)
|
||||
|
||||
|
||||
}
|
||||
|
||||
gg(){
|
||||
this.filtersFormArray.push(this.createFilterGroup());
|
||||
this.filtersFormArray2.push(this.createFilterGroup());
|
||||
this.filtersFormArray3.push(this.createFilterGroup());
|
||||
this.filtersFormArray4.push(this.createFilterGroup());
|
||||
this.filtersFormArray5.push(this.createFilterGroup());
|
||||
this.filtersFormArray6.push(this.createFilterGroup());
|
||||
this.filtersFormArray7.push(this.createFilterGroup());
|
||||
// this.addFilterToFiltersFormArray(i)
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
</ng-scrollbar>
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button type="submit" class="mat-green" mat-raised-button >{{action}}</button>
|
||||
<button mat-button (click)="closeDialog()" >Cancel</button>
|
||||
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="myError('assignService', 'required')">ServiceName is required</mat-error>
|
||||
<mat-error *ngIf="myError('assignService', 'maxlength')">Limit exceed</mat-error> </mat-form-field>
|
||||
<mat-error *ngIf="myError('assignService', 'maxlength')">Limit exceed</mat-error>
|
||||
</mat-form-field>
|
||||
<ng-template #elseTemplate>
|
||||
Sure to delete <b>{{local_data.servicesName}}</b>?
|
||||
</ng-template>
|
||||
|
||||
@ -49,7 +49,7 @@ this.getServicesList()
|
||||
}
|
||||
|
||||
getServicesList() {
|
||||
let param ={"busId": localStorage.getItem('busId')}
|
||||
let param ={"busId":localStorage.getItem('busId')}
|
||||
console.log(param)
|
||||
this._api.getServicesDetailsApi(param).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
|
||||
@ -36,6 +36,6 @@
|
||||
</div>
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button type="submit" class="mat-green" mat-raised-button >{{action}}</button>
|
||||
<button mat-button (click)="closeDialog()" >Cancel</button>
|
||||
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
@ -12,7 +12,7 @@
|
||||
<mat-error *ngIf="myError('businessselect', 'required')">Username is required</mat-error>
|
||||
<mat-error *ngIf="myError('businessselect', 'maxlength')">Limit exceed</mat-error>
|
||||
</mat-form-field> -->
|
||||
<mat-form-field appearance="outline" class="mat-pane">
|
||||
<mat-form-field appearance="outline" class="mat-pane" *ngIf="userrole != 'BADMIN'">
|
||||
<mat-label>Business</mat-label>
|
||||
<mat-select placeholder="Select Business" formControlName="businessselect" required [disabled]="disableBus ==0">
|
||||
<mat-option>--</mat-option>
|
||||
@ -32,6 +32,17 @@
|
||||
</mat-select>
|
||||
<mat-error *ngIf="myError('role', 'required')">role is required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field appearance="outline" class="mat-pane" *ngIf="form.get('role').value == 'PRACTITIONER'">
|
||||
<mat-label>Assign Service</mat-label>
|
||||
<mat-select placeholder="Select Role" formControlName="assignService" multiple required>
|
||||
<mat-option *ngFor="let details of servicesList" (onSelectionChange)="getValues($event,details)" [value]="details.serviceId">
|
||||
{{details.servicesName}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="myError('assignService', 'required')">ServiceName is required</mat-error>
|
||||
<mat-error *ngIf="myError('assignService', 'maxlength')">Limit exceed</mat-error>
|
||||
</mat-form-field> -->
|
||||
|
||||
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<mat-label>Name</mat-label>
|
||||
@ -89,7 +100,7 @@
|
||||
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button type="submit" class="mat-green" mat-raised-button >{{action}}</button>
|
||||
<button mat-button (click)="closeDialog()" >Cancel</button>
|
||||
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
</ng-scrollbar>
|
||||
</form>
|
||||
|
||||
@ -4,6 +4,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { Router } from '@angular/router';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { BusinessService } from 'app/appoinment/business/business-service/business.service';
|
||||
import { ApiServiceService } from 'app/appoinment/service-list-details/service-api-services/api-service.service';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
export interface UsersData {
|
||||
@ -32,12 +33,16 @@ export class AddUserComponent implements OnInit {
|
||||
private apiUrl = environment.apiEndpoint;
|
||||
busId: any;
|
||||
disableBus: any=1;
|
||||
userrole: any = [];
|
||||
servicesList: any = [];
|
||||
serviceCheckedData: any = [];
|
||||
assignedServiceValue: any = [];
|
||||
constructor(private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder,
|
||||
public dialogRef: MatDialogRef<AddUserComponent>,
|
||||
@Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData,public _bus:BusinessService) {
|
||||
@Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData,public _bus:BusinessService,public _ser:ApiServiceService) {
|
||||
console.log(data);
|
||||
this.local_data = {...data};
|
||||
console.log( this.local_data)
|
||||
console.log(this.local_data)
|
||||
// this.local_data.busId = localStorage.getItem('busNameID')
|
||||
this.action = this.local_data.action;
|
||||
this.formData= new FormData();
|
||||
@ -48,7 +53,7 @@ export class AddUserComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.hide = true;
|
||||
this.disableBus = localStorage.getItem('go_admin')
|
||||
let userrole = localStorage.getItem('user_role')
|
||||
this.userrole = localStorage.getItem('user_role')
|
||||
this.form = new FormGroup({
|
||||
businessselect: new FormControl('',[Validators.required]),
|
||||
role: new FormControl('', [Validators.required]),
|
||||
@ -65,7 +70,7 @@ export class AddUserComponent implements OnInit {
|
||||
)]),
|
||||
logo: new FormControl('', null),
|
||||
// confirmPassword: new FormControl('', [Validators.required, Validators.minLength(6)]),
|
||||
createdBy:new FormControl(userrole,null),
|
||||
createdBy:new FormControl(this.userrole,null),
|
||||
});
|
||||
console.log(this.local_data);
|
||||
|
||||
@ -154,16 +159,21 @@ export class AddUserComponent implements OnInit {
|
||||
close() {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
|
||||
submit(){
|
||||
console.log(this.form.value);
|
||||
console.log(this.form.value);
|
||||
if(this.userrole == 'BADMIN'){
|
||||
this.form.controls['businessselect'].clearValidators();
|
||||
this.form.controls['businessselect'].updateValueAndValidity();
|
||||
this.busId = localStorage.getItem('busId')
|
||||
}
|
||||
if(this.action == 'Update'){
|
||||
this.form.controls['password'].clearValidators();
|
||||
this.form.controls['password'].updateValueAndValidity();
|
||||
}
|
||||
if (!this.form.valid) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
let tmp = this.form.value
|
||||
tmp.id = this.local_data.id
|
||||
console.log(tmp,this.formData.getAll('image'));
|
||||
@ -186,8 +196,8 @@ export class AddUserComponent implements OnInit {
|
||||
this.formData.append('contactNo', tmp.contactNo);
|
||||
// this.formData.append('confirmPassword', tmp.password);
|
||||
// tmp.confirmPassword = this.local_data.confirmPassword
|
||||
this.dialogRef.close({event:this.action,data: this.formData});
|
||||
console.log( this.formData,this.form.value);
|
||||
this.dialogRef.close({event:this.action,data: this.formData,role:this.form.value.role});
|
||||
console.log(this.formData,this.form.value);
|
||||
console.log(this.action,this.local_data)
|
||||
}
|
||||
|
||||
@ -212,6 +222,7 @@ export class AddUserComponent implements OnInit {
|
||||
}
|
||||
// this.formData= new FormData();
|
||||
// this.formData=[];
|
||||
this.formData= new FormData();
|
||||
this.formData.append('image', file, file.name);
|
||||
// this.formData.append('file', file, file.name);
|
||||
}
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
<h5 mat-dialog-title> <strong>Assign Service to Dr. {{pracititionerName}}</strong>
|
||||
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="close()"
|
||||
><mat-icon>close</mat-icon></button></h5>
|
||||
|
||||
<mat-form-field appearance="outline" class="mat-pane" >
|
||||
<mat-label>Assign Service</mat-label>
|
||||
<mat-select placeholder="Select Role" [(ngModel)]="assignService" multiple required>
|
||||
<mat-option *ngFor="let details of servicesList" (onSelectionChange)="getValues($event,details)" [value]="details.servicesName">
|
||||
{{details.servicesName}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<!-- <mat-error *ngIf="myError('assignService', 'required')">ServiceName is required</mat-error>
|
||||
<mat-error *ngIf="myError('assignService', 'maxlength')">Limit exceed</mat-error> -->
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<div style="border: 1px solid #ccc;"></div>
|
||||
|
||||
<div *ngIf="servicesList_array.length != 0">
|
||||
<ng-scrollbar class="scrollHV">
|
||||
<mat-card class="p-1" *ngFor="let details of servicesList_array;let i = index">
|
||||
<div fxLayout="row" class="flexCard">
|
||||
<div fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10">
|
||||
<img mat-list-avatar src="https://prodaphstorage.blob.core.windows.net/specialties/bdf0cf0d-754e-4254-aaf7-fdc7aedd7c35.jpg" width="100" height="100" >
|
||||
</div>
|
||||
<div fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70">
|
||||
<div class="service-info">{{details.servicesName}}</div>
|
||||
<div class="service-info2">{{servicesList_data[i].duration.length>0 ? servicesList_data[i].duration[0].durationNew : details.duration}} Mins | <span class="indianSymbol">{{servicesList_data[i].duration.length>0 ? servicesList_data[i].duration[0].fees : details.fees}}</span></div>
|
||||
<!-- <div class="info" (click)="asignService(details,i)">+ Customize the price and duration of a service.</div> -->
|
||||
</div>
|
||||
<!-- <div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15" fxLayoutAlign="center center">
|
||||
<span style="color: green;">Active</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</mat-card>
|
||||
</ng-scrollbar>
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button type="button" (click)="closeDialog()" class="mat-green" mat-raised-button >Done</button>
|
||||
<button mat-button (click)="closeDialog()" >Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="servicesList_array.length == 0">
|
||||
<div fxLayout="row" class="flexCard">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
|
||||
<div><img src="assets/images/service.png" width="300" height="300"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" class="flexCard">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
|
||||
<p class="noAssignedService">No Service Assigned</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,67 @@
|
||||
.p-1{
|
||||
padding: 1rem !important;
|
||||
.flexCard{
|
||||
display: contents !important;
|
||||
}
|
||||
}
|
||||
.mat-pane{
|
||||
width: 100%;
|
||||
}
|
||||
.scrollHV {
|
||||
height: calc(100vh - 267px) !important;
|
||||
}
|
||||
.service-info{
|
||||
// line-height: 3rem!important;
|
||||
font-size: 14px!important;
|
||||
font-weight: 500!important;
|
||||
color: #2f2c2c;
|
||||
}
|
||||
.service-info2{
|
||||
// line-height: 3rem!important;
|
||||
font-size: 12px!important;
|
||||
font-weight: 500!important;
|
||||
color: #5F5F5F;
|
||||
}
|
||||
.indianSymbol {
|
||||
content: "\20B9";
|
||||
}
|
||||
|
||||
.mat-card{
|
||||
background-color: #FFF;
|
||||
min-height: 45px;
|
||||
border-bottom: 1px solid #F5F6F8;
|
||||
position: relative;
|
||||
margin: 17px 10px 17px 10px;
|
||||
display: flex;
|
||||
.mat-nav-list .mat-list-item:hover{
|
||||
background: none;
|
||||
}
|
||||
.name{
|
||||
font-size: 15px;
|
||||
color: #111;
|
||||
}
|
||||
.time-amount{
|
||||
color: #5B6572!important;
|
||||
font-size: 13px;
|
||||
line-height: 25px;
|
||||
}
|
||||
.Customize{
|
||||
color: #567FC2!important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
}
|
||||
.mat-name{
|
||||
font-size: 14px;
|
||||
color: #5B6572!important;
|
||||
padding-top: 3rem;
|
||||
padding-right: 8rem;
|
||||
padding-left: 8rem;
|
||||
}
|
||||
.mat-status{
|
||||
font-size: 14px;
|
||||
color: green!important;
|
||||
padding-top: 3rem;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PractAssignServiceComponent } from './pract-assign-service.component';
|
||||
|
||||
describe('PractAssignServiceComponent', () => {
|
||||
let component: PractAssignServiceComponent;
|
||||
let fixture: ComponentFixture<PractAssignServiceComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ PractAssignServiceComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PractAssignServiceComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,147 @@
|
||||
import { Component, Inject, OnInit, Optional } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { UserService } from '../user-service/user.service';
|
||||
import { ApiServiceService } from 'app/appoinment/service-list-details/service-api-services/api-service.service';
|
||||
import { ConsultantService } from 'app/appoinment/consultant-setting/consultant-service/consultant.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pract-assign-service',
|
||||
templateUrl: './pract-assign-service.component.html',
|
||||
styleUrls: ['./pract-assign-service.component.scss']
|
||||
})
|
||||
export class PractAssignServiceComponent implements OnInit {
|
||||
assignService:any = []
|
||||
serviceCheckedData: number;
|
||||
pracititionerUserId: any = [];
|
||||
servicesList: any = [];
|
||||
servicesList_array: any[];
|
||||
servicesList_data: any = [];
|
||||
user_ID: any;
|
||||
busId: any;
|
||||
pracititionerName: any;
|
||||
constructor(public _use:UserService, public dialogRef: MatDialogRef<PractAssignServiceComponent>,
|
||||
@Optional() @Inject(MAT_DIALOG_DATA) public data,public _ser:ApiServiceService,public _api:ConsultantService) {
|
||||
console.log(data)
|
||||
if(data.action == 'Update'){
|
||||
this.pracititionerUserId = data.obj.id
|
||||
this.pracititionerName = data.obj.userName
|
||||
}else{
|
||||
this.pracititionerUserId = data.userId
|
||||
this.pracititionerName = data.obj
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
// this.getServicesList()
|
||||
// this.user_ID = localStorage.getItem('user_id')
|
||||
this.busId = localStorage.getItem('busId')
|
||||
this.getServicesList(this.pracititionerUserId,this.busId)
|
||||
}
|
||||
|
||||
closeDialog(){
|
||||
this.dialogRef.close({event:'Cancel'});
|
||||
}
|
||||
|
||||
close() {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
// getServicesList() {
|
||||
// let param ={"busId":localStorage.getItem('busId')}
|
||||
// console.log(param)
|
||||
// this._ser.getServicesListDetails(param).subscribe(res => {
|
||||
// if (res.status == 200) {
|
||||
// this.servicesList = res.data;
|
||||
// }
|
||||
// else{
|
||||
// this.servicesList=[];
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
getValues(event: {
|
||||
isUserInput: any;
|
||||
source: { value: any; selected: any };
|
||||
},details) {
|
||||
console.log(event,details,this.assignService)
|
||||
if (event.isUserInput) {
|
||||
if (event.source.selected === true) {
|
||||
console.log('1',event.source.value)
|
||||
this.serviceCheckedData = 1
|
||||
this.getCheckedService(details)
|
||||
} else {
|
||||
console.log('2',event.source.value)
|
||||
this.serviceCheckedData = 0
|
||||
this.getCheckedService(details)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
getCheckedService(params){
|
||||
console.log(params)
|
||||
let data = {serviceId:params.serviceId,userId:this.pracititionerUserId,busId:params.busId,active:this.serviceCheckedData}
|
||||
console.log(data)
|
||||
this._use.getServiceCheckedDetails(data).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
console.log(res)
|
||||
// this.checkedList = res.data;
|
||||
this.getServicesList(this.pracititionerUserId,this.busId)
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
getAssignedList(busId) {
|
||||
this._api.getAssignedDetails(busId).subscribe(res => {
|
||||
console.log(res)
|
||||
if (res.status == 200) {
|
||||
this.servicesList = res.data;
|
||||
|
||||
let result = this.servicesList.filter((obj, index, self) =>
|
||||
index === self.findIndex((t) => (
|
||||
t.serviceId === obj.serviceId
|
||||
))
|
||||
);
|
||||
this.servicesList = result
|
||||
console.log(this.servicesList)
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
getServicesList(id,busId) {
|
||||
this.servicesList_array = []
|
||||
//this._pd.getTabStatusPdDetails(this.tabStatus)
|
||||
this._api.getServicesListDetails(id,busId).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
this.servicesList_data = res.data;
|
||||
console.log(this.servicesList_data)
|
||||
res['data'].forEach(element => {
|
||||
// tmp.push(element.service)
|
||||
element.service.forEach(e => {
|
||||
console.log(e)
|
||||
this.servicesList_array.push(e)
|
||||
this.assignService.push(e.servicesName)
|
||||
});
|
||||
});
|
||||
|
||||
// this.servicesList_array = this.servicesList_array.filter((obj, index, self) =>
|
||||
// index === self.findIndex((t) => (
|
||||
// t.serviceId === obj.serviceId
|
||||
// ))
|
||||
// );
|
||||
// let result = this.assignService.filter((obj, index, self) =>
|
||||
// index === self.findIndex((t) => (
|
||||
// t.serviceId === obj.serviceId
|
||||
// ))
|
||||
// );
|
||||
// this.assignService = result
|
||||
console.log(this.servicesList_array)
|
||||
}
|
||||
this.getAssignedList(this.busId)
|
||||
});
|
||||
// this.assignService = this.checkedArray
|
||||
}
|
||||
|
||||
}
|
||||
@ -9,6 +9,7 @@ import { AddUserComponent } from '../add-user/add-user.component';
|
||||
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';
|
||||
|
||||
export interface UsersData {
|
||||
id: number;
|
||||
@ -164,7 +165,7 @@ export class UserListComponent implements OnInit {
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
// this.deleteRowData(element);
|
||||
this.formAddUpdateAndDelete(name,element)
|
||||
this.formAddUpdateAndDelete(name,element,'','')
|
||||
Swal.fire(
|
||||
'Deleted!',
|
||||
'Your imaginary file has been deleted.',
|
||||
@ -203,7 +204,7 @@ export class UserListComponent implements OnInit {
|
||||
}
|
||||
if(result != undefined){
|
||||
console.log(result)
|
||||
this.formAddUpdateAndDelete(result,result.data)
|
||||
this.formAddUpdateAndDelete(result,result.data,action,obj)
|
||||
}
|
||||
// console.log(result)
|
||||
// if(result.event == 'Add'){
|
||||
@ -216,7 +217,7 @@ export class UserListComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
formAddUpdateAndDelete(result,row_obj){
|
||||
formAddUpdateAndDelete(result,row_obj,action,obj){
|
||||
console.log(result,row_obj)
|
||||
let formValue = []
|
||||
if(result.event == 'Add'){
|
||||
@ -264,9 +265,9 @@ export class UserListComponent implements OnInit {
|
||||
let user_role = localStorage.getItem('user_role')
|
||||
if(user_role != 'BADMIN'){
|
||||
localStorage.setItem('busNameID',null)
|
||||
}
|
||||
}
|
||||
|
||||
// this.usersList = res.data;
|
||||
// this.usersList = res.data;
|
||||
this.getUsersList()
|
||||
if(result.event == 'Add'){
|
||||
this.notifierService.notify('success', 'User Added Successfully');
|
||||
@ -275,6 +276,12 @@ 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)
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
this.notifierService.notify('warning', res.message);
|
||||
@ -288,6 +295,19 @@ export class UserListComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
openAssignService(userId,action,obj) {
|
||||
const dialogRef = this.dialog.open(PractAssignServiceComponent, {
|
||||
width: '25%',
|
||||
height: '100%',
|
||||
// maxWidth: '38vw',
|
||||
position: { right: '0' },
|
||||
data:{userId,action,obj}
|
||||
});
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// addRowData(row_obj){
|
||||
// var d = this.dataSource.data.length+1
|
||||
// console.log(this.dataSource)
|
||||
|
||||
@ -34,6 +34,11 @@ export class UserService {
|
||||
// )
|
||||
}
|
||||
|
||||
getServiceCheckedDetails(params): Observable<any>{
|
||||
return this._http.post(this.apiUrl + 'AlterServicesMap', params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
handleError(arg0: string, arg1: undefined[]): (err: any, caught: Observable<any>) => import("rxjs").ObservableInput<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
|
||||
@ -8,6 +8,7 @@ import { DemoMaterialModule } from 'app/shared/demo.module';
|
||||
import { NgScrollbarModule } from 'ngx-scrollbar';
|
||||
import { AddUserComponent } from './add-user/add-user.component';
|
||||
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
||||
import { PractAssignServiceComponent } from './pract-assign-service/pract-assign-service.component';
|
||||
|
||||
const customNotifierOptions: NotifierOptions = {
|
||||
position: {
|
||||
@ -54,6 +55,7 @@ const customNotifierOptions: NotifierOptions = {
|
||||
declarations: [
|
||||
UserListComponent,
|
||||
AddUserComponent,
|
||||
PractAssignServiceComponent,
|
||||
|
||||
],
|
||||
imports: [
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
<span class="head">Date & Time</span>
|
||||
</div>
|
||||
<div fxFlex.xs="75" fxFlex.sm="75" fxFlex.md="75" fxFlex.lg="75" fxFlex.xl="75">
|
||||
<span>: {{bookingSummary.appoinmentDate | date:'fullDate'}}</span><span style="margin-left: 6px;">({{bookingSummary.appoinmentSlots[0] | date:'shortTime'}})</span>
|
||||
<span>: {{bookingSummary.appoinmentDate}}</span><span style="margin-left: 6px;">{{bookingSummary.appoinmentSlots[0] | date:'shortTime'}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row wrap" style="margin-bottom: 20px;">
|
||||
|
||||
@ -116,6 +116,7 @@ export class ConsultantsListComponent implements OnInit {
|
||||
localStorage.setItem('user_id',param.id)
|
||||
let URL = this.router.url;
|
||||
console.log(URL,param)
|
||||
localStorage.setItem('advanced_slot_days',param['practitionerInfos'][0].days)
|
||||
let URL_AS_LIST = URL.split('/');
|
||||
console.log(URL_AS_LIST);
|
||||
if(URL_AS_LIST[2] == 'business'){
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
<div fxLayout="row">
|
||||
<div fxFlex.xs="80" fxFlex.sm="80" fxFlex.md="80" fxFlex.lg="80" fxFlex.xl="80">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" appMobileNumberPattern maxlength="10" minlength="10" placeholder="Phone No" name="phone" formControlName="phoneNo" [readonly]="verifyOTP == '1'" required>
|
||||
<input matInput type="text" appMobileNumberPattern maxlength="10" minlength="10" placeholder="Phone No" name="phone" formControlName="phoneNo" [readonly]="noChangeNo == '1'" required>
|
||||
<mat-error *ngIf="myError('phoneNo', 'required')">Contact No is required</mat-error>
|
||||
<mat-error *ngIf="myError('phoneNo', 'pattern')">Invalid Contact No </mat-error>
|
||||
<mat-error *ngIf="myError('phoneNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
|
||||
|
||||
@ -70,4 +70,9 @@ mat-toolbar{
|
||||
height: 50px;
|
||||
font-size: 14px
|
||||
}
|
||||
|
||||
.custom-dialog-container{
|
||||
background: none !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
@ -5,6 +5,9 @@ import { EndUserService } from '../end-user.service';
|
||||
import firebase from 'firebase/app';
|
||||
import 'firebase/auth';
|
||||
import 'firebase/firestore';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { OptVerifyComponent } from './opt-verify/opt-verify.component';
|
||||
import { event } from 'jquery';
|
||||
|
||||
|
||||
var config = {
|
||||
@ -32,8 +35,9 @@ export class CustomerInfoComponent implements OnInit {
|
||||
otp!: string;
|
||||
verifykey: any;
|
||||
busName: string;
|
||||
noChangeNo: any = 0;
|
||||
|
||||
constructor(private router: Router,private formBuilder: FormBuilder,public _cus:EndUserService, private ngZone: NgZone) {
|
||||
constructor(public dialog: MatDialog,private router: Router,private formBuilder: FormBuilder,public _cus:EndUserService, private ngZone: NgZone) {
|
||||
// firebase.initializeApp(config)
|
||||
}
|
||||
|
||||
@ -61,7 +65,7 @@ export class CustomerInfoComponent implements OnInit {
|
||||
console.log(this.form.value)
|
||||
console.log('add')
|
||||
if(!this.form.valid){
|
||||
return
|
||||
return
|
||||
}
|
||||
let row_obj = this.form.value
|
||||
console.log(row_obj)
|
||||
@ -69,7 +73,7 @@ export class CustomerInfoComponent implements OnInit {
|
||||
cusName: row_obj.cusName,
|
||||
email: row_obj.email,
|
||||
address_1: row_obj.address_1,
|
||||
phoneNo: this.phoneNumber.substring(3) ,
|
||||
phoneNo: row_obj.phoneNo,
|
||||
pincode: row_obj.pincode,
|
||||
state: row_obj.state,
|
||||
city: row_obj.city,
|
||||
@ -100,126 +104,43 @@ export class CustomerInfoComponent implements OnInit {
|
||||
},1000)
|
||||
}
|
||||
|
||||
resendOTP() {
|
||||
this.phoneNumber = this.form.value.phoneNo
|
||||
if( this.phoneNumber.length!=10){
|
||||
alert("invalid Phone No...!")
|
||||
}else{
|
||||
this.otpData = event
|
||||
this.timeLeft = 60;
|
||||
this.interval = setInterval(() => {
|
||||
if(this.timeLeft > 0) {
|
||||
this.timeLeft--;
|
||||
} else {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
},1000)
|
||||
|
||||
this.reCaptchaVerifier = new firebase.auth.RecaptchaVerifier(
|
||||
'sign-in-button',
|
||||
{
|
||||
size: 'invisible',
|
||||
}
|
||||
);
|
||||
console.log(this.reCaptchaVerifier);
|
||||
this.phoneNumber = "+91"+this.phoneNumber;
|
||||
console.log(this.phoneNumber);
|
||||
firebase
|
||||
.auth()
|
||||
.signInWithPhoneNumber(this.phoneNumber, this.reCaptchaVerifier)
|
||||
.then((confirmationResult) => {
|
||||
localStorage.setItem(
|
||||
'verificationId',
|
||||
JSON.stringify(confirmationResult.verificationId)
|
||||
);
|
||||
this.ngZone.run(() => {
|
||||
//this.router.navigate(['/code']);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error.message);
|
||||
alert(error.message);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
verify(event){
|
||||
this.verifykey = JSON.parse(localStorage.getItem('verificationId') || '{}');
|
||||
console.log(this.verifykey);
|
||||
this.otp = this.form.value.otp
|
||||
console.log(this.otp);
|
||||
var credential = firebase.auth.PhoneAuthProvider.credential(
|
||||
this.verifykey,
|
||||
this.otp
|
||||
);
|
||||
|
||||
console.log(credential);
|
||||
firebase
|
||||
.auth()
|
||||
.signInWithCredential(credential)
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
localStorage.setItem('user_data', JSON.stringify(response));
|
||||
this.ngZone.run(() => {
|
||||
// this.router.navigate(['/dashboard']);
|
||||
this.verifyOTP = event
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
alert(error.message);
|
||||
});
|
||||
}
|
||||
|
||||
getOTP(event) {
|
||||
|
||||
|
||||
getOTP(event) {
|
||||
|
||||
this.phoneNumber = this.form.value.phoneNo
|
||||
if( this.phoneNumber.length!=10){
|
||||
alert("invalid Phone No...!")
|
||||
alert("invalid Phone No...!")
|
||||
}else{
|
||||
this.otpData = event
|
||||
this.timeLeft = 60;
|
||||
this.interval = setInterval(() => {
|
||||
if(this.timeLeft > 0) {
|
||||
this.timeLeft--;
|
||||
} else {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
},1000)
|
||||
|
||||
this.reCaptchaVerifier = new firebase.auth.RecaptchaVerifier(
|
||||
'sign-in-button',
|
||||
{
|
||||
size: 'invisible',
|
||||
}
|
||||
);
|
||||
console.log(this.reCaptchaVerifier);
|
||||
this.phoneNumber = "+91"+this.phoneNumber;
|
||||
console.log(this.phoneNumber);
|
||||
firebase
|
||||
.auth()
|
||||
.signInWithPhoneNumber(this.phoneNumber, this.reCaptchaVerifier)
|
||||
.then((confirmationResult) => {
|
||||
localStorage.setItem(
|
||||
'verificationId',
|
||||
JSON.stringify(confirmationResult.verificationId)
|
||||
);
|
||||
this.ngZone.run(() => {
|
||||
//this.router.navigate(['/code']);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error.message);
|
||||
alert(error.message);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 5000);
|
||||
});
|
||||
this.openOtp(event)
|
||||
this.noChangeNo = event
|
||||
console.log(this.noChangeNo)
|
||||
// this.otpData = event
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
openOtp(event) {
|
||||
const dialogRef = this.dialog.open(OptVerifyComponent, {
|
||||
width: '30%',
|
||||
// height: '100%',
|
||||
// maxWidth: '38vw',
|
||||
// position: { right: '0' },
|
||||
disableClose: true ,
|
||||
panelClass: 'custom-dialog-container',
|
||||
|
||||
data:{event,phoneNo:this.phoneNumber}
|
||||
});
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
console.log(result)
|
||||
if(result == 'signIn'){
|
||||
this.verifyOTP = 1
|
||||
}else{
|
||||
this.noChangeNo = 0
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
<div class="relative">
|
||||
<div fxLayout="row" fxLayoutAlign="center start">
|
||||
<div fxLayout="column" fxFlex.xl="100" fxFlex.lg="100" fxFlex.md="100" fxFlex.sm="100" fxFlex.xs="100">
|
||||
<!-- <mat-card class="login-session"> -->
|
||||
<h2 class="base-border mat-text-warn mb-1">OTP</h2>
|
||||
<div fxLayout="row">
|
||||
<div fxFlex.xs="80" fxFlex.sm="80" fxFlex.md="80" fxFlex.lg="80" fxFlex.xl="80">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="Enter OTP" [(ngModel)]="getOtpvalue" type="text" maxlength="6">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<button type="button" (click)="verify(1)" mat-raised-button class="mr-1 mb-1" matTooltip="VERIFY" matTooltipPosition="below" style="background-color: #4CAF50;color:#fff;">VERIFY</button>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row">
|
||||
<button type="button" *ngIf="timeLeft != 0" mat-raised-button color="primary">{{timeLeft == 0 ? 'Resend OTP' : timeLeft+' Seconds Left....' }} </button>
|
||||
<button type="button" *ngIf="timeLeft == 0" mat-raised-button color="primary" (click)="resendOTP(1)">{{timeLeft == 0 ? 'Resend OTP' : timeLeft+' Seconds Left....' }} </button>
|
||||
</div>
|
||||
<!-- </mat-card> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,7 @@
|
||||
.mat-dialog-container{
|
||||
background: none !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
.base-border{
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { OptVerifyComponent } from './opt-verify.component';
|
||||
|
||||
describe('OptVerifyComponent', () => {
|
||||
let component: OptVerifyComponent;
|
||||
let fixture: ComponentFixture<OptVerifyComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ OptVerifyComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(OptVerifyComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,160 @@
|
||||
import { Component, Inject, NgZone, OnInit } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import firebase from 'firebase/app';
|
||||
import 'firebase/auth';
|
||||
import 'firebase/firestore';
|
||||
|
||||
@Component({
|
||||
selector: 'app-opt-verify',
|
||||
templateUrl: './opt-verify.component.html',
|
||||
styleUrls: ['./opt-verify.component.scss']
|
||||
})
|
||||
export class OptVerifyComponent implements OnInit {
|
||||
form: FormGroup;
|
||||
otpData: any = 0;
|
||||
timeLeft: number = 0;
|
||||
interval;
|
||||
verifyOTP: any = 0;
|
||||
phoneNumber: any;
|
||||
reCaptchaVerifier!: any;
|
||||
getOtpvalue:any =[]
|
||||
otp!: string;
|
||||
verifykey: any;
|
||||
busName: string;
|
||||
noChangeNo: any = 0;
|
||||
constructor(public dialogRef: MatDialogRef<OptVerifyComponent>,@Inject(MAT_DIALOG_DATA) public data,private ngZone: NgZone) {
|
||||
this.getOtp(data)
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
getOtp(data){
|
||||
console.log(data)
|
||||
this.phoneNumber = data.phoneNo
|
||||
this.timeLeft = 60;
|
||||
this.interval = setInterval(() => {
|
||||
if(this.timeLeft > 0) {
|
||||
this.timeLeft--;
|
||||
} else {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
},1000)
|
||||
|
||||
this.reCaptchaVerifier = new firebase.auth.RecaptchaVerifier(
|
||||
'sign-in-button',
|
||||
{
|
||||
size: 'invisible',
|
||||
}
|
||||
);
|
||||
console.log(this.reCaptchaVerifier);
|
||||
this.phoneNumber = "+91"+this.phoneNumber;
|
||||
console.log(this.phoneNumber);
|
||||
firebase
|
||||
.auth()
|
||||
.signInWithPhoneNumber(this.phoneNumber, this.reCaptchaVerifier)
|
||||
.then((confirmationResult) => {
|
||||
localStorage.setItem(
|
||||
'verificationId',
|
||||
JSON.stringify(confirmationResult.verificationId)
|
||||
);
|
||||
this.ngZone.run(() => {
|
||||
//this.router.navigate(['/code']);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error.message);
|
||||
alert(error.message);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
verify(event){
|
||||
this.verifykey = JSON.parse(localStorage.getItem('verificationId') || '{}');
|
||||
console.log(this.verifykey);
|
||||
this.otp = this.getOtpvalue
|
||||
console.log(this.otp);
|
||||
var credential = firebase.auth.PhoneAuthProvider.credential(
|
||||
this.verifykey,
|
||||
this.otp
|
||||
);
|
||||
|
||||
console.log(credential);
|
||||
firebase
|
||||
.auth()
|
||||
.signInWithCredential(credential)
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
this.dialogRef.close(response.operationType);
|
||||
localStorage.setItem('user_data', JSON.stringify(response));
|
||||
this.ngZone.run(() => {
|
||||
// this.router.navigate(['/dashboard']);
|
||||
console.log(response)
|
||||
this.verifyOTP = event
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.dialogRef.close()
|
||||
alert(error.message);
|
||||
});
|
||||
}
|
||||
|
||||
resendOTP() {
|
||||
this.phoneNumber = this.phoneNumber
|
||||
if( this.phoneNumber.length!=10){
|
||||
alert("invalid Phone No...!")
|
||||
}else{
|
||||
this.otpData = event
|
||||
this.timeLeft = 60;
|
||||
this.interval = setInterval(() => {
|
||||
if(this.timeLeft > 0) {
|
||||
this.timeLeft--;
|
||||
} else {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
},1000)
|
||||
|
||||
this.reCaptchaVerifier = new firebase.auth.RecaptchaVerifier(
|
||||
'sign-in-button',
|
||||
{
|
||||
size: 'invisible',
|
||||
}
|
||||
);
|
||||
console.log(this.reCaptchaVerifier);
|
||||
this.phoneNumber = "+91"+this.phoneNumber;
|
||||
console.log(this.phoneNumber);
|
||||
firebase
|
||||
.auth()
|
||||
.signInWithPhoneNumber(this.phoneNumber, this.reCaptchaVerifier)
|
||||
.then((confirmationResult) => {
|
||||
localStorage.setItem(
|
||||
'verificationId',
|
||||
JSON.stringify(confirmationResult.verificationId)
|
||||
);
|
||||
this.ngZone.run(() => {
|
||||
//this.router.navigate(['/code']);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error.message);
|
||||
alert(error.message);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
closeDialog(){
|
||||
this.dialogRef.close({event:'Cancel'});
|
||||
}
|
||||
|
||||
close() {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
}
|
||||
@ -136,6 +136,7 @@ export class DoctorProfileComponent implements OnInit {
|
||||
console.log(this.dp)
|
||||
this.profileDetails = this.bookedAppointment.practitionerInfos[0]
|
||||
console.log(this.profileDetails)
|
||||
localStorage.setItem('advanced_slot_days',this.profileDetails.days)
|
||||
this.skillsDetails = JSON.parse(this.profileDetails.skills)
|
||||
// this.skillsDetails = JSON.parse(this.skillsDetails)
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@ import { BookingSummaryComponent } from './booking-summary/booking-summary.compo
|
||||
import { SummaryComponent } from './summary/summary.component';
|
||||
import { DoctorProfileComponent } from './doctor-profile/doctor-profile.component';
|
||||
import { NgxSpinnerModule } from "ngx-spinner";
|
||||
import { OptVerifyComponent } from './customer-info/opt-verify/opt-verify.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@ -26,7 +27,7 @@ import { NgxSpinnerModule } from "ngx-spinner";
|
||||
SearchCategoryComponent,
|
||||
ConsultantsListComponent,
|
||||
CentersListComponent,
|
||||
PaymentComponent,CustomerInfoComponent, BookingSummaryComponent, SummaryComponent, DoctorProfileComponent
|
||||
PaymentComponent,CustomerInfoComponent, BookingSummaryComponent, SummaryComponent, DoctorProfileComponent, OptVerifyComponent
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
|
||||
@ -66,7 +66,7 @@
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="64" fxFlex.lg="64" fxFlex.xl="64" class="p-gap">
|
||||
<div fxLayout="row wrap mt-2" fxLayoutAlign="center center">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="p-gap">
|
||||
<mat-card class="navStyle" fxLayoutAlign="center center"> <button mat-raised-button (click)="goToSlotBooking2()" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_left</mat-icon></button><span style="width: 150px;text-align: center;">{{check(days) | date:'longDate'}}</span><button mat-raised-button (click)="goToSlotBooking()" *ngIf="clicks < 5" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_right</mat-icon></button></mat-card>
|
||||
<mat-card class="navStyle" fxLayoutAlign="center center"> <button mat-raised-button (click)="goToSlotBooking2()" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_left</mat-icon></button><span style="width: 150px;text-align: center;">{{check(days) | date:'longDate'}}</span><button mat-raised-button (click)="goToSlotBooking()" *ngIf="clicks < advanced_slot_days" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_right</mat-icon></button></mat-card>
|
||||
</div>
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="p-gap" style="text-align: center;">
|
||||
<div *ngIf="slots.length == 0">
|
||||
@ -82,7 +82,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<ng-scrollbar class="scrollHV" >
|
||||
<button *ngFor="let slot of slots;let i=index" mat-raised-button mat-button-sm class="mr-1 mt-1 hoverButton" [ngClass]="{'primary':slotIndex != i,'clickedSlot':slotIndex == i } " (click)="toggleActive($event,slot,i)" >{{slot | date:'shortTime'}}</button>
|
||||
<button *ngFor="let slot of slots;let i=index" mat-raised-button mat-button-sm class="mr-1 mt-1 hoverButton" [ngClass]="{'primary':slotIndex != i,'clickedSlot':slotIndex == i }" (click)="toggleActive($event,slot,i)" >{{slot | date:'shortTime'}}</button>
|
||||
</ng-scrollbar>
|
||||
|
||||
|
||||
@ -187,9 +187,9 @@
|
||||
</div>
|
||||
<div style="border: 1px solid #ccc;" fxFlex.md="1"></div>
|
||||
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="35" fxFlex.lg="35" fxFlex.xl="35" class="p-gap">
|
||||
<div class="inline">
|
||||
<!-- <div class="inline">
|
||||
<p class="text-color">Teero would like to schedule an interview with you! Pick a time & date.</p>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="">
|
||||
<!-- <p class="param"><img src="assets/images/Location.svg" alt="Avatar" class="img">Business </p>
|
||||
<span class="span-text">{{busName}}</span> -->
|
||||
|
||||
@ -54,6 +54,7 @@ export class SlotBookingDetailsComponent implements OnInit {
|
||||
servicesName: any=[];
|
||||
user: any=[];
|
||||
serviceMapdetails:any =[]
|
||||
advanced_slot_days: any;
|
||||
constructor(private router:Router,private datepipe:DatePipe,public end_user:EndUserService) {
|
||||
this.end_user.appointmentBooked_observable$.subscribe((res) => {
|
||||
console.log('booked', res);
|
||||
@ -86,7 +87,24 @@ export class SlotBookingDetailsComponent implements OnInit {
|
||||
|
||||
this.slot_Split()
|
||||
|
||||
this.advanced_slot_days = parseInt(localStorage.getItem('advanced_slot_days'))-1
|
||||
console.log(this.advanced_slot_days)
|
||||
|
||||
let tmp=[]
|
||||
for(let i=0;i<=this.advanced_slot_days;i++){
|
||||
console.log(i)
|
||||
var someDate = new Date();
|
||||
someDate.setDate(someDate.getDate() + i); //number of days to add, e.x. 15 days
|
||||
var dateFormated = someDate.toISOString().substr(0,10);
|
||||
console.log(dateFormated);
|
||||
tmp.push(dateFormated)
|
||||
this.days= tmp
|
||||
|
||||
}
|
||||
console.log(tmp)
|
||||
|
||||
console.log(this.days)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -291,17 +309,9 @@ if(this.getHours.length != 0){
|
||||
}
|
||||
|
||||
getApiData(){
|
||||
this.busName = localStorage.getItem('busName')
|
||||
let tmp=[]
|
||||
for(let i=0;i<=5;i++){
|
||||
var someDate = new Date();
|
||||
someDate.setDate(someDate.getDate() + i); //number of days to add, e.x. 15 days
|
||||
var dateFormated = someDate.toISOString().substr(0,10);
|
||||
console.log(dateFormated);
|
||||
tmp.push(dateFormated)
|
||||
}
|
||||
console.log(tmp)
|
||||
this.days= tmp
|
||||
this.busName = localStorage.getItem('busName')
|
||||
|
||||
|
||||
let params ={"id":this.user.id}
|
||||
this.end_user.getSlots(params).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
@ -314,7 +324,7 @@ if(this.getHours.length != 0){
|
||||
}
|
||||
goToSlotBooking(){
|
||||
// this.days[]
|
||||
if( this.clicks <5){
|
||||
if( this.clicks <this.advanced_slot_days){
|
||||
this.clicks += 1;
|
||||
}
|
||||
console.log(this.days,this.days[ this.clicks], this.clicks)
|
||||
@ -367,6 +377,7 @@ if(this.getHours.length != 0){
|
||||
|
||||
}
|
||||
check(param){
|
||||
// console.log(param,this.clicks)
|
||||
return param[this.clicks];
|
||||
|
||||
}
|
||||
|
||||
@ -85,10 +85,16 @@ export class LoginComponent {
|
||||
let usersList = res.data[0];
|
||||
localStorage.setItem('practitioner',JSON.stringify(usersList))
|
||||
console.log(usersList)
|
||||
|
||||
if(usersList['practitionerInfos'].length==0){
|
||||
console.log('in')
|
||||
this.router.navigate(['/consultant-setting'])
|
||||
}else{
|
||||
if(usersList.role == 'PRACTITIONER'){
|
||||
let dataDays = usersList['practitionerInfos'][0].days
|
||||
localStorage.setItem('advanced_slot_days',dataDays)
|
||||
console.log(dataDays)
|
||||
}
|
||||
this.router.navigate(['/home'])
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,9 +10,9 @@ export const environment = {
|
||||
// apiEndpoint:'http://192.168.1.20:8080/api/',
|
||||
// apiEndpoint:'https://api.venbait.in/api/',
|
||||
// apiEndpoint:'http://venbainfotech.com:5000/api/',
|
||||
// apiEndpoint:'http://192.168.1.8:8080/api/',
|
||||
apiEndpoint:'http://192.168.1.17:8080/api/',
|
||||
|
||||
apiEndpoint:'https://api.venbait.in/api/',
|
||||
// apiEndpoint:'https://api.venbait.in/api/',
|
||||
|
||||
//EndUser URL
|
||||
endUserUrl:'https://venbainfotech.com/appointment/#/customer/',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user