working hours changes

This commit is contained in:
bitbucket 2023-03-29 16:37:49 +05:30
parent ccadab7bc9
commit 70fc993883
9 changed files with 735 additions and 572 deletions

View File

@ -37,7 +37,7 @@
</ng-container> </ng-container>
<ng-container matColumnDef="time"> <ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef class="font-color">Appointment Time </th> <th mat-header-cell *matHeaderCellDef class="font-color">Appointment Time </th>
<td mat-cell *matCellDef="let element"> <div class="label">{{element.appoinmentSlots }}</div> </td> <td mat-cell *matCellDef="let element"><br> <div class="label">{{element.appoinmentSlots }}</div> </td>
</ng-container> </ng-container>

View File

@ -63,8 +63,18 @@ export class AppoinmentsListComponent implements OnInit {
this._app.getAppoinmentsListDetails().subscribe(res => { this._app.getAppoinmentsListDetails().subscribe(res => {
if (res.status == 200) { if (res.status == 200) {
this.appoinmentsList = res.data; this.appoinmentsList = res.data;
let user_role = localStorage.getItem('user_role');
if(user_role == 'PRACTITIONER'){
let id = localStorage.getItem('user_id')
console.log(id)
this.appoinmentsList
console.log(this.appoinmentsList) console.log(this.appoinmentsList)
let filter = this.appoinmentsList.filter(arr=>{return arr["ServicesMapDetail.userId"]
== id})
console.log(filter)
this.appoinmentsList = filter
}
} }
else{ else{

View File

@ -160,7 +160,19 @@ export class BusinessListComponent implements OnInit {
// var d = this.customersList.length+1 // var d = this.customersList.length+1
console.log(formValue[0]) console.log(formValue[0])
this._bus.addFormDetails(formValue[0]).subscribe(res => {
const formData:FormData = new FormData();
formData.append('image', formValue[0].logo);
// formData.append('busId', JSON.stringify(formValue[0].busName));
// formData.append('busName', JSON.stringify(formValue[0].busName));
// formData.append('address', JSON.stringify(formValue[0].address));
// formData.append('state', JSON.stringify(formValue[0].state));
// formData.append('city', JSON.stringify(formValue[0].city));
// formData.append('email', JSON.stringify(formValue[0].email));
// formData.append('contactNo', JSON.stringify(formValue[0].contactNo));
console.log(formData)
this._bus.addFormDetails(formData).subscribe(res => {
if (res.status == 200) { if (res.status == 200) {
// this.customersList = res.data; // this.customersList = res.data;
this.getBusinessList() this.getBusinessList()

View File

@ -19,7 +19,7 @@ export class BusinessService {
) )
} }
addFormDetails(addParams): Observable<any> { addFormDetails(addParams:any): Observable<any> {
return this._http.post(this.apiUrl + 'createBusinessDetails', addParams) return this._http.post(this.apiUrl + 'createBusinessDetails', addParams)
// .pipe( // .pipe(
// catchError(this.handleError('role', [])) // catchError(this.handleError('role', []))

View File

@ -19,6 +19,10 @@
<span class="staff-title"> <span class="staff-title">
Profile Profile
</span> </span>
<button mat-icon-button matTooltip="Edit" *ngIf="isEditable == false" (click)="edit_table(isEditable)" fileName="customers"><mat-icon >edit</mat-icon></button>
<!-- <button mat-icon-button *ngIf="table[0].statement == statement_item && table[0].statement != 'Cash Flow Statement'" color="accent" matTooltip="Edit" matTooltipPosition="right" (click)="editandcancel(true,table[0].section)" ><mat-icon>edit</mat-icon></button> -->
<button mat-icon-button color="accent" *ngIf="isEditable == true" (click)="edit_table(isEditable)" matTooltip="Cancel" matTooltipPosition="right" ><mat-icon>cancel_presentation</mat-icon></button>
<button mat-icon-button color="accent" *ngIf="isEditable == true" matTooltip="Submit" matTooltipPosition="right" ><mat-icon>done</mat-icon></button>
</div> </div>
<ng-scrollbar class="scrollHV"> <ng-scrollbar class="scrollHV">
<div mat-dialog-content class="my-table" > <div mat-dialog-content class="my-table" >
@ -26,6 +30,7 @@
<div class="form-group label-container"> <div class="form-group label-container">
<label>Name <span class="line">-</span></label> <label>Name <span class="line">-</span></label>
<a style="padding: 10px;">{{usersList.userName}}</a> <a style="padding: 10px;">{{usersList.userName}}</a>
</div> </div>
<div class="form-group label-container"> <div class="form-group label-container">
<label>Email Address <span style="margin-left: 2.7rem;">-</span></label> <label>Email Address <span style="margin-left: 2.7rem;">-</span></label>
@ -41,32 +46,67 @@
</div> </div>
<div class="form-group label-container"> <div class="form-group label-container">
<label>Gender <span style="margin-left: 5.5rem;">-</span></label> <label>Gender <span style="margin-left: 5.5rem;">-</span></label>
<a style="padding: 10px;">{{practitionerdetails.gender}}</a> <a *ngIf="isEditable == false" style="padding: 10px;">{{practitionerdetails.gender}}</a>
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
<mat-label>Gender</mat-label>
<input type="text" matInput placeholder="Gender">
</mat-form-field>
</div> </div>
<div class="form-group label-container"> <div class="form-group label-container">
<label>Date of Birth <span style="margin-left: 3.5rem;">-</span></label> <label>Date of Birth <span style="margin-left: 3.5rem;">-</span></label>
<a style="padding: 10px;">{{practitionerdetails.dob}}</a> <a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.dob}}</a>
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
<mat-label>Date of Birth</mat-label>
<input type="text" matInput placeholder="Date of Birth">
</mat-form-field>
</div> </div>
<div class="form-group label-container"> <div class="form-group label-container">
<label>Languages <span style="margin-left: 4rem;">-</span></label> <label>Languages <span style="margin-left: 4rem;">-</span></label>
<a style="padding: 10px;">{{practitionerdetails.languages}}</a> <a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.languages}}</a>
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
<mat-label>Languages</mat-label>
<input type="text" matInput placeholder="Languages">
</mat-form-field>
</div> </div>
<div class="form-group label-container"> <div class="form-group label-container">
<label>Qualification <span style="margin-left: 4rem;">-</span></label> <label>Qualification <span style="margin-left: 4rem;">-</span></label>
<a style="padding: 10px;">{{practitionerdetails.qualification}}</a> <a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.qualification}}</a>
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
<mat-label>Qualification</mat-label>
<input type="text" matInput placeholder="Qualification">
</mat-form-field>
</div> </div>
<div class="form-group label-container"> <div class="form-group label-container">
<label>Designation <span style="margin-left: 3.7rem;">-</span></label> <label>Designation <span style="margin-left: 3.7rem;">-</span></label>
<a style="padding: 10px;">{{practitionerdetails.designtion}}</a> <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">
</mat-form-field>
</div> </div>
<div class="form-group label-container"> <div class="form-group label-container">
<label>Experience <span style="margin-left: 4rem;">-</span></label> <label>Experience <span style="margin-left: 4rem;">-</span></label>
<a style="padding: 10px;">{{practitionerdetails.exp}}</a> <a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.exp}}</a>
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
<mat-label>Experience</mat-label>
<input type="text" matInput placeholder="Experience">
</mat-form-field>
</div> </div>
<div class="form-group label-container"> <!-- <div class="form-group label-container">
<label>Fees <span style="margin-left: 6.7rem;">-</span></label> <label>Fees <span style="margin-left: 6.7rem;">-</span></label>
<a style="padding: 10px;">{{practitionerdetails.fees}}</a> <a style="padding: 10px;">{{practitionerdetails.fees}}</a>
</div> <mat-form-field class="example-full-width">
<mat-label>Email</mat-label>
<input type="email" matInput placeholder="Ex. pat@example.com">
</mat-form-field>
</div> -->
<!-- <div class="form-group label-container"> <!-- <div class="form-group label-container">
<label>WorkingHours <span style="margin-left: 6.7rem;">-</span></label> <label>WorkingHours <span style="margin-left: 6.7rem;">-</span></label>
<a style="padding: 10px;">{{practitionerdetails.workingHours}}</a> <a style="padding: 10px;">{{practitionerdetails.workingHours}}</a>

View File

@ -27,7 +27,7 @@ export class ConsultantSettingComponent implements OnInit {
status: 'Active', status: 'Active',
}, },
]; ];
isEditable:any = false;
public usersList:any = new MatTableDataSource(); public usersList:any = new MatTableDataSource();
public servicesList:any = new MatTableDataSource(); public servicesList:any = new MatTableDataSource();
practitionerdetails: any; practitionerdetails: any;
@ -141,6 +141,22 @@ openDialog(action,obj) {
// }); // });
} }
edit_table(param){
if (param == true) {
this.isEditable = false;
} else {
console.log('status', );
this.isEditable = true
// localStorage.setItem('row_item',JSON.stringify(tableArr))
console.log( this.isEditable);
// this.isEditable = status;
// this.isEditable_month = tableArr.months;
}
}
workingDialog(action,obj) { workingDialog(action,obj) {
obj.action = action; obj.action = action;
const dialogRef = this.dialog.open(ExtraWorkingHoursComponent, { const dialogRef = this.dialog.open(ExtraWorkingHoursComponent, {

View File

@ -15,10 +15,10 @@
<div [formGroupName]="i" class="container"> <div [formGroupName]="i" class="container">
<div class="dis-flexs"> <div class="dis-flexs">
<div class="label-name" formControlName="day"> <div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" > <input id="color-toggle" type="checkbox" *ngIf="i == 0">
<span class="labelname checkbox-default-blue checked" <span class="labelname checkbox-default-blue checked"
[value]="day"> [value]="day">
<label>Sunday</label> <label *ngIf="i == 0">Sunday</label>
</span> </span>
</div> </div>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
@ -81,16 +81,16 @@
</button> --> </button> -->
</div> </div>
</form> </form>
<form [formGroup]="dynamicForm"> <form [formGroup]="dynamicForm2">
<div formArrayName="filters"> <div formArrayName="filters2">
<div *ngFor="let filter of filtersFormArray.controls; let i = index;"> <div *ngFor="let filter of filtersFormArray2.controls; let i = index;">
<div [formGroupName]="i" class="container"> <div [formGroupName]="i" class="container">
<div class="dis-flexs"> <div class="dis-flexs">
<div class="label-name" formControlName="day"> <div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" > <input id="color-toggle" type="checkbox" *ngIf="i == 0">
<span class="labelname checkbox-default-blue checked" <span class="labelname checkbox-default-blue checked"
[value]="day"> [value]="day">
<label>Monday</label> <label *ngIf="i == 0">Monday</label>
</span> </span>
</div> </div>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
@ -117,79 +117,52 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-icon class="deleteRow"
(click)="addFilterToFiltersFormArray()">
add
</mat-icon>
<mat-icon class="deleteRow"
(click)="removeFilterFromFiltersFormArray(i)">
delete
</mat-icon>
</div>
</div>
</div>
</div>
</form>
<form [formGroup]="dynamicForm">
<div formArrayName="filters">
<div *ngFor="let filter of filtersFormArray.controls; let i = index;">
<div [formGroupName]="i" class="container">
<div class="dis-flexs">
<div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" >
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label>Tuesday</label>
</span>
</div>
<mat-form-field appearance="outline">
<mat-select
placeholder="Select Time"
formControlName="filterType">
<mat-option
*ngFor="let filterType of filterTypes"
[value]="filterType">
{{ filterType }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" class="margin-lft">
<mat-select
(selectionChange)="selectedAPIChanged(i)"
placeholder="Select Time"
#apiField
formControlName="apiType">
<mat-option
*ngFor="let apiType of apiTypes"
[value]="apiType">
{{ apiType }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-icon class="deleteRow"
(click)="addFilterToFiltersFormArray()">
add
</mat-icon>
<mat-icon class="deleteRow"
(click)="removeFilterFromFiltersFormArray(i)">
delete
</mat-icon>
</div>
</div>
</div>
<!-- <mat-form-field appearance="outline"
*ngIf="filter.get('value')">
<input
matInput
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>
</div>
</div>
</div>
<!-- <button
mat-raised-button
color="primary"
type="button"
(click)="addFilterToFiltersFormArray()">
Add row
</button> -->
<!-- <button
class="save"
mat-stroked-button
color="primary"
[disabled]="dynamicForm.invalid || filtersFormArray.controls.length < 1"
(click)="save()">
Save
</button> -->
</div> </div>
</form> </form>
<form [formGroup]="dynamicForm"> <form [formGroup]="dynamicForm3">
<div formArrayName="filters"> <div formArrayName="filters3">
<div *ngFor="let filter of filtersFormArray.controls; let i = index;"> <div *ngFor="let filter of filtersFormArray3.controls; let i = index;">
<div [formGroupName]="i" class="container"> <div [formGroupName]="i" class="container">
<div class="dis-flexs"> <div class="dis-flexs" >
<div class="label-name" formControlName="day"> <div class="label-name" formControlName="day" >
<input id="color-toggle" type="checkbox" > <input id="color-toggle" type="checkbox" *ngIf="i == 0">
<span class="labelname checkbox-default-blue checked" <span class="labelname checkbox-default-blue checked"
[value]="day"> [value]="day">
<label>Wednesday</label> <label *ngIf="i == 0">Tuesday</label>
</span> </span>
</div> </div>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
@ -216,29 +189,52 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field appearance="outline"
*ngIf="filter.get('value')">
<input
matInput
formControlName="value"
[placeholder]="apiField.value">
</mat-form-field> -->
<mat-icon class="deleteRow" <mat-icon class="deleteRow"
(click)="addFilterToFiltersFormArray()"> (click)="addFilterToFiltersFormArray3()">
add add
</mat-icon> </mat-icon>
<mat-icon class="deleteRow" <mat-icon class="deleteRow"
(click)="removeFilterFromFiltersFormArray(i)"> (click)="removeFilterFromFiltersFormArray3(i)">
delete delete
</mat-icon> </mat-icon>
</div> </div>
</div> </div>
</div> </div>
<!-- <button
mat-raised-button
color="primary"
type="button"
(click)="addFilterToFiltersFormArray()">
Add row
</button> -->
<!-- <button
class="save"
mat-stroked-button
color="primary"
[disabled]="dynamicForm.invalid || filtersFormArray.controls.length < 1"
(click)="save()">
Save
</button> -->
</div> </div>
</form> </form>
<form [formGroup]="dynamicForm"> <form [formGroup]="dynamicForm4">
<div formArrayName="filters"> <div formArrayName="filters4">
<div *ngFor="let filter of filtersFormArray.controls; let i = index;"> <div *ngFor="let filter of filtersFormArray4.controls; let i = index;">
<div [formGroupName]="i" class="container"> <div [formGroupName]="i" class="container">
<div class="dis-flexs"> <div class="dis-flexs">
<div class="label-name" formControlName="day"> <div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" > <input id="color-toggle" type="checkbox" *ngIf="i == 0" >
<span class="labelname checkbox-default-blue checked" <span class="labelname checkbox-default-blue checked"
[value]="day"> [value]="day">
<label>Thursday</label> <label *ngIf="i == 0">Wednesday</label>
</span> </span>
</div> </div>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
@ -265,29 +261,52 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field appearance="outline"
*ngIf="filter.get('value')">
<input
matInput
formControlName="value"
[placeholder]="apiField.value">
</mat-form-field> -->
<mat-icon class="deleteRow" <mat-icon class="deleteRow"
(click)="addFilterToFiltersFormArray()"> (click)="addFilterToFiltersFormArray4()">
add add
</mat-icon> </mat-icon>
<mat-icon class="deleteRow" <mat-icon class="deleteRow"
(click)="removeFilterFromFiltersFormArray(i)"> (click)="removeFilterFromFiltersFormArray4(i)">
delete delete
</mat-icon> </mat-icon>
</div> </div>
</div> </div>
</div> </div>
<!-- <button
mat-raised-button
color="primary"
type="button"
(click)="addFilterToFiltersFormArray()">
Add row
</button> -->
<!-- <button
class="save"
mat-stroked-button
color="primary"
[disabled]="dynamicForm.invalid || filtersFormArray.controls.length < 1"
(click)="save()">
Save
</button> -->
</div> </div>
</form> </form>
<form [formGroup]="dynamicForm"> <form [formGroup]="dynamicForm5">
<div formArrayName="filters"> <div formArrayName="filters5">
<div *ngFor="let filter of filtersFormArray.controls; let i = index;"> <div *ngFor="let filter of filtersFormArray5.controls; let i = index;">
<div [formGroupName]="i" class="container"> <div [formGroupName]="i" class="container">
<div class="dis-flexs"> <div class="dis-flexs">
<div class="label-name" formControlName="day"> <div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" > <input id="color-toggle" type="checkbox" *ngIf="i == 0">
<span class="labelname checkbox-default-blue checked" <span class="labelname checkbox-default-blue checked"
[value]="day"> [value]="day">
<label>Friday</label> <label *ngIf="i == 0">ThursDay</label>
</span> </span>
</div> </div>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
@ -314,29 +333,52 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field appearance="outline"
*ngIf="filter.get('value')">
<input
matInput
formControlName="value"
[placeholder]="apiField.value">
</mat-form-field> -->
<mat-icon class="deleteRow" <mat-icon class="deleteRow"
(click)="addFilterToFiltersFormArray()"> (click)="addFilterToFiltersFormArray5()">
add add
</mat-icon> </mat-icon>
<mat-icon class="deleteRow" <mat-icon class="deleteRow"
(click)="removeFilterFromFiltersFormArray(i)"> (click)="removeFilterFromFiltersFormArray5(i)">
delete delete
</mat-icon> </mat-icon>
</div> </div>
</div> </div>
</div> </div>
<!-- <button
mat-raised-button
color="primary"
type="button"
(click)="addFilterToFiltersFormArray()">
Add row
</button> -->
<!-- <button
class="save"
mat-stroked-button
color="primary"
[disabled]="dynamicForm.invalid || filtersFormArray.controls.length < 1"
(click)="save()">
Save
</button> -->
</div> </div>
</form> </form>
<form [formGroup]="dynamicForm"> <form [formGroup]="dynamicForm6">
<div formArrayName="filters"> <div formArrayName="filters6">
<div *ngFor="let filter of filtersFormArray.controls; let i = index;"> <div *ngFor="let filter of filtersFormArray6.controls; let i = index;">
<div [formGroupName]="i" class="container"> <div [formGroupName]="i" class="container">
<div class="dis-flexs"> <div class="dis-flexs">
<div class="label-name" formControlName="day"> <div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" > <input id="color-toggle" type="checkbox" *ngIf="i == 0">
<span class="labelname checkbox-default-blue checked" <span class="labelname checkbox-default-blue checked"
[value]="day"> [value]="day">
<label>Saturday</label> <label *ngIf="i == 0">Friday</label>
</span> </span>
</div> </div>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
@ -363,293 +405,115 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field appearance="outline"
*ngIf="filter.get('value')">
<input
matInput
formControlName="value"
[placeholder]="apiField.value">
</mat-form-field> -->
<mat-icon class="deleteRow" <mat-icon class="deleteRow"
(click)="addFilterToFiltersFormArray()"> (click)="addFilterToFiltersFormArray6()">
add add
</mat-icon> </mat-icon>
<mat-icon class="deleteRow" <mat-icon class="deleteRow"
(click)="removeFilterFromFiltersFormArray(i)"> (click)="removeFilterFromFiltersFormArray6(i)">
delete delete
</mat-icon> </mat-icon>
</div> </div>
</div> </div>
</div> </div>
<!-- <button
mat-raised-button
color="primary"
type="button"
(click)="addFilterToFiltersFormArray()">
Add row
</button> -->
<!-- <button
class="save"
mat-stroked-button
color="primary"
[disabled]="dynamicForm.invalid || filtersFormArray.controls.length < 1"
(click)="save()">
Save
</button> -->
</div> </div>
</form> </form>
<!-- <div day="Sunday" class="label-container"> <form [formGroup]="dynamicForm7">
<div class="label-name"> <div formArrayName="filters7">
<input id="color-toggle" type="checkbox" > <div *ngFor="let filter of filtersFormArray7.controls; let i = index;">
<span class="labelname checkbox-default-blue checked"> <div [formGroupName]="i" class="container">
<label>Sunday</label> <div class="dis-flexs">
<div class="label-name" formControlName="day">
<input id="color-toggle" type="checkbox" (change)="showOptions($event)" *ngIf="i == 0">
<span class="labelname checkbox-default-blue checked"
[value]="day">
<label *ngIf="i == 0">Saturday</label>
</span> </span>
</div> </div>
<div class="dis-flex" *ngFor="let row of rows; let i = index"> <mat-form-field appearance="outline">
<div class="dis-flex" [(ngModel)]="row.noQuestion" > <mat-select
<div class="content-container"> placeholder="Select Time"
<div class="content-area"> formControlName="filterType">
<form [formGroup]="datainputForm" (ngSubmit)="onSubmit()" novalidate> <mat-option
<section class="form-block"> *ngFor="let filterType of filterTypes"
<div class="form-group dis-flex"> [value]="filterType">
<div class="select pr-1 ml-1"> {{ filterType }}
<select formControlName="dropDownTest" (change)="onSelectChange()" id="dropDownTestId" class="selectBox select-drop-box "> </mat-option>
<option *ngFor="let dropDownTestx of timing" [ngValue]="dropDownTestx" [disabled]="dropDownTestx === 'vmnic2'"> </mat-select>
{{ dropDownTestx }} </mat-form-field>
</option> <mat-form-field appearance="outline" class="margin-lft">
</select> <mat-select
</div> (selectionChange)="selectedAPIChanged(i)"
<div class="select pr-2"> placeholder="Select Time"
<select formControlName="dropDownTests" (change)="onSelectChange()" id="dropDownTestIds" class="selectBox select-drop-box "> #apiField
<option *ngFor="let dropDownTestxs of timing" [ngValue]="dropDownTestxs" [disabled]="dropDownTestxs === 'vmnic2'"> formControlName="apiType">
{{ dropDownTestxs }} <mat-option
</option> *ngFor="let apiType of apiTypes"
</select> [value]="apiType">
{{ apiType }}
</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-form-field appearance="outline"
*ngIf="filter.get('value')">
<input
matInput
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>
</div> </div>
</div> </div>
</section>
</form>
</div> </div>
<!-- <button
mat-raised-button
color="primary"
type="button"
(click)="addFilterToFiltersFormArray()">
Add row
</button> -->
<!-- <button
class="save"
mat-stroked-button
color="primary"
[disabled]="dynamicForm.invalid || filtersFormArray.controls.length < 1"
(click)="save()">
Save
</button> -->
</div> </div>
<span class="addbreak" (click)="addNewRow()">+</span> </form>
<span class="deleteRow" (click)="deleteRow(i)"><i class="fa fa-trash"></i></span>
</div>
<div class="applyToAll">Apply To All</div>
</div>
</div>
<div day="Monday" class="label-container">
<div class="label-name">
<input id="color-toggle" type="checkbox" >
<span class="labelname checkbox-default-blue checked">
<label>Monday</label>
</span>
</div>
<div class="dis-flex" *ngFor="let row of rows; let i = index">
<div class="dis-flex" [(ngModel)]="row.noQuestion">
<div class="content-container">
<div class="content-area">
<form [formGroup]="datainputForm" (ngSubmit)="onSubmit()" novalidate>
<section class="form-block">
<div class="form-group dis-flex">
<div class="select pr-1 ml-1">
<select formControlName="dropDownTest" (change)="onSelectChange()" id="dropDownTestId" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestx of timing" [ngValue]="dropDownTestx" [disabled]="dropDownTestx === 'vmnic2'">
{{ dropDownTestx }}
</option>
</select>
</div>
<div class="select pr-2">
<select formControlName="dropDownTests" (change)="onSelectChange()" id="dropDownTestIds" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestxs of timing" [ngValue]="dropDownTestxs" [disabled]="dropDownTestxs === 'vmnic2'">
{{ dropDownTestxs }}
</option>
</select>
</div>
</div>
</section>
</form>
</div>
</div>
<span class="addbreak" (click)="addNewRow()">+</span>
<span class="deleteRow" (click)="deleteRow(i)"><i class="fa fa-trash"></i></span>
</div>
<div class="applyToAll addbreak">Apply To All</div>
</div>
</div>
<div day="Tuesday" class="label-container">
<div class="label-name">
<input id="color-toggle" type="checkbox" >
<span class="labelname checkbox-default-blue checked">
<label>Tuesday</label>
</span>
</div>
<div class="dis-flex" *ngFor="let row of rows; let i = index">
<div class="dis-flex" [(ngModel)]="row.noQuestion">
<div class="content-container">
<div class="content-area">
<form [formGroup]="datainputForm" (ngSubmit)="onSubmit()" novalidate>
<section class="form-block">
<div class="form-group dis-flex">
<div class="select pr-1 ml-1">
<select formControlName="dropDownTest" (change)="onSelectChange()" id="dropDownTestId" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestx of timing" [ngValue]="dropDownTestx" [disabled]="dropDownTestx === 'vmnic2'">
{{ dropDownTestx }}
</option>
</select>
</div>
<div class="select pr-2">
<select formControlName="dropDownTests" (change)="onSelectChange()" id="dropDownTestIds" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestxs of timing" [ngValue]="dropDownTestxs" [disabled]="dropDownTestxs === 'vmnic2'">
{{ dropDownTestxs }}
</option>
</select>
</div>
</div>
</section>
</form>
</div>
</div>
<span class="addbreak" (click)="addNewRow()">+</span>
<span class="deleteRow" (click)="deleteRow(i)"><i class="fa fa-trash"></i></span>
</div>
<div class="applyToAll addbreak">Apply To All</div>
</div>
</div>
<div day="Wednesday" class="label-container">
<div class="label-name">
<input id="color-toggle" type="checkbox" >
<span class="labelname checkbox-default-blue checked">
<label>Wednesday</label>
</span>
</div>
<div class="dis-flex" *ngFor="let row of rows; let i = index">
<div class="dis-flex" [(ngModel)]="row.noQuestion">
<div class="content-container">
<div class="content-area">
<form [formGroup]="datainputForm" (ngSubmit)="onSubmit()" novalidate>
<section class="form-block">
<div class="form-group dis-flex">
<div class="select pr-1 ml-1">
<select formControlName="dropDownTest" (change)="onSelectChange()" id="dropDownTestId" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestx of timing" [ngValue]="dropDownTestx" [disabled]="dropDownTestx === 'vmnic2'">
{{ dropDownTestx }}
</option>
</select>
</div>
<div class="select pr-2">
<select formControlName="dropDownTests" (change)="onSelectChange()" id="dropDownTestIds" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestxs of timing" [ngValue]="dropDownTestxs" [disabled]="dropDownTestxs === 'vmnic2'">
{{ dropDownTestxs }}
</option>
</select>
</div>
</div>
</section>
</form>
</div>
</div>
<span class="addbreak" (click)="addNewRow()">+</span>
<span class="deleteRow" (click)="deleteRow(i)"><i class="fa fa-trash"></i></span>
</div>
<div class="applyToAll addbreak">Apply To All</div>
</div>
</div>
<div day="Thursday" class="label-container">
<div class="label-name">
<input id="color-toggle" type="checkbox" >
<span class="labelname checkbox-default-blue checked">
<label>Thursday</label>
</span>
</div>
<div class="dis-flex" *ngFor="let row of rows; let i = index">
<div class="dis-flex" [(ngModel)]="row.noQuestion">
<div class="content-container">
<div class="content-area">
<form [formGroup]="datainputForm" (ngSubmit)="onSubmit()" novalidate>
<section class="form-block">
<div class="form-group dis-flex">
<div class="select pr-1 ml-1">
<select formControlName="dropDownTest" (change)="onSelectChange()" id="dropDownTestId" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestx of timing" [ngValue]="dropDownTestx" [disabled]="dropDownTestx === 'vmnic2'">
{{ dropDownTestx }}
</option>
</select>
</div>
<div class="select pr-2">
<select formControlName="dropDownTests" (change)="onSelectChange()" id="dropDownTestIds" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestxs of timing" [ngValue]="dropDownTestxs" [disabled]="dropDownTestxs === 'vmnic2'">
{{ dropDownTestxs }}
</option>
</select>
</div>
</div>
</section>
</form>
</div>
</div>
<span class="addbreak" (click)="addNewRow()">+</span>
<span class="deleteRow" (click)="deleteRow(i)"><i class="fa fa-trash"></i></span>
</div>
<div class="applyToAll addbreak">Apply To All</div>
</div>
</div>
<div day="Friday" class="label-container">
<div class="label-name">
<input id="color-toggle" type="checkbox" >
<span class="labelname checkbox-default-blue checked">
<label>Friday</label>
</span>
</div>
<div class="dis-flex" *ngFor="let row of rows; let i = index">
<div class="dis-flex" [(ngModel)]="row.noQuestion">
<div class="content-container">
<div class="content-area">
<form [formGroup]="datainputForm" (ngSubmit)="onSubmit()" novalidate>
<section class="form-block">
<div class="form-group dis-flex">
<div class="select pr-1 ml-1">
<select formControlName="dropDownTest" (change)="onSelectChange()" id="dropDownTestId" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestx of timing" [ngValue]="dropDownTestx" [disabled]="dropDownTestx === 'vmnic2'">
{{ dropDownTestx }}
</option>
</select>
</div>
<div class="select pr-2">
<select formControlName="dropDownTests" (change)="onSelectChange()" id="dropDownTestIds" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestxs of timing" [ngValue]="dropDownTestxs" [disabled]="dropDownTestxs === 'vmnic2'">
{{ dropDownTestxs }}
</option>
</select>
</div>
</div>
</section>
</form>
</div>
</div>
<span class="addbreak" (click)="addNewRow()">+</span>
<span class="deleteRow" (click)="deleteRow(i)"><i class="fa fa-trash"></i></span>
</div>
<div class="applyToAll addbreak">Apply To All</div>
</div>
</div>
<div day="Saturday" class="label-container">
<div class="label-name">
<input id="color-toggle" type="checkbox" >
<span class="labelname checkbox-default-blue checked">
<label>Saturday</label>
</span>
</div>
<div class="dis-flex" *ngFor="let row of rows; let i = index">
<div class="dis-flex" [(ngModel)]="row.noQuestion">
<div class="content-container">
<div class="content-area">
<form [formGroup]="datainputForm" (ngSubmit)="onSubmit()" novalidate>
<section class="form-block">
<div class="form-group dis-flex">
<div class="select pr-1 ml-1">
<select formControlName="dropDownTest" (change)="onSelectChange()" id="dropDownTestId" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestx of timing" [ngValue]="dropDownTestx" [disabled]="dropDownTestx === 'vmnic2'">
{{ dropDownTestx }}
</option>
</select>
</div>
<div class="select pr-2">
<select formControlName="dropDownTests" (change)="onSelectChange()" id="dropDownTestIds" class="selectBox select-drop-box ">
<option *ngFor="let dropDownTestxs of timing" [ngValue]="dropDownTestxs" [disabled]="dropDownTestxs === 'vmnic2'">
{{ dropDownTestxs }}
</option>
</select>
</div>
</div>
</section>
</form>
</div>
</div>
<span class="addbreak" (click)="addNewRow()">+</span>
<span class="deleteRow" (click)="deleteRow(i)"><i class="fa fa-trash"></i></span>
</div>
<div class="applyToAll addbreak">Apply To All</div>
</div>
</div> -->
<!-- </ng-scrollbar> -->
<div class="popup-button mb-2"> <div class="popup-button mb-2">
<span class="buttons cancel" (click)="close()">Cancel</span> <span class="buttons cancel" (click)="close()">Cancel</span>
<span (click)="save()" class="buttons add">Save</span> <span (click)="save()" class="buttons add">Save</span>

View File

@ -22,6 +22,12 @@ export class EditWorkingHoursComponent implements OnInit {
]; ];
dynamicForm: FormGroup; dynamicForm: FormGroup;
dynamicForm2: FormGroup;
dynamicForm3: FormGroup;
dynamicForm4: FormGroup;
dynamicForm5: FormGroup;
dynamicForm6: FormGroup;
dynamicForm7: FormGroup;
// rows = [{noQuestion : 0}]; // rows = [{noQuestion : 0}];
datainputForm: FormGroup; datainputForm: FormGroup;
// 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',] // 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',]
@ -50,21 +56,130 @@ ngOnInit(): void {
this.dynamicForm = this.fb.group({ this.dynamicForm = this.fb.group({
filters: this.fb.array([]) 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.seedFiltersFormArray();
this.seedFiltersFormArray2();
this.seedFiltersFormArray3();
this.seedFiltersFormArray4();
this.seedFiltersFormArray5();
this.seedFiltersFormArray6();
this.seedFiltersFormArray7();
} }
seedFiltersFormArray() { seedFiltersFormArray() {
this.seedData.forEach(seedDatum => { this.seedData.forEach(seedDatum => {
console.log(seedDatum)
const formGroup = this.createFilterGroup(); const formGroup = this.createFilterGroup();
if (seedDatum.apiType) { if (seedDatum.apiType) {
formGroup.addControl('value', this.getFormControl()); formGroup.addControl('value', this.getFormControl());
} }
seedDatum.day = 'sunday'
formGroup.patchValue(seedDatum); formGroup.patchValue(seedDatum);
this.filtersFormArray.push(formGroup); this.filtersFormArray.push(formGroup);
});
}
seedFiltersFormArray2() {
this.seedData.forEach(seedDatum => {
const formGroup = this.createFilterGroup();
if (seedDatum.apiType) {
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.apiType) {
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.apiType) {
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.apiType) {
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.apiType) {
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.apiType) {
formGroup.addControl('value', this.getFormControl());
}
seedDatum.day = 'saturday'
formGroup.patchValue(seedDatum);
this.filtersFormArray7.push(formGroup);
}); });
} }
createFilterGroup() { createFilterGroup() {
return this.fb.group({ return this.fb.group({
filterType: [], filterType: [],
@ -72,14 +187,57 @@ createFilterGroup() {
day: [] day: []
}); });
} }
createFilterGroup2() {
return this.fb.group({
filterType: [],
apiType: [],
day: []
});
}
addFilterToFiltersFormArray() { addFilterToFiltersFormArray() {
this.filtersFormArray.push(this.createFilterGroup()); 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) { removeFilterFromFiltersFormArray(index) {
this.filtersFormArray.removeAt(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) { selectedAPIChanged(i) {
this.getFilterGroupAtIndex(i).addControl('value', this.getFormControl()); this.getFilterGroupAtIndex(i).addControl('value', this.getFormControl());
@ -90,12 +248,34 @@ getFormControl() {
} }
save() { save() {
console.log(this.dynamicForm.value);
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);
} }
get filtersFormArray() { get filtersFormArray() {
return (<FormArray>this.dynamicForm.get('filters')); 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'));
}
getFilterGroupAtIndex(index) { getFilterGroupAtIndex(index) {
return (<FormGroup>this.filtersFormArray.at(index)); return (<FormGroup>this.filtersFormArray.at(index));
@ -121,4 +301,6 @@ getFilterGroupAtIndex(index) {
onSubmit() { onSubmit() {
console.log(this.datainputForm.value); console.log(this.datainputForm.value);
} }
showOptions(event:any): void {
console.log(event.checked);}
} }

View File

@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatTable, MatTableDataSource } from '@angular/material/table'; import { MatTable, MatTableDataSource } from '@angular/material/table';
import { AppointmentsService } from 'app/appoinment/appoinments/appointments-service/appointments.service';
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { AddCustomersComponent } from '../add-customers/add-customers.component'; import { AddCustomersComponent } from '../add-customers/add-customers.component';
import { CustomersService } from '../customers-service/customers.service'; import { CustomersService } from '../customers-service/customers.service';
@ -50,8 +51,9 @@ export class CustomersListComponent implements OnInit {
// pageSize = 10; // pageSize = 10;
// pageEvent: PageEvent; // pageEvent: PageEvent;
addFormData: any; addFormData: any;
appoinmentsList:any =[];
constructor(public dialog: MatDialog,public _cus:CustomersService) { } appoinmentsIds:any = [];
constructor(public dialog: MatDialog,public _cus:CustomersService,public _app:AppointmentsService) { }
ngOnInit(): void { ngOnInit(): void {
// console.log('IN') // console.log('IN')
@ -61,10 +63,47 @@ export class CustomersListComponent implements OnInit {
getCustomersList() { getCustomersList() {
//this._pd.getTabStatusPdDetails(this.tabStatus) //this._pd.getTabStatusPdDetails(this.tabStatus)
let user_role = localStorage.getItem('user_role');
if(user_role == 'PRACTITIONER'){
this._app.getAppoinmentsListDetails().subscribe(res => {
if (res.status == 200) {
this.appoinmentsList = res.data;
let id = localStorage.getItem('user_id')
console.log(id)
console.log(this.appoinmentsList)
let filter = this.appoinmentsList.filter(arr=>{return arr["ServicesMapDetail.userId"]
== id})
console.log(filter)
filter.forEach(element => {
this.appoinmentsIds.push( element.customer[0].id)
});
}
else{
}
})
}
this._cus.getCustomersListDetails().subscribe(res => { this._cus.getCustomersListDetails().subscribe(res => {
if (res.status == 200) { if (res.status == 200) {
this.customersList = res.data; this.customersList = res.data;
// console.log(this.customersList) console.log(this.customersList,this.appoinmentsIds)
let user_role = localStorage.getItem('user_role');
if(user_role == 'PRACTITIONER'){
const activeIds = this.appoinmentsIds
const serviceList = this.customersList
const result = serviceList.filter(({id}) => activeIds.includes(id));
console.log(result)
this.customersList = result
}
// this.dataSource = res.data.length; // this.dataSource = res.data.length;
// console.log(this.dataSource) // console.log(this.dataSource)
// this.dataSource.data = this.customersList; // this.dataSource.data = this.customersList;