Commit ff6a66f3 by Jansa Jose

dc

parent d3677ac3
...@@ -26,7 +26,7 @@ import { ForgotComponent } from './forgot/forgot.component'; ...@@ -26,7 +26,7 @@ import { ForgotComponent } from './forgot/forgot.component';
HttpClientModule, HttpClientModule,
MalihuScrollbarModule.forRoot() MalihuScrollbarModule.forRoot()
], ],
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}], providers: [],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { } export class AppModule { }
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link appointment" data-toggle="tab" href="#appointment">Appointments <a class="nav-link appointment" data-toggle="tab" href="#appointment" #appointmentTab>Appointments
<div class="notification" *ngIf="successBookDtls">{{ successBookDtls?.length || '0' }}</div> <div class="notification" *ngIf="successBookDtls">{{ successBookDtls?.length || '0' }}</div>
</a> </a>
</li> </li>
...@@ -244,8 +244,7 @@ ...@@ -244,8 +244,7 @@
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td>{{bookData.scheduled_date+' '+bookData.scheduled_time}}</td> <td>{{bookData.scheduled_date+' '+bookData.scheduled_time}}</td>
<td>{{bookData.car_name}}</td> <td>{{bookData.car_name}}</td>
<td>{{(bookData.is_multiple ==='0')? bookData.mechanic_data[0].first_name+' '+bookData.mechanic_data[0].last_name : bookData.mechanic_data.length+' Requests'}}</td> <td>{{(bookData.is_multiple === '0')? bookData.mechanic_data[0].first_name+' '+bookData.mechanic_data[0].last_name : bookData.mechanic_data.length+' Requests'}}</td>
<!-- <td>{{bookData.cost}}</td> -->
<td> <td>
<div class="floatLeft"> <div class="floatLeft">
<div class="btn-group btn-group-justified"> <div class="btn-group btn-group-justified">
...@@ -275,11 +274,12 @@ ...@@ -275,11 +274,12 @@
<td>{{mechdata.phone}}</td> <td>{{mechdata.phone}}</td>
<td>{{mechdata.rating > 0?mechdata.rating+'/5':''}}</td> <td>{{mechdata.rating > 0?mechdata.rating+'/5':''}}</td>
<td>{{mechdata.location}}</td> <td>{{mechdata.location}}</td>
<td>{{mechdata.custom_amount > 0 ?mechdata.custom_amount:bookData.cost}}</td> <td>{{mechdata.custom_amount > 0 ?mechdata.custom_amount:mechdata.mechanic_amount}}</td>
<td> <td>
<div class="btn-group btn-group-justified"> <div class="btn-group btn-group-justified">
<button class="btn btn-default btn-sm" *ngIf="mechdata.status =='0'">Waiting for Approval</button> <button class="btn btn-default btn-sm" *ngIf="bookData.status == '1' && !mechdata.custom_service_quote">Accepted</button>
<button class="btn btn-success btn-sm" *ngIf="mechdata.status =='1' && bookData.status != '1'" (click)="mechanicQuoteAccept(bookData.booking_id,mechdata.mechanic_id)">Accept</button> <button class="btn btn-default btn-sm" *ngIf="mechdata.status == '0'">Waiting for Approval</button>
<button class="btn btn-success btn-sm" [attr.bookAmount]="mechdata.custom_amount > 0 ?mechdata.custom_amount:mechdata.mechanic_amount" *ngIf="mechdata.status == '1' && bookData.status != '1'" (click)="mechanicQuoteAccept($event,bookData.booking_id,mechdata.mechanic_id)">Accept</button>
<button class="btn btn-info btn-sm" (click)="showCustQuote(bookData.booking_id,mechdata.mechanic_id,1)" data-toggle="modal" data-target="#quote" *ngIf="mechdata.status =='1' && mechdata.custom_service_quote">View Quote</button> <button class="btn btn-info btn-sm" (click)="showCustQuote(bookData.booking_id,mechdata.mechanic_id,1)" data-toggle="modal" data-target="#quote" *ngIf="mechdata.status =='1' && mechdata.custom_service_quote">View Quote</button>
</div> </div>
</td> </td>
...@@ -387,7 +387,7 @@ ...@@ -387,7 +387,7 @@
<td>{{mechdata.phone}}</td> <td>{{mechdata.phone}}</td>
<td>{{mechdata.rating > 0?mechdata.rating+'/5':''}}</td> <td>{{mechdata.rating > 0?mechdata.rating+'/5':''}}</td>
<td>{{mechdata.location}}</td> <td>{{mechdata.location}}</td>
<td>{{mechdata.custom_amount > 0 ?mechdata.custom_amount:bookData.cost}}</td> <td>{{mechdata.custom_amount > 0 ?mechdata.custom_amount:mechdata.mechanic_amount}}</td>
<td> <td>
<div class="btn-group btn-group-justified"> <div class="btn-group btn-group-justified">
<button class="btn btn-info btn-sm" (click)="showCustQuote(bookData.booking_id,mechdata.mechanic_id,2)" data-toggle="modal" data-target="#quote" *ngIf="mechdata.status =='1' && mechdata.custom_service_quote">View Quote</button> <button class="btn btn-info btn-sm" (click)="showCustQuote(bookData.booking_id,mechdata.mechanic_id,2)" data-toggle="modal" data-target="#quote" *ngIf="mechdata.status =='1' && mechdata.custom_service_quote">View Quote</button>
...@@ -750,7 +750,7 @@ ...@@ -750,7 +750,7 @@
<div class="modal" id="quotes"> <div class="modal" id="quotes">
<div class="modal-dialog modal-full"> <div class="modal-dialog modal-full">
<div class="modal-content login_modal_wrapper" malihu-scrollbar [scrollbarOptions]="scrollbarOptions"> <div class="modal-content login_modal_wrapper" malihu-scrollbar [scrollbarOptions]="scrollbarOptions">
<div #closeQuoteWizard class="modal_close" data-dismiss="modal" (click)="scheduleDateInit = false; scheduleMechanic = false"> <div #closeQuoteWizard class="modal_close" data-dismiss="modal" (click)="scheduleDateInit = false; scheduleMechanic = false; selMechanics = [];">
&times; &times;
</div> </div>
<div class="modal-body"> <div class="modal-body">
...@@ -799,8 +799,8 @@ ...@@ -799,8 +799,8 @@
</div> </div>
<div class="mechanic_detail relative"> <div class="mechanic_detail relative">
<div class="custom_checkbox_stack"> <div class="custom_checkbox_stack">
<input class="custom_checkbox" id="custom_checkbox-1" type="checkbox" value="value1"> <input class="custom_checkbox" [attr.id]="'custom_checkbox-1'+i" (click)="checkboxChange(i,mechanic.mechanic_id,$event,mechanic.estimate)" type="checkbox" value="value1">
<label for="custom_checkbox-1"></label> <label [attr.for]="'custom_checkbox-1'+i"></label>
</div> </div>
<h4>{{mechanic.display_name}}</h4> <h4>{{mechanic.display_name}}</h4>
<div *ngIf="mechanic.shop_id != 0; else mechanicDetails"> <div *ngIf="mechanic.shop_id != 0; else mechanicDetails">
...@@ -815,8 +815,8 @@ ...@@ -815,8 +815,8 @@
<p>{{mechanic.distance | number:'1.2-2'}} miles away from you</p> <p>{{mechanic.distance | number:'1.2-2'}} miles away from you</p>
</ng-template> </ng-template>
<button (click)="scheduleNow(mechanic.mechanic_id,mechanic.estimate)" <button (click)="scheduleNow(mechanic.mechanic_id,mechanic.estimate)"
[ngClass]="{'book_now':scheduleDateInit == true && scheduleMechanic == mechanic.mechanic_id, [ngClass]="{'book_now':scheduleDateInit == true && scheduleMechanic == mechanic.mechanic_id && selMechanics.length <= 0,
'book_now_disabled':scheduleDateInit == false || (scheduleDateInit == true && scheduleMechanic != mechanic.mechanic_id)}"> 'book_now_disabled':scheduleDateInit == false || (scheduleDateInit == true && scheduleMechanic != mechanic.mechanic_id) || selMechanics.length > 0}">
{{loginDetails ? 'Book now' : 'Login and Continue' }} {{loginDetails ? 'Book now' : 'Login and Continue' }}
</button> </button>
</div> </div>
...@@ -891,7 +891,7 @@ ...@@ -891,7 +891,7 @@
<div class="clear"></div> <div class="clear"></div>
<p>Estimated Price : <strong>{{estimatedPrice}}</strong></p> <p>Estimated Price : <strong>{{estimatedPrice}}</strong></p>
<div class="clear"></div> <div class="clear"></div>
<button class="request_all_btn">Request All</button> <button class="request_all_btn" *ngIf="selMechanics.length > 0 && scheduleDateInit == true" (click)="scheduleMultipleRequest()">Request All</button>
</div> </div>
<div class="service_map"> <div class="service_map">
<agm-map #gm [latitude]="lat" [longitude]="lng" [fitBounds]="true"> <agm-map #gm [latitude]="lat" [longitude]="lng" [fitBounds]="true">
...@@ -965,6 +965,7 @@ ...@@ -965,6 +965,7 @@
<!-- BOOKING-QUOTE-MODAL-ENDS --> <!-- BOOKING-QUOTE-MODAL-ENDS -->
<!-- BOOKING-SUCCESS-MODAL-STARTS --> <!-- BOOKING-SUCCESS-MODAL-STARTS -->
<button #successModel class="hide" data-toggle="modal" data-target="#success"></button>
<div class="modal" id="success"> <div class="modal" id="success">
<div class="modal-dialog modal-full"> <div class="modal-dialog modal-full">
<div class="modal-content login_modal_wrapper"> <div class="modal-content login_modal_wrapper">
...@@ -991,6 +992,8 @@ ...@@ -991,6 +992,8 @@
<!-- BOOKING-SUCCESS-MODAL-ENDS --> <!-- BOOKING-SUCCESS-MODAL-ENDS -->
<!-- BOOKING-FAILURE-MODAL-STARTS --> <!-- BOOKING-FAILURE-MODAL-STARTS -->
<button #failureModel class="hide" data-toggle="modal" data-target="#failure"></button>
<div class="modal" id="failure"> <div class="modal" id="failure">
<div class="modal-dialog modal-full"> <div class="modal-dialog modal-full">
<div class="modal-content login_modal_wrapper"> <div class="modal-content login_modal_wrapper">
......
...@@ -6,6 +6,7 @@ import { WebService } from './../../provider/web.service'; ...@@ -6,6 +6,7 @@ import { WebService } from './../../provider/web.service';
import { MapsAPILoader } from '@agm/core'; import { MapsAPILoader } from '@agm/core';
import { SubjectService } from './../../provider/subject.service'; import { SubjectService } from './../../provider/subject.service';
import { google } from '@google/maps'; import { google } from '@google/maps';
import { apiConfig } from '../../../environments/server.config';
import { ImageStorage } from '../../../environments/server.config'; import { ImageStorage } from '../../../environments/server.config';
import { formatDate } from '@angular/common'; import { formatDate } from '@angular/common';
...@@ -28,9 +29,11 @@ export class DashboardComponent implements OnInit { ...@@ -28,9 +29,11 @@ export class DashboardComponent implements OnInit {
errMessage: any; errMessage: any;
modelDates: number[] = new Array(); modelDates: number[] = new Array();
monthArray: any[] = new Array(12); monthArray: any[] = new Array(12);
mechanics: string = '';
editProfile; editProfile;
loginDetails: any; loginDetails: any;
selectedFile: File; selectedFile: File;
selMechanics: any[] = new Array();
profile_image: any; profile_image: any;
mechCustQuote: number[] = new Array(); mechCustQuote: number[] = new Array();
confirmParam: string = ''; confirmParam: string = '';
...@@ -73,8 +76,8 @@ export class DashboardComponent implements OnInit { ...@@ -73,8 +76,8 @@ export class DashboardComponent implements OnInit {
currDate: any; currDate: any;
nextDate: any; nextDate: any;
dateStep: number = 0; dateStep: number = 0;
activeTab: any;
dateSection: any[] = new Array(); dateSection: any[] = new Array();
serverUrl: string;
imageServer: string; imageServer: string;
mechanicData: any; mechanicData: any;
autoSchedule: boolean; autoSchedule: boolean;
...@@ -96,11 +99,14 @@ export class DashboardComponent implements OnInit { ...@@ -96,11 +99,14 @@ export class DashboardComponent implements OnInit {
@ViewChild("confirmModal") public confirmModalRef: ElementRef; @ViewChild("confirmModal") public confirmModalRef: ElementRef;
@ViewChild("googleLocVin") public googleLocVinRef: ElementRef; @ViewChild("googleLocVin") public googleLocVinRef: ElementRef;
@ViewChild("goTostep1") public goTostep1Ref: ElementRef; @ViewChild("goTostep1") public goTostep1Ref: ElementRef;
@ViewChild("failureModel") public failureModelRef: ElementRef;
@ViewChild("successModel") public successModelRef: ElementRef;
@ViewChild("step2nextBtn") public step2nextRef: ElementRef; @ViewChild("step2nextBtn") public step2nextRef: ElementRef;
@ViewChild("step3nextBtn") public step3nextRef: ElementRef; @ViewChild("step3nextBtn") public step3nextRef: ElementRef;
@ViewChild("closeQuoteWizard") closeQuoteWizardRef: ElementRef; @ViewChild("closeQuoteWizard") closeQuoteWizardRef: ElementRef;
@ViewChild("googleLocDetails") public googleLocDetailsRef: ElementRef; @ViewChild("googleLocDetails") public googleLocDetailsRef: ElementRef;
@ViewChild("newGoogleLocSearch") public newGoogleLocRef: ElementRef; @ViewChild("newGoogleLocSearch") public newGoogleLocRef: ElementRef;
@ViewChild("appointmentTab") public appointmentTabRef: ElementRef;
@ViewChild("serviceHistoryTab") public serviceHistoryTabRef: ElementRef; @ViewChild("serviceHistoryTab") public serviceHistoryTabRef: ElementRef;
@ViewChild("closeVehicleAddForm") public closeVehicleAddFormRef: ElementRef; @ViewChild("closeVehicleAddForm") public closeVehicleAddFormRef: ElementRef;
...@@ -118,9 +124,9 @@ export class DashboardComponent implements OnInit { ...@@ -118,9 +124,9 @@ export class DashboardComponent implements OnInit {
this.nextDate = new Date(); this.nextDate = new Date();
this.issuesData = false; this.issuesData = false;
this.loader = false; this.loader = false;
this.activeTab = 'profile';
this.errMessage = false; this.errMessage = false;
this.vehDetails = false; this.vehDetails = false;
this.serverUrl = apiConfig;
this.imageServer = ImageStorage; this.imageServer = ImageStorage;
this.searchLocError = false; this.searchLocError = false;
this.showLeftArrow = false; this.showLeftArrow = false;
...@@ -137,11 +143,24 @@ export class DashboardComponent implements OnInit { ...@@ -137,11 +143,24 @@ export class DashboardComponent implements OnInit {
this.tab = 'active'; this.tab = 'active';
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.activeTab = params['tab']; let payStatus = params['status'];
let activeTab = params['tab'];
if(this.activeTab == 'service'){ if(payStatus && payStatus !=''){
if(payStatus == 'success')
this.successModelRef.nativeElement.click();
if(payStatus == 'failure')
this.failureModelRef.nativeElement.click();
}
if(activeTab && activeTab !=''){
if(activeTab == 'service'){
this.serviceHistoryTabRef.nativeElement.click(); this.serviceHistoryTabRef.nativeElement.click();
} }
if(activeTab == 'appointment'){
this.appointmentTabRef.nativeElement.click();
}
}
}); });
this.vehicleVinAddForm = new FormGroup({ this.vehicleVinAddForm = new FormGroup({
...@@ -210,7 +229,7 @@ export class DashboardComponent implements OnInit { ...@@ -210,7 +229,7 @@ export class DashboardComponent implements OnInit {
this.webService.post_data('getCustBookDetails', {'customer_id':this.loginDetails.customer_id}).subscribe(response => { this.webService.post_data('getCustBookDetails', {'customer_id':this.loginDetails.customer_id}).subscribe(response => {
if ( response.status == '1' && response.bookData != 'undefined' && response.bookData != undefined && response.bookData != 'null' && response.bookData != null ) { if ( response.status == '1' && response.bookData != 'undefined' && response.bookData != undefined && response.bookData != 'null' && response.bookData != null ) {
let bookings = response.bookData; let bookings = response.bookData;
console.log(bookings) console.log(bookings);
let successBooking: any[] = new Array(); let successBooking: any[] = new Array();
let bookingDetails: any[] = new Array(); let bookingDetails: any[] = new Array();
...@@ -648,7 +667,6 @@ export class DashboardComponent implements OnInit { ...@@ -648,7 +667,6 @@ export class DashboardComponent implements OnInit {
this.webService.post_data('getNearByMechanics',searchData).subscribe(response => { this.webService.post_data('getNearByMechanics',searchData).subscribe(response => {
if(response.status == '1'){ if(response.status == '1'){
this.mechanicData = response.mechanic_data; this.mechanicData = response.mechanic_data;
this.dateSection.push(new Date(this.today.setDate(this.today.getDate()))); this.dateSection.push(new Date(this.today.setDate(this.today.getDate())));
this.dateSection.push(new Date(this.today.setDate(this.today.getDate() + 1))); this.dateSection.push(new Date(this.today.setDate(this.today.getDate() + 1)));
...@@ -732,6 +750,24 @@ export class DashboardComponent implements OnInit { ...@@ -732,6 +750,24 @@ export class DashboardComponent implements OnInit {
this.loader = true; this.loader = true;
this.wizardData['cost'] = cost; this.wizardData['cost'] = cost;
this.wizardData['multiple'] ='0';
this.confirmBooking();
}
scheduleMultipleRequest(){
if(!this.loginDetails){
this.routeToIndex();
}
let coma = '';
const thisObj = this;
this.mechanics = '';
this.selMechanics.forEach(function (mechanic_data) {
thisObj.mechanics += coma+mechanic_data.mechanic_id+':'+mechanic_data.amount;
coma = ',';
})
this.wizardData['mechanic_id'] = thisObj.mechanics;
this.wizardData['cost'] = this.estimatedPrice;
this.wizardData['multiple'] ='1';
this.confirmBooking(); this.confirmBooking();
} }
...@@ -825,12 +861,13 @@ export class DashboardComponent implements OnInit { ...@@ -825,12 +861,13 @@ export class DashboardComponent implements OnInit {
}); });
} }
mechanicQuoteAccept(booking_id,mechanic_id){ mechanicQuoteAccept(event,booking_id,mechanic_id){
if(!booking_id || !mechanic_id){ if(!booking_id || !mechanic_id){
return false; return false;
} }
this.showConfirmPopUp('acceptQuote',{bookingId:booking_id,mechanicId:mechanic_id}); let amount = event.target.attributes.bookAmount.value;
this.showConfirmPopUp('acceptQuote',{bookingId:booking_id,mechanicId:mechanic_id,amount:amount});
} }
cnfCancelBook(booking_id){ cnfCancelBook(booking_id){
...@@ -874,11 +911,26 @@ export class DashboardComponent implements OnInit { ...@@ -874,11 +911,26 @@ export class DashboardComponent implements OnInit {
acceptQuote(param: any){ acceptQuote(param: any){
this.webService.post_data('acceptMechanicQuote',param).subscribe(response => { this.webService.post_data('acceptMechanicQuote',param).subscribe(response => {
if(response.status == 'success'){ if(response.status == 'success'){
this.getCustBookDetails(); document.location.href = this.serverUrl+'payNow/'+response.data;
// this.getCustBookDetails();
} }
}) })
} }
checkboxChange(index,mechanic_id,event,estimate){
if (event.target.checked) {
this.selMechanics.push({id:index,mechanic_id:mechanic_id,amount:estimate});
} else {
let id = this.selMechanics.findIndex(x => x.id == index);
if (id != -1) {
this.selMechanics.splice(id, 1);
}
}
}
scrollToTop(id){ scrollToTop(id){
$('#'+id).stop().animate({scrollTop: 0}, 800); $('#'+id).stop().animate({scrollTop: 0}, 800);
} }
......
...@@ -489,7 +489,7 @@ ...@@ -489,7 +489,7 @@
<div class="modal" id="quotes"> <div class="modal" id="quotes">
<div class="modal-dialog modal-full"> <div class="modal-dialog modal-full">
<div class="modal-content login_modal_wrapper" malihu-scrollbar [scrollbarOptions]="scrollbarOptions"> <div class="modal-content login_modal_wrapper" malihu-scrollbar [scrollbarOptions]="scrollbarOptions">
<div #closeQuoteWizard class="modal_close" data-dismiss="modal" (click)="scheduleDateInit = false; scheduleMechanic = false"> <div #closeQuoteWizard class="modal_close" data-dismiss="modal" (click)="scheduleDateInit = false; scheduleMechanic = false; selMechanics = [];">
&times; &times;
</div> </div>
<div class="modal-body"> <div class="modal-body">
...@@ -537,8 +537,8 @@ ...@@ -537,8 +537,8 @@
</div> </div>
<div class="mechanic_detail relative"> <div class="mechanic_detail relative">
<div class="custom_checkbox_stack"> <div class="custom_checkbox_stack">
<input class="custom_checkbox" id="custom_checkbox-1" type="checkbox" value="value1"> <input class="custom_checkbox" [attr.id]="'custom_checkbox-1'+i" (click)="checkboxChange(i,mechanic.mechanic_id,$event,mechanic.estimate)" type="checkbox" value="value1">
<label for="custom_checkbox-1"></label> <label [attr.for]="'custom_checkbox-1'+i"></label>
</div> </div>
<h4>{{mechanic.display_name}}</h4> <h4>{{mechanic.display_name}}</h4>
...@@ -553,8 +553,8 @@ ...@@ -553,8 +553,8 @@
<h6>{{mechanic.phone}}</h6> <h6>{{mechanic.phone}}</h6>
<p>{{mechanic.distance | number:'1.2-2' }} miles away from you</p> <p>{{mechanic.distance | number:'1.2-2' }} miles away from you</p>
</ng-template> </ng-template>
<button (click)="scheduleNow(mechanic.mechanic_id,mechanic.estimate)" [ngClass]="{'book_now':scheduleDateInit == true && scheduleMechanic == mechanic.mechanic_id, <button (click)="scheduleNow(mechanic.mechanic_id,mechanic.estimate)" [ngClass]="{'book_now':scheduleDateInit == true && scheduleMechanic == mechanic.mechanic_id && selMechanics.length <= 0,
'book_now_disabled':scheduleDateInit == false || (scheduleDateInit == true && scheduleMechanic != mechanic.mechanic_id)}"> 'book_now_disabled':scheduleDateInit == false || (scheduleDateInit == true && scheduleMechanic != mechanic.mechanic_id) || selMechanics.length > 0}">
{{loginDetails ? 'Book now' : 'Login and Continue' }} {{loginDetails ? 'Book now' : 'Login and Continue' }}
</button> </button>
</div> </div>
...@@ -629,7 +629,7 @@ ...@@ -629,7 +629,7 @@
<div class="clear"></div> <div class="clear"></div>
<p>Estimated Price : <strong>{{estimatedPrice}}</strong></p> <p>Estimated Price : <strong>{{estimatedPrice}}</strong></p>
<div class="clear"></div> <div class="clear"></div>
<button class="request_all_btn">Request All</button> <button class="request_all_btn" *ngIf="selMechanics.length > 0 && scheduleDateInit == true" (click)="scheduleMultipleRequest()">Request All</button>
</div> </div>
<div class="service_map"> <div class="service_map">
<agm-map #gm [latitude]="lat" [longitude]="lng" [fitBounds]="true"> <agm-map #gm [latitude]="lat" [longitude]="lng" [fitBounds]="true">
......
...@@ -68,7 +68,9 @@ export class IndexComponent implements OnInit { ...@@ -68,7 +68,9 @@ export class IndexComponent implements OnInit {
currDate: any; currDate: any;
nextDate: any; nextDate: any;
dateStep: number = 0; dateStep: number = 0;
mechanics: string = '';
dateSection: any[] = new Array(); dateSection: any[] = new Array();
selMechanics: any[] = new Array();
imageServer: string; imageServer: string;
mechanicData: any; mechanicData: any;
autoSchedule: boolean; autoSchedule: boolean;
...@@ -456,6 +458,25 @@ export class IndexComponent implements OnInit { ...@@ -456,6 +458,25 @@ export class IndexComponent implements OnInit {
this.confirmBooking(); this.confirmBooking();
} }
scheduleMultipleRequest(){
if(!this.loginDetails){
this.autoSchedule = true;
this.loginModalRef.nativeElement.click();
return false;
}
let coma = '';
const thisObj = this;
this.mechanics = '';
this.selMechanics.forEach(function (mechanic_data) {
thisObj.mechanics += coma+mechanic_data.mechanic_id+':'+mechanic_data.amount;
coma = ',';
})
this.wizardData['mechanic_id'] = thisObj.mechanics;
this.wizardData['cost'] = this.estimatedPrice;
this.wizardData['multiple'] ='1';
this.confirmBooking();
}
confirmBooking(){ confirmBooking(){
this.wizardData['customer_id'] = this.loginDetails.customer_id; this.wizardData['customer_id'] = this.loginDetails.customer_id;
this.wizardData['selected_issues'] = this.selectedIssues; this.wizardData['selected_issues'] = this.selectedIssues;
...@@ -526,6 +547,17 @@ export class IndexComponent implements OnInit { ...@@ -526,6 +547,17 @@ export class IndexComponent implements OnInit {
reader.readAsDataURL(optionalImg); reader.readAsDataURL(optionalImg);
} }
checkboxChange(index,mechanic_id,event,estimate){
if (event.target.checked) {
this.selMechanics.push({id:index,mechanic_id:mechanic_id,amount:estimate});
} else {
let id = this.selMechanics.findIndex(x => x.id == index);
if (id != -1) {
this.selMechanics.splice(id, 1);
}
}
}
scrollToBottom(id){ scrollToBottom(id){
$('#'+id).stop().animate({scrollTop: $('#'+id)[0].scrollHeight}, 1500); $('#'+id).stop().animate({scrollTop: $('#'+id)[0].scrollHeight}, 1500);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment