slot changes and fees set dynamically

This commit is contained in:
bitbucket 2023-04-18 10:43:44 +05:30
parent 27992ff2f5
commit 77872cdd77
10 changed files with 33 additions and 10 deletions

View File

@ -14,10 +14,13 @@ export class AssignServiceComponent implements OnInit {
constructor(public dialogRef: MatDialogRef<AssignServiceComponent>,@Optional() @Inject(MAT_DIALOG_DATA) public data) { constructor(public dialogRef: MatDialogRef<AssignServiceComponent>,@Optional() @Inject(MAT_DIALOG_DATA) public data) {
console.log(data) console.log(data)
this.local_data = data this.local_data = data
if(this.local_data.hasOwnProperty('durationNew')){
this.local_data.duration = this.local_data.durationNew this.local_data.duration = this.local_data.durationNew
} }
}
ngOnInit(): void { ngOnInit(): void {
this.form = new FormGroup({ this.form = new FormGroup({
duration: new FormControl('', [Validators.required]), duration: new FormControl('', [Validators.required]),

View File

@ -433,7 +433,7 @@
</div> </div>
<div fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70"> <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-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="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 : details.fees}}</span></div>
<div class="info" (click)="asignService(details,i)">+ Customize the price and duration of a service.</div> <div class="info" (click)="asignService(details,i)">+ Customize the price and duration of a service.</div>
</div> </div>
<div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15" fxLayoutAlign="center center"> <div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15" fxLayoutAlign="center center">

View File

@ -173,12 +173,13 @@ export class EditWorkingHoursComponent implements OnInit {
let sunday ={filters :this.data[0].sunday.hours } let sunday ={filters :this.data[0].sunday.hours }
for(let i=0;i<=this.data[0].sunday.hours.length-2;i++){ for(let i=0;i<=this.data[0].sunday.hours.length-2;i++){
this.addFilterToFiltersFormArray() this.addFilterToFiltersFormArray()
this.dynamicForm.patchValue(sunday)
} }
// if(this.data[0].sunday.hours.length>1){ // if(this.data[0].sunday.hours.length>1){
// } // }
this.dynamicForm.patchValue(sunday)
// this.data[1].monday.hours.forEach(element => { // this.data[1].monday.hours.forEach(element => {
// element.value = null // element.value = null

View File

@ -43,6 +43,7 @@ ngOnInit() {
description: new FormControl('',[Validators.required]), description: new FormControl('',[Validators.required]),
fees:new FormControl('',[Validators.required]) fees:new FormControl('',[Validators.required])
}); });
this.local_data.duration = JSON.stringify(this.local_data.duration)
this.form.patchValue(this.local_data) this.form.patchValue(this.local_data)
} }

View File

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

View File

@ -223,6 +223,10 @@ let updatevalue = { serviceId: row_obj.serviceId,
console.log(URL+"/"+data.randStr+"/practitioner") console.log(URL+"/"+data.randStr+"/practitioner")
this.router.navigate([URL+"/"+data.randStr+"/practitioner"]) this.router.navigate([URL+"/"+data.randStr+"/practitioner"])
}else{ }else{
let filter = this.full_data.filter(arr=>{return arr.serviceId == data.serviceId && arr.busId ==data.busId})
console.log(filter)
localStorage.setItem('cusServiceData',JSON.stringify(filter))
localStorage.setItem("servicedetails",JSON.stringify(data))
this.router.navigate([URL+"/slots/list"]) this.router.navigate([URL+"/slots/list"])
} }

View File

@ -69,7 +69,7 @@
<p class="param"><img src="assets/images/person.svg" alt="Avatar" class="img"> Practitioner </p> <p class="param"><img src="assets/images/person.svg" alt="Avatar" class="img"> Practitioner </p>
<span class="span-text">Dr. {{doctor}}</span> <span class="span-text">Dr. {{doctor}}</span>
<p class="param"><img src="assets/images/information.svg" alt="Avatar" class="img"> Service </p> <p class="param"><img src="assets/images/information.svg" alt="Avatar" class="img"> Service </p>
<span class="span-text"> {{servicesName.servicesName}} ({{servicesName.duration <span class="span-text"> {{servicesName.servicesName}} ({{serviceMapdetails[0].duration.length>0 ? serviceMapdetails[0].duration[0].durationNew:serviceMapdetails[0].service[0].duration
}} Mins)</span> }} Mins)</span>
<!-- <p class="text-color d-flex align-items-start" > <!-- <p class="text-color d-flex align-items-start" >
<img src="assets/images/information.svg" alt="Avatar" class="img" /> <img src="assets/images/information.svg" alt="Avatar" class="img" />
@ -81,7 +81,8 @@
<p class="param"><img src="assets/images/Time-Icon.svg" alt="Avatar" class="img">Time : </p> <p class="param"><img src="assets/images/Time-Icon.svg" alt="Avatar" class="img">Time : </p>
<span class="span-text">{{slotTime | date:'shortTime'}}</span> <span class="span-text">{{slotTime | date:'shortTime'}}</span>
<p class="param"><img src="assets/images/Location.svg" alt="Avatar" class="img">Amount : </p> <p class="param"><img src="assets/images/Location.svg" alt="Avatar" class="img">Amount : </p>
<span class="span-text"><span class="ex" style="font-size: 17px;padding-bottom: 10px;line-height: 17px;">&#x20b9;</span> {{user.practitionerInfos[0].days}}</span> <span class="span-text"><span class="ex" style="font-size: 17px;padding-bottom: 10px;line-height: 17px;">&#x20b9;</span> {{ serviceMapdetails[0].duration.length>0 ? serviceMapdetails[0].duration[0].fees:serviceMapdetails[0].service[0].fees
}}</span>
</div> </div>
</div> </div>

View File

@ -51,10 +51,12 @@ export class SlotBookingDetailsComponent implements OnInit {
doctor: any=[]; doctor: any=[];
servicesName: any=[]; servicesName: any=[];
user: any=[]; user: any=[];
serviceMapdetails:any =[]
constructor(private router:Router,private datepipe:DatePipe,public end_user:EndUserService) { constructor(private router:Router,private datepipe:DatePipe,public end_user:EndUserService) {
this.end_user.appointmentBooked_observable$.subscribe((res) => { this.end_user.appointmentBooked_observable$.subscribe((res) => {
console.log('booked', res); console.log('booked', res);
if(res.length>0){ if(res.length>0){
this.serviceMapdetails =res
this.servicesName = res[0].service[0] this.servicesName = res[0].service[0]
this.user = res[0].user[0] this.user = res[0].user[0]
this.doctor = res[0].user[0].userName this.doctor = res[0].user[0].userName
@ -106,8 +108,13 @@ export class SlotBookingDetailsComponent implements OnInit {
// console.log(key,value1) // console.log(key,value1)
// } // }
}); });
let getDuration = JSON.parse(localStorage.getItem('servicedetails')) let tmpdata = localStorage.getItem('servicedetails')
let getDuration;
if(tmpdata != null){
getDuration = JSON.parse(localStorage.getItem('servicedetails'))
console.log(getDuration.duration) console.log(getDuration.duration)
}
function convertTime12to24 (time12h) { function convertTime12to24 (time12h) {
const [time, modifier] = time12h.split(' '); const [time, modifier] = time12h.split(' ');
@ -165,6 +172,7 @@ export class SlotBookingDetailsComponent implements OnInit {
// Output the intervals // Output the intervals
console.log(intervals); console.log(intervals);
//this.slots = intervals //this.slots = intervals
} }
@ -177,6 +185,10 @@ export class SlotBookingDetailsComponent implements OnInit {
let service = localStorage.getItem("servicedetails") let service = localStorage.getItem("servicedetails")
let serviceDetails = JSON.parse(service) let serviceDetails = JSON.parse(service)
console.log(serviceDetails) console.log(serviceDetails)
this.servicesName = serviceDetails
this.serviceMapdetails = this.serviceMapdetails.filter(arr=>{return arr.serviceId == serviceDetails.serviceId })
console.log( this.serviceMapdetails)
// this.form.controls['note'].setValue('Sample') // this.form.controls['note'].setValue('Sample')
this.form.patchValue(this.local_data) this.form.patchValue(this.local_data)
} }

View File

@ -188,7 +188,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="vertical-menu w-100 " > <div class="vertical-menu w-100 " style="margin: 1rem;" >
<!-- <button (click)="menuToggleFunc()" mat-icon-button class="lines-btn"> <!-- <button (click)="menuToggleFunc()" mat-icon-button class="lines-btn">
<mat-icon>menu</mat-icon> <mat-icon>menu</mat-icon>
</button> --> </button> -->

View File

@ -10,7 +10,7 @@ export const environment = {
// apiEndpoint:'http://192.168.1.20:8080/api/', // apiEndpoint:'http://192.168.1.20:8080/api/',
// apiEndpoint:'https://api.venbait.in/api/', // apiEndpoint:'https://api.venbait.in/api/',
// apiEndpoint:'http://venbainfotech.com:5000/api/', // apiEndpoint:'http://venbainfotech.com:5000/api/',
apiEndpoint:'http://192.168.1.4:8080/api/', apiEndpoint:'http://192.168.1.8:8080/api/',
// apiEndpoint:'https://api.venbait.in/api/', // apiEndpoint:'https://api.venbait.in/api/',
//EndUser URL //EndUser URL