Merge branch 'master' of bitbucket.org:venbainformationtechnology/appointments_frontend

This commit is contained in:
bitbucket 2023-03-29 16:40:22 +05:30
commit cc5e7d55bd
14 changed files with 440 additions and 139 deletions

View File

@ -0,0 +1,28 @@
<!-- <mat-card class="settings-panel" > -->
<h5 mat-dialog-title>
<strong>Assign Service</strong>
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="closeDialog()">
<mat-icon>close</mat-icon>
</button>
</h5>
<form [formGroup]="form" (ngSubmit)="submit()">
<ng-scrollbar class="scrollHV">
<div mat-dialog-content class="my-table">
<mat-form-field appearance="outline" class="mat-pane">
<mat-label>Duration</mat-label>
<input placeholder="Duration" type="number" matInput formControlName="duration">
<mat-error *ngIf="myError('duration', 'required')">Duration is required</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" class="mat-pane">
<mat-label>Fees</mat-label>
<input placeholder="Fees" matInput type="number" formControlName="fees">
<mat-error *ngIf="myError('fees', 'required')">Fees is required</mat-error>
</mat-form-field>
</div>
</ng-scrollbar>
<div mat-dialog-actions>
<button mat-button type="submit" class="mat-green" mat-raised-button >Submit</button>
<button mat-button (click)="closeDialog()" >Cancel</button>
</div>
</form>
<!-- </mat-card> -->

View File

