From 56b8c9abf07db8792270985e1a220672e5995138 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Thu, 13 Apr 2023 12:47:49 +0530 Subject: [PATCH] slot fixs --- .../user/add-user/add-user.component.html | 2 +- .../user/add-user/add-user.component.ts | 33 +++++++++++--- .../user/user-list/user-list.component.ts | 5 ++- .../customer-info/customer-info.component.ts | 16 +++---- .../slot-booking-details.component.html | 18 +++++--- .../slot-booking-details.component.scss | 16 +++++++ .../slot-booking-details.component.ts | 43 +++++++++++++++++++ 7 files changed, 110 insertions(+), 23 deletions(-) diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.html b/ng-seed/src/app/appoinment/user/add-user/add-user.component.html index 4e8d2e5..7f115d7 100644 --- a/ng-seed/src/app/appoinment/user/add-user/add-user.component.html +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.html @@ -16,7 +16,7 @@ Business -- - + {{business.busName}} diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts index bb90175..5caf5f6 100644 --- a/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts @@ -30,12 +30,14 @@ export class AddUserComponent implements OnInit { imageViewStatus: boolean; formData:any=[]; private apiUrl = environment.apiEndpoint; + busId: any; constructor(private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder, public dialogRef: MatDialogRef, @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData,public _bus:BusinessService) { console.log(data); this.local_data = {...data}; - + console.log( this.local_data) + // this.local_data.busId = localStorage.getItem('busNameID') this.action = this.local_data.action; this.formData= new FormData(); this.getBusinessList() @@ -60,9 +62,7 @@ export class AddUserComponent implements OnInit { createdBy:new FormControl(userrole,null), }); console.log(this.local_data); - if(this.action == 'Update'){ - this.local_data.businessselect = this.local_data.busId - } + this.form.patchValue(this.local_data) setTimeout(() => { @@ -105,8 +105,18 @@ export class AddUserComponent implements OnInit { // this.form.controls['businessselect'].setValue(data) console.log(this.businessList) console.log(this.form['value'].businessselect) - this.local_data.businessselect = this.local_data.busId - + // this.local_data.businessselect = this.local_data.busId + console.log(localStorage.getItem('busNameID'), localStorage.getItem('go_admin')) + if( localStorage.getItem('go_admin') =='0'){ + this.local_data.businessselect = localStorage.getItem('busNameID') + this.form.controls['businessselect'].setValue(localStorage.getItem('busNameID')) + } + //localStorage.setItem('busNameID',getData.busId) + + if(this.action == 'Update'){ + this.local_data.businessselect = this.local_data.busId + } + console.log( this.local_data) this.form.patchValue(this.local_data) } } @@ -139,10 +149,14 @@ export class AddUserComponent implements OnInit { let tmp = this.form.value tmp.id = this.local_data.id console.log(this.formData.getAll('image')); + if(this.busId == null){ + this.busId = localStorage.getItem('busNameID') || null + } if(this.action == 'Update'){ this.formData.append('id', tmp.id); - this.formData.append('busId', this.local_data.busId); + this.formData.append('busId', this.busId); } + this.formData.append('busId', this.busId); this.formData.append('userName', tmp.userName); this.formData.append('password', tmp.password); this.formData.append('role', tmp.role); @@ -183,5 +197,10 @@ export class AddUserComponent implements OnInit { image_view(image){ return this.apiUrl+'imageViewer?img_name='+image; } + bus(data){ + this.busId = data + console.log(data) + + } } diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts index 7cb45f1..4fb231f 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts @@ -65,7 +65,7 @@ export class UserListComponent implements OnInit { let open_go_admin = localStorage.getItem('go_admin') if(open_go_admin == '0'){ this.openDialog('Add',{}) - localStorage.setItem('go_admin','1') + // localStorage.setItem('go_admin','1') } } @@ -166,6 +166,7 @@ export class UserListComponent implements OnInit { } openDialog(action,obj) { + // localStorage.setItem('busNameID',null) obj.action = action; const dialogRef = this.dialog.open(AddUserComponent, { // width: '30%', @@ -234,6 +235,8 @@ export class UserListComponent implements OnInit { console.log(formValue[0]) this._use.addFormDetails(formValue[0]).subscribe(res => { if (res.status == 200) { + localStorage.setItem('go_admin','1') + localStorage.setItem('busNameID',null) // this.usersList = res.data; this.getUsersList() if(result.event == 'Add'){ diff --git a/ng-seed/src/app/end-user/customer-info/customer-info.component.ts b/ng-seed/src/app/end-user/customer-info/customer-info.component.ts index 8e3243e..bcd82eb 100644 --- a/ng-seed/src/app/end-user/customer-info/customer-info.component.ts +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.ts @@ -72,15 +72,15 @@ export class CustomerInfoComponent implements OnInit { city: row_obj.city, }; - // this._cus.addCusDetails(addFormData).subscribe(res => { - // if (res.status == 200) { - // console.log(res) + this._cus.addCusDetails(addFormData).subscribe(res => { + if (res.status == 200) { + console.log(res) - // let URL = this.router.url; - // console.log(URL) - // this.router.navigate([URL+"/"+res['data'].id+"/pt"]) - // } - // }); + let URL = this.router.url; + console.log(URL) + this.router.navigate([URL+"/"+res['data'].id+"/pt"]) + } + }); } diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html index ba56c8b..ebbe0bc 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html @@ -84,17 +84,23 @@
- - +
+
{{check(days) | date:'longDate'}}
+
+ +
+ +
+ + + - -
+ + -->