multiple bugfixes from 20 Apr 2020 to 7 jan 2023

This commit is contained in:
Pranav 2023-01-07 17:09:46 +00:00
parent 902e04c7e6
commit 63d062c4a7
122 changed files with 13163 additions and 12361 deletions

View file

@ -420,7 +420,8 @@ console.log("2->",newContact2);
last_name: this.last_name, last_name: this.last_name,
password: this.passwordd, password: this.passwordd,
org_name: this.org_name, org_name: this.org_name,
email: this.emaill, email: this.emaill == null?'':this.emaill,
phone : this.phone == null?'':this.phone,
expdate : new Date(expDate).toISOString(), expdate : new Date(expDate).toISOString(),
supAdmin:this.sup_admin, supAdmin:this.sup_admin,
isDealer: false, isDealer: false,

View file

@ -1,163 +1,3 @@
<!-- <app-all-menus></app-all-menus>
<div class="small">
<button md-button [mdMenuTriggerFor]="menu" style="padding:0%;"><i class="material-icons">list</i></button>
<md-menu #menu="mdMenu">
<a href="#">
<h6>DASHBOARD
<md-icon style="float:right">dashboard</md-icon>
</h6>
</a>
<a href="#">
<h6>RULES<md-icon style="float:right">dock</md-icon>
</h6>
</a>
</md-menu>
</div>
<div style="float:left; width: 100%;padding-top: 6%;">
<p class="headStyle">{{'Customers' | translate}}</p>
<p *ngIf="errorMsg" style="text-align: center">{{serviceResponse}}</p>
<div class="loading" *ngIf="Load">Loading&#8230;</div>
<div id="toast">
<div id="desc">{{data_descip}}</div>
</div>
<div class="row">
<div class="col-sm-4">
<button *ngIf="(dealer_Permission === true) || (superAdmin === true) || adbtn" mdTooltip="{{'Add customer' | translate}}" style="border:1px solid transparent; background-color: transparent;margin-top:8px;cursor:pointer" (click)="openDialog()">
<md-icon style="float: right;width:30px;height:30px;cursor:pointer">add</md-icon>
</button>
<a *ngIf="showNav" href="https://youtu.be/dg1zd2geHXA" style="cursor: pointer;color:black" title="Video tutorial"
target="_blank">
<md-icon class="material-icons" style="font-size: 30px"> theaters </md-icon>
</a>
</div>
<div class="col-sm-8" style="padding-left: 41%;padding-top: 1%;">
<input style="border-radius: 6px;
border: 1px solid #c7c7c7;
border-bottom: 0px;
padding: 12px;
width: 175px;
/* margin-right: 22%; */
height: 7px;
background-color: red;
font-size: 12px;
float: left;
margin-top: 0;
background: #fffcfc;" type="search" class="form-control" id="myInput" name="myInput" [(ngModel)]="myInput"
placeholder="{{'Customer Search' | translate}}" (ngModelChange)="searchFilter($event)" />
<button [disabled]="lastcall" (click)="pre()" style="margin-left: 10px;">
< {{'Previous' | translate}} </button> <button [disabled]="firstcall" (click)="next()"> {{'Next' | translate}} >
</button>
</div>
</div>
<div class="scrollbar" style="overflow:overlay;">
<table id="myTable" class="table table-striped" style="overflow-y: hidden;
overflow-x: hidden;font-size:12px">
<thead style="background-color:#A2C523;color: white;">
<tr>
<th>{{'User ID' | translate}}</th>
<th>{{'Name' | translate}}</th>
<th>{{'Dealer' | translate}}</th>
<th>{{'Email ID' | translate}}</th>
<th>{{'Phone Number' | translate}}</th>
<th>{{'Password' | translate}}</th>
<th>{{'Total Vehicle' | translate}}</th>
<th>{{'Deleted Vehicle' | translate}}</th>
<th>{{'Created On' | translate}}</th>
<th>{{'Expire On' | translate}}</th>
<th>{{'Token' | translate}}</th>
<th>{{'Last activity' | translate}}</th>
<th>{{'Last login' | translate}}</th>
<th>{{'Login type' | translate}}</th>
<th>{{'Documents' | translate}}</th>
<th>{{'Edit' | translate}}</th>
<th *ngIf="((custtype == true)||(superAdmin == true))">{{'Report Setting' | translate}}</th>
<th *ngIf="((custtype == true)||(superAdmin == true))">{{'Dashboard Column' | translate}}</th>
<th>{{'Delete' | translate}}</th>
<th>{{'Customer Status' | translate}}</th>
<th>{{'Customer Info' | translate}}</th>
<th>{{'Reset Password' | translate}}</th>
<th>{{'Add Point' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let cust_array of custumer">
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.user_id?cust_array.user_id:'NA'}}
</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.first_name}} {{cust_array.last_name}}
</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.DealerDetails[0].first_name}}
{{cust_array.DealerDetails[0].last_name}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.email}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.phone}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.pass?cust_array.pass:'NA'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.total_vehicle}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.delDevices}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.created_on |date:'dd/MM/yyyy'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.expire_date|date:'dd/MM/yyyy'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">
{{cust_array.notificationTokenCount ?cust_array.notificationTokenCount :0}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">
{{cust_array.last_activity_on|date:'dd/MM/yyyy, h:mm:ss a'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">
{{cust_array.last_login|date:'dd/MM/yyyy, h:mm:ss a'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">
{{cust_array.login_type?cust_array.login_type:"NA"}}</td>
<td>
<p><button md-tooltip="View/Download"
style="border:1px solid transparent; background-color: transparent;float:right"
(click)="viewDocuments(cust_array)">
<md-icon>library_books</md-icon>
</button></p>
</td>
<td>
<p><button md-tooltip="Edit" style="border:1px solid transparent; background-color: transparent;float:right"
(click)="edit_costumerDetail(cust_array)">
<md-icon>edit</md-icon>
</button></p>
</td>
<td *ngIf="((custtype == true)||(superAdmin == true))">
<p><button md-tooltip="Report Setting"
style="border:1px solid transparent; background-color: transparent;float:right"
(click)="reportSetting(cust_array)">
<md-icon>calendar_today</md-icon>
</button></p>
</td>
<td *ngIf="((custtype == true)||(superAdmin == true))">
<img src="assets/image/customised_table.png" alt="Customise Table Content" height="25" width="25" style="cursor: pointer;" title="Customise Table Content" (click)="custom_table(cust_array)">
</td>
<td>
<p><button md-tooltip="Delete"
style="border:1px solid transparent; background-color: transparent;float:right"
(click)="delete_costumerDetail(cust_array)">
<md-icon>delete</md-icon>
</button></p>
</td>
<td style="padding-top:20px">
<md-slide-toggle [(ngModel)]="cust_array.status" ngDefaultControl (change)="onChange(cust_array,$event)">
</md-slide-toggle>
</td>
<td style="padding-top:18px">
<i class="fas fa-sign-in-alt" style="cursor: pointer;font-size: 22px;" title="Send Login Credentials" (click)="shareUserCredential(cust_array)"></i>
</td>
<td style="padding-top:18px">
<img src="assets/image/reset_password.png" alt="reset_password" height="25" width="25" style="cursor: pointer;" title="Reset password" (click)="resetPassword(cust_array)">
</td>
<td>
<i id="pointShare" style="cursor:pointer;font-size: 20px;margin-top: 12px;" class="fas fa-coins" (click)="addPoints(cust_array)"></i>
</td>
</tr>
</tbody>
</table>
</div>
</div> -->
<div class="limiter"> <div class="limiter">
<app-all-menus></app-all-menus> <app-all-menus></app-all-menus>
@ -269,7 +109,7 @@
</div> --> </div> -->
<!-- <p style="width:100%;text-align: center;align-items: center;background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)">Dealers</p> --> <!-- <p style="width:100%;text-align: center;align-items: center;background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)">Dealers</p> -->
<div class="table100 ver1"> <div class="table100 ver1">
<div class="table100-firstcol"> <!-- <div class="table100-firstcol">
<table id='customerTable'> <table id='customerTable'>
<thead> <thead>
<tr class="row100 head"> <tr class="row100 head">
@ -290,8 +130,8 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div> -->
<div class="wrap-table100-nextcols js-pscroll" style="height: 660px"> <div class="1wrap-table100-nextcols js-pscroll" style="height: 660px">
<div class="table100-nextcols"> <div class="table100-nextcols">
<table> <table>
<thead> <thead>
@ -299,6 +139,12 @@
<th <th
class="cell100 column2" class="cell100 column2"
style="font-weight: 600; background: #add8e6" style="font-weight: 600; background: #add8e6"
>
{{ "NAME" | translate }}
</th>
<th
class="cell100 column2"
style="font-weight: 600; background: #add8e6"
> >
{{ "USER ID" | translate }} {{ "USER ID" | translate }}
</th> </th>
@ -326,77 +172,6 @@
> >
{{ "PASSWORD" | translate }} {{ "PASSWORD" | translate }}
</th> </th>
<!-- <th
class="cell100 column7"
style="font-weight: 600; background: #add8e6"
>
{{ "TOTAL VEHICLES" | translate }}
</th>
<th
class="cell100 column8"
style="font-weight: 600; background: #add8e6"
>
{{ "DELETED VEHICLES" | translate }}
</th>
<th
class="cell100 column9"
style="font-weight: 600; background: #add8e6"
>
{{ "CREATED ON" | translate }}
</th>
<th
class="cell100 column10"
style="font-weight: 600; background: #add8e6"
>
{{ "EXPIRES ON" | translate }}
</th>
<th
class="cell100 column11"
style="font-weight: 600; background: #add8e6"
>
{{ "TOKEN" | translate }}
</th>
<th
class="cell100 column12"
style="font-weight: 600; background: #add8e6"
>
{{ "LAST ACTIVITY" | translate }}
</th>
<th
class="cell100 column13"
style="font-weight: 600; background: #add8e6"
>
{{ "LAST LOGIN" | translate }}
</th>
<th
class="cell100 column14"
style="font-weight: 600; background: #add8e6"
>
{{ "LOGIN TYPE" | translate }}
</th>
<th
class="cell100 column12"
style="font-weight: 600; background: #add8e6"
>
{{ "ALLOCATED POINTS" | translate }}
</th>
<th class="cell100 column15" style="
text-align: center;
font-weight: 600;
background: #add8e6;
">
{{ "KYC Status" | translate }}
</th>
<th
class="cell100 column15"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "DOCUMENTS" | translate }}
</th> -->
<th <th
class="cell100 column16" class="cell100 column16"
style=" style="
@ -407,28 +182,6 @@
> >
{{ "EDIT" | translate }} {{ "EDIT" | translate }}
</th> </th>
<!-- <th
class="cell100 column17"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
*ngIf="custtype == true || superAdmin == true"
>
{{ "USER SETTINGS" | translate }}
</th>
<th
class="cell100 column18"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
*ngIf="custtype == true || superAdmin == true"
>
{{ "DASHBOARD COLUMNS" | translate }}
</th> -->
<th <th
class="cell100 column19" class="cell100 column19"
style=" style="
@ -439,74 +192,14 @@
> >
{{ "DELETE" | translate }} {{ "DELETE" | translate }}
</th> </th>
<!-- <th
class="cell100 column20"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "CUSTOMER STATUS" | translate }}
</th>
<th
class="cell100 column21"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "CUSTOMER INFO" | translate }}
</th>
<th
class="cell100 column22"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "RESTET PASSWORD" | translate }}
</th>
<th
class="cell100 column23"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "SUSPEND ACCOUNT" | translate }}
</th>
<th
class="cell100 column23"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "ADMIN ALERT" | translate }}
</th>
<th *ngIf="custtype" class="cell100 column23" style="
text-align: center;
font-weight: 600;
background: #add8e6;
">
{{ "DEALER ALERT" | translate }}
</th>
<th class="cell100 column23" style="
text-align: center;
font-weight: 600;
background: #add8e6;
">
{{ "Pull Data" | translate }}
</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="row100 body" *ngFor="let cust_array of custumer"> <tr class="row100 body" *ngFor="let cust_array of custumer">
<td class="cell100 column1" (click)="viewCustomerDetails(cust_array)">
<a style=" cursor: pointer;color: #000000bf;text-decoration: underline;"> <strong> {{ cust_array.first_name ? cust_array.first_name : "" }}
{{ cust_array.last_name ? cust_array.last_name : "" }}</strong> </a>
</td>
<td <td
class="cell100 column2" class="cell100 column2"
style="cursor: pointer" style="cursor: pointer"
@ -551,99 +244,6 @@
> >
{{ cust_array.pass ? cust_array.pass : "NA" }} {{ cust_array.pass ? cust_array.pass : "NA" }}
</td> </td>
<!-- <td
class="cell100 column7"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.total_vehicle }}
</td>
<td
class="cell100 column8"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.delDevices }}
</td>
<td
class="cell100 column9"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.created_on | date: "dd/MM/yyyy" }}
</td>
<td
class="cell100 column10"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.expire_date | date: "dd/MM/yyyy" }}
</td>
<td
class="cell100 column11"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{
cust_array.notificationTokenCount
? cust_array.notificationTokenCount
: 0
}}
</td>
<td
class="cell100 column12"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{
cust_array.last_activity_on
| date: "dd/MM/yyyy, h:mm:ss a"
}}
</td>
<td
class="cell100 column13"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.last_login | date: "dd/MM/yyyy, h:mm:ss a" }}
</td>
<td
class="cell100 column14"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.login_type ? cust_array.login_type : "NA" }}
</td>
<td
class="cell100 colu mn14"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{
cust_array.point_Allocated
? cust_array.point_Allocated
: 0
}}
</td>
<td class="cell100 column15" style="cursor: pointer; text-align: center">
<button class="btn btn-warning btn-sm" style="border-radius: 40px; font-size: x-small; background-color: orange;"
*ngIf="cust_array.kycStatus==undefined">Pending</button>
<button class="btn btn-warning btn-sm" style="border-radius: 40px; font-size: x-small; background-color: orange;" *ngIf="cust_array.kycStatus=='Pending'">{{cust_array.kycStatus}}</button>
<button class="btn btn-success btn-sm" style="border-radius: 40px; font-size: x-small; background-color: green;" *ngIf="cust_array.kycStatus=='Approved'">{{cust_array.kycStatus}}</button>
<button class="btn btn-danger btn-sm" style="border-radius: 40px; font-size: x-small; background-color: red;" *ngIf="cust_array.kycStatus=='Reject'">{{cust_array.kycStatus}}</button>
</td>
<td
class="cell100 column15"
style="cursor: pointer; text-align: center"
>
<i
class="far fa-folder-open"
md-tooltip="View/Download"
style="cursor: pointer"
(click)="viewDocuments(cust_array)"
></i>
</td> -->
<td class="cell100 column16" style="text-align: center"> <td class="cell100 column16" style="text-align: center">
<i <i
class="far fa-edit" class="far fa-edit"
@ -652,31 +252,6 @@
(click)="edit_costumerDetail(cust_array)" (click)="edit_costumerDetail(cust_array)"
></i> ></i>
</td> </td>
<!-- <td
class="cell100 column17"
*ngIf="custtype == true || superAdmin == true"
style="text-align: center"
>
<i
class="fas fa-sort-alpha-down"
md-tooltip="User Setting"
style="cursor: pointer"
(click)="reportSetting(cust_array)"
></i>
</td>
<td
class="cell100 column18"
*ngIf="custtype == true || superAdmin == true"
style="text-align: center"
>
<i
class="fas fa-columns"
md-tooltip="Customise Table Content"
style="cursor: pointer"
(click)="custom_table(cust_array)"
></i>
</td> -->
<td class="cell100 column19" style="text-align: center"> <td class="cell100 column19" style="text-align: center">
<i <i
class="fas fa-trash-alt" class="fas fa-trash-alt"
@ -686,55 +261,6 @@
></i> ></i>
</td> </td>
<!-- <td class="cell100 column20" style="text-align: center">
<md-slide-toggle
[(ngModel)]="cust_array.status"
style="height: 0px !important"
ngDefaultControl
ngDefaultControl
(change)="onChange(cust_array, $event)"
></md-slide-toggle>
</td>
<td class="cell100 column21" style="text-align: center">
<i
class="fas fa-sign-in-alt"
title="Send Login Credentials"
(click)="shareUserCredential(cust_array)"
></i>
</td>
<td class="cell100 column22" style="text-align: center">
<i
class="fas fa-unlock-alt"
title="Reset Password"
(click)="resetPassword(cust_array)"
></i>
</td>
<td class="cell100 column20" style="text-align: center">
<md-slide-toggle
[(ngModel)]="cust_array.accountSuspended"
style="height: 0px !important"
ngDefaultControl
(change)="accountStatusOnChange(cust_array, $event)"
></md-slide-toggle>
</td>
<td class="column20" style="text-align: center">
<md-slide-toggle
[(ngModel)]="cust_array.adminAlert"
style="height: 0px !important"
ngDefaultControl
(change)="alertStatus($event, cust_array)"
></md-slide-toggle>
</td>
<td *ngIf="custtype" class="column20" style="text-align: center">
<md-slide-toggle [(ngModel)]="cust_array.dealerAlert" style="height: 0px !important" ngDefaultControl
(change)="dealerAlert($event, cust_array)"></md-slide-toggle>
</td>
<td class="column20" style="text-align: center">
<md-slide-toggle [checked]="cust_array.pullData?cust_array.pullData:false" style="height: 0px !important" ngDefaultControl
(change)="generatePullData($event, cust_array)"></md-slide-toggle>
</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -310,6 +310,7 @@ export class AddComponent implements OnInit {
vewdev(id) { vewdev(id) {
console.log(id); console.log(id);
localStorage.setItem("custId", id); localStorage.setItem("custId", id);
localStorage.setItem("addDev", 'yes');
localStorage.removeItem("in1"); localStorage.removeItem("in1");
this.selectedlanguage = localStorage.getItem('appLang'); this.selectedlanguage = localStorage.getItem('appLang');
this.translate.setDefaultLang(this.selectedlanguage); this.translate.setDefaultLang(this.selectedlanguage);
@ -333,7 +334,6 @@ export class AddComponent implements OnInit {
// localStorage.setItem('Dealer',"OFF"); // localStorage.setItem('Dealer',"OFF");
// localStorage.setItem('superadmin',"OFF") // localStorage.setItem('superadmin',"OFF")
console.log('this.superAdmin',this.superAdmin); console.log('this.superAdmin',this.superAdmin);
debugger;
if(this.superAdmin === true){ if(this.superAdmin === true){
localStorage.setItem('supAdminAcessToCust', 'true' ); localStorage.setItem('supAdminAcessToCust', 'true' );
} }

View file

@ -23,6 +23,7 @@ export class ReportSettingComponent implements OnInit {
{name:"Door",dash_column:false,value:"door_column"}, {name:"Door",dash_column:false,value:"door_column"},
{name :"Temperature",dash_column:false,value:"temp_column"}, {name :"Temperature",dash_column:false,value:"temp_column"},
{name :"Charging status",dash_column:false,value:"charging_column"}, {name :"Charging status",dash_column:false,value:"charging_column"},
{ name: "Address", dash_column: false, value: "address" },
]; ];
reportArray = [ reportArray = [
@ -169,9 +170,9 @@ export class ReportSettingComponent implements OnInit {
// arr[0].dash_column = d_column[dt].dash_column; // arr[0].dash_column = d_column[dt].dash_column;
// this.dashboard_column[dt].dash_column = d_column[dt] ; // this.dashboard_column[dt].dash_column = d_column[dt] ;
arr1[0].dash_column = d_column[dt] ; arr1[0].dash_column = d_column[dt] ? d_column[dt]:false ;
console.log('d_column[dt]',d_column[dt]) console.log('d_column[dt]', d_column[dt] ? d_column[dt] : false)
// arr[0].Astatus = tempReport[dt].Astatus; // arr[0].Astatus = tempReport[dt].Astatus;
} }
console.log("that.reportArray=>",that.reportArray); console.log("that.reportArray=>",that.reportArray);

View file

@ -49,7 +49,7 @@
<a *ngIf="superAdmin || custtype" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" (click)="deviceMaster('admin')">{{'Device Master' | translate}}</a> <a *ngIf="superAdmin || custtype" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" (click)="deviceMaster('admin')">{{'Device Master' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="showIMEI" (click)="imeiFind('admin')">{{'IMEI Finder' | translate}}</a> <a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="showIMEI" (click)="imeiFind('admin')">{{'IMEI Finder' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || isOperator" (click)="deviceInventoryList('admin')">{{'Inventory List' | translate}}</a> <a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || isOperator" (click)="deviceInventoryList('admin')">{{'Inventory List' | translate}}</a>
<li class="dropdown-submenu dropdown_style"> <li class="dropdown-submenu dropdown_style" *ngIf="superAdmin || custtype ">
<a class="nav-link dropdown-toggle" <a class="nav-link dropdown-toggle"
style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"
data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span
@ -71,7 +71,7 @@
(click)="issueList('admin')">{{'Issue List' | translate}}</a> (click)="issueList('admin')">{{'Issue List' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || custtype" (click)="messageUtility('admin')">{{'Message Utility' | translate}}</a> <a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || custtype" (click)="messageUtility('admin')">{{'Message Utility' | translate}}</a>
<li class="dropdown-submenu dropdown_style"> <li class="dropdown-submenu dropdown_style" *ngIf="superAdmin">
<a class="nav-link dropdown-toggle" <a class="nav-link dropdown-toggle"
style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"
data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span
@ -89,6 +89,28 @@
</ul> </ul>
</li> </li>
<li class="dropdown-submenu dropdown_style" *ngIf="showIMEI">
<a class="nav-link dropdown-toggle"
style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"
data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span
style="margin-left: 13px;">Transfer</span></a>
<ul class="dropdown-menu dropdown_style">
<li class="dropdown_style" (click)="deviceSetting('admin')"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'Device' | translate}}</a>
</li>
<li class="dropdown_style" (click)="userSetting('admin')"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'User' | translate}}</a>
</li>
<!-- <a *ngIf="showIMEI" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" >{{'Device Setting' | translate}}</a> -->
<!-- <a class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
*ngIf="showIMEI" (click)="userSetting('admin')">{{'User Setting' | translate}}</a> -->
</ul>
</li>
<!-- <a *ngIf="superAdmin" class="dropdown-item" <!-- <a *ngIf="superAdmin" class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
(click)="modelMaster('admin')">{{'Model Master' | translate}}</a> --> (click)="modelMaster('admin')">{{'Model Master' | translate}}</a> -->
@ -98,10 +120,11 @@
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
*ngIf="superAdmin" (click)="RTOMaster('admin')">{{'RTO Master' | translate}}</a> --> *ngIf="superAdmin" (click)="RTOMaster('admin')">{{'RTO Master' | translate}}</a> -->
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="tutorialVideos('admin')">{{'Tutorial Videos' | translate}}</a> <a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin && urlspecifc" (click)="tutorialVideos('admin')">{{'Tutorial Videos' | translate}}</a>
<a class="dropdown-item" <a class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
*ngIf="showIMEI" (click)="userFinder('admin')">{{'User Finder' | translate}}</a> *ngIf="showIMEI" (click)="userFinder('admin')">{{'User Finder' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="userMaster('admin')">{{'User Master' | translate}}</a> <a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="userMaster('admin')">{{'User Master' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || custtype" (click)="VType('admin')">{{'Vehicle Type' | translate}}</a> <a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || custtype" (click)="VType('admin')">{{'Vehicle Type' | translate}}</a>

View file

@ -37,6 +37,7 @@ import { ContactService } from '../contact.service';
import { TranslateService } from 'ng2-translate'; import { TranslateService } from 'ng2-translate';
import { MdDialog } from '@angular/material'; import { MdDialog } from '@angular/material';
import { DemoVideosComponent } from '../const/demo-videos/demo-videos.component'; import { DemoVideosComponent } from '../const/demo-videos/demo-videos.component';
import { DatainjectionService } from '../datainjection.service';
// import { PoiListComponent } from '../poi-list/poi-list.component'; // import { PoiListComponent } from '../poi-list/poi-list.component';
// import { PoiDtlDelComponent } from "../poi-dtl-del/poi-dtl-del.component"; // import { PoiDtlDelComponent } from "../poi-dtl-del/poi-dtl-del.component";
// import { MdDialog } from '@angular/material'; // import { MdDialog } from '@angular/material';
@ -110,7 +111,7 @@ export class AllMenusComponent implements OnInit {
adressTab: boolean=false; adressTab: boolean=false;
phone: any; phone: any;
// ,public dialog: MdDialog // ,public dialog: MdDialog
constructor(public dialog: MdDialog,private router: Router, private route: ActivatedRoute, private contactService: ContactService,public translate: TranslateService) { constructor(private _DatainjectionService: DatainjectionService,public dialog: MdDialog,private router: Router, private route: ActivatedRoute, private contactService: ContactService,public translate: TranslateService) {
this.contactService.totalTicketCount.subscribe(totalTicketCount => { this.contactService.totalTicketCount.subscribe(totalTicketCount => {
// this.ticketCount = totalTicketCount // this.ticketCount = totalTicketCount
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id; this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
@ -146,7 +147,15 @@ export class AllMenusComponent implements OnInit {
menuWidth:any; menuWidth:any;
sup_admin:boolean; sup_admin:boolean;
isOrgnaisation:boolean=false; isOrgnaisation:boolean=false;
urlspecifc:boolean =false;
ngOnInit() { ngOnInit() {
let domainName = window.location.host;
console.log(domainName, 'domainName');
if (domainName.indexOf('oneqlik') >= 0 || domainName.indexOf('localhost') >= 0) {
this.urlspecifc = true
} else {
this.urlspecifc = false;
}
// console.log("Inside all app menu component---------------------------------------------"); // console.log("Inside all app menu component---------------------------------------------");
// this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin; // this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
if(localStorage.getItem('superadmin')=="ON"){ if(localStorage.getItem('superadmin')=="ON"){
@ -164,6 +173,7 @@ export class AllMenusComponent implements OnInit {
// this.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email; // this.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName; this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin; this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.isOrganisation = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isOrganisation; this.isOrganisation = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isOrganisation;
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn; this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
// // this.routePath = JSON.parse(localStorage.getItem('routeData')); // // this.routePath = JSON.parse(localStorage.getItem('routeData'));
@ -188,7 +198,7 @@ export class AllMenusComponent implements OnInit {
} }
this._DatainjectionService.refreshConnection();
// console.log("this.reportPrefrecne=>",this.reportPrefrecne); // console.log("this.reportPrefrecne=>",this.reportPrefrecne);
@ -706,6 +716,7 @@ fuel_report(id){
logout() { logout() {
window.localStorage.clear(); window.localStorage.clear();
this._DatainjectionService.closeConnection();
this.router.navigateByUrl("login"); this.router.navigateByUrl("login");
} }
@ -914,4 +925,10 @@ getLanguage(){
toll(){ toll(){
this.router.navigate(['/toll']) this.router.navigate(['/toll'])
} }
deviceSetting(id){
this.router.navigate(['/device-setting'])
}
userSetting(id) {
this.router.navigate(['/user-setting'])
}
} }

View file

@ -112,7 +112,7 @@ console.log(token);
} }
} }
this.contactService.dealerInfo(this.url).subscribe( this.contactService.dealerInfo(this.url == 'localhost:4200' ?'oneqlik.in':this.url ).subscribe(
data => { data => {
this.userData = data this.userData = data

View file

@ -278,6 +278,8 @@ import { AddNewDeviceComponent } from './dashboard/add-new-device/add-new-device
import { ViewCertificateComponent } from './dashboard/view-certificate/view-certificate.component'; import { ViewCertificateComponent } from './dashboard/view-certificate/view-certificate.component';
import { NewEditDeviceComponent } from './dashboard/new-edit-device/new-edit-device.component'; import { NewEditDeviceComponent } from './dashboard/new-edit-device/new-edit-device.component';
import { DownloadCertificateComponent } from './dashboard/download-certificate/download-certificate.component'; import { DownloadCertificateComponent } from './dashboard/download-certificate/download-certificate.component';
import { DeviceSettingComponent } from './device-setting/device-setting.component';
import { UserSettingComponent } from './user-setting/user-setting.component';
// import { DisatanceReportComponent } from './report/disatance-report/disatance-report.component'; // import { DisatanceReportComponent } from './report/disatance-report/disatance-report.component';
// import { MainComponent } from './report/main/main.component'; // import { MainComponent } from './report/main/main.component';
// import { AcReportsComponent } from './report/ac-report/ac-report.component'; // import { AcReportsComponent } from './report/ac-report/ac-report.component';
@ -537,6 +539,8 @@ export function createTranslateLoader(http: Http) {
ViewCertificateComponent, ViewCertificateComponent,
NewEditDeviceComponent, NewEditDeviceComponent,
DownloadCertificateComponent, DownloadCertificateComponent,
DeviceSettingComponent,
UserSettingComponent,
// LiveTrackingComponent, // LiveTrackingComponent,
// MainComponent, // MainComponent,
// DisatanceReportComponent, // DisatanceReportComponent,

View file

@ -207,6 +207,9 @@ import { AddNewDeviceComponent } from './dashboard/add-new-device/add-new-device
// import { AcReportComponent } from './device-report/ac-report/ac-report.component'; // import { AcReportComponent } from './device-report/ac-report/ac-report.component';
import { FuelReportComponent } from './device-report/fuel-report/fuel-report.component'; import { FuelReportComponent } from './device-report/fuel-report/fuel-report.component';
import { NewEditDeviceComponent } from './dashboard/new-edit-device/new-edit-device.component'; import { NewEditDeviceComponent } from './dashboard/new-edit-device/new-edit-device.component';
import { DeviceSettingComponent } from './device-setting/device-setting.component';
import { UserSettingComponent } from './user-setting/user-setting.component';
import { CurrentPositionReportComponent } from './report/report component/current-position/current-position.component';
// import { DeviceFuelReportComponent } from './device-report/device-fuel-report/device-fuel-report.component'; // import { DeviceFuelReportComponent } from './device-report/device-fuel-report/device-fuel-report.component';
// import { DeviceSOSreportComponent } from './device-report/device-sosreport/device-sosreport.component'; // import { DeviceSOSreportComponent } from './device-report/device-sosreport/device-sosreport.component';
// import { TripByDeviceComponent } from './device-report/trip-by-device/trip-by-device.component'; // import { TripByDeviceComponent } from './device-report/trip-by-device/trip-by-device.component';
@ -421,6 +424,10 @@ export const router: Routes =[
path: 'daily_report', // child route path path: 'daily_report', // child route path
component: DailyReportComponent, component: DailyReportComponent,
}, },
{
path: 'current_position', // child route path
component: CurrentPositionReportComponent,
},
{ {
path: 'daily_logs', path: 'daily_logs',
component: DailyLogssComponent, component: DailyLogssComponent,
@ -553,6 +560,8 @@ export const router: Routes =[
{path:'FuelPrice',component:FuelPriceComponent}, {path:'FuelPrice',component:FuelPriceComponent},
{path:'addFuelPrice',component:AddFuelPriceComponent}, {path:'addFuelPrice',component:AddFuelPriceComponent},
{path:'RTO_Master',component:RtoMasterComponent}, {path:'RTO_Master',component:RtoMasterComponent},
{ path: 'device-setting', component: DeviceSettingComponent },
{ path: 'user-setting', component: UserSettingComponent },
// {path:'routePlanReportNew',component:NewRoutePlanReportComponent}, // {path:'routePlanReportNew',component:NewRoutePlanReportComponent},
{path:'routePlanReportNew',component:RoutPlanReportComponent}, {path:'routePlanReportNew',component:RoutPlanReportComponent},
{path:'ModelMaster',component:ModelMasterComponent}, {path:'ModelMaster',component:ModelMasterComponent},

View file

@ -286,15 +286,15 @@
</td> </td>
<td (click)="vewdev(device.Device_ID,device.Device_Name,device.type_of_device,device.expiration_date,device.last_speed,device.status)">{{device.total_odo <td (click)="vewdev(device.Device_ID,device.Device_Name,device.type_of_device,device.expiration_date,device.last_speed,device.status)">{{device.total_odo
? (device.total_odo | number: '1.2-2' ): 0}}</td> ? (device.total_odo | number: '1.2-2' ): 0}}</td>
<td > <td style="width:200px">
<div style="cursor: pointer;"> <div style="cursor: pointer;">
<!-- title="update Address" (click)="updateAddress(device)" --> <!-- title="update Address" (click)="updateAddress(device)" -->
<!-- <img style="width: 20px;" src='../../assets/image/addressICON.png' (click)=getAddress(device) md-tooltip="Click to get device's last location"> --> <!-- <img style="width: 20px;" src='../../assets/image/addressICON.png' (click)=getAddress(device) md-tooltip="Click to get device's last location"> -->
<div > <div style="text-align: center;" >
<span md-tooltip="Device's last location" *ngIf="device.locationAddress!=null">{{device.locationAddress}}</span> <span style="text-align: center;" md-tooltip="Device's last location" *ngIf="device.locationAddress">{{device.locationAddress}}</span>
<span style="text-align: center;" md-tooltip="Device's last location" *ngIf="device.locationAddress==null"> <span style="text-align: start;" *ngIf="!device.locationAddress">
<img style="width: 20px;" src='../../assets/image/addressICON.png' (click)=getAddress(device) <img style="width: 20px;" src='../../assets/image/addressICON.png' (click)=getAddress(device,true)
md-tooltip="Click to get device's last location"> md-tooltip="Click to get device's last location">
</span> </span>
<i *ngIf="(device.pen)" style="cursor: pointer;color:gray" class="fas fa-pen" title="update Address" (click)="updateAddress(device)"></i> <i *ngIf="(device.pen)" style="cursor: pointer;color:gray" class="fas fa-pen" title="update Address" (click)="updateAddress(device)"></i>

View file

@ -662,6 +662,8 @@ export class ConstComponent implements OnInit {
this.gsm_column = dashboard_content.gsm_column ; this.gsm_column = dashboard_content.gsm_column ;
this.ignition_column = dashboard_content.ignition_column ; this.ignition_column = dashboard_content.ignition_column ;
this.ext_volt = dashboard_content.ext_volt ; this.ext_volt = dashboard_content.ext_volt ;
this.dashboardAddress = dashboard_content.address ? dashboard_content.address:false
console.log('dashboard_content', this.dashboardAddress);
// this.door_column: false // this.door_column: false
// this.temp_column: false // this.temp_column: false
// this.charging_column: false // this.charging_column: false
@ -720,12 +722,12 @@ export class ConstComponent implements OnInit {
} }
this.socket_Ing = this.injectData.getSocket_gps(); //this.socket_Ing = this.injectData.getSocket_gps();
this.socket_Ing.on('connect', function (this) { // this.socket_Ing.on('connect', function (this) {
// console.log("No function") // // console.log("No function")
}); // });
this.modelChanged this.modelChanged
.debounceTime(2000) // wait 300ms after the last event before emitting last event .debounceTime(2000) // wait 300ms after the last event before emitting last event
@ -806,7 +808,7 @@ export class ConstComponent implements OnInit {
this.socket_Ing = this.injectData.getSocket_gps(); //this.socket_Ing = this.injectData.getSocket_gps();
// this.socket_Ing.on('connect', function (this) { // this.socket_Ing.on('connect', function (this) {
@ -1109,15 +1111,20 @@ export class ConstComponent implements OnInit {
// }else{ // }else{
// var milege=(this.deviceData[j].total_odo/100)*(Number(this.deviceData[j].distanceVariation.substring(1))) // var milege=(this.deviceData[j].total_odo/100)*(Number(this.deviceData[j].distanceVariation.substring(1)))
// console.log("MILEGE->",milege,'-',this.deviceData[j].total_odo); // //console.log("MILEGE->",milege,'-',this.deviceData[j].total_odo);
// this.deviceData[j].total_odo=this.deviceData[j].total_odo-milege // this.deviceData[j].total_odo=this.deviceData[j].total_odo-milege
// } // }
// } // }
this.getAddress(this.deviceData[j])
if (this.dashboardAddress){
this.getAddress(this.deviceData[j],false)
} }
console.log('this.deviceData',this.deviceData);
}
//console.log('this.deviceData',this.deviceData);
} }
@ -1214,8 +1221,8 @@ export class ConstComponent implements OnInit {
this.filterId = 'r'; this.filterId = 'r';
clearInterval(this.interval); clearInterval(this.interval);
var a = "RUNNING" var a = "RUNNING"
// console.log(this.skip,this.limit); // //console.log(this.skip,this.limit);
// console.log(this.DealerID); // //console.log(this.DealerID);
var status_1 = false; var status_1 = false;
this.contactService.getDeviceByFilter_dash(a,this.emailid, this.useridd, this.skip, this.limit, this.myInput,this.supAdm,this.DealerID,status_1) this.contactService.getDeviceByFilter_dash(a,this.emailid, this.useridd, this.skip, this.limit, this.myInput,this.supAdm,this.DealerID,status_1)
.subscribe(res => { .subscribe(res => {
@ -1247,21 +1254,21 @@ export class ConstComponent implements OnInit {
} }
getDeviceBYfilterStop(i) { getDeviceBYfilterStop(i) {
console.log("inside function"); //console.log("inside function");
if(i==3){ if(i==3){
this.skip =0; this.skip =0;
} }
this.filterId = 's'; this.filterId = 's';
// console.log(this.skip); // //console.log(this.skip);
clearInterval(this.interval); clearInterval(this.interval);
var a = "STOPPED" var a = "STOPPED"
var status_1 = false; var status_1 = false;
this.contactService.getDeviceByFilter_dash(a,this.emailid, this.useridd, this.skip, this.limit, this.myInput,this.supAdm,this.DealerID,status_1) this.contactService.getDeviceByFilter_dash(a,this.emailid, this.useridd, this.skip, this.limit, this.myInput,this.supAdm,this.DealerID,status_1)
.subscribe(res => { .subscribe(res => {
// console.log("stoppedveh=>",res); // //console.log("stoppedveh=>",res);
for(var i=0 ;i<res.length;i++){ for(var i=0 ;i<res.length;i++){
var a = res.devices[i].Ignition ; var a = res.devices[i].Ignition ;
// console.log(a); // //console.log(a);
} }
@ -1305,7 +1312,7 @@ export class ConstComponent implements OnInit {
var status_1 = false; var status_1 = false;
this.contactService.getDeviceByFilter_dash(a,this.emailid, this.useridd, this.skip, this.limit, this.myInput,this.supAdm,this.DealerID,status_1) this.contactService.getDeviceByFilter_dash(a,this.emailid, this.useridd, this.skip, this.limit, this.myInput,this.supAdm,this.DealerID,status_1)
.subscribe(res => { .subscribe(res => {
// console.log("ourveh=>",res) // //console.log("ourveh=>",res)
this.filtes = res.devices; this.filtes = res.devices;
this.abc(this.filtes); this.abc(this.filtes);
@ -1372,7 +1379,7 @@ export class ConstComponent implements OnInit {
} }
alldev() { alldev() {
// console.log("localstorageComp") // //console.log("localstorageComp")
var retrievedData = localStorage.getItem("devices"); var retrievedData = localStorage.getItem("devices");
var cord = JSON.parse(retrievedData); var cord = JSON.parse(retrievedData);
this.filtes = cord; this.filtes = cord;
@ -1382,7 +1389,7 @@ export class ConstComponent implements OnInit {
selectedlanguage:any selectedlanguage:any
// ----------------new login method------------------------- // ----------------new login method-------------------------
vewdevLogin(id) { vewdevLogin(id) {
console.log(id); //console.log(id);
localStorage.setItem("custId", id); localStorage.setItem("custId", id);
localStorage.removeItem("in1"); localStorage.removeItem("in1");
this.selectedlanguage = localStorage.getItem('appLang'); this.selectedlanguage = localStorage.getItem('appLang');
@ -1391,7 +1398,7 @@ selectedlanguage:any
this.contactService.getcustToken(id).subscribe( this.contactService.getcustToken(id).subscribe(
data => { data => {
// this.devicesss = data // this.devicesss = data
// console.log(this.devicesss) // //console.log(this.devicesss)
window.localStorage['Dealer_token'] = window.localStorage['token'] window.localStorage['Dealer_token'] = window.localStorage['token']
window.localStorage['token'] =data.custumer_token; window.localStorage['token'] =data.custumer_token;
@ -1406,7 +1413,7 @@ selectedlanguage:any
} }
// localStorage.setItem('Dealer',"OFF"); // localStorage.setItem('Dealer',"OFF");
// localStorage.setItem('superadmin',"OFF") // localStorage.setItem('superadmin',"OFF")
console.log('this.superAdmin',this.superAdmin); //console.log('this.superAdmin',this.superAdmin);
// debugger; // debugger;
if(this.superAdmin === true){ if(this.superAdmin === true){
localStorage.setItem('supAdminAcessToCust', 'true' ); localStorage.setItem('supAdminAcessToCust', 'true' );
@ -1418,7 +1425,7 @@ selectedlanguage:any
this.router.navigateByUrl("const?_status=" + "OK"); this.router.navigateByUrl("const?_status=" + "OK");
// console.log('testing', this.useridd); // //console.log('testing', this.useridd);
} }
this.deviceData=[] this.deviceData=[]
this.supAdm=undefined this.supAdm=undefined
@ -1430,7 +1437,7 @@ selectedlanguage:any
} }
vewdev(id, name, type, expDate,lastSpeed,status) { vewdev(id, name, type, expDate,lastSpeed,status) {
// console.log(lastSpeed); // //console.log(lastSpeed);
var exStatus = status.slice(0,7); var exStatus = status.slice(0,7);
if(exStatus === 'Expired'){ if(exStatus === 'Expired'){
@ -1453,7 +1460,7 @@ selectedlanguage:any
vehicleName: name, vehicleName: name,
vehicleType: type vehicleType: type
} }
// console.log("Inside View Dev",dataStatus); // //console.log("Inside View Dev",dataStatus);
if (type == "Tracker") { if (type == "Tracker") {
localStorage.setItem('last_speed',lastSpeed ); localStorage.setItem('last_speed',lastSpeed );
this.router.navigateByUrl("location?_dname=" + name + "_id=" + id); this.router.navigateByUrl("location?_dname=" + name + "_id=" + id);
@ -1473,7 +1480,7 @@ selectedlanguage:any
if(i==0){ if(i==0){
this.skip=0; this.skip=0;
} }
// console.log(this.skip, this.limit); // //console.log(this.skip, this.limit);
this.filterId = '' ; this.filterId = '' ;
if (this.checker == "OK" || this.checker == "ok") { if (this.checker == "OK" || this.checker == "ok") {
@ -1506,7 +1513,7 @@ selectedlanguage:any
}, },
(err) => { (err) => {
if (err) { if (err) {
console.log(err); //console.log(err);
} }
} }
) )
@ -1625,8 +1632,8 @@ selectedlanguage:any
// setInterval(function(){ // setInterval(function(){
for (var y = 0; y < that.final.length; y++) { for (var y = 0; y < that.final.length; y++) {
that.socket_Ing.emit('acc', that.final[y].Device_ID) //that.socket_Ing.emit('acc', that.final[y].Device_ID)
that.socket_Ing.on(that.final[y].Device_ID + 'acc', that.accListener(y, that.final[y])); //that.socket_Ing.on(that.final[y].Device_ID + 'acc', that.accListener(y, that.final[y]));
var d = new Date(); var d = new Date();
var a = d.setHours(0, 0, 0, 0); var a = d.setHours(0, 0, 0, 0);
@ -1634,7 +1641,7 @@ selectedlanguage:any
// console.log('socket function'); // //console.log('socket function');
that.abc(that.total_final); that.abc(that.total_final);
// },(1000*that.setTimeOut.value)) // },(1000*that.setTimeOut.value))
@ -1965,7 +1972,7 @@ selectedlanguage:any
key: string = 'Device_Name'; //set default key: string = 'Device_Name'; //set default
reverse: boolean = false; reverse: boolean = false;
sort(key) { sort(key) {
// console.log(key); // //console.log(key);
this.key = key; this.key = key;
this.reverse = !this.reverse; this.reverse = !this.reverse;
} }
@ -2009,19 +2016,19 @@ selectedlanguage:any
// } // }
locationAddress: any; locationAddress: any;
getAddress(device) { getAddress(device,check) {
var ds = device.status; var ds = device.status;
var exStatus = ds.slice(0,7); var exStatus = ds.slice(0,7);
if(exStatus === 'Expired'){ if(exStatus === 'Expired' && check){
// swal({ swal({
// title: 'Expired', title: 'Expired',
// text: "Renew Your subscription for uninterrupted service", text: "Renew Your subscription for uninterrupted service",
// type: 'warning', type: 'warning',
// showCancelButton: false, showCancelButton: false,
// confirmButtonColor: '#3085d6', confirmButtonColor: '#3085d6',
// confirmButtonText: 'ok' confirmButtonText: 'ok'
// }) })
}else{ }else{
this.lattitude = device.last_location?device.last_location.lat:0; this.lattitude = device.last_location?device.last_location.lat:0;
this.longitude = device.last_location?device.last_location.long:0; this.longitude = device.last_location?device.last_location.long:0;
@ -2031,7 +2038,7 @@ selectedlanguage:any
"long": device.last_location?device.last_location.long:0 "long": device.last_location?device.last_location.long:0
} }
this.contactService.getAddressByApi(latlng_1).subscribe(res=>{ this.contactService.getAddressByApi(latlng_1).subscribe(res=>{
// console.log('addressresponse=>',res); // //console.log('addressresponse=>',res);
if(res.message == "Address not found in databse"){ if(res.message == "Address not found in databse"){
this.addressConversionBygoogleAPI(device); this.addressConversionBygoogleAPI(device);
}else{ }else{
@ -2070,11 +2077,11 @@ selectedlanguage:any
geocoder.geocode(request, function (data, status) { geocoder.geocode(request, function (data, status) {
console.log('request',data); //console.log('request',data);
if (status == google.maps.GeocoderStatus.OK) { if (status == google.maps.GeocoderStatus.OK) {
if (data[0] != null) { if (data[0] != null) {
console.log('request',request); //console.log('request',request);
outerThis.address_show = data[0].formatted_address; outerThis.address_show = data[0].formatted_address;
device.locationAddress = outerThis.address_show; device.locationAddress = outerThis.address_show;
device['pen'] = true; device['pen'] = true;
@ -2099,13 +2106,13 @@ selectedlanguage:any
} }
translateAddressToHindi(device){ translateAddressToHindi(device){
console.log("Device",device); //console.log("Device",device);
// translation // translation
var index=this.deviceData.indexOf(device); var index=this.deviceData.indexOf(device);
console.log("herk",this.deviceData.indexOf(device)) //console.log("herk",this.deviceData.indexOf(device))
this.contactService.addressTranslationInHindi({text:device.locationAddress}).subscribe(res=>{ this.contactService.addressTranslationInHindi({text:device.locationAddress}).subscribe(res=>{
this.deviceData[index].locationAddress=res.translation; this.deviceData[index].locationAddress=res.translation;
console.log(res); //console.log(res);
}) })
@ -2118,9 +2125,9 @@ selectedlanguage:any
"address":address "address":address
} }
this.contactService.saveAdd(addressObj).subscribe(res=>{ this.contactService.saveAdd(addressObj).subscribe(res=>{
console.log(res); //console.log(res);
},err=>{ },err=>{
console.log("couldn't save address"); //console.log("couldn't save address");
}) })
} }
@ -2128,7 +2135,7 @@ selectedlanguage:any
updateAddress(dev){ updateAddress(dev){
console.log(dev); //console.log(dev);
let dialogRef = this.dialog.open(ManualAddressComponent, { let dialogRef = this.dialog.open(ManualAddressComponent, {
width: '600px', width: '600px',
@ -2137,11 +2144,11 @@ selectedlanguage:any
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
if (result == "success") { if (result == "success") {
console.log(result); //console.log(result);
} }
else if (result == "cancel") { else if (result == "cancel") {
console.log(result); //console.log(result);
} }
}); });
@ -2155,7 +2162,7 @@ selectedlanguage:any
next() { next() {
this.lastcall = false; this.lastcall = false;
this.skip += 1; this.skip += 1;
// console.log("skip=>",this.skip); // //console.log("skip=>",this.skip);
if(this.filterId== 'i'){ if(this.filterId== 'i'){
this.getDeviceBYfilterIdle(10); this.getDeviceBYfilterIdle(10);
@ -2188,7 +2195,7 @@ selectedlanguage:any
} }
pre() { pre() {
// console.log(this.skip) // //console.log(this.skip)
if (this.skip > 0) { if (this.skip > 0) {
this.skip -= 1; this.skip -= 1;
this.lastcall = false; this.lastcall = false;
@ -2238,8 +2245,8 @@ selectedlanguage:any
getfuel(device,ind){ getfuel(device,ind){
// console.log(ind); // //console.log(ind);
// console.log(device); // //console.log(device);
// debugger; // debugger;
var show_val = ''; var show_val = '';
if(this.fuelflag == 'l'){ if(this.fuelflag == 'l'){
@ -2275,9 +2282,9 @@ selectedlanguage:any
public ngOnDestroy() { public ngOnDestroy() {
localStorage.setItem('refreshInterval', JSON.stringify(this.setTimeOut.value)); localStorage.setItem('refreshInterval', JSON.stringify(this.setTimeOut.value));
if(this.final){ if(this.final){
for (var e = 0; e < this.final.length; e++) { // for (var e = 0; e < this.final.length; e++) {
this.socket_Ing.removeAllListeners(this.final[e]) // this.socket_Ing.removeAllListeners(this.final[e])
} // }
} }
clearInterval(this.interval); clearInterval(this.interval);
} }
@ -2425,9 +2432,9 @@ selectedlanguage:any
}) })
that.contactService.vehicleUtilization(role,userid).subscribe(res=>{ that.contactService.vehicleUtilization(role,userid).subscribe(res=>{
console.log('resresresresresresres=>',res); //console.log('resresresresresresres=>',res);
var bargraph = res; var bargraph = res;
console.log('bargraph',bargraph.length); //console.log('bargraph',bargraph.length);
if((bargraph.length != 0)&&(bargraph.length != undefined)){ if((bargraph.length != 0)&&(bargraph.length != undefined)){
var varGraphObject = bargraph; var varGraphObject = bargraph;
@ -2502,7 +2509,7 @@ selectedlanguage:any
"options":chartOptions "options":chartOptions
}) })
},err=>{ },err=>{
console.log(err); //console.log(err);
}) })
clearTimeout(tOut); clearTimeout(tOut);
@ -2549,7 +2556,7 @@ selectedlanguage:any
options: optionDonought options: optionDonought
}); });
that.contactService.getExpenseGrapgData(userId).subscribe(res=>{ that.contactService.getExpenseGrapgData(userId).subscribe(res=>{
console.log('resresresresresresres',res); //console.log('resresresresresresres',res);
var expenseData = res ; var expenseData = res ;
var expData = [0,0,0,0,0]; var expData = [0,0,0,0,0];
@ -2568,7 +2575,7 @@ selectedlanguage:any
} }
} }
console.log('expDataexpDataexpDataexpDataexpData',expData); //console.log('expDataexpDataexpDataexpDataexpData',expData);
daugnoutChart_1 = { daugnoutChart_1 = {
datasets: [{ datasets: [{
data:expData, data:expData,
@ -2583,7 +2590,7 @@ selectedlanguage:any
options: optionDonought options: optionDonought
}); });
},err=>{ },err=>{
console.log(err); //console.log(err);
}) })
clearTimeout(tOut2); clearTimeout(tOut2);
},3000) },3000)
@ -2594,7 +2601,12 @@ selectedlanguage:any
var that = this; var that = this;
$( document ).ready(function() { $( document ).ready(function() {
var canvas_1 = <HTMLCanvasElement>document.getElementById("utilisationChart"); var canvas_1 = <HTMLCanvasElement>document.getElementById("utilisationChart");
var ctx_1 = canvas_1.getContext("2d"); var ctx_1;
try {
ctx_1 = canvas_1.getContext("2d");
} catch (error) {
}
var daugnoutChart = { var daugnoutChart = {
datasets: [{ datasets: [{
data: [ data: [
@ -2662,7 +2674,7 @@ selectedlanguage:any
var Uid = this.useridd; var Uid = this.useridd;
this.reminderrr = []; this.reminderrr = [];
this.contactService.getVehicleReminder(Uid).subscribe(res=>{ this.contactService.getVehicleReminder(Uid).subscribe(res=>{
console.log('this.reminderVal',this.reminderVal); //console.log('this.reminderVal',this.reminderVal);
this.reminderrr = res[0]; this.reminderrr = res[0];
var notifString = ''; var notifString = '';
this.notifArr = []; this.notifArr = [];
@ -2676,7 +2688,7 @@ selectedlanguage:any
var rd = moment(this.reminderrr[i].reminder_date).format('lll');; var rd = moment(this.reminderrr[i].reminder_date).format('lll');;
notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd; notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd;
this.notifArr.push(notifString); this.notifArr.push(notifString);
console.log('notifArr',this.notifArr); //console.log('notifArr',this.notifArr);
} }
} }
@ -2691,7 +2703,7 @@ selectedlanguage:any
var rd = moment(this.reminderrr[i].reminder_date).format('lll');; var rd = moment(this.reminderrr[i].reminder_date).format('lll');;
notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd; notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd;
this.notifArr.push(notifString); this.notifArr.push(notifString);
console.log('notifArr',this.notifArr); //console.log('notifArr',this.notifArr);
} }
} }
} }
@ -2706,7 +2718,7 @@ selectedlanguage:any
var rd = moment(this.reminderrr[i].reminder_date).format('lll');; var rd = moment(this.reminderrr[i].reminder_date).format('lll');;
notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd; notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd;
this.notifArr.push(notifString); this.notifArr.push(notifString);
console.log('notifArr',this.notifArr); //console.log('notifArr',this.notifArr);
} }
} }
} }
@ -2720,7 +2732,7 @@ selectedlanguage:any
var rd = moment(this.reminderrr[i].reminder_date).format('lll');; var rd = moment(this.reminderrr[i].reminder_date).format('lll');;
notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd; notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd;
this.notifArr.push(notifString); this.notifArr.push(notifString);
console.log('notifArr',this.notifArr); //console.log('notifArr',this.notifArr);
} }
} }
} if(this.reminderVal == '15daysN'){ } if(this.reminderVal == '15daysN'){
@ -2733,7 +2745,7 @@ selectedlanguage:any
var rd = moment(this.reminderrr[i].reminder_date).format('lll');; var rd = moment(this.reminderrr[i].reminder_date).format('lll');;
notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd; notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd;
this.notifArr.push(notifString); this.notifArr.push(notifString);
console.log('notifArr',this.notifArr); //console.log('notifArr',this.notifArr);
} }
} }
} if(this.reminderVal == '30daysN'){ } if(this.reminderVal == '30daysN'){
@ -2746,18 +2758,18 @@ selectedlanguage:any
var rd = moment(this.reminderrr[i].reminder_date).format('lll');; var rd = moment(this.reminderrr[i].reminder_date).format('lll');;
notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd; notifString = 'Reminder for Vehicle' + ' ' + this.reminderrr[i].device.Device_Name + ' ' +'for' +' '+ this.reminderrr[i].reminder_type +' ' + 'on' +' '+ rd;
this.notifArr.push(notifString); this.notifArr.push(notifString);
console.log('notifArr',this.notifArr); //console.log('notifArr',this.notifArr);
} }
} }
} }
},err=>{ },err=>{
console.log(err); //console.log(err);
}) })
} }
getreminderevent(ev){ getreminderevent(ev){
console.log(ev); //console.log(ev);
this.reminderVal = ev.value; this.reminderVal = ev.value;
this.vehicleReminder(); this.vehicleReminder();
@ -2773,11 +2785,11 @@ selectedlanguage:any
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
if (result == "success") { if (result == "success") {
console.log(result); //console.log(result);
} }
else if (result == "cancel") { else if (result == "cancel") {
console.log(result); //console.log(result);
} }
}); });
@ -2792,8 +2804,8 @@ selectedlanguage:any
billingDetailArr = [{'key' : 'Paid','value' : 0},{'key' : 'Pending','value' : 0}]; billingDetailArr = [{'key' : 'Paid','value' : 0},{'key' : 'Pending','value' : 0}];
VehicleAdded = ['Today','Last Week','Last Month']; VehicleAdded = ['Today','Last Week','Last Month'];
getDeviceCount($event,id){ getDeviceCount($event,id){
console.log($event); //console.log($event);
console.log(id); //console.log(id);
} }
@ -2816,11 +2828,11 @@ selectedlanguage:any
this.contactService.getDeviceCount(role,user_id).subscribe(res=>{ this.contactService.getDeviceCount(role,user_id).subscribe(res=>{
this.totalCount = [{'key' : 'Today','value' : 0},{'key' : 'Week','value' : 0},{'key' : 'Month','value' : 0}]; this.totalCount = [{'key' : 'Today','value' : 0},{'key' : 'Week','value' : 0},{'key' : 'Month','value' : 0}];
this.totalCount = [{'key' : 'Today','value' : res[0].today?res[0].today:0},{'key' : 'Week','value' : res[1].week?res[1].week:0},{'key' : 'Month','value' : res[2]?res[2].month:0}]; this.totalCount = [{'key' : 'Today','value' : res[0].today?res[0].today:0},{'key' : 'Week','value' : res[1].week?res[1].week:0},{'key' : 'Month','value' : res[2]?res[2].month:0}];
console.log(this.totalCount); //console.log(this.totalCount);
},err=>{ },err=>{
console.log(err); //console.log(err);
}) })
} }
@ -2845,7 +2857,7 @@ selectedlanguage:any
this.contactService.getExpiredDeviceCount(role1,user_id1).subscribe(res=>{ this.contactService.getExpiredDeviceCount(role1,user_id1).subscribe(res=>{
this.totalExpiredCount = [{'key' : 'Today','value' : 0},{'key' : 'Week','value' : 0},{'key' : 'Month','value' : 0}]; this.totalExpiredCount = [{'key' : 'Today','value' : 0},{'key' : 'Week','value' : 0},{'key' : 'Month','value' : 0}];
this.totalExpiredCount = [{'key' : 'Today','value' : res[0].today?res[0].today:0},{'key' : 'Week','value' : res[1].week?res[1].week:0},{'key' : 'Month','value' : res[2]?res[2].month:0}]; this.totalExpiredCount = [{'key' : 'Today','value' : res[0].today?res[0].today:0},{'key' : 'Week','value' : res[1].week?res[1].week:0},{'key' : 'Month','value' : res[2]?res[2].month:0}];
console.log(this.totalExpiredCount); //console.log(this.totalExpiredCount);
},err=>{ },err=>{
@ -2874,7 +2886,7 @@ selectedlanguage:any
this.contactService.getRenewDeviceCount(role1,user_id1).subscribe(res=>{ this.contactService.getRenewDeviceCount(role1,user_id1).subscribe(res=>{
this.totalRenewedCount = [{'key' : 'Today','value' : 0},{'key' : 'Week','value' : 0},{'key' : 'Month','value' : 0}]; this.totalRenewedCount = [{'key' : 'Today','value' : 0},{'key' : 'Week','value' : 0},{'key' : 'Month','value' : 0}];
this.totalRenewedCount = [{'key' : 'Today','value' : res[0].today?res[0].today:0},{'key' : 'Week','value' : res[1].week?res[1].week:0},{'key' : 'Month','value' : res[2]?res[2].month:0}]; this.totalRenewedCount = [{'key' : 'Today','value' : res[0].today?res[0].today:0},{'key' : 'Week','value' : res[1].week?res[1].week:0},{'key' : 'Month','value' : res[2]?res[2].month:0}];
console.log(this.totalRenewedCount); //console.log(this.totalRenewedCount);
},err=>{ },err=>{
@ -2909,7 +2921,7 @@ selectedlanguage:any
var api_key = 'AIzaSyA_ycttLXPMfCSSNAfPOsaENPQ85i17lPU'; var api_key = 'AIzaSyA_ycttLXPMfCSSNAfPOsaENPQ85i17lPU';
var apiIdentifier = localStorage.getItem('apiIdentifier'); var apiIdentifier = localStorage.getItem('apiIdentifier');
if(apiIdentifier == null){ if(apiIdentifier == null){
console.log("Inside AppIdentifier"); //console.log("Inside AppIdentifier");
this.contactService.getgoogleApi(this.useridd).subscribe(res=>{ this.contactService.getgoogleApi(this.useridd).subscribe(res=>{
if(res.message != "api key not found"){ if(res.message != "api key not found"){
api_key = res.api_key; api_key = res.api_key;
@ -2938,7 +2950,7 @@ selectedlanguage:any
}) })
}else{ }else{
console.log(apiIdentifier); //console.log(apiIdentifier);
var aCount = localStorage.getItem('apiCOunt'); var aCount = localStorage.getItem('apiCOunt');
if(aCount != '1'){ if(aCount != '1'){
// var script = document.createElement('script'); // var script = document.createElement('script');
@ -2972,14 +2984,14 @@ selectedlanguage:any
if(this.custtype === true){role = 'Dealer' ;} if(this.custtype === true){role = 'Dealer' ;}
var user_id = this.useridd; var user_id = this.useridd;
this.contactService.getDeviceCount1(role,user_id,key,this.skip,this.limit).subscribe(res=>{ this.contactService.getDeviceCount1(role,user_id,key,this.skip,this.limit).subscribe(res=>{
console.log('added deviceList',res); //console.log('added deviceList',res);
this.filtes = res; this.filtes = res;
this.abc(this.filtes); this.abc(this.filtes);
}) })
} }
getExpiredVehList(key){ getExpiredVehList(key){
this.filterId = 'ev'; this.filterId = 'ev';
console.log(this.skip); //console.log(this.skip);
if(key === 'Today'){ if(key === 'Today'){
key='today'; key='today';
this.keyIdentifier = key; this.keyIdentifier = key;
@ -2997,7 +3009,7 @@ selectedlanguage:any
if(this.custtype === true){role = 'Dealer' ;} if(this.custtype === true){role = 'Dealer' ;}
var user_id = this.useridd; var user_id = this.useridd;
this.contactService.getExpiredDeviceCount1(role,user_id,key,this.skip,this.limit).subscribe(res=>{ this.contactService.getExpiredDeviceCount1(role,user_id,key,this.skip,this.limit).subscribe(res=>{
console.log('ExpiredDeviceList',res); //console.log('ExpiredDeviceList',res);
this.filtes = res; this.filtes = res;
this.abc(this.filtes); this.abc(this.filtes);
}) })
@ -3024,7 +3036,7 @@ selectedlanguage:any
if(this.custtype === true){role = 'Dealer' ;} if(this.custtype === true){role = 'Dealer' ;}
var user_id = this.useridd; var user_id = this.useridd;
this.contactService.getRenewDeviceCount1(role,user_id,key,this.skip,this.limit).subscribe(res=>{ this.contactService.getRenewDeviceCount1(role,user_id,key,this.skip,this.limit).subscribe(res=>{
console.log('renewedDeviceList',res); //console.log('renewedDeviceList',res);
this.filtes = res; this.filtes = res;
this.abc(this.filtes); this.abc(this.filtes);
}) })
@ -3035,11 +3047,11 @@ selectedlanguage:any
if (navigator.geolocation) { if (navigator.geolocation) {
// if(location.protocol != 'https:'){ // if(location.protocol != 'https:'){
// this.contactService.getlatLong().subscribe(res=>{ // this.contactService.getlatLong().subscribe(res=>{
// console.log(res); // //console.log(res);
// }) // })
// }else{ // }else{
navigator.geolocation.getCurrentPosition(function(position) { navigator.geolocation.getCurrentPosition(function(position) {
console.log('Position=>',position); //console.log('Position=>',position);
let geocoder = new google.maps.Geocoder(); let geocoder = new google.maps.Geocoder();
var d_lat= position.coords.latitude; var d_lat= position.coords.latitude;
var d_lng=position.coords.longitude; var d_lng=position.coords.longitude;
@ -3055,13 +3067,13 @@ selectedlanguage:any
if (status == google.maps.GeocoderStatus.OK) { if (status == google.maps.GeocoderStatus.OK) {
if (data[0] != null) { if (data[0] != null) {
var address_show = data[0]; var address_show = data[0];
console.log('var=>' ,address_show); //console.log('var=>' ,address_show);
for (var ac = 0; ac < data[0].address_components.length; ac++) { for (var ac = 0; ac < data[0].address_components.length; ac++) {
var component = data[0].address_components[ac]; var component = data[0].address_components[ac];
switch(component.types[0]) { switch(component.types[0]) {
case 'administrative_area_level_1': case 'administrative_area_level_1':
userState = component.long_name; userState = component.long_name;
console.log(userState); //console.log(userState);
break; break;
} }
}; };
@ -3093,9 +3105,9 @@ selectedlanguage:any
} }
getFuelprice(ustate){ getFuelprice(ustate){
console.log(ustate); //console.log(ustate);
this.contactService.getFuelDetail(ustate).subscribe(fuelprice=>{ this.contactService.getFuelDetail(ustate).subscribe(fuelprice=>{
console.log('fuelpricefuelpricefuelprice=>',fuelprice); //console.log('fuelpricefuelpricefuelprice=>',fuelprice);
this.fuelCount=[{ this.fuelCount=[{
fuel : 'Diesel', fuel : 'Diesel',
price: fuelprice[0]?fuelprice[0].diesel:'--', price: fuelprice[0]?fuelprice[0].diesel:'--',
@ -3114,12 +3126,13 @@ selectedlanguage:any
langSymbol:boolean=true; langSymbol:boolean=true;
valueSymbol =''; valueSymbol ='';
fuelShow:boolean=true; fuelShow:boolean=true;
dashboardAddress: boolean = false;
getLanguage(){ getLanguage(){
var that = this; var that = this;
var Var = { uid: this.useridd }; var Var = { uid: this.useridd };
this.contactService.getLanguages(Var).subscribe((res:any)=>{ this.contactService.getLanguages(Var).subscribe((res:any)=>{
console.log('resresresresresresresresresresresresresresresres ',res); //console.log('resresresresresresresresresresresresresresresres ',res);
if(res.timezone != undefined){ if(res.timezone != undefined){
if(res.timezone === 'Asia/Kolkata'){ if(res.timezone === 'Asia/Kolkata'){
this.fuelShow = true; this.fuelShow = true;
@ -3128,7 +3141,6 @@ selectedlanguage:any
} }
} }
var ls = res.currency_code ; var ls = res.currency_code ;
if(ls !=undefined){ if(ls !=undefined){
if(ls === 'INR'){ if(ls === 'INR'){
@ -3141,13 +3153,13 @@ selectedlanguage:any
} }
},err=>{ },err=>{
console.log(err); //console.log(err);
}) })
} }
totalOdo(dev){ totalOdo(dev){
console.log(dev); //console.log(dev);
var from = new Date().setHours(0,0,0); var from = new Date().setHours(0,0,0);
var fd = new Date(from).toISOString(); var fd = new Date(from).toISOString();
var to = new Date(); var to = new Date();
@ -3161,7 +3173,7 @@ selectedlanguage:any
} }
var suburl = "/summary/distance?from=" + fd +'&to=' + td + '&user=' + user_id + '&device=' + imei; var suburl = "/summary/distance?from=" + fd +'&to=' + td + '&user=' + user_id + '&device=' + imei;
this.contactService.get(suburl).subscribe((resp:any) => { this.contactService.get(suburl).subscribe((resp:any) => {
console.log('const ka data =>',resp) //console.log('const ka data =>',resp)
if(resp){ if(resp){
if(resp.length!=0){ if(resp.length!=0){
dev.roadShow=false; dev.roadShow=false;
@ -3169,12 +3181,12 @@ selectedlanguage:any
// if(this.distanceVariation[0]=="+"){ // if(this.distanceVariation[0]=="+"){
// var milege=(a/100)*(Number(this.distanceVariation.substring(1))) // var milege=(a/100)*(Number(this.distanceVariation.substring(1)))
// console.log("MILEGE->",milege,'-',a); // //console.log("MILEGE->",milege,'-',a);
// a=a+milege // a=a+milege
// }else{ // }else{
// var milege=(a/100)*(Number(this.distanceVariation.substring(1))) // var milege=(a/100)*(Number(this.distanceVariation.substring(1)))
// console.log("MILEGE->",milege,'-',a); // //console.log("MILEGE->",milege,'-',a);
// a=a-milege // a=a-milege
// } // }
@ -3201,10 +3213,10 @@ selectedlanguage:any
} }
reload(){ reload(){
window.localStorage['GetDevData'] = 'True' window.localStorage['GetDevData'] = 'True'
// console.log("p1"); // //console.log("p1");
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin; this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.activatedRoute.queryParams.subscribe((params: Params) => { this.activatedRoute.queryParams.subscribe((params: Params) => {
// console.log('p3'); // //console.log('p3');
this.aa = params['_status']; this.aa = params['_status'];
if (this.aa != "OK") { if (this.aa != "OK") {

File diff suppressed because one or more lines are too long

View file

@ -28,7 +28,7 @@
placeholder="Enter Contact number" placeholder="Enter Contact number"
[ngClass]="{ 'is-invalid': submitted && f.contactNo.errors }" [ngClass]="{ 'is-invalid': submitted && f.contactNo.errors }"
/> />
<small *ngIf="message">{{ message }}</small> <small [class.d-none]="!contactMessage">{{contactMessage}}</small>
<div <div
*ngIf="submitted && f.contactNo.errors" *ngIf="submitted && f.contactNo.errors"
class="invalid-feedback" class="invalid-feedback"
@ -41,25 +41,47 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-2">
<label for="inputEmail4">Owner Name</label> <span>*</span> <label for="inputEmail4">Owner First Name</label> <span>*</span>
<input <input
formControlName="ownerName" formControlName="first_name"
type="text" type="text"
class="form-control" class="form-control"
id="inputEmail4" id="inputEmail4"
placeholder="Please Enter Owner Name" placeholder="Enter First Name"
[ngClass]="{ 'is-invalid': submitted && f.ownerName.errors }" [ngClass]="{ 'is-invalid': submitted && f.first_name.errors }"
/> />
<div <div
*ngIf="submitted && f.ownerName.errors" *ngIf="submitted && f.first_name.errors"
class="invalid-feedback" class="invalid-feedback"
> >
<div *ngIf="f.ownerName.errors.required"> <div *ngIf="f.first_name.errors.required">
Owner Name is required Owner First Name is required
</div> </div>
<div *ngIf="f.ownerName.errors.pattern"> <div *ngIf="f.first_name.errors.pattern">
Please enter valid name Please enter valid first name
</div>
</div>
</div>
<div class="form-group col-md-2">
<label for="inputEmail4">Owner Last Name</label> <span>*</span>
<input
formControlName="last_name"
type="text"
class="form-control"
id="inputEmail4"
placeholder="Enter Last Name"
[ngClass]="{ 'is-invalid': submitted && f.last_name.errors }"
/>
<div
*ngIf="submitted && f.last_name.errors"
class="invalid-feedback"
>
<div *ngIf="f.last_name.errors.required">
Owner Last Name is required
</div>
<div *ngIf="f.last_name.errors.pattern">
Please enter valid last name
</div> </div>
</div> </div>
</div> </div>
@ -184,6 +206,7 @@
<input <input
formControlName="device_id" formControlName="device_id"
type="text" type="text"
(keyup)="removeSpecialChar()"
class="form-control" class="form-control"
id="inputCity" id="inputCity"
[ngClass]="{ 'is-invalid': submitted && f.email.errors }" [ngClass]="{ 'is-invalid': submitted && f.email.errors }"
@ -209,6 +232,10 @@
</option> </option>
</select> </select>
</div> </div>
<div *ngIf="invalidEmeiSelected" style="margin-top: 0.25rem;
font-size: .875rem;
color: #dc3545;">This IMEI is already added in system. Please choose different IMEI</div>
<div <div
*ngIf="submitted && f.device_id.errors" *ngIf="submitted && f.device_id.errors"
class="invalid-feedback" class="invalid-feedback"
@ -217,6 +244,7 @@
Device Id is required Device Id is required
</div> </div>
</div> </div>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">

View file

@ -5,6 +5,7 @@ import { FlashMessagesService } from 'angular2-flash-messages';
import { BsDatepickerConfig, BsModalRef, BsModalService } from 'ngx-bootstrap'; import { BsDatepickerConfig, BsModalRef, BsModalService } from 'ngx-bootstrap';
import { ContactService } from '../../contact.service'; import { ContactService } from '../../contact.service';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
import { T } from '../../../../node_modules3/@types/lodash/fp';
declare var $:any; declare var $:any;
declare var swal: any; declare var swal: any;
@Component({ @Component({
@ -15,6 +16,7 @@ declare var swal: any;
export class AddNewDeviceComponent implements OnInit { export class AddNewDeviceComponent implements OnInit {
DeviceModelValue: any; DeviceModelValue: any;
modalRef: BsModalRef; modalRef: BsModalRef;
contactMessage= '';
submitted = false; submitted = false;
date=new Date() date=new Date()
expDate:any = new Date(this.date.getFullYear() + 1, this.date.getMonth(), this.date.getDate()).toLocaleString(); expDate:any = new Date(this.date.getFullYear() + 1, this.date.getMonth(), this.date.getDate()).toLocaleString();
@ -188,7 +190,9 @@ export class AddNewDeviceComponent implements OnInit {
} }
this.deviceForm=this.fb.group({ this.deviceForm=this.fb.group({
ownerName:['',[Validators.required,Validators.pattern("[a-zA-Z][a-zA-Z ]+")]], //ownerName:['',[Validators.required,Validators.pattern("[a-zA-Z][a-zA-Z ]+")]],
first_name: ['', [Validators.required, Validators.pattern("[a-zA-Z][a-zA-Z ]+")]],
last_name: ['', [Validators.required, Validators.pattern("[a-zA-Z][a-zA-Z ]+")]],
contactNo:['',[Validators.required,Validators.pattern('[0-9 ]{10}')]], contactNo:['',[Validators.required,Validators.pattern('[0-9 ]{10}')]],
device_id:[''], device_id:[''],
address:['',Validators.required], address:['',Validators.required],
@ -228,6 +232,7 @@ export class AddNewDeviceComponent implements OnInit {
var that=this var that=this
$(document).on('change','#inventory',function() { $(document).on('change','#inventory',function() {
var value = $('#inventory').val(); var value = $('#inventory').val();
that.checkDeviceEMI(value);
for(var i=0;i<that.inventory.length;i++){ for(var i=0;i<that.inventory.length;i++){
if(value==that.inventory[i].IMEI){ if(value==that.inventory[i].IMEI){
var date=new Date() var date=new Date()
@ -244,6 +249,9 @@ export class AddNewDeviceComponent implements OnInit {
sim1:that.inventory[i].Mob1, sim1:that.inventory[i].Mob1,
sim2:that.inventory[i].Mob2, sim2:that.inventory[i].Mob2,
eSimExpiry:new Date(exp), eSimExpiry:new Date(exp),
trackingExp: new Date(exp),
device_id:value, device_id:value,
}) })
that.vahanID=that.inventory[i]['SerialNo'] that.vahanID=that.inventory[i]['SerialNo']
@ -334,14 +342,14 @@ export class AddNewDeviceComponent implements OnInit {
var expDate = new Date(); var expDate = new Date();
expDate.setFullYear(expDate.getFullYear()+1); expDate.setFullYear(expDate.getFullYear()+1);
var name=this.deviceForm.value.ownerName.split(' ') //var name=this.deviceForm.value.ownerName.split(' ')
var data={ var data={
// Dealer:this.reactiveForm.value.manager, // Dealer:this.reactiveForm.value.manager,
custumer: true, custumer: true,
expdate:new Date(expDate).toISOString(), expdate:new Date(expDate).toISOString(),
first_name:name[0]?name[0]:'', first_name: this.deviceForm.value.first_name ? this.deviceForm.value.first_name:'',
last_name:name[1]?name[1]:'', last_name: this.deviceForm.value.last_name ? this.deviceForm.value.last_name : '',
isDealer: false, isDealer: false,
phone:this.deviceForm.value.contactNo, phone:this.deviceForm.value.contactNo,
user_id:"", user_id:"",
@ -439,6 +447,10 @@ export class AddNewDeviceComponent implements OnInit {
if(this.deviceForm.value.eSimExpiry){ if(this.deviceForm.value.eSimExpiry){
newDevice['esim_validity'] = this.deviceForm.value.eSimExpiry newDevice['esim_validity'] = this.deviceForm.value.eSimExpiry
} }
if (this.deviceForm.value.trackingExp) {
newDevice['expdate'] = this.deviceForm.value.trackingExp
}
if(this.deviceForm.value.model){ if(this.deviceForm.value.model){
@ -569,7 +581,11 @@ export class AddNewDeviceComponent implements OnInit {
} }
} }
removeSpecialChar() {
if (this.deviceForm.value.device_id) {
this.deviceForm.controls.device_id.setValue(this.deviceForm.value.device_id.replaceAll(/[^0-9 ]/g, "").replaceAll(' ', ''));
}
}
generatePassword(passwordLength) { generatePassword(passwordLength) {
var numberChars = "0123456789"; var numberChars = "0123456789";
var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@ -597,7 +613,7 @@ user
userFound:boolean=false; userFound:boolean=false;
onSearchChange(value){ onSearchChange(value){
this.userFound=false this.userFound=false
this.message=undefined this.contactMessage = '';
console.log(value); console.log(value);
var phone=this.deviceForm.value.contactNo var phone=this.deviceForm.value.contactNo
if(phone.length==10){ if(phone.length==10){
@ -606,20 +622,25 @@ onSearchChange(value){
console.log(res); console.log(res);
if(res.message=="User already Present"){ if(res.message=="User already Present"){
this.deviceForm.patchValue({ this.deviceForm.patchValue({
ownerName:res.data[0].first_name?res.data[0].first_name:""+" "+res.data[0].last_name?res.data[0].first_name:'', //ownerName:res.data[0].first_name?res.data[0].first_name:""+" "+res.data[0].last_name?res.data[0].first_name:'',
first_name: res.data[0].first_name ? res.data[0].first_name : "",
last_name: res.data[0].last_name ? res.data[0].last_name : '',
email:res.data[0].email?res.data[0].email:"" email:res.data[0].email?res.data[0].email:""
}) })
this.user=res.data[0] this.user=res.data[0]
this.userFound=true; this.userFound=true;
this.deviceForm.controls.ownerName.disable(); this.deviceForm.controls.first_name.disable();
this.deviceForm.controls.last_name.disable();
this.deviceForm.controls.email.disable(); this.deviceForm.controls.email.disable();
}else{ }else{
this.userFound=false this.userFound=false
this.message=res.message this.contactMessage = res.message
console.log('this.contactMessage', this.contactMessage);
} }
},err=>{ },err=>{
console.log(err); console.log(err);
this.message=err.error.message this.contactMessage=err.error.message
console.log('this.contactMessage err', this.contactMessage);
}) })
} }
@ -693,7 +714,20 @@ onSearchChange(value){
} }
invalidEmeiSelected = false;
checkDeviceEMI(id) {
this.contactService.checkDeviceId(id)
.subscribe(res => {
try {
this.invalidEmeiSelected = res['_body'] != 'No device Found';
} catch (error) {
}
})
}
vehData:any; vehData:any;
getvehDetail(){ getvehDetail(){
this.contactService.getvehType(this.userId) this.contactService.getvehType(this.userId)
@ -709,6 +743,7 @@ getvehDetail(){
this.loadropdown() this.loadropdown()
}) })
} }
docRow:boolean=false; docRow:boolean=false;
// AddDocumentsField(addedRow:any){ // AddDocumentsField(addedRow:any){
// console.log("Inside function !!!"); // console.log("Inside function !!!");

View file

@ -15,12 +15,12 @@
</md-option> </md-option>
</md-select> </md-select>
<h4 style="display: inline-block;">{{'Vehicles' | translate}}</h4> <h4 style="display: inline-block;">{{'Vehicles' | translate}}</h4>
<i style="margin-left: 20px;padding-top: 5px;cursor: pointer;float: left;" title="Add Device" class="fas fa-plus" (click)="adddev()" *ngIf="(bussinessType=='0' || bussinessType==undefined)" ></i> <i style="margin-left: 20px;padding-top: 5px;cursor: pointer;float: left;" title="Add Device" class="fas fa-plus" (click)="adddev()" *ngIf="(showAddButton && (bussinessType=='0' || bussinessType==undefined))" ></i>
<!-- *ngIf="((custtype && ((dealer_Permission == true)||(dealer_Permission === undefined)))||superAdmin) && (bussinessType!=0 || bussinessType==undefined)"></i> --> <!-- *ngIf="((custtype && ((dealer_Permission == true)||(dealer_Permission === undefined)))||superAdmin) && (bussinessType!=0 || bussinessType==undefined)"></i> -->
<!-- (custtype && ((dealer_Permission == true)||(dealer_Permission === undefined)))||superAdmin||adbtn --> <!-- (custtype && ((dealer_Permission == true)||(dealer_Permission === undefined)))||superAdmin||adbtn -->
<i style="margin-left: 20px;padding-top: 5px;cursor: pointer;float: left;" title="Add Device" class="fas fa-plus-circle" (click)="adddevnew()" *ngIf="(bussinessType=='1')"></i> <i style="margin-left: 20px;padding-top: 5px;cursor: pointer;float: left;" title="Add Device" class="fas fa-plus-circle" (click)="adddevnew()" *ngIf="(bussinessType=='1')"></i>
<!-- *ngIf="((custtype && ((dealer_Permission == true)||(dealer_Permission === undefined)))||superAdmin||adbtn) && bussinessType=='1'"></i> --> <!-- *ngIf="((custtype && ((dealer_Permission == true)||(dealer_Permission === undefined)))||superAdmin||adbtn) && bussinessType=='1'"></i> -->
<i style="margin-left: 15px;padding-top: 5px;float: left;" class="fas fa-file-export" title="Export to Excel" (click)="exportExcel()" *ngIf="(bussinessType=='0' || bussinessType==undefined)"></i> <i style="margin-left: 15px;padding-top: 5px;float: left;" class="fas fa-file-export" title="Export to Excel" (click)="tableToCSV()" *ngIf="(bussinessType=='0' || bussinessType==undefined)"></i>
<i style="margin-left: 15px;padding-top: 5px;float: left;" class="fas fa-file-export" title="Export to Excel" (click)="exportExcel1()" *ngIf="(bussinessType=='1')"></i> <i style="margin-left: 15px;padding-top: 5px;float: left;" class="fas fa-file-export" title="Export to Excel" (click)="exportExcel1()" *ngIf="(bussinessType=='1')"></i>
<a *ngIf="showNav" href="https://youtu.be/dg1zd2geHXA" style="float: left;;margin-left: 15px;padding-top: 5px;cursor: pointer;color:white"title="Video tutorial" target="_blank"> <i class="fas fa-video"></i> </a> <a *ngIf="showNav" href="https://youtu.be/dg1zd2geHXA" style="float: left;;margin-left: 15px;padding-top: 5px;cursor: pointer;color:white"title="Video tutorial" target="_blank"> <i class="fas fa-video"></i> </a>

View file

@ -18,7 +18,7 @@ import { Params,Router, ActivatedRoute, CanActivate, ActivatedRouteSnapshot, Rou
import {ContactService} from '../contact.service'; import {ContactService} from '../contact.service';
import { checkNoChangesNode } from '@angular/core/src/view/view'; import { checkNoChangesNode } from '@angular/core/src/view/view';
import { SpeednotifyComponent } from '../dashboard/speednotify/speednotify.component'; import { SpeednotifyComponent } from '../dashboard/speednotify/speednotify.component';
import { SidebarComponent } from '../sidebar/sidebar.component'; //import { SidebarComponent } from '../sidebar/sidebar.component';
import { MyaccountComponent } from '../myaccount/myaccount.component'; import { MyaccountComponent } from '../myaccount/myaccount.component';
import {DatainjectionService} from '../datainjection.service' import {DatainjectionService} from '../datainjection.service'
import { isUndefined } from 'util'; import { isUndefined } from 'util';
@ -165,22 +165,25 @@ modelChanged: Subject<string> = new Subject<string>();
} }
bussinessType; bussinessType;
showButton:Boolean=false showButton:Boolean=false;
showAddButton:Boolean=false;
ngOnInit() { ngOnInit() {
// this.updateFieldswithvalue() // this.updateFieldswithvalue()
this.showDemoVideo(); this.showDemoVideo();
this.socket_Ing = this.injectData.getSocket_gps(); this.socket_Ing = this.injectData.getSocket_gps();
if (localStorage.getItem('addDev') == 'yes' || JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin || JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer){
this.showAddButton=true;
}else{
this.showAddButton = false;
}
// this.from_date = new Date();
// this.from_date.setDate(1);
// this.to_date = new Date();
this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY, h:mm:ss a' }, { containerClass: this.colorTheme }); this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY, h:mm:ss a' }, { containerClass: this.colorTheme });
//io.connect('https://www.oneqlik.in/gps', { secure: true, rejectUnauthorized: false, transports: ["polling"], upgrade: false }); //io.connect('https://www.oneqlik.in/gps', { secure: true, rejectUnauthorized: false, transports: ["polling"], upgrade: false });
this.socket_Ing.on('connect', function (this) { // this.socket_Ing.on('connect', function (this) {
// console.log('Ignition IO Connected'); // // console.log('Ignition IO Connected');
}) // })
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin; this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.adbtn = localStorage.getItem("dlrchk"); this.adbtn = localStorage.getItem("dlrchk");
this.bussinessType=JSON.parse(window.atob(window.localStorage.token.split(".")[1])).bussinessType this.bussinessType=JSON.parse(window.atob(window.localStorage.token.split(".")[1])).bussinessType
@ -995,6 +998,11 @@ dealerTocust:any;
for(var j=0;j<this.deviceData.length;j++){ for(var j=0;j<this.deviceData.length;j++){
// this.deviceData[j].userContactNumber = this.deviceData[j].user && this.deviceData[j].user.phone ? this.deviceData[j].user.phone : 'n/a'
if(this.deviceData[j].status_updated_at==undefined){ if(this.deviceData[j].status_updated_at==undefined){
let dev_status_1= this.deviceData[j].status?this.deviceData[j].status:"Not available"; let dev_status_1= this.deviceData[j].status?this.deviceData[j].status:"Not available";
this.deviceData[j].status = dev_status_1 ; this.deviceData[j].status = dev_status_1 ;
@ -1550,8 +1558,9 @@ testTable() {
"render": function(data, type, row) { "render": function(data, type, row) {
var fn = data?data.first_name:'-' ; var fn = data?data.first_name:'-' ;
var ln = data?data.last_name:'-' var ln = data && data.last_name?data.last_name:'';
return fn + ' ' + ln ; let ph = data && data.phone ? ' (' + data.phone +')' : ''
return fn + ' ' + ln + '' + ph;
} }
}, },
{ {
@ -1582,7 +1591,7 @@ testTable() {
"visible" :true, "visible" :true,
"render": function(data, type, row) { "render": function(data, type, row) {
var createdDate = new Date(data); var createdDate = new Date(data);
return data ? (moment(createdDate).format('LL')) : ""; return data ? (moment(createdDate).format('DD/MM/YYYY')) : "";
} }
}, },
{ {
@ -1591,7 +1600,7 @@ testTable() {
"visible" :true, "visible" :true,
"render": function(data, type, row) { "render": function(data, type, row) {
var expDate = new Date(data); var expDate = new Date(data);
return data ? (moment(expDate).format('LL')) : ""; return data ? (moment(expDate).format('DD/MM/YYYY')) : "";
} }
}, },
{ {
@ -1600,7 +1609,7 @@ testTable() {
"visible" :true, "visible" :true,
"render": function(data, type, row) { "render": function(data, type, row) {
var expDate = new Date(data); var expDate = new Date(data);
return data ? (moment(expDate).format('LL')) : ""; return data ? (moment(expDate).format('DD/MM/YYYY')) : "";
} }
}, },
{ {
@ -1648,7 +1657,7 @@ testTable() {
"defaultContent": "", "defaultContent": "",
"render": function(data, type, row) { "render": function(data, type, row) {
var expDate = new Date(data); var expDate = new Date(data);
return data ? (moment(expDate).format('lll')) : ""; return data ? (moment(expDate).format('DD/MM/YYYY hh:mm:ss')) : "";
} }
}, },
{ {
@ -1826,6 +1835,7 @@ exportCertificate(data){
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
// console.log(result); // console.log(result);
// if (result == "advance") { // if (result == "advance") {
@ -1894,7 +1904,72 @@ exportCertificate(data){
} }
tab:any; tab:any;
tableToCSV() {
// Variable to store the final csv data
var csv_data = [];
// Get each row data
var rows = document.getElementsByTagName('tr');
var isHeaderSelected = false;
for (var i = 0; i < rows.length; i++) {
console.log(rows[i]);
// Get each column data
var cols = !isHeaderSelected ? rows[i].querySelectorAll('td,th') : rows[i].querySelectorAll('td');
if (!isHeaderSelected) {
isHeaderSelected = (rows[i].querySelectorAll('th')).length ? true : false;
}
// Stores each csv row data
var csvrow = [];
if (cols.length) {
for (var j = 0; j < cols.length -7; j++) {
// Get the text data of each cell
// of a row and push it to csvrow
csvrow.push(cols[j].innerHTML ? cols[j].innerHTML.replace(/,/g, ";"):' ');
}
// Combine each column value with comma
csv_data.push(csvrow.join(","));
}
}
// Combine each row data with new line character
let newcsv_data = csv_data.join('\n');
// Call this function to download csv file
this.downloadCSVFile(newcsv_data);
}
downloadCSVFile(csv_data) {
// Create CSV file object and feed
// our csv_data into it
let CSVFile = new Blob([csv_data], {
type: "text/csv"
});
// Create to temporary link to initiate
// download process
var temp_link = document.createElement('a');
// Download csv file
temp_link.download = "Vehicle.csv";
var url = window.URL.createObjectURL(CSVFile);
temp_link.href = url;
// This link should not be displayed
temp_link.style.display = "none";
document.body.appendChild(temp_link);
// Automatically click the link to
// trigger download
temp_link.click();
document.body.removeChild(temp_link);
}
exportExcel1() { exportExcel1() {
var data = this.devicess.devices var data = this.devicess.devices
@ -1913,7 +1988,8 @@ exportCertificate(data){
} }
if (data[i].user) { if (data[i].user) {
var name1 = data[i].user.first_name ? data[i].user.first_name : "" + " " + data[i].user.last_name ? data[i].user.last_name : "" var name1 = data[i].user.first_name ? data[i].user.first_name : "" + " " + data[i].user.last_name ? data[i].user.last_name : ""
data[i].customerName = name1; let ph = data[i].user && data[i].user.phone ? ' (' + data[i].user.phone + ')' : ''
data[i].customerName = name1 + ph;
data[i].customerId = data[i].imageDoc[0] ? data[i].imageDoc[0].phone ? data[i].imageDoc[0].phone : "" :"" data[i].customerId = data[i].imageDoc[0] ? data[i].imageDoc[0].phone ? data[i].imageDoc[0].phone : "" :""
} }
@ -2015,41 +2091,72 @@ exportCertificate(data){
} }
exportExcel() { exportExcel() {
window.open('data:application/csv,charset=utf-8,' + $('#deviceTable1').html());
var tab_text = "<table border='2px'><tr bgcolor='#87AFC6'>"; var tab_text = "<table border='2px'><tr bgcolor='#87AFC6'>";
var textRange; var j = 0; var textRange; var j = 0;
this.tab = document.getElementById('deviceTable1'); // id of table var table = $('#deviceTable1').clone();
table[0].querySelector("thead").remove();
console.log(table[0].querySelector("thead"));
// console.log(this.tab.rows.length) table[0].prepend($(".dataTable thead").clone()[0]);
var rowlength = 4; this.tab = table[0];//document.getElementById('deviceTable'); // id of table
if((this.superAdmin ==true)||(this.custtype ==true)||(this.dealerTocust=='ON')){
var rowlength = 6;
}
for(j = 0 ; j < this.tab.rows.length; j++)
{
for (j = 0; j < this.tab.rows.length; j++) {
tab_text = tab_text + this.tab.rows[j].innerHTML + "</tr>"; tab_text = tab_text + this.tab.rows[j].innerHTML + "</tr>";
//tab_text=tab_text+"</tr>"; //tab_text=tab_text+"</tr>";
} }
$('table tr').find('td:eq(20),th:eq(20)').remove();
$('table tr').find('td:eq(21),th:eq(21)').remove();
tab_text = tab_text + "</table>"; tab_text = tab_text + "</table>";
tab_text = tab_text.replace(/<A[^>]*>|<\/A>/g, "");//remove if u want links in your table tab_text = tab_text.replace(/<A[^>]*>|<\/A>/g, "");//remove if u want links in your table
tab_text = tab_text.replace(/<img[^>]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/<img[^>]*>/gi, ""); // remove if u want images in your table
tab_text = tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params tab_text = tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params
// tab_text= tab_text.replace(/<th>Edit</th>/gi, ""); // reomves input params
// console.log(tab_text);
var ua = window.navigator.userAgent; var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE "); var msie = ua.indexOf("MSIE ");
tab_text = tab_text.replace(/\s{2,}/g, '') // <-- Replace all consecutive spaces, 2+
.replace(/%/g, '%25') // <-- Escape %
.replace(/&/g, '%26') // <-- Escape &
.replace(/#/g, '%23') // <-- Escape #
.replace(/"/g, '%22') // <-- Escape "
.replace(/'/g, '%27');
console.log(tab_text.length, 32767 < tab_text.length);
var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text)); var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
return (sa); return (sa);
// var tab_text="<table border='2px'><tr bgcolor='#87AFC6'>";
// var textRange; var j=0;
// this.tab = document.getElementById('deviceTable1'); // id of table
// // console.log(this.tab.rows.length)
// var rowlength = 4;
// if((this.superAdmin ==true)||(this.custtype ==true)||(this.dealerTocust=='ON')){
// var rowlength = 6;
// }
// for(j = 0 ; j < this.tab.rows.length; j++)
// {
// tab_text=tab_text+this.tab.rows[j].innerHTML+"</tr>";
// //tab_text=tab_text+"</tr>";
// }
// $('table tr').find('td:eq(20),th:eq(20)').remove();
// $('table tr').find('td:eq(21),th:eq(21)').remove();
// tab_text=tab_text+"</table>";
// tab_text= tab_text.replace(/<A[^>]*>|<\/A>/g, "");//remove if u want links in your table
// tab_text= tab_text.replace(/<img[^>]*>/gi,""); // remove if u want images in your table
// tab_text= tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params
// // tab_text= tab_text.replace(/<th>Edit</th>/gi, ""); // reomves input params
// // console.log(tab_text);
// var ua = window.navigator.userAgent;
// var msie = ua.indexOf("MSIE ");
// var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
// return (sa);
} }
dateChange(id){ dateChange(id){
@ -2060,7 +2167,7 @@ exportCertificate(data){
} }
pageLength:any; pageLength:any;
pageLengthArr=[10,25,50,100,200,500,"All"]; pageLengthArr=[10,25,50,100,200,500,1000,2000,5000];
callDataTable(){ callDataTable(){
this.customDatafilter = true; this.customDatafilter = true;
this.skip = 0; this.skip = 0;

View file

@ -180,7 +180,7 @@
src="{{ org.imageDoc }}" src="{{ org.imageDoc }}"
width="100px" width="100px"
height="100px" height="100px"
/><br /><br /> /><br />
</div> </div>
</td> </td>
<td style="text-align: center; font-weight: 700"> <td style="text-align: center; font-weight: 700">
@ -190,28 +190,28 @@
</td> </td>
<td style="text-align: center"> <td style="text-align: center">
<div> <div>
<img src="{{ imgURL }}" width="100px" height="150px" /> <img src="{{ imgURL }}" width="100px" height="100px" />
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="3" style="text-align: center"> <td colspan="3" style="text-align: center">
<h6 style="font-size: 18px">&nbsp;&nbsp;.</h6>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td width="200">
TAC Reg.No &nbsp;&nbsp;&nbsp; <br /> TAC Reg.No &nbsp;&nbsp;&nbsp; <br />
CoP No.&nbsp;&nbsp;&nbsp;&nbsp;<br /> CoP No.&nbsp;&nbsp;&nbsp;&nbsp;<br />
CoP Validity upto&nbsp;&nbsp;<br /> CoP Validity upto&nbsp;&nbsp;<br />
Fitment Date&nbsp;&nbsp;&nbsp;<br /> Fitment Date&nbsp;&nbsp;&nbsp;<br />
Fitment Renewal Date&nbsp;&nbsp;<br /> Fitment Renewal Date&nbsp;&nbsp;<br />
</td> </td>
<td> <td colspan="2">
: CK8077 <br /> : CK8077 <br />
: CC0GP8551<br /> : CC0GR8739<br />
: 30 September 2022 <br /> : 30 September 2023 <br />
: {{ kycApprovalDate ? (kycApprovalDate | date: "dd/MM/yyyy") : "" : {{ kycApprovalDate ? (kycApprovalDate | date: "dd/MM/yyyy") : ""
}}<br /> }}<br />
: {{ esim_validity ? esim_validity : "" }}<br /> : {{ esim_validity ? esim_validity : "" }}<br />
@ -219,7 +219,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td colspan="3">
<h6 style="font-size: 18px; margin: 20px 0 10px 0px"> <h6 style="font-size: 18px; margin: 15px 0 5px 0px">
AIS 140 COMPLIANCE VLT INSTALLATION CERTIFICATE AIS 140 COMPLIANCE VLT INSTALLATION CERTIFICATE
</h6> </h6>
</td> </td>
@ -247,7 +247,7 @@
Secondary SIM<br /> Secondary SIM<br />
Secondary SIM Valid till<br /> Secondary SIM Valid till<br />
</td> </td>
<td> <td colspan="2">
: {{ fitmentCertificateNo ? fitmentCertificateNo : "" }}<br /> : {{ fitmentCertificateNo ? fitmentCertificateNo : "" }}<br />
: {{ ChassisNo ? ChassisNo : "" }}<br /> : {{ ChassisNo ? ChassisNo : "" }}<br />
: {{ engineNo ? engineNo : "" }}<br /> : {{ engineNo ? engineNo : "" }}<br />
@ -265,35 +265,38 @@
: {{ gsmModule ? gsmModule : "Telit GE910" }}<br /> : {{ gsmModule ? gsmModule : "Telit GE910" }}<br />
: {{ ICCICD ? ICCICD : "" }}<br /> : {{ ICCICD ? ICCICD : "" }}<br />
: {{ simNum ? simNum : "" }}<br /> : {{ simNum ? simNum : "" }}<br />
: {{ expiration_date ? (expiration_date | date: "dd/MM/yyyy") : "" : {{ esim_validity ? (esim_validity) : ""
}}<br /> }}<br />
: {{ simNum1 ? simNum1 : "" }}<br /> : {{ simNum1 ? simNum1 : "" }}<br />
: {{ expiration_date ? (expiration_date | date: "dd/MM/yyyy") : "" : {{ esim_validity ? (esim_validity) : ""
}}<br /> }}<br />
</td> </td>
</tr> </tr>
<tr style="padding-top: 10px"> <tr style="padding-top: 5px">
<td>
</td>
<td> <td>
<img <img
src="{{ deviceImage[0] ? deviceImage[0] : img1 }}" src="{{ deviceImage[0] ? deviceImage[0] : img1 }}"
width="90px" width="80px"
height="90px" height="80px"
/> />
</td>
<td>
<img <img
src="{{ deviceImage[1] ? deviceImage[1] : img1 }}" src="{{ deviceImage[1] ? deviceImage[1] : img1 }}"
width="90px" width="80px"
height="90px" height="80px"
/>
<img
src="{{ deviceImage[2] ? deviceImage[2] : img1 }}"
width="80px"
height="80px"
/> />
</td> </td>
<td> <td>
<img
src="{{ deviceImage[2] ? deviceImage[2] : img1 }}"
width="90px"
height="90px"
/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -305,10 +308,10 @@
</p> </p>
</td> </td>
</tr> </tr>
<tr style="padding-top: 10px"> <tr style="padding-top: 5px">
<td>Authorised</td> <td>Authorised</td>
</tr> </tr>
<tr style="padding-top: 10px"> <tr style="padding-top: 5px">
<td>Undertaking</td> <td>Undertaking</td>
</tr> </tr>
<tr> <tr>
@ -322,16 +325,16 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" style="text-align: center; margin-top: 10px"> <td colspan="1" style="text-align: center; margin-top: 5px">
Customer Name : {{ user.first_name ? user.first_name : "" }} Customer Name : {{ user.first_name ? user.first_name : "" }}
{{ user.last_name ? user.last_name : "" }}<br /> {{ user.last_name ? user.last_name : "" }}<br />
Contact/Login ID : {{ user.phone ? user.phone : "" }} Contact/Login ID : {{ user.phone ? user.phone : "" }}
</td> </td>
<td colspan="1">
<td>
Customer Address: {{ user.address ? user.address : "" }}<br /> Customer Address: {{ user.address ? user.address : "" }}<br />
Customer Sign : Customer Sign :
</td> </td>
<td></td>
</tr> </tr>
</table> </table>
</md-dialog-content> </md-dialog-content>

View file

@ -104,7 +104,7 @@ deletetemplate:boolean=false;
this.org = JSON.parse(localStorage.getItem('ORG')) this.org = JSON.parse(localStorage.getItem('ORG'))
if (!this.data.deviceInfo.esim_validity) { if (!this.data.deviceInfo.esim_validity) {
if (this.data.deviceInfo.License == "Yearly") { if (this.data.deviceInfo.License == "Yearly") {
this.esim_validity=this.data.deviceInfo.kycApprovalDate?moment(new Date(this.data.deviceInfo.kycApprovalDate), "DD-MM-YYYY").add(1, 'years').format("DD/MM/YYYY"):undefined; this.esim_validity = this.data.deviceInfo.kycApprovalDate ? moment(new Date(this.data.deviceInfo.kycApprovalDate), "DD/MM/YYYY").add(1, 'years').format("DD/MM/YYYY") : undefined;
} }
} else { } else {
this.esim_validity = this.data.deviceInfo.esim_validity ? moment(new Date(this.data.deviceInfo.esim_validity)).format("DD/MM/YYYY") : undefined this.esim_validity = this.data.deviceInfo.esim_validity ? moment(new Date(this.data.deviceInfo.esim_validity)).format("DD/MM/YYYY") : undefined
@ -163,6 +163,7 @@ deletetemplate:boolean=false;
} }
for (var i = 0; i < this.deviceImage.length; i++) { for (var i = 0; i < this.deviceImage.length; i++) {
console.log("DEVUCE IMAGE=>", this.deviceImage[i]);
this.deviceImage[i] = this.deviceImage[i] && this.deviceImage[i] != "" ? 'http://nipponsecura.in' + this.deviceImage[i].substring(6) : '' this.deviceImage[i] = this.deviceImage[i] && this.deviceImage[i] != "" ? 'http://nipponsecura.in' + this.deviceImage[i].substring(6) : ''
@ -306,6 +307,9 @@ f1().then(res => f2().then(res1=>f3()));
}
closePopup() {
this.dialogRef.close(1);
} }
getLocationLink() { getLocationLink() {
var data = { var data = {
@ -361,6 +365,7 @@ f1().then(res => f2().then(res1=>f3()));
stamp.crossOrigin = "anonymous"; stamp.crossOrigin = "anonymous";
// stamp.onload = function(){ // stamp.onload = function(){
console.log("0"); console.log("0");
doc.setPage(1);
doc.addImage(that.stamp1, 'png', 15, 210, 30, 30) doc.addImage(that.stamp1, 'png', 15, 210, 30, 30)
// }; // };
var img = new Image(); var img = new Image();
@ -369,6 +374,7 @@ f1().then(res => f2().then(res1=>f3()));
// if(this.org.imageDoc){ // if(this.org.imageDoc){
// img.onload = function(){ // img.onload = function(){
console.log("-1"); console.log("-1");
doc.setPage(1);
doc.addImage(that.img, 'png', 15, 9, 50, 40) doc.addImage(that.img, 'png', 15, 9, 50, 40)
// }; // };
@ -391,13 +397,13 @@ f1().then(res => f2().then(res1=>f3()));
data.row.cells[0].styles.halign = 'center'; data.row.cells[0].styles.halign = 'center';
data.row.cells[0].styles.fontSize = 25; data.row.cells[0].styles.fontSize = 25;
data.row.cells[0].styles.overflow = "linebreak" data.row.cells[0].styles.overflow = "linebreak"
data.row.cells[0].styles.lineHeight= "2.5"; data.row.cells[0].styles.lineHeight = "1.5";
// doc.setLineHeightFactor() // doc.setLineHeightFactor()
// } // }
// doc.addImage(this.supAdmin.imageDoc,'JPEG', 140, 9,40,40); // doc.addImage(this.supAdmin.imageDoc,'JPEG', 140, 9,40,40);
doc.setPage(1);
doc.addImage(this.imgURL, 'JPEG', 150, 9, 50, 40); doc.addImage(this.imgURL, 'JPEG', 150, 9, 50, 40);
} }
@ -405,7 +411,7 @@ f1().then(res => f2().then(res1=>f3()));
// data.row.cells[0].styles.halign = 'center'; // data.row.cells[0].styles.halign = 'center';
doc.halign = 'center'; doc.halign = 'center';
doc.setFontStyle('bold'); doc.setFontStyle('bold');
doc.cellPadding=60 doc.cellPadding = 50
} }
if (data.row.index === 3) { if (data.row.index === 3) {
@ -424,13 +430,13 @@ f1().then(res => f2().then(res1=>f3()));
} }
if (data.row.index === 5) { if (data.row.index === 5) {
data.row.height = 30; data.row.height = 25;
// data.row.cells[0].styles.halign = 'center'; // data.row.cells[0].styles.halign = 'center';
// doc.halign = 'center'; // doc.halign = 'center';
} }
if (data.row.index === 6) { if (data.row.index === 6) {
data.row.height = 45; data.row.height = 40;
// data.row.cells[0].styles.halign = 'center'; // data.row.cells[0].styles.halign = 'center';
// doc.halign = 'center'; // doc.halign = 'center';
} }
@ -544,4 +550,5 @@ f1().then(res => f2().then(res1=>f3()));
xhr.responseType = 'blob'; xhr.responseType = 'blob';
xhr.send(); xhr.send();
} }
} }

View file

@ -80,7 +80,7 @@
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="inputCity">Dealer Followup Mobile</label> <span>*</span> <label for="inputCity">Dealer Followup Mobile ff</label> <span>*</span>
<input <input
formControlName="dealerFollowup" formControlName="dealerFollowup"
type="text" type="text"

View file

@ -194,6 +194,7 @@ export class NewEditDeviceComponent implements OnInit {
this.DealerId = JSON.parse(window.atob(window.localStorage.Dealer_token.split(".")[1]))._id; this.DealerId = JSON.parse(window.atob(window.localStorage.Dealer_token.split(".")[1]))._id;
} }
console.log('this.custtype', this.custtype);
var fname=this.deviceData.user?this.deviceData.user.first_name?this.deviceData.user.first_name:'':""; var fname=this.deviceData.user?this.deviceData.user.first_name?this.deviceData.user.first_name:'':"";
var lname=this.deviceData.user?this.deviceData.user.last_name?this.deviceData.user.last_name:'':"" var lname=this.deviceData.user?this.deviceData.user.last_name?this.deviceData.user.last_name:'':""
@ -217,7 +218,7 @@ export class NewEditDeviceComponent implements OnInit {
SMSPlan:[''], SMSPlan:[''],
city:[this.deviceData.transportOfficeCity?this.deviceData.transportOfficeCity:''], city:[this.deviceData.transportOfficeCity?this.deviceData.transportOfficeCity:''],
deviceModel:[this.deviceData.device_model?this.deviceData.device_model._id:''], deviceModel:[this.deviceData.device_model?this.deviceData.device_model._id:''],
trackingExp:new Date(this.expDate), trackingExp: [this.deviceData.expiration_date ? new Date(this.deviceData.expiration_date) : ''],
eSimExpiry:[this.deviceData.esim_validity?new Date(this.deviceData.esim_validity):''], eSimExpiry:[this.deviceData.esim_validity?new Date(this.deviceData.esim_validity):''],
model:[this.deviceData.Model?this.deviceData.Model:''], model:[this.deviceData.Model?this.deviceData.Model:''],
email:[this.deviceData.user?this.deviceData.user.email?this.deviceData.user.email:'':''], email:[this.deviceData.user?this.deviceData.user.email?this.deviceData.user.email:'':''],
@ -363,7 +364,12 @@ export class NewEditDeviceComponent implements OnInit {
if(this.deviceForm.value.address){ if(this.deviceForm.value.address){
data['address']=this.deviceForm.value.address data['address']=this.deviceForm.value.address
} }
if (this.deviceForm.value.eSimExpiry) {
data['esim_validity'] = this.deviceForm.value.eSimExpiry
}
if (this.deviceForm.value.trackingExp) {
data['expdate'] = this.deviceForm.value.trackingExp
}
console.log(data); console.log(data);
this.contactService.post('/users/editUserDetails',data).subscribe((res:any)=>{ this.contactService.post('/users/editUserDetails',data).subscribe((res:any)=>{
@ -412,7 +418,7 @@ export class NewEditDeviceComponent implements OnInit {
bussinessType:1 bussinessType:1
} }
if (this.custtype) { if (this.custtype) {
newDevice['Dealer'] = this.userId; newDevice['Dealer'] = this.deviceData.Dealer && this.deviceData.Dealer._id ? this.deviceData.Dealer._id : newDevice['Dealer'];
} else if((this.custtype == false)&&(window.localStorage['Custumer'] == 'ON') ) { } else if((this.custtype == false)&&(window.localStorage['Custumer'] == 'ON') ) {
newDevice['Dealer'] = this.DealerId newDevice['Dealer'] = this.DealerId
} }
@ -463,6 +469,9 @@ export class NewEditDeviceComponent implements OnInit {
if(this.deviceForm.value.eSimExpiry){ if(this.deviceForm.value.eSimExpiry){
newDevice['esim_validity'] = this.deviceForm.value.eSimExpiry; newDevice['esim_validity'] = this.deviceForm.value.eSimExpiry;
}
if (this.deviceForm.value.trackingExp) {
newDevice['expdate'] = this.deviceForm.value.trackingExp
} }
if(this.deviceForm.value.vehicleCategory){ if(this.deviceForm.value.vehicleCategory){
newDevice['vehicleCategory'] = this.deviceForm.value.vehicleCategory; newDevice['vehicleCategory'] = this.deviceForm.value.vehicleCategory;
@ -498,9 +507,15 @@ export class NewEditDeviceComponent implements OnInit {
this.contactService.editdevice(newDevice) this.contactService.editdevice(newDevice)
.subscribe((device) => { .subscribe((device) => {
window.localStorage['DataUpdate'] = 'True'; window.localStorage['DataUpdate'] = 'True';
localStorage.getItem('KycApprovalRedirect')
if (localStorage.getItem('KycApprovalRedirect')) {
localStorage.removeItem('KycApprovalRedirect')
this.router.navigateByUrl("KycApproval")
} else {
this.router.navigateByUrl("dashboard"); this.router.navigateByUrl("dashboard");
} }
}
// this.Load = false // this.Load = false
) )
, (err: any) => { , (err: any) => {

View file

@ -9,6 +9,7 @@ import 'rxjs/add/operator/map';
@Injectable() @Injectable()
export class DatainjectionService { export class DatainjectionService {
socketConnection= false;
devicess:any; devicess:any;
final:any=null; final:any=null;
userID:any; userID:any;
@ -38,17 +39,9 @@ export class DatainjectionService {
} }
constructor(private contactService: ContactService, private activatedRoute: ActivatedRoute, private http: Http,private router:Router) { constructor(private contactService: ContactService, private activatedRoute: ActivatedRoute, private http: Http,private router:Router) {
// alert('ata injection constructor') // alert('ata injection constructor')
this.socket_gps = io.connect('https://soc.oneqlik.in' +'/gps', { this.getConnection();
secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false
});
this.socket_5000 = io.connect('https://soc.oneqlik.in', {
secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false
});
this.socket_notifIO = io.connect('https://soc.oneqlik.in'+'/notifIO', {
secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false
});
// this.socket_gps = io.connect('https://socket.oneqlik.in' +'/gps', { // this.socket_gps = io.connect('https://socket.oneqlik.in' +'/gps', {
// secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false // secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false
@ -63,6 +56,57 @@ export class DatainjectionService {
// }); // });
// https://server2.oneqlik.in/ // https://server2.oneqlik.in/
}
closeConnection() {
// this.socket_notifIO.removeAllListeners();
// this.socket_gps.removeAllListeners();
// this.socket_5000.removeAllListeners();
// this.socket_notifIO.disconnect();
// this.socket_gps.disconnect();
// this.socket_5000.disconnect();
this.socketConnection = false;
try {
this.socket_notifIO.close();
this.socket_gps.close();
this.socket_5000.close();
} catch (error) {
console.log('Connection Close',error)
}
}
refreshConnection() {
if (!this.socketConnection) {
this.getConnection();
}
}
setGPSConnection() {
if (window.localStorage.currentuser) {
//this.socketConnection = true;
this.useridd = window.localStorage.currentuser;
this.socket_gps = io.connect('https://soc.oneqlik.in' + '/gps?userId=' + this.useridd, {
secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false
});
}
}
removedGPSConnection() {
this.socket_gps.close();
}
getConnection() {
if (window.localStorage.currentuser) {
this.socketConnection = true;
this.useridd = window.localStorage.currentuser;
this.socket_notifIO = io.connect('https://soc.oneqlik.in' + '/notifIOV2?userId=' + this.useridd, {
secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false
});
//this.setGPSConnection();
this.socket_5000 = io.connect('https://soc.oneqlik.in?userId=' + this.useridd, {
secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false
});
}
if (window.localStorage.custumer_token) { if (window.localStorage.custumer_token) {
this.fs = JSON.parse(window.atob(window.localStorage.custumer_token.split(".")[1])).fn; this.fs = JSON.parse(window.atob(window.localStorage.custumer_token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.custumer_token.split(".")[1])).ln; this.ls = JSON.parse(window.atob(window.localStorage.custumer_token.split(".")[1])).ln;
@ -79,13 +123,14 @@ export class DatainjectionService {
} }
} }
else { else {
console.log(router.url);
var url=(router.url).substring(0,12); var url = (this.router.url).substring(0, 12);
console.log(url); console.log(url);
if (url == "/ViewVehicle") { if (url == "/ViewVehicle") {
} else { } else {
if (window.localStorage.token) {
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn; this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln; this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
this.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email; this.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
@ -99,13 +144,13 @@ export class DatainjectionService {
if (this.mb.charAt(0) == "n") { if (this.mb.charAt(0) == "n") {
this.mb = ' ' this.mb = ' '
} }
}
} }
} }
} }
getDevice(emailid,id) { getDevice(emailid,id) {
return this.http.get(this.dev_url + "/devices/getDeviceByUser?email="+emailid+'&id='+id) return this.http.get(this.dev_url + "/devices/getDeviceByUser?email="+emailid+'&id='+id)
.map(data => { .map(data => {

View file

@ -335,6 +335,7 @@ export class DealersInfoComponent implements OnInit {
dealerSwitch(dlr) { dealerSwitch(dlr) {
// console.log(dlr); // console.log(dlr);
localStorage.setItem("DealerObj=>", dlr._id); localStorage.setItem("DealerObj=>", dlr._id);
localStorage.setItem("addDev", 'yes');
localStorage.removeItem("in1"); localStorage.removeItem("in1");
this.contactService.getcustToken(dlr._id).subscribe( this.contactService.getcustToken(dlr._id).subscribe(
data => { data => {

View file

@ -9,14 +9,14 @@
<flash-messages style="float: center;margin:0px 1px;height:-6px;"></flash-messages> <flash-messages style="float: center;margin:0px 1px;height:-6px;"></flash-messages>
</div> </div>
</div> </div>
<div class="loading" *ngIf="Load">Loading&#8230;</div>
<div class="card-header" id="headingOne"> <div class="card-header" id="headingOne">
<h2 class="mb-0"> <h2 class="mb-0">
<button class="btn btn-link" (click)="change()" type="button" data-toggle="collapse" data-target="#collapseZero" <button class="btn btn-link" (click)="change()" type="button" data-toggle="collapse" data-target="#collapseZero"
aria-expanded="true" aria-controls="collapseZero"> aria-expanded="true" aria-controls="collapseZero">
Device Inventory Device Inventory
</button> </button>
<button (click)="exportiventory()" class="btn btn-primary btn-sm float-sm-right ml-2" type="button" >Export To Excel</button>
<button (click)="addmultiple()" class="btn btn-primary btn-sm float-sm-right ml-2" type="button" data-toggle="collapse" <button (click)="addmultiple()" class="btn btn-primary btn-sm float-sm-right ml-2" type="button" data-toggle="collapse"
data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">Add Multiple Device</button> data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">Add Multiple Device</button>
<!-- *ngIf="checkedList.length>0" --> <!-- *ngIf="checkedList.length>0" -->
@ -30,12 +30,11 @@
<button class="btn btn-primary btn-sm float-sm-right ml-2" type="button" (click)="change()" data-toggle="collapse" <button class="btn btn-primary btn-sm float-sm-right ml-2" type="button" (click)="change()" data-toggle="collapse"
data-target="#collapseSix" aria-expanded="true" aria-controls="collapseSix" (click)="selectTab('sent')">Transaction History</button> data-target="#collapseSix" aria-expanded="true" aria-controls="collapseSix" (click)="selectTab('sent')">Transaction History</button>
<div aria-labelledby="dropdownMenuButton" class="dropdown-menu" x-placement="bottom-start" <div aria-labelledby="dropdownMenuButton" class="dropdown-menu" x-placement="bottom-start"
style="position: absolute; transform: translate3d(92px, 35px, 0px); top: 0px; left: 0px; will-change: transform;"> style="position: absolute; transform: translate3d(92px, 35px, 0px); top: 0px; left: 0px; will-change: transform;">
<a data-toggle="collapse" (click)="change()" data-target="#collapseThree" aria-expanded="true" aria-controls="collapseThree" class="dropdown-item" style="cursor: pointer;"> Dealer</a> <a *ngIf="isSuperAdmin" data-toggle="collapse" (click)="change()" data-target="#collapseThree" aria-expanded="true" aria-controls="collapseThree" class="dropdown-item" style="cursor: pointer;"> Dealer</a>
<a data-toggle="collapse" (click)="change()" data-target="#collapseFour" aria-expanded="true" aria-controls="collapseFour" class="dropdown-item" style="cursor: pointer;">Installer</a> <a data-toggle="collapse" (click)="change()" data-target="#collapseFour" aria-expanded="true" aria-controls="collapseFour" class="dropdown-item" style="cursor: pointer;">Installer</a>
<a data-toggle="collapse" (click)="change()" data-target="#collapseFive" aria-expanded="true" aria-controls="collapseFour" class="dropdown-item" style="cursor: pointer;">Distributer</a> <a *ngIf="isOrganisation" data-toggle="collapse" (click)="change()" data-target="#collapseFive" aria-expanded="true" aria-controls="collapseFour" class="dropdown-item" style="cursor: pointer;">Distributer</a>
</div> </div>
</h2> </h2>
</div> </div>
@ -53,8 +52,23 @@
</div> </div>
</div> </div>
<div class="table-responsive"> <div class="table-responsive gridtable">
<table class="table table-striped table-hover " style="overflow-y: hidden; overflow-x: hidden;font-size:12px"> <div>
<div class="float-right" style="margin-bottom: 5px;">
<button [disabled]="lastcall" style="border-radius: 50px;" (click)="pre()" class="btn btn-outline-primary btn-sm"><i class="fa fa-arrow-circle-left"></i></button>
<button [disabled]="firstcall" style="border-radius: 50px;" (click)="next()" class="btn btn-outline-primary btn-sm"><i class="fa fa-arrow-circle-right"></i></button>
</div>
<div class="input-field first-wrap">
<!-- <div class="icon-wrap">
<i class="fas fa-search" width="24" height="24" viewBox="0 0 24 24"></i>
</div> -->
<input style="width: 460px;float: right;margin-right: 21px;margin-bottom: 5px;" type="text" class="form-control" id="myInput" name="myInput" type="text" [(ngModel)]="myInput" (ngModelChange)="searchFilter($event)" placeholder="{{'Search' | translate}}" />
</div>
</div>
<table id="deviceInventory" class="table table-striped table-hover " style="overflow-y: hidden; overflow-x: hidden;font-size:12px">
<thead> <thead>
<tr> <tr>
<th><input type="checkbox" id="customCheck1" [(ngModel)]="masterSelected" (change)="checkUncheckAll()"></th> <th><input type="checkbox" id="customCheck1" [(ngModel)]="masterSelected" (change)="checkUncheckAll()"></th>

View file

@ -15,3 +15,35 @@
.bg-red { .bg-red {
background-color: #d9534f !important; background-color: #d9534f !important;
} }
.gridtable tbody {
display: block;
max-height: 400px;
overflow-y: scroll;
}
.gridtable thead,
.gridtable tbody tr {
display: table;
table-layout: fixed;
width: 100%;
}
.gridtable thead {
width: calc(100% - 1.1em);
}
.gridtable thead {
position: relative;
}
.gridtable thead th:last-child:after {
content: ' ';
position: absolute;
// background-color: #337ab7;
width: 1.3em;
height: 38px;
right: -1.3em;
top: 0;
border-bottom: 2px solid #ddd;
}

View file

@ -1,6 +1,8 @@
import { Component, OnInit, TemplateRef } from '@angular/core'; import { Component, OnInit, TemplateRef } from '@angular/core';
import { MdSnackBar } from '@angular/material';
import { FlashMessagesService } from 'angular2-flash-messages'; import { FlashMessagesService } from 'angular2-flash-messages';
import { BsDatepickerConfig, BsModalRef, BsModalService } from 'ngx-bootstrap'; import { BsDatepickerConfig, BsModalRef, BsModalService } from 'ngx-bootstrap';
import { Subject } from 'rxjs/Subject';
import { ContactService } from '../contact.service'; import { ContactService } from '../contact.service';
declare var XLSX:any; declare var XLSX:any;
declare var swal: any; declare var swal: any;
@ -25,7 +27,7 @@ uploadJSON: any;
showErrorupload: boolean =false; showErrorupload: boolean =false;
faileduploadDevices=[]; faileduploadDevices=[];
showErrorupload_1: boolean =false; showErrorupload_1: boolean =false;
Load: boolean; Load: boolean=false;
useridd: any; useridd: any;
selectedArr=[] selectedArr=[]
inventory=[] inventory=[]
@ -49,15 +51,27 @@ uploadJSON: any;
installer_info: any; installer_info: any;
transaction=[] transaction=[]
myInput: any; myInput: any;
modelChanged: Subject<string> = new Subject<string>();
array=[{IMEI:'877',Vendor_Name:'test',Purchase_date:'2021-12-20T18:30:00.000Z','Bill date':'2021-12-20T18:30:00.000Z','Bill no':'2212',State:'Maharastra', array=[{IMEI:'877',Vendor_Name:'test',Purchase_date:'2021-12-20T18:30:00.000Z','Bill date':'2021-12-20T18:30:00.000Z','Bill no':'2212',State:'Maharastra',
'eSIM validaity':'One Year/Two Year','Device model no':'3232','Serial no':'5443','Iccid no':'4223','Mob-1':'983993022','Mob-2':'983993022','vahanID':"45433"}] 'eSIM validaity':'One Year/Two Year','Device model no':'3232','Serial no':'5443','Iccid no':'4223','Mob-1':'983993022','Mob-2':'983993022','vahanID':"45433"}]
constructor(private contactService:ContactService,private _flashMessagesService: FlashMessagesService) { constructor(private contactService: ContactService, private _flashMessagesService: FlashMessagesService, public snackBar: MdSnackBar) {
this.masterSelected = false; this.masterSelected = false;
} this.modelChanged
.debounceTime(2000) // wait 300ms after the last event before emitting last eventpublic sidebar: SidebarComponent,
.distinctUntilChanged() // only emit if value is different from previous value
.subscribe(myInput => {
this.myInput = myInput;
// this.tabelObj;
this.getInventory();
});
}
isOrganisation:Boolean=false;
isSuperAdmin: Boolean = false;
ngOnInit() { ngOnInit() {
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id; this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.isSuperAdmin=JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isSuperAdmin ? JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isSuperAdmin : false;
this.isOrganisation = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isOrganisation ? JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isOrganisation:false;
this.getInventory(); this.getInventory();
this.dealerDetail(); this.dealerDetail();
this.getInventoryCount(); this.getInventoryCount();
@ -90,6 +104,9 @@ uploadJSON: any;
}); });
console.log("file=>",that.uploadJSON); console.log("file=>",that.uploadJSON);
that.uploadJSON.forEach(mData=> {
mData['IMEI']= mData['IMEI'].replaceAll(/[^0-9 ]/g, "").replaceAll(' ', '')
})
console.log("Failed",that.failedFiles); console.log("Failed",that.failedFiles);
@ -102,7 +119,14 @@ uploadJSON: any;
this.getInstallerData() this.getInstallerData()
} }
searchFilter(text: string) {
this.modelChanged.next(text);
}
uploadExcel(){ uploadExcel(){
this.Load=true
this.failedUploadFiles = []; this.failedUploadFiles = [];
this.uploadJSON.forEach(element => { this.uploadJSON.forEach(element => {
element=JSON.stringify(element) element=JSON.stringify(element)
@ -119,11 +143,17 @@ uploadJSON: any;
} }
console.log(data); console.log(data);
this.contactService.addMultipleInventory(data).subscribe(res=>{ this.contactService.addMultipleInventory(data).subscribe((res:any)=>{
console.log(res); console.log(res);
this.Load = false
this.getInventory() this.getInventory()
var msg = "Records Added Successfully" var msg = res.message
this._flashMessagesService.show(msg, { cssClass: 'alert-success', timeout: 3000 }); this.snackBar.open(msg, '', {
duration: 4000,
});
// this._flashMessagesService.show(msg, { cssClass: 'alert-success', timeout: 3000 });
},err=>{
this.Load = false
}) })
} }
@ -163,13 +193,13 @@ this.failedUploadFiles = [];
getInventory(){ getInventory(){
this.Load=true;
var dateObj={} var dateObj={}
var url="/Device_inventory/getInventory?user="+this.useridd var url = "/Device_inventory/getInventory?user=" + this.useridd + '&limit=' + this.pageSize + '&skip=' + this.pageIndex
if((this.dateId == 'to_date')||(this.to_date != undefined)){
dateObj['to_date'] = this.to_date.toISOString();
} if (this.myInput){
if((this.dateId == 'from_date')||(this.from_date != undefined)){ url = url + '&search=' + this.myInput
dateObj['from_date'] = this.from_date.toISOString();
} }
// if(dateObj != undefined){ // if(dateObj != undefined){
@ -177,12 +207,15 @@ this.failedUploadFiles = [];
// } // }
this.contactService.get(url).subscribe((res:any)=>{ this.contactService.get(url).subscribe((res:any)=>{
console.log(res); console.log(res);
this.Load=false;
for(let i=0;i<res.length;i++){ for(let i=0;i<res.length;i++){
res[i].isSelected=false res[i].isSelected=false
} }
this.inventory=res; this.inventory=res;
this.showErrorupload=true; this.showErrorupload=true;
this.getCheckedItemList(); this.getCheckedItemList();
},err=>{
this.Load = false;
}) })
} }
checkValue(data,index){ checkValue(data,index){
@ -476,7 +509,7 @@ exportExcels() {
this.downloadFile(this.array); this.downloadFile(this.array);
} }
downloadFile(data, filename = 'Distance Report') { downloadFile(data, filename = 'Device Inventory') {
let arrHeader = ["IMEI","Device model no","Purchase_date","Serial no","Iccid no","Mob-1","Mob-2", "Vendor_Name", "Bill date", "Bill no","State","eSIM validaity"]; let arrHeader = ["IMEI","Device model no","Purchase_date","Serial no","Iccid no","Mob-1","Mob-2", "Vendor_Name", "Bill date", "Bill no","State","eSIM validaity"];
let csvData = this.ConvertToCSV(data, arrHeader); let csvData = this.ConvertToCSV(data, arrHeader);
@ -566,32 +599,6 @@ exportExcel()
return (sa); return (sa);
} }
// exportExcel(){
// var tab_text="<table border='2px'><tr bgcolor='#87AFC6'>";
// var textRange; var j=0;
// var table = $('#sample').clone();
// table[0].querySelector("thead").remove();
// table[0].prepend($(".dataTable thead").clone()[0]);
// var tab:any = table[0];//document.getElementById('deviceTable'); // id of table
// for(j = 0 ; j < tab.rows.length ; j++)
// {
// tab_text=tab_text+ tab.rows[j].innerHTML+"</tr>";
// }
// tab_text=tab_text+"</table>";
// tab_text= tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params
// var ua = window.navigator.userAgent;
// var msie = ua.indexOf("MSIE ");
// var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
// return (sa);
// }
tabelObj tabelObj
testTable() { testTable() {
@ -773,5 +780,76 @@ testTable() {
this.failedFiles=[]; this.failedFiles=[];
this.dealerObj=undefined this.dealerObj=undefined
} }
firstcall: boolean = false;
lastcall: boolean = true;
next() {
this.lastcall = false;
this.pageIndex += 1;
this.getInventory()
}
searchText: any;
pageIndex = 0;
pageSize = 50;
// next1(){
// this.pageIndex += 1;
// this.getInventory()
// }
pre() {
// console.log(this.skip)
if (this.pageIndex > 0) {
this.pageIndex -= 1;
this.lastcall = false;
this.getInventory()
} else {
this.lastcall = true;
this.firstcall = false;
this.getInventory()
}
}
exportiventory() {
// console.log("INKDJN");
// let element = document.getElementById('deviceInventory');
// const ws =XLSX.utils.table_to_sheet(element);
// /* generate workbook and add the worksheet */
// const wb = XLSX.utils.book_new();
// XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
// /* save to file */
// XLSX.writeFile(wb, 'attendance.xlsx');
var tab_text = "<table border='2px'><tr bgcolor='#87AFC6'>";
var textRange; var j = 0;
var table = $('#deviceInventory').clone();
// table[0].querySelector("thead").remove();
// table[0].prepend($(".dataTable thead").clone()[0]);
var tab = table[0];//document.getElementById('deviceTable'); // id of table
for (j = 0; j < tab.rows.length; j++) {
tab_text = tab_text + tab.rows[j].innerHTML + "</tr>";
// console.log('tab_text',JSON.parse(tab_text));
//tab_text=tab_text+"</tr>";
}
tab_text = tab_text + "</table>";
// tab_text= tab_text.replace(/<A[^>]*>|<\/A>/g, "");//remove if u want links in your table
// tab_text= tab_text.replace(/<img[^>]*>/gi,""); // remove if u want images in your table
tab_text = tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
return (sa);
}
} }

View file

@ -94,6 +94,7 @@ this.expire_status -->
<tr> <tr>
<th style="text-align: left;">{{'Device Name' | translate}}</th> <th style="text-align: left;">{{'Device Name' | translate}}</th>
<th style="text-align: left;">{{'Device IMEI' | translate}}</th> <th style="text-align: left;">{{'Device IMEI' | translate}}</th>
<th style="text-align: left;">{{'Sim Number' | translate}}</th>
<th style="text-align: left;">{{'User' | translate}}</th> <th style="text-align: left;">{{'User' | translate}}</th>
<th style="text-align: left;">{{'Distributer' | translate}}</th> <th style="text-align: left;">{{'Distributer' | translate}}</th>
<th style="text-align: left;">{{'Distributer Mob' | translate}}</th> <th style="text-align: left;">{{'Distributer Mob' | translate}}</th>

View file

@ -212,6 +212,12 @@ export class DeviceListComponent implements OnInit {
return data?data : ''; return data?data : '';
} }
}, },
{
"data": "sim_number",
"render": function (data, type, row) {
return data ? data : '';
}
},
{ {
"data": "User", "data": "User",
"render": function(data, type, row) { "render": function(data, type, row) {

View file

@ -58,6 +58,7 @@ text:any;
option:any; option:any;
geo_status=[]; geo_status=[];
superAdmin:Boolean = false; superAdmin:Boolean = false;
ngOnInit() { ngOnInit() {
// var fTime = new Date().setHours(0,0,0); // var fTime = new Date().setHours(0,0,0);
// this.Fromdate = new Date(fTime); // this.Fromdate = new Date(fTime);
@ -341,7 +342,7 @@ testTable() {
"scrollCollapse": true, "scrollCollapse": true,
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
ajax: (dataTablesParameters,callback) => { ajax: (dataTablesParameters,callback) => {
console.log('temptemptemptemptemp',dataTablesParameters); console.log('manoj patidar',dataTablesParameters);
var deviceID; var deviceID;
that.Load= true; that.Load= true;
// dataTablesParameters.find._u = that.useridd; // dataTablesParameters.find._u = that.useridd;

View file

@ -79,11 +79,11 @@
<td style="cursor:pointer ; text-align: center">{{(gps_report.imei) ? gps_report.imei : "NA"}}</td> <td style="cursor:pointer ; text-align: center">{{(gps_report.imei) ? gps_report.imei : "NA"}}</td>
<td style="cursor:pointer ; text-align: center">{{gps_report.date | date : 'd/M/yyyy, h:mm a'}}</td> <td style="cursor:pointer ; text-align: center">{{gps_report.date | date : 'd/M/yyyy, h:mm a'}}</td>
<td style="cursor:pointer ; text-align: center">{{gps_report.odo ?(gps_report.odo | number : '1.2-2' ): "NA"}}</td> <td style="cursor:pointer ; text-align: center">{{gps_report.odo ?(gps_report.odo | number : '1.2-2' ): "NA"}}</td>
<td style="cursor:pointer ; text-align: center">{{get_distance(pathReport,i)}}</td> <td style="cursor:pointer ; text-align: center">{{gps_report.get_distance}}</td>
<td style="cursor:pointer ; text-align: center">{{gps_report.speed ? (gps_report.speed | number : '1.2-2' ) : "0"}}</td> <td style="cursor:pointer ; text-align: center">{{gps_report.speed ? (gps_report.speed | number : '1.2-2' ) : "0"}}</td>
<td style="cursor:pointer ; text-align: center">{{gps_report.external_Battery? (gps_report.external_Battery | number : '1.2-2' ) : "0"}}</td> <td style="cursor:pointer ; text-align: center">{{gps_report.external_Battery? (gps_report.external_Battery | number : '1.2-2' ) : "0"}}</td>
<td style="cursor:pointer ; text-align: center">{{gettempExac(gps_report.temp)}}</td> <td style="cursor:pointer ; text-align: center">{{gps_report.temp}}</td>
<td style="cursor:pointer ; text-align: center">{{getcummulative_distance(pathReport,i)}}</td> <td style="cursor:pointer ; text-align: center">{{gps_report.getcummulative_distance}}</td>
<!-- <td style="cursor:pointer ; text-align: center;width:40%" *ngIf = "locationOnDemand"> <!-- <td style="cursor:pointer ; text-align: center;width:40%" *ngIf = "locationOnDemand">
<a href={{addressLink}} target="_blank" (click)= getlink(gps_report) md-tooltip="Click to get device's last location"><img height="20px" width="20px" src="../../../assets/image/addressICON.png"></a> <a href={{addressLink}} target="_blank" (click)= getlink(gps_report) md-tooltip="Click to get device's last location"><img height="20px" width="20px" src="../../../assets/image/addressICON.png"></a>
</td> --> </td> -->

View file

@ -236,6 +236,9 @@ this.pathReport=[];
for(let i = 0; i <res.length ; i++){ for(let i = 0; i <res.length ; i++){
if(res[i]!=null){ if(res[i]!=null){
res[i].Device_name = device_name; res[i].Device_name = device_name;
res[i].get_distance == this.get_distance(res, i);
res[i].getcummulative_distance = this.getcummulative_distance(res, i);
res[i].temp = this.gettempExac(res[i].temp);
this.pathReport.push(res[i]); this.pathReport.push(res[i]);
}else{ }else{
console.log('resnullresnullresnullresnullres=>',res[i]); console.log('resnullresnullresnullresnullres=>',res[i]);
@ -292,6 +295,7 @@ get_distance(gps_report,index_1){
} }
export_pdf(){ export_pdf(){
debugger
console.log('pdf'); console.log('pdf');
// jsPDF(orientation, unit, format // jsPDF(orientation, unit, format
@ -323,6 +327,7 @@ export_pdf(){
// cellWidth : 50 // cellWidth : 50
// }, // },
willDrawCell: data => { willDrawCell: data => {
console.log('data', data);
console.log('data=>',data); console.log('data=>',data);
// console.log('data=>',data.row.index.length); // console.log('data=>',data.row.index.length);

View file

@ -231,7 +231,7 @@
<td> <td>
Owner Name : {{userName}}<br> Owner Name : {{userName}}<br>
</td> </td>
<td> <td style="vertical-align: baseline;" colspan="2">
Owner Address : {{userAddress}} Owner Address : {{userAddress}}
</td> </td>
<td> <td>
@ -292,18 +292,22 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td colspan="1">
<h6 style="font-size:18px;margin: 20px 0 10px 0px;">Fitment Images:- </h6> <h6 style="font-size:18px;margin: 20px 0 10px 0px;">Fitment Images:- </h6>
</td> </td>
<td colspan="2" style="text-align: end;">
<!-- {{deviceImage |json}} --> <!-- {{deviceImage |json}} -->
<td style="margin-left: -155px;" *ngIf="deviceImage.length && deviceImage[0]"> <ng-container style="" *ngIf="deviceImage.length && deviceImage[0]">
<img style=" margin-left: -91px;" src="{{deviceImage[0]}}" width="90px" height="90px"> <img style=" " src="{{deviceImage[0]}}" width="90px" height="90px">
</td> </ng-container>
<td *ngIf="deviceImage.length && deviceImage[1]"> <ng-container *ngIf="deviceImage.length && deviceImage[1]">
<img src="{{deviceImage[1]}}" width="90px" height="90px"> <img src="{{deviceImage[1]}}" width="90px" height="90px">
</td> </ng-container>
<td *ngIf="deviceImage.length && deviceImage[2]"> <ng-container *ngIf="deviceImage.length && deviceImage[2]">
<img src="{{deviceImage[2]}}" width="90px" height="90px"> <img src="{{deviceImage[2]}}" width="90px" height="90px">
</ng-container>
</td> </td>
</tr> </tr>
<tr> <tr>

View file

@ -58,7 +58,7 @@ deletetemplate:boolean=false;
dealerAddress: any; dealerAddress: any;
CID_No: any; CID_No: any;
imgUrl: any; imgUrl: any;
imgURL: any; imgURL: any = '';
companyName: any; companyName: any;
companyAddress: any; companyAddress: any;
transportOfficeCity: any; transportOfficeCity: any;
@ -93,19 +93,19 @@ deletetemplate:boolean=false;
this.getUser(); this.getUser();
this.dealerDetail(); this.dealerDetail();
console.log("DATA",this.data); console.log("DATA",this.data);
this.lastDeviceTime=this.data.deviceInfo.last_device_time; this.lastDeviceTime = this.data.deviceInfo.last_device_time ? this.data.deviceInfo.last_device_time:'';
this.lastPingOn=this.data.deviceInfo.last_ping_on this.lastPingOn = this.data.deviceInfo.last_ping_on ? this.data.deviceInfo.last_ping_on:''
this.devName = this.data.deviceInfo.Device_Name; this.devName = this.data.deviceInfo.Device_Name ? this.data.deviceInfo.Device_Name:'';
this.devID = this.data.deviceInfo.Device_ID?this.data.deviceInfo.Device_ID:""; this.devID = this.data.deviceInfo.Device_ID?this.data.deviceInfo.Device_ID:"";
this.phNum =this.data.deviceInfo.contact_number; this.phNum = this.data.deviceInfo.contact_number ? this.data.deviceInfo.contact_number:'';
this.createdOn = this.data.deviceInfo.created_on?(new Date(this.data.deviceInfo.created_on).toISOString()):""; this.createdOn = this.data.deviceInfo.created_on?(new Date(this.data.deviceInfo.created_on).toISOString()):"";
this.expOn = this.data.deviceInfo.expiration_date?(new Date(this.data.deviceInfo.expiration_date).toISOString()):""; this.expOn = this.data.deviceInfo.expiration_date?(new Date(this.data.deviceInfo.expiration_date).toISOString()):"";
// this.iconType=this.data.deviceInfo.iconType; // this.iconType=this.data.deviceInfo.iconType;
this.simNum =this.data.deviceInfo.sim_number; this.simNum = this.data.deviceInfo.sim_number ? this.data.deviceInfo.sim_number:'';
this.orignalEmail = this.data.deviceInfo.Email_ID this.orignalEmail = this.data.deviceInfo.Email_ID ? this.data.deviceInfo.Email_ID:''
this.emailId = this.data.deviceInfo.Email_ID; this.emailId = this.data.deviceInfo.Email_ID ? this.data.deviceInfo.Email_ID:'';
this.deviceImage=this.data.deviceInfo.deviceImage this.deviceImage = this.data.deviceInfo.deviceImage ? this.data.deviceInfo.deviceImage:''
this.deviceImage = this.deviceImage.filter(dFilter=>dFilter);
for(var i=0;i<this.deviceImage.length;i++){ for(var i=0;i<this.deviceImage.length;i++){
this.deviceImage[i] = 'https://www.oneqlik.in' + this.deviceImage[i].substring(6) this.deviceImage[i] = 'https://www.oneqlik.in' + this.deviceImage[i].substring(6)
@ -113,29 +113,29 @@ deletetemplate:boolean=false;
} }
console.log(this.deviceImage); console.log(this.deviceImage);
this.todayODO=this.data.deviceInfo.today_odo; this.todayODO = this.data.deviceInfo.today_odo ? this.data.deviceInfo.today_odo:0;
this.totalODO =this.data.deviceInfo.total_odo; this.totalODO = this.data.deviceInfo.total_odo ? this.data.deviceInfo.total_odo:0;
this.deviceID = this.data.deviceInfo._id; this.deviceID = this.data.deviceInfo._id ? this.data.deviceInfo._id:'';
this.initialUser = this.data.deviceInfo.user._id; this.initialUser = this.data.deviceInfo.user._id ? this.data.deviceInfo.user._id:'';
this.userName = this.data.deviceInfo.OwnerName; this.userName = this.data.deviceInfo.OwnerName ? this.data.deviceInfo.OwnerName:'';
this.userAddress = this.data.deviceInfo?this.data.deviceInfo.user.address:""; this.userAddress = this.data.deviceInfo?this.data.deviceInfo.user.address:"";
this.dealerName = this.data.deviceInfo.Dealer_name ; this.dealerName = this.data.deviceInfo.Dealer_name ? this.data.deviceInfo.Dealer_name:'' ;
this.dealerId = this.data.deviceInfo.Dealer?this.data.deviceInfo.Dealer._id : ""; this.dealerId = this.data.deviceInfo.Dealer?this.data.deviceInfo.Dealer._id : "";
console.log('this.dealerId',this.dealerId); console.log('this.dealerId',this.dealerId);
this.dealerAddress = this.data.deviceInfo.DealerAddress; this.dealerAddress = this.data.deviceInfo.DealerAddress ? this.data.deviceInfo.DealerAddress:'';
this.InvoiceDate = this.data.deviceInfo.invoiceDate?(new Date(this.data.deviceInfo.invoiceDate).toISOString()):""; this.InvoiceDate = this.data.deviceInfo.invoiceDate?(new Date(this.data.deviceInfo.invoiceDate).toISOString()):"";
this.invoiceNum = this.data.deviceInfo.invoiceNumber this.invoiceNum = this.data.deviceInfo.invoiceNumber ? this.data.deviceInfo.invoiceNumber:''
this.CID_No = this.data.deviceInfo.CID_No this.CID_No = this.data.deviceInfo.CID_No ? this.data.deviceInfo.CID_No:''
this.devicetype = this.data.deviceInfo.device_model?this.data.deviceInfo.device_model.device_type:""; this.devicetype = this.data.deviceInfo.device_model?this.data.deviceInfo.device_model.device_type:"";
this.ICCICD = this.data.deviceInfo.ICCICD; this.ICCICD = this.data.deviceInfo.ICCICD ? this.data.deviceInfo.ICCICD:'';
this.IMSI = this.data.deviceInfo.IMSI; this.IMSI = this.data.deviceInfo.IMSI ? this.data.deviceInfo.IMSI:'';
this.uniqueID = this.data.deviceInfo.uniqueID; this.uniqueID = this.data.deviceInfo.uniqueID? this.data.deviceInfo.uniqueID:"";
this.fitmentDate = this.data.deviceInfo.fitmentDate?new Date(this.data.deviceInfo.fitmentDate):""; this.fitmentDate = this.data.deviceInfo.fitmentDate?new Date(this.data.deviceInfo.fitmentDate):"";
this.expiration_date =this.data.deviceInfo.expiration_date?new Date(this.data.deviceInfo.expiration_date):""; this.expiration_date =this.data.deviceInfo.expiration_date?new Date(this.data.deviceInfo.expiration_date):"";
this.engineNo = this.data.deviceInfo.engineNo; this.engineNo = this.data.deviceInfo.engineNo ? this.data.deviceInfo.engineNo:'';
this.typeOfVehicle = this.data.deviceInfo.typeOfVehicle; this.typeOfVehicle = this.data.deviceInfo.typeOfVehicle ? this.data.deviceInfo.typeOfVehicle:'';
this.manufacturingCompany = this.data.deviceInfo.manufacturingCompany; this.manufacturingCompany = this.data.deviceInfo.manufacturingCompany ? this.data.deviceInfo.manufacturingCompany:'';
this.lastFitnessDate = this.data.deviceInfo.lastFitnessDate?new Date(this.data.deviceInfo.lastFitnessDate):""; this.lastFitnessDate = this.data.deviceInfo.lastFitnessDate?new Date(this.data.deviceInfo.lastFitnessDate):"";
this.vehicleRegDate = this.data.deviceInfo.vehicleRegDate? new Date(this.data.deviceInfo.vehicleRegDate):""; this.vehicleRegDate = this.data.deviceInfo.vehicleRegDate? new Date(this.data.deviceInfo.vehicleRegDate):"";
@ -145,13 +145,13 @@ deletetemplate:boolean=false;
// console.log(this.CID_No,this.devicetype,this.ICCICD,this.IMSI,this.uniqueID,this.fitmentDate,this.engineNo,this.typeOfVehicle,this.manufacturingCompany); // console.log(this.CID_No,this.devicetype,this.ICCICD,this.IMSI,this.uniqueID,this.fitmentDate,this.engineNo,this.typeOfVehicle,this.manufacturingCompany);
// console.log(this.lastFitnessDate,this.vehicleRegDate,this.vehicleManufacturingDate,this.lattitude,this.longitude) // console.log(this.lastFitnessDate,this.vehicleRegDate,this.vehicleManufacturingDate,this.lattitude,this.longitude)
if(this.data.deviceInfo['actionId']=="exportPdf"){ if(this.data.deviceInfo['actionId']=="exportPdf"){
this.companyName = this.data.deviceInfo.companyName; this.companyName = this.data.deviceInfo.companyName ? this.data.deviceInfo.companyName:'';
this.companyAddress = this.data.deviceInfo.companyAddress; this.companyAddress = this.data.deviceInfo.companyAddress ? this.data.deviceInfo.companyAddress:'';
this.transportOfficeCity = this.data.deviceInfo.transportOfficeCity; this.transportOfficeCity = this.data.deviceInfo.transportOfficeCity ? this.data.deviceInfo.transportOfficeCity:'';
this.transportOfficeState = this.data.deviceInfo.transportOfficeState; this.transportOfficeState = this.data.deviceInfo.transportOfficeState ? this.data.deviceInfo.transportOfficeState:'';
this.ChassisNo = this.data.deviceInfo.ChassisNo; this.ChassisNo = this.data.deviceInfo.ChassisNo ? this.data.deviceInfo.ChassisNo:'';
this.deviceManufacturer = this.data.deviceInfo.device_model?this.data.deviceInfo.device_model.Manufacturer:""; this.deviceManufacturer = this.data.deviceInfo.device_model?this.data.deviceInfo.device_model.Manufacturer:"";
this.numberOfSOS = this.data.deviceInfo.numberOfSOS; this.numberOfSOS = this.data.deviceInfo.numberOfSOS ? this.data.deviceInfo.numberOfSOS:'';
this.editTemplate =false; this.editTemplate =false;
this.deletetemplate = false; this.deletetemplate = false;
this.ExportPdf =true; this.ExportPdf =true;
@ -433,15 +433,15 @@ filterDistStates(dst){
var myImage = new Image(); var myImage = new Image();
myImage.src = that.deviceImage[0]?that.deviceImage[0]:''; myImage.src = that.deviceImage[0] && that.deviceImage[0] !='' ?that.deviceImage[0]:'';
myImage.crossOrigin="anonymous"; myImage.crossOrigin="anonymous";
var myImage1 = new Image(); var myImage1 = new Image();
myImage1.src = that.deviceImage[1]?that.deviceImage[1]:''; myImage1.src = that.deviceImage[1] && that.deviceImage[1] != '' ?that.deviceImage[1]:'';
myImage1.crossOrigin="anonymous"; myImage1.crossOrigin="anonymous";
var myImage2 = new Image(); var myImage2 = new Image();
myImage2.src = that.deviceImage[2]?that.deviceImage[2]:''; myImage2.src = that.deviceImage[2] && that.deviceImage[2] != '' ?that.deviceImage[2]:'';
myImage2.crossOrigin="anonymous"; myImage2.crossOrigin="anonymous";
if(that.deviceImage.length==0){ if(that.deviceImage.length==0){
@ -450,38 +450,48 @@ filterDistStates(dst){
function f1() { function f1() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if(myImage.src) {
myImage.onload = function () { myImage.onload = function () {
console.log("1"); console.log("1");
doc.addImage(myImage , 'png', 40, 180, 30, 20); doc.setPage(1);
doc.addImage(myImage, 'png', 160, 213, 20, 20);
if (that.deviceImage.length == 1) { if (that.deviceImage.length == 1) {
doc.save('sample-file.pdf'); doc.save('sample-file.pdf');
} }
}; };
}
resolve(''); resolve('');
}); });
} }
function f3(){ function f3(){
if (myImage2) {
myImage2.onload = function () { myImage2.onload = function () {
console.log("3"); console.log("3");
doc.setPage(1);
doc.addImage(myImage2 , 'png', 80, 180, 30, 20); doc.addImage(myImage2, 'png', 100, 213, 20, 20);
doc.save('sample-file.pdf'); doc.save('sample-file.pdf');
}; };
} }
}
function f2() { function f2() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (myImage1) {
myImage1.onload = function () { myImage1.onload = function () {
console.log("2"); console.log("2");
doc.addImage(myImage1 , 'png', 60, 180, 30, 20); doc.setPage(1);
doc.addImage(myImage1, 'png', 130, 213, 20, 20);
if (that.deviceImage.length == 2) { if (that.deviceImage.length == 2) {
doc.save('sample-file.pdf'); doc.save('sample-file.pdf');
} }
}; };
}
resolve(''); resolve('');
}) })

View file

@ -32,7 +32,7 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4" *ngIf="!inventoryManagement"> <div class="form-group col-md-4" *ngIf="!inventoryManagement">
<label for="inputPassword4">{{"Device ID (IMEI No.)" | translate}}</label> <span>*</span> <label for="inputPassword4">{{"Device ID (IMEI No.)" | translate}}</label> <span>*</span>
<input [(ngModel)]=" deviceid" name=" deviceid" placeholder="Please Enter Device ID (IMEI)" type="text" class="form-control"> <input (keyup)="removeSpecialChar()" [(ngModel)]=" deviceid" name=" deviceid" placeholder="Please Enter Device ID (IMEI)" type="text" class="form-control">
</div> </div>
<div class="form-group col-md-4" *ngIf="inventoryManagement"> <div class="form-group col-md-4" *ngIf="inventoryManagement">

View file

@ -548,7 +548,11 @@ export class DialogContentExampleDialogComponent implements OnInit {
} }
showDate:boolean=false; showDate:boolean=false;
removeSpecialChar() {
if (this.deviceid) {
this.deviceid = this.deviceid.replaceAll(/[^0-9 ]/g, "").replaceAll(' ', '');
}
}
addDevice(btnindex) { addDevice(btnindex) {
console.log("In addDevice"); console.log("In addDevice");
@ -606,9 +610,20 @@ console.log("1");
// console.log("userDetailTopass",this.userDetail._id); // console.log("userDetailTopass",this.userDetail._id);
// console.log("vehdata",this.vehType._id) // console.log("vehdata",this.vehType._id)
//this._flashMessagesService.show('Congratulation Device Added as '+this.deviceid, { cssClass: 'alert-success', timeout: 2000 }); //this._flashMessagesService.show('Congratulation Device Added as '+this.deviceid, { cssClass: 'alert-success', timeout: 2000 });
let expDateObj ;
if (this.expDate) {
expDateObj = new Date(this.expDate);
} else {
var eDate = new Date();
var LifeTimeyear = eDate.getFullYear() + 5;
eDate.setFullYear(LifeTimeyear);
expDateObj = new Date(eDate);
}
this.newDevice = { this.newDevice = {
devicename: this.devicename, devicename: this.devicename,
deviceid: this.deviceid, deviceid: this.deviceid ? this.deviceid.replaceAll(/[^0-9]/g, "") : this.deviceid,
des: this.des, des: this.des,
model: this.model, model: this.model,
hrdwr: this.hrdwr, hrdwr: this.hrdwr,
@ -622,7 +637,7 @@ console.log("1");
driver_name: this.driver, driver_name: this.driver,
contact_number: this.dcontact, contact_number: this.dcontact,
device_model: this.DeviceModelValue, device_model: this.DeviceModelValue,
expdate: new Date(this.expDate), expdate: expDateObj,
License : this.licenseVal, License : this.licenseVal,
deviceDistanceVariation:this.selcetedSign+(this.deviceDistanceVariation?this.deviceDistanceVariation:'0') deviceDistanceVariation:this.selcetedSign+(this.deviceDistanceVariation?this.deviceDistanceVariation:'0')
@ -1835,6 +1850,7 @@ onUpload(imgIndex) {
failedReason:any; failedReason:any;
failedUploadFiles:any; failedUploadFiles:any;
uploadExcel(){ uploadExcel(){
console.log("Device Json Payload",this.uploadJSON); console.log("Device Json Payload",this.uploadJSON);
this.failedUploadFiles = []; this.failedUploadFiles = [];
this.Load =true; this.Load =true;

View file

@ -74,6 +74,7 @@
<th style="text-align:left;">{{'Address' | translate}}</th> <th style="text-align:left;">{{'Address' | translate}}</th>
<th style="text-align:left;">{{'Organisation Name' | translate}}</th> <th style="text-align:left;">{{'Organisation Name' | translate}}</th>
<th style="text-align:left;">{{'Point Allocated' | translate}}</th> <th style="text-align:left;">{{'Point Allocated' | translate}}</th>
<th style="text-align:left;">{{'No Of Devices' | translate}}</th>
<!-- <th style="text-align:left;">{{'Available Points' | translate}}</th> --> <!-- <th style="text-align:left;">{{'Available Points' | translate}}</th> -->
<th style="text-align:left;">{{'Point Shared' | translate}}</th> <th style="text-align:left;">{{'Point Shared' | translate}}</th>
<th style="text-align:left;">{{'Status' | translate}}</th> <th style="text-align:left;">{{'Status' | translate}}</th>

View file

@ -61,7 +61,6 @@ export class DistributersListComponent implements OnInit {
.distinctUntilChanged() // only emit if value is different from previous value .distinctUntilChanged() // only emit if value is different from previous value
.subscribe(myInput => { .subscribe(myInput => {
this.myInput = myInput; this.myInput = myInput;
console.log('this.myInput in constructor = > ',this.myInput);
this.tabelObj.draw(); this.tabelObj.draw();
@ -194,13 +193,20 @@ export class DistributersListComponent implements OnInit {
dataTablesParameters.sort = {_id :-1} dataTablesParameters.sort = {_id :-1}
var suburl = ""; var suburl = "";
suburl += "/users/datatable"; suburl += "/users/distributorsWithDeviceCounts";
// console.log(suburl); // console.log(suburl);
// console.log(dataTablesParameters); // console.log(dataTablesParameters);
// console.log(suburl) // console.log(suburl)
that.contactService.post(suburl, dataTablesParameters).subscribe(resp => { that.contactService.post(suburl, {
"organisation": that.useridd,
"search":that.myInput,
"skip": dataTablesParameters.start / dataTablesParameters.length,
"limit": dataTablesParameters.length
}).subscribe(resp => {
callback(resp); callback({
draw: 0, recordsFiltered: resp['count'], recordsTotal: resp['count'], data: resp['response']
});
}, err => { }, err => {
// console.log(err); // console.log(err);
@ -324,7 +330,6 @@ export class DistributersListComponent implements OnInit {
"data": "phone", "data": "phone",
"render": function (data, type, row) { "render": function (data, type, row) {
console.log('row=>',row);
var phoneShow = ''; var phoneShow = '';
if(row.std_code != undefined){ if(row.std_code != undefined){
phoneShow ='+' + row.std_code.dialcode + '-' + data ; phoneShow ='+' + row.std_code.dialcode + '-' + data ;
@ -358,6 +363,12 @@ export class DistributersListComponent implements OnInit {
return data ? data : ""; return data ? data : "";
} }
}, },
{
"data": "noOfDevices",
"render": function (data, type, row) {
return data ? data.total : 0;
}
},
// { // {
// "data" : "_id", // "data" : "_id",
// "render" : function(data, type,row){ // "render" : function(data, type,row){

View file

@ -61,6 +61,11 @@
<md-error class="required">{{'Enter Address' | translate}}</md-error> <md-error class="required">{{'Enter Address' | translate}}</md-error>
</md-form-field> </md-form-field>
</div> </div>
<div class="row">
<span style="margin-right: 10px;">{{'Bussiness Type' | translate}}</span>
<md-slide-toggle style="float: right;margin-top: 5px;" [(ngModel)]="bussinessType" ngDefaultControl>
</md-slide-toggle>
</div>
<div class="row" style="padding-left:38%"> <div class="row" style="padding-left:38%">
<button class="btn btn-primary btn-block/"(click)="editDealer()" style="background:green;cursor:pointer;width: 159px;height: 44px;">EDIT DEALER</button> <button class="btn btn-primary btn-block/"(click)="editDealer()" style="background:green;cursor:pointer;width: 159px;height: 44px;">EDIT DEALER</button>

View file

@ -8,7 +8,7 @@ import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
styleUrls: ['./edit-dealer.component.scss'] styleUrls: ['./edit-dealer.component.scss']
}) })
export class EditDealerComponent implements OnInit { export class EditDealerComponent implements OnInit {
bussinessType: boolean = false;
dealerInfo:any; dealerInfo:any;
dealerEditForm:any; dealerEditForm:any;
firstName:any; firstName:any;
@ -37,7 +37,9 @@ export class EditDealerComponent implements OnInit {
this.PhoneNum = this.dealerInfo.dealer_payload.phone?this.dealerInfo.dealer_payload.phone:''; this.PhoneNum = this.dealerInfo.dealer_payload.phone?this.dealerInfo.dealer_payload.phone:'';
this.address =this.dealerInfo.dealer_payload.address?this.dealerInfo.dealer_payload.address:''; this.address =this.dealerInfo.dealer_payload.address?this.dealerInfo.dealer_payload.address:'';
this.expDate = this.dealerInfo.dealer_payload.expire_date?this.dealerInfo.dealer_payload.expire_date:''; this.expDate = this.dealerInfo.dealer_payload.expire_date?this.dealerInfo.dealer_payload.expire_date:'';
console.log(this.dealerInfo); this.bussinessType = this.dealerInfo.dealer_payload.bussinessType ? this.dealerInfo.dealer_payload.bussinessType == "1" ? true : false : false
// this.bussinessType = this.dealerInfo.dealer_payload.bussinessType!=undefined ? this.dealerInfo.dealer_payload.bussinessType : false;
console.log(this.dealerInfo, this.bussinessType);
// this.pageId = this.dealerInfo.id; // this.pageId = this.dealerInfo.id;
// console.log("PAGEID=>",this.pageId); // console.log("PAGEID=>",this.pageId);
@ -64,6 +66,11 @@ export class EditDealerComponent implements OnInit {
expire_date:new Date(this.expDate), expire_date:new Date(this.expDate),
} }
if (this.bussinessType != undefined) {
editDealerPayload['bussinessType'] = this.bussinessType ? "1" : "0";
}
// this.dealerInfo.dealer_payload.status // this.dealerInfo.dealer_payload.status
if(this.PhoneNum !== this.dealerInfo.dealer_payload.phone){ if(this.PhoneNum !== this.dealerInfo.dealer_payload.phone){
editDealerPayload['phone'] = this.PhoneNum editDealerPayload['phone'] = this.PhoneNum

View file

@ -17,6 +17,7 @@ import { FlashMessagesService } from 'angular2-flash-messages';
export class GpsMasterComponent implements OnInit { export class GpsMasterComponent implements OnInit {
Fromdate=new Date(); Fromdate=new Date();
todate=new Date(); todate=new Date();
reportData : any = [];
tabelObj: any; tabelObj: any;
emailid: any; emailid: any;
useridd: any; useridd: any;
@ -148,10 +149,13 @@ export class GpsMasterComponent implements OnInit {
// if(id != 0) // if(id != 0)
console.log('calling api'); console.log('calling api');
that.contactService.post(suburl, dataTablesParameters).subscribe(resp => { that.contactService.post(suburl, dataTablesParameters).subscribe(resp => {
// console.log('resp',resp);
that.reportData = resp['data'];
callback(resp); callback(resp);
}, err => { }, err => {
// console.log(err); // console.log(err);
// console.log(err.status); // console.log(err.status);
that.reportData = [];
callback({data:[]}) callback({data:[]})
}); });
@ -377,7 +381,96 @@ deviceName1:any;
tab:any; tab:any;
exportExcel() exportExcel() {
this.downloadFile(this.reportData)
}
downloadFile(data) {
let arrHeader = ['imei','latDecimal','longDecimal','speed','date','insertionTime','syncedAt','integrationResponse','ignition','power','GPS','isFluctuation','isPastData','external_Battery','fuelVoltage','currentFuel','raw','ac','powerCutAlarm','satellites'] ;
let csvData = this.ConvertToCSV(data, arrHeader);
let blob = new Blob(['\ufeff' + csvData], { type: 'text/csv;charset=utf-8;' });
let dwldLink = document.createElement("a");
let url = URL.createObjectURL(blob);
let isSafariBrowser = navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1;
if (isSafariBrowser) { //if Safari open in new window to save file with random filename.
dwldLink.setAttribute("target", "_blank");
}
dwldLink.setAttribute("href", url);
dwldLink.setAttribute("download", "systemLogs.csv");
dwldLink.style.visibility = "hidden";
document.body.appendChild(dwldLink);
dwldLink.click();
document.body.removeChild(dwldLink);
this.Load = false;
}
convertToDate(element, key) {
if (element[key]) {
var device_time = new Date(element[key]);
return device_time ? (moment(device_time).format('dddd,ll,LTS')) : "";
} else {
return element[key]
}
}
ConvertToCSV(objArray, headerList) {
let array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
array = JSON.parse(JSON.stringify(array));
array.forEach(element => {
element['date'] = this.convertToDate(element,'date');
element['insertionTime'] = this.convertToDate(element, 'insertionTime')
element['syncedAt'] = this.convertToDate(element, 'syncedAt')
element['date'] = this.convertToDate(element, 'date')
if (element.integrationResponse){
if (typeof (element.integrationResponse) === 'object') {
element.integrationResponse = JSON.stringify(element.integrationResponse);
}
}
if (element.fuelVoltage) {
element.fuelVoltage = element.fuelVoltage ? (element.fuelVoltage / 1000).toFixed(2):'';
}
});
// console.log(array,"<===");Distance 126.94
// Running 2:1
// Idle 1:56
// Stop
let str = 'Customer List \r\n';
let row = 'S.No,';
// name,emial,phone,id,password and status no of vehicles
let newHeaders = ['Device IMEI', 'Lattitude', 'Longitude', 'Speed', 'Device Time', 'Insertion Time', 'Last Push', 'Integration Respnse', 'Ignition', 'Power', 'GPS positioned', 'isFluctuation', 'isPastData', 'Ext. Volt.', 'Fuel Volt.', 'Fuel Value (L)', 'Raw Data', 'AC', 'Powercut Alarm', 'Sattelite'];
for (let index in newHeaders) {
row += newHeaders[index] + ',';
}
row = row.slice(0, -1);
str += row + '\r\n';
for (let i = 0; i < array.length; i++) {
let line = (i + 1) + '';
if (i < array.length) { }
for (let index in headerList) {
let head = headerList[index];
line += ',' + this.strRep(array[i][head]);
}
str += line + '\r\n';
}
return str;
}
strRep(data) {
if (typeof data == "string") {
let newData = data.replace(/,/g, " ");
return newData;
}
else if (typeof data == "undefined") {
return "-";
}
else if (typeof data == "number") {
return data.toString();
}
else {
return data;
}
}
exportExcelOld()
{ {
var tab_text="<table border='2px'><tr bgcolor='#87AFC6'>"; var tab_text="<table border='2px'><tr bgcolor='#87AFC6'>";

View file

@ -21,7 +21,20 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of imageDoc"> <tr *ngFor="let item of imageDoc">
<td><img style="width: 100px;" [src]="'https://www.oneqlik.in'+item.image.substring(6)" (click)="openModal(template,item)"></td> <td *ngIf="hasPdfFile(item.image); else pdfSection">
<a target="_blank" [href]="'https://www.oneqlik.in'+item.image.substring(6)">
<i class="fas fa-file-pdf fa-3x pl-4"></i>
</a>
<td>
<ng-template #pdfSection>
<td>
<img *ngIf="item.image ; else notAvaillableImg" style="width: 100px;" [src]="'https://www.oneqlik.in'+item.image.substring(6)" (click)="openModal(template,item)">
<ng-template #notAvaillableImg>Not Available</ng-template>
</td>
</ng-template>
<td>{{item.phone}}</td> <td>{{item.phone}}</td>
<td>{{item.doctype}}</td> <td>{{item.doctype}}</td>
</tr> </tr>

View file

@ -121,7 +121,9 @@ export class DeviceDocComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.bsConfig = Object.assign({}, { containerClass: 'theme-dark-blue' }); this.bsConfig = Object.assign({}, { containerClass: 'theme-dark-blue' });
} }
hasPdfFile(url) {
return url && url.indexOf(".pdf") != -1;
}
AddDocumentsField(addedRow:any){ AddDocumentsField(addedRow:any){
@ -271,8 +273,10 @@ titleForDoc
openModal(template: TemplateRef<any>,doc){ openModal(template: TemplateRef<any>,doc){
this.modalRef = this.modalService.show(template,{'backdrop':'static',class:'modal-dialog-centered'}); this.modalRef = this.modalService.show(template,{'backdrop':'static',class:'modal-dialog-centered'});
// this.number=doc.phone; // this.number=doc.phone;
var name=(this.data.dealer_payload.user?this.data.dealer_payload.user.first_name?this.data.dealer_payload.user.first_name:"":''+" "+ let fname = this.data.dealer_payload.user && this.data.dealer_payload.user.first_name ? this.data.dealer_payload.user.first_name : "";
this.data.dealer_payload.user?this.data.dealer_payload.user.last_name?this.data.dealer_payload.user.last_name:"":'') let lName = this.data.dealer_payload.user && this.data.dealer_payload.user.last_name ? this.data.dealer_payload.user.last_name : '';
var name = fname + " " + lName
this.titleForDoc=doc.doctype?doc.doctype=="Adhar card1"?"Adhar card Front":doc.doctype=="Adhar card2"?"Adhar card Back":doc.doctype:doc.doctype this.titleForDoc=doc.doctype?doc.doctype=="Adhar card1"?"Adhar card Front":doc.doctype=="Adhar card2"?"Adhar card Back":doc.doctype:doc.doctype
this.key=[]; this.key=[];
this.value=[] this.value=[]
@ -283,6 +287,7 @@ openModal(template: TemplateRef<any>,doc){
doc.phone] doc.phone]
}else if(doc.doctype=="Adhar card2" || doc.doctype=="Adhar card2 *"){ }else if(doc.doctype=="Adhar card2" || doc.doctype=="Adhar card2 *"){
this.key=['Name',"Address","Adhaar no"]; this.key=['Name',"Address","Adhaar no"];
this.value=[this.data.dealer_payload.user?this.data.dealer_payload.user.first_name?this.data.dealer_payload.user.first_name:"":''+" "+ this.value=[this.data.dealer_payload.user?this.data.dealer_payload.user.first_name?this.data.dealer_payload.user.first_name:"":''+" "+
this.data.dealer_payload.user?this.data.dealer_payload.user.last_name?this.data.dealer_payload.user.last_name:"":'', this.data.dealer_payload.user?this.data.dealer_payload.user.last_name?this.data.dealer_payload.user.last_name:"":'',
@ -297,7 +302,7 @@ openModal(template: TemplateRef<any>,doc){
this.data.dealer_payload.ChassisNo?this.data.dealer_payload.ChassisNo:"", this.data.dealer_payload.ChassisNo?this.data.dealer_payload.ChassisNo:"",
doc.phone] doc.phone]
console.log('this.value', this.value, name)
}else if(doc.doctype=="vehicle RC"|| doc.doctype=="vehicle RC"){ }else if(doc.doctype=="vehicle RC"|| doc.doctype=="vehicle RC"){
this.key=['Name',"Vehicle Number","Address","Engine No.","Chassis No.","Number"]; this.key=['Name',"Vehicle Number","Address","Engine No.","Chassis No.","Number"];
this.value=[name, this.value=[name,

View file

@ -170,6 +170,9 @@
<th> <th>
{{ "View" | translate }} {{ "View" | translate }}
</th> </th>
<th>
{{ "Edit" | translate }}
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -355,6 +358,10 @@
<td style="text-align: center; cursor: pointer"> <td style="text-align: center; cursor: pointer">
<i class="fas fa-eye" (click)="viewDocuments(cust_array)"></i> <i class="fas fa-eye" (click)="viewDocuments(cust_array)"></i>
</td> </td>
<td style="text-align: center; cursor: pointer">
<i id="edit" (click)="editDevice(cust_array)" title="Edit Vehicle" style="font-size:20px;color: green" class="fas fa-edit"></i>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -16,6 +16,7 @@ import { NormalCertComponent } from '../../device/normal-cert/normal-cert.compon
import { CertOptionComponent } from '../../device/cert-option/cert-option.component'; import { CertOptionComponent } from '../../device/cert-option/cert-option.component';
import { EditDeviceMasterComponent } from '../../device/edit-device-master/edit-device-master.component'; import { EditDeviceMasterComponent } from '../../device/edit-device-master/edit-device-master.component';
declare var swal: any; declare var swal: any;
import * as moment from 'moment';
@Component({ @Component({
selector: 'app-device-kyc', selector: 'app-device-kyc',
@ -335,6 +336,11 @@ searchFilter(text: string) {
// that.limit = len; // that.limit = len;
this.getCustomer(); this.getCustomer();
} }
editDevice(data) {
localStorage.setItem('deviceData', JSON.stringify(data))
localStorage.setItem('KycApprovalRedirect','true');
this.router.navigate(['/editDevice']);
}
getCustomer(){ getCustomer(){
this.Load = true; this.Load = true;
var url="/devices/getAllVehi?id="+this.organisation+"&skip="+this.skip+'&limit='+this.limit var url="/devices/getAllVehi?id="+this.organisation+"&skip="+this.skip+'&limit='+this.limit
@ -452,10 +458,31 @@ tab:any;
// var custumer=[]; // var custumer=[];
// custumer = data; // custumer = data;
for(var i=0;i<this.custumer.length;i++){ for(var i=0;i<this.custumer.length;i++){
this.custumer[i].email=this.custumer[i].user.email?this.custumer[i].user.email:'' this.custumer[i].DocName = '-';
this.custumer[i].user_id=this.custumer[i].user.user_id?this.custumer[i].user.user_id:'' this.custumer[i].device_Type_csv = this.custumer[i].device_model && this.custumer[i].device_model.device_type ? this.custumer[i].device_model.device_type :''
this.custumer[i].phone=this.custumer[i].user.phone?this.custumer[i].user.phone:'' this.custumer[i].adharNumber = '-';
this.custumer[i].fullName=this.custumer[i].user.first_name?this.custumer[i].user.first_name:''+" "+this.custumer[i].user.last_name?this.custumer[i].user.last_name:''; if (this.custumer[i].imageDoc && this.custumer[i].imageDoc.length) {
let findData = this.custumer[i].imageDoc.find(dImageDoc => dImageDoc.doctype == 'Adhar card1 *');
if (findData) {
this.custumer[i].DocName = 'Aadhar Card';
this.custumer[i].adharNumber = findData.phone ? findData.phone.replaceAll('-','') : '-' ;
}
}
let lastName = this.custumer[i].user && this.custumer[i].user.last_name ? this.custumer[i].user.last_name : '';
console.log(lastName);
this.custumer[i].Dphone ='-';
this.custumer[i].kycApprovalDateOnly = moment(this.custumer[i].kycApprovalDate).format("DD/MM/YYYY");
this.custumer[i].fuelType = '-';
this.custumer[i].stateServer = '-';
this.custumer[i].email = this.custumer[i].user && this.custumer[i].user.email ? this.custumer[i].user.email : ''
this.custumer[i].Dealer_full_name = (this.custumer[i] && this.custumer[i].Dealer && this.custumer[i].Dealer.first_name ? this.custumer[i].Dealer.first_name : '') + ' ' + (this.custumer[i] && this.custumer[i].Dealer &&this.custumer[i].Dealer.last_name ? this.custumer[i].Dealer.last_name : '')
//this.custumer[i].Dealer_full_name = (this.custumer[i].Dealer.first_name ? this.custumer[i].Dealer.first_name : '') + ' ' +(this.custumer[i].Dealer.last_name ? this.custumer[i].Dealer.last_name : '');
// this.custumer[i].email=this.custumer[i].user.email?this.custumer[i].user.email:''
this.custumer[i].user_id = this.custumer[i].user && this.custumer[i].user.user_id?this.custumer[i].user.user_id:''
this.custumer[i].phone = this.custumer[i].user && this.custumer[i].user.phone?this.custumer[i].user.phone:'';
this.custumer[i].address = this.custumer[i].user && this.custumer[i].user.address ? this.custumer[i].user.address : ''
this.custumer[i].fullName = (this.custumer[i].user && this.custumer[i].user.first_name ? this.custumer[i].user.first_name : '') + " " + (lastName ? lastName :'');
console.log(this.custumer[i].fullName);
if(i==(this.custumer.length-1)){ if(i==(this.custumer.length-1)){
this.downloadFile(this.custumer); this.downloadFile(this.custumer);
@ -479,8 +506,8 @@ tab:any;
} }
downloadFile(data) { downloadFile(data) {
let arrHeader = ["Device_ID", "kycApprovalDateOnly", "vahanID", "device_Type_csv", "IccidNo", "sim_number", "sim_number2", 'sim_provider', 'License', 'Dealer_full_name', 'phone', 'DocName', 'adharNumber', "fullName", "ConcernPersonName", 'phone', 'manufacturingCompany', 'Model', 'ChassisNo', 'engineNo', 'fuelType', 'Device_Name', 'transportOfficeCity', 'transportOfficeState', 'pin', "transportOfficeState", 'rto', "stateServer", 'state_certifcate_date', 'DocName', 'adharNumber', 'address'];
let arrHeader = ["fullName", "email", "phone", "user_id","kycStatus","Device_Name","Device_ID","esim_validity","remark","RtoState","RtoCity"]; let arrHeaderOld = ["fullName", "email", "phone", "user_id","kycStatus","Device_Name","Device_ID","esim_validity","remark","RtoState","RtoCity"];
let csvData = this.ConvertToCSV(data, arrHeader); let csvData = this.ConvertToCSV(data, arrHeader);
let blob = new Blob(['\ufeff' + csvData], { type: 'text/csv;charset=utf-8;' }); let blob = new Blob(['\ufeff' + csvData], { type: 'text/csv;charset=utf-8;' });
let dwldLink = document.createElement("a"); let dwldLink = document.createElement("a");
@ -507,7 +534,8 @@ tab:any;
let str = 'Customer List \r\n'; let str = 'Customer List \r\n';
let row = 'S.No,'; let row = 'S.No,';
// name,emial,phone,id,password and status no of vehicles // name,emial,phone,id,password and status no of vehicles
let newHeaders =["Name", "Email", "Phone", "User id","KYC Status","Device Name","IMEI","E Sim Validity","Remark","RTO State","RTO City"]; let newHeaders = ['IMEI NO.', 'KYC Approve Date', 'DEVICE ID', 'Device Model', 'ICCID NO.', 'SIM 1', 'SIM 2', 'Profile', 'Plan', 'Dealership- Distributor Name', 'D. Mobile', 'ID Proof Document', 'ID NO', 'Customer Name', 'Concern Person Name', 'Mobile No', 'MAKE BY', 'Model', 'Chassis No', 'Engine No', 'Fuel Type', 'Vehicle No.', 'CITY', 'State', 'PIN', 'RTO STATE', 'RTO NAME', 'STATE SERVER', 'State certificate Generation Date', 'Address Proof Document', 'Address ProofDocument No.', 'ADDRESS'];
let newHeadersOld =["Name", "Email", "Phone", "User id","KYC Status","Device Name","IMEI","E Sim Validity","Remark","RTO State","RTO City"];
for (let index in newHeaders) { for (let index in newHeaders) {
row += newHeaders[index] + ','; row += newHeaders[index] + ',';

View file

@ -28,7 +28,7 @@
name="fontStyle" aria-label="Font Style"> name="fontStyle" aria-label="Font Style">
<md-button-toggle style="width: 100%;font-size: 12px; text-align: center;" <md-button-toggle style="width: 100%;font-size: 12px; text-align: center;"
*ngFor="let vehStatus of AllVeh" *ngFor="let vehStatus of AllVeh"
[ngClass]="{ 'selectedRunning' :(vehStatus.status == 'Running'), 'deselected' : !vehStatus.status, 'selectedStopped' :(vehStatus.status == 'Stopped'), 'Inactice' :(vehStatus.status == 'Inactive'),'selectIdling' :(vehStatus.status == 'Idle'), 'selectedNodata' : (vehStatus.status == 'No data')}"> [ngClass]="{ 'selectedTotal' :(vehStatus.status == 'Total'),'selectedRunning' :(vehStatus.status == 'Running'), 'deselected' : !vehStatus.status, 'selectedStopped' :(vehStatus.status == 'Stopped'), 'Inactice' :(vehStatus.status == 'Inactive'),'selectIdling' :(vehStatus.status == 'Idle'), 'selectedNodata' : (vehStatus.status == 'No data')}">
<div (click)="getDeviceBYfilter(vehStatus.status,'tclick')"> <div (click)="getDeviceBYfilter(vehStatus.status,'tclick')">
{{vehStatus.totalCount}} {{vehStatus.totalCount}}
{{vehStatus.status | translate}} {{vehStatus.status | translate}}
@ -246,7 +246,7 @@
</div> </div>
<md-input-container *ngIf="devReady === true" style="width: 100%;height:40px;font-size: 12px;" [disabled]='disableSearch'> <md-input-container *ngIf="devReady === true" style="width: 100%;height:40px;font-size: 12px;" [disabled]='disableSearch'>
<input mdInput placeholder="Search" [mdAutocomplete]="tdAuto" name="state" #state="ngModel" <input mdInput placeholder="Search" [mdAutocomplete]="tdAuto" name="state" #state="ngModel"
[(ngModel)]="deviceName" (ngModelChange)="filterDevices(deviceName)" [(ngModel)]="deviceName" (ngModelChange)="filterDevicesNew(deviceName)"
[disabled]='disableSearch'> [disabled]='disableSearch'>
<md-autocomplete #tdAuto="mdAutocomplete"> <md-autocomplete #tdAuto="mdAutocomplete">
<md-option *ngFor="let device of foods" [value]="device.viewValue" (click)="change(device)"> <md-option *ngFor="let device of foods" [value]="device.viewValue" (click)="change(device)">
@ -941,14 +941,15 @@
<i class="far fa-play-circle" *ngIf="tempMapHistory[i].flag=='init'" (click)="play(i)" mdTooltip="{{'Play History' | translate}}" style="width: 34px;height: 34px;font-size: 34px;color: #1eacb2;"></i> <i class="far fa-play-circle" *ngIf="tempMapHistory[i].flag=='init'" (click)="play(i)" mdTooltip="{{'Play History' | translate}}" style="width: 34px;height: 34px;font-size: 34px;color: #1eacb2;"></i>
<i class="far fa-play-circle" *ngIf="tempMapHistory[i].flag=='start'" (click)="play(i)" mdTooltip="{{'Play History' | translate}}" style="width: 34px;height: 34px;font-size: 34px;color: #1eacb2;"></i> <i class="far fa-play-circle" *ngIf="tempMapHistory[i].flag=='start'" (click)="play(i)" mdTooltip="{{'Play History' | translate}}" style="width: 34px;height: 34px;font-size: 34px;color: #1eacb2;"></i>
<i class="far fa-pause-circle" *ngIf="tempMapHistory[i].flag=='stop'" (click)="play(i)" mdTooltip="{{'Pause' | translate}}" style="width: 34px;height: 34px;font-size: 34px;color: #1eacb2;"></i> <i class="far fa-pause-circle" *ngIf="tempMapHistory[i].flag=='stop'" (click)="play(i)" mdTooltip="{{'Pause' | translate}}" style="width: 34px;height: 34px;font-size: 34px;color: #1eacb2;"></i>
<i class="fas fa-redo " *ngIf="sliderValue == seekBarValue && sliderValue != 0" (click)="replay(i)" mdTooltip="{{'Play History' | translate}}" style="width: 34px;height: 34px;font-size: 31px;color: #1eacb2;"></i>
</div> </div>
<input type="range" min="0" max={{seekBarValue}} [(ngModel)]="sliderValue" class="slider" id="slider1" style="width: 200px;margin-left: 20px;margin-right: 20px; box-shadow: 0px 0px 6px 5px lightg" (change)="zoomSet()"> <input type="range" min="0" max={{seekBarValue}} [(ngModel)]="sliderValue" class="slider" id="slider1" style="width: 200px;margin-left: 20px;margin-right: 20px; box-shadow: 0px 0px 6px 5px lightg" (change)="zoomSet()">
<!-- (change)="changeRange()" --> <!-- (change)="changeRange()" -->
<div class="kWgQNm" id="myDIV"> <div class="kWgQNm" id="myDIV">
<div width="30px" cursor="pointer" font-size="14px" color="#1EACB2" class="sc-bdVaJa dfmgGo active" (click)="changeSpeed(1)">1x</div> <div width="30px" cursor="pointer" font-size="14px" color="#1EACB2" [class.active]="speed == 100 || speed == 0" class="sc-bdVaJa dfmgGo" (click)="changeSpeed(1)">1x</div>
<div width="30px" cursor="pointer" font-size="14px" color="#1EACB2" class="sc-bdVaJa jXaklS" (click)="changeSpeed(2)">2x</div> <div width="30px" cursor="pointer" font-size="14px" color="#1EACB2" class="sc-bdVaJa jXaklS" [class.active]="speed == 200" (click)="changeSpeed(2)">2x</div>
<div width="30px" cursor="pointer" font-size="14px" color="#1EACB2" class="sc-bdVaJa jXaklS" (click)="changeSpeed(5)">5x</div> <div width="30px" cursor="pointer" font-size="14px" color="#1EACB2" class="sc-bdVaJa jXaklS" [class.active]="speed == 500" (click)="changeSpeed(5)">5x</div>
<div width="30px" cursor="pointer" font-size="14px" color="#FFFFFF" class="sc-bdVaJa bvKoMW" (click)="changeSpeed(10)">10x</div> <div width="30px" cursor="pointer" font-size="14px" color="#FFFFFF" class="sc-bdVaJa bvKoMW" [class.active]="speed == 1000" (click)="changeSpeed(10)">10x</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -30,6 +30,12 @@
border-right: 2px solid #ededed; border-right: 2px solid #ededed;
} }
.selectedTotal{
background: #9341acc7;
color: white;
border-right: 2px solid #ededed;
}
.selectedStopped{ .selectedStopped{
background: #cb0000d9; background: #cb0000d9;
color: white; color: white;

View file

@ -25,6 +25,7 @@ import { AddDeviceComponent } from './add-device/add-device.component';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { ShoRoutePlanComponent } from './sho-route-plan/sho-route-plan.component'; import { ShoRoutePlanComponent } from './sho-route-plan/sho-route-plan.component';
declare var jsPDF : any; declare var jsPDF : any;
declare var html2canvas:any declare var html2canvas:any
@ -52,7 +53,7 @@ export class LocationComponent implements OnInit, OnDestroy {
modelChanged: Subject<string> = new Subject<string>(); modelChanged: Subject<string> = new Subject<string>();
area=0; area=0;
toppings = new FormControl(); toppings = new FormControl();
isLastPosition =false;
toppingList: string[] = ['Extra cheese', 'Mushroom', 'Onion', 'Pepperoni', 'Sausage', 'Tomato']; toppingList: string[] = ['Extra cheese', 'Mushroom', 'Onion', 'Pepperoni', 'Sausage', 'Tomato'];
imei imei
// private fuelComponent: SidemenuFuelComponent; // private fuelComponent: SidemenuFuelComponent;
@ -149,6 +150,7 @@ export class LocationComponent implements OnInit, OnDestroy {
maintanance: any; maintanance: any;
expiredDevices: any; expiredDevices: any;
OutOfReach: any; OutOfReach: any;
totalDevices:any;
no_data: any; no_data: any;
Running: any; Running: any;
idle_duration: any; idle_duration: any;
@ -546,6 +548,7 @@ export class LocationComponent implements OnInit, OnDestroy {
offline: Boolean = false; offline: Boolean = false;
geo: Boolean = false; geo: Boolean = false;
foods = []; foods = [];
masterFoods = [];
devmap(a) { devmap(a) {
// console.log(a); // console.log(a);
} }
@ -1163,7 +1166,7 @@ export class LocationComponent implements OnInit, OnDestroy {
outerThis.draw_flight_trail(outerThis.flightPathArr); outerThis.draw_flight_trail(outerThis.flightPathArr);
} }
console.log('devobject coming from socket',deviceInfo,msg,initData);
// console.log('device object coming from service',outerThis.deviceList) // console.log('device object coming from service',outerThis.deviceList)
// if((a != null) && (a != undefined)&&(outerThis.navId != 'locationComponent')){ // if((a != null) && (a != undefined)&&(outerThis.navId != 'locationComponent')){
// if (deviceInfo.status != 'RUNNING') { // if (deviceInfo.status != 'RUNNING') {
@ -2057,7 +2060,12 @@ export class LocationComponent implements OnInit, OnDestroy {
map.mapTypes.set('darkmode', styledMapType); map.mapTypes.set('darkmode', styledMapType);
outerThis.mapNew = map; outerThis.mapNew = map;
var trafficLayer = new google.maps.TrafficLayer(); var trafficLayer = new google.maps.TrafficLayer();
// trafficLayer.setMap(map);
if (outerThis.isTraffic) {
trafficLayer.setMap(map); trafficLayer.setMap(map);
} else {
trafficLayer.setMap(null);
}
// outerThis.geoService(map); // outerThis.geoService(map);
outerThis.trafficLayer = trafficLayer; outerThis.trafficLayer = trafficLayer;
@ -2415,17 +2423,16 @@ export class LocationComponent implements OnInit, OnDestroy {
// liveAddress = data[0].formatted_address; // liveAddress = data[0].formatted_address;
// var add = liveAddress; // var add = liveAddress;
console.log('entering Address field');
// } else { // } else {
console.log('entering Address field');
// liveAddress = "No address available"; // liveAddress = "No address available";
// } // }
// } // }
// else { // else {
console.log('entering Address field');
// liveAddress = 'static address'; // liveAddress = 'static address';
console.log(liveAddress);
// } // }
// }) // })
@ -2847,7 +2854,6 @@ export class LocationComponent implements OnInit, OnDestroy {
number_plate : infobox_numberPlate number_plate : infobox_numberPlate
} }
outerThis.markerArray.push(mtemp); outerThis.markerArray.push(mtemp);
console.log('marker Temp array=>',outerThis.markerArray,outerThis.socketData);
google.maps.event.addListener(m, 'click', function () { google.maps.event.addListener(m, 'click', function () {
// console.log('Opening Infow window',m); // console.log('Opening Infow window',m);
// { lat: , lng: } // { lat: , lng: }
@ -2880,7 +2886,7 @@ export class LocationComponent implements OnInit, OnDestroy {
} }
flightPathArr: any = []; flightPathArr: any = [];
isTraffic: boolean = true; isTraffic: boolean = false;
mapTypeId: any = "roadmap"; mapTypeId: any = "roadmap";
setMapType(mapTypeId) { setMapType(mapTypeId) {
// console.log(mapTypeId); // console.log(mapTypeId);
@ -3091,7 +3097,7 @@ export class LocationComponent implements OnInit, OnDestroy {
var lng = coord[1]; var lng = coord[1];
let outerThis = this let outerThis = this
var startPos = [lat, lng]; var startPos = [lat, lng];
this.speed = 200 //this.speed = 200
var iconselected = this.devicon var iconselected = this.devicon
var delay = 100; var delay = 100;
@ -3317,7 +3323,7 @@ export class LocationComponent implements OnInit, OnDestroy {
marker.setPosition(new google.maps.LatLng(lat, lng)); marker.setPosition(new google.maps.LatLng(lat, lng));
map.setCenter({ lat: lat, lng: lng }); map.setCenter({ lat: lat, lng: lng });
// console.log("Abinash");
that.start = setTimeout(that.moveMarker, delay); that.start = setTimeout(that.moveMarker, delay);
} }
else { else {
@ -3353,13 +3359,16 @@ export class LocationComponent implements OnInit, OnDestroy {
that.rangeDetector = false; that.rangeDetector = false;
console.log('iteration', a,coords.length)
// console.log("outside moveMarker function"); // console.log("outside moveMarker function");
if (a > coords.length) { if (a > coords.length) {
// console.log("Cord.length if condition"); // console.log("Cord.length if condition");
outerThis.speeed2 = 0; outerThis.speeed2 = 0;
outerThis.isLastPosition = true;
} }
else { else {
outerThis.isLastPosition = false;
// console.log("Cord.length else condition"); // console.log("Cord.length else condition");
that.moveMarker(); that.moveMarker();
km_h = outerThis.speed; km_h = outerThis.speed;
@ -3598,6 +3607,13 @@ zoomSet(){
showStatus: boolean = false; showStatus: boolean = false;
flag: any; flag: any;
playing: boolean = false; playing: boolean = false;
replay(i) {
this.speed = 100;
clearTimeout(this.start);
this.marker4.setPosition({ lat: this.latLngLine[i].lat, lng: this.latLngLine[i].lng });
this.tempMapHistory[i]['flag'] = 'init';
this.play(i);
}
play(playindex) { play(playindex) {
// console.log('playindex',playindex); // console.log('playindex',playindex);
@ -3610,6 +3626,7 @@ zoomSet(){
tempObj["tempDataCoordArr"] = tempDataCoordArr; tempObj["tempDataCoordArr"] = tempDataCoordArr;
if (this.tempMapHistory[playindex]['flag'] == 'init') { if (this.tempMapHistory[playindex]['flag'] == 'init') {
this.speed = 100;
this.animateMarker_history(this.marker4, tempDataCoordArr, 50, icontype); this.animateMarker_history(this.marker4, tempDataCoordArr, 50, icontype);
tempObj["marker"] = this.marker4; tempObj["marker"] = this.marker4;
this.tempMapHistory[playindex]['flag'] = 'stop'; this.tempMapHistory[playindex]['flag'] = 'stop';
@ -4160,7 +4177,7 @@ zoomSet(){
var cumulativeDistance =0 ; var cumulativeDistance =0 ;
for (let i = this.latlongObjArr.length - 1; i > 0; i--) { for (let i = this.latlongObjArr.length - 1; i > 0; i--) {
console.log(this.latlongObjArr[i]);
var d_name = (this.navId === 'locationHistory')? this.dev_id.viewValue:this.dev_id.Device_Name; var d_name = (this.navId === 'locationHistory')? this.dev_id.viewValue:this.dev_id.Device_Name;
this.speed = this.latlongObjArr[i].speed + "Km/hr"; this.speed = this.latlongObjArr[i].speed + "Km/hr";
this.im = this.latlongObjArr[i].imei; this.im = this.latlongObjArr[i].imei;
@ -4190,7 +4207,7 @@ zoomSet(){
+ this.im + `</b><br><b>DEVICE DATE : ` + this.im + `</b><br><b>DEVICE DATE : `
+ this.datee + `</b><br><b>SPEED : `+ this.speed + + this.datee + `</b><br><b>SPEED : `+ this.speed +
`</b><br><b>INSERTION TIME : `+ insertionTime + `</b><br><b>INSERTION TIME : `+ insertionTime +
`</b><br><b>RAW : `+ raw + `</b><br><b>RAW : ` + '<span style="word-break: break-all;" id="display_row'+this.latlongObjArr[i]._id +'"></span><a id="' + this.latlongObjArr[i]._id +'" style="color: blue;text-decoration: underline;" onclick = "window.angularComponentRef.zone.run(() => {window.angularComponentRef.component.GetRowPacketEvent(\'' + this.latlongObjArr[i]._id + '\');})" > Get Raw Data </a>'+
`</b><br><b style="margin-bottom:10px" id="addressBinding">Address : ` `</b><br><b style="margin-bottom:10px" id="addressBinding">Address : `
+ this.contentAdd + '</b></div></b><br>' + this.contentAdd + '</b></div></b><br>'
+'<button style="margin-top:10px;background-color: blue;color: white;padding: 5px;" onclick="window.angularComponentRef.zone.run(() => {window.angularComponentRef.component.addpoi(\'' + lastLat + ',' + lastlong + '\');})">ADD POI</button></div></div></div>' +'<button style="margin-top:10px;background-color: blue;color: white;padding: 5px;" onclick="window.angularComponentRef.zone.run(() => {window.angularComponentRef.component.addpoi(\'' + lastLat + ',' + lastlong + '\');})">ADD POI</button></div></div></div>'
@ -4382,7 +4399,7 @@ zoomSet(){
icon: iconSrc, icon: iconSrc,
scaledSize: new google.maps.Size(20, 20), scaledSize: new google.maps.Size(20, 20),
}); });
// markerSrc['infowindow'] = new google.maps.InfoWindow({ content: content }); markerSrc['infowindow'] = new google.maps.InfoWindow({ content: content });
const infowindow = new google.maps.InfoWindow({ const infowindow = new google.maps.InfoWindow({
content: contentString, content: contentString,
}); });
@ -4592,13 +4609,18 @@ zoomSet(){
var customTxt; var customTxt;
var txt; var txt;
function geocodePosition(pos, callback) { function geocodePosition(pos, callback) {
try {
var geocoder = new google.maps.Geocoder(); var geocoder = new google.maps.Geocoder();
geocoder.geocode({ geocoder.geocode({
latLng: pos latLng: pos
}, function (responses) { }, function (responses) {
callback(responses[0].formatted_address) callback(responses && responses[0] && responses[0].formatted_address ? responses[0].formatted_address : null)
}); });
} catch (error) {
callback(null)
}
} }
var k; var k;
@ -4712,7 +4734,12 @@ zoomSet(){
// console.log('mapmapmapmapmapmapmapmapmapmapmapmapmapmap',map); // console.log('mapmapmapmapmapmapmapmapmapmapmapmapmapmap',map);
outerThis.historyMap = map; outerThis.historyMap = map;
var trafficLayer = new google.maps.TrafficLayer(); var trafficLayer = new google.maps.TrafficLayer();
if(outerThis.isTraffic){
trafficLayer.setMap(map); trafficLayer.setMap(map);
}else{
trafficLayer.setMap(null);
}
isMapInit = true; isMapInit = true;
@ -5472,13 +5499,15 @@ var seconds = num % 60;
} }
ngOnInit() { ngOnInit() {
this.injectData.setGPSConnection();
window["angularComponentRef"] = { component: this, zone: this._ngZone }; window["angularComponentRef"] = { component: this, zone: this._ngZone };
this.socket = this.injectData.getSocket_gps(); this.socket = this.injectData.getSocket_gps();
this.socket.on('connect', function (this) { }); this.socket.on('connect', function (this) { });
this.socket_Notify = this.injectData.getSocket_notifIO(); this.socket_Notify = this.injectData.getSocket_notifIO();
this.socket_Notify.on('connect', function(this){ }); this.socket_Notify.on('connect', function(this){
console.log('notify connect ',this);
});
this.bsConfig = Object.assign({dateInputFormat: 'DD-MM-YYYY, h:mm:ss a'}, { containerClass: this.colorTheme }); this.bsConfig = Object.assign({dateInputFormat: 'DD-MM-YYYY, h:mm:ss a'}, { containerClass: this.colorTheme });
// console.log('this.bsConfig',this.bsConfig); // console.log('this.bsConfig',this.bsConfig);
@ -5700,9 +5729,17 @@ var seconds = num % 60;
if( this.socket_Notify){ if( this.socket_Notify){
this.socket_Notify.removeAllListeners() this.socket_Notify.removeAllListeners()
} }
this.injectData.removedGPSConnection();
} }
GetRowPacketEvent(data) {
this.contactService.GetRowPacket(data).subscribe((res: any) => {
document.getElementById(data).innerHTML = '';
document.getElementById('display_row' + data).innerHTML = res.raw ? res.raw : 'NA';
})
}
addpoi(lat) { addpoi(lat) {
// var lattitude = JSON.parse(lat); // var lattitude = JSON.parse(lat);
var latlng = JSON.stringify(lat).substring(1, lat.length - 1); var latlng = JSON.stringify(lat).substring(1, lat.length - 1);
@ -5825,12 +5862,45 @@ var seconds = num % 60;
} }
} }
this.masterFoods = JSON.parse(JSON.stringify(this.foods));
this.sortFoodDataByKey();
}, err => { }, err => {
// this.Load = false; // this.Load = false;
// console.log(err); // console.log(err);
}) })
} }
filterDevicesNew(dlr) {
if ((this.navId === 'locationHistory')) {
if (dlr) {
const filterdealerValue: any = dlr;
this.foods = [];
this.masterFoods.forEach(pp => {
let t = pp.viewValue.toLocaleLowerCase().indexOf(filterdealerValue.toLocaleLowerCase());
if (t > -1) {
this.foods.push(pp)
}
});
} else {
this.foods = [...this.masterFoods];
}
}
this.sortFoodDataByKey();
}
sortFoodDataByKey() {
this.foods.sort((a, b) => {
let fa = a.viewValue.toLowerCase(),
fb = b.viewValue.toLowerCase();
if (fa < fb) {
return -1;
}
if (fa > fb) {
return 1;
}
return 0;
})
}
filterDevices(dlr) { filterDevices(dlr) {
// console.log("=========>",dlr,this.foods); // console.log("=========>",dlr,this.foods);
@ -6274,7 +6344,7 @@ var seconds = num % 60;
controlText.style.lineHeight = '38px'; controlText.style.lineHeight = '38px';
controlText.style.paddingLeft = '5px'; controlText.style.paddingLeft = '5px';
controlText.style.paddingRight = '5px'; controlText.style.paddingRight = '5px';
controlText.innerHTML = text; controlText.innerHTML = text ? text : '';
controlUI.appendChild(controlText); controlUI.appendChild(controlText);
// Setup the click event listeners: simply set the map to Chicago. // Setup the click event listeners: simply set the map to Chicago.
@ -6361,6 +6431,11 @@ var seconds = num % 60;
}) })
function geocodePosition(pos, callback) { function geocodePosition(pos, callback) {
try {
} catch (error) {
}
var geocoder = new google.maps.Geocoder(); var geocoder = new google.maps.Geocoder();
geocoder.geocode({ geocoder.geocode({
latLng: pos latLng: pos
@ -6416,7 +6491,7 @@ var seconds = num % 60;
// } // }
AllVeh: any = [{ 'status': 'Running', 'totalCount': '0' }, { 'status': 'Idle', 'totalCount': '0' }, { 'status': 'Stopped', 'totalCount': '0' }, { 'status': 'Inactive', 'totalCount': '0' }, { 'status': 'No data', 'totalCount': '0' }] AllVeh: any = [{ 'status': 'Total', 'totalCount': '0' },{ 'status': 'Running', 'totalCount': '0' }, { 'status': 'Idle', 'totalCount': '0' }, { 'status': 'Stopped', 'totalCount': '0' }, { 'status': 'Inactive', 'totalCount': '0' }, { 'status': 'No data', 'totalCount': '0' }]
deviceData = [ deviceData = [
{ {
@ -6648,6 +6723,7 @@ var seconds = num % 60;
this.off_vech = this.devicess["OFF Devices"]; this.off_vech = this.devicess["OFF Devices"];
this.maintanance = this.devicess["Maintance Device"]; this.maintanance = this.devicess["Maintance Device"];
this.expiredDevices = this.devicess["expire_status"]; this.expiredDevices = this.devicess["expire_status"];
this.totalDevices = this.devicess["Total_Vech"];
this.OutOfReach = this.devicess["OutOfReach"]; this.OutOfReach = this.devicess["OutOfReach"];
this.no_data = this.devicess["no_data"]; this.no_data = this.devicess["no_data"];
this.Running = this.devicess["running_devices"]; this.Running = this.devicess["running_devices"];
@ -6674,11 +6750,12 @@ var seconds = num % 60;
// this.loading = this.devicess.running_details.forward.count; // this.loading = this.devicess.running_details.forward.count;
// this.unloading = this.devicess.running_details.reverse.count; // this.unloading = this.devicess.running_details.reverse.count;
// this.not_on_root = this.devicess.running_details.not_on_route.count; // this.not_on_root = this.devicess.running_details.not_on_route.count;
this.AllVeh[0].totalCount = this.Running; this.AllVeh[0].totalCount = this.totalDevices;
this.AllVeh[1].totalCount = this.idle_vech; this.AllVeh[1].totalCount = this.Running;
this.AllVeh[2].totalCount = this.off_vech; this.AllVeh[2].totalCount = this.idle_vech;
this.AllVeh[3].totalCount = this.OutOfReach; this.AllVeh[3].totalCount = this.off_vech;
this.AllVeh[4].totalCount = this.no_data; this.AllVeh[4].totalCount = this.OutOfReach;
this.AllVeh[5].totalCount = this.no_data;
// console.log("DAtatatatat---",this.AllVeh); // console.log("DAtatatatat---",this.AllVeh);
@ -6692,8 +6769,14 @@ var seconds = num % 60;
devReady:boolean=true; devReady:boolean=true;
groups=[] groups=[]
getDeviceBYfilter(i,iden) { getDeviceBYfilter(i,iden) {
// console.log('iden=>',iden); console.log(i,iden);
this.currStatus = i; this.currStatus = i;
if (this.currStatus =='Total'){
this.ngOnInit();
}
else{
if (i == 6) { if (i == 6) {
this.skip = 0; this.skip = 0;
} }
@ -6715,6 +6798,7 @@ var seconds = num % 60;
} }
this.deviceList = []; this.deviceList = [];
this.foods = []; this.foods = [];
this.masterFoods = [];
// console.log('this.navId',this.navId); // console.log('this.navId',this.navId);
if (this.navId == 'locationHistory') { if (this.navId == 'locationHistory') {
iden = 'tclick'; iden = 'tclick';
@ -6735,7 +6819,7 @@ var seconds = num % 60;
this.firstcall = true this.firstcall = true
} }
this.foods = []; this.foods = [];
this.masterFoods = [];
for (var k = 0; k < this.deviceList.length; k++) { for (var k = 0; k < this.deviceList.length; k++) {
// if(this.deviceList[k].vehicleGroup){ // if(this.deviceList[k].vehicleGroup){
@ -6761,8 +6845,7 @@ var seconds = num % 60;
this.foods.push(a); this.foods.push(a);
if (k === (this.deviceList.length - 1)) { if (k === (this.deviceList.length - 1)) {
// console.log("1111111110100000"); // console.log("1111111110100000");
if(this.navId!='locationHistory') if (this.navId != 'locationHistory') {
{
this.showSocketData = false this.showSocketData = false
} }
this.livetrack(null); this.livetrack(null);
@ -6788,8 +6871,11 @@ var seconds = num % 60;
this.selectAllVehicles({ checked: true }) this.selectAllVehicles({ checked: true })
// console.log('this.deviceList',this.deviceList,'GROUP===',this.groups); // console.log('this.deviceList',this.deviceList,'GROUP===',this.groups);
this.masterFoods = JSON.parse(JSON.stringify(this.foods));
this.sortFoodDataByKey();
}) })
}
} }
@ -7720,19 +7806,12 @@ historySeekbaar(){
} }
public Selectedspeed = 1;
changeSpeed(t){ changeSpeed(t){
// console.log(t); // console.log(t);
this.speed = t * 100; this.speed = t * 100;
var header = document.getElementById("myDIV"); this.Selectedspeed = t;
var btns = header.getElementsByClassName("sc-bdVaJa");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}
} }
@ -7784,6 +7863,8 @@ getNearByVehicles(devData){
} }
} }
this.masterFoods = JSON.parse(JSON.stringify(this.foods));
this.sortFoodDataByKey();
// console.log('this.deviceList',this.deviceList); // console.log('this.deviceList',this.deviceList);
}else{ }else{
this.data_descip = "No Nearby Devices Found !!!"; this.data_descip = "No Nearby Devices Found !!!";
@ -8110,6 +8191,8 @@ getNearByVehicles(devData){
}) })
} }
// @HostListener('click', ['$event']) // @HostListener('click', ['$event'])
// onClick(event) { // onClick(event) {
// if (event.target.id === 'deletePoint'){ // if (event.target.id === 'deletePoint'){
@ -8305,8 +8388,8 @@ image
this.endTime=this.tempMapHistory[0].toTime; this.endTime=this.tempMapHistory[0].toTime;
var name=this.deviceNameForPDF+" track from "+this.startTime+" to "+this.endTime+'.pdf' var name=this.deviceNameForPDF+" track from "+this.startTime+" to "+this.endTime+'.pdf'
var outerThis=this; var outerThis=this;
this.startAddress=this.finalArr[0].address this.startAddress = this.finalArr[0] ?this.finalArr[0].address : '';
this.endAddress=this.finalArr[this.finalArr.length-1].address this.endAddress = this.finalArr[0] ?this.finalArr[this.finalArr.length-1].address :''
// console.log(this.startAddress,this.endAddress); // console.log(this.startAddress,this.endAddress);
// console.log(this.tempMapHistory,this.startAddress,this.endAddress, this.image); // console.log(this.tempMapHistory,this.startAddress,this.endAddress, this.image);
@ -8320,7 +8403,7 @@ image
}; };
var doc = new jsPDF(pdfOptions); var doc = new jsPDF(pdfOptions);
this.contactService.setFontInPdf(doc);
var pageWidth = doc.internal.pageSize.width-20; var pageWidth = doc.internal.pageSize.width-20;
var width = pageWidth; var width = pageWidth;
@ -8446,7 +8529,8 @@ selectAllVehicles(ev){
} }
this.final = this.deviceList; this.final = this.deviceList;
this.foods = [];
this.masterFoods = [];
for (let i = 0; i < this.final.length; i++) { for (let i = 0; i < this.final.length; i++) {
this.final[i]['checked'] = true; this.final[i]['checked'] = true;
// this.deviceList = this.final; // this.deviceList = this.final;
@ -8469,6 +8553,7 @@ selectAllVehicles(ev){
} }
} }
let that= this; let that= this;
if((this.navId === undefined)||(this.navId != 'locationHistory')){ if((this.navId === undefined)||(this.navId != 'locationHistory')){
this.livetrack(this.fin); this.livetrack(this.fin);
@ -8479,6 +8564,8 @@ selectAllVehicles(ev){
this.new = this.foods[y]; this.new = this.foods[y];
} }
} }
this.masterFoods = JSON.parse(JSON.stringify(this.foods));
this.sortFoodDataByKey();
}else{ }else{
@ -8494,7 +8581,12 @@ selectAllVehicles(ev){
var map = new google.maps.Map(document.getElementById('map'), myOptions); var map = new google.maps.Map(document.getElementById('map'), myOptions);
// console.log('mapmapmapmapmapmapmapmapmapmapmapmapmapmap',map); // console.log('mapmapmapmapmapmapmapmapmapmapmapmapmapmap',map);
var trafficLayer = new google.maps.TrafficLayer(); var trafficLayer = new google.maps.TrafficLayer();
// trafficLayer.setMap(map);
if (this.isTraffic) {
trafficLayer.setMap(map); trafficLayer.setMap(map);
} else {
trafficLayer.setMap(null);
}
var zoomBar: any; var zoomBar: any;
zoomBar = document.getElementById('myRange'); zoomBar = document.getElementById('myRange');
map.setZoom(map.getZoom()); map.setZoom(map.getZoom());
@ -8524,7 +8616,7 @@ getTravelPathReport(device){
var payload ={ var payload ={
"to":new Date(this.date2).toISOString(), "to":new Date(this.date2).toISOString(),
"from" : new Date(this.datefrom).toISOString(), "from" : new Date(this.datefrom).toISOString(),
"device" : device.Device_ID, "device": device.Device_ID ? device.Device_ID : device.did,
"interval" :10 "interval" :10
} }
@ -8532,9 +8624,12 @@ getTravelPathReport(device){
this.reportArr = []; this.reportArr = [];
if (resp && resp.length) {
this.reportArr= resp.filter(function (el) { this.reportArr= resp.filter(function (el) {
return el != null; return el != null;
}); });
}
let last = {speed:''}; let last = {speed:''};
let result = []; let result = [];
@ -8742,7 +8837,7 @@ this.reportArr1=this.reportArr
for (var j = 0; j < rowCount; j++) { for (var j = 0; j < rowCount; j++) {
var str=(pdfBody[j].latDecimal?pdfBody[j].latDecimal:0)+' , '+(pdfBody[j].longDecimal?pdfBody[j].longDecimal:0) var str = (pdfBody[j] && pdfBody[j].latDecimal ? pdfBody[j].latDecimal : 0) + ' , ' + (pdfBody[j] &&pdfBody[j].longDecimal?pdfBody[j].longDecimal:0)
body.push({ body.push({
deviceName:pdfBody[j].Device_name, deviceName:pdfBody[j].Device_name,

View file

@ -134,8 +134,8 @@
</div> </div>
<div class="col-sm-6 col-md-6 col-lg-6" > <div class="col-sm-6 col-md-6 col-lg-6" >
<div style="text-align: right;padding-top: 20px;"> <div style="text-align: right;padding-top: 20px;">
<span style="font-size: 18px; font-weight: 400; color: #2a2828; padding-right: 30px;cursor:pointer;font-weight:500">Become a Reseller</span> <!-- <span style="font-size: 18px; font-weight: 400; color: #2a2828; padding-right: 30px;cursor:pointer;font-weight:500">Become a Reseller</span>
<span style="font-size: 18px; font-weight: 400; color: #767474;">Support Contact</span> <span style="font-size: 18px; font-weight: 400; color: #767474;">Support Contact</span> -->
<span style="font-size: 18px; font-weight: 500; padding-left: 20px;"><a>{{supportContact}}</a></span> <span style="font-size: 18px; font-weight: 500; padding-left: 20px;"><a>{{supportContact}}</a></span>
<!-- {{supportContact}} --> <!-- {{supportContact}} -->
</div> </div>

View file

@ -25,6 +25,7 @@ import {Observable} from 'rxjs/Observable';
import { TranslateService } from 'ng2-translate'; import { TranslateService } from 'ng2-translate';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { AnnouncementComponent } from '../const/announcement/announcement.component'; import { AnnouncementComponent } from '../const/announcement/announcement.component';
//import { DatainjectionService } from '../datainjection.service';
@Component({ @Component({
selector: 'app-services', selector: 'app-services',
templateUrl: './login.component.html', templateUrl: './login.component.html',
@ -116,7 +117,14 @@ passwordIcon:any = "visibility_off";
console.log("Inside showlink false"); console.log("Inside showlink false");
this.showLink = false; this.showLink = false;
} }
//let tUrl = 'http://www.nipponsecura.in/login';
//let split1 = tUrl.split('//')[1];
if (split2 == "www.nipponsecura.in" || split2 == "nipponsecura.in") {
this.cpn_showLink = true;
this.mainSiteurl = 'https://nipponaudio.com/';
}
if(split2 == "login.cpntrack.com"){ if(split2 == "login.cpntrack.com"){
this.cpn_showLink = true; this.cpn_showLink = true;
@ -245,6 +253,7 @@ passwordIcon:any = "visibility_off";
// debugger; // debugger;
this.dataService.log(newlog) this.dataService.log(newlog)
.subscribe(login => { .subscribe(login => {
this.showLoader = false; this.showLoader = false;
this.logins.push(login); this.logins.push(login);
// console.log(JSON.parse("TOKEN",login.token)); // console.log(JSON.parse("TOKEN",login.token));
@ -254,7 +263,7 @@ passwordIcon:any = "visibility_off";
localStorage.setItem('currentuser',JSON.parse(atob(login.token.split('.')[1]))._id); localStorage.setItem('currentuser',JSON.parse(atob(login.token.split('.')[1]))._id);
var isOperator = JSON.parse(atob(login.token.split('.')[1])).isOperator; var isOperator = JSON.parse(atob(login.token.split('.')[1])).isOperator;
var userId = JSON.parse(atob(login.token.split('.')[1]))._id; var userId = JSON.parse(atob(login.token.split('.')[1]))._id;
// this._DatainjectionService.getConnection();
this.getLanguage(userId,isOperator,JSON.parse(atob(login.token.split('.')[1])).customer_role); this.getLanguage(userId,isOperator,JSON.parse(atob(login.token.split('.')[1])).customer_role);
} , (err: any) => { } , (err: any) => {
@ -735,7 +744,7 @@ countdown( elementName, minutes, seconds )
this.organisationName = (this.url == 'oneqlik')?'OneQlik':this.userData.organisationName ; this.organisationName = (this.url == 'oneqlik')?'OneQlik':this.userData.organisationName ;
this.supportContact = this.userData.contact_support?this.userData.contact_support : ''; this.supportContact = this.userData.contact_support?this.userData.contact_support : '';
this.tagline= this.userData.tagline?this.userData.tagline : this.tagline; this.tagline= this.userData.tagline?this.userData.tagline : this.tagline;
this._document.getElementById('appFavicon').setAttribute('href', this.dev_url+this.userData.favicon); this._document.getElementById('appFavicon').setAttribute('href', this.userData.favicon ? this.dev_url + this.userData.favicon :'faviconn.ico' );
this.text=this.userData.text; this.text=this.userData.text;
window.localStorage['dealerName']= this.userData.dealerName; window.localStorage['dealerName']= this.userData.dealerName;
window.localStorage['DealerID'] = this.userData.email window.localStorage['DealerID'] = this.userData.email

View file

@ -66,6 +66,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
this.router.navigateByUrl("location"); this.router.navigateByUrl("location");
} }
accListener(){ accListener(){
console.log('connect notifiov2')
var outerThis = this; var outerThis = this;
return function(msg){ return function(msg){
// console.log(msg); // console.log(msg);
@ -169,7 +170,9 @@ mb:any
} }
this.socket_Notify = this.injectData.getSocket_notifIO(); this.socket_Notify = this.injectData.getSocket_notifIO();
this.socket_Notify.on('connect', function(this){ }); this.socket_Notify.on('connect', function(this){
console.log('notify connect',this)
});
this.socket_Notify.on( this.useridd, this.accListener()); this.socket_Notify.on( this.useridd, this.accListener());
this.getData(this.useridd).subscribe( this.getData(this.useridd).subscribe(
data => { data => {

View file

@ -107,7 +107,7 @@
<a class="dropdown-item" <a class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
*ngIf="superAdmin" (click)="tutorialVideos('admin')">{{'Tutorial Videos' | translate}}</a> *ngIf="superAdmin && urlspecifc" (click)="tutorialVideos('admin')">{{'Tutorial Videos' | translate}}</a>
<a class="dropdown-item" <a class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
*ngIf="superAdmin" (click)="userFinder('admin')">{{'User Finder' | translate}}</a> *ngIf="superAdmin" (click)="userFinder('admin')">{{'User Finder' | translate}}</a>

View file

@ -51,6 +51,7 @@ declare var google: any,$:any;
export class AllMenusComponent implements OnInit { export class AllMenusComponent implements OnInit {
// //
marker1: any; marker1: any;
mapData: any[]; mapData: any[];
routePath: any; routePath: any;
before: any; before: any;
@ -58,6 +59,7 @@ export class AllMenusComponent implements OnInit {
cust: boolean = false; cust: boolean = false;
logo: any; logo: any;
text: any; text: any;
urlspecifc:boolean = false
fs: any; ls: any; emailid: any; or: any; useridd: any; mb: any; custtype: any; dealer: any; fs: any; ls: any; emailid: any; or: any; useridd: any; mb: any; custtype: any; dealer: any;
showImage: any; showImage: any;
groups = []; groups = [];
@ -146,6 +148,13 @@ export class AllMenusComponent implements OnInit {
menuWidth:any; menuWidth:any;
sup_admin:boolean; sup_admin:boolean;
ngOnInit() { ngOnInit() {
let domainName = window.location.host;
console.log(domainName, 'domainName');
if (domainName.indexOf('oneqlik') >= 0 || domainName.indexOf('localhost') >= 0) {
this.urlspecifc = true
} else {
this.urlspecifc = false;
}
// console.log("Inside all app menu component---------------------------------------------"); // console.log("Inside all app menu component---------------------------------------------");
// this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin; // this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
if(localStorage.getItem('superadmin')=="ON"){ if(localStorage.getItem('superadmin')=="ON"){

View file

@ -723,6 +723,7 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
// lineColor: [0, 0, 0] // lineColor: [0, 0, 0]
// }, // },
theme:'grid', theme:'grid',
didDrawPage: function (data) { didDrawPage: function (data) {
// Header // Header
doc.setFontSize(20); doc.setFontSize(20);
@ -784,6 +785,7 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
'Moving Time':'Moving Time (HH:MM)', 'Moving Time':'Moving Time (HH:MM)',
'Stoppage Time':'Stoppage Time (HH:MM)', 'Stoppage Time':'Stoppage Time (HH:MM)',
'Idle Time':'Idle Time (HH:MM)', 'Idle Time':'Idle Time (HH:MM)',
fuelConsumed: 'Fuel Consumed',
startAddress:'Start Location', startAddress:'Start Location',
endAddress:'End Location', endAddress:'End Location',
} }
@ -798,21 +800,31 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
let body = []; let body = [];
for (var j = 0; j < rowCount; j++) { for (var j = 0; j < rowCount; j++) {
body.push({ body.push({
Date: (pdfBody[j].Date ? (moment(pdfBody[j].Date).format('DD-MM-YYYY')) : "") ,
Date:pdfBody[j].Date,
VRN:pdfBody[j].VRN, VRN:pdfBody[j].VRN,
'Distance(Kms)':(pdfBody[j]['Distance(Kms)']).toFixed(2), 'Distance(Kms)':(pdfBody[j]['Distance(Kms)']).toFixed(2),
'Moving Time':this.conversion(pdfBody[j]['Moving Time']), 'Moving Time':this.conversion(pdfBody[j]['Moving Time']),
'Stoppage Time':this.conversion(pdfBody[j]['Moving Time']), 'Stoppage Time':this.conversion(pdfBody[j]['Moving Time']),
"Idle Time":this.conversion(pdfBody[j]['Idle Time']), "Idle Time":this.conversion(pdfBody[j]['Idle Time']),
fuelConsumed: this.fuleConvert((pdfBody[j]['Distance(Kms)']).toFixed(2), pdfBody[j]['Mileage']),
startAddress:pdfBody[j].startAddress, startAddress:pdfBody[j].startAddress,
endAddress:pdfBody[j].endAddress, endAddress:pdfBody[j].endAddress,
}); });
} }
return body; return body;
} }
fuleConvert(distance,data) {
if (data && distance) {
var mileage = parseFloat(distance) / parseFloat(data)
return mileage.toFixed(2)
} else {
return ''
}
}
conversion(data){ conversion(data){
var hhmm; var hhmm;
if(data){ if(data){

View file

@ -326,9 +326,9 @@ export class DisatanceReportComponent implements OnInit {
var j = 0; var j = 0;
that.finalArr = []; that.finalArr = [];
for (var i = 0; i < that.reportArr.length; i++) { for (var i = 0; i < that.reportArr.length; i++) {
if (that.reportArr[i].reportData){ if (that.reportArr[i]){
that.clocation_1(that.reportArr[i].reportData, function (err, succ) { that.clocation_1(that.reportArr[i], function (err, succ) {
if (err) { if (err) {
console.log(err); console.log(err);
j++; j++;

View file

@ -19,11 +19,51 @@
</div> </div>
</div> --> </div> -->
<div class="col-sm-12 col-md-12 col-lg-12" style="padding-left: 5px; padding-right: 20px; padding-top: 5px;"> <div class="col-sm-12 col-md-12 col-lg-12" style="padding-left: 5px; padding-right: 20px; padding-top: 5px;">
<div class="row" style="margin:0px;height: 84vh;padding-top:10px;padding-bottom:5px;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;"> <div class="row" style="margin: 0;padding-bottom: 10px;">
<div class="col-sm-12 col-md-12 col-lg-12" style="padding-right: 0%;padding-left: 0;">
<!-- timefilter icons -->
<div class="row">
<div class="btn-group btn-group-sm col-md-6" role="group" aria-label="Basic example" >
<button [class.tab-btn-active]="isNormalView" type="button" style="width:50%;border-right: 2px solid white;" class="btn btn-secondary animateClass_4"
(click)="setActiveView(true)">{{'Events' | translate}}</button>
<button [class.tab-btn-active]="!isNormalView" type="button" style="width:50%;border-right: 2px solid white;" class="btn btn-secondary animateClass_5"
(click)="setActiveView(false)">{{'Report' | translate}}</button>
</div>
<div *ngIf="!isNormalView" class="col-md-6">
<div class="row">
<div class="col-md-5" >Duration More than (in Min)</div>
<div class="col-md-4">
<input
class="form-control"
style=""
min="0"
name="filterDuration"
[(ngModel)]="filterDuration"
type="number"
/>
</div>
<div class="col-md-3">
<button class="mat-raised-button"
style="background-color: #1556b9; color: #fdfdfd"
(click)="filterDetailsReport()"
>
{{ "Filter" | translate }}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div [class.d-hide]="!isNormalView " class="row" style="margin:0px;height: 84vh;padding-top:10px;padding-bottom:5px;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;">
<div class="col-sm-12 col-md-12 col-lg-12"> <div class="col-sm-12 col-md-12 col-lg-12">
<div *ngIf="Load" class="loading">Loading&#8230;</div> <div *ngIf="Load" class="loading">Loading&#8230;</div>
<div style="width: 100%;height:84vh;"> <div style="width: 100%;height:84vh;">
<table id="deviceTable" cellspacing="0" style="width: 100%;font-size: 14px;"> <table class="deviceTable" id="deviceTable" cellspacing="0" style="width: 100%;font-size: 14px;">
<thead style="background-color:#e0e0e0;color: #444444;"> <thead style="background-color:#e0e0e0;color: #444444;">
<tr > <tr >
<th style="text-align: left;">{{'Vehicle Name' | translate}}</th> <th style="text-align: left;">{{'Vehicle Name' | translate}}</th>
@ -31,10 +71,109 @@
<th style="text-align: left;">{{'Datetime' | translate}}</th> <th style="text-align: left;">{{'Datetime' | translate}}</th>
<th style="text-align: left;">{{'Location' | translate}}</th> <th style="text-align: left;">{{'Location' | translate}}</th>
<th style="text-align: left;">{{'GeoFence Name' | translate}}</th> <th style="text-align: left;">{{'GeoFence Name' | translate}}</th>
</tr> </tr>
</thead> </thead>
</table> </table>
</div> </div>
</div>
</div>
<div [class.d-hide]="isNormalView" class="row" style="margin:0px;height: 84vh;padding-top:10px;padding-bottom:5px;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;">
<div class="col-sm-12 col-md-12 col-lg-12">
<div *ngIf="Load" class="loading">Loading&#8230;</div>
<div style="width: 100%;height:84vh;">
<table class="deviceDetailsTable" id="deviceDetailsTable" cellspacing="0" style="width: 100%;font-size: 14px;">
<thead style="background-color:#e0e0e0;color: #444444;">
<tr >
<th style="text-align: left;">{{'Vehicle Name' | translate}}</th>
<th style="text-align: left;">{{'In Time' | translate}}</th>
<th style="text-align: left;">{{'Out Time' | translate}}</th>
<th style="text-align: left;">{{'Duration' | translate}}</th>
<th style="text-align: left;">{{'GeoFence Name' | translate}}</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<div class="row" style="display: none; margin:0px;height: 84vh;padding-top:10px;padding-bottom:5px;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;">
<div class="col-sm-12 col-md-12 col-lg-12">
<div *ngIf="Load" class="loading">Loading&#8230;</div>
<div style="width: 100%;height:84vh;">
<div id="geoDetailsTable">
<div *ngFor="let detailReport of newDetailsReport; let i=index;">
<div style="width: 100%;">
<tr class="tr-geofence">
<td>Object:</td>
<td>{{detailReport.vehicle}}</td>
</tr>
<tr class="tr-geofence">
<td>Period:</td>
<td>{{Fromdate | date:"dd/MM/yyyy hh:mm:ss"}} - {{todate | date:"dd/MM/yyyy hh:mm:ss"}}</td>
</tr>
<!-- <div > <strong>Object: </strong> {{detailReport.vehicle}}</div>
</div>
<div style="width: 100%;margin-bottom: 10px;">
<div > <strong >Period: </strong>{{Fromdate | date:"medium"}} - {{todate | date:"medium"}}</div>
</div> -->
<table class="geoDetailsTable" cellspacing="0" style="width: 100%;font-size: 16px;">
<thead style="background-color:#e0e0e0;color: #444444;">
<tr class="tr-geofence">
<th style="text-align: left;">{{'Object' | translate}}</th>
<th style="text-align: left;">{{'Zone in' | translate}}</th>
<th style="text-align: left;">{{'Zone Out' | translate}}</th>
<th style="text-align: left;">{{'Duration' | translate}}</th>
<th style="text-align: left;">{{'Route length' | translate}}</th>
<th style="text-align: left;">{{'Zone name' | translate}}</th>
<th style="text-align: left;">{{'Zone position' | translate}}</th>
</tr>
</thead>
<tbody>
<tr class="tr-geofence" [style.background-color]="item.durationMin > 120 ? 'yellow':'white'" *ngFor="let item of detailReport.list; let i=index;" >
<td style="text-align: left;">{{item.vehicleName ? item.vehicleName : '-'}}</td>
<td style="text-align: left;">{{item.inTimeDate ? (item.inTimeDate | date:'dd/MM/yyyy hh:mm:ss') : '-'}}</td>
<td style="text-align: left;">{{item.outTimeDate ? (item.outTimeDate | date:'dd/MM/yyyy hh:mm:ss') : '-'}}</td>
<td style="text-align: left;">{{item.duration ? item.duration : '-'}}</td>
<td style="text-align: left;">{{item.routeLength ? item.routeLength : '0'}} km</td>
<td style="text-align: left;">{{item.geoid && item.geoid.geoname ? item.geoid.geoname : '-'}}</td>
<td style="text-align: left;">-</td>
</tr>
</tbody>
</table>
<table class="geoDetailsTable" cellspacing="0" style="width: 100%;font-size: 14px;margin-top: 10px;margin-bottom: 10px;">
<thead style="background-color:#e0e0e0;color: #444444;">
<tr class="tr-geofence" >
<th style="text-align: left;"></th>
<th style="text-align: left;"></th>
<th style="text-align: left;"></th>
<!-- <th style="text-align: left;"></th> -->
</tr>
</thead>
<tbody>
<tr class="tr-geofence" *ngFor="let item of detailReport.calculatedKey; let i=index;" >
<td style="text-align: left;">{{item.zoneName ? item.zoneName : '-'}}</td>
<td style="text-align: left;">{{item.durationTotal ? item.durationTotal : '-'}}</td>
<td style="text-align: left;">{{item.distanceTotal ? item.distanceTotal : '0'}} km</td>
<!-- <td style="text-align: left;">{{item.idleTime}}</td> -->
</tr>
</tbody>
</table>
<div *ngIf="!detailReport.calculatedKey.length">Nothing has been found on your request.</div>
</div>
</div>
<div id="editor789"></div>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -3,7 +3,15 @@
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.d-hide {
display: none;
}
.yellow-bg {
background-color: yellow;
}
.tab-btn-active{
background-color: #616466 !important;
}
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;

View file

@ -25,6 +25,7 @@ declare var google: any;
styleUrls: ['./geofancing-report.component.scss'] styleUrls: ['./geofancing-report.component.scss']
}) })
export class GeofancingReportComponent implements OnInit { export class GeofancingReportComponent implements OnInit {
filterDuration: number = 0;
date1: any; date1: any;
finalArr = [] finalArr = []
finall: any; finall: any;
@ -36,7 +37,16 @@ export class GeofancingReportComponent implements OnInit {
userName: any; userName: any;
before: any; before: any;
deviceArr: any = []; deviceArr: any = [];
isNormalView = true;
dtOptions: any = {};
setActiveView(status) {
this.isNormalView = status;
setTimeout(() => {
this.tabelDetailsObj.columns.adjust().draw();
this.tabelObj.columns.adjust().draw();
}, 1000)
}
private finalise = new Subject<void>(); private finalise = new Subject<void>();
constructor(private contactService: ContactService, private _service: ReportService, private router: Router, public dialog: MdDialog) { constructor(private contactService: ContactService, private _service: ReportService, private router: Router, public dialog: MdDialog) {
this._service.invokeEventForgeofenceReport.pipe( this._service.invokeEventForgeofenceReport.pipe(
@ -78,6 +88,11 @@ option:any;
geo_status = []; geo_status = [];
superAdmin: Boolean = false; superAdmin: Boolean = false;
ngOnInit() { ngOnInit() {
this.dtOptions = {
pagingType: 'full_numbers',
pageLength: 10,
processing: true
};
// var fTime = new Date().setHours(0,0,0); // var fTime = new Date().setHours(0,0,0);
// this.Fromdate = new Date(fTime); // this.Fromdate = new Date(fTime);
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin; this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
@ -115,6 +130,7 @@ superAdmin:Boolean = false;
this.testTable(); this.testTable();
this.testDetailsTable();
} }
@ -340,6 +356,134 @@ superAdmin:Boolean = false;
// console.log('Error While fetching data'); // console.log('Error While fetching data');
// }) // })
// } // }
tabelDetailsObj: any;
testDetailsTable() {
const that = this;
console.log("inside function");
$(document).ready(function () {
that.tabelDetailsObj = $('#deviceDetailsTable').DataTable({
// dom: 'Bfrtip',
// buttons: [
// 'copy', 'csv', 'excel', 'pdf', 'print'
// ] ,
"processing": true,
"searching": true,
pagingType: 'full_numbers',
pageLength: 25,
serverSide: false,
"scrollY": '65vh',
"scrollCollapse": true,
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
ajax: (dataTablesParameters, callback) => {
console.log('temptemptemptemptemp', dataTablesParameters);
var deviceID;
that.Load = true;
var tempfd = new Date().setHours(0, 0, 0, 0);
var tf = new Date(tempfd);
var temptd = new Date();
var from_date = that.Fromdate ? that.Fromdate : tf.toISOString();
var to_date = that.todate ? that.todate : temptd.toISOString();
var user = that.useridd;
var temp = {
from_date: from_date,
to_date: to_date,
user: user
}
var suburl = "/geofencing/GeoFencingReport";
// suburl += "/notifs/GeoFencingReport?from_date=" + temp.from_date + '&to_date=' + temp.to_date + '&_u=' + temp.user;
that.finalArr = []
// console.log(this.deviceArr);
if (that.deviceArr.length != 0) {
// suburl += '&geoid=' + that.deviceArr.join(',');
} else {
let resp = [];
callback({ data: resp });
}
if (temp.from_date && temp.to_date && that.deviceArr.length != 0) {
that.contactService.postWithURL(suburl, {
"from_date": temp.from_date,
"to_date": temp.to_date,
"geoidlist": that.deviceArr.length ? that.deviceArr : []
}).subscribe((resp: any) => {
// console.log(ignReport.length);
that.Load = false;
that.finalArr = resp
let newData = that.setDetailsReport(resp);
that.newDetailsReport = that.groupDataAndPrepareNewCollection(newData);
console.log('new Table Data=>', that.newDetailsReport);
callback({ data: newData });
}, err => {
that.Load = false;
console.log("error", err);
});
} else {
that.Load = false;
callback({ data: [] });
}
},
"columns": [
{
"data": "vehicleName",
"render": function (data, type, row) {
return data ? data : '';
}
},
{
"data": "inTime",
render: function (data, type, row) {
return data ? data : '';
}
}, {
"data": "outTime",
render: function (data, type, row) {
return data ? data : '';
}
}, {
"data": "duration",
render: function (data, type, row) {
return data ? data : '';
}
},
{
"data": "geoid",
render: function (data, type, row) {
return data ? data.geoname : '';
}
}
],
"columnDefs": [
{ className: "dt-body-left", "targets": [0, 1, 2, 3, 4] },
{
"targets": '_all',
"createdCell": function (td, cellData, rowData, row, col) {
$(td).css('padding', '18px')
}
},
{ "width": "20%", "targets": 0 },
{ "width": "20%", "targets": 1 },
{ "width": "20%", "targets": 2 },
{ "width": "20%", "targets": 3 },
{ "width": "20%", "targets": 4 },
]
});
});
}
tabelObj: any; tabelObj: any;
testTable() { testTable() {
const that = this; const that = this;
@ -401,7 +545,8 @@ testTable() {
that.finalArr = [] that.finalArr = []
// console.log(this.deviceArr); // console.log(this.deviceArr);
if (that.deviceArr.length != 0) { if (that.deviceArr.length != 0) {
suburl +='&geoid='+that.deviceArr[0];
suburl += '&geoid=' + that.deviceArr.join(',');
} else { } else {
let resp = []; let resp = [];
@ -413,6 +558,7 @@ testTable() {
// console.log(ignReport.length); // console.log(ignReport.length);
that.Load = false; that.Load = false;
that.finalArr = resp that.finalArr = resp
//that.setDetailsReport(resp);
console.log('respresp=>', resp); console.log('respresp=>', resp);
callback({ data: resp }); callback({ data: resp });
}, err => { }, err => {
@ -486,7 +632,65 @@ testTable() {
}); });
} }
groupDataAndPrepareNewCollection(gridData) {
let newTableData = [];
if (gridData && gridData.length) {
let result = gridData.reduce(function (r, a) {
r[a.vehicleName] = r[a.vehicleName] || [];
r[a.vehicleName].push(a);
return r;
}, Object.create(null));
Object.keys(result).forEach(key => {
newTableData.push({
'vehicle': key,
'list': result[key],
'calculatedKey':this.calculateGeofence(result[key])
})
});
}
return newTableData;
}
totalGeoFaceCalculate(data) {
let returnData = {
durationTotal:0,
distanceTotal:0,
idleTime:'0 h 0 m',
labelDuration:''
}
data.forEach(item=>{
returnData.durationTotal += item.durationMin;
returnData.distanceTotal += item.routeLength;
})
return returnData;
}
calculateGeofence(geofenceData) {
let newGeoFenceData = []
let result = geofenceData.reduce(function (r, a) {
r[a.geoid.geoname] = r[a.geoid.geoname] || [];
r[a.geoid.geoname].push(a);
return r;
}, Object.create(null));
Object.keys(result).forEach(key => {
let finalSetData = this.totalGeoFaceCalculate(result[key]);
if (finalSetData.durationTotal) {
finalSetData['labelDuration'] = Math.floor(finalSetData.durationTotal / 60) + " H, " + finalSetData.durationTotal % 60 + " M"
} else {
finalSetData['labelDuration'] = 'O H, 0 M';
}
newGeoFenceData.push({
'zoneName': key,
'durationTotal': finalSetData.labelDuration,
'durationTotalMin': finalSetData.durationTotal,
'distanceTotal': finalSetData.distanceTotal,
'idleTime':finalSetData.idleTime,
})
});
return newGeoFenceData;
}
addressLink = ""; addressLink = "";
getlink(report) { getlink(report) {
console.log("inside function"); console.log("inside function");
@ -500,19 +704,23 @@ getlink(report){
tab: any; tab: any;
exportExcel() exportExcel() {
{
var tab_text = "<table border='2px'><tr bgcolor='#87AFC6'>"; var tab_text = "<table border='2px'><tr bgcolor='#87AFC6'>";
var textRange; var j = 0; var textRange; var j = 0;
var table = $('#deviceTable').clone(); let tableId = this.isNormalView ? '#deviceTable' : '#deviceDetailsTable';
let tableClass = this.isNormalView ? '.deviceTable' : '.deviceDetailsTable';
var table = $(tableId).clone();
table[0].querySelector("thead").remove(); table[0].querySelector("thead").remove();
table[0].prepend($(".dataTable thead").clone()[0]); let tHead = $(tableClass + " thead").clone()[0];
table[0].prepend(tHead);
this.tab = table[0];//document.getElementById('deviceTable'); // id of table this.tab = table[0];//document.getElementById('deviceTable'); // id of table
for(j = 0 ; j < this.tab.rows.length ; j++) for (j = 0; j < this.tab.rows.length; j++) {
{
tab_text = tab_text + this.tab.rows[j].innerHTML + "</tr>"; tab_text = tab_text + this.tab.rows[j].innerHTML + "</tr>";
//tab_text=tab_text+"</tr>"; //tab_text=tab_text+"</tr>";
} }
@ -525,17 +733,26 @@ getlink(report){
var ua = window.navigator.userAgent; var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE "); var msie = ua.indexOf("MSIE ");
if(this.isNormalView) {
var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text)); var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
return (sa); return (sa);
} }
else {
var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent($('#geoDetailsTable').html()));
return (sa);
}
}
getReport(event) { getReport(event) {
if (event == 'getExcel') { if (event == 'getExcel') {
if(this.isNormalView) {
this.exportExcel(); this.exportExcel();
} else if(event=='getPdf') } else {
{ this.tableToCSV();
}
} else if (event == 'getPdf') {
this.expotToPdf(); this.expotToPdf();
} else { } else {
var deviceId: any; var deviceId: any;
@ -557,16 +774,94 @@ getlink(report){
console.log(this.tabelObj); console.log(this.tabelObj);
this.tabelObj.ajax.reload(); this.tabelObj.ajax.reload();
this.tabelDetailsObj.ajax.reload();
} }
} }
tableToCSV() {
// Variable to store the final csv data
var csv_data = [];
// Get each row data
var rows = document.getElementsByClassName('tr-geofence');
for (var i = 0; i < rows.length; i++) {
// Get each column data
var cols = rows[i].querySelectorAll('td,th');
// Stores each csv row data
var csvrow = [];
for (var j = 0; j < cols.length; j++) {
// Get the text data of each cell
// of a row and push it to csvrow
csvrow.push(cols[j].innerHTML);
}
// Combine each column value with comma
csv_data.push(csvrow.join(","));
}
// Combine each row data with new line character
let newcsv_data = csv_data.join('\n');
// Call this function to download csv file
this.downloadCSVFile(newcsv_data);
}
downloadCSVFile(csv_data) {
// Create CSV file object and feed
// our csv_data into it
let CSVFile = new Blob([csv_data], {
type: "text/csv"
});
// Create to temporary link to initiate
// download process
var temp_link = document.createElement('a');
// Download csv file
temp_link.download = "Geofence.csv";
var url = window.URL.createObjectURL(CSVFile);
temp_link.href = url;
// This link should not be displayed
temp_link.style.display = "none";
document.body.appendChild(temp_link);
// Automatically click the link to
// trigger download
temp_link.click();
document.body.removeChild(temp_link);
}
expotToPdf() { expotToPdf() {
console.log(this.finalArr); console.log(this.finalArr);
this.downloadPdf() this.downloadPdf()
if(this.isNormalView) {
} else {
// var doc = new jsPDF();
// var specialElementHandlers = {
// '#editor789': function (element, renderer) {
// return true;
// }
// };
// doc.fromHTML($('#geoDetailsTable').html(), 15, 5, {
// 'width': 500,
// 'elementHandlers': specialElementHandlers
// });
// doc.save('detail_geofence.pdf')
}
} }
@ -614,15 +909,22 @@ endAddress;
f_date f_date
t_date t_date
downloadPdf() { downloadPdf() {
var outerThis=this var outerThis = this;
let displayArray = [];
if (!this.isNormalView) {
displayArray = this.displayDetailsReport;
} else {
displayArray = outerThis.finalArr;
}
let fileName = let fileName =
"Distnace Report" + "Distnace Report" +
new Date() + new Date() +
PDF_EXTENSION; PDF_EXTENSION;
var pdfsize = "a2"; var pdfsize = "a2";
var totalPagesExp = "{total_pages_count_string}"; var totalPagesExp = "{total_pages_count_string}";
outerThis.startAddress= outerThis.finalArr[0].address; outerThis.startAddress = displayArray[0].address;
outerThis.endAddress= outerThis.finalArr[outerThis.finalArr.length-1].address outerThis.endAddress = displayArray[displayArray.length - 1].address
var doc = new jsPDF("p", "pt", pdfsize); var doc = new jsPDF("p", "pt", pdfsize);
// outerThis.f_date = moment(this.Fromdate).format('lll'); // outerThis.f_date = moment(this.Fromdate).format('lll');
// outerThis.t_date =moment(this.todate).format('lll'); // outerThis.t_date =moment(this.todate).format('lll');
@ -658,7 +960,7 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
head: outerThis.headRows(), head: outerThis.headRows(),
// margin: { top: 80 }, // margin: { top: 80 },
// startY: doc.autoTable.previous.finalY + 200, // startY: doc.autoTable.previous.finalY + 200,
body: outerThis.bodyRows(outerThis.finalArr.length, outerThis.finalArr), body: outerThis.bodyRows(displayArray.length, displayArray),
options, options,
styles: { overflow: 'linebreak' }, styles: { overflow: 'linebreak' },
@ -671,10 +973,12 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
// logo=localStorage.getItem('logo1'); // logo=localStorage.getItem('logo1');
if (logo) if (logo)
doc.addImage(dataUrl, 'JPEG', pageWidth - 100, 6, 75, 75); doc.addImage(dataUrl, 'JPEG', pageWidth - 100, 6, 75, 75);
doc.autoTable({html:"#headerTable", doc.autoTable({
html: "#headerTable",
styles: { fontSize: 13, textColor: "[255,72,72]" }, styles: { fontSize: 13, textColor: "[255,72,72]" },
margin: { bottom: 140, left: 40, right: 8, top: 40 }, margin: { bottom: 140, left: 40, right: 8, top: 40 },
theme:'plain'}); theme: 'plain'
});
// Footer // Footer
var str = "Page " + doc.internal.getNumberOfPages() var str = "Page " + doc.internal.getNumberOfPages()
@ -715,11 +1019,7 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
xhr.send(); xhr.send();
} }
headRows() { headRows() {
let finalPrintKeys = this.isNormalView ? {
return [
// displayedColumns=['vehicleName','IMEI','totalDistance','fuel','ignOn','ignOff','idleTime','outOfReach','noGps','trips','maxSpeed','startLocation','endLocation','details'];
{
vehicleName: 'Vehicle Name', vehicleName: 'Vehicle Name',
direction: 'In/Out', direction: 'In/Out',
timestamp: 'Date Time', timestamp: 'Date Time',
@ -727,7 +1027,19 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
geoname: 'Geofence Name', geoname: 'Geofence Name',
} : {
vehicleName: 'Vehicle Name',
inTime: 'In Time',
outTime: 'Out Time',
duration: 'Duration',
geoname: 'Geofence Name',
} }
return [
// displayedColumns=['vehicleName','IMEI','totalDistance','fuel','ignOn','ignOff','idleTime','outOfReach','noGps','trips','maxSpeed','startLocation','endLocation','details'];
finalPrintKeys
]; ];
} }
@ -737,6 +1049,7 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
rowCount = rowCount || 10; rowCount = rowCount || 10;
let body = []; let body = [];
for (var j = 0; j < rowCount; j++) { for (var j = 0; j < rowCount; j++) {
if (this.isNormalView) {
body.push({ body.push({
vehicleName: pdfBody[j].vehicleName, vehicleName: pdfBody[j].vehicleName,
direction: pdfBody[j].direction, direction: pdfBody[j].direction,
@ -745,11 +1058,87 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
geoname: pdfBody[j].geoid.geoname ? pdfBody[j].geoid.geoname : '--', geoname: pdfBody[j].geoid.geoname ? pdfBody[j].geoid.geoname : '--',
}); });
} else {
body.push({
vehicleName: pdfBody[j].vehicleName,
inTime: pdfBody[j].inTime,
outTime: pdfBody[j].outTime,
duration: pdfBody[j].duration,
geoname: pdfBody[j].geoid.geoname ? pdfBody[j].geoid.geoname : '--',
});
}
} }
return body; return body;
} }
displayDetailsReport = [];
newDetailsReport = [];
setDetailsReport(list) {
// let a = list.sort(function (a, b) {
// // Turn your strings into dates, and then subtract them
// // to get a value that is either negative, positive, or zero.
// let d1 = new Date(b.timestamp).getTime();
// let d2 = new Date(a.timestamp).getTime();
// return d2 - d1;
// });
this.displayDetailsReport = [];
this.newDetailsReport = [];
list.forEach(item => {
if (item.direction == 'Out') {
// let lastItem = this.displayDetailsReport.filter(dItem => dItem.direction == 'In' && item.vehicleName.trim() == dItem.vehicleName.trim())
// if (lastItem && lastItem.length) {
// if (!lastItem[lastItem.length - 1].isOutEntry) {
// let dateDiff = this.dateDifferent(lastItem[lastItem.length - 1].timestamp, item.timestamp);
// lastItem[lastItem.length - 1].isOutEntry = true;
// lastItem[lastItem.length - 1].outTime = item.timestamp ? (moment(item.timestamp).format('llll')) : ""
// lastItem[lastItem.length - 1].duration = dateDiff.label;
// lastItem[lastItem.length - 1].durationMin = dateDiff.min;
// }
// }
} else { // in direction
item.vehicleName = item.device && item.device.Device_Name ? item.device.Device_Name : 'n/a'
item.inTimeDate = item.arrivalTime;
item.inTime = item.arrivalTime ? (moment(item.arrivalTime).format('llll')) : "";
let dateDiff = this.convertMStoHourMin(item.duration);
item.outTime = item.departureTime ? (moment(item.departureTime).format('llll')) : "n/a";
item.routeLength = 0;
item.outTimeDate = item.departureTime;
item.duration = dateDiff.label;
item.durationMin = dateDiff.min;
this.displayDetailsReport.push(item);
}
});
this.displayDetailsReport = this.displayDetailsReport.filter(ddR => ddR.durationMin >= this.filterDuration)
return this.displayDetailsReport;
}
dateDifferent(date1, date2) {
var today = date1? new Date(date1): new Date();
var Christmas = date2? new Date(date2):new Date();
var diffMs = (Christmas.getTime() - today.getTime()); // milliseconds between now & Christmas
var diffDays = Math.floor(diffMs / 86400000); // days
var diffHrs = Math.floor((diffMs % 86400000) / 3600000); // hours
var diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes
let finalMin = (diffHrs + (diffDays * 24)) * 60 + diffMins;
console.log(finalMin);
return { label: (diffHrs + (diffDays * 24)) + " H, " + diffMins + "M", min: finalMin };
}
convertMStoHourMin(diffMs) {
var diffDays = Math.floor(diffMs / 86400000); // days
var diffHrs = Math.floor((diffMs % 86400000) / 3600000); // hours
var diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes
let finalMin = (diffHrs + (diffDays * 24)) * 60 + diffMins;
console.log(finalMin);
return { label: (diffHrs + (diffDays * 24)) + " H, " + diffMins + "M", min: finalMin };
}
filterDetailsReport() {
this.tabelDetailsObj.ajax.reload();
}
} }

View file

@ -749,12 +749,12 @@ export class NewTravelPathReportComponent implements OnInit {
imei: pdfBody[j].imei, imei: pdfBody[j].imei,
date: moment(pdfBody[j].date).format('lll'), date: moment(pdfBody[j].date).format('lll'),
odo: pdfBody[j].odo ? (pdfBody[j].odo).toFixed(2) : 0, odo: pdfBody[j].odo ? (pdfBody[j].odo).toFixed(2) : 0,
distanceFromPrevious: this.get_distance(pdfBody[j].index), distanceFromPrevious: pdfBody[j].distanceFromPrevious,
speed: pdfBody[j].speed, speed: pdfBody[j].speed,
avgSpeed: this.getavgSpeed(pdfBody[j].index), avgSpeed: pdfBody[j].avgSpeed,
externalBattery: pdfBody[j].external_Battery ? pdfBody[j].external_Battery : '0', externalBattery: pdfBody[j].external_Battery ? pdfBody[j].external_Battery : '0',
temperature: pdfBody[j].temp ? (parseFloat(pdfBody[j].temp) / 10).toFixed(2) : '0', temperature: pdfBody[j].temp ? (parseFloat(pdfBody[j].temp) / 10).toFixed(2) : '0',
cumDistance: this.getcummulative_distance(pdfBody[j], pdfBody[j].index), cumDistance: pdfBody[j].cum_distance,
location: (pdfBody[j].latDecimal ? pdfBody[j].latDecimal : 0) + ' , ' + (pdfBody[j].longDecimal ? pdfBody[j].longDecimal : 0), location: (pdfBody[j].latDecimal ? pdfBody[j].latDecimal : 0) + ' , ' + (pdfBody[j].longDecimal ? pdfBody[j].longDecimal : 0),
address: pdfBody[j].address, address: pdfBody[j].address,

View file

@ -417,13 +417,13 @@ addressLink = "";
} }
} , } ,
{ {
"data": "address", "data": null,
render: function(data, type, row) { render: function(data, type, row) {
var lat = row.lat?row.lat:0; var lat = row.lat?row.lat:0;
var lng = row.long?row.long:0; var lng = row.long?row.long:0;
var addressLink = '<a href="https://maps.google.com/?q='+ lat +','+lng +' " target="_blank" title="Click to get vehicle last location"> <img height="20px" width="20px" src="../../../assets/image/addressICON.png"> </a>'; var addressLink = '<a href="https://maps.google.com/?q='+ lat +','+lng +' " target="_blank" title="Click to get vehicle last location"> <img height="20px" width="20px" src="../../../assets/image/addressICON.png"> </a>';
if(data){ if(row.address){
return data ; return row.address ;
}else{ }else{
return addressLink; return addressLink;
} }
@ -615,6 +615,7 @@ downloadPdf() {
// outerThis.startAddress= outerThis.finalArr[0].address; // outerThis.startAddress= outerThis.finalArr[0].address;
// outerThis.endAddress= outerThis.finalArr[outerThis.finalArr.length-1].address // outerThis.endAddress= outerThis.finalArr[outerThis.finalArr.length-1].address
var doc = new jsPDF("p", "pt", pdfsize); var doc = new jsPDF("p", "pt", pdfsize);
console.log(outerThis);
outerThis.f_date = moment(this.Fromdate).format('lll'); outerThis.f_date = moment(this.Fromdate).format('lll');
outerThis.t_date =moment(this.todate).format('lll'); outerThis.t_date =moment(this.todate).format('lll');
// var date_combine = f_date + ' to ' + t_date; // var date_combine = f_date + ' to ' + t_date;
@ -728,8 +729,8 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
body.push({ body.push({
vehicleName:pdfBody[j].device.Device_Name, vehicleName:pdfBody[j].device.Device_Name,
fromDate:moment(this.Fromdate).format('lll'), fromDate: moment(pdfBody[j].arrival_time).format('lll'),
toDate:moment(this.todate).format('lll'), toDate: moment(pdfBody[j].departure_time).format('lll'),
duration:this.durationFun(pdfBody[j]), duration:this.durationFun(pdfBody[j]),
location:pdfBody[j].address?pdfBody[j].address:'N/A', location:pdfBody[j].address?pdfBody[j].address:'N/A',

View file

@ -2,7 +2,7 @@
<div class="topDiv"> <div class="topDiv">
<div class="row" style="text-align: center; background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)"> <div class="row" style="text-align: center; background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)">
<div class="col-sm-12 col-md-12 col-lg-12"> <div class="col-sm-12 col-md-12 col-lg-12">
<h4>{{'Trip Report'|translate}}</h4> <h4>{{'1 Trip Report'|translate}}</h4>
</div> </div>
</div> </div>
<!-- <div class="row rowStyle" > <!-- <div class="row rowStyle" >

View file

@ -586,11 +586,14 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
rowCount = rowCount || 10; rowCount = rowCount || 10;
let body = []; let body = [];
for (var j = 0; j < rowCount; j++) { for (var j = 0; j < rowCount; j++) {
var stime = pdfBody[j].start_time ? new Date(pdfBody[j].start_time) : '';
var endTime = pdfBody[j].end_time? new Date(pdfBody[j].end_time):'';
body.push({ body.push({
Device_Name:pdfBody[j].device.Device_Name, Device_Name:pdfBody[j].device.Device_Name,
fromDate:moment(this.Fromdate).format('lll'), fromDate: stime? moment(stime).format('llll'):'',
fromLocation:pdfBody[j].startAddress?pdfBody[j].startAddress:'N/A', fromLocation:pdfBody[j].startAddress?pdfBody[j].startAddress:'N/A',
toDate: moment(this.todate).format('lll'), toDate: endTime ? moment(endTime).format('lll'):'',
toLocation:pdfBody[j].endAddress?pdfBody[j].endAddress:'N/A', toLocation:pdfBody[j].endAddress?pdfBody[j].endAddress:'N/A',
distance:pdfBody[j].distance?(pdfBody[j].distance/1000).toFixed(2):0 distance:pdfBody[j].distance?(pdfBody[j].distance/1000).toFixed(2):0
}); });

View file

@ -60,6 +60,7 @@
<div class="col-sm-9 col-md-9 col-lg-9" style="padding: 0"> <div class="col-sm-9 col-md-9 col-lg-9" style="padding: 0">
<div> <div>
<select <select
[disabled]="componentIdentifier =='current_position'"
style="width: -webkit-fill-available" style="width: -webkit-fill-available"
[ngModel]="selectGroup" [ngModel]="selectGroup"
(ngModelChange)="onChangeGroup($event)" (ngModelChange)="onChangeGroup($event)"
@ -91,6 +92,17 @@
</div> </div>
<div class="col-sm-9 col-md-9 col-lg-9" style="padding: 0"> <div class="col-sm-9 col-md-9 col-lg-9" style="padding: 0">
<div> <div>
<div *ngIf="componentIdentifier =='daywise_report'">
<select (change)="onDateChange()" id="dbselect_single">
<option
*ngFor="let option_1 of options"
[value]="option_1.selectedValue"
>
{{ option_1.value }}
</option>
</select>
</div>
<div *ngIf="componentIdentifier !='daywise_report'">
<select id="dbselect" multiple="multiple"> <select id="dbselect" multiple="multiple">
<option <option
*ngFor="let option_1 of options" *ngFor="let option_1 of options"
@ -102,6 +114,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div <div
*ngIf="componentIdentifier === 'notification_master' || !isCC" *ngIf="componentIdentifier === 'notification_master' || !isCC"
class="row" class="row"
@ -227,7 +240,8 @@
style="width: 100%" style="width: 100%"
> >
<button <button
[disabled]="componentIdentifier === 'dayWiseReport'" [disabled]="componentIdentifier === 'dayWiseReport' || componentIdentifier =='current_position'"
type="button" type="button"
style="width: 25%; border-right: 2px solid white" style="width: 25%; border-right: 2px solid white"
class="btn btn-secondary animateClass_4" class="btn btn-secondary animateClass_4"
@ -236,6 +250,8 @@
{{ "Today" | translate }} {{ "Today" | translate }}
</button> </button>
<button <button
[disabled]="componentIdentifier =='current_position'"
type="button" type="button"
style="width: 25%; border-right: 2px solid white" style="width: 25%; border-right: 2px solid white"
class="btn btn-secondary animateClass_5" class="btn btn-secondary animateClass_5"
@ -244,6 +260,7 @@
{{ "Yesterday" | translate }} {{ "Yesterday" | translate }}
</button> </button>
<button <button
[disabled]="componentIdentifier =='current_position'"
type="button" type="button"
style="width: 25%; border-right: 2px solid white" style="width: 25%; border-right: 2px solid white"
class="btn btn-secondary animateClass_6" class="btn btn-secondary animateClass_6"
@ -252,7 +269,9 @@
{{ "Week" | translate }} {{ "Week" | translate }}
</button> </button>
<button <button
[disabled]="componentIdentifier === 'distance_report'"
[disabled]="componentIdentifier === 'distance_report' || componentIdentifier =='current_position'"
type="button" type="button"
style="width: 25%" style="width: 25%"
class="btn btn-secondary animateClass_7" class="btn btn-secondary animateClass_7"
@ -284,10 +303,20 @@
{{ "From" | translate }} :</span {{ "From" | translate }} :</span
> >
</div> </div>
<div class="col-sm-9 col-md-9 col-lg-9" style="padding: 0px"> <div class="col-sm-9 col-md-9 col-lg-9 mp-datepicker" style="padding: 0px">
<!-- from datetime picker --> <!-- from datetime picker -->
<input <ng-container *ngIf="componentIdentifier =='daily_report' || componentIdentifier =='daywise_report'">
<owl-date-time (ngModelChange)="onDateChange($event)" ngDefaultControl [name]="'from_date'" [(ngModel)]="from_date" [hourFormat]="'12'" [type]="'calendar'" [dateFormat]="'DD/MM/YYYY'" [autoClose]="true"></owl-date-time>
</ng-container>
<ng-container *ngIf="!(componentIdentifier =='daily_report' || componentIdentifier =='daywise_report')">
<owl-date-time (ngModelChange)="onDateChange($event)" ngDefaultControl [name]="'from_date'" [(ngModel)]="from_date" [hourFormat]="'12'" [type]="'both'" [dateFormat]="'DD/MM/YYYY h:mm:ss a'" [autoClose]="true"></owl-date-time>
</ng-container>
<!-- <input
id="from_date" id="from_date"
[disabled]="componentIdentifier =='current_position'"
bsDatepicker bsDatepicker
class="form-control form-control-sm" class="form-control form-control-sm"
style="height: 25px" style="height: 25px"
@ -295,7 +324,7 @@
[(ngModel)]="from_date" [(ngModel)]="from_date"
type="text" type="text"
(ngModelChange)="clicked = false" (ngModelChange)="clicked = false"
/> /> -->
</div> </div>
</div> </div>
<div <div
@ -308,10 +337,20 @@
>{{ lableVariable | translate }} :</span >{{ lableVariable | translate }} :</span
> >
</div> </div>
<div class="col-sm-9 col-md-9 col-lg-9" style="padding: 0px"> <div class="col-sm-9 col-md-9 col-lg-9 mp-datepicker" style="padding: 0px">
<!-- tolabel picker --> <!-- tolabel picker -->
<input <ng-container *ngIf="componentIdentifier =='daily_report' || componentIdentifier =='daywise_report'">
<owl-date-time ngDefaultControl (ngModelChange)="onDateChange($event)" [name]="'to_date'" [(ngModel)]="to_date" [hourFormat]="'12'" [type]="'calendar'" [dateFormat]="'DD/MM/YYYY'" [autoClose]="true"></owl-date-time>
</ng-container>
<ng-container *ngIf="!(componentIdentifier =='daily_report' || componentIdentifier =='daywise_report')">
<owl-date-time ngDefaultControl (ngModelChange)="onDateChange($event)" [name]="'to_date'" [(ngModel)]="to_date" [hourFormat]="'12'" [type]="'both'" [dateFormat]="'DD/MM/YYYY h:mm:ss a'" [autoClose]="true"></owl-date-time>
</ng-container>
<!-- <input
id="to_date" id="to_date"
[disabled]="componentIdentifier =='current_position'"
bsDatepicker bsDatepicker
class="form-control form-control-sm" class="form-control form-control-sm"
style="height: 25px" style="height: 25px"
@ -320,7 +359,7 @@
[(ngModel)]="to_date" [(ngModel)]="to_date"
type="text" type="text"
(ngModelChange)="clicked = false" (ngModelChange)="clicked = false"
/> /> -->
</div> </div>
</div> </div>
<div <div
@ -1088,7 +1127,7 @@
<div class="col-3">{{ "Vahicle Name" | translate }}</div> <div class="col-3">{{ "Vahicle Name" | translate }}</div>
<div class="col-9"> <div class="col-9">
<div style="display: flex"> <div style="display: flex">
<select id="dbselectVehicleName" multiple="multiple"> <select [disabled]="componentIdentifier =='current_position'" id="dbselectVehicleName" multiple="multiple">
<option <option
*ngFor="let uname of deviceArr_1" *ngFor="let uname of deviceArr_1"
[value]="uname.Device_ID" [value]="uname.Device_ID"
@ -1112,6 +1151,7 @@
style="width: 100%" style="width: 100%"
> >
<button <button
type="button" type="button"
style="width: 25%; border-right: 2px solid white" style="width: 25%; border-right: 2px solid white"
class="btn btn-secondary animateClass_4" class="btn btn-secondary animateClass_4"

View file

@ -9,3 +9,13 @@ col-sm-9 col-md-9 col-lg-9 .ms-parent {
.inner { .inner {
display: inline-block; display: inline-block;
} }
.time-picker {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
max-width: 16em;
min-width: 16em;
background-color: #e6e6e6;
}

View file

@ -78,6 +78,7 @@ export class ReportFilterComponent implements OnInit {
reportArray = [ reportArray = [
{name : "AC Report",Rstatus:true,Astatus:false,value:"ac_report"}, {name : "AC Report",Rstatus:true,Astatus:false,value:"ac_report"},
{ name: "Current Position", Rstatus: true, Astatus: false, value: "current_position" },
{name:"Daily Report",Rstatus:true,Astatus:false,value:"daily_report"}, {name:"Daily Report",Rstatus:true,Astatus:false,value:"daily_report"},
{name:"Daily Logs",Rstatus:true,Astatus:false,value:"daily_logs"}, {name:"Daily Logs",Rstatus:true,Astatus:false,value:"daily_logs"},
{name:"Daywise Report",Rstatus:true,Astatus:false,value:"daywise_report"}, {name:"Daywise Report",Rstatus:true,Astatus:false,value:"daywise_report"},
@ -143,9 +144,92 @@ export class ReportFilterComponent implements OnInit {
console.log(this.componentIdentifier,this.selectedStopageDuration); console.log(this.componentIdentifier,this.selectedStopageDuration);
this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY, h:mm:ss a' }, { containerClass: this.colorTheme }); this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY, h:mm:ss a' }, { containerClass: this.colorTheme });
} }
groups groups;
ngOnInit() { changeEvents()
{
$(document).on('change', 'select', ()=> {
this.clicked = false
});
$("#dbselect_single").change( ()=> {
this.clicked = false
});
$("#dbselect_1").change( ()=> {
this.clicked = false
});
$("#dbselect_billtype").change( ()=> {
this.clicked = false
});
$("#dbselect_billStatus").change( ()=> {
this.clicked = false
});
$("#dbselectPhone").change( ()=> {
this.clicked = false
});
$("#dbselectName").change( ()=> {
this.clicked = false
});
$("#dbselectSIM").change( ()=> {
this.clicked = false
});
$("#dbselectIMEI").change( ()=> {
this.clicked = false
});
$("#dbselectVehicleName").change( ()=> {
this.clicked = false
});
$("#dbselect_2").change( ()=> {
this.clicked = false
});
$("#dbselect_3").change( ()=> {
this.clicked = false
});
$("#dbselect_notif").change( ()=> {
this.clicked = false
});
$("#dbselect").change( ()=> {
this.clicked = false
});
$("#dbselect_single").change( ()=> {
this.clicked = false
});
$("#dbselect1").change( ()=> {
this.clicked = false
});
$("#dbselectNotif").change( ()=> {
this.clicked = false
});
}
ngOnInit() {
setTimeout(()=>{
this.changeEvents();
},100)
this.loadropdown(); this.loadropdown();
var fTime = new Date(); var fTime = new Date();
fTime.setHours(0,0,0,0); fTime.setHours(0,0,0,0);
@ -156,74 +240,7 @@ export class ReportFilterComponent implements OnInit {
this.from_date = new Date(fTime); this.from_date = new Date(fTime);
} }
$("#dbselect_1").change(function () {
that.clicked=false
});
$("#dbselect_billtype").change(function () {
that.clicked=false
});
$("#dbselect_billStatus").change(function () {
that.clicked=false
});
$("#dbselectPhone").change(function () {
that.clicked=false
});
$("#dbselectName").change(function () {
that.clicked=false
});
$("#dbselectSIM").change(function () {
that.clicked=false
});
$("#dbselectIMEI").change(function () {
that.clicked=false
});
$("#dbselectVehicleName").change(function () {
that.clicked=false
});
$("#dbselect_2").change(function () {
that.clicked=false
});
$("#dbselect_3").change(function () {
that.clicked=false
});
$("#dbselect_notif").change(function () {
that.clicked=false
});
$("#dbselect").change(function () {
that.clicked=false
});
$("#dbselect1").change(function () {
that.clicked=false
});
$("#dbselectNotif").change(function () {
that.clicked=false
});
// console.log('this.componentIdentifier',this.componentIdentifier); // console.log('this.componentIdentifier',this.componentIdentifier);
this.reportPrefrecne = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).report_preference; this.reportPrefrecne = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).report_preference;
console.log("----------------",this.reportPrefrecne,'---->',typeof(this.reportPrefrecne)); console.log("----------------",this.reportPrefrecne,'---->',typeof(this.reportPrefrecne));
@ -270,7 +287,7 @@ $("#dbselectNotif").change(function () {
var td = new Date().setHours(23,59,59,999); var td = new Date().setHours(23,59,59,999);
this.to_date = new Date(td); this.to_date = new Date(td);
this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYYY' }, { containerClass: this.colorTheme }); this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY, h:mm:ss a' }, { containerClass: this.colorTheme });
} }
@ -407,7 +424,9 @@ $("#dbselectNotif").change(function () {
} }
chnageValueEvent() {
this.clicked = false
}
loadropdown() { loadropdown() {
let that = this; let that = this;
var placeholderval; var placeholderval;
@ -435,8 +454,8 @@ $("#dbselectNotif").change(function () {
width: 200, width: 200,
placeholder: this.componentIdentifier == 'geofence_report'?'Select Geofence .....': placeholderval, placeholder: this.componentIdentifier == 'geofence_report'?'Select Geofence .....': placeholderval,
filter: true, filter: true,
single: true, // single: true,
selectAll: false // selectAll: false
}) })
@ -540,15 +559,19 @@ $("#dbselectNotif").change(function () {
} }
}else{ }else{
setTimeout(() => { setTimeout(() => {
$('#dbselect').multipleSelect({ $('#dbselect').multipleSelect({
width: 200, width: 200,
placeholder:this.componentIdentifier == 'geofence_report'?'Select Geofence....': 'Select Vehicle.....', placeholder:this.componentIdentifier == 'geofence_report'?'Select Geofence....': 'Select .....',
filter: true, filter: true,
}) })
}, 100); }, 100);
} }
if(this.componentIdentifier == 'poi_report'){ if(this.componentIdentifier == 'poi_report'){
setTimeout(() => { setTimeout(() => {
$('#dbselect_1').multipleSelect({ $('#dbselect_1').multipleSelect({
@ -608,7 +631,19 @@ $("#dbselectNotif").change(function () {
} }
if (this.componentIdentifier === 'daywise_report') {
setTimeout(() => {
$('#dbselect_single').multipleSelect({
width: 200,
placeholder: 'Select ....',
filter: true,
single: true,
selectAll: false
})
}, 1000);
}
// if(this.componentIdentifier == 'usersMaster'){ // if(this.componentIdentifier == 'usersMaster'){
@ -636,7 +671,9 @@ $("#dbselectNotif").change(function () {
// } // }
// },200) // },200)
setTimeout(()=>{
this.changeEvents();
},100)
} }
@ -644,7 +681,12 @@ $("#dbselectNotif").change(function () {
deviceFilterArr :any; deviceFilterArr :any;
reportFilter(data): void { reportFilter(data): void {
var demo=[] var demo=[]
if (this.componentIdentifier == "daywise_report") {
this.deviceArr = $('#dbselect_single').multipleSelect('getSelects','value');
} else {
this.deviceArr = $('#dbselect').multipleSelect('getSelects','value'); this.deviceArr = $('#dbselect').multipleSelect('getSelects','value');
}
// var group = $('#groupSelect').multipleSelect('getSelects','value'); // var group = $('#groupSelect').multipleSelect('getSelects','value');
// console.log("GROUPS==>",group); // console.log("GROUPS==>",group);
@ -782,7 +824,9 @@ $("#dbselectNotif").change(function () {
{ {
this.reportService.distanceReport(filter) this.reportService.distanceReport(filter)
} }
if (this.componentIdentifier == "current_position") {
this.reportService.currentPositionReport(filter)
}
if(this.componentIdentifier=="geofence_report") if(this.componentIdentifier=="geofence_report")
@ -922,7 +966,9 @@ exportPDF(){
{ {
this.reportService.distanceReport(filter) this.reportService.distanceReport(filter)
} }
if (this.componentIdentifier == "current_position") {
this.reportService.currentPositionReport(filter)
}
if(this.componentIdentifier=="geofence_report") if(this.componentIdentifier=="geofence_report")
this.reportService.geofenceReport(filter) this.reportService.geofenceReport(filter)
@ -1007,7 +1053,9 @@ exportExel(){
{ {
this.reportService.distanceReport(filter) this.reportService.distanceReport(filter)
} }
if (this.componentIdentifier == "current_position") {
this.reportService.currentPositionReport(filter)
}
if(this.componentIdentifier=="geofence_report") if(this.componentIdentifier=="geofence_report")
this.reportService.geofenceReport(filter) this.reportService.geofenceReport(filter)
@ -1487,6 +1535,10 @@ changeComponent(component){
// this.loadropdown() // this.loadropdown()
this.ngOnInit() this.ngOnInit()
}
onDateChange() {
console.log('on change triggered');
this.clicked = false;
} }
onChangeGroup(event){ onChangeGroup(event){
console.log(event); console.log(event);

View file

@ -87,6 +87,7 @@ import { PerformanceReportComponent } from './report component/performance-repor
import { NotiLocationComponent } from './report component/notification-master/noti-location/noti-location.component'; import { NotiLocationComponent } from './report component/notification-master/noti-location/noti-location.component';
import { HeaderComponent } from '../report/header/header.component'; import { HeaderComponent } from '../report/header/header.component';
import { ViewRawComponent } from './report component/push-data-report/view-raw/view-raw.component'; import { ViewRawComponent } from './report component/push-data-report/view-raw/view-raw.component';
import { CurrentPositionReportComponent } from './report component/current-position/current-position.component';
@NgModule({ @NgModule({
imports: [ imports: [
@ -155,7 +156,7 @@ import { ViewRawComponent } from './report component/push-data-report/view-raw/v
], ],
entryComponents:[DetailComponent,WorkingHourDetailComponent,AcreportInfoComponent,SummaryDetailsComponent,NotiLocationComponent,ViewRawComponent], entryComponents:[DetailComponent,WorkingHourDetailComponent,AcreportInfoComponent,SummaryDetailsComponent,NotiLocationComponent,ViewRawComponent],
declarations: [MainComponent,IgnReportComponent, ReportFilterComponent,DisatanceReportComponent,TripDetailsComponent,POIReportComponent,OverSpeedComponent,MaintananceComponent,IgnitionReportComponent,IdleReportComponent,IdealReportComponent,FuelReportComponent,DayWiseReportComponent,DeviceSpeedReportComponent,AcreportInfoComponent, declarations: [MainComponent,IgnReportComponent, ReportFilterComponent,DisatanceReportComponent,TripDetailsComponent,POIReportComponent,OverSpeedComponent,MaintananceComponent,IgnitionReportComponent,IdleReportComponent,IdealReportComponent,FuelReportComponent,DayWiseReportComponent,DeviceSpeedReportComponent,AcreportInfoComponent,
TravelPathReportComponent,TempretureReportComponent,TempretureGraphComponent,SummaryReportComponent,StoppageReportComponent,RouteViolationComponent,DeviceFuelReportComponent,DeviceSOSreportComponent,AcReportsComponent, DailyReportComponent,DailyDetailsComponent, TravelPathReportComponent, TempretureReportComponent, TempretureGraphComponent, SummaryReportComponent, StoppageReportComponent, RouteViolationComponent, DeviceFuelReportComponent, DeviceSOSreportComponent, AcReportsComponent, DailyReportComponent,CurrentPositionReportComponent,DailyDetailsComponent,
WorkingHourReportComponent,WorkingHourDetailComponent,TripReportComponent,TripLoadUnloadComponent,AlertReportComponent, DailyLogssComponent,AllMenusComponent,NotificationComponent,GeofancingReportComponent,DetailComponent,DriversPerformanceReportComponent,NotificationMastersComponent, NoReportComponent, StartComponent, SummaryDetailsComponent, NewTravelPathReportComponent, PushDataReportComponent, PerformanceReportComponent, NotiLocationComponent, HeaderComponent, ViewRawComponent] WorkingHourReportComponent,WorkingHourDetailComponent,TripReportComponent,TripLoadUnloadComponent,AlertReportComponent, DailyLogssComponent,AllMenusComponent,NotificationComponent,GeofancingReportComponent,DetailComponent,DriversPerformanceReportComponent,NotificationMastersComponent, NoReportComponent, StartComponent, SummaryDetailsComponent, NewTravelPathReportComponent, PushDataReportComponent, PerformanceReportComponent, NotiLocationComponent, HeaderComponent, ViewRawComponent]
}) })
export class ReportModule { } export class ReportModule { }

View file

@ -6,6 +6,7 @@ export class ReportService {
invokeEvent: Subject<any> = new Subject(); invokeEvent: Subject<any> = new Subject();
invokeEventForAcReport:Subject<any>=new Subject(); invokeEventForAcReport:Subject<any>=new Subject();
invokeEventForDistance:Subject<any>=new Subject(); invokeEventForDistance:Subject<any>=new Subject();
invokeEventForCurrentPosition: Subject<any> = new Subject();
invokeEventForDailyLogs:Subject<any>=new Subject(); invokeEventForDailyLogs:Subject<any>=new Subject();
invokeEventForDayWiseReport:Subject<any>=new Subject(); invokeEventForDayWiseReport:Subject<any>=new Subject();
invokeEventForgeofenceReport:Subject<any>=new Subject(); invokeEventForgeofenceReport:Subject<any>=new Subject();
@ -121,6 +122,10 @@ export class ReportService {
console.log(value); console.log(value);
this.invokeEventForDistance.next(value) this.invokeEventForDistance.next(value)
} }
currentPositionReport(value) {
console.log(value);
this.invokeEventForCurrentPosition.next(value)
}
geofenceReport(value){ geofenceReport(value){
console.log(value); console.log(value);
this.invokeEventForgeofenceReport.next(value) this.invokeEventForgeofenceReport.next(value)

View file

@ -1,303 +1,4 @@
<!-- <app-all-menus *ngIf="!token_identifier"></app-all-menus> --> <!-- <app-all-menus *ngIf="!token_identifier"></app-all-menus> -->
<button *ngIf="token_identifier" <div id="map" class="map-view" style="width: 100%; height:
style="background-color: #cc0000;color:#fdfdfd;font-size: 12px;float: right;z-index: 111;" md-raised-button>NLET 100%;">
ERP</button>
<div class="topWrapper" id="main">
<div class="mainWrapperWrapper">
<!-- <div class="row" style="background: #426E86">
<div class="col-sm-4 col-md-4 col-lg-4" style="color: white;text-align: center; padding-top: 10px;">
</div>
<div class="col-sm-4 col-md-4 col-lg-4">
<p
style="margin: 0; padding-top: 5px;text-align: center; padding-bottom: 5px; font-size: 20px; font-weight: 500;color: white; ">
{{headingName | translate}}</p>
</div>
<div id="toast">
<div id="desc">{{data_descip}}</div>
</div>
</div> -->
<div class="col-sm-4 col-md-4 col-lg-4" style="color: white;text-align: center;"> </div>
<div class="row rowStyle" style="padding-bottom: 39px;">
<div class="col-sm-12 col-md-12 col-lg-12 panel-body panel-resizable" style="padding:0px; overflow: hidden">
<div *ngIf="Load">
<div class="loading">Loading&#8230;</div>
</div>
<div *ngIf="(immobilizeChk === true)"
style="width: 350px;height: 250px;z-index: 3;position: absolute;background: white;top: 20%;left: 37%;background: white;border-radius: 12px;padding: 15px 20px;box-shadow: rgba(0, 0, 0, 0.16) 4px 2px 10px;">
<div *ngIf="showErr === false">
<div style="text-align: center; padding: 20px;color: #426e86;">
<i style="font-size: 60px; text-align: center;" class="far fa-clock"></i>
<!-- <img src={{timerGif}}> -->
</div>
<p style="text-align: center;font-size: 16px;font-weight: 600;color: #a2a2a2;">Command Triggered , Please
wait :</p>
<div style="text-align: center; padding: 10px;font-size: 16px;font-weight: 600;color: #a2a2a2;">
<span style="font-size: 40px;">{{immobilizeCount}}</span>
<span>Sec.</span>
</div>
</div>
<div *ngIf="showErr === true">
<div style="text-align: center; padding: 20px;">
<i *ngIf="errIcon=== true" style="font-size: 60px; text-align: center;color: red;"
class="far fa-times-circle"></i>
<i *ngIf="locked=== true" style="font-size: 60px; text-align: center;color: red;" class="fas fa-lock"></i>
<i *ngIf="unlocked === true" style="font-size: 60px; text-align: center;color: green;"
class="fas fa-lock-open"></i>
</div>
<p style="text-align: center;font-size: 25px;font-weight: 600;color: #a2a2a2;">{{ImmErrMsg}}</p>
</div>
</div>
<div *ngIf="showHistory === false" id="map" style="width: 100%; height: 100%;"></div>
<div *ngIf="showHistory === true" id="map2" style="width: 100%; height: 100%;"></div>
<div style=" width: 100px; top: 110px; right: -7px; position: absolute; z-index: 1;">
<input type="range" min="0" max="22" value="5" class="slider" id="myRange"
style="transform: rotate(-90deg); height: 7px; box-shadow: 0px 0px 6px 5px lightg">
<div style="display: grid; width: fit-content; float: right; padding-right: 20px; padding-top: 80px;">
<a style="float:right;margin: 0;height: 24px;color:white;padding:4px 0px 4px 0px;cursor: pointer;box-shadow: 3px 2px 5px 0px rgb(178, 176, 174);border-bottom: 1px solid;text-align: center;width:38px;"
[ngStyle]="{'background' : (mapTypeId=='roadmap') ? '#86ac41c7;' : '#989898'}"
class="pointer animateClass_10" (click)="setMapType('roadmap')">
<!-- <span id="d"> -->
<!-- <i class="material-icons" mdTooltip="Selected" style="float:right;font-size: 11px;color:green;padding-right: 10px;">fiber_manual_record</i> -->
<i class="material-icons" style="font-size: 16px;padding: 0px 8px 0px 8px;" mdTooltip="Google Street">
streetview </i>
<!-- </span> -->
</a>
<a style="text-align: center;width:38px;float:right;margin: 0;height: 24px;color:white;padding:4px 0px 4px 0px;cursor: pointer;box-shadow: 3px 2px 5px 0px rgb(178, 176, 174);border-bottom: 1px solid"
[ngStyle]="{'background' : (mapTypeId=='terrain') ? '#86ac41c7;' : '#989898'}"
class="pointer animateClass_10" (click)="setMapType('terrain')">
<!-- <span id="d"> -->
<!-- <i class="material-icons" mdTooltip="Selected" *ngIf="mapTypeId=='terrain'" style="float:right;font-size: 11px;color:green;padding-right: 10px;">fiber_manual_record</i> -->
<i class="material-icons" style="font-size: 16px;padding: 0px 8px 0px 8px" mdTooltip="Google Physical">
terrain </i>
<!-- </span> -->
</a>
<a style="text-align: center;width:38px;float:right;margin: 0;height: 24px;color:white;padding:4px 0px 4px 0px;cursor: pointer;box-shadow: 3px 2px 5px 0px rgb(178, 176, 174);border-bottom: 1px solid"
[ngStyle]="{'background' : (mapTypeId=='satellite') ? '#86ac41c7;' : '#989898'}"
class="pointer animateClass_10" (click)="setMapType('satellite')">
<span id="e">
<!-- <i class="material-icons" mdTooltip="Selected" *ngIf="mapTypeId=='satellite'" style="float:right;font-size: 11px;color:green;padding-right: 10px;">fiber_manual_record</i> -->
<i class="material-icons" style="font-size: 16px;padding: 0px 8px 0px 8px;"
mdTooltip="Google Satellite"> satellite </i>
</span>
</a>
<a style="text-align: center;width:38px;float:right;cursor: pointer;color:white;margin: 0;height: 28px;padding:4px 0px 8px 0px;box-shadow: 3px 2px 5px 0px rgb(178, 176, 174);border-bottom: 1px solid"
[ngStyle]="{'background' : (mapTypeId=='hybrid') ? '#86ac41c7;' : '#989898'}"
class="pointer animateClass_10" (click)="setMapType('hybrid')">
<span id="f">
<!-- <i class="material-icons" mdTooltip="Selected" *ngIf="mapTypeId=='hybrid'" style="float:right;font-size: 11px;color:green;padding-right: 10px;">fiber_manual_record</i> -->
<i class="material-icons" style="font-size: 16px;padding: 0px 8px 0px 8px;" mdTooltip="Google Hybrid">
layers </i>
</span>
</a>
<a style="text-align: center;width:38px;float:right;cursor: pointer;color:white;margin: 0;height: 28px;padding:4px 0px 8px 0px;box-shadow: 3px 2px 5px 0px rgb(178, 176, 174);border-bottom: 1px solid"
[ngStyle]="{'background' : (mapTypeId=='darkmode') ? '#86ac41c7;' : '#989898'}"
class="pointer animateClass_10" (click)="setMapType('darkmode')">
<span id="k">
<!-- <i class="material-icons" mdTooltip="Selected" *ngIf="mapTypeId=='hybrid'" style="float:right;font-size: 11px;color:green;padding-right: 10px;">fiber_manual_record</i> -->
<i class="material-icons" style="font-size: 16px;padding: 0px 8px 0px 8px;" mdTooltip="Night Mode">
nights_stay </i>
</span>
</a>
<a style="text-align: center;width:38px;float:right;margin: 0;height: 24px;color:white;padding:4px 0px 4px 0px;cursor: pointer;box-shadow: 3px 2px 5px 0px rgb(178, 176, 174);border-bottom: 1px solid"
[ngStyle]="{'background' : (isTraffic==true) ? '#86ac41c7;' : '#989898'}" class="pointer animateClass_10"
(click)="setMapType('traffic')">
<span id="g">
<!-- <i class="material-icons" mdTooltip="Google Hybrid" *ngIf="isTraffic" style="float:right;font-size: 14px;color:green;padding-right: 10px;">done</i> -->
<i class="material-icons" style="font-size: 16px;padding: 0px 8px 0px 8px;" mdTooltip="Google Traffic">
traffic </i>
</span>
</a>
</div>
</div>
</div>
</div>
<!-- <div class="row" style="padding: 0px;margin: 0px;">
<div class="col-sm-12 col-md-12 col-lg-12" style="padding: 0;margin: 0;">
<div class="row">
<div class="col-sm-6 col-md-6 col-lg-6">
<div>
<i class="fas fa-expand" title="Hide work area" (click)="showHideWorkArea()"></i>
</div>
</div>
<div class="col-sm-6 col-md-6 col-lg-6">
<div>
<i class="fas fa-book-open"></i>
</div>
<div>
<p>{{currentTime}}</p>
</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
<!-- <div *ngIf="false"> -->
<table id="headerTable" style="border: 1px solid black;width: 100%;
border-collapse: collapse;">
<tr style="text-align:center">
<div style="text-align:center">Table</div>
</tr>
<tr style="height:30px;border-top:1px solid black">
<td>
<span style="font-weight: 700;">Name</span>: {{deviceNameForPDF}}
</td>
<td>
<!-- <image style="width: 50px;height: 50px;" src="image"></image> -->
</td>
</tr>
<tr>
<td>
<span style="font-weight: 700;">Start Time</span>: {{startTime}}
</td>
<td>
<span style="font-weight: 700;">End Time</span>: {{endTime}}
</td>
</tr>
<tr style="height:30px;border-top:1px solid black">
<td>
<span style="font-weight: 700;"> Start Address</span>: {{startAddress}}
</td>
<td>
<span style="font-weight: 700;">End Address</span>: {{endAddress}}
</td>
</tr>
</table>
<div class="w3-sidebar w3-bar-block w3-animate-right"
style="display:none;right:0;width: 290px;top: 60px;background: transparent;" id="rightMenu">
<button (click)="closeRightMenu()" class="w3-bar-item w3-button w3-large">Close &times;</button>
<div class="card m-2" style="border: 1px solid #dadada;
box-shadow: 4px 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.2s;
background:
url('../../assets/images/liveTrackIcons/location(background).jpg') top/100% auto no-repeat;
background-repeat:no-repeat;">
<!-- <div class="card-header">
<h4>Location</h4>
</div> -->
<div class="card-body" style="font-family: initial;">
<h6> {{liveAdd}}</h6>
<span>Latitude:{{socketData?socketData.latDecimal:''}}</span>
<span>Longitude:{{socketData?socketData.longDecimal:''}}</span>
</div>
</div>
<div class="card m-2" style="border: 1px solid #dadada;box-shadow: 4px 4px 8px 0 rgba(0, 0, 0, 0.2);transition: 0.2s;color: black;
background: linear-gradient(45deg, #f44336, transparent);">
<!-- <div class="card-header">
<h4>Speed</h4>
</div> -->
<div class="card-body" style="font-family: initial;">
<h6><i class="fas fa-tachometer-alt"></i> {{socketData?socketData.speed:''}} km/hr</h6>
</div>
</div>
<div class="card m-2">
<!-- <div class="card-header">
<h3>IMEI</h3>
</div> -->
<div class="card-body">
<h5>
IMEI
</h5>
<h6>{{socketData?socketData.imei:''}}</h6>
</div>
</div>
<div class="card m-2">
<div class="card-body">
<div class="row">
<!-- <div class="col-md-6"> -->
<span style="white-space: nowrap;"> {{'Date' | translate}}: {{socketData?socketData.date:'' |
date:'medium'}}</span>
<span> {{'Command' | translate}}: {{socketData?socketData.command?socketData.command:'NA':'NA'}}</span>
<span>{{'Ignition' | translate}} : {{socketData?socketData.ignition==1?'ON':'OFF':'NA'}}</span>
<!-- </div> -->
<!-- <div class="col-md-6"> -->
<span> {{'Satellites' | translate}}: {{socketData?socketData.satellites:'NA'}}</span>
<span>{{'GPS Positioned' | translate}} : {{socketData?socketData['GPS positioned']==1?'Fixed':socketData['GPS
positioned']==0?'Not Fixed':'NA':'NA'}}</span>
<span>{{'Port' | translate}} : {{socketData?socketData.port:'NA'}}</span>
<!-- </div> -->
</div>
</div>
</div>
<!-- <div class="card m-2">
<div class="card-header">
<h3>hjdsh</h3>
</div>
<div class="card-body">
<h4>a,sjnaksnasjnl</h4>
</div>
</div>
<div class="card m-2">
<div class="card-header">
<h3>hjdsh</h3>
</div>
<div class="card-body">
<h4>a,sjnaksnasjnl</h4>
</div>
</div>
<div class="card m-2">
<div class="card-header">
<h3>hjdsh</h3>
</div>
<div class="card-body">
<h4>a,sjnaksnasjnl</h4>
</div>
</div>
<div class="card m-2">
<div class="card-header">
<h3>hjdsh</h3>
</div>
<div class="card-body">
<h4>a,sjnaksnasjnl</h4>
</div>
</div>
<div class="card m-2">
<div class="card-header">
<h3>hjdsh</h3>
</div>
<div class="card-body">
<h4>a,sjnaksnasjnl</h4>
</div>
</div> -->
</div> </div>

View file

@ -823,3 +823,9 @@ tbody tr:nth-child(even) {
// color:white; // color:white;
// } // }
} }
.map-view{
width: 100%;
height: 100vh !important;
position: unset !important;
overflow: hidden;
}

View file

@ -582,7 +582,9 @@ export class ShowVehiclesComponent implements OnInit {
if (a == undefined) { if (a == undefined) {
} }
else { else {
if (this.socket) {
this.socket.removeAllListeners(a.deviceId); this.socket.removeAllListeners(a.deviceId);
}
//this.socket_Geo.removeAllListeners(a.did); //this.socket_Geo.removeAllListeners(a.did);
} }
@ -869,8 +871,10 @@ export class ShowVehiclesComponent implements OnInit {
// return; // return;
// } // }
for (var e = 0; e < this.deviceToTrack.length; e++) { for (var e = 0; e < this.deviceToTrack.length; e++) {
if (this.socket) {
this.socket.removeAllListeners(this.deviceToTrack[e]) this.socket.removeAllListeners(this.deviceToTrack[e])
} }
}
this.deviceToTrack = []; this.deviceToTrack = [];
@ -1138,8 +1142,13 @@ export class ShowVehiclesComponent implements OnInit {
for (var x = 0; x < this.deviceToTrack.length; x++) { for (var x = 0; x < this.deviceToTrack.length; x++) {
var newChannel = this.deviceToTrack[x].toString(); var newChannel = this.deviceToTrack[x].toString();
var date = new Date().setHours(0, 0, 0, 0) var date = new Date().setHours(0, 0, 0, 0)
if (this.socket) {
this.socket.on(newChannel, channelListener(newChannel)); this.socket.on(newChannel, channelListener(newChannel));
this.socket.emit('initLive', newChannel, date); this.socket.emit('initLive', newChannel, date);
} else {
channelListener(newChannel)
}
} }
var r var r
@ -3447,7 +3456,7 @@ zoomSet(){
center: latlng, center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP mapTypeId: google.maps.MapTypeId.ROADMAP
}; };
map = new google.maps.Map(document.getElementById("map2"), myOptions); map = new google.maps.Map(document.getElementById("map"), myOptions);
marker = new google.maps.Marker({ marker = new google.maps.Marker({
position: latlng, position: latlng,
@ -4641,7 +4650,7 @@ zoomSet(){
mapTypeId: google.maps.MapTypeId.ROADMAP mapTypeId: google.maps.MapTypeId.ROADMAP
}; };
map = new google.maps.Map(document.getElementById('map2'), myOptions); map = new google.maps.Map(document.getElementById('map'), myOptions);
console.log('mapmapmapmapmapmapmapmapmapmapmapmapmapmap',map); console.log('mapmapmapmapmapmapmapmapmapmapmapmapmapmap',map);
outerThis.historyMap = map; outerThis.historyMap = map;
var trafficLayer = new google.maps.TrafficLayer(); var trafficLayer = new google.maps.TrafficLayer();
@ -4795,6 +4804,7 @@ zoomSet(){
initMap(GeoFencCoords); initMap(GeoFencCoords);
let outerThis = this; let outerThis = this;
function initMap(GeoFencCoords) { function initMap(GeoFencCoords) {
map = new google.maps.Map(document.getElementById('map'), { map = new google.maps.Map(document.getElementById('map'), {
zoom: 17, zoom: 17,
center: { lat: GeoFencCoords[0].lat, lng: GeoFencCoords[0].lng }, center: { lat: GeoFencCoords[0].lat, lng: GeoFencCoords[0].lng },
@ -5011,7 +5021,7 @@ var seconds = num % 60;
}, },
mapTypeId: google.maps.MapTypeId.ROADMAP mapTypeId: google.maps.MapTypeId.ROADMAP
}; };
var mapHistory = new google.maps.Map(document.getElementById("map2"), myOptions); var mapHistory = new google.maps.Map(document.getElementById("map"), myOptions);
var marker = new google.maps.Marker({ var marker = new google.maps.Marker({
center: { center: {
@ -5204,12 +5214,27 @@ var seconds = num % 60;
ngOnInit() { ngOnInit() {
const myOptions = {
zoom: 12,
center: new google.maps.LatLng(18.602941, 73.777147),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
let map = new google.maps.Map(document.getElementById('map'), myOptions);
console.log('mapmapmapmapmapmapmapmapmapmapmapmapmapmap', map);
this.historyMap = map;
window["angularComponentRef"] = { component: this, zone: this._ngZone }; window["angularComponentRef"] = { component: this, zone: this._ngZone };
this.socket = this.injectData.getSocket_gps(); this.socket = this.injectData.getSocket_gps();
if (this.socket) {
this.socket.on('connect', function (this) { }); this.socket.on('connect', function (this) { });
}
this.socket_Notify = this.injectData.getSocket_notifIO(); this.socket_Notify = this.injectData.getSocket_notifIO();
if (this.socket_Notify){
this.socket_Notify.on('connect', function(this){ }); this.socket_Notify.on('connect', function(this){ });
}
this.bsConfig = Object.assign({dateInputFormat: 'DD-MM-YYYY, h:mm:ss a'}, { containerClass: this.colorTheme }); this.bsConfig = Object.assign({dateInputFormat: 'DD-MM-YYYY, h:mm:ss a'}, { containerClass: this.colorTheme });
//console.log('this.bsConfig',this.bsConfig); //console.log('this.bsConfig',this.bsConfig);
@ -5424,7 +5449,10 @@ var seconds = num % 60;
// className:any; // className:any;
ngOnDestroy() { ngOnDestroy() {
for (var e = 0; e < this.deviceToTrack.length; e++) { for (var e = 0; e < this.deviceToTrack.length; e++) {
if (this.socket){
this.socket.removeAllListeners(this.deviceToTrack[e]) this.socket.removeAllListeners(this.deviceToTrack[e])
}
localStorage.removeItem('mapLoad_ID'); localStorage.removeItem('mapLoad_ID');
localStorage.removeItem('mapLoad_Name'); localStorage.removeItem('mapLoad_Name');
@ -5567,6 +5595,7 @@ var seconds = num % 60;
} }
} }
}, err => { }, err => {
// this.Load = false; // this.Load = false;
// //console.log(err); // //console.log(err);
@ -6433,8 +6462,13 @@ var seconds = num % 60;
lastcall: boolean = true; lastcall: boolean = true;
devReady:boolean=true; devReady:boolean=true;
groups=[] groups=[]
markerListArray = [];
getDeviceBYfilter(i,iden) { getDeviceBYfilter(i,iden) {
//console.log('iden=>',iden); //console.log('iden=>',iden);
this.markerListArray.forEach((i)=>{
i.setMap(null)
})
this.markerListArray = [];
this.currStatus = i; this.currStatus = i;
if (i == 6) { if (i == 6) {
this.skip = 0; this.skip = 0;
@ -6507,10 +6541,11 @@ var seconds = num % 60;
{ {
this.showSocketData=false this.showSocketData=false
} }
this.livetrack(null); //this.livetrack(null);
} }
} }
} }
@ -6525,16 +6560,57 @@ var seconds = num % 60;
console.log("DRIVER NAME",this.DriverName,this.deviceList[0].ac); console.log("DRIVER NAME",this.DriverName,this.deviceList[0].ac);
this.ac=this.deviceList[0].ac?this.deviceList[0].ac:'NA' this.ac=this.deviceList[0].ac?this.deviceList[0].ac:'NA'
this.DriverNumber=this.deviceList[0].contact_number this.DriverNumber=this.deviceList[0].contact_number
this.historyMap.setCenter({ lat: this.deviceList[0].last_location.lat, lng: this.deviceList[0].last_location.long });
//this.historyMap.setZoom(12);
}
//this.selectAllVehicles({checked:true})
this.deviceList.forEach((device)=>{
this.markerListArray.push(new google.maps.Marker({
position: new google.maps.LatLng(device.last_location && device.last_location.lat ? device.last_location.lat : 0, device.last_location && device.last_location.long ? device.last_location.long : 0),
map: this.historyMap,
label: {
text: device.Device_Name,
fontSize: '12px',
background:'#fff',
color:'black',
className: 'marker-label',
labelStyle:{
'background-color': 'white',
'color': 'black',
'text-align': 'center',
width: '100px',
border: 0,
}},
icon: {
url: this.iconCheck(device.status, device.iconType),
scaledSize: new google.maps.Size(30, 70),
} }
this.selectAllVehicles({checked:true})
}))
})
this.zoomeExtends(this.markerListArray);
console.log('this.deviceList',this.deviceList,'GROUP===',this.groups); console.log('this.deviceList',this.deviceList,'GROUP===',this.groups);
}) })
} }
isSetBound = true;
zoomeExtends(markers) {
if (this.isSetBound) {
this.isSetBound = false;
var bounds = new google.maps.LatLngBounds();
if (markers.length > 0) {
for (var i = 0; i < markers.length; i++) {
bounds.extend(markers[i].getPosition());
}
this.historyMap.fitBounds(bounds);
}
}
}
getDevicebyIdComingFromDashboard() { getDevicebyIdComingFromDashboard() {
this.buindhistoryDevice = []; this.buindhistoryDevice = [];
var DeviceObj = JSON.parse(localStorage.getItem('devDetail')); var DeviceObj = JSON.parse(localStorage.getItem('devDetail'));
@ -6553,6 +6629,10 @@ var seconds = num % 60;
}) })
} else { } else {
this.getDeviceBYfilter('', ''); this.getDeviceBYfilter('', '');
setInterval(() => {
this.getDeviceBYfilter('','');
}, 300000);
} }
} }
@ -6658,7 +6738,7 @@ var seconds = num % 60;
}, },
mapTypeId: google.maps.MapTypeId.ROADMAP mapTypeId: google.maps.MapTypeId.ROADMAP
}; };
var mapHistory = new google.maps.Map(document.getElementById("map2"), myOptions); var mapHistory = new google.maps.Map(document.getElementById("map"), myOptions);
var marker = new google.maps.Marker({ var marker = new google.maps.Marker({
center: { center: {
@ -6722,7 +6802,7 @@ var seconds = num % 60;
}, },
mapTypeId: google.maps.MapTypeId.ROADMAP mapTypeId: google.maps.MapTypeId.ROADMAP
}; };
var mapHistory = new google.maps.Map(document.getElementById("map2"), myOptions); var mapHistory = new google.maps.Map(document.getElementById("map"), myOptions);
var marker = new google.maps.Marker({ var marker = new google.maps.Marker({
center: { center: {
@ -7902,7 +7982,7 @@ getNearByVehicles(devData){
// // console.log(zzz[0].lat) // // console.log(zzz[0].lat)
// initMap(GeoFencCoords); // initMap(GeoFencCoords);
// function initMap(GeoFencCoords) { // function initMap(GeoFencCoords) {
// map = new google.maps.Map(document.getElementById('map2'), { // map = new google.maps.Map(document.getElementById('map'), {
// zoom: 17, // zoom: 17,
// center: {lat: GeoFencCoords[0].lat, lng: GeoFencCoords[0].lng}, // center: {lat: GeoFencCoords[0].lat, lng: GeoFencCoords[0].lng},
// mapTypeId: 'terrain' // mapTypeId: 'terrain'
@ -8033,7 +8113,7 @@ image
console.log(this.tempMapHistory,this.startAddress,this.endAddress, this.image); console.log(this.tempMapHistory,this.startAddress,this.endAddress, this.image);
var element = $('#map2'); var element = $('#map');
var pdfOptions = { var pdfOptions = {
orientation: "landscape", // One of "portrait" or "landscape" (or shortcuts "p" (Default), "l") orientation: "landscape", // One of "portrait" or "landscape" (or shortcuts "p" (Default), "l")
unit: "mm", //Measurement unit to be used when coordinates are specified. One of "pt" (points), "mm" (Default), "cm", "in" unit: "mm", //Measurement unit to be used when coordinates are specified. One of "pt" (points), "mm" (Default), "cm", "in"

View file

@ -210,12 +210,12 @@ refresh()
this.mb = ' ' this.mb = ' '
} }
this.socket_Ing = this.injectData.getSocket_gps(); // this.socket_Ing = this.injectData.getSocket_gps();
//io.connect('https://www.oneqlik.in/gps', { secure: true, rejectUnauthorized: false, transports: ["polling"], upgrade: false }); // //io.connect('https://www.oneqlik.in/gps', { secure: true, rejectUnauthorized: false, transports: ["polling"], upgrade: false });
this.socket_Ing.on('connect', function(this){ // this.socket_Ing.on('connect', function(this){
}); // });
// this.Load = true; // this.Load = true;
// var secretKey = 'adnateIOTtrackeR'; // var secretKey = 'adnateIOTtrackeR';
@ -408,7 +408,7 @@ Ing_Status(){
for(var y=0; y<this.final.length; y++){ for(var y=0; y<this.final.length; y++){
// this.socket_Ing.emit('acc',this.final[y].Device_ID ) // this.socket_Ing.emit('acc',this.final[y].Device_ID )
this.socket_Ing.on(this.final[y].Device_ID+'acc', this.accListener(y,this.final[y])) // this.socket_Ing.on(this.final[y].Device_ID+'acc', this.accListener(y,this.final[y]))
// this.socket_Ing.on(this.final[y].Device_ID+'acc',function(d1,d2,d3,d4,d5){ // this.socket_Ing.on(this.final[y].Device_ID+'acc',function(d1,d2,d3,d4,d5){
// console.log("d1,d2,d3,d4,d5",d1,d2,d3,d4,d5); // console.log("d1,d2,d3,d4,d5",d1,d2,d3,d4,d5);
// }); // });
@ -470,13 +470,13 @@ getrequest(para){
this.supAdm = this.useridd; this.supAdm = this.useridd;
} }
let socket_Ing = this.injectData.getSocket_gps(); // let socket_Ing = this.injectData.getSocket_gps();
io.connect('https://www.oneqlik.in/gps', { secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false }); // io.connect('https://www.oneqlik.in/gps', { secure: true, rejectUnauthorized: false, transports: ["websocket", "polling"], upgrade: false });
socket_Ing.on('connect', function(this){ // socket_Ing.on('connect', function(this){
}); // });
// this.injectData.getGroupData(this.emailid,this.useridd).subscribe(resp=>{ // this.injectData.getGroupData(this.emailid,this.useridd).subscribe(resp=>{
@ -505,12 +505,12 @@ getrequest(para){
// }); // });
} }
ngOnDestroy() { ngOnDestroy() {
for (var e = 0; e < this.ing_Arr.length; e++){ // for (var e = 0; e < this.ing_Arr.length; e++){
// console.log(this.ing_Arr[e]) // // console.log(this.ing_Arr[e])
this.socket_Ing.removeAllListeners(this.ing_Arr[e]) // this.socket_Ing.removeAllListeners(this.ing_Arr[e])
} // }
this.socket_Ing.removeAllListeners() // this.socket_Ing.removeAllListeners()
} }
showd(d){ showd(d){

View file

@ -5,12 +5,12 @@
export const environment = { export const environment = {
production: false, production: false,
hostUrl: "http://localhost:3000", // hostUrl: "http://localhost:3000",
hostUrl2: "http://localhost:3000", // hostUrl2: "http://localhost:3000",
// hostUrl: "https://socket.oneqlik.in", // hostUrl: "https://socket.oneqlik.in",
// hostUrl2: "https://socket.oneqlik.in", // hostUrl2: "https://socket.oneqlik.in",
// hostUrl: "https://www.oneqlik.in", hostUrl: "https://www.oneqlik.in",
// hostUrl2: "https://www.oneqlik.in", hostUrl2: "https://www.oneqlik.in",
socket5000: "", socket5000: "",
showLandingpageMenu: ["www.drsupergps.com", "www.vpngps.tech", "www.globaltechnohelp.com", "www.tracktive.in", "www.sohamshakti.in", "www.spygpstrack.com", "www.mtelematics.in", "www.dstrackingsolutions.com", "www.vctrack.in", "www.hltgps.in", "www.xcelgps.com"] showLandingpageMenu: ["www.drsupergps.com", "www.vpngps.tech", "www.globaltechnohelp.com", "www.tracktive.in", "www.sohamshakti.in", "www.spygpstrack.com", "www.mtelematics.in", "www.dstrackingsolutions.com", "www.vctrack.in", "www.hltgps.in", "www.xcelgps.com"]

View file

@ -286,7 +286,7 @@
<script src="https://www.gstatic.com/charts/loader.js"></script> <script src="https://www.gstatic.com/charts/loader.js"></script>
<!-- AIzaSyCNT3eO1wPQHUhY_cmQ9N_9BkLzJ_GB9j8 --> <!-- AIzaSyCNT3eO1wPQHUhY_cmQ9N_9BkLzJ_GB9j8 -->
<!-- old key AIzaSyDZKxpYMfGSyStS3fLuVqHuM6ZEJWtF1-k --> <!-- old key AIzaSyDZKxpYMfGSyStS3fLuVqHuM6ZEJWtF1-k -->
<script id= "mapApi" src="https://maps.google.com/maps/api/js?libraries=geometry,places,drawing&key=AIzaSyDNmQ3sok_q3O9JZ66cFJgzFfiJiDWESmY"></script> <script id= "mapApi" src="https://maps.google.com/maps/api/js?libraries=geometry,places,drawing&key=AIzaSyCYRS0MutZAJa2OztMvaYwBoaMG-fx3zaw"></script>
<!-- AIzaSyA_ycttLXPMfCSSNAfPOsaENPQ85i17lPU latest key used on 2 november --> <!-- AIzaSyA_ycttLXPMfCSSNAfPOsaENPQ85i17lPU latest key used on 2 november -->
<!-- AIzaSyCmSXnoBBGekErvqBvu5N7dbeqdH1pHp7c --> <!-- AIzaSyCmSXnoBBGekErvqBvu5N7dbeqdH1pHp7c -->
<!-- AIzaSyDllmSphAf92Mk69v46HFCiClWibYehkiU --> <!-- AIzaSyDllmSphAf92Mk69v46HFCiClWibYehkiU -->

View file

@ -41,3 +41,16 @@ md-toolbar-row {
.mat-tab-body.mat-tab-body-active { .mat-tab-body.mat-tab-body-active {
overflow-y: hidden !important; overflow-y: hidden !important;
} }
.mp-datepicker .owl-dateTime-dialog {
width: 13em !important;
}
.marker-label {
background-color: white;
color: black;
text-align: center;
width: auto;
padding: 2px;
border: 0;
border-radius: 18%;
margin-top: -43px;
}