Merge branch 'master' of bitbucket.org:venbainformationtechnology/appointments_frontend

This commit is contained in:
surendar.m@watermelon.us 2023-03-31 16:14:02 +05:30
commit 56daba5988
7 changed files with 587 additions and 377 deletions

View File

@ -1,14 +1,16 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs';
import { BehaviorSubject, Observable } from 'rxjs';
import { catchError } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class ConsultantService {
public getPractitionerInfo:BehaviorSubject<any> = new BehaviorSubject<any>([]);
public getPractitionerInfo_observable$ = this.getPractitionerInfo.asObservable();
private apiUrl = environment.apiEndpoint;
constructor(private _http: HttpClient) { }
@ -31,6 +33,10 @@ export class ConsultantService {
createDurationFeesDetails(params): Observable<any>{
return this._http.post(this.apiUrl + 'CreateDuration', params)
}
createPractitionerInfo(param): Observable<any>{
return this._http.post(this.apiUrl + 'createPractitionerInfo', param)
}
handleError(arg0: string, arg1: undefined[]): (err: any, caught: Observable<any>) => import("rxjs").ObservableInput<any> {
throw new Error('Method not implemented.');

View File

@ -172,116 +172,123 @@
</div> -->
<div class="timing-container">
<div class="timing">
<span class="dis-flex">
<span class="dis">
<i class="material-icons">&#xe192;</i> <span class="clock">Sunday</span>
</span>
</div>
<div class="dis-flex mt-1">
<div class="dis-flex" >
<span> 09:00am</span>
<div class="dis mt-1" *ngFor="let item of workinghours[0]['sunday']['hours']; ">
<div class="dis" >
<span> {{item.startTime}}
</span>
</div>
<span class="hyphen">-</span>
<div class="dis-flex" >
<span> 06:00pm</span>
<span> {{item.endTime}}</span>
</div>
</div>
</div>
<div class="timing-container">
<div class="timing">
<span class="dis-flex">
<span class="dis">
<i class="material-icons">&#xe192;</i> <span class="clock">Monday</span>
</span>
</div>
<div class="dis-flex mt-1">
<div class="dis-flex" >
<span> 09:00am</span>
<div class="dis-flex mt-1" *ngFor="let item of workinghours[1]['monday']['hours']; ">
<div class="dis" >
<span> {{item.startTime}}
</span>
</div>
<span class="hyphen">-</span>
<div class="dis-flex" >
<span> 06:00pm</span>
<span> {{item.endTime}}</span>
</div>
</div>
</div>
</div>
<div class="timing-container">
<div class="timing">
<span class="dis-flex">
<span class="dis">
<i class="material-icons">&#xe192;</i> <span class="clock">Tuesday</span>
</span>
</div>
<div class="dis-flex mt-1">
<div class="dis-flex" >
<span> 09:00am</span>
<div class="dis-flex mt-1" *ngFor="let item of workinghours[2]['tuesday']['hours']; ">
<div class="dis" >
<span> {{item.startTime}}
</span>
</div>
<span class="hyphen">-</span>
<div class="dis-flex" >
<span> 06:00pm</span>
<span> {{item.endTime}}</span>
</div>
</div>
</div>
</div>
<div class="timing-container">
<div class="timing">
<span class="dis-flex">
<span class="dis">
<i class="material-icons">&#xe192;</i> <span class="clock">Wednesday</span>
</span>
</div>
<div class="dis-flex mt-1">
<div class="dis-flex" >
<span> 09:00am</span>
<div class="dis-flex mt-1" *ngFor="let item of workinghours[3]['wednesday']['hours']; ">
<div class="dis" >
<span> {{item.startTime}}
</span>
</div>
<span class="hyphen">-</span>
<div class="dis-flex" >
<span> 06:00pm</span>
<span> {{item.endTime}}</span>
</div>
</div>
</div>
</div><br />
</div>
<div class="timing-container">
<div class="timing">
<span class="dis-flex">
<span class="dis">
<i class="material-icons">&#xe192;</i> <span class="clock">Thursday</span>
</span>
</div>
<div class="dis-flex mt-1">
<div class="dis-flex" >
<span> 09:00am</span>
<div class="dis-flex mt-1" *ngFor="let item of workinghours[4]['thursday']['hours']; ">
<div class="dis" >
<span> {{item.startTime}}
</span>
</div>
<span class="hyphen">-</span>
<div class="dis-flex" >
<span> 06:00pm</span>
<span> {{item.endTime}}</span>
</div>
</div>
</div>
</div>
<div class="timing-container">
<div class="timing">
<span class="dis-flex">
<span class="dis">
<i class="material-icons">&#xe192;</i> <span class="clock">Friday</span>
</span>
</div>
<div class="dis-flex mt-1">
<div class="dis-flex" >
<span> 09:00am</span>
<div class="dis-flex mt-1" *ngFor="let item of workinghours[5]['friday']['hours']; ">
<div class="dis" >
<span> {{item.startTime}}
</span>
</div>
<span class="hyphen">-</span>
<div class="dis-flex" >
<span> 06:00pm</span>
<span> {{item.endTime}}</span>
</div>
</div>
</div>
</div>
<div class="timing-container">
<div class="timing">
<span class="dis-flex">
<span class="dis">
<i class="material-icons">&#xe192;</i> <span class="clock">Saturday</span>
</span>
</div>
<div class="dis-flex mt-1">
<div class="dis-flex" >
<span> 09:00am</span>
<div class="dis-flex mt-1" *ngFor="let item of workinghours[6]['saturday']['hours']; ">
<div class="dis" >
<span> {{item.startTime}}
</span>
</div>
<span class="hyphen">-</span>
<div class="dis-flex" >
<span> 06:00pm</span>
<span> {{item.endTime}}</span>
</div>
</div>
</div>
</div>
<!-- <div class="timing-container">
<div class="timing">
<span class="dis-flex">

View File

@ -38,6 +38,7 @@ export class ConsultantSettingComponent implements OnInit {
serviceCheckedData: number;
checkedArray: any[];
servicesList_data: any=[];
workinghours: any=[];
constructor(private formBuilder: FormBuilder, public dialog: MatDialog, public _con:ConsultantService, private fb: FormBuilder, public _api:ConsultantService,private locationStrategy: LocationStrategy) {}
@ -112,7 +113,10 @@ workingDialog(action,obj) {
this.usersList = res.data[0];
console.log(this.usersList)
this.practitionerdetails = this.usersList['practitionerInfos'][0]
this._con.getPractitionerInfo.next( this.usersList['practitionerInfos']);
console.log(this.practitionerdetails)
this.workinghours = JSON.parse(this.practitionerdetails.workingHours)
console.log(this.workinghours)
this.apiUrl = 'http://localhost:4200/customer/business/'+this.usersList.randStr
}
@ -170,12 +174,12 @@ workingDialog(action,obj) {
position: { right: '0' },
data:obj
});
// dialogRef.afterClosed().subscribe(result => {
// if(result != undefined){
// console.log(result)
// this.formAddUpdateAndDelete(result,result.data)
// }
// });
dialogRef.afterClosed().subscribe(result => {
if(result == 0){
console.log(result)
this.getUsersList()
}
});
}

View File

@ -12,16 +12,25 @@
<div formArrayName="filters">
<div *ngFor="let filter of filtersFormArray.controls; let i = index;">
<div [formGroupName]="i" class="container">
<div class="dis-flexs">
<mat-checkbox class="example-margin mt-2" formControlName="day" (change)="showOptions($event)">Sunday</mat-checkbox>
<div class="dis-flexs">
<div class="label-name" formControlName="day">
<!-- <input type="checkbox" *ngIf="i == 0" > -->
<mat-checkbox *ngIf="i == 0" [ngModelOptions]="{standalone: true}" [(ngModel)]="Select1" > </mat-checkbox>
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label *ngIf="i == 0">Sunday</label>
</span>
</div>
<mat-form-field appearance="outline">
<mat-select
placeholder="Select Time"
formControlName="filterType">
formControlName="startTime">
<mat-option
*ngFor="let filterType of filterTypes"
[value]="filterType">
{{ filterType }}
*ngFor="let startTime of startTimes"
[value]="startTime">
{{ startTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -30,11 +39,11 @@
(selectionChange)="selectedAPIChanged(i)"
placeholder="Select Time"
#apiField
formControlName="apiType">
formControlName="endTime">
<mat-option
*ngFor="let apiType of apiTypes"
[value]="apiType">
{{ apiType }}
*ngFor="let endTime of endTimes"
[value]="endTime">
{{ endTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -80,7 +89,8 @@
<div [formGroupName]="i" class="container">
<div class="dis-flexs">
<div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" *ngIf="i == 0">
<!-- <input type="checkbox" *ngIf="i == 0"> -->
<mat-checkbox *ngIf="i == 0" [ngModelOptions]="{standalone: true}" [(ngModel)]="Select2" > </mat-checkbox>
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label *ngIf="i == 0">Monday</label>
@ -89,11 +99,11 @@
<mat-form-field appearance="outline">
<mat-select
placeholder="Select Time"
formControlName="filterType">
formControlName="startTime">
<mat-option
*ngFor="let filterType of filterTypes"
[value]="filterType">
{{ filterType }}
*ngFor="let startTime of startTimes"
[value]="startTime">
{{ startTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -102,11 +112,11 @@
(selectionChange)="selectedAPIChanged(i)"
placeholder="Select Time"
#apiField
formControlName="apiType">
formControlName="endTime">
<mat-option
*ngFor="let apiType of apiTypes"
[value]="apiType">
{{ apiType }}
*ngFor="let endTime of endTimes"
[value]="endTime">
{{ endTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -152,7 +162,8 @@
<div [formGroupName]="i" class="container">
<div class="dis-flexs" >
<div class="label-name" formControlName="day" >
<input id="color-toggle" type="checkbox" *ngIf="i == 0">
<!-- <input type="checkbox" *ngIf="i == 0"> -->
<mat-checkbox *ngIf="i == 0" [ngModelOptions]="{standalone: true}" [(ngModel)]="Select3" > </mat-checkbox>
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label *ngIf="i == 0">Tuesday</label>
@ -161,11 +172,11 @@
<mat-form-field appearance="outline">
<mat-select
placeholder="Select Time"
formControlName="filterType">
formControlName="startTime">
<mat-option
*ngFor="let filterType of filterTypes"
[value]="filterType">
{{ filterType }}
*ngFor="let startTime of startTimes"
[value]="startTime">
{{ startTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -174,11 +185,11 @@
(selectionChange)="selectedAPIChanged(i)"
placeholder="Select Time"
#apiField
formControlName="apiType">
formControlName="endTime">
<mat-option
*ngFor="let apiType of apiTypes"
[value]="apiType">
{{ apiType }}
*ngFor="let endTime of endTimes"
[value]="endTime">
{{ endTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -224,7 +235,8 @@
<div [formGroupName]="i" class="container">
<div class="dis-flexs">
<div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" *ngIf="i == 0" >
<!-- <input type="checkbox" *ngIf="i == 0" > -->
<mat-checkbox *ngIf="i == 0" [ngModelOptions]="{standalone: true}" [(ngModel)]="Select4" > </mat-checkbox>
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label *ngIf="i == 0">Wednesday</label>
@ -233,11 +245,11 @@
<mat-form-field appearance="outline">
<mat-select
placeholder="Select Time"
formControlName="filterType">
formControlName="startTime">
<mat-option
*ngFor="let filterType of filterTypes"
[value]="filterType">
{{ filterType }}
*ngFor="let startTime of startTimes"
[value]="startTime">
{{ startTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -246,11 +258,11 @@
(selectionChange)="selectedAPIChanged(i)"
placeholder="Select Time"
#apiField
formControlName="apiType">
formControlName="endTime">
<mat-option
*ngFor="let apiType of apiTypes"
[value]="apiType">
{{ apiType }}
*ngFor="let endTime of endTimes"
[value]="endTime">
{{ endTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -296,7 +308,8 @@
<div [formGroupName]="i" class="container">
<div class="dis-flexs">
<div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" *ngIf="i == 0">
<!-- <input type="checkbox" *ngIf="i == 0"> -->
<mat-checkbox *ngIf="i == 0" [ngModelOptions]="{standalone: true}" [(ngModel)]="Select5" > </mat-checkbox>
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label *ngIf="i == 0">ThursDay</label>
@ -305,11 +318,11 @@
<mat-form-field appearance="outline">
<mat-select
placeholder="Select Time"
formControlName="filterType">
formControlName="startTime">
<mat-option
*ngFor="let filterType of filterTypes"
[value]="filterType">
{{ filterType }}
*ngFor="let startTime of startTimes"
[value]="startTime">
{{ startTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -318,11 +331,11 @@
(selectionChange)="selectedAPIChanged(i)"
placeholder="Select Time"
#apiField
formControlName="apiType">
formControlName="endTime">
<mat-option
*ngFor="let apiType of apiTypes"
[value]="apiType">
{{ apiType }}
*ngFor="let endTime of endTimes"
[value]="endTime">
{{ endTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -368,7 +381,8 @@
<div [formGroupName]="i" class="container">
<div class="dis-flexs">
<div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" *ngIf="i == 0">
<!-- <input type="checkbox" *ngIf="i == 0"> -->
<mat-checkbox *ngIf="i == 0" [ngModelOptions]="{standalone: true}" [(ngModel)]="Select6" > </mat-checkbox>
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label *ngIf="i == 0">Friday</label>
@ -377,11 +391,11 @@
<mat-form-field appearance="outline">
<mat-select
placeholder="Select Time"
formControlName="filterType">
formControlName="startTime">
<mat-option
*ngFor="let filterType of filterTypes"
[value]="filterType">
{{ filterType }}
*ngFor="let startTime of startTimes"
[value]="startTime">
{{ startTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -390,11 +404,11 @@
(selectionChange)="selectedAPIChanged(i)"
placeholder="Select Time"
#apiField
formControlName="apiType">
formControlName="endTime">
<mat-option
*ngFor="let apiType of apiTypes"
[value]="apiType">
{{ apiType }}
*ngFor="let endTime of endTimes"
[value]="endTime">
{{ endTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -440,7 +454,8 @@
<div [formGroupName]="i" class="container">
<div class="dis-flexs">
<div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" (change)="showOptions($event)" *ngIf="i == 0">
<!-- <input type="checkbox" (change)="showOptions($event)" *ngIf="i == 0"> -->
<mat-checkbox *ngIf="i == 0" [ngModelOptions]="{standalone: true}" [(ngModel)]="Select7" > </mat-checkbox>
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label *ngIf="i == 0">Saturday</label>
@ -449,11 +464,11 @@
<mat-form-field appearance="outline">
<mat-select
placeholder="Select Time"
formControlName="filterType">
formControlName="startTime">
<mat-option
*ngFor="let filterType of filterTypes"
[value]="filterType">
{{ filterType }}
*ngFor="let startTime of startTimes"
[value]="startTime">
{{ startTime }}
</mat-option>
</mat-select>
</mat-form-field>
@ -462,11 +477,11 @@
(selectionChange)="selectedAPIChanged(i)"
placeholder="Select Time"
#apiField
formControlName="apiType">
formControlName="endTime">
<mat-option
*ngFor="let apiType of apiTypes"
[value]="apiType">
{{ apiType }}
*ngFor="let endTime of endTimes"
[value]="endTime">
{{ endTime }}
</mat-option>
</mat-select>
</mat-form-field>

View File

@ -1,26 +1,89 @@
import { Component, OnInit } from '@angular/core';
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
import { MatCheckboxChange } from '@angular/material/checkbox';
import { MatDialogRef } from '@angular/material/dialog';
import { Component, OnInit } from "@angular/core";
import { FormArray, FormBuilder, FormGroup } from "@angular/forms";
import { MatCheckboxChange } from "@angular/material/checkbox";
import { MatDialogRef } from "@angular/material/dialog";
import { ConsultantService } from "../consultant-service/consultant.service";
@Component({
selector: 'app-edit-working-hours',
templateUrl: './edit-working-hours.component.html',
styleUrls: ['./edit-working-hours.component.scss']
selector: "app-edit-working-hours",
templateUrl: "./edit-working-hours.component.html",
styleUrls: ["./edit-working-hours.component.scss"],
})
export class EditWorkingHoursComponent implements OnInit {
startTimes = [
"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",
];
endTimes = [
"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",
];
days = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
];
seedData = [{ day: "Sunday", startTime: "09:00am", endTime: "09:30am" }];
filterTypes = [
'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',
];
apiTypes = [
'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',
];
days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
seedData = [
{ day: 'Sunday', filterType: '09:00am', apiType: '09:30am' },
];
Select1: any = false;
Select2: any = false;
Select3: any = false;
Select4: any = false;
Select5: any = false;
Select6: any = false;
Select7: any = false;
dynamicForm: FormGroup;
dynamicForm2: FormGroup;
@ -31,279 +94,392 @@ export class EditWorkingHoursComponent implements OnInit {
dynamicForm7: FormGroup;
// rows = [{noQuestion : 0}];
datainputForm: FormGroup;
Answer: any = [];
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',]
constructor(public dialogRef: MatDialogRef<EditWorkingHoursComponent>, private fb: FormBuilder) { }
constructor(
public dialogRef: MatDialogRef<EditWorkingHoursComponent>,
private fb: FormBuilder,public _api:ConsultantService
) {
this._api.getPractitionerInfo_observable$.subscribe((res) => {
console.log('nav list 3', res);
if(res.length>0){
this.practitioner = res
}
}
)
}
close() {
this.dialogRef.close();
}
}
// addNewRow() {
// this.rows.push({noQuestion : 0});
// }
// addNewRow() {
// this.rows.push({noQuestion : 0});
// }
// deleteRow(i){
// this.rows.splice(i, 1 );
// }
// deleteRow(i){
// this.rows.splice(i, 1 );
// }
ngOnInit(): void {
this.datainputForm = this.fb.group({
dropDownTest: '09:00am',
dropDownTests: '09:30am',
dropDownTest1:''
})
this.dynamicForm = this.fb.group({
filters: this.fb.array([])
});
this.dynamicForm2 = this.fb.group({
filters2: this.fb.array([])
});
this.dynamicForm3 = this.fb.group({
filters3: this.fb.array([])
});
this.dynamicForm4 = this.fb.group({
filters4: this.fb.array([])
});
this.dynamicForm5 = this.fb.group({
filters5: this.fb.array([])
});
this.dynamicForm6 = this.fb.group({
filters6: this.fb.array([])
});
this.dynamicForm7 = this.fb.group({
filters7: this.fb.array([])
});
this.seedFiltersFormArray();
this.seedFiltersFormArray2();
this.seedFiltersFormArray3();
this.seedFiltersFormArray4();
this.seedFiltersFormArray5();
this.seedFiltersFormArray6();
this.seedFiltersFormArray7();
ngOnInit(): void {
this.datainputForm = this.fb.group({
dropDownTest: "09:00am",
dropDownTests: "09:30am",
dropDownTest1: "",
});
}
this.dynamicForm = this.fb.group({
filters: this.fb.array([]),
});
this.dynamicForm2 = this.fb.group({
filters2: this.fb.array([]),
});
this.dynamicForm3 = this.fb.group({
filters3: this.fb.array([]),
});
this.dynamicForm4 = this.fb.group({
filters4: this.fb.array([]),
});
this.dynamicForm5 = this.fb.group({
filters5: this.fb.array([]),
});
this.dynamicForm6 = this.fb.group({
filters6: this.fb.array([]),
});
this.dynamicForm7 = this.fb.group({
filters7: this.fb.array([]),
});
this.seedFiltersFormArray();
this.seedFiltersFormArray2();
this.seedFiltersFormArray3();
this.seedFiltersFormArray4();
this.seedFiltersFormArray5();
this.seedFiltersFormArray6();
this.seedFiltersFormArray7();
}
seedFiltersFormArray() {
this.seedData.forEach((seedDatum) => {
console.log(seedDatum);
const formGroup = this.createFilterGroup();
if (seedDatum.endTime) {
formGroup.addControl("value", this.getFormControl());
}
seedDatum.day = "sunday";
seedFiltersFormArray() {
this.seedData.forEach(seedDatum => {
console.log(seedDatum)
const formGroup = this.createFilterGroup();
if (seedDatum.apiType) {
formGroup.addControl('value', this.getFormControl());
formGroup.patchValue(seedDatum);
this.filtersFormArray.push(formGroup);
});
}
seedFiltersFormArray2() {
this.seedData.forEach((seedDatum) => {
const formGroup = this.createFilterGroup();
if (seedDatum.endTime) {
formGroup.addControl("value", this.getFormControl());
}
seedDatum.day = "monday";
formGroup.patchValue(seedDatum);
this.filtersFormArray2.push(formGroup);
});
}
seedFiltersFormArray3() {
this.seedData.forEach((seedDatum) => {
const formGroup = this.createFilterGroup();
if (seedDatum.endTime) {
formGroup.addControl("value", this.getFormControl());
}
seedDatum.day = "tuesday";
formGroup.patchValue(seedDatum);
this.filtersFormArray3.push(formGroup);
});
}
seedFiltersFormArray4() {
this.seedData.forEach((seedDatum) => {
const formGroup = this.createFilterGroup();
if (seedDatum.endTime) {
formGroup.addControl("value", this.getFormControl());
}
seedDatum.day = "wednesday";
formGroup.patchValue(seedDatum);
this.filtersFormArray4.push(formGroup);
});
}
seedFiltersFormArray5() {
this.seedData.forEach((seedDatum) => {
const formGroup = this.createFilterGroup();
if (seedDatum.endTime) {
formGroup.addControl("value", this.getFormControl());
}
seedDatum.day = "thursday";
formGroup.patchValue(seedDatum);
this.filtersFormArray5.push(formGroup);
});
}
seedFiltersFormArray6() {
this.seedData.forEach((seedDatum) => {
const formGroup = this.createFilterGroup();
if (seedDatum.endTime) {
formGroup.addControl("value", this.getFormControl());
}
seedDatum.day = "friday";
formGroup.patchValue(seedDatum);
this.filtersFormArray6.push(formGroup);
});
}
seedFiltersFormArray7() {
this.seedData.forEach((seedDatum) => {
const formGroup = this.createFilterGroup();
if (seedDatum.endTime) {
formGroup.addControl("value", this.getFormControl());
}
seedDatum.day = "saturday";
formGroup.patchValue(seedDatum);
this.filtersFormArray7.push(formGroup);
});
}
createFilterGroup() {
return this.fb.group({
startTime: [],
endTime: [],
day: [],
});
}
createFilterGroup2() {
return this.fb.group({
startTime: [],
endTime: [],
day: [],
});
}
addFilterToFiltersFormArray() {
this.filtersFormArray.push(this.createFilterGroup());
}
addFilterToFiltersFormArray2() {
this.filtersFormArray2.push(this.createFilterGroup2());
}
addFilterToFiltersFormArray3() {
this.filtersFormArray3.push(this.createFilterGroup());
}
addFilterToFiltersFormArray4() {
this.filtersFormArray4.push(this.createFilterGroup());
}
addFilterToFiltersFormArray5() {
this.filtersFormArray5.push(this.createFilterGroup());
}
addFilterToFiltersFormArray6() {
this.filtersFormArray6.push(this.createFilterGroup());
}
addFilterToFiltersFormArray7() {
this.filtersFormArray7.push(this.createFilterGroup());
}
removeFilterFromFiltersFormArray(index) {
this.filtersFormArray.removeAt(index);
}
removeFilterFromFiltersFormArray2(index) {
this.filtersFormArray2.removeAt(index);
}
removeFilterFromFiltersFormArray3(index) {
this.filtersFormArray3.removeAt(index);
}
removeFilterFromFiltersFormArray4(index) {
this.filtersFormArray4.removeAt(index);
}
removeFilterFromFiltersFormArray5(index) {
this.filtersFormArray5.removeAt(index);
}
removeFilterFromFiltersFormArray6(index) {
this.filtersFormArray6.removeAt(index);
}
removeFilterFromFiltersFormArray7(index) {
this.filtersFormArray7.removeAt(index);
}
selectedAPIChanged(i) {
this.getFilterGroupAtIndex(i).addControl("value", this.getFormControl());
}
getFormControl() {
return this.fb.control(null);
}
save() {
this.Answer = [];
let tmp = [
this.dynamicForm.value,
this.dynamicForm2.value,
this.dynamicForm3.value,
this.dynamicForm4.value,
this.dynamicForm5.value,
this.dynamicForm6.value,
this.dynamicForm7.value,
];
console.log(tmp);
if (this.Select1 == true) {
this.Answer.push( {sunday: {
hours:this.dynamicForm.value.filters,
breaks: [],
}});
}else{
this.Answer.push( {sunday: {
hours:[],
breaks: [],
}});
}
seedDatum.day = 'sunday'
formGroup.patchValue(seedDatum);
this.filtersFormArray.push(formGroup);
});
}
seedFiltersFormArray2() {
this.seedData.forEach(seedDatum => {
const formGroup = this.createFilterGroup();
if (seedDatum.apiType) {
formGroup.addControl('value', this.getFormControl());
if (this.Select2 == true) {
this.Answer.push({monday: {
hours:this.dynamicForm2.value.filters2,
breaks: [],
}});
}else{
this.Answer.push({monday: {
hours:[],
breaks: [],
}});
}
seedDatum.day = 'monday'
formGroup.patchValue(seedDatum);
this.filtersFormArray2.push(formGroup);
});
}
seedFiltersFormArray3() {
this.seedData.forEach(seedDatum => {
const formGroup = this.createFilterGroup();
if (seedDatum.apiType) {
formGroup.addControl('value', this.getFormControl());
if (this.Select3 == true) {
this.Answer.push({tuesday: {
hours:this.dynamicForm3.value.filters3,
breaks: [],
}});
}else{
this.Answer.push({tuesday: {
hours:[],
breaks: [],
}});
}
seedDatum.day = 'tuesday'
formGroup.patchValue(seedDatum);
this.filtersFormArray3.push(formGroup);
});
}
seedFiltersFormArray4() {
this.seedData.forEach(seedDatum => {
const formGroup = this.createFilterGroup();
if (seedDatum.apiType) {
formGroup.addControl('value', this.getFormControl());
if (this.Select4 == true) {
this.Answer.push({ wednesday: {
hours:this.dynamicForm4.value.filters4,
breaks: [],
},});
}else{
this.Answer.push({ wednesday: {
hours:[],
breaks: [],
},});
}
seedDatum.day = 'wednesday'
formGroup.patchValue(seedDatum);
this.filtersFormArray4.push(formGroup);
});
}
seedFiltersFormArray5() {
this.seedData.forEach(seedDatum => {
const formGroup = this.createFilterGroup();
if (seedDatum.apiType) {
formGroup.addControl('value', this.getFormControl());
if (this.Select5 == true) {
this.Answer.push({ thursday: {
hours:this.dynamicForm5.value.filters5,
breaks: [],
},});
}else{
this.Answer.push({ thursday: {
hours:[],
breaks: [],
},});
}
seedDatum.day = 'thursday'
formGroup.patchValue(seedDatum);
this.filtersFormArray5.push(formGroup);
});
}
seedFiltersFormArray6() {
this.seedData.forEach(seedDatum => {
const formGroup = this.createFilterGroup();
if (seedDatum.apiType) {
formGroup.addControl('value', this.getFormControl());
if (this.Select6 == true) {
this.Answer.push({ friday: {
hours:this.dynamicForm6.value.filters6,
breaks: [],
},});
}else{
this.Answer.push({ friday: {
hours:[],
breaks: [],
},});
}
seedDatum.day = 'friday'
formGroup.patchValue(seedDatum);
this.filtersFormArray6.push(formGroup);
});
}
seedFiltersFormArray7() {
this.seedData.forEach(seedDatum => {
const formGroup = this.createFilterGroup();
if (seedDatum.apiType) {
formGroup.addControl('value', this.getFormControl());
if (this.Select7 == true) {
this.Answer.push({ saturday: {
hours:this.dynamicForm7.value.filters7,
breaks: [],
}});
}else{
this.Answer.push({ saturday: {
hours:[],
breaks: [],
}});
}
seedDatum.day = 'saturday'
formGroup.patchValue(seedDatum);
this.filtersFormArray7.push(formGroup);
});
}
createFilterGroup() {
return this.fb.group({
filterType: [],
apiType: [],
day: []
});
}
createFilterGroup2() {
return this.fb.group({
filterType: [],
apiType: [],
day: []
});
}
console.log(this.Answer);
let param;
if( this.practitioner.length>0){
param ={id:this.practitioner[0].id,workingHours:JSON.stringify(this.Answer)}
}
addFilterToFiltersFormArray() {
this.filtersFormArray.push(this.createFilterGroup());
}
addFilterToFiltersFormArray2() {
this.filtersFormArray2.push(this.createFilterGroup2());
}
addFilterToFiltersFormArray3() {
this.filtersFormArray3.push(this.createFilterGroup());
}
addFilterToFiltersFormArray4() {
this.filtersFormArray4.push(this.createFilterGroup());
}
addFilterToFiltersFormArray5() {
this.filtersFormArray5.push(this.createFilterGroup());
}
addFilterToFiltersFormArray6() {
this.filtersFormArray6.push(this.createFilterGroup());
}
addFilterToFiltersFormArray7() {
this.filtersFormArray7.push(this.createFilterGroup());
}
this._api.createPractitionerInfo(param).subscribe(res => {
if (res.status == 200) {
console.log(res)
this.dialogRef.close(1)
// this.checkedList = res.data;
}else{
this.dialogRef.close(0)
}
} );
}
removeFilterFromFiltersFormArray(index) {
this.filtersFormArray.removeAt(index);
}
removeFilterFromFiltersFormArray2(index) {
this.filtersFormArray2.removeAt(index);
}
removeFilterFromFiltersFormArray3(index) {
this.filtersFormArray3.removeAt(index);
}
removeFilterFromFiltersFormArray4(index) {
this.filtersFormArray4.removeAt(index);
}
removeFilterFromFiltersFormArray5(index) {
this.filtersFormArray5.removeAt(index);
}
removeFilterFromFiltersFormArray6(index) {
this.filtersFormArray6.removeAt(index);
}
removeFilterFromFiltersFormArray7(index) {
this.filtersFormArray7.removeAt(index);
}
selectedAPIChanged(i) {
this.getFilterGroupAtIndex(i).addControl('value', this.getFormControl());
}
get filtersFormArray() {
return <FormArray>this.dynamicForm.get("filters");
}
get filtersFormArray2() {
return <FormArray>this.dynamicForm2.get("filters2");
}
get filtersFormArray3() {
return <FormArray>this.dynamicForm3.get("filters3");
}
get filtersFormArray4() {
return <FormArray>this.dynamicForm4.get("filters4");
}
get filtersFormArray5() {
return <FormArray>this.dynamicForm5.get("filters5");
}
get filtersFormArray6() {
return <FormArray>this.dynamicForm6.get("filters6");
}
get filtersFormArray7() {
return <FormArray>this.dynamicForm7.get("filters7");
}
getFormControl() {
return this.fb.control(null);
}
getFilterGroupAtIndex(index) {
return <FormGroup>this.filtersFormArray.at(index);
}
save() {
// onSelectChange(){
// console.log(this.datainputForm.get('dropDownTest').value);
// if( this.datainputForm.get('dropDownTest').value === 'vmnic3'){
let tmp = [this.dynamicForm.value,this.dynamicForm2.value,this.dynamicForm3.value,this.dynamicForm4.value,this.dynamicForm5.value,this.dynamicForm6.value,this.dynamicForm7.value]
console.log(tmp);
}
// this.datainputForm.get('dropDownTest1').disable();
// }else{
// this.datainputForm.get('dropDownTest1').enable();
// }
get filtersFormArray() {
return (<FormArray>this.dynamicForm.get('filters'));
}
get filtersFormArray2() {
return (<FormArray>this.dynamicForm2.get('filters2'));
}
get filtersFormArray3() {
return (<FormArray>this.dynamicForm3.get('filters3'));
}
get filtersFormArray4() {
return (<FormArray>this.dynamicForm4.get('filters4'));
}
get filtersFormArray5() {
return (<FormArray>this.dynamicForm5.get('filters5'));
}
get filtersFormArray6() {
return (<FormArray>this.dynamicForm6.get('filters6'));
}
get filtersFormArray7() {
return (<FormArray>this.dynamicForm7.get('filters7'));
}
// console.log(this.datainputForm.get('dropDownTests').value);
// if( this.datainputForm.get('dropDownTests').value === 'vmnic3'){
getFilterGroupAtIndex(index) {
return (<FormGroup>this.filtersFormArray.at(index));
}
// onSelectChange(){
// console.log(this.datainputForm.get('dropDownTest').value);
// if( this.datainputForm.get('dropDownTest').value === 'vmnic3'){
// this.datainputForm.get('dropDownTest1').disable();
// }else{
// this.datainputForm.get('dropDownTest1').enable();
// }
// console.log(this.datainputForm.get('dropDownTests').value);
// if( this.datainputForm.get('dropDownTests').value === 'vmnic3'){
// this.datainputForm.get('dropDownTest1').disable();
// }else{
// this.datainputForm.get('dropDownTest1').enable();
// }
// }
// this.datainputForm.get('dropDownTest1').disable();
// }else{
// this.datainputForm.get('dropDownTest1').enable();
// }
// }
onSubmit() {
console.log(this.datainputForm.value);
}
showOptions(event:MatCheckboxChange): void {
console.log(event.checked);
showOptions(event: MatCheckboxChange, value): void {
console.log(event.checked, value);
if (value == "sunday" && event.checked == true) {
this.Answer.push(this.dynamicForm.value);
}
// this.form['value'].admin_checked = event.checked
// console.log(this.form['value'].admin_checked)
}

View File

@ -15,7 +15,7 @@ private apiUrl = environment.apiEndpoint;
getServicesListDetails(): Observable<any> {
console.log('IN')
return this._http.post(this.apiUrl + "getServicesDetails",{})
return this._http.post<any[]>(this.apiUrl + "getServicesDetails",{})
// .pipe(
// catchError(this.handleError('role', []))
// )

View File

@ -6,5 +6,7 @@
export const environment = {
production: false,
environmentName: 'Testing Environment',//Localhost Environment.
apiEndpoint:'http://192.168.1.20:8080/api/',
};