import { Component, Injector, OnInit, ViewChild, ViewEncapsulation, EventEmitter, Output, Input, ChangeDetectorRef, ViewContainerRef, ChangeDetectionStrategy } from '@angular/core'; import { ActivatedRoute, Router, NavigationEnd } from '@angular/router'; import { appModuleAnimation } from '@shared/animations/routerTransition'; import { AppComponentBase } from '@shared/common/app-component-base'; import { ControllerRouteDetailServiceProxy, ShippingPackageServiceProxy,DriverProximityDetails, ControllerScheduleDetailDto, GetCompaniesListItemDto,OrderPackageListDto, OrderStatusAttachmentServiceProxy, UpdateOrderSorting, UpdateOrderSortingInput, UpdateRouteTemplateAddressSorting, RouteTemplateAddressServiceProxy, RemoveOrderInput, RemoveOrderList,UpdateCountInput, UpdateCountList , OrderServiceProxy, LockedOrderInput, UpdateRouteScheduleDetailSorting, AddressIdInput, AcceptProximityInput, ProximityServiceProxy, DriverProximityServiceProxy, ContainersServiceProxy, GetEditCountDetails, UpdateCountLHInput, ProximityCodeListDto } from '@shared/service-proxies/service-proxies'; import { AppSessionService } from '@shared/common/session/app-session.service'; import { ClinicNotes } from './clinic-notes.component'; import { RouteDetailAttachment } from './route-detail-attachment.component'; import { ChangeEta } from './change-eta-modal.component'; import { Table } from "primeng/table"; import { LazyLoadEvent } from "primeng/primeng"; import { Paginator } from 'primeng/components/paginator/paginator'; import { catchError, finalize, filter } from 'rxjs/operators'; import * as _ from 'lodash'; import * as moment from 'moment-timezone'; import { MovePendingOrder } from './move-order-modal.component'; import { CommonLookupModalComponent } from '@app/shared/common/lookup/common-lookup-modal.component'; import { ViewDriverProximitiesMapComponent } from '@app/sprintship/fleet-management/driver-proximities/view-driver-proximities-map.component'; import { EntityTypeHistoryModalComponent } from '@app/shared/common/entityHistory/entity-type-history-modal.component'; import { Observable, Subject, throwError } from 'rxjs'; import { AppLocalizationService } from '@app/shared/common/localization/app-localization.service'; import { UrlService } from '@app/shared/url.service'; declare var $: any; declare var jquery: any; @Component({ selector: 'lab-route-detail', templateUrl: 'lab-route-detail.component.html', encapsulation: ViewEncapsulation.None, styleUrls: ['./route-detail.component.less'], animations: [appModuleAnimation()], changeDetection: ChangeDetectionStrategy.OnPush, }) export class LabRouteDetailComponent extends AppComponentBase implements OnInit { routeId: number = null; packages: Array<{ id: number, name: string, color: string, total: number }> = new Array(); sumOfPackages: Array<{ id: number, name: string, total: number }> = new Array(); data: any; packageCount: Array<{ id: number, quantity: number }> = new Array(); lineHaulCount: Array<{ id: number, quantity: number }> = new Array(); filterText = ''; accountNoFilter: any; clinicFilter: any; proximityFilter: any; advancedFiltersAreShown = false; now: Date; arrayNotes: Array = new Array(); dNote: string; resultCount: number; saving = false; _isEditShow: boolean = false; resultCountOrder: number; freeze = true; drag = false; newRemoveOrderInput: Array = []; updateCountInputList: Array = []; updateCountLHInputList: Array = []; sprintIds: Array<{}> = new Array(); sprintIdsList: any[]; checkAll: boolean; records: any; checked: boolean = true orderIds: Array<{}> = new Array(); locationName: string; // data: Array []; @ViewChild('driversList', {static: true}) driversList: CommonLookupModalComponent; @ViewChild('viewDriverProximitiesMapModal', { static: true }) viewDriverProximitiesMapModal: ViewDriverProximitiesMapComponent; @ViewChild("dataTable", { static: true }) dataTable: Table @ViewChild("paginator", { static: true }) paginator: Paginator @ViewChild('clinicNotes', { static: true }) clinicNotes: ClinicNotes; @ViewChild('routeDetailAttachment', { static: true }) routeDetailAttachment: RouteDetailAttachment; @ViewChild('changeEta', { static: false }) changeEta: ChangeEta; @ViewChild('movePendingOrderModal', { static: false }) movePendingOrderModal: MovePendingOrder; @ViewChild('container', { static: false }) container; @Output() passOrderIds: EventEmitter = new EventEmitter(); @Output() passOrderIdsForRoute: EventEmitter = new EventEmitter(); @Input() labRouteDetails: any; @ViewChild('entityTypeHistoryModal', { static: true }) entityTypeHistoryModal: EntityTypeHistoryModalComponent; _entityTypeFullName = 'SprintTek.Shipping.Orders.Order'; entityHistoryEnabled = false; newDto: ControllerScheduleDetailDto = new ControllerScheduleDetailDto(); newPackage: OrderPackageListDto = new OrderPackageListDto(); lockedEtaInput: LockedOrderInput = new LockedOrderInput(); driverProximityDetails: DriverProximityDetails = new DriverProximityDetails(); packagesList: Array = new Array(); totalCount: any; flag = false; containers: Array<{ id: number, name: string, color: string, total: number }> = new Array(); tbodyHolder: any; orderList: Array = []; routeTemplateAddressList: Array = []; routeScheduleDetailList: Array = []; handoff: Array = []; loading = true; locationId: number; routeCode: string; driverName: string; hasContent: boolean; routeName: string; lineHaul = []; getRouteDetailFunction: Function; getRouteForMove: Function; driverPage: boolean = false; isDeliveryCode: boolean = false; handOffChecker: string; constructor( private urlService: UrlService, injector: Injector, private id: ActivatedRoute, private _controllerRouteDetails: ControllerRouteDetailServiceProxy, private _controllerRoutePackages: ShippingPackageServiceProxy, private _appSessionService: AppSessionService, private router: Router, private _orderAppService: OrderServiceProxy, private _proximityCodeService: DriverProximityServiceProxy, private _controllerRouteContainers: ContainersServiceProxy, private viewContainerRef: ViewContainerRef, private ref: ChangeDetectorRef, private _driverProximityServiceProxys: DriverProximityServiceProxy, private _appLocalizationService: AppLocalizationService, ) { super(injector); setInterval(() => { // require view to be updated this.ref.markForCheck(); }, 1000); } ngOnInit() { this.setIsEntityHistoryEnabled(); this.locationId = parseInt(localStorage.getItem('operatingLocationId')); this.driverPage = false; this.id.paramMap.subscribe(params => { this.routeId = Number(params.get('id')); }); this._controllerRouteDetails.checkFreeze(this.routeId).subscribe(result => { this.freeze = result; if(this.freeze == false) { this.drag = true; } else { this.drag = false; } }); // this.getLabPackages(); this.getLabContainers(); this.now = new Date(); // this.driversList.configure({ // title: this.l('Assign Driver'), // dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number) => { // let input = new DriverListInput(); // input.filter = filter; // input.maxResultCount = maxResultCount; // input.skipCount = skipCount; // input.tenantId = tenantId; // return this._commonLookupService.findUsers(input); // } // }); } private setIsEntityHistoryEnabled(): void { let customSettings = (abp as any).custom; this.entityHistoryEnabled = customSettings.EntityHistory && customSettings.EntityHistory.isEnabled && _.filter(customSettings.EntityHistory.enabledEntities, entityType => entityType === this._entityTypeFullName).length === 1; } showHistory(role: ControllerScheduleDetailDto): void { this.entityTypeHistoryModal.show({ entityId: role.id.toString(), entityTypeFullName: this._entityTypeFullName, entityTypeDescription: "Route Detail -" +" " +role.pickupDetail.contact.company.name }); } ngAfterViewInit() { } getLabPackages() { this.packages = []; this._controllerRoutePackages.getShippingPackageListOptions(undefined, undefined, undefined, undefined, undefined, undefined).subscribe(result => { result.forEach(element => { if (element.name !== 'Default') { this.packages.push(element); } }); // let items = document.getElementsByClassName('statsCounts').length); // console.log(items) // $.each($('.statsCounts'), function (key, val) { // if ($(val).children().hasClass('routeloader')) { // $(val).html('-'); // } // console.log("hello") // }); }); } getLabContainers() { this.containers = []; this._controllerRouteContainers.getAll().subscribe(result => { result.items.forEach(element => { this.containers.push(element); }); }); } getTotal(array) { var data = array.map(i => i.quantity); data.reduce((a, b) => a + b, 0); return data; } getRouteDetails(event?: LazyLoadEvent) { this.getLabPackages(); this.spinnerService.show(); let maxcount = 700; let routeId; let previousUrl = this.urlService.getPreviousUrl(); this.handOffChecker = localStorage.getItem('checkHandOffRoute') == null ? 'true' : localStorage.getItem('checkHandOffRoute'); this._controllerRouteDetails.handOffRouteChecker(this.routeId, this.handOffChecker, previousUrl) .subscribe(result => { routeId = result; this._controllerRouteDetails.getRouteSchedDetailList( undefined, localStorage.getItem('timeZone'), moment(localStorage.getItem('loadDate')), routeId, this.filterText, this.accountNoFilter, this.clinicFilter, this.proximityFilter, undefined ) .subscribe(result => { let sampleCount = 0 // let status = []; let statusDescription = []; let eta = []; let packageCount = []; let lineHaulCount = []; let attachment = []; if(result.length > 0){ for (let index = 0; index < result.length; index++) { this.orderIds.push(result[index].id) for (let key = 0; key < result[index].orderPackages.length; key++) { if (result[index].orderPackages[key].package.name != "Default") { result[index].packageCount += result[index].orderPackages[key].quantity; for (var data in this.packages) { if (this.packages[data].id == result[index].orderPackages[key].package.id) { this.packages[data].total += result[index].orderPackages[key].quantity; } } } } if (result[index].orderContainers) { for (let key = 0; key < result[index].orderContainers.length; key++) { result[index].lineHaulCount += result[index].orderContainers[key].quantity; for (var data in this.containers) { if (this.containers[data].id == result[index].orderContainers[key].container.id) { this.containers[data].total += result[index].orderContainers[key].quantity; } } } } result[index].eta = result[index].estimatedTimeOfArrival.utcOffset(moment.parseZone(result[index].estimatedTimeOfArrival).utcOffset()).format('LT'); if (result[index].arrivalTime != null) { result[index].arriveTime = result[index].arrivalTime.utcOffset(moment.parseZone(result[index].arrivalTime).utcOffset()).format('LT'); } if(result[index].proximityCode){ if(result[index].proximityCode.isAccepted){ result[index].proximityCodeLastModificationTime = moment(result[index].proximityCode.lastModificationTime).utcOffset(moment.parseZone(result[index].proximityCode.lastModificationTime).utcOffset()).format('MM/DD/YYYY h:mm A'); } else { result[index].proximityCodeLastModificationTime = ""; } } if (result[index].handOffRoute != null){ this.lineHaul.push(result[index].routeId); result[index].handOffRoute.timezoneAbbr = (localStorage.getItem('RouteName') == result[index].handOffRoute.name) ? '': result[index].handOffRoute.timezoneAbbr; } // eta.push(result[index].estimatedTimeOfArrival.utcOffset(moment.parseZone(result[index].estimatedTimeOfArrival).utcOffset()).format('LT')); // status.push(result[index].orderStatus); packageCount.push(result[index].packageCount); lineHaulCount.push(result[index].lineHaulCount); statusDescription.push(result[index].orderStatusDescription); } result.push(this.newDto); var lastKey = result.length - 1; result[lastKey].id = result[0].id; result[lastKey].action = "Delivery"; result[lastKey].company = new GetCompaniesListItemDto; if(result[0].deliveryDetail.contact.company){ result[lastKey].company.name = result[0].deliveryDetail.contact.company.name; result[lastKey].company.accountNo = result[0].deliveryDetail.contact.company.name; } else { result[lastKey].company.name = ""; result[lastKey].company.accountNo = ""; } result[lastKey].pickupDetail = result[0].deliveryDetail; result[lastKey].deliveryDetail = result[0].deliveryDetail; // status.sort((a, b) => a.time - b.time); // eta.sort((a,b) => a-b); statusDescription.sort((a, b) => a - b); packageCount.reduce((a, b) => a + b); lineHaulCount.reduce((a, b) => a + b); // result[lastKey].orderStatus = status[status.length - 1]; result[lastKey].deliveryTime = result[0].stopTime; // result[lastKey].estimatedTimeOfArrival = eta[eta.length - 1]; // result[lastKey].orderStatusDescription = statusDescription[statusDescription.length - 1]; result[lastKey].orderPackages = null; result[lastKey].completion = result[0].completion; result[lastKey].completionString = result[0].completionString; result[lastKey].orderExtras = result[0].orderExtras; for (let index = 0; index < result.length; index++) { if (result[index].meetPointRoute != null) { result[lastKey].meetPointRoute = result[index].meetPointRoute; break; } } // result[lastKey].orderStatusAttachment = attachment; // result[lastKey].deliveryNote = this.dNote; result[lastKey].pickUp = result[0].pickUp; // result[lastKey].proximityCode = new ProximityCodeListDto; // let countArrive = 1 // for(var data in result){ // if(result[data].arrivalTime!=null){cd // countArrive++; // if(countArrive==result.length){ // result[lastKey].proximityCode.value = result[0].proximityCode.value; // result[lastKey].proximityCode.isAccepted = result[0].proximityCode.isAccepted; // result[lastKey].proximityCode.modifiedByName = result[0].proximityCode.modifiedByName; // result[lastKey].proximityCode.lastModificationTime = result[0].proximityCode.lastModificationTime; // result[lastKey].driverProximityDetails = result[0].driverProximityDetails; // this.isDeliveryCode = true; // result[0].proximityCode = new ProximityCodeListDto; // console.log(result[lastKey]); // } // } // } result[lastKey].packageCount = packageCount.reduce((a, b) => a + b); result[lastKey].lineHaulCount = lineHaulCount.reduce((a, b) => a + b); } this.primengTableHelper.totalRecordsCount = result.length; this.primengTableHelper.records = result; this.resultCount = result.length; if ($('.packageType').is(':empty')) { } this.routeCode = this.getParentComponent().routeCode; this.driverName = this.getParentComponent().vehicleName; this.routeName = localStorage.getItem('RouteName'); this._controllerRouteDetails.getLastProximity(this.routeId).subscribe(res => { if(res.value==undefined){ }else{ result[lastKey].proximityCode = res; // this.isDeliveryCode = true; // result[0].proximityCode = null; } }); this.spinnerService.hide(); localStorage.removeItem('checkHandOffRoute'); }, error =>{ this.spinnerService.hide(); // this.router.navigate(['/app/sprintship/dispatch']); }); }); } toggleMoreInfo(event) { var element = event.currentTarget.nextSibling; var selector = document.querySelectorAll('.more-info-container.active'); var hover = document.querySelectorAll('.more-btn.hover'); if (element.classList.contains('active')) { event.currentTarget.classList.remove('hover'); element.classList.remove('active'); } else { if (selector.length > 0) { selector[0].classList.remove('active'); hover[0].classList.remove('hover'); } element.classList.add('active'); event.currentTarget.classList.add('hover'); } } ConvertToInt(val) { return parseInt(val); } navOrder(id) { this.router.navigate(['/app/sprintship/controller-order-details/', id]); } navRoute(id, routeCode) { this.router.routeReuseStrategy.shouldReuseRoute = function() { return false; }; localStorage.setItem('checkHandOffRoute', this.routeId == id ? 'false' : 'true'); this.router.onSameUrlNavigation = 'reload'; this.router.navigate(['/app/sprintship/controller-routes-details/', id]); localStorage.setItem('RouteName', routeCode); } orderAttachments(id: number) { this.routeDetailAttachment.show(id); } onShown() { } rowReorder(routeScheduleId?: number) { this.tbodyHolder = null; this.tableRow(); this.orderList = []; this.routeTemplateAddressList = []; for (let index = 0; index < this.primengTableHelper.records.length - 1; index++) { var element = this.primengTableHelper.records[index]; let a = new UpdateOrderSorting({ id: parseInt(element.id), sortOrder: index }) this.orderList.push(a); let b = new UpdateRouteTemplateAddressSorting({ addressId: element.pickupDetail.contact.address.id, routeTemplateId: element.routeTemplateId, sortOrder: index }) this.routeTemplateAddressList.push(b); let c = new UpdateRouteScheduleDetailSorting({ id: element.routeScheduleId, sortOrder: index }) this.routeScheduleDetailList.push(c); } let input = new UpdateOrderSortingInput({ sortingOrderInput: this.orderList, sortingRouteTemplateAddressInput: this.routeTemplateAddressList, sortingRouteScheduleDetailInput: this.routeScheduleDetailList }) // console.log(input) this._orderAppService.updateOrderSorting( input ).pipe().subscribe(result => { this.notify.info(this.l('SavedSuccessfully')); this.getRouteDetails(); }) } tableRow() { this.tbodyHolder = document.getElementsByTagName('tbody')[0].rows; } getParentComponent() { return this.viewContainerRef['_data'].componentView.component.viewContainerRef['_view'].component; } moveOrders(id: number) { if (this.sprintIds.indexOf(id) == -1) { this.sprintIds.push(id); } else { this.sprintIds.splice(this.sprintIds.indexOf(id), 1); } this.sprintIdsList = this.sprintIds; if (this.sprintIdsList.length == this.orderIds.length) { this.checkAll = true; } else { this.checkAll = false; } this.passOrderIds.emit(this.sprintIdsList); this.passOrderIdsForRoute.emit(this.sprintIdsList); } selectAllOrders() { this.sprintIdsList = null; this.records = this.primengTableHelper.records // console.log(this.records[0]) // console.log(this.records[10].pickUp) // && (this.records[i].pickUp == false && this.records[i].delivered == false) for (var i = 0; i < this.records.length - 1 ; i++) { if(this.checkAll == true && this._isEditShow && (this.records[i].delivered || this.records[i].pickUp || this.records[i].markedAsDelivered || this.records[i].empty) ){ this.sprintIds.push(this.records[i].id); this.records[i].selected = this.checkAll; } else if (this.checkAll == true && (this.records[i].pickUp == false && this.records[i].delivered == false && !this.records[i].markedAsDelivered) && !this._isEditShow) { // && (this.records[i].pickUp == false && this.records[i].delivered == false) this.sprintIds.push(this.records[i].id); this.records[i].selected = this.checkAll; // console.log("if") } else { if(this.sprintIds.indexOf(this.records[i].id) > -1) { this.sprintIds.splice(this.sprintIds.indexOf(this.records[i].id), 1); this.records[i].selected = this.checkAll; } // this.sprintIds.splice(this.sprintIds.indexOf(this.records[i].id), 1); // this.records[i].selected = this.checkAll; // console.log("else") } //for passing of order ids this.sprintIdsList = this.sprintIds; this.passOrderIds.emit(this.sprintIdsList); this.passOrderIdsForRoute.emit(this.sprintIdsList) // // console.log(this.sprintIdsList) } } removeStop(): void { let that = this; that.newRemoveOrderInput = []; this.sprintIdsList.forEach(function (value, i) { let removeOrderInput = new RemoveOrderInput({ id: parseInt(value), routeId: that.routeId }); that.newRemoveOrderInput.push(removeOrderInput); }); let updateRouteIdInput = new RemoveOrderList({ removeOrderInput: that.newRemoveOrderInput }); this._orderAppService.updateRouteId(updateRouteIdInput) .pipe(finalize(() => { this.saving = false; })) .subscribe(() => { this.notify.info(this.l('SavedSuccessfully')); this.getRouteDetails(); }); } singleRemoveStop(orderId: number) { this.sprintIdsList = [] this.message.confirm( '', '', (isConfirmed) => { this.sprintIdsList.push(orderId) if (isConfirmed) { this.removeStop(); } } ); } // test(id: number): void { // this.sprintIds.push(id); // this.sprintIdsList = this.sprintIds; // this._isEditShow = true; // this.getLabPackages(); // } countOrder():void{ if(this.sprintIdsList != null){ this._orderAppService.getOrdersCount(this.sprintIdsList) .subscribe((result) => { if(result == 0){ //this.resultCountOrder = result; //this.message.info("Please uncheck order with waiting pickup status first to update the count for Packages."); //this.message.info("Please clear the checkboxes first to proceed editing package count.","Unable to Edit Count"); this.message.info(this._appLocalizationService.l('EditCountInfo'),this._appLocalizationService.l('UnableToEditCount')); this.sprintIdsList = null; } }); } } // editCount(): void{ // // if(this.sprintIdsList != null){ // this._isEditShow = true; // // this._orderAppService.getOrdersCount(this.sprintIdsList) // // .subscribe((result) => { // // if(result > 0){ // // this.message.info("Please uncheck order with waiting pickup status first to update the count for Packages."); // // } // // else{ // // this._isEditShow = true; // // this.getLabPackages(); // // } // // }); // // } // // else{ // // this.message.info("Please select order first to update the count for Packages."); // // this.sprintIdsList = null; // // } // } cancelEditCount(): void{ this._isEditShow = false; this.sprintIdsList = null; } saveEditCount(notes : string): Observable{ let that = this; var ele = document.getElementsByTagName('input'); var subject = new Subject(); for (let i = 0; i < ele.length; i++) { // CHECK THE ELEMENT TYPE. var str = ele[i].id; var name = ele[i].name; var splitted = str.split("packageRecord"); var splittedName = name.split("package"); if (ele[i].type == 'number') { var checkLH = name.startsWith("LH"); if(checkLH == true) { let updateCountLHInput = new UpdateCountLHInput({ orderId: parseInt(splitted[1]), containerId : parseInt(name.split("LH")[1]), containerQuantity : ele[i].value == null || ele[i].value == "" ? 0 : parseInt(ele[i].value) }); that.updateCountLHInputList.push(updateCountLHInput); //alert("TEST : " + name.split("LH")[1]); } else{ let updateCountInput = new UpdateCountInput({ orderId: parseInt(splitted[1]), orderPackageId: 0, packageId: parseInt(splittedName[1]), quantity: ele[i].value == null || ele[i].value == "" ? 0 : parseInt(ele[i].value) }); that.updateCountInputList.push(updateCountInput); } } } let _updateCountInputList = new UpdateCountList({ routeId : this.routeId, notes : notes, updateCountInput: that.updateCountInputList, updateCountLHInput: that.updateCountLHInputList }); this._orderAppService.updateCount(_updateCountInputList) .pipe( catchError((err) => { this.spinnerService.hide(); return throwError(err); }) ) .subscribe(() => { this.notify.info(this.l('SavedSuccessfully')); this.getRouteDetails(); // this.getLabPackages(); this.getLabContainers(); this._isEditShow = false; that.sprintIdsList = []; that.sprintIds = []; that.sprintIdsList = null; that.updateCountInputList = []; this._controllerRouteDetails.getEditCountDetails(this.routeId) .subscribe(result => { subject.next(result) }) }); return subject.asObservable(); } setEta(id: number, etaStart: any, etaEnd: any, routeScheduleId: number): void { this.changeEta.show(id, etaStart, etaEnd, routeScheduleId); } lockEta(id: number, value: boolean, routeScheduleId: number) { this.lockedEtaInput.id = id; this.lockedEtaInput.locked = value; this.lockedEtaInput.routeScheduleId = routeScheduleId; this.message.confirm( '', '', (isConfirmed) => { if (isConfirmed) { this._orderAppService.lockedOrder(this.lockedEtaInput) .pipe(finalize(() => { this.saving = false; })) .subscribe(() => { this.notify.info(this.l('SavedSuccessfully')); this.getRouteDetails(); }); } } ); } proximity(clinic: string, addressId: number, lat: string, lon: string, orderId: number): void { this.message.confirm( 'You are updating ' + clinic + ' geocoordinates with Latitude: ' + lat + ', Longitude: ' + lon + '?', '', (isConfirmed) => { if (isConfirmed) { var data = new AddressIdInput; data.id = addressId; data.orderId = orderId; this._controllerRouteDetails.updateClinicGeocode(data) .pipe(finalize(() => { this.saving = false; })) .subscribe(() => { this.notify.info(this.l('SavedSuccessfully')); this.getRouteDetails(); // var acceptProximity = new AcceptProximityInput; // acceptProximity.orderId = orderId; // this._proximityCodeService.acceptProximity(acceptProximity) // .pipe(finalize(() => { this.saving = false; })) // .subscribe(() => { // this.notify.info(this.l('SavedSuccessfully')); // }); }); } } ); } isEmpty(element: HTMLElement): boolean { const nodes = element.childNodes; for (let i = 0; i < nodes.length; i++) { const node = nodes.item(i); if (node.nodeType !== 8 && nodes.item(i).textContent.trim().length !== 0) { return false; } } return true; } mapClick(item: ControllerScheduleDetailDto, routeCode: string, driverName: string, driverPage: boolean, isDeliveryCode: boolean ){ this.spinnerService.show(); this._driverProximityServiceProxys.getDriverProximityDetails(item.id, this.locationId, isDeliveryCode) .subscribe(result => { if(result!=null){ this.viewDriverProximitiesMapModal.show(result, routeCode, driverName, driverPage); this.spinnerService.hide(); } }); } }