@ -0,0 +1,62 @@
// ::ng-deep .cdk-overlay-pane{
// width: 60%!important;
// }
.mat-pane{
width: 20rem;
}
.button{
// float: right;
margin-bottom: 1rem;
background-color: #ffff;
margin-top: -1rem;
// margin-left: 6rem;
float: right;
}
::ng-deep .mat-card.settings-panel {
position: inherit;
bottom: 0px;
right: 0px;
width: 350px;
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;
}
}
::ng-deep .mat-dialog-content {
max-height: 170vh !important;
overflow: hidden!important;
}
::ng-deep .mat-dialog-container{
overflow: hidden!important;
}
.scrollHV {
height: calc(100vh - 150px);
}
:ng-deep .ng-scroll-viewport-wrapper{
right: -25px !important;
}

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AssignServiceComponent } from './assign-service.component';
describe('AssignServiceComponent', () => {
let component: AssignServiceComponent;
let fixture: ComponentFixture<AssignServiceComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AssignServiceComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(AssignServiceComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,55 @@
import { Component, Inject, OnInit, Optional } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({
selector: 'app-assign-service',
templateUrl: './assign-service.component.html',
styleUrls: ['./assign-service.component.scss']
})
export class AssignServiceComponent implements OnInit {
form: FormGroup;
local_data: any;
constructor(public dialogRef: MatDialogRef<AssignServiceComponent>,@Optional() @Inject(MAT_DIALOG_DATA) public data) {
console.log(data)
this.local_data = data
this.local_data.duration = this.local_data.durationNew
}
ngOnInit(): void {
this.form = new FormGroup({
duration: new FormControl('', [Validators.required]),
fees: new FormControl('', [Validators.required])
});
this.form.patchValue(this.local_data)
}
public myError = (controlName: string, errorName: string) =>{
return this.form.controls[controlName].hasError(errorName);
}
closeDialog(){
this.dialogRef.close();
}
submit(){
console.log(this.form.value)
let user_id = localStorage.getItem('user_id')
let details:any = {
durationNew: this.form.value.duration,
fees:this.form.value.fees,
busId:this.local_data.busId,
userId: user_id,
serviceId:this.local_data.serviceId
}
if(this.local_data.hasOwnProperty('id')){
details.id =this.local_data.id
}
this.dialogRef.close(details);
}
}

View File

@ -13,18 +13,23 @@ export class ConsultantService {
constructor(private _http: HttpClient) { }
getUsersListDetails(id): Observable<any> {
console.log('IN')
return this._http.post(this.apiUrl + 'getPractitionerInfo', {id:id})
// .pipe(
// catchError(this.handleError('role', []))
// )
}
getServicesListDetails(userId,busId): Observable<any> {
console.log('IN')
return this._http.post(this.apiUrl + 'getServicesMapDetails', {busId:busId, userId:userId})
// .pipe(
// catchError(this.handleError('role', []))
// )
}
getAssignedDetails(busId:any): Observable<any>{
return this._http.post(this.apiUrl + 'getServicesDetails', {busId:busId})
}
getServiceCheckedDetails(params): Observable<any>{
return this._http.post(this.apiUrl + 'AlterServicesMap', params)
}
createDurationFeesDetails(params): Observable<any>{
return this._http.post(this.apiUrl + 'CreateDuration', params)
}
handleError(arg0: string, arg1: undefined[]): (err: any, caught: Observable<any>) => import("rxjs").ObservableInput<any> {

View File

@ -7,19 +7,25 @@ import { DemoMaterialModule } from 'app/shared/demo.module';
import { NgScrollbarModule } from 'ngx-scrollbar';
import { EditWorkingHoursComponent } from './edit-working-hours/edit-working-hours.component';
import { ExtraWorkingHoursComponent } from './extra-working-hours/extra-working-hours.component';
import { AssignServiceComponent } from './assign-service/assign-service.component';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatFormFieldModule } from '@angular/material/form-field';
@NgModule({
declarations: [
ConsultantSettingComponent,
EditWorkingHoursComponent,
ExtraWorkingHoursComponent
ExtraWorkingHoursComponent,
AssignServiceComponent
],
imports: [
CommonModule,
ConsultantSettingRoutingModule,
DemoMaterialModule,
NgScrollbarModule
NgScrollbarModule,
MatSidenavModule,
MatFormFieldModule,
]
})
export class ConsultantSettingModule { }

View File

@ -8,7 +8,7 @@
</div>
</div> -->
<mat-tab-group [@.disabled]="true">
<mat-tab-group [@.disabled]="true" (selectedTabChange)="tabClick($event)">
<mat-tab>
<ng-template mat-tab-label>
@ -316,27 +316,49 @@
<ng-template mat-tab-label>
<i class="material-icons icons">&#xe7fb;</i> Assigned Services
</ng-template>
<div class="staff">
<div class="staff assignService" >
<span class="staff-title">
Define Your Services
</span>
<!-- <mat-form-field appearance="outline" class="mat-pane">
<mat-label>Role</mat-label>
<mat-select placeholder="Select Role" formControlName="assiendservice" required>
<mat-option>--</mat-option>
<mat-option *ngFor="let details of servicesList_array" [value]="details.servicesName">
{{details.servicesName}}
<mat-form-field appearance="outline" style="width: 45%;" class="mat-pane">
<mat-label>Assign Service</mat-label>
<mat-select placeholder="Select Role" [(ngModel)]="assignService" multiple required>
<!-- <ng-scrollbar class="scrollHV"> -->
<mat-option (onSelectionChange)="getValues($event,details)" *ngFor="let details of servicesList" [value]="details.servicesName">
<div class="card-comment-widget">
<mat-list>
<mat-list-item>
<img class="img-responsive img-circle" src="https://prodaphstorage.blob.core.windows.net/specialties/bdf0cf0d-754e-4254-aaf7-fdc7aedd7c35.jpg" alt="Online Doctor Consultation - Allergist and Clinical Immunologist" width="30" height="30" alt="user list image">
<h6 mat-line>{{details.servicesName}}</h6>
<!-- <div class="comment-time">
Oct-11,17
</div> -->
</mat-list-item>
<!-- <span> <img src="assets/images/userpic.png" class="rad-full" width="30" height="30" alt=""></span> -->
</mat-list>
</div>
</mat-option>
<!-- </ng-scrollbar> -->
</mat-select>
<mat-error *ngIf="myError('businessselect', 'required')">role is required</mat-error>
</mat-form-field> -->
<!-- <mat-error *ngIf="myError('businessselect', 'required')">role is required</mat-error> -->
</mat-form-field>
</div>
<mat-card class="mb-2 example-card d-flex" *ngFor="let details of servicesList_array">
<input id="color-toggle" type="checkbox" class="checkbox">
<mat-card-title-group>
<mat-card-title class="service-info">{{details.servicesName}}</mat-card-title>
<mat-card-title class="info">{{details.duration}} Minutes</mat-card-title>
</mat-card-title-group>
<mat-card class="p-1" *ngFor="let details of servicesList_array;let i = index">
<div fxLayout="row" class="flexCard">
<div fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10">
<img mat-list-avatar src="https://prodaphstorage.blob.core.windows.net/specialties/bdf0cf0d-754e-4254-aaf7-fdc7aedd7c35.jpg" width="50" height="50" >
</div>
<div fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70">
<div class="service-info">{{details.servicesName}}</div>
<div class="service-info2">{{servicesList_data[i].duration.length>0 ? servicesList_data[i].duration[0].durationNew : details.duration}} Mins | <span class="indianSymbol">{{servicesList_data[i].duration.length>0 ? servicesList_data[i].duration[0].fees : 0}}</span></div>
<div class="info" (click)="asignService(details,i)">+ Customize the price and duration of a service.</div>
</div>
<div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15" fxLayoutAlign="center center">
<span style="color: green;">Active</span>
</div>
</div>
</mat-card>
</mat-tab>

View File

@ -343,21 +343,28 @@ margin-bottom: 10rem;
margin-left: 1rem;
}
.service-info{
line-height: 3rem!important;
// line-height: 3rem!important;
font-size: 14px!important;
font-weight: 500!important;
color: #2f2c2c;
}
.service-info2{
// line-height: 3rem!important;
font-size: 12px!important;
font-weight: 500!important;
color: #5F5F5F;
}
.info{
font-size: 12px!important;
font-weight: 500;
color: rgba(2,71,91,.6);
padding: 0 0 10px;
// padding: 0 0 10px;
max-height: 38px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
cursor: pointer;
}
::ng-deep .mat-card .mat-card-title:nth-child(2) {
margin-top: -33px!important;
@ -382,3 +389,22 @@ margin-bottom: 10rem;
// color: #4C4C4C;
// text-align: center;
// }
.assignService{
.scrollHV {
height: calc(100vh - 461px) !important;
}
}
::ng-deep .mat-select-panel .mat-option{
height: 5em !important;
}
// css example
.indianSymbol {
content: "\20B9";
}
.p-1{
padding: 1rem !important;
.flexCard{
display: contents !important;
}
}

View File

@ -5,6 +5,7 @@ import { MatDialog } from '@angular/material/dialog';
import { MatTableDataSource } from '@angular/material/table';
import { ApiServiceService } from 'app/appoinment/service-list-details/service-api-services/api-service.service';
import { environment } from 'environments/environment';
import { AssignServiceComponent } from '../assign-service/assign-service.component';
import { ConsultantService } from '../consultant-service/consultant.service';
import { EditWorkingHoursComponent } from '../edit-working-hours/edit-working-hours.component';
import { ExtraWorkingHoursComponent } from '../extra-working-hours/extra-working-hours.component';
@ -15,6 +16,7 @@ import { ExtraWorkingHoursComponent } from '../extra-working-hours/extra-working
styleUrls: ['./consultant-setting.component.scss']
})
export class ConsultantSettingComponent implements OnInit {
assignService:any = []
registerForm: FormGroup;
submitted = false;
selected = 'Assign New Services';
@ -33,6 +35,9 @@ export class ConsultantSettingComponent implements OnInit {
practitionerdetails: any;
servicesList_array: any = [];
apiUrl:any;
serviceCheckedData: number;
checkedArray: any[];
servicesList_data: any=[];
constructor(private formBuilder: FormBuilder, public dialog: MatDialog, public _con:ConsultantService, private fb: FormBuilder, public _api:ConsultantService,private locationStrategy: LocationStrategy) {}
@ -53,93 +58,18 @@ export class ConsultantSettingComponent implements OnInit {
}
getUsersList() {
//this._pd.getTabStatusPdDetails(this.tabStatus)
let id = localStorage.getItem('user_id')
console.log(id)
this._con.getUsersListDetails(id).subscribe(res => {
if (res.status == 200) {
this.usersList = res.data[0];
console.log(this.usersList)
this.practitionerdetails = this.usersList['practitionerInfos'][0]
console.log(this.practitionerdetails)
this.apiUrl = 'http://localhost:4200/customer/business/'+this.usersList.randStr
this.getServicesList(this.usersList.id,this.usersList.busId)
// this.dataSource = res.data.length;
// console.log(this.dataSource)
// this.dataSource.data = this.usersList;
// console.log(this.dataSource.data)
// this.recordStatus=false;
}
else{
// this.usersList=[];
// this.dataSource = null;
// this.recordStatus=true;
}
}
,error => {
// this.errorMessage.push(error);
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
// alert(error.html_format);
});
}
getServicesList(id,busId) {
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._api.getServicesListDetails(id,busId).subscribe(res => {
if (res.status == 200) {
this.servicesList = res.data;
res['data'].forEach(element => {
// tmp.push(element.service)
element.service.forEach(e => {
this.servicesList_array.push(e)
});
});
console.log(this.servicesList_array)
// console.log(this.servicesList)
// this.dataSource = res.data.length;
// console.log(this.dataSource)
// this.dataSource.data = this.servicesList;
// console.log(this.dataSource.data)
// this.recordStatus=false;
}
else{
// this.servicesList=[];
// this.dataSource = null;
// this.recordStatus=true;
}
}
,error => {
// this.errorMessage.push(error);
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
// alert(error.html_format);
});
}
get f() {
return this.registerForm.controls;
}
onSubmit() {
this.submitted = true;
if (this.registerForm.invalid) {
return;
public myError = (controlName: string, errorName: string) =>{
return this.registerForm.controls[controlName].hasError(errorName);
}
tabClick(tab) {
console.log(tab.index);
if(tab.index == '2'){
this.getServicesList(this.usersList.id,this.usersList.busId)
// this.getAssignedList(this.usersList.busId)
}
}
console.log(JSON.stringify(this.registerForm.value, null, 2));
}
openDialog(action,obj) {
obj.action = action;
const dialogRef = this.dialog.open(EditWorkingHoursComponent, {
width: '48%',
height: '100%',
// maxWidth: '38vw',
position: { right: '0' },
data:obj
});
// dialogRef.afterClosed().subscribe(result => {
// if(result != undefined){
// console.log(result)
// this.formAddUpdateAndDelete(result,result.data)
// }
// });
}
edit_table(param){
@ -173,6 +103,165 @@ workingDialog(action,obj) {
// }
// });
}
getUsersList() {
//this._pd.getTabStatusPdDetails(this.tabStatus)
let id = localStorage.getItem('user_id')
console.log(id)
this._con.getUsersListDetails(id).subscribe(res => {
if (res.status == 200) {
this.usersList = res.data[0];
console.log(this.usersList)
this.practitionerdetails = this.usersList['practitionerInfos'][0]
console.log(this.practitionerdetails)
this.apiUrl = 'http://localhost:4200/customer/business/'+this.usersList.randStr
}
} );
}
getAssignedList(busId) {
this._api.getAssignedDetails(busId).subscribe(res => {
console.log(res)
if (res.status == 200) {
this.servicesList = res.data;
}
} );
}
getServicesList(id,busId) {
this.servicesList_array = []
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._api.getServicesListDetails(id,busId).subscribe(res => {
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
}
get f() {
return this.registerForm.controls;
}
onSubmit() {
this.submitted = true;
if (this.registerForm.invalid) {
return;
}
console.log(JSON.stringify(this.registerForm.value, null, 2));
}
openDialog(action,obj) {
obj.action = action;
const dialogRef = this.dialog.open(EditWorkingHoursComponent, {
width: '48%',
height: '100%',
// maxWidth: '38vw',
position: { right: '0' },
data:obj
});
// dialogRef.afterClosed().subscribe(result => {
// if(result != undefined){
// console.log(result)
// this.formAddUpdateAndDelete(result,result.data)
// }
// });
}
workingDialog(action,obj) {
obj.action = action;
const dialogRef = this.dialog.open(ExtraWorkingHoursComponent, {
width: '48%',
height: '100%',
// maxWidth: '38vw',
position: { right: '0' },
data:obj
});
// dialogRef.afterClosed().subscribe(result => {
// if(result != undefined){
// console.log(result)
// this.formAddUpdateAndDelete(result,result.data)
// }
// });
}
asignService(param,index){
console.log(param)
console.log(index,this.servicesList_data)
if(this.servicesList_data[index].duration.length>0){
param = this.servicesList_data[index].duration[0]
}
const dialogRef = this.dialog.open(AssignServiceComponent, {
width: '30%',
height: '100%',
// maxWidth: '38vw',
position: { right: '0' },
data:param
});
dialogRef.afterClosed().subscribe(result => {
console.log(result)
if(result instanceof Object){
this.createDurationFees(result)
}
});
}
createDurationFees(param){
this._api.createDurationFeesDetails(param).subscribe(res => {
if (res.status == 200) {
console.log(res)
// this.checkedList = res.data;
}
} );
}
getValues(event: {
isUserInput: any;
source: { value: any; selected: any };
},details) {
console.log(event,details,this.assignService)
if (event.isUserInput) {
if (event.source.selected === true) {
console.log('1',event.source.value)
this.serviceCheckedData = 1
this.getCheckedService(details)
} else {
console.log('2',event.source.value)
this.serviceCheckedData = 0
this.getCheckedService(details)
}
}
}
// AlterServicesMap
// methoad post
// param = {serviceId:"",userId:"",busId:"",active:1}
getCheckedService(params){
console.log(params)
let userid = localStorage.getItem('user_id')
let data = {serviceId:params.serviceId,userId:userid,busId:params.busId,active:this.serviceCheckedData}
console.log(data)
this._api.getServiceCheckedDetails(data).subscribe(res => {
if (res.status == 200) {
console.log(res)
// this.checkedList = res.data;
this.getServicesList(this.usersList.id,this.usersList.busId)
}
} );
}
}

View File

@ -14,7 +14,7 @@ export class ApiServiceService {
getServicesListDetails(): Observable<any> {
console.log('IN')
return this._http.get<any[]>(this.apiUrl + "getServicesDetails ")
return this._http.post<any[]>(this.apiUrl + "getServicesDetails",{})
// .pipe(
// catchError(this.handleError('role', []))
// )

View File

@ -31,7 +31,7 @@
<ng-container matColumnDef="duration">
<th mat-header-cell *matHeaderCellDef class="font-color"> Duration </th>
<td mat-cell *matCellDef="let element"> {{element.duration}} </td>
<td mat-cell *matCellDef="let element"> {{element.duration}} Mins </td>
</ng-container>
<ng-container matColumnDef="action">

View File

@ -44,29 +44,12 @@ export class ServiceListComponent implements OnInit {
this.getServicesList()
}
getServicesList() {
//this._pd.getTabStatusPdDetails(this.tabStatus)
getServicesList() {
this._api.getServicesListDetails().subscribe(res => {
if (res.status == 200) {
this.servicesList = res.data;
// console.log(this.servicesList)
// this.dataSource = res.data.length;
// console.log(this.dataSource)
// this.dataSource.data = this.servicesList;
// console.log(this.dataSource.data)
// this.recordStatus=false;
}
else{
// this.servicesList=[];
// this.dataSource = null;
// this.recordStatus=true;
}
}
,error => {
// this.errorMessage.push(error);
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
// alert(error.html_format);
});
this.servicesList = res.data;
}
} );
}
confirmBox(event,element){

View File

@ -15,7 +15,7 @@ private apiUrl = environment.apiEndpoint;
getServicesListDetails(): Observable<any> {
console.log('IN')
return this._http.get<any[]>(this.apiUrl + "getServicesDetails ")
return this._http.get<any[]>(this.apiUrl + "getServicesDetails",{})
// .pipe(
// catchError(this.handleError('role', []))
// )

View File

@ -16,7 +16,7 @@
<div class="d-flex calender-time">
<div class="calender">
<mat-card class="demo-inline-calendar-card cardCalender">
<mat-calendar [(selected)]="selected"></mat-calendar>
<mat-calendar [(selected)]="selected"></mat-calendar>
</mat-card>
</div>
</div>