diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html index 38cae88..042e1bc 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html @@ -38,7 +38,7 @@ Date and Time - {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots | date:'shortTime'}} + {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots[0] | date:'shortTime'}} diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts index e0596a3..3663409 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts @@ -76,30 +76,58 @@ export class AppoinmentsListComponent implements OnInit { } getAppoinmentsList() { + let user_role = localStorage.getItem('user_role'); //this._pd.getTabStatusPdDetails(this.tabStatus) this._app.getAppoinmentsListDetails().subscribe(res => { if (res.status == 200) { this.isLoading = false this.appoinmentsList = res.data; + localStorage.setItem('busId', res.data[0].busId + ) console.log(this.appoinmentsList) this.appointmentListLength = res.data.length; console.log(this.appointmentListLength) this.appointmentListSource['data'] = this.appoinmentsList; console.log(this.appointmentListSource) this.recordStatus=false; + console.log(this.appoinmentsList) - let user_role = localStorage.getItem('user_role'); + this.appoinmentsList.forEach(element => { + console.log(element) + element.appoinmentSlots = JSON.parse(element.appoinmentSlots) + }); + console.log(this.appoinmentsList) + + if(user_role == 'PRACTITIONER'){ + console.log('if ') let id = localStorage.getItem('user_id') console.log(id) + this.appointmentListSource['data'] = this.appoinmentsList; this.appointmentListSource console.log(this.appointmentListSource) let filter = this.appointmentListSource['data'].filter(arr=>{return arr["ServicesMapDetail.userId"] == id}) console.log(filter) + filter.sort((a: any, b: any) => { + return b.id - a.id; + }); this.appointmentListSource['data'] = filter this.appointmentListLength = filter.length; + console.log(this.appointmentListSource) + + } else { + console.log('else') + this.appointmentListLength = res.data.length; + console.log(this.appointmentListLength) + this.appoinmentsList.sort((a: any, b: any) => { + return b.id - a.id; + }); + this.appointmentListSource['data'] = this.appoinmentsList; + console.log(this.appointmentListSource) + } + this.recordStatus=false; } else{ this.appoinmentsList=[]; @@ -161,7 +189,7 @@ export class AppoinmentsListComponent implements OnInit { openDialog(action,obj) { obj.action = action; const dialogRef = this.dialog.open(DialogBoxComponent, { - width: '55%', + width: '40%', height: '100%', // maxWidth: '38vw', position: { right: '0' }, diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments.module.ts b/ng-seed/src/app/appoinment/appoinments/appoinments.module.ts index 15141c6..fdf477f 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments.module.ts +++ b/ng-seed/src/app/appoinment/appoinments/appoinments.module.ts @@ -10,7 +10,8 @@ import { DialogBoxComponent } from './dialog-box/dialog-box.component'; import { DemoMaterialModule } from 'app/shared/demo.module'; import { NgScrollbarModule } from 'ngx-scrollbar'; import { NotifierModule, NotifierOptions } from 'angular-notifier'; -import { DataTableModule } from 'ornamentum' +import { DataTableModule } from 'ornamentum'; +import { AppointmentAddcustomerComponent } from './appointment-addcustomer/appointment-addcustomer.component' // import CalendarTodayIcon from '@material-ui/icons/CalendarToday'; @@ -58,7 +59,8 @@ const customNotifierOptions: NotifierOptions = { @NgModule({ declarations: [ AppoinmentsListComponent, - DialogBoxComponent + DialogBoxComponent, + AppointmentAddcustomerComponent ], imports: [ DemoMaterialModule, diff --git a/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.html b/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.html new file mode 100644 index 0000000..84ed95f --- /dev/null +++ b/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.html @@ -0,0 +1,39 @@ + + +
+
+
+ New Customer
+ + + Name + + + + + Email + + + + + Phone + + + +
+ +
+
\ No newline at end of file diff --git a/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.scss b/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.scss new file mode 100644 index 0000000..2853f60 --- /dev/null +++ b/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.scss @@ -0,0 +1,252 @@ +$color_red_orange_approx: #107c14; +$white: #fff; +$black_10: rgba(0, 0, 0, 0.1); +$black_30: rgba(0, 0, 0, 0.3); +$icon-size: 3rem; +$icon-color: #D8D8D8; +$main-color: #f44336; +$tem-color : #217e69; +.mat-pane{ + width: 27rem; +} +.button{ + margin-bottom: 1rem; + background-color: #ffff!important; + margin-top: -1rem; + position: absolute; + right: 20px; +} +::ng-deep .mat-card.settings-panel { + position: inherit; + bottom: 0px; + right: 0px; + width: 100%; + z-index: 9; + top: 58px; +} + +::ng-deep body .mat-card { + box-shadow:none!important; +} + +// @include media-breakpoint-down(lg) { +// padding-top: 150px; +// } +// @include media-breakpoint-down(md) { +// padding-top: 100px; +// } +// @include media-breakpoint-down(sm) { +// padding-top: 100px; +// } + + +// @media only screen and (max-width: 600px) { +// .cdk-overlay-pane{ +// width: 90%!important; +// } +// } + +@media (max-width: 959px){ + .cdk-overlay-pane{ + width: 90%!important; + } +} + +.field{ + display: flex; +} +.label-container{ + flex: 1; + color: #666; + position: relative; + text-transform: capitalize; + width: 100px; + flex: none; + margin-right: 20px; + align-self: flex-start; + padding-top: 20px; + box-sizing: border-box; + line-height: 15px; + font-size: 14px; +} +.Date-container{ + margin-right: 40px!important; +} +// ::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper { +// margin: 0.25em 0; +// width: 175%!important; +// } +.mate{ + width: 43% !important; +} +.date-marge{ + margin-left: 1.5rem; +} +.field-inline{ + display: inline-flex; +} +// ::ng-deep .swal2-height-auto { +// // height: auto!important; +// } +::ng-deep .mat-dialog-content { + max-height: 75vh!important; + overflow: unset!important; + // overflow: hidden!important; +} +::ng-deep .mat-dialog-container{ + overflow: hidden!important; +} +.scrollHV { + height: calc(100vh - 190px); +} +.notes{ + margin-left: 7.5rem; + margin-top: 2rem; + color: #666; +} +//popup +.card { + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); + transition: 0.3s; + width: 100%; + // padding: 10px; + } + .topnav { + overflow: hidden; + background: #52518F; + color: #ffff; + text-align: center; + padding: 15px; + // display: flex; + } + .days{ + font-size: 12px; + color: #666; + border-bottom: 1px solid #ccc; + padding: 5px; + } +// .flexxx{ + +// display: flex; +// // margin-top: 1rem; +// // border-top:1px solid #ccc; +// } +// .date-time{ +// position: absolute; +// // top: -11px; +// bottom: 0px; +// } +// .date-position{ +// position: relative; +// } +.add-customer{ + padding: 5px; + font-size: 12px; + color: #666; +} + +.navStyle{ + width: 100%; + height: 3rem; + background-color: #227f6e; + color: #fff; +} +.innerdivs{ + width:100%; + // float:left; +} +.innerdivs2{ + width:100%; + // float:left; + text-align: center; + margin-bottom: 1rem !important; +} +.cardDesign{ + border: 1px solid #e8edef; + width: 89%; + background-color: #227f6e21; + // box-shadow: 0 2px 0 rgb(0 0 0 / 3%) +} +.hoverButton{ + background: $white; + // box-shadow: 0 2px 6px $tem-color; + transition: all 0.1s ease-in-out 0s; + &:hover { + box-shadow: 0 0 8px $tem-color; + + transform: scale(1.05); + } +} +.primary{ + background-color: #00866e00; + color: brown; + width: auto; + border: 1px solid brown; + cursor: pointer; +} +.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; +} +.newCustomer{ + color: #227f6e; + text-align: center; + border: 1px solid #e8edef; +} + +.cardDesign2{ + border: 1px dashed #227f6e; + width: 75%; + height: 348px; + margin-left: 3rem; + background-color: #fcfcfc; + margin-bottom: 2rem; +} +.card-mat-pane{ + width: 20rem; +} +.new{ + color: #227f6e; + margin-top: 0px !important; +} +.popup-button { + // margin-top: 2rem; + width: 100%; + } + .cancel { + background: #F5F5F5; + color: #111; + float: left; + cursor: pointer; + } + .buttons { + width: 50%; + background: #FFF; + color: #111; + font-size: 15px; + // font-family: zohopuvi-medium; + text-align: center; + border-top: 1px solid #E2E2E2; + padding: 10px; + -webkit-transition: all .2s ease-in; + -moz-transition: all .2s ease-in; + transition: all .2s ease-in; + } + .add { + background-color: #4caf50; + color: #FFF; + border-top: 1px solid #4caf50; + float: left; + cursor: pointer; +} +.pad{ + padding: 20px !important; +} \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.spec.ts b/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.spec.ts new file mode 100644 index 0000000..54e1087 --- /dev/null +++ b/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AppointmentAddcustomerComponent } from './appointment-addcustomer.component'; + +describe('AppointmentAddcustomerComponent', () => { + let component: AppointmentAddcustomerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AppointmentAddcustomerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AppointmentAddcustomerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.ts b/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.ts new file mode 100644 index 0000000..73c7adc --- /dev/null +++ b/ng-seed/src/app/appoinment/appoinments/appointment-addcustomer/appointment-addcustomer.component.ts @@ -0,0 +1,52 @@ +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { AppointmentsService } from '../appointments-service/appointments.service'; +import { CustomersService } from 'app/appoinment/customers/customers-service/customers.service'; + +@Component({ + selector: 'app-appointment-addcustomer', + templateUrl: './appointment-addcustomer.component.html', + styleUrls: ['./appointment-addcustomer.component.scss'] +}) +export class AppointmentAddcustomerComponent implements OnInit { + form: FormGroup; + @Output() childButtonEvent = new EventEmitter(); + constructor(public _app:AppointmentsService,public _cus:CustomersService) { } + + ngOnInit(): void { + this.form = new FormGroup({ + name: new FormControl('', [Validators.required]), + email: new FormControl('', [Validators.required]), + phoneNo: new FormControl('', [Validators.required]), + + + }); + } + save(){ + + } + close(){ + + } + 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') + + } + this._cus.addFormDetails(form).subscribe(res => { + if (res.status == 200) { + this.childButtonEvent.emit(res); + // this._app.customerlist.next(res) + } + }) + + } +} diff --git a/ng-seed/src/app/appoinment/appoinments/appointments-service/appointments.service.ts b/ng-seed/src/app/appoinment/appoinments/appointments-service/appointments.service.ts index f947001..b8a658a 100644 --- a/ng-seed/src/app/appoinment/appoinments/appointments-service/appointments.service.ts +++ b/ng-seed/src/app/appoinment/appoinments/appointments-service/appointments.service.ts @@ -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 AppointmentsService { - + + public customerlist:BehaviorSubject = new BehaviorSubject([]); +public customerlist_observable$ = this.customerlist.asObservable(); private apiUrl = environment.apiEndpoint; constructor(private _http: HttpClient) { } @@ -33,6 +35,10 @@ export class AppointmentsService { // catchError(this.handleError('role', [])) // ) } + getSlots(Params){ + + return this._http.post(this.apiUrl + 'getSlots', Params) + } handleError(arg0: string, arg1: undefined[]): (err: any, caught: Observable) => import("rxjs").ObservableInput { diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html index 5c37321..083f640 100644 --- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html +++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html @@ -1,225 +1,125 @@ - -
- {{action}} Appoinment + +
{{action}} Appoinment -
- -
+ >close
+ +
-
- - - - -- - - {{business.busname}} - - - Please choose an Business - Please choose any other - -
+ -
- - - - -- - - {{business.service}} - - - Please choose an Service - Please choose any other - -
- -
- - - - -- - - {{business.practitioner}} - - - Please choose an Practitioner - Please choose any other - -
- -
- - - - - - - - - - - - -
-
- Wed, 12 Apr 2023 -
-
-
+ + Business + -
-
- MORNING -
-
- - - -
+ + + + Service + + -- + + {{business.servicesName}} + + + Please choose an Service + Please choose any other + + + + + Practitioner + + + + + + Choose a date + + + + + + Choose a Time + + + + + -
-
- AFTERNOON -
-
- - -
-
-
-
- EVENING -
-
- - -
-
-
-
- NIGHT -
-
- -
-
-
-
-
-
+
+ + + +
+ - - -
- - - - - Add customer - - {{business.customer}} - - - Please choose an Customer - Please choose any other - -
- - - -
- - -
+ + Customer + + + + New Customer + + {{business.cusName + }} + + + Please choose an Customer + Please choose any other + + + +
- - - - - - - - -
- - - Sure to delete {{local_data.name}}? - -
-
- - -
- \ No newline at end of file + + + + Sure to delete {{local_data.cusName}}? + +
+
+
+ + +
+ + \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.scss b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.scss index 07a69a4..2853f60 100644 --- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.scss +++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.scss @@ -1,8 +1,13 @@ -// ::ng-deep .cdk-overlay-pane{ -// width: 60%!important; -// } +$color_red_orange_approx: #107c14; +$white: #fff; +$black_10: rgba(0, 0, 0, 0.1); +$black_30: rgba(0, 0, 0, 0.3); +$icon-size: 3rem; +$icon-color: #D8D8D8; +$main-color: #f44336; +$tem-color : #217e69; .mat-pane{ - width: 20rem; + width: 27rem; } .button{ margin-bottom: 1rem; @@ -72,7 +77,7 @@ // width: 175%!important; // } .mate{ - width: 22% !important; + width: 43% !important; } .date-marge{ margin-left: 1.5rem; @@ -138,4 +143,110 @@ padding: 5px; font-size: 12px; color: #666; -} \ No newline at end of file +} + +.navStyle{ + width: 100%; + height: 3rem; + background-color: #227f6e; + color: #fff; +} +.innerdivs{ + width:100%; + // float:left; +} +.innerdivs2{ + width:100%; + // float:left; + text-align: center; + margin-bottom: 1rem !important; +} +.cardDesign{ + border: 1px solid #e8edef; + width: 89%; + background-color: #227f6e21; + // box-shadow: 0 2px 0 rgb(0 0 0 / 3%) +} +.hoverButton{ + background: $white; + // box-shadow: 0 2px 6px $tem-color; + transition: all 0.1s ease-in-out 0s; + &:hover { + box-shadow: 0 0 8px $tem-color; + + transform: scale(1.05); + } +} +.primary{ + background-color: #00866e00; + color: brown; + width: auto; + border: 1px solid brown; + cursor: pointer; +} +.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; +} +.newCustomer{ + color: #227f6e; + text-align: center; + border: 1px solid #e8edef; +} + +.cardDesign2{ + border: 1px dashed #227f6e; + width: 75%; + height: 348px; + margin-left: 3rem; + background-color: #fcfcfc; + margin-bottom: 2rem; +} +.card-mat-pane{ + width: 20rem; +} +.new{ + color: #227f6e; + margin-top: 0px !important; +} +.popup-button { + // margin-top: 2rem; + width: 100%; + } + .cancel { + background: #F5F5F5; + color: #111; + float: left; + cursor: pointer; + } + .buttons { + width: 50%; + background: #FFF; + color: #111; + font-size: 15px; + // font-family: zohopuvi-medium; + text-align: center; + border-top: 1px solid #E2E2E2; + padding: 10px; + -webkit-transition: all .2s ease-in; + -moz-transition: all .2s ease-in; + transition: all .2s ease-in; + } + .add { + background-color: #4caf50; + color: #FFF; + border-top: 1px solid #4caf50; + float: left; + cursor: pointer; +} +.pad{ + padding: 20px !important; +} \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts index 46d3426..9afd42d 100644 --- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts +++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts @@ -2,6 +2,12 @@ import { Component, Inject, OnInit, Optional } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { Router } from '@angular/router'; +import { AppointmentsService } from '../appointments-service/appointments.service'; +import { DatePipe } from '@angular/common'; +import { ConsultantService } from 'app/appoinment/consultant-setting/consultant-service/consultant.service'; +import { CustomersService } from 'app/appoinment/customers/customers-service/customers.service'; +import { EndUserService } from 'app/end-user/end-user.service'; +import { NotifierService } from 'angular-notifier'; export interface UsersData { // id: number; busname: string; @@ -78,27 +84,30 @@ export class DialogBoxComponent implements OnInit { {staff: 'Devi.k'}, ]; appoinmentSlots = new FormControl('', [Validators.required]); - slots = [ - {appoinmentSlots: '9AM - 9.30AM'}, - {appoinmentSlots: '10AM - 10.30AM'}, - {appoinmentSlots: '11AM - 11.30AM'}, - {appoinmentSlots: '12AM - 12.30AM'}, - {appoinmentSlots: '01PM - 01.30PM'}, - {appoinmentSlots: '02PM - 02.30PM'}, - {appoinmentSlots: '03PM - 03.30PM'}, - {appoinmentSlots: '04PM - 04.30PM'}, - {appoinmentSlots: '05PM - 05.30PM'}, - {appoinmentSlots: '06PM - 06.30PM'}, - {appoinmentSlots: '07PM - 07.30PM'}, - ]; + slots:any =[]; - - constructor(private router: Router,private formBuilder: FormBuilder, - public dialogRef: MatDialogRef, - @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData) { + clicks:any = 0; + customerCard: any; + slot_array: any; + date: any; + servicesList_array: any[]; + servicesList_data: any; + assignService: any=[]; + duration: any; + userData: any; + appoinmentsIds: any=[]; + customersList: any; + customerId: any; + slotsResult: any; + ServiceId: any; + constructor(private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder, public _cus:CustomersService, + public dialogRef: MatDialogRef,public _api:ConsultantService, public _con:ConsultantService, + @Inject(MAT_DIALOG_DATA) public data: UsersData,public _app:AppointmentsService,public end_user:EndUserService) { console.log(data); this.local_data = {...data}; this.action = this.local_data.action; + + } get f(){ return this.form.controls; @@ -127,41 +136,264 @@ 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() { - this.form = new FormGroup({ - busname: new FormControl('', [Validators.required]), - service: new FormControl('', [Validators.required]), - practitioner: new FormControl('', [Validators.required]), - appoinmentDate: new FormControl('', [Validators.required]), - appoinmentTime: new FormControl('', [Validators.required]), - customer: new FormControl('', [Validators.required]), - note: new FormControl('', [Validators.required]), + ngOnInit() { + // this._app.customerlist_observable$.subscribe((res) => { + // console.log('cus', res); + + // if(res){ + + + // } + + // }) + this.getSlots() + let userId = localStorage.getItem('user_id') + let busId = localStorage.getItem('busId') + this.getServicesList(userId, busId) + this.getApiData() + this.form = new FormGroup({ + busname: new FormControl('', [Validators.required]), + service: new FormControl('', [Validators.required]), + practitioner: new FormControl('', [Validators.required]), + appoinmentDate: new FormControl('', [Validators.required]), + appoinmentTime: new FormControl('', [Validators.required]), + customer: new FormControl('', [Validators.required]), + // note: new FormControl('', [Validators.required]), - workspace: new FormControl('', [Validators.required]), - staff: new FormControl('', [Validators.required]), - slot: new FormControl('', [Validators.required]), - appoinmentSlots: new FormControl('', [Validators.required]), + + + + appoinmentSlots: new FormControl('', [Validators.required]), + + }); + console.log(this.local_data, this.selects) + // this.form.controls['note'].setValue('Sample') + this.form.patchValue(this.local_data) + let id = localStorage.getItem('user_id') + console.log(id) + this._con.getUsersListDetails(id).subscribe(res => { + if (res.status == 200) { + console.log(res) + + this.userData = res.data[0] + this.form.controls['busname'].setValue( this.userData.BusinessDetails[0].busName + ); + + this.form.controls['practitioner'].setValue( this.userData.userName); + } + }) + } + public myError = (controlName: string, errorName: string) =>{ + return this.form.controls[controlName].hasError(errorName); + } + submit(){ + console.log(this.form.value); + + let paramsmap= { + "serviceId": ""+this.ServiceId+"", + "userId":localStorage.getItem('user_id'), + "busId": localStorage.getItem('busId') + } + this.end_user.CreatecusServicesMapDetails(paramsmap).subscribe(res => { + if (res.status == 200) { + let serviceMap = res['data'][0].id + let paramsData= { + "busId": localStorage.getItem('busId'), + "cusId": this.customerId, + "appoinmentDate": this.form.value.appoinmentDate, + "appoinmentTime": this.form.value.appoinmentTime, + "serviceMap":serviceMap, + "appoinmentSlots": this.slotsResult, + //"servicemap" :this.bookedAppointment_servicemap + } + console.log(paramsData) + this._app.addFormDetails(paramsData).subscribe(res => { + if (res.status == 200) { + this.notifierService.notify('success', 'Appointment Added Successfully'); + this.dialogRef.close(); + } + }) + } + }) + } + + + goToSlotBooking(){ + // this.days[] + if(this.clicks <5){ + this.clicks += 1; + } + } + goToSlotBooking2(){ + // this.days[] + if( this.clicks >0){ + this.clicks -= 1; + } + console.log( this.clicks) + } + check(param){ + return param[this.clicks]; + } + + addCustomerList(param){ + this.customerCard = param + } + save(){ + + } + + getSlots(){ + let id = localStorage.getItem('user_id') + let params ={"id": id} + this._app.getSlots(params).subscribe((res:any) => { + if (res.status == 200) { + console.log(res) + let data = res['data']; + this.slots = data + } + }) + } + + toggleActive(event:any,param:any,i:any){ + console.log(event,param,i) + this.slot_array =[]; + // debugger; + // // event.preventDefault(); + // this.slotIndex = i + // this.slotTime = param + let resultDate = new DatePipe('en-US').transform(param, 'shortTime') + this.form.controls['appoinmentTime'].setValue(resultDate) + this.date= param + console.log(this.date,param,this.duration) + let thirtyMinutes = this.duration * 60 * 1000; // convert 30 minutes to milliseconds + let date1 = new Date(param); + let date2 = new Date(date1.getTime() + thirtyMinutes); + console.log(date1); + console.log(date2); + const currentTime = new Date(); // Get the current time + //const filteredTimes = this.slots.filter(time => new Date(time) > date1); + + const rangeDate = new Date(date2); + + const resultArray = this.slots.filter(slot => { + const date = new Date(slot); + return date >= rangeDate; + }); + + const firstSlt = new Date(date1); + const lastSlt = new Date( resultArray[0]); + const filteredTimes = this.slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt); + + console.log(resultArray,filteredTimes); + let result = filteredTimes.pop(); + console.log(result); + this.slotsResult = filteredTimes + this.show = false; + // this.slots.forEach(element => { + // if(element { + if (res.status == 200) { + this.servicesList_data = res.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) + }); + }); + console.log(this.servicesList_array) + } + // this.getAssignedList(this.usersList.busId) + }); + // this.assignService = this.checkedArray + } + serviceData(data){ + this.ServiceId = data.serviceId + + this.duration = data.duration + + } + + getApiData(){ + this._app.getAppoinmentsListDetails().subscribe(res => { + if (res.status == 200) { + let appoinmentsList = res.data; + let id = localStorage.getItem('user_id') + console.log(id) + console.log(appoinmentsList) + let filter = appoinmentsList.filter(arr=>{return arr["ServicesMapDetail.userId"] + == id}) + console.log(filter) + filter.forEach(element => { + this.appoinmentsIds.push( element.customer[0].id) + }); + this.getCustomerDetails() + } + }) + } + getCustomerDetails(){ + this._cus.getCustomersListDetails().subscribe(res => { + if (res.status == 200) { + + this.customersList = res.data; + + + 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 + console.log(activeIds,serviceList) + + const result = serviceList.filter(({id}) => activeIds.includes(id)); + console.log(result) + this.customersList = result + + } + + } + else{ - }); -console.log(this.local_data, this.selects) -// this.form.controls['note'].setValue('Sample') - this.form.patchValue(this.local_data) -} - public myError = (controlName: string, errorName: string) =>{ - return this.form.controls[controlName].hasError(errorName); - } - submit(){ - console.log(this.form.value); } + } ); +} + +receivedMessageHandler(res) { + + console.log(res) + this.customersList.push(res.data) + this.customerId = res.data.id + this.form.controls['customer'].setValue( res.data.id); + this.customerCard = 0 +} + +receiveAutoMsgHandler(p) { + console.log(p) +} +customerIdvalue(id){ + console.log(id) + this.customerId = id +} + } diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts index f9e7d16..0e6db2a 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts @@ -64,6 +64,9 @@ export class BusinessListComponent implements OnInit { console.log(this.businessList) this.businessListLength = res.data.length; console.log(this.businessListLength) + this.businessList.sort((a: any, b: any) => { + return b.id - a.id; + }); this.businessListSource['data'] = this.businessList; console.log(this.businessListSource) this.recordStatus=false; diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html index 129ed75..fd68ce0 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html @@ -112,10 +112,18 @@
+
+ + {{practitionerdetails.caption}} + + Caption + + +
{{practitionerdetails.description}} - + Description @@ -371,7 +379,7 @@
--> -
+
diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss index 629349f..451a0c5 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss @@ -384,7 +384,7 @@ box-sizing: border-box; line-height: 15px; } .scrollHV { -height: calc(100vh - 190px); +height: calc(100vh - 200px); } ::ng-deep .mat-form-field-infix { height: 50px!important; @@ -405,9 +405,9 @@ margin-left: 1rem; ::ng-deep .mat-card .mat-card-title:nth-child(2) { margin-top: -33px!important; } -::ng-deep .mat-select-panel .mat-option{ -height: 5em !important; -} +// ::ng-deep .mat-select-panel .mat-option{ +// height: 5em !important; +// } // css example .indianSymbol { content: "\20B9"; diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts index d726b5a..e5bf8f6 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts @@ -46,6 +46,7 @@ export class ConsultantSettingComponent implements OnInit { gender: any=[]; description:any=[]; skills:any = []; + caption:any = []; dob: any=[]; languages: any=[]; designtion: any=[]; @@ -162,18 +163,22 @@ unavailability(action,obj) { "gender": null, "description":null, "skills": null, + "caption": null, "isActive": "1", }] } this.practitionerdetails = this.usersList['practitionerInfos'][0] + this.practitionerdetails.skills = JSON.parse(this.practitionerdetails.skills) + console.log( this.practitionerdetails) this._con.getPractitionerInfo.next( this.usersList['practitionerInfos']); console.log(this.practitionerdetails) this.id=this.practitionerdetails.id this.userName = this.usersList.userName this.gender=this.practitionerdetails.gender this.description=this.practitionerdetails.description - this.skills=this.practitionerdetails.skills + this.skills= JSON.parse(this.practitionerdetails.skills) + this.caption = this.practitionerdetails.caption this.dob=this.practitionerdetails.dob this.exp=this.practitionerdetails.exp this.languages=this.practitionerdetails.languages @@ -240,7 +245,7 @@ unavailability(action,obj) { //if(this.working_customize == false){ // obj.action = action; const dialogRef = this.dialog.open(EditWorkingHoursComponent, { - width: '48%', + width: '45%', height: '100%', // maxWidth: '38vw', position: { right: '0' }, @@ -337,6 +342,7 @@ unavailability(action,obj) { "gender": this.gender, "description": this.description, "skills": this.skills, + "caption": this.caption, "userName": this.userName, "userId":userid } diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html index dc8fe95..b479dd9 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html @@ -1,13 +1,14 @@
+
@@ -521,7 +522,7 @@ -->
- +
- : {{serviceMapDetails.user[0].userName}} + : Dr.{{serviceMapDetails.user[0].userName}}
@@ -79,7 +79,7 @@ Date & Time
- : {{bookingSummary.appoinmentDate | date:'fullDate'}}({{bookingSummary.appoinmentSlots | date:'shortTime'}}) + : {{bookingSummary.appoinmentDate | date:'fullDate'}}({{bookingSummary.appoinmentSlots[0] | date:'shortTime'}})
diff --git a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts index 3669b6f..dfedad0 100644 --- a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts @@ -33,6 +33,7 @@ export class BookingSummaryComponent implements OnInit { this.end_user.summmarylist_observable$.subscribe((res) => { console.log('booked2', res); this.bookingSummary = res[0] + this.bookingSummary.appoinmentSlots =JSON.parse( this.bookingSummary.appoinmentSlots) // this.end_user.getcusServicesMapDetails() let param ={id:this.bookingSummary.serviceMap} diff --git a/ng-seed/src/app/end-user/consultants/consultants-list.component.html b/ng-seed/src/app/end-user/consultants/consultants-list.component.html index c65bd42..8cedd68 100644 --- a/ng-seed/src/app/end-user/consultants/consultants-list.component.html +++ b/ng-seed/src/app/end-user/consultants/consultants-list.component.html @@ -1,10 +1,11 @@ -
+ Appointment

{{busName}}

+
@@ -84,12 +85,13 @@
+

© 2023 Venba Information Technology Pvt Ltd. All Rights Reserved

-
+
@@ -98,7 +100,7 @@
-

No Service

+

No Doctor

diff --git a/ng-seed/src/app/end-user/customer-info/customer-info.component.html b/ng-seed/src/app/end-user/customer-info/customer-info.component.html index f7fb0e1..c7f09ba 100644 --- a/ng-seed/src/app/end-user/customer-info/customer-info.component.html +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.html @@ -30,7 +30,7 @@
- + Contact No is required Invalid Contact No Contact No must be at least 10 characters @@ -40,7 +40,7 @@
- +
verified @@ -53,12 +53,12 @@
- +
- - + +
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 bcd82eb..4d8f6c0 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 @@ -45,11 +45,11 @@ export class CustomerInfoComponent implements OnInit { '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$', ),]), phoneNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]), - address_1: new FormControl('', [Validators.maxLength(50)]), - city: new FormControl('', [Validators.maxLength(10)]), - state: new FormControl('', [Validators.maxLength(10)]), - otp: new FormControl('', [Validators.maxLength(10)]), - pincode: new FormControl('',[Validators.maxLength(6)]), + address_1: new FormControl('', [ Validators.maxLength(50)]), + city: new FormControl('', [ Validators.maxLength(10)]), + state: new FormControl('', [ Validators.maxLength(10)]), + otp: new FormControl('', [ Validators.maxLength(10)]), + pincode: new FormControl('',[ Validators.maxLength(6)]), }); } @@ -60,17 +60,21 @@ export class CustomerInfoComponent implements OnInit { submit(){ console.log(this.form.value) console.log('add') + if(!this.form.valid){ + return + } let row_obj = this.form.value console.log(row_obj) let addFormData = { cusName: row_obj.cusName, email: row_obj.email, address_1: row_obj.address_1, - phoneNo: row_obj.phoneNo, + phoneNo: this.phoneNumber.substring(3) , pincode: row_obj.pincode, state: row_obj.state, city: row_obj.city, }; + console.log(addFormData) this._cus.addCusDetails(addFormData).subscribe(res => { if (res.status == 200) { diff --git a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html index 7c0e2d6..8375d8e 100644 --- a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html +++ b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html @@ -42,6 +42,7 @@
--> + Appointment

{{busName}}

@@ -70,10 +71,10 @@ Phone : {{bookedAppointment.contactNo}} -
  • +
  • Email: {{bookedAppointment.email}} @@ -91,115 +92,49 @@
  • -
    +
    -

    “I highly appreciate your help for my family in our most difficult time. We owed everyone at @dr.changes a big thank you and our life.”

    +

    “{{profileDetails.caption}}”

    - More than 15 years ago, a small group of families, community activists, and civil servants in New York came together to form an organization called Dr.Changes. They provide services for those struggling to care for a loved one who did not “fit” into traditional health systems: stroke, Parkinson’s, Alzheimer’s disease, traumatic brain injury, debilitating disorders, etc. The diagnoses were different, but the families shared common challenges: few community resources, isolation, lack of information, and drastic changes in family roles. + {{profileDetails.description}}

    -

    SKILLS

    -
    -
    -
      -
    • +

      SKILLS

      +
      +
      beenhere - Assisting with walking from bed to wheelchair -
    • -
    • - - beenhere - - - Bathing, dressing and grooming assistance -
    • -
    • - - beenhere - - Medication reminders -
    • -
    • - - beenhere - - Safety and fall prevention -
    • -
    • - - beenhere - - Status reporting to family -
    • -
    -
    -
    -
      -
    • - - beenhere - - Assisting with walking from bed to wheelchair -
    • -
    • - - beenhere - - - Bathing, dressing and grooming assistance -
    • -
    • - - beenhere - - Medication reminders -
    • -
    • - - beenhere - - Safety and fall prevention -
    • -
    • - - beenhere - - Status reporting to family -
    • -
    -
    -
    + {{skillsList}} +
    +
    -
    +

    LANGUAGE

    -

    English

    -

    French

    +

    {{profileDetails.languages}}

    QUALIFICATIONS

    -

    Master of Science

    -

    University Limerick

    +

    {{profileDetails.qualification}}

    @@ -208,8 +143,22 @@
    -