Merge branch 'master' of bitbucket.org:venbainformationtechnology/appointments_frontend
This commit is contained in:
commit
45433bd3ac
@ -78,7 +78,9 @@ export class AppoinmentsListComponent implements OnInit {
|
||||
getAppoinmentsList() {
|
||||
let user_role = localStorage.getItem('user_role');
|
||||
//this._pd.getTabStatusPdDetails(this.tabStatus)
|
||||
this._app.getAppoinmentsListDetails().subscribe(res => {
|
||||
let param ={"busId": localStorage.getItem('busId')}
|
||||
console.log(param)
|
||||
this._app.getAppoinmentsListDetails(param).subscribe(res => {
|
||||
|
||||
if (res.status == 200) {
|
||||
this.isLoading = false
|
||||
@ -130,6 +132,7 @@ export class AppoinmentsListComponent implements OnInit {
|
||||
this.recordStatus=false;
|
||||
}
|
||||
else{
|
||||
this.isLoading = false
|
||||
this.appoinmentsList=[];
|
||||
this.appointmentListLength= null;
|
||||
this.recordStatus=true;
|
||||
|
||||
@ -205,7 +205,7 @@ $tem-color : #217e69;
|
||||
.cardDesign2{
|
||||
border: 1px dashed #227f6e;
|
||||
width: 75%;
|
||||
height: 348px;
|
||||
height: 337px;
|
||||
margin-left: 3rem;
|
||||
background-color: #fcfcfc;
|
||||
margin-bottom: 2rem;
|
||||
@ -239,6 +239,7 @@ $tem-color : #217e69;
|
||||
-webkit-transition: all .2s ease-in;
|
||||
-moz-transition: all .2s ease-in;
|
||||
transition: all .2s ease-in;
|
||||
border: 0;
|
||||
}
|
||||
.add {
|
||||
background-color: #4caf50;
|
||||
|
||||
@ -14,9 +14,9 @@ public customerlist_observable$ = this.customerlist.asObservable();
|
||||
private apiUrl = environment.apiEndpoint;
|
||||
constructor(private _http: HttpClient) { }
|
||||
|
||||
getAppoinmentsListDetails(): Observable<any> {
|
||||
getAppoinmentsListDetails(param): Observable<any> {
|
||||
console.log('IN')
|
||||
return this._http.get<any[]>(this.apiUrl + "getAppoinmentsDetails")
|
||||
return this._http.post<any[]>(this.apiUrl + "getAppoinmentsDetails",param)
|
||||
// .pipe(
|
||||
// catchError(this.handleError('role', []))
|
||||
// )
|
||||
|
||||
@ -165,7 +165,7 @@ $tem-color : #217e69;
|
||||
border: 1px solid #e8edef;
|
||||
width: 89%;
|
||||
background-color: #227f6e21;
|
||||
// box-shadow: 0 2px 0 rgb(0 0 0 / 3%)
|
||||
box-shadow: 0 2px 0 #00000008
|
||||
}
|
||||
.hoverButton{
|
||||
background: $white;
|
||||
|
||||
@ -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;
|
||||
@ -336,7 +336,8 @@ export class DialogBoxComponent implements OnInit {
|
||||
}
|
||||
|
||||
getApiData(){
|
||||
this._app.getAppoinmentsListDetails().subscribe(res => {
|
||||
let param ={"busId": localStorage.getItem('busId')}
|
||||
this._app.getAppoinmentsListDetails(param).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
let appoinmentsList = res.data;
|
||||
let id = localStorage.getItem('user_id')
|
||||
|
||||
@ -25,8 +25,7 @@
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<mat-label>Phone No</mat-label>
|
||||
<input placeholder="Phone No" matInput [(ngModel)]="local_data.contactNo" formControlName="contactNo">
|
||||
<input type="number" placeholder="Phone No" matInput [(ngModel)]="local_data.contactNo" formControlName="contactNo">
|
||||
<mat-error *ngIf="myError('contactNo', 'required')">Contact No is required</mat-error>
|
||||
<mat-error *ngIf="myError('contactNo', 'pattern')">Invalid Contact No </mat-error>
|
||||
<mat-error *ngIf="myError('contactNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
|
||||
@ -60,7 +59,7 @@
|
||||
<img *ngIf="action == 'Update' && imageViewStatus != true" class="image mb-2" [src]="image_view(local_data.logo)" height="150" width="150"/>
|
||||
<img *ngIf="imageViewStatus == true" class="image mb-2" [src]="url" height="150" width="150"><br/>
|
||||
<input type='file'accept="image/*" data-max-size="2048" style="width: 50%;" (change)="onSelectFile($event)" formControlName="logo"><br>
|
||||
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB </span>
|
||||
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB <br> Supported File (jpg,jpeg anf png)</span>
|
||||
</div>
|
||||
<div fxFlex.xs="30" fxFlex.sm="30" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" fxLayoutAlign="start end">
|
||||
<mat-checkbox *ngIf="action != 'Update'" class="example-margin mt-2" formControlName="admin_checked" (change)="showOptions($event)">Add Admin</mat-checkbox>
|
||||
|
||||
@ -51,26 +51,33 @@ export class AddBusinessComponent implements OnInit {
|
||||
onSelectFile(event) {
|
||||
console.log(event)
|
||||
console.log(event.target.files[0])
|
||||
if(event.target.files[0].size > 2097152){
|
||||
this.notifierService.notify('warning', 'Image size is too Larger');
|
||||
}else {
|
||||
const file = event.target.files[0];
|
||||
if(event != null){
|
||||
this.imageViewStatus = true
|
||||
}
|
||||
this.form['value'].logo = [event.target.files[0]]
|
||||
if (event.target.files && event.target.files[0]) {
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
reader.onload = (event) => {
|
||||
this.url = event.target.result;
|
||||
console.log(this.url)
|
||||
let fileType = event.target.files[0]
|
||||
if(fileType.type == 'image/png' || fileType.type == 'image/jpg' || fileType.type == 'image/jpeg'){
|
||||
if(event.target.files[0].size > 2097152){
|
||||
this.notifierService.notify('warning', 'Image size is too Larger');
|
||||
}else {
|
||||
const file = event.target.files[0];
|
||||
if(event != null){
|
||||
this.imageViewStatus = true
|
||||
}
|
||||
this.form['value'].logo = [event.target.files[0]]
|
||||
if (event.target.files && event.target.files[0]) {
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
reader.onload = (event) => {
|
||||
this.url = event.target.result;
|
||||
console.log(this.url)
|
||||
}
|
||||
}
|
||||
// this.formData=[];
|
||||
this.formData.append('image', file, file.name);
|
||||
console.log(this.currentFileUpload)
|
||||
}
|
||||
// this.formData=[];
|
||||
this.formData.append('image', file, file.name);
|
||||
console.log(this.currentFileUpload)
|
||||
}
|
||||
} else {
|
||||
this.notifierService.notify('warning', 'Invalid File)');
|
||||
this.notifierService.notify('warning', 'Upload Supported File Like (png,jpg and jpeg)');
|
||||
}
|
||||
|
||||
|
||||
// this.formData.append('file', file, file.name);
|
||||
}
|
||||
@ -83,14 +90,14 @@ export class AddBusinessComponent implements OnInit {
|
||||
admin_checked: new FormControl('',null),
|
||||
|
||||
logo: new FormControl('', null),
|
||||
busName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||
address: new FormControl('', [Validators.required, Validators.maxLength(50)]),
|
||||
city: new FormControl('', [Validators.required, Validators.maxLength(10)]),
|
||||
state: new FormControl('', [Validators.required, Validators.maxLength(10)]),
|
||||
busName: new FormControl('', [Validators.required]),
|
||||
address: new FormControl('', [Validators.required, Validators.maxLength(100)]),
|
||||
city: new FormControl('', [Validators.required]),
|
||||
state: new FormControl('', [Validators.required]),
|
||||
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
||||
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
||||
),]),
|
||||
contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]),
|
||||
contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10),Validators.pattern('^[0-9]{10}$')]),
|
||||
createdBy:new FormControl(userrole,[Validators.required]),
|
||||
});
|
||||
|
||||
@ -100,7 +107,7 @@ export class AddBusinessComponent implements OnInit {
|
||||
public myError = (controlName: string, errorName: string) =>{
|
||||
return this.form.controls[controlName].hasError(errorName);
|
||||
}
|
||||
|
||||
|
||||
submit(){
|
||||
let tmp = this.form.value
|
||||
tmp.id = this.local_data.id
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
<input type="text" matInput placeholder="" [(ngModel)]="dob">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container">
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Languages <span style="margin-left: 4rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.languages}}</a>
|
||||
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
@ -78,7 +78,7 @@
|
||||
<input type="text" matInput placeholder="Languages" [(ngModel)]="languages">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container">
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Qualification <span style="margin-left: 4rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.qualification}}</a>
|
||||
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
@ -86,7 +86,7 @@
|
||||
<input type="text" matInput placeholder="Qualification" [(ngModel)]="qualification">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container">
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Designation <span style="margin-left: 3.7rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.designtion}}</a>
|
||||
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
@ -94,7 +94,7 @@
|
||||
<input type="text" matInput placeholder="Designation" [(ngModel)]="designtion">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container">
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Experience <span style="margin-left: 4rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.exp}}</a>
|
||||
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
@ -102,7 +102,7 @@
|
||||
<input type="text" matInput placeholder="Experience" [(ngModel)]="exp">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container">
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Skills <span style="margin-left: 4rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.skills}}</a>
|
||||
<mat-form-field class="example-full-width" *ngIf="isEditable == true">
|
||||
@ -112,7 +112,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container">
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Caption <span style="margin-left: 4rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.caption}}</a>
|
||||
<mat-form-field style="width: 60%;" *ngIf="isEditable == true">
|
||||
@ -120,7 +120,7 @@
|
||||
<textarea matInput rows="3" cols="30" placeholder="Caption" [(ngModel)]="caption"></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group label-container">
|
||||
<div class="form-group label-container" *ngIf="userRole != 'BADMIN'">
|
||||
<label>Description <span style="margin-left: 4rem;">-</span></label>
|
||||
<a style="padding: 10px;" *ngIf="isEditable == false">{{practitionerdetails.description}}</a>
|
||||
<mat-form-field style="width: 60%;" *ngIf="isEditable == true">
|
||||
@ -178,7 +178,7 @@
|
||||
</ng-scrollbar>
|
||||
</mat-tab>
|
||||
|
||||
<mat-tab>
|
||||
<mat-tab *ngIf="userRole != 'BADMIN'">
|
||||
<ng-template mat-tab-label>
|
||||
<i class="material-icons icons-Hours"></i>
|
||||
Working Hours
|
||||
@ -200,8 +200,8 @@
|
||||
<!-- <div class="alert">
|
||||
<span class="closebtn">× sample follows customized working hours in (GMT +05:30) India Standard Time (Asia/Kolkata).</span>
|
||||
</div> -->
|
||||
<div class="timing-container mt-1">
|
||||
<div fxLayout="row wrap">
|
||||
<div class="timing-container mt-1" >
|
||||
<div fxLayout="row wrap" *ngIf="workinghours[0]['sunday']['hours'].length>0">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
|
||||
<div class="timing">
|
||||
<span class="dis-flex">
|
||||
@ -223,7 +223,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timing-container">
|
||||
<div class="timing-container" *ngIf="workinghours[1]['monday']['hours'].length>0">
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
|
||||
<div class="timing">
|
||||
@ -248,7 +248,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timing-container">
|
||||
<div class="timing-container" *ngIf="workinghours[2]['tuesday']['hours'].length>0">
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
|
||||
<div class="timing">
|
||||
@ -271,7 +271,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timing-container">
|
||||
<div class="timing-container" *ngIf="workinghours[3]['wednesday']['hours'].length>0">
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
|
||||
<div class="timing">
|
||||
@ -294,7 +294,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timing-container">
|
||||
<div class="timing-container" *ngIf="workinghours[4]['thursday']['hours'].length>0">
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
|
||||
<div class="timing">
|
||||
@ -317,7 +317,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timing-container">
|
||||
<div class="timing-container" *ngIf="workinghours[5]['friday']['hours'].length>0">
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
|
||||
<div class="timing">
|
||||
@ -340,7 +340,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timing-container">
|
||||
<div class="timing-container" *ngIf="workinghours[6]['saturday']['hours'].length>0">
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
|
||||
<div class="timing">
|
||||
@ -393,7 +393,7 @@
|
||||
</div>
|
||||
</mat-tab>
|
||||
|
||||
<mat-tab>
|
||||
<mat-tab *ngIf="userRole != 'BADMIN'">
|
||||
<ng-template mat-tab-label>
|
||||
<i class="material-icons icons"></i> Assigned Services
|
||||
</ng-template>
|
||||
|
||||
@ -34,7 +34,23 @@ export class ConsultantSettingComponent implements OnInit {
|
||||
isEditable:any = false;
|
||||
public usersList:any = new MatTableDataSource();
|
||||
public servicesList:any = new MatTableDataSource();
|
||||
practitionerdetails: any;
|
||||
practitionerdetails: any=[
|
||||
{
|
||||
|
||||
"exp":null,
|
||||
"qualification":null,
|
||||
"days": null,
|
||||
"languages": null,
|
||||
"workingHours": JSON.stringify([{"sunday":{"hours":[{"startTime":"09:30 am","endTime":"06:00 pm","day":"sunday","value":null}],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"tuesday","value":null}],"breaks":[]}},{"wednesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"wednesday","value":null}],"breaks":[]}},{"thursday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"thursday","value":null}],"breaks":[]}},{"friday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"friday","value":null}],"breaks":[]}},{"saturday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"saturday","value":null}],"breaks":[]}}]),
|
||||
"dob": null,
|
||||
"designtion": null,
|
||||
"gender": null,
|
||||
"description":null,
|
||||
"skills": null,
|
||||
"caption": null,
|
||||
"isActive": "1",
|
||||
|
||||
}]
|
||||
servicesList_array: any = [];
|
||||
serviceCheckedData: number;
|
||||
checkedArray: any[];
|
||||
@ -55,12 +71,15 @@ export class ConsultantSettingComponent implements OnInit {
|
||||
id: any;
|
||||
public end_User_Url = environment.endUserUrl;
|
||||
endUserURL: any;
|
||||
userRole:any=[];
|
||||
genderOption:any = [{'name':'Male'},{'name':'Female'}]
|
||||
skillsOption:any = [{'name':'Assisting with walking from bed to wheelchair'},{'name':'Bathing, dressing and grooming assistance'},{'name':'Medication reminders'},{'name':'Safety and fall prevention'},{'name':'Status reporting to family'},{'name':'Assisting with walking from bed to wheelchair'},{'name':'Bathing, dressing and grooming assistance'},{'name':'Medication reminders'},{'name':'Safety and fall prevention'},{'name':'Status reporting to family'}]
|
||||
constructor(private notifierService: NotifierService,private formBuilder: FormBuilder, public dialog: MatDialog, public _con:ConsultantService, private fb: FormBuilder, public _api:ConsultantService,private locationStrategy: LocationStrategy) {}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.userRole = localStorage.getItem('user_role');
|
||||
console.log( this.userRole )
|
||||
// this.openDialog('action','obj')
|
||||
this.registerForm = this.formBuilder.group({
|
||||
name: ['', Validators.required],
|
||||
@ -148,6 +167,8 @@ unavailability(action,obj) {
|
||||
this._con.getUsersListDetails(id).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
this.usersList = res.data[0];
|
||||
|
||||
localStorage.setItem('practitioner',JSON.stringify( this.usersList))
|
||||
console.log(this.usersList)
|
||||
if(this.usersList['practitionerInfos'].length==0){
|
||||
this.usersList['practitionerInfos'] =[
|
||||
@ -157,7 +178,7 @@ unavailability(action,obj) {
|
||||
"qualification":null,
|
||||
"days": null,
|
||||
"languages": null,
|
||||
"workingHours": "[{\"sunday\":{\"hours\":[{\"startTime\":\"09:30 am\",\"endTime\":\"09:30 pm\",\"day\":\"sunday\",\"value\":null}],\"breaks\":[]}},{\"monday\":{\"hours\":[{\"startTime\":\"09:00 am\",\"endTime\":\"09:30 pm\",\"day\":\"monday\",\"value\":null}],\"breaks\":[]}},{\"tuesday\":{\"hours\":[{\"startTime\":\"09:00 am\",\"endTime\":\"12:00 am\",\"day\":\"tuesday\",\"value\":null},{\"startTime\":\"01:00 pm\",\"endTime\":\"04:00 pm\",\"day\":null},{\"startTime\":\"05:00 pm\",\"endTime\":\"09:00 pm\",\"day\":null}],\"breaks\":[]}},{\"wednesday\":{\"hours\":[{\"startTime\":\"09:00 am\",\"endTime\":\"09:30 am\",\"day\":\"wednesday\",\"value\":null}],\"breaks\":[]}},{\"thursday\":{\"hours\":[{\"startTime\":\"09:00 am\",\"endTime\":\"09:30 am\",\"day\":\"thursday\",\"value\":null}],\"breaks\":[]}},{\"friday\":{\"hours\":[{\"startTime\":\"09:00 am\",\"endTime\":\"09:30 am\",\"day\":\"friday\",\"value\":null}],\"breaks\":[]}},{\"saturday\":{\"hours\":[{\"startTime\":\"09:00 am\",\"endTime\":\"09:30 am\",\"day\":\"saturday\",\"value\":null}],\"breaks\":[]}}]",
|
||||
"workingHours": JSON.stringify([{"sunday":{"hours":[{"startTime":"09:30 am","endTime":"06:00 pm","day":"sunday","value":null}],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"tuesday","value":null}],"breaks":[]}},{"wednesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"wednesday","value":null}],"breaks":[]}},{"thursday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"thursday","value":null}],"breaks":[]}},{"friday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"friday","value":null}],"breaks":[]}},{"saturday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"saturday","value":null}],"breaks":[]}}]),
|
||||
"dob": null,
|
||||
"designtion": null,
|
||||
"gender": null,
|
||||
@ -173,11 +194,14 @@ unavailability(action,obj) {
|
||||
console.log( this.practitionerdetails)
|
||||
this._con.getPractitionerInfo.next( this.usersList['practitionerInfos']);
|
||||
console.log(this.practitionerdetails)
|
||||
this.endUserURL = this.end_User_Url+this.usersList['BusinessDetails'][0].randStr
|
||||
this.workinghours = JSON.parse(this.practitionerdetails.workingHours)
|
||||
this.skills= JSON.parse(this.practitionerdetails.skills)
|
||||
this.id=this.practitionerdetails.id
|
||||
this.userName = this.usersList.userName
|
||||
this.gender=this.practitionerdetails.gender
|
||||
this.description=this.practitionerdetails.description
|
||||
this.skills= JSON.parse(this.practitionerdetails.skills)
|
||||
|
||||
this.caption = this.practitionerdetails.caption
|
||||
this.dob=this.practitionerdetails.dob
|
||||
this.exp=this.practitionerdetails.exp
|
||||
@ -185,10 +209,10 @@ unavailability(action,obj) {
|
||||
this.qualification=this.practitionerdetails.qualification
|
||||
this.designtion=this.practitionerdetails.designtion
|
||||
console.log(this.gender)
|
||||
this.workinghours = JSON.parse(this.practitionerdetails.workingHours)
|
||||
|
||||
// this.workinghours = this.practitionerdetails.workingHours
|
||||
console.log(this.workinghours)
|
||||
this.endUserURL = this.end_User_Url+this.usersList['BusinessDetails'][0].randStr
|
||||
|
||||
console.log(this.endUserURL)
|
||||
|
||||
}
|
||||
@ -340,11 +364,12 @@ unavailability(action,obj) {
|
||||
"dob": this.dob,
|
||||
"designtion": this.qualification,
|
||||
"gender": this.gender,
|
||||
"workingHours": JSON.stringify([{"sunday":{"hours":[{"startTime":"09:30 am","endTime":"06:00 pm","day":"sunday","value":null}],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"tuesday","value":null}],"breaks":[]}},{"wednesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"wednesday","value":null}],"breaks":[]}},{"thursday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"thursday","value":null}],"breaks":[]}},{"friday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"friday","value":null}],"breaks":[]}},{"saturday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"saturday","value":null}],"breaks":[]}}]),
|
||||
"description": this.description,
|
||||
"skills": this.skills,
|
||||
"caption": this.caption,
|
||||
"userName": this.userName,
|
||||
"userId":userid
|
||||
"practitionerId":userid
|
||||
}
|
||||
if(this.usersList['practitionerInfos'].length>0) {
|
||||
param.id = this.id
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
</h5>
|
||||
</div>
|
||||
<ng-scrollbar class="scrollHV">
|
||||
|
||||
<form [formGroup]="dynamicForm">
|
||||
<div formArrayName="filters">
|
||||
<div *ngFor="let filter of filtersFormArray.controls; let i = index;">
|
||||
@ -27,7 +28,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime">
|
||||
formControlName="startTime" [disabled]="Select1 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
[value]="startTime">
|
||||
@ -40,7 +41,7 @@
|
||||
(selectionChange)="selectedAPIChanged(i)"
|
||||
placeholder="Select Time"
|
||||
#apiField
|
||||
formControlName="endTime">
|
||||
formControlName="endTime" [disabled]="Select1 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
[value]="endTime">
|
||||
@ -100,7 +101,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime">
|
||||
formControlName="startTime" [disabled]="Select2 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
[value]="startTime">
|
||||
@ -113,7 +114,7 @@
|
||||
(selectionChange)="selectedAPIChanged(i)"
|
||||
placeholder="Select Time"
|
||||
#apiField
|
||||
formControlName="endTime">
|
||||
formControlName="endTime" [disabled]="Select2 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
[value]="endTime">
|
||||
@ -173,7 +174,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime">
|
||||
formControlName="startTime" [disabled]="Select3 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
[value]="startTime">
|
||||
@ -186,7 +187,7 @@
|
||||
(selectionChange)="selectedAPIChanged(i)"
|
||||
placeholder="Select Time"
|
||||
#apiField
|
||||
formControlName="endTime">
|
||||
formControlName="endTime" [disabled]="Select3 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
[value]="endTime">
|
||||
@ -246,7 +247,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime">
|
||||
formControlName="startTime" [disabled]="Select4 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
[value]="startTime">
|
||||
@ -259,7 +260,7 @@
|
||||
(selectionChange)="selectedAPIChanged(i)"
|
||||
placeholder="Select Time"
|
||||
#apiField
|
||||
formControlName="endTime">
|
||||
formControlName="endTime" [disabled]="Select4 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
[value]="endTime">
|
||||
@ -319,7 +320,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime">
|
||||
formControlName="startTime" [disabled]="Select5 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
[value]="startTime">
|
||||
@ -332,7 +333,7 @@
|
||||
(selectionChange)="selectedAPIChanged(i)"
|
||||
placeholder="Select Time"
|
||||
#apiField
|
||||
formControlName="endTime">
|
||||
formControlName="endTime" [disabled]="Select5 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
[value]="endTime">
|
||||
@ -392,7 +393,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime">
|
||||
formControlName="startTime" [disabled]="Select6 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
[value]="startTime">
|
||||
@ -405,7 +406,7 @@
|
||||
(selectionChange)="selectedAPIChanged(i)"
|
||||
placeholder="Select Time"
|
||||
#apiField
|
||||
formControlName="endTime">
|
||||
formControlName="endTime" [disabled]="Select6 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
[value]="endTime">
|
||||
@ -465,7 +466,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-select
|
||||
placeholder="Select Time"
|
||||
formControlName="startTime">
|
||||
formControlName="startTime" [disabled]="Select7 !=true">
|
||||
<mat-option
|
||||
*ngFor="let startTime of startTimes"
|
||||
[value]="startTime">
|
||||
@ -478,7 +479,7 @@
|
||||
(selectionChange)="selectedAPIChanged(i)"
|
||||
placeholder="Select Time"
|
||||
#apiField
|
||||
formControlName="endTime">
|
||||
formControlName="endTime" [disabled]="Select7 !=true">
|
||||
<mat-option
|
||||
*ngFor="let endTime of endTimes"
|
||||
[value]="endTime">
|
||||
|
||||
@ -18,8 +18,8 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
"10:30 am",
|
||||
"11:00 am",
|
||||
"11:30 am",
|
||||
"12:00 am",
|
||||
"12:30 am",
|
||||
"12:00 pm",
|
||||
"12:30 pm",
|
||||
"01:00 pm",
|
||||
"01:00 pm",
|
||||
"01:30 pm",
|
||||
@ -46,8 +46,8 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
"10:30 am",
|
||||
"11:00 am",
|
||||
"11:30 am",
|
||||
"12:00 am",
|
||||
"12:30 am",
|
||||
"12:00 pm",
|
||||
"12:30 pm",
|
||||
"01:00 pm",
|
||||
"01:00 pm",
|
||||
"01:30 pm",
|
||||
@ -98,7 +98,7 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
Answer: any = [];
|
||||
practitioner:any =[];
|
||||
// timing: any[] = ['09:00am','09:30am','10:00am','10:30am','11:00am','11:30am','12:00am','12:30am','01:00pm','01:00pm','01:30pm', '02:00pm', '02:30pm', '03:00pm', '03:30pm', '04:00pm', '04:30pm', '05:00pm', '05:30pm', '06:00pm', '06:30pm', '07:00pm', '07:30pm', '08:00pm','08:30pm', '09:00pm',]
|
||||
|
||||
doctor:any=[];
|
||||
constructor(private notifierService: NotifierService,
|
||||
public dialogRef: MatDialogRef<EditWorkingHoursComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data,
|
||||
@ -106,6 +106,7 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
) {
|
||||
var date = new Date('9:00 am');
|
||||
console.log(this.data,date)
|
||||
|
||||
|
||||
this._api.getPractitionerInfo_observable$.subscribe((res) => {
|
||||
console.log('nav list 3', res);
|
||||
@ -129,7 +130,9 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
// this.rows.splice(i, 1 );
|
||||
// }
|
||||
|
||||
ngOnInit(): void {
|
||||
ngOnInit() {
|
||||
this.doctor = JSON.parse(localStorage.getItem('practitioner'))
|
||||
console.log (this.doctor)
|
||||
this.datainputForm = this.fb.group({
|
||||
dropDownTest: "09:00am",
|
||||
dropDownTests: "09:30am",
|
||||
@ -164,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)
|
||||
}
|
||||
|
||||
//}, 1000);
|
||||
// this.dynamicForm7.patchValue(saturday)
|
||||
|
||||
// }, 2000);
|
||||
|
||||
}
|
||||
|
||||
@ -462,7 +508,12 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
console.log(this.Answer);
|
||||
let param;
|
||||
if( this.practitioner.length>0){
|
||||
param ={id:this.practitioner[0].id,workingHours:JSON.stringify(this.Answer)}
|
||||
if(this.practitioner[0].hasOwnProperty('id')){
|
||||
param ={id:this.practitioner[0].id,workingHours:JSON.stringify(this.Answer)}
|
||||
}else{
|
||||
param ={practitionerId: this.doctor.id,workingHours:JSON.stringify(this.Answer)}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this._api.createPractitionerInfo(param).subscribe(res => {
|
||||
|
||||
@ -80,11 +80,14 @@ export class CustomersListComponent implements OnInit {
|
||||
getCustomersList() {
|
||||
console.log('in')
|
||||
//this._pd.getTabStatusPdDetails(this.tabStatus)
|
||||
this.recordStatus=false;
|
||||
let user_role = localStorage.getItem('user_role');
|
||||
if(user_role == 'PRACTITIONER'){
|
||||
this._app.getAppoinmentsListDetails().subscribe(res => {
|
||||
if(user_role == 'PRACTITIONER' || user_role == 'BADMIN'){
|
||||
let param ={"busId": localStorage.getItem('busId')}
|
||||
this._app.getAppoinmentsListDetails(param).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
this.appoinmentsList = res.data;
|
||||
this.recordStatus=true;
|
||||
let id = localStorage.getItem('user_id')
|
||||
console.log(id)
|
||||
console.log(this.appoinmentsList)
|
||||
@ -94,14 +97,21 @@ export class CustomersListComponent implements OnInit {
|
||||
filter.forEach(element => {
|
||||
this.appoinmentsIds.push( element.customer[0].id)
|
||||
});
|
||||
this.getCustomerDetails()
|
||||
}
|
||||
if(this.appoinmentsList.length>0){
|
||||
this.getCustomerDetails()
|
||||
}
|
||||
|
||||
} else{
|
||||
this.isLoading = false
|
||||
this.recordStatus=true;
|
||||
}
|
||||
})
|
||||
}
|
||||
// this.getCustomerDetails()
|
||||
}
|
||||
|
||||
getCustomerDetails(){
|
||||
|
||||
this._cus.getCustomersListDetails().subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
this.isLoading = false
|
||||
@ -135,6 +145,7 @@ export class CustomersListComponent implements OnInit {
|
||||
|
||||
}
|
||||
else{
|
||||
this.isLoading = false
|
||||
this.customersList=[];
|
||||
this.customersListLength= null;
|
||||
this.recordStatus=true;
|
||||
|
||||
@ -23,6 +23,11 @@
|
||||
<textarea matInput placeholder="Description" formControlName="description"></textarea>
|
||||
<mat-error *ngIf="myError('description', 'required')">Duration is required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<input type="number" placeholder="Fees" matInput formControlName="fees">
|
||||
<mat-error *ngIf="myError('fees', 'required')">Fees is required</mat-error>
|
||||
<!-- <mat-error *ngIf="myError('fees', 'maxlength')">Limit exceed</mat-error> -->
|
||||
</mat-form-field>
|
||||
<ng-template #elseTemplate>
|
||||
Sure to delete <b>{{local_data.servicesName}}</b>?
|
||||
</ng-template>
|
||||
|
||||
@ -40,7 +40,8 @@ ngOnInit() {
|
||||
this.form = new FormGroup({
|
||||
servicesName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||
duration: new FormControl('',[Validators.required]),
|
||||
description: new FormControl('',[Validators.required])
|
||||
description: new FormControl('',[Validators.required]),
|
||||
fees:new FormControl('',[Validators.required])
|
||||
});
|
||||
this.form.patchValue(this.local_data)
|
||||
}
|
||||
|
||||
@ -12,14 +12,20 @@ export class ApiServiceService {
|
||||
private apiUrl = environment.apiEndpoint;
|
||||
constructor(private _http: HttpClient) { }
|
||||
|
||||
getServicesListDetails(): Observable<any> {
|
||||
getServicesListDetails(param): Observable<any> {
|
||||
console.log('IN')
|
||||
return this._http.post<any[]>(this.apiUrl + "getServicesDetails",param)
|
||||
// .pipe(
|
||||
// catchError(this.handleError('role', []))
|
||||
// )
|
||||
}
|
||||
getServicesListDetails2(): Observable<any> {
|
||||
console.log('IN')
|
||||
return this._http.post<any[]>(this.apiUrl + "getServicesDetails",{})
|
||||
// .pipe(
|
||||
// catchError(this.handleError('role', []))
|
||||
// )
|
||||
}
|
||||
|
||||
addFormDetails(addParams): Observable<any> {
|
||||
return this._http.post(this.apiUrl + 'CreateService', addParams)
|
||||
// .pipe(
|
||||
|
||||
@ -34,12 +34,16 @@
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Duration </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.duration}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="fees">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Fees </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.fees}} </mat-cell>
|
||||
</ng-container>
|
||||
<!-- Description Column -->
|
||||
<ng-container matColumnDef="description">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Description </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<!-- Action Column -->
|
||||
<ng-container matColumnDef="action">
|
||||
|
||||
@ -18,7 +18,7 @@ export class ServiceListComponent implements OnInit {
|
||||
addFormData: any;
|
||||
push: any;
|
||||
id: number;
|
||||
displayedColumns: string[] = ['serviceId','servicesName','duration','description','action'];
|
||||
displayedColumns: string[] = ['serviceId','servicesName','duration','fees','description','action'];
|
||||
serviceId: number;
|
||||
|
||||
public servicesListLength: number;
|
||||
@ -59,7 +59,9 @@ export class ServiceListComponent implements OnInit {
|
||||
|
||||
|
||||
getServicesList() {
|
||||
this._api.getServicesListDetails().subscribe(res => {
|
||||
let param ={"busId": localStorage.getItem('busId')}
|
||||
console.log(param)
|
||||
this._api.getServicesListDetails(param).subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
this.isLoading = false;
|
||||
this.servicesList = res.data;
|
||||
@ -74,6 +76,7 @@ export class ServiceListComponent implements OnInit {
|
||||
this.recordStatus=false;
|
||||
}
|
||||
else{
|
||||
this.isLoading = false;
|
||||
this.servicesList=[];
|
||||
this.servicesListLength= null;
|
||||
this.recordStatus=true;
|
||||
@ -137,10 +140,11 @@ export class ServiceListComponent implements OnInit {
|
||||
if(result.event == 'Add'){
|
||||
console.log('add')
|
||||
let addFormData = {
|
||||
// busId: 'abc123',
|
||||
// id: row_obj.id,
|
||||
busId: localStorage.getItem('busId'),
|
||||
id: row_obj.id,
|
||||
description:row_obj.description,
|
||||
duration: parseInt(row_obj.duration),
|
||||
fees: parseInt(row_obj.fees),
|
||||
serviceId: row_obj.serviceId,
|
||||
servicesName: row_obj.servicesName
|
||||
};
|
||||
@ -151,6 +155,7 @@ export class ServiceListComponent implements OnInit {
|
||||
let updatevalue = {
|
||||
description:row_obj.description,
|
||||
serviceId: row_obj.serviceId,
|
||||
fees: parseInt(row_obj.fees),
|
||||
duration: parseInt(row_obj.duration),
|
||||
servicesName: row_obj.servicesName
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
</mat-form-field> -->
|
||||
<mat-form-field appearance="outline" class="mat-pane">
|
||||
<mat-label>Business</mat-label>
|
||||
<mat-select placeholder="Select Business" formControlName="businessselect" required>
|
||||
<mat-select placeholder="Select Business" formControlName="businessselect" required [disabled]="disableBus ==0">
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let business of businessList" (click)="bus(business.busId)" [value]="business.busId">
|
||||
{{business.busName}}
|
||||
@ -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}}
|
||||
@ -52,7 +52,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<mat-label>Phone No</mat-label>
|
||||
<input matInput placeholder="Enter Phone No" formControlName="contactNo" id="contactNo">
|
||||
<input matInput type="number" placeholder="Enter Phone No" formControlName="contactNo" id="contactNo">
|
||||
<mat-error *ngIf="myError('contactNo', 'required')">Contact No is required</mat-error>
|
||||
<mat-error *ngIf="myError('contactNo', 'pattern')">Invalid Contact No </mat-error>
|
||||
<mat-error *ngIf="myError('contactNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
|
||||
@ -80,7 +80,7 @@
|
||||
<img *ngIf="action == 'Update' && imageViewStatus != true" class="image mb-2" [src]="image_view(local_data.logo)" height="150" width="150"/>
|
||||
<img *ngIf="imageViewStatus == true" class="image mb-2" [src]="url" height="150" width="150"><br/>
|
||||
<input type='file'accept="image/*" data-max-size="2048" style="width: 33%;" (change)="onSelectFile($event)" formControlName="logo"><br>
|
||||
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB </span>
|
||||
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB <br> Supported File (jpg,jpeg anf png)</span>
|
||||
<!-- <mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<input placeholder="ConfirmPassword" matInput formControlName="confirmPassword">
|
||||
<mat-error *ngIf="myError('confirmPassword', 'required')">confirmPassword is required</mat-error>
|
||||
|
||||
@ -31,6 +31,7 @@ export class AddUserComponent implements OnInit {
|
||||
formData:any=[];
|
||||
private apiUrl = environment.apiEndpoint;
|
||||
busId: any;
|
||||
disableBus: any=1;
|
||||
constructor(private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder,
|
||||
public dialogRef: MatDialogRef<AddUserComponent>,
|
||||
@Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData,public _bus:BusinessService) {
|
||||
@ -45,11 +46,12 @@ export class AddUserComponent implements OnInit {
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.disableBus = localStorage.getItem('go_admin')
|
||||
let userrole = localStorage.getItem('user_role')
|
||||
this.form = new FormGroup({
|
||||
businessselect: new FormControl('',[Validators.required]),
|
||||
role: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||
userName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||
role: new FormControl('', [Validators.required]),
|
||||
userName: new FormControl('', [Validators.required]),
|
||||
// contactNo: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||
contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]),
|
||||
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||
@ -110,10 +112,14 @@ export class AddUserComponent implements OnInit {
|
||||
console.log(this.form['value'].businessselect)
|
||||
// this.local_data.businessselect = this.local_data.busId
|
||||
console.log(localStorage.getItem('busNameID'), localStorage.getItem('go_admin'))
|
||||
if( localStorage.getItem('go_admin') =='0'){
|
||||
// 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)
|
||||
|
||||
if(this.action == 'Update'){
|
||||
@ -157,7 +163,7 @@ export class AddUserComponent implements OnInit {
|
||||
}
|
||||
if(this.action == 'Update'){
|
||||
this.formData.append('id', tmp.id);
|
||||
this.formData.append('busId', this.busId);
|
||||
|
||||
}
|
||||
this.formData.append('busId', this.busId);
|
||||
this.formData.append('userName', tmp.userName);
|
||||
@ -175,6 +181,8 @@ export class AddUserComponent implements OnInit {
|
||||
onSelectFile(event) {
|
||||
console.log(event.target.files[0])
|
||||
const file = event.target.files[0];
|
||||
let fileType = event.target.files[0]
|
||||
if(fileType.type == 'image/png' || fileType.type == 'image/jpg' || fileType.type == 'image/jpeg'){
|
||||
if(event.target.files[0].size > 2097152){
|
||||
this.notifierService.notify('warning', 'Image size is too Larger');
|
||||
}else {
|
||||
@ -194,6 +202,10 @@ export class AddUserComponent implements OnInit {
|
||||
this.formData.append('image', file, file.name);
|
||||
// this.formData.append('file', file, file.name);
|
||||
}
|
||||
} else {
|
||||
this.notifierService.notify('warning', 'Invalid File)');
|
||||
this.notifierService.notify('warning', 'Upload Supported File Like (png,jpg and jpeg)');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<mat-label>Filter</mat-label>
|
||||
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Type Here" #input>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" style="width:20%;margin-left: 5%;">
|
||||
<!-- <mat-form-field appearance="outline" style="width:20%;margin-left: 5%;">
|
||||
<mat-label>Business</mat-label>
|
||||
<mat-select placeholder="Select Business" formControlName="businessselect" required>
|
||||
<mat-option (click)="applyFilter(null)">All</mat-option>
|
||||
@ -14,14 +14,14 @@
|
||||
</mat-select>
|
||||
|
||||
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
<mat-form-field appearance="outline" style="width:20%;margin-left: 5%;">
|
||||
<mat-label>Role</mat-label>
|
||||
<mat-select placeholder="Select Business" formControlName="businessselect" required>
|
||||
<mat-option (click)="applyFilter(null)">All</mat-option>
|
||||
<mat-option (click)="applyFilter('SADMIN')">SADMIN</mat-option>
|
||||
<mat-option (click)="applyFilter('PRACTITIONER')"> PRACTITIONER</mat-option>
|
||||
<mat-option (click)="applyFilter('BADMIN')">BADMIN</mat-option>
|
||||
<mat-option value="All" (click)="applyFilter(null)">All</mat-option>
|
||||
<mat-option value="SADMIN" (click)="applyFilter('SADMIN')">SADMIN</mat-option>
|
||||
<mat-option value="PRACTITIONER"(click)="applyFilter('PRACTITIONER')"> PRACTITIONER</mat-option>
|
||||
<mat-option value="BADMIN" (click)="applyFilter('BADMIN')">BADMIN</mat-option>
|
||||
|
||||
|
||||
</mat-select>
|
||||
|
||||
@ -169,7 +169,11 @@ export class UserListComponent implements OnInit {
|
||||
|
||||
}
|
||||
openDialog(action,obj) {
|
||||
// localStorage.setItem('busNameID',null)
|
||||
|
||||
if(action == 'Update' || action == 'Delete'){
|
||||
localStorage.setItem('busNameID',obj.busId
|
||||
)
|
||||
}
|
||||
obj.action = action;
|
||||
const dialogRef = this.dialog.open(AddUserComponent, {
|
||||
// width: '30%',
|
||||
@ -179,6 +183,8 @@ export class UserListComponent implements OnInit {
|
||||
data:obj
|
||||
});
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
localStorage.setItem('go_admin','1')
|
||||
localStorage.setItem('busNameID',null)
|
||||
if(result != undefined){
|
||||
console.log(result)
|
||||
this.formAddUpdateAndDelete(result,result.data)
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
|
||||
<ng-scrollbar class="scrollHV">
|
||||
|
||||
<mat-toolbar>
|
||||
<span style="text-align: center;">Appointment</span>
|
||||
<h3 style="margin-left:35% ;">{{busName}}</h3>
|
||||
</mat-toolbar>
|
||||
<ng-scrollbar class="scrollHV">
|
||||
<div class="container mt-1">
|
||||
<div fxLayout="row wrap" fxLayoutAlign="center">
|
||||
<div class="column mat-width" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
|
||||
|
||||
@ -110,7 +110,7 @@ export class SearchCategoryComponent implements OnInit {
|
||||
console.log(this.eventData)
|
||||
if(this.eventData == 'services'){
|
||||
//this._pd.getTabStatusPdDetails(this.tabStatus)
|
||||
this._api.getServicesListDetails().subscribe(res => {
|
||||
this._api.getServicesListDetails2().subscribe(res => {
|
||||
if (res.status == 200) {
|
||||
this.servicesList = res.data;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ export class RoleMenuItemsPipe implements PipeTransform {
|
||||
// if(type=="1"){
|
||||
switch(localStorage.getItem('user_role')){
|
||||
case 'SADMIN': return value.filter(val=>val.state!="appoinments" && val.state!="customers" && val.state != "consultant-setting" && val.state!="consultants" && val.state!="services");
|
||||
case 'BADMIN': return value.filter(val=>val.state !="business" && val.state != "consultant-setting" && val.state!="users" && val.state!="consultants");
|
||||
case 'BADMIN': return value.filter(val=>val.state !="business" && val.state!="users" && val.state!="consultants");
|
||||
case 'PRACTITIONER': return value.filter(val=>val.state !="business" && val.state!="consultants" && val.state!="users" && val.state!="services");
|
||||
// case 'PRACTITIONER':
|
||||
// case '3': return value.filter(val=>val.state!="settings");
|
||||
|
||||
@ -47,7 +47,11 @@ export class LoginComponent {
|
||||
localStorage.setItem('user_token',res.token);
|
||||
localStorage.setItem('user_role',res.role);
|
||||
localStorage.setItem('email',JSON.stringify(auth))
|
||||
localStorage.setItem('user_id',res.roleId)
|
||||
localStorage.setItem('user_id',res.roleId
|
||||
);
|
||||
|
||||
localStorage.setItem('busId',res.busId)
|
||||
|
||||
this.router.navigate(['/home'])
|
||||
}
|
||||
}else{
|
||||
|
||||
@ -10,7 +10,7 @@ export const environment = {
|
||||
// apiEndpoint:'http://192.168.1.20:8080/api/',
|
||||
// apiEndpoint:'https://api.venbait.in/api/',
|
||||
// apiEndpoint:'http://venbainfotech.com:5000/api/',
|
||||
apiEndpoint:'http://192.168.1.3:8080/api/',
|
||||
apiEndpoint:'http://192.168.1.4:8080/api/',
|
||||
// apiEndpoint:'https://api.venbait.in/api/',
|
||||
|
||||
//EndUser URL
|
||||
|
||||
Loading…
Reference in New Issue
Block a user