working hrs dynamic set value and add user changes
This commit is contained in:
parent
eea59cf123
commit
c018a8ac7c
@ -96,7 +96,7 @@ export class DialogBoxComponent implements OnInit {
|
||||
duration: any;
|
||||
userData: any;
|
||||
appoinmentsIds: any=[];
|
||||
customersList: any;
|
||||
customersList: any=[];
|
||||
customerId: any;
|
||||
slotsResult: any;
|
||||
ServiceId: any;
|
||||
|
||||
@ -167,52 +167,95 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
this.seedFiltersFormArray5();
|
||||
this.seedFiltersFormArray6();
|
||||
this.seedFiltersFormArray7();
|
||||
setTimeout(() => {
|
||||
//setInterval(() => {
|
||||
|
||||
|
||||
let sunday ={filters :this.data[0].sunday.hours }
|
||||
if(this.data[0].sunday.hours.length>1){
|
||||
for(let i=0;i<=this.data[0].sunday.hours.length-2;i++){
|
||||
this.addFilterToFiltersFormArray()
|
||||
}
|
||||
// if(this.data[0].sunday.hours.length>1){
|
||||
|
||||
// }
|
||||
|
||||
this.dynamicForm.patchValue(sunday)
|
||||
let monday ={filters :this.data[1].monday.hours }
|
||||
if(this.data[1].monday.hours.length>1){
|
||||
// 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)
|
||||
}
|
||||
// if(this.data[1].monday.hours.length>1){
|
||||
// this.addFilterToFiltersFormArray2()
|
||||
// }
|
||||
|
||||
this.dynamicForm2.patchValue(monday)
|
||||
let tuesday ={filters :this.data[2].tuesday.hours }
|
||||
if(this.data[2].tuesday.hours.length>1){
|
||||
|
||||
let tuesday ={filters3 :this.data[2].tuesday.hours }
|
||||
// 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)
|
||||
}
|
||||
|
||||
this.dynamicForm3.patchValue(tuesday)
|
||||
let wednesday ={filters :this.data[3].wednesday.hours }
|
||||
if(this.data[3].wednesday.hours.length>1){
|
||||
this.addFilterToFiltersFormArray4()
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
let thursday ={filters :this.data[4].thursday.hours }
|
||||
if(this.data[4].thursday.hours.length>1){
|
||||
this.addFilterToFiltersFormArray5()
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
let friday ={filters :this.data[5].friday.hours }
|
||||
if(this.data[5].friday.hours.length>1){
|
||||
this.addFilterToFiltersFormArray6()
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
let saturday ={filters :this.data[6].saturday.hours }
|
||||
if(this.data[6].saturday.hours.length>1){
|
||||
this.addFilterToFiltersFormArray7()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
}, 2000);
|
||||
// this.dynamicForm7.patchValue(saturday)
|
||||
|
||||
// }, 2000);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane" [readonly]="true">
|
||||
<mat-label>Role</mat-label>
|
||||
<mat-select placeholder="Select Role" formControlName="role" required>
|
||||
<mat-select placeholder="Select Role" formControlName="role" required [disabled]="disableBus ==0">
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let roleNmae of role" [value]="roleNmae.name">
|
||||
{{roleNmae.name}}
|
||||
|
||||
@ -115,6 +115,10 @@ export class AddUserComponent implements OnInit {
|
||||
// if( localStorage.getItem('go_admin') =='0'){
|
||||
this.local_data.businessselect = localStorage.getItem('busNameID')
|
||||
this.form.controls['businessselect'].setValue(localStorage.getItem('busNameID'))
|
||||
if( this.disableBus == 0){
|
||||
this.form.controls['role'].setValue('BADMIN')
|
||||
}
|
||||
|
||||
// }
|
||||
//localStorage.setItem('busNameID',getData.busId)
|
||||
|
||||
|
||||
@ -169,8 +169,11 @@ export class UserListComponent implements OnInit {
|
||||
|
||||
}
|
||||
openDialog(action,obj) {
|
||||
|
||||
if(action == 'Update' || action == 'Delete'){
|
||||
localStorage.setItem('busNameID',obj.busId
|
||||
)
|
||||
}
|
||||
obj.action = action;
|
||||
const dialogRef = this.dialog.open(AddUserComponent, {
|
||||
// width: '30%',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user