Commit ac26230f by Jansa Jose

vin audit

parent 34890a48
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
<td> <td>
<div class="floatLeft"> <div class="floatLeft">
<div class="btn-group btn-group-justified"> <div class="btn-group btn-group-justified">
<button class="btn btn-default btn-sm">{{bookData.status === '1' ? 'Accepted' : 'Pending'}}</button> <button class="{{bookData.status === '1' ? 'btn btn-success btn-sm' : 'btn btn-primary btn-sm'}}btn btn-primary btn-sm">{{bookData.status === '1' ? 'Accepted' : 'Pending'}}</button>
<button (click)="cnfCancelBook(bookData.booking_id)" class="btn btn-danger btn-sm">Cancel</button> <button (click)="cnfCancelBook(bookData.booking_id)" class="btn btn-danger btn-sm">Cancel</button>
</div> </div>
</div> </div>
...@@ -277,8 +277,8 @@ ...@@ -277,8 +277,8 @@
<td>{{mechdata.custom_amount > 0 ?mechdata.custom_amount:mechdata.mechanic_amount}}</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="bookData.status == '1' && !mechdata.custom_service_quote">Accepted</button> <button class="btn btn-success btn-sm" *ngIf="bookData.status == '1' && !mechdata.custom_service_quote">Accepted</button>
<button class="btn btn-default btn-sm" *ngIf="mechdata.status == '0'">Waiting for Approval</button> <button class="btn btn-info 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-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>
...@@ -450,7 +450,7 @@ ...@@ -450,7 +450,7 @@
<select (change)="get_model($event.target.value)" class="vehicle_input_select" placeholder="Choose Make" <select (change)="get_model($event.target.value)" class="vehicle_input_select" placeholder="Choose Make"
formControlName="maker" [ngClass]="{'input_error': !vehicleDetailsAddForm.controls['maker'].valid && vehicleDetailsFormSubmitClick}"> formControlName="maker" [ngClass]="{'input_error': !vehicleDetailsAddForm.controls['maker'].valid && vehicleDetailsFormSubmitClick}">
<option value="" class="hide">MAKE</option> <option value="" class="hide">MAKE</option>
<option *ngFor="let car_date of carSearchJsonData; let key = index" value="{{key}}">{{car_date.brand}}</option> <option *ngFor="let car_date of carBrands; let key = index" value="{{car_date.veh_brand_id}}">{{car_date.maker}}</option>
</select> </select>
</div> </div>
</div> </div>
...@@ -459,7 +459,7 @@ ...@@ -459,7 +459,7 @@
<select class="vehicle_input_select" placeholder="Choose Model" formControlName="modelName" <select class="vehicle_input_select" placeholder="Choose Model" formControlName="modelName"
[ngClass]="{'input_error': !vehicleDetailsAddForm.controls['modelName'].valid && vehicleDetailsFormSubmitClick}"> [ngClass]="{'input_error': !vehicleDetailsAddForm.controls['modelName'].valid && vehicleDetailsFormSubmitClick}">
<option value="" class="hide">MODEL</option> <option value="" class="hide">MODEL</option>
<option *ngFor="let car_models of carModel">{{car_models}}</option> <option *ngFor="let car_models of carModel">{{car_models.model}}</option>
</select> </select>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
......
...@@ -718,7 +718,7 @@ ...@@ -718,7 +718,7 @@
padding: 30px; padding: 30px;
padding-top: 50px; padding-top: 50px;
position: relative; position: relative;
top: 85px; top: 15px;
.login_modal_inner { .login_modal_inner {
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
...@@ -820,7 +820,7 @@ ...@@ -820,7 +820,7 @@
} }
} }
.active{ .active{
background-color: #f2f2f2; background-color: #b9b9b9;
padding:8px; padding:8px;
padding-left: 15px; padding-left: 15px;
border-radius: 8px; border-radius: 8px;
......
...@@ -44,7 +44,8 @@ export class DashboardComponent implements OnInit { ...@@ -44,7 +44,8 @@ export class DashboardComponent implements OnInit {
successBookDtls: any; successBookDtls: any;
profileEditResp: any; profileEditResp: any;
autocompleteVin: any; autocompleteVin: any;
carSearchJsonData: any; carBrands: any;
selBrand: string = '';
autocompleteDetails: any; autocompleteDetails: any;
optionalDescription: string; optionalDescription: string;
editProfileSubmitClick: boolean; editProfileSubmitClick: boolean;
...@@ -175,9 +176,7 @@ export class DashboardComponent implements OnInit { ...@@ -175,9 +176,7 @@ export class DashboardComponent implements OnInit {
modelName: new FormControl('', [Validators.required]) modelName: new FormControl('', [Validators.required])
}); });
this.webService.get_stored_json('car-list.json').subscribe((response: any) => { this.getVehicleBrand();
this.carSearchJsonData = response;
});
this.subjectService.getLoginData().subscribe(loginData => { this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData')); this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
...@@ -224,6 +223,29 @@ export class DashboardComponent implements OnInit { ...@@ -224,6 +223,29 @@ export class DashboardComponent implements OnInit {
$('body').attr('style',''); $('body').attr('style','');
} }
getVehicleBrand(){
this.webService.get_data('getVehicleBrand').subscribe(response => {
if(response.status == 'success'){
this.carBrands = response.data;
}
});
}
get_model(brand_id) {
const thisObj = this;
thisObj.carBrands.forEach(function (brandData,index) {
if(brandData.veh_brand_id == brand_id){
thisObj.selBrand = brandData.maker;
}
});
this.webService.post_data('getVehicleModel',{'vehBrand_id':brand_id}).subscribe(response => {
if(response.status == 'success'){
this.carModel = response.data;
}
});
}
getCustBookDetails(){ getCustBookDetails(){
this.loader = true; this.loader = true;
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 => {
...@@ -269,10 +291,6 @@ export class DashboardComponent implements OnInit { ...@@ -269,10 +291,6 @@ export class DashboardComponent implements OnInit {
}); });
} }
get_model(event) {
this.carModel = this.carSearchJsonData[event].models;
}
setIssueSelected(event){ setIssueSelected(event){
let issue_id = event.target.attributes.issue_id.value; let issue_id = event.target.attributes.issue_id.value;
let sub_issue_id = event.target.attributes.sub_issue_id.value; let sub_issue_id = event.target.attributes.sub_issue_id.value;
...@@ -418,7 +436,7 @@ export class DashboardComponent implements OnInit { ...@@ -418,7 +436,7 @@ export class DashboardComponent implements OnInit {
} }
let location; let location;
this.vehicleDetailsFormSubmitClick = false; this.vehicleDetailsFormSubmitClick = false;
vehicleData.car_maker = this.carSearchJsonData[vehicleData['maker']]['brand']; vehicleData.car_maker = this.selBrand;
this.ngZone.run(() => { this.ngZone.run(() => {
let place: google.maps.places.PlaceResult = this.autocompleteDetails.getPlace(); let place: google.maps.places.PlaceResult = this.autocompleteDetails.getPlace();
if (place == undefined || place == null || place === undefined || place === null || if (place == undefined || place == null || place === undefined || place === null ||
...@@ -477,7 +495,7 @@ export class DashboardComponent implements OnInit { ...@@ -477,7 +495,7 @@ export class DashboardComponent implements OnInit {
this.loader = false; this.loader = false;
this.errMessage = {'errMsg':response.message} this.errMessage = {'errMsg':response.message}
    setTimeout (() => {     setTimeout (() => {
         this.errMessage = false;          this.errMessage = false;
      }, 2000);       }, 2000);
} }
}); });
...@@ -561,9 +579,9 @@ export class DashboardComponent implements OnInit { ...@@ -561,9 +579,9 @@ export class DashboardComponent implements OnInit {
} }
}); });
this.getIssueData(); this.getIssueData();
} }
getIssueData(){ getIssueData(){
const This = this; const This = this;
this.loader = true; this.loader = true;
this.webService.get_data('getGeneralIssues').subscribe(response => { this.webService.get_data('getGeneralIssues').subscribe(response => {
...@@ -579,9 +597,9 @@ export class DashboardComponent implements OnInit { ...@@ -579,9 +597,9 @@ export class DashboardComponent implements OnInit {
this.loader = false; this.loader = false;
return false; return false;
}); });
} }
searchIssues(event){ searchIssues(event){
if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){ if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){
this.issuesData = this.defIssuesData; this.issuesData = this.defIssuesData;
} else { } else {
...@@ -612,50 +630,50 @@ export class DashboardComponent implements OnInit { ...@@ -612,50 +630,50 @@ export class DashboardComponent implements OnInit {
$('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true); $('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true);
}); });
},500); },500);
} }
// searchIssues(event){ // searchIssues(event){
// if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){ // if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){
// this.issuesData = this.defIssuesData; // this.issuesData = this.defIssuesData;
// } else { // } else {
// const thisObj = this; // const thisObj = this;
// let data: any[] = new Array(); // let data: any[] = new Array();
// let serRegExp = new RegExp(event.target.value,"gi"); // let serRegExp = new RegExp(event.target.value,"gi");
// thisObj.defIssuesData.forEach(function (issues,index) { // thisObj.defIssuesData.forEach(function (issues,index) {
// let issueCat = issues.issue; // let issueCat = issues.issue;
// let subIssueCat =issues.sub_categories; // let subIssueCat =issues.sub_categories;
// if(issueCat.search(serRegExp) != -1){ // if(issueCat.search(serRegExp) != -1){
// thisObj.defIssuesData['exception'] = '0'; // thisObj.defIssuesData['exception'] = '0';
// data.push(thisObj.defIssuesData[index]); // data.push(thisObj.defIssuesData[index]);
// }else { // }else {
// issues.sub_categories.forEach(function (issues_cat_1,index_1) { // issues.sub_categories.forEach(function (issues_cat_1,index_1) {
// let subIssueCat = issues_cat_1.issue_category; // let subIssueCat = issues_cat_1.issue_category;
// if(subIssueCat.search(serRegExp) != -1){ // if(subIssueCat.search(serRegExp) != -1){
// thisObj.defIssuesData['exception'] = '1'; // thisObj.defIssuesData['exception'] = '1';
// data.push(thisObj.defIssuesData[index]); // data.push(thisObj.defIssuesData[index]);
// // console.log(thisObj.defIssuesData[index].sub_categories[index_1]) // // console.log(thisObj.defIssuesData[index].sub_categories[index_1])
// } // }
// }) // })
// } // }
// }); // });
// console.log(thisObj.defIssuesData); // console.log(thisObj.defIssuesData);
// this.issuesData = (data.length > 0)?data:false; // this.issuesData = (data.length > 0)?data:false;
// } // }
// setTimeout(()=>{ // setTimeout(()=>{
// this.selectedIssues.forEach(function (issues) { // this.selectedIssues.forEach(function (issues) {
// $('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true); // $('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true);
// }); // });
// },500); // },500);
// } // }
jumpToStep3(){ jumpToStep3(){
if(this.selectedIssues.length != 0){ if(this.selectedIssues.length != 0){
this.step3nextRef.nativeElement.click(); this.step3nextRef.nativeElement.click();
} }
} }
getQuote(){ getQuote(){
const thisObj = this; const thisObj = this;
this.loader = true; this.loader = true;
...@@ -679,23 +697,23 @@ export class DashboardComponent implements OnInit { ...@@ -679,23 +697,23 @@ export class DashboardComponent implements OnInit {
this.loader = false; this.loader = false;
return false; return false;
}); });
} }
onMouseOver(infoWindow, gm) { onMouseOver(infoWindow, gm) {
if (gm.lastOpen != null) { if (gm.lastOpen != null) {
gm.lastOpen.close(); gm.lastOpen.close();
} }
gm.lastOpen = infoWindow; gm.lastOpen = infoWindow;
infoWindow.open(); infoWindow.open();
} }
onMouseOut(gm){ onMouseOut(gm){
if (gm.lastOpen != null) { if (gm.lastOpen != null) {
gm.lastOpen.close(); gm.lastOpen.close();
} }
} }
next(event) { next(event) {
if(this.dateStep > 30){ if(this.dateStep > 30){
this.showLeftArrow = true; this.showLeftArrow = true;
this.showRightArrow = false; this.showRightArrow = false;
...@@ -709,9 +727,9 @@ export class DashboardComponent implements OnInit { ...@@ -709,9 +727,9 @@ export class DashboardComponent implements OnInit {
this.dateSection[0] = new Date(this.currDate); this.dateSection[0] = new Date(this.currDate);
this.dateSection[1] = new Date(this.nextDate); this.dateSection[1] = new Date(this.nextDate);
this.dateStep += 1; this.dateStep += 1;
} }
prev(event) { prev(event) {
if(this.dateStep <= 0){ if(this.dateStep <= 0){
this.showLeftArrow = false; this.showLeftArrow = false;
this.showRightArrow = true; this.showRightArrow = true;
...@@ -725,13 +743,13 @@ export class DashboardComponent implements OnInit { ...@@ -725,13 +743,13 @@ export class DashboardComponent implements OnInit {
this.dateSection[0] = new Date(this.currDate); this.dateSection[0] = new Date(this.currDate);
this.dateSection[1] = new Date(this.nextDate); this.dateSection[1] = new Date(this.nextDate);
this.dateStep -= 1; this.dateStep -= 1;
} }
getSchedule(time,index){ getSchedule(time,index){
this.wizardData['schedule_date'] = {'date':this.formatDate(this.dateSection[index]),'time':time}; this.wizardData['schedule_date'] = {'date':this.formatDate(this.dateSection[index]),'time':time};
} }
formatDate(date) { formatDate(date) {
const d = new Date(date); const d = new Date(date);
let day = '' + d.getDate(); let day = '' + d.getDate();
let month = ''+(d.getMonth()+1); let month = ''+(d.getMonth()+1);
...@@ -739,9 +757,9 @@ export class DashboardComponent implements OnInit { ...@@ -739,9 +757,9 @@ export class DashboardComponent implements OnInit {
if (day.length < 2) { day = '0'+day; } if (day.length < 2) { day = '0'+day; }
if (month.length < 2) { month = '0'+month; } if (month.length < 2) { month = '0'+month; }
return [year,month,day].join('-'); return [year,month,day].join('-');
} }
scheduleNow(mechanic_id,cost){ scheduleNow(mechanic_id,cost){
this.wizardData['mechanic_id'] = mechanic_id+':'+cost; this.wizardData['mechanic_id'] = mechanic_id+':'+cost;
if(!this.loginDetails){ if(!this.loginDetails){
...@@ -752,9 +770,9 @@ export class DashboardComponent implements OnInit { ...@@ -752,9 +770,9 @@ export class DashboardComponent implements OnInit {
this.wizardData['cost'] = cost; this.wizardData['cost'] = cost;
this.wizardData['multiple'] ='0'; this.wizardData['multiple'] ='0';
this.confirmBooking(); this.confirmBooking();
} }
scheduleMultipleRequest(){ scheduleMultipleRequest(){
if(!this.loginDetails){ if(!this.loginDetails){
this.routeToIndex(); this.routeToIndex();
} }
...@@ -769,9 +787,9 @@ export class DashboardComponent implements OnInit { ...@@ -769,9 +787,9 @@ export class DashboardComponent implements OnInit {
this.wizardData['cost'] = this.estimatedPrice; this.wizardData['cost'] = this.estimatedPrice;
this.wizardData['multiple'] ='1'; this.wizardData['multiple'] ='1';
this.confirmBooking(); 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;
this.wizardData['optionalDescription'] = this.optionalDescription; this.wizardData['optionalDescription'] = this.optionalDescription;
...@@ -806,9 +824,9 @@ export class DashboardComponent implements OnInit { ...@@ -806,9 +824,9 @@ export class DashboardComponent implements OnInit {
this.loader = false; this.loader = false;
return false; return false;
}); });
} }
resetQuoteWizard(){ resetQuoteWizard(){
this.selectedIssues = []; this.selectedIssues = [];
this.scheduleMechanic = false; this.scheduleMechanic = false;
this.scheduleDateInit = false; this.scheduleDateInit = false;
...@@ -819,9 +837,9 @@ export class DashboardComponent implements OnInit { ...@@ -819,9 +837,9 @@ export class DashboardComponent implements OnInit {
this.optionalImges[3] = false; this.optionalImges[3] = false;
this.optionalImges[4] = false; this.optionalImges[4] = false;
this.optionalDescription = ''; this.optionalDescription = '';
} }
showCustQuote(booking_id,mechanic_id,type){ showCustQuote(booking_id,mechanic_id,type){
if(!booking_id || !mechanic_id){ if(!booking_id || !mechanic_id){
return false; return false;
} }
...@@ -843,9 +861,9 @@ export class DashboardComponent implements OnInit { ...@@ -843,9 +861,9 @@ export class DashboardComponent implements OnInit {
} }
}); });
this.loader = false; this.loader = false;
} }
cancelBooking(booking: any){ cancelBooking(booking: any){
let bookingId: number; let bookingId: number;
if(!booking.bookingId){ if(!booking.bookingId){
return false; return false;
...@@ -859,32 +877,32 @@ export class DashboardComponent implements OnInit { ...@@ -859,32 +877,32 @@ export class DashboardComponent implements OnInit {
this.loader = false; this.loader = false;
} }
}); });
} }
mechanicQuoteAccept(event,booking_id,mechanic_id){ mechanicQuoteAccept(event,booking_id,mechanic_id){
if(!booking_id || !mechanic_id){ if(!booking_id || !mechanic_id){
return false; return false;
} }
let amount = event.target.attributes.bookAmount.value; let amount = event.target.attributes.bookAmount.value;
this.showConfirmPopUp('acceptQuote',{bookingId:booking_id,mechanicId:mechanic_id,amount:amount}); this.showConfirmPopUp('acceptQuote',{bookingId:booking_id,mechanicId:mechanic_id,amount:amount});
} }
cnfCancelBook(booking_id){ cnfCancelBook(booking_id){
if(!booking_id){ if(!booking_id){
return false; return false;
} }
this.showConfirmPopUp('cancelBooking',{bookingId:booking_id}); this.showConfirmPopUp('cancelBooking',{bookingId:booking_id});
} }
cnfdeleteCustomerCar(customer_id,vehicle_id){ cnfdeleteCustomerCar(customer_id,vehicle_id){
if(!customer_id || !vehicle_id){ if(!customer_id || !vehicle_id){
return false; return false;
} }
this.showConfirmPopUp('deleteCustomerCar',{'customer_id':customer_id,'customer_veh_id':vehicle_id}); this.showConfirmPopUp('deleteCustomerCar',{'customer_id':customer_id,'customer_veh_id':vehicle_id});
} }
showConfirmPopUp(fn_name: string, param: any){ showConfirmPopUp(fn_name: string, param: any){
if(fn_name === ''){ if(fn_name === ''){
return false; return false;
} }
...@@ -894,9 +912,9 @@ export class DashboardComponent implements OnInit { ...@@ -894,9 +912,9 @@ export class DashboardComponent implements OnInit {
this.confirmParam = param; this.confirmParam = param;
this.confirmCallBak = fn_name; this.confirmCallBak = fn_name;
this.confirmModalRef.nativeElement.click(); this.confirmModalRef.nativeElement.click();
} }
confirmCallBack(fn_name: string,param: string){ confirmCallBack(fn_name: string,param: string){
if(fn_name === '' || !this[fn_name]){ if(fn_name === '' || !this[fn_name]){
return false; return false;
} }
...@@ -906,9 +924,9 @@ export class DashboardComponent implements OnInit { ...@@ -906,9 +924,9 @@ export class DashboardComponent implements OnInit {
} else { } else {
this[fn_name](); this[fn_name]();
} }
} }
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'){
document.location.href = this.serverUrl+'payNow/'+response.data; document.location.href = this.serverUrl+'payNow/'+response.data;
...@@ -918,9 +936,9 @@ export class DashboardComponent implements OnInit { ...@@ -918,9 +936,9 @@ export class DashboardComponent implements OnInit {
// this.getCustBookDetails(); // this.getCustBookDetails();
} }
}) })
} }
checkboxChange(index,mechanic_id,event,estimate){ checkboxChange(index,mechanic_id,event,estimate){
if (event.target.checked) { if (event.target.checked) {
this.selMechanics.push({id:index,mechanic_id:mechanic_id,amount:estimate}); this.selMechanics.push({id:index,mechanic_id:mechanic_id,amount:estimate});
} else { } else {
...@@ -929,15 +947,15 @@ export class DashboardComponent implements OnInit { ...@@ -929,15 +947,15 @@ export class DashboardComponent implements OnInit {
this.selMechanics.splice(id, 1); this.selMechanics.splice(id, 1);
} }
} }
} }
scrollToTop(id){ scrollToTop(id){
$('#'+id).stop().animate({scrollTop: 0}, 800); $('#'+id).stop().animate({scrollTop: 0}, 800);
} }
scrollToBottom(id){ scrollToBottom(id){
$('#'+id).stop().animate({scrollTop: $('#'+id)[0].scrollHeight}, 1500); $('#'+id).stop().animate({scrollTop: $('#'+id)[0].scrollHeight}, 1500);
} }
tab_swap(type) { this.tab = type; } tab_swap(type) { this.tab = type; }
} }
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
<div class="col-md-6"> <div class="col-md-6">
<select (change)="get_model($event.target.value)" formControlName="maker" [ngClass]="{'input_error': !vehicleDataForm.controls['maker'].valid && vehicleDataFormSubmit}"> <select (change)="get_model($event.target.value)" formControlName="maker" [ngClass]="{'input_error': !vehicleDataForm.controls['maker'].valid && vehicleDataFormSubmit}">
<option value="" class="hide">MAKE</option> <option value="" class="hide">MAKE</option>
<option *ngFor="let car_date of carSearchJsonData; let key = index" value="{{car_date.veh_brand_id}}">{{car_date.maker}}</option> <option *ngFor="let car_date of carBrands; let key = index" value="{{car_date.veh_brand_id}}">{{car_date.maker}}</option>
</select> </select>
</div> </div>
</div> </div>
......
...@@ -395,7 +395,7 @@ ...@@ -395,7 +395,7 @@
padding: 30px; padding: 30px;
padding-top: 50px; padding-top: 50px;
position: relative; position: relative;
top: 85px; top:15px;
.login_modal_inner { .login_modal_inner {
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
...@@ -498,7 +498,7 @@ ...@@ -498,7 +498,7 @@
} }
} }
.active{ .active{
background-color: #f2f2f2; background-color: #b9b9b9;
padding:8px; padding:8px;
padding-left: 15px; padding-left: 15px;
border-radius: 8px; border-radius: 8px;
......
...@@ -80,8 +80,9 @@ export class IndexComponent implements OnInit { ...@@ -80,8 +80,9 @@ export class IndexComponent implements OnInit {
scheduleMechanic: any; scheduleMechanic: any;
carModel: any; carModel: any;
carBrands: any;
selBrand: string = '';
modelDates: number[] = new Array(); modelDates: number[] = new Array();
carSearchJsonData: any;
optionalImges: any = new Array({1:false,2:false,3:false,4:false}); optionalImges: any = new Array({1:false,2:false,3:false,4:false});
optionalDescription: string; optionalDescription: string;
...@@ -118,9 +119,6 @@ export class IndexComponent implements OnInit { ...@@ -118,9 +119,6 @@ export class IndexComponent implements OnInit {
modelName: new FormControl('', [Validators.required]) modelName: new FormControl('', [Validators.required])
}); });
// this.webService.get_stored_json('car-list.json').subscribe((response: any) => {
// this.carSearchJsonData = response;
// });
this.getVehicleBrand(); this.getVehicleBrand();
let currentYear = Number((new Date()).getFullYear()); let currentYear = Number((new Date()).getFullYear());
...@@ -156,20 +154,30 @@ export class IndexComponent implements OnInit { ...@@ -156,20 +154,30 @@ export class IndexComponent implements OnInit {
} }
getVehicleBrand(){ getVehicleBrand(){
this.loader=true;
this.webService.get_data('getVehicleBrand').subscribe(response => { this.webService.get_data('getVehicleBrand').subscribe(response => {
if(response.status == 'success'){ if(response.status == 'success'){
this.carSearchJsonData = response.data; this.carBrands = response.data;
} }
this.loader = false;
}); });
} }
get_model(event) { get_model(brand_id) {
this.webService.post_data('getVehicleModel',{'vehBrand_id':event}).subscribe(response => { this.loader = true;
const thisObj = this;
thisObj.carBrands.forEach(function (brandData,index) {
if(brandData.veh_brand_id == brand_id){
thisObj.selBrand = brandData.maker;
}
});
this.webService.post_data('getVehicleModel',{'vehBrand_id':brand_id}).subscribe(response => {
if(response.status == 'success'){ if(response.status == 'success'){
this.carModel = response.data; this.carModel = response.data;
} }
this.loader = false;
}); });
// this.carModel = this.carSearchJsonData[event].models;
} }
getVehicleLoc(lastLoc){ getVehicleLoc(lastLoc){
...@@ -209,12 +217,12 @@ export class IndexComponent implements OnInit { ...@@ -209,12 +217,12 @@ export class IndexComponent implements OnInit {
} }
this.wizardData['vechile_info'] = {'trim':vehicleData['trim'], this.wizardData['vechile_info'] = {'trim':vehicleData['trim'],
'lastMaintanceDate':(vehicleData['last_date'])?(formatDate(vehicleData['last_date'],'MM/dd/yyyy','en')):'', 'lastMaintanceDate':(vehicleData['last_date'])?(formatDate(vehicleData['last_date'],'MM/dd/yyyy','en')):'',
'maker':this.carSearchJsonData[vehicleData['maker']]['brand'], 'maker':this.selBrand,
'milage':vehicleData['milage'],'emgine':vehicleData['emgine'], 'milage':vehicleData['milage'],'emgine':vehicleData['emgine'],
'modelName':vehicleData['modelName'],'modelYear':vehicleData['modelYear'], 'modelName':vehicleData['modelName'],'modelYear':vehicleData['modelYear'],
'maintanenceInterval':vehicleData['maintanence_interval'] 'maintanenceInterval':vehicleData['maintanence_interval']
} }
//console.log(this.wizardData['vechile_info']) console.log(this.wizardData['vechile_info'])
this.vehicleDataFormSubmit = false; this.vehicleDataFormSubmit = false;
} }
......
...@@ -43,7 +43,11 @@ ...@@ -43,7 +43,11 @@
</li> </li>
</ul> </ul>
<ng-template #noCart> <ng-template #noCart>
No Data Found <div class="cmn_nodata">
<img src="../../../assets/images/no_result.png">
<p>No Data Found</p>
</div>
</ng-template> </ng-template>
</div> </div>
</div> </div>
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
padding: 10px; padding: 10px;
img{ img{
height: 180px; height: 180px;
width: auto; max-width: 100%;
} }
} }
h5{ h5{
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
</app-searchbar> </app-searchbar>
<div class="loader_overlay" *ngIf="loader"></div> <div class="loader_overlay" *ngIf="loader"></div>
<div class="myorder_wrapper"> <div class="myorder_wrapper">
<ul *ngIf="bookedData" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll"> <ul *ngIf="bookedData;else noOrders" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<li *ngFor="let book of bookedData"> <li *ngFor="let book of bookedData">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
...@@ -45,6 +45,13 @@ ...@@ -45,6 +45,13 @@
</div> </div>
</li> </li>
</ul> </ul>
<ng-template #noOrders>
<div class="cmn_nodata">
<img src="../../../assets/images/no_result.png">
<p>No Data Found</p>
</div>
</ng-template>
</div> </div>
</div> </div>
<div class="bottom_product_list"> <div class="bottom_product_list">
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
padding: 10px; padding: 10px;
img{ img{
height: 180px; height: 180px;
width: auto; max-width: 100%;
} }
} }
h5{ h5{
......
...@@ -20,8 +20,9 @@ ...@@ -20,8 +20,9 @@
<div class="product_details"> <div class="product_details">
<h1>{{productDetails.product_name}}</h1> <h1>{{productDetails.product_name}}</h1>
<h2>{{productDetails.short_description}}</h2> <h2>{{productDetails.short_description}}</h2>
<h2>Brand : </h2><h4>{{productDetails.brand_name}}</h4> <h2><strong>Brand : </strong>{{productDetails.brand_name}}</h2>
<div *ngIf="productDetails.part_id"><h2>Part ID : </h2><h4>{{productDetails.part_id}}</h4></div> <div *ngIf="productDetails.part_id">
<h2><strong>Part ID : </strong>{{productDetails.part_id}}</h2></div>
<h3>$ {{productDetails.amount}}</h3> <h3>$ {{productDetails.amount}}</h3>
<div class="rating_div" *ngIf="productDetails.rating"> <div class="rating_div" *ngIf="productDetails.rating">
<fieldset class="rating prevent-click"> <fieldset class="rating prevent-click">
......
...@@ -852,3 +852,19 @@ bs-datepicker-container{ ...@@ -852,3 +852,19 @@ bs-datepicker-container{
padding-bottom: 50px; padding-bottom: 50px;
} }
.cmn_nodata{
text-align: center;
padding-top:10%;
padding-bottom: 10%;
img{
width: 200px;
margin-bottom:50px;
}
p{
text-align: center;
color: #a8a8a8;
font-size: 24px;
font-weight: 300;
}
}
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