reappointment changes

This commit is contained in:
bitbucket 2023-04-21 15:38:09 +05:30
parent 807dd9463b
commit 76c21dc25e
3 changed files with 42 additions and 5 deletions

View File

@ -33,7 +33,7 @@ export interface UsersData {
export class AppoinmentsListComponent implements OnInit {
push: any;
displayedColumns: string[] = ['id','ClientName','datetime','phoneNo','email','address','status', 'action'];
displayedColumns: string[] = ['ClientName','datetime','phoneNo','email','address','status', 'action'];
public appointmentListLength: number;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;

View File

@ -188,8 +188,27 @@ export class DialogBoxComponent implements OnInit {
});
console.log(this.local_data, this.selects)
// this.local_data.forEach(element => {
if(this.local_data.hasOwnProperty('action')){
if(this.local_data.action != 'Add'){
this.local_data.service = this.local_data['ServicesMapDetail.serviceId']
this.ServiceId = this.local_data.service
this.local_data.customer = this.local_data.customer[0].id
this.customerId = this.local_data.customer
this.slotsResult =this.local_data.appoinmentSlots
console.log(this.servicesList_array)
}
}
// });
// 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 => {
@ -218,7 +237,7 @@ export class DialogBoxComponent implements OnInit {
this.end_user.CreatecusServicesMapDetails(paramsmap).subscribe(res => {
if (res.status == 200) {
let serviceMap = res['data'][0].id
let paramsData= {
let paramsData:any= {
"busId": localStorage.getItem('busId'),
"cusId": this.customerId,
"appoinmentDate": this.form.value.appoinmentDate,
@ -227,10 +246,24 @@ export class DialogBoxComponent implements OnInit {
"appoinmentSlots": this.slotsResult,
//"servicemap" :this.bookedAppointment_servicemap
}
if(this.local_data.hasOwnProperty('id')){
paramsData.id =this.local_data.id
}
console.log(paramsData)
this._app.addFormDetails(paramsData).subscribe(res => {
if (res.status == 200) {
this.notifierService.notify('success', 'Appointment Added Successfully');
if(this.local_data.hasOwnProperty('action')){
if(this.local_data.action != 'Add'){
this.notifierService.notify('success', 'Appointment Rescheduled Successfully');
}else{
this.notifierService.notify('success', 'Appointment Added Successfully');
}
}else{
this.notifierService.notify('success', 'Appointment Added Successfully');
}
this.dialogRef.close(0);
}
})
@ -323,7 +356,8 @@ export class DialogBoxComponent implements OnInit {
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)
console.log(this.date,param,this.duration, this.ServiceId)
let thirtyMinutes = this.duration * 60 * 1000; // convert 30 minutes to milliseconds
let date1 = new Date(param);
let date2 = new Date(date1.getTime() + thirtyMinutes);
@ -372,6 +406,9 @@ export class DialogBoxComponent implements OnInit {
});
});
console.log(this.servicesList_array)
this.servicesList_array.filter(arr=>{return arr.serviceId == this.local_data['ServicesMapDetail.serviceId']})
this.duration = this.servicesList_array[0].duration
}
// this.getAssignedList(this.usersList.busId)
});

View File

@ -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.28:8080/api/',
apiEndpoint:'http://192.168.1.7:8080/api/',
//apiEndpoint:'https://api.venbait.in/api/',
//EndUser URL