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,46 +1,46 @@
// #body{ // #body{
// overflow-x: hidden; // overflow-x: hidden;
// overflow-y: hidden; // overflow-y: hidden;
// } // }
#myInput { #myInput {
border-radius: 15px; border-radius: 15px;
/* border: 2px solid #18262F; */ /* border: 2px solid #18262F; */
padding: 7px; padding: 7px;
width: 116px; width: 116px;
height: 17px; height: 17px;
font-size: 9px; font-size: 9px;
outline: none; outline: none;
float: right; float: right;
margin-top: 2%; margin-top: 2%;
} }
.headStyle { .headStyle {
text-align: center; text-align: center;
font-size: 22px; font-size: 22px;
font-weight: 500; font-weight: 500;
color: #6b6a6a; color: #6b6a6a;
padding-top: 7px; padding-top: 7px;
margin: 0px; margin: 0px;
} }
.sidebar { .sidebar {
height: 84vh; height: 84vh;
width: 24%; width: 24%;
text-align: left; text-align: left;
background: white; background: white;
box-shadow: 3px 1px 5px 0px #b2b0ae; box-shadow: 3px 1px 5px 0px #b2b0ae;
position: fixed; position: fixed;
padding: 10px; padding: 10px;
} }
.main { .main {
box-shadow: 3px 1px 5px 0px #b2b0ae; box-shadow: 3px 1px 5px 0px #b2b0ae;
padding: 10px; padding: 10px;
background: white; background: white;
// margin-left: 5px; // margin-left: 5px;
} }
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }

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">
@ -283,19 +123,25 @@
</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)"> <td class="cell100 column1" (click)="viewCustomerDetails(cust_array)">
{{ cust_array.first_name ? cust_array.first_name : "" }} {{ cust_array.first_name ? cust_array.first_name : "" }}
{{ cust_array.last_name ? cust_array.last_name : "" }} {{ cust_array.last_name ? cust_array.last_name : "" }}
</td> </td>
</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>
<tr class="row100 head"> <tr class="row100 head">
<th
class="cell100 column2"
style="font-weight: 600; background: #add8e6"
>
{{ "NAME" | translate }}
</th>
<th <th
class="cell100 column2" class="cell100 column2"
style="font-weight: 600; background: #add8e6" style="font-weight: 600; background: #add8e6"
@ -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 </tr>
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>
</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

@ -1,36 +1,36 @@
.title { .title {
font-weight: 600; font-weight: 600;
margin-top: 20px; margin-top: 20px;
font-size: 24px; font-size: 24px;
} }
.customBtn { .customBtn {
border-radius: 0px; border-radius: 0px;
padding: 10px; padding: 10px;
} }
// form input { // form input {
// display: inline-block; // display: inline-block;
// width: 50px; // width: 50px;
// height: 50px; // height: 50px;
// text-align: center; // text-align: center;
// } // }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 250px; max-width: 250px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }

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

@ -1,307 +1,307 @@
button, button,
input { input {
font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
} }
a { a {
color: #f96332; color: #f96332;
} }
a:hover, a:hover,
a:focus { a:focus {
color: #f96332; color: #f96332;
} }
p { p {
line-height: 1.61em; line-height: 1.61em;
font-weight: 300; font-weight: 300;
font-size: 1.2em; font-size: 1.2em;
} }
.category { .category {
text-transform: capitalize; text-transform: capitalize;
font-weight: 700; font-weight: 700;
color: #9a9a9a; color: #9a9a9a;
} }
body { body {
color: #2c2c2c; color: #2c2c2c;
font-size: 14px; font-size: 14px;
font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
overflow-x: hidden; overflow-x: hidden;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
.nav-item .nav-link, .nav-item .nav-link,
.nav-tabs .nav-link { .nav-tabs .nav-link {
-webkit-transition: all 300ms ease 0s; -webkit-transition: all 300ms ease 0s;
-moz-transition: all 300ms ease 0s; -moz-transition: all 300ms ease 0s;
-o-transition: all 300ms ease 0s; -o-transition: all 300ms ease 0s;
-ms-transition: all 300ms ease 0s; -ms-transition: all 300ms ease 0s;
transition: all 300ms ease 0s; transition: all 300ms ease 0s;
} }
.card a { .card a {
-webkit-transition: all 150ms ease 0s; -webkit-transition: all 150ms ease 0s;
-moz-transition: all 150ms ease 0s; -moz-transition: all 150ms ease 0s;
-o-transition: all 150ms ease 0s; -o-transition: all 150ms ease 0s;
-ms-transition: all 150ms ease 0s; -ms-transition: all 150ms ease 0s;
transition: all 150ms ease 0s; transition: all 150ms ease 0s;
} }
[data-toggle="collapse"][data-parent="#accordion"] i { [data-toggle="collapse"][data-parent="#accordion"] i {
-webkit-transition: transform 150ms ease 0s; -webkit-transition: transform 150ms ease 0s;
-moz-transition: transform 150ms ease 0s; -moz-transition: transform 150ms ease 0s;
-o-transition: transform 150ms ease 0s; -o-transition: transform 150ms ease 0s;
-ms-transition: all 150ms ease 0s; -ms-transition: all 150ms ease 0s;
transition: transform 150ms ease 0s; transition: transform 150ms ease 0s;
} }
[data-toggle="collapse"][data-parent="#accordion"][aria-expanded="true"] i { [data-toggle="collapse"][data-parent="#accordion"][aria-expanded="true"] i {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform: rotate(180deg); -webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg); -ms-transform: rotate(180deg);
transform: rotate(180deg); transform: rotate(180deg);
} }
.now-ui-icons { .now-ui-icons {
display: inline-block; display: inline-block;
font: normal normal normal 14px/1 "Nucleo Outline"; font: normal normal normal 14px/1 "Nucleo Outline";
font-size: inherit; font-size: inherit;
// speak: none; // speak: none;
text-transform: none; text-transform: none;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
@-webkit-keyframes nc-icon-spin { @-webkit-keyframes nc-icon-spin {
0% { 0% {
-webkit-transform: rotate(0deg); -webkit-transform: rotate(0deg);
} }
100% { 100% {
-webkit-transform: rotate(360deg); -webkit-transform: rotate(360deg);
} }
} }
@-moz-keyframes nc-icon-spin { @-moz-keyframes nc-icon-spin {
0% { 0% {
-moz-transform: rotate(0deg); -moz-transform: rotate(0deg);
} }
100% { 100% {
-moz-transform: rotate(360deg); -moz-transform: rotate(360deg);
} }
} }
@keyframes nc-icon-spin { @keyframes nc-icon-spin {
0% { 0% {
-webkit-transform: rotate(0deg); -webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg); -moz-transform: rotate(0deg);
-ms-transform: rotate(0deg); -ms-transform: rotate(0deg);
-o-transform: rotate(0deg); -o-transform: rotate(0deg);
transform: rotate(0deg); transform: rotate(0deg);
} }
100% { 100% {
-webkit-transform: rotate(360deg); -webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg); -moz-transform: rotate(360deg);
-ms-transform: rotate(360deg); -ms-transform: rotate(360deg);
-o-transform: rotate(360deg); -o-transform: rotate(360deg);
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.now-ui-icons.objects_umbrella-13:before { .now-ui-icons.objects_umbrella-13:before {
content: "\ea5f"; content: "\ea5f";
} }
.now-ui-icons.shopping_cart-simple:before { .now-ui-icons.shopping_cart-simple:before {
content: "\ea1d"; content: "\ea1d";
} }
.now-ui-icons.shopping_shop:before { .now-ui-icons.shopping_shop:before {
content: "\ea50"; content: "\ea50";
} }
.now-ui-icons.ui-2_settings-90:before { .now-ui-icons.ui-2_settings-90:before {
content: "\ea4b"; content: "\ea4b";
} }
.nav-tabs { .nav-tabs {
border: 0; border: 0;
padding: 15px 0.7rem; padding: 15px 0.7rem;
} }
.nav-tabs:not(.nav-tabs-neutral) > .nav-item > .nav-link.active { .nav-tabs:not(.nav-tabs-neutral) > .nav-item > .nav-link.active {
box-shadow: 0px 5px 35px 0px rgba(0, 0, 0, 0.3); box-shadow: 0px 5px 35px 0px rgba(0, 0, 0, 0.3);
} }
.card .nav-tabs { .card .nav-tabs {
border-top-right-radius: 0.1875rem; border-top-right-radius: 0.1875rem;
border-top-left-radius: 0.1875rem; border-top-left-radius: 0.1875rem;
} }
.nav-tabs > .nav-item > .nav-link { .nav-tabs > .nav-item > .nav-link {
color: #888888; color: #888888;
margin: 0; margin: 0;
margin-right: 5px; margin-right: 5px;
background-color: transparent; background-color: transparent;
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 30px; border-radius: 30px;
font-size: 14px; font-size: 14px;
padding: 11px 23px; padding: 11px 23px;
line-height: 1.5; line-height: 1.5;
} }
.nav-tabs > .nav-item > .nav-link:hover { .nav-tabs > .nav-item > .nav-link:hover {
background-color: transparent; background-color: transparent;
} }
.nav-tabs > .nav-item > .nav-link.active { .nav-tabs > .nav-item > .nav-link.active {
background-color: #444; background-color: #444;
border-radius: 30px; border-radius: 30px;
color: #ffffff; color: #ffffff;
} }
.nav-tabs > .nav-item > .nav-link i.now-ui-icons { .nav-tabs > .nav-item > .nav-link i.now-ui-icons {
font-size: 14px; font-size: 14px;
position: relative; position: relative;
top: 1px; top: 1px;
margin-right: 3px; margin-right: 3px;
} }
.nav-tabs.nav-tabs-neutral > .nav-item > .nav-link { .nav-tabs.nav-tabs-neutral > .nav-item > .nav-link {
color: #ffffff; color: #ffffff;
} }
.nav-tabs.nav-tabs-neutral > .nav-item > .nav-link.active { .nav-tabs.nav-tabs-neutral > .nav-item > .nav-link.active {
background-color: rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.2);
color: #ffffff; color: #ffffff;
} }
.card { .card {
border: 0; border: 0;
border-radius: 0.1875rem; border-radius: 0.1875rem;
display: inline-block; display: inline-block;
position: relative; position: relative;
width: 100%; width: 100%;
// margin-bottom: 30px; // margin-bottom: 30px;
// box-shadow: 0px 5px 25px 0px rgba(0, 0, 0, 0.2); // box-shadow: 0px 5px 25px 0px rgba(0, 0, 0, 0.2);
} }
.card .card-header { .card .card-header {
background-color: transparent; background-color: transparent;
border-bottom: 0; border-bottom: 0;
background-color: transparent; background-color: transparent;
border-radius: 0; border-radius: 0;
padding: 0; padding: 0;
} }
.card[data-background-color="orange"] { .card[data-background-color="orange"] {
background-color: #2d4262; background-color: #2d4262;
} }
.card[data-background-color="red"] { .card[data-background-color="red"] {
background-color: #ff3636; background-color: #ff3636;
} }
.card[data-background-color="yellow"] { .card[data-background-color="yellow"] {
background-color: #ffb236; background-color: #ffb236;
} }
.card[data-background-color="blue"] { .card[data-background-color="blue"] {
background-color: #2ca8ff; background-color: #2ca8ff;
} }
.card[data-background-color="green"] { .card[data-background-color="green"] {
background-color: #15b60d; background-color: #15b60d;
} }
[data-background-color="orange"] { [data-background-color="orange"] {
background-color: #2d4262; background-color: #2d4262;
} }
[data-background-color="black"] { [data-background-color="black"] {
background-color: #2c2c2c; background-color: #2c2c2c;
} }
[data-background-color]:not([data-background-color="gray"]) { [data-background-color]:not([data-background-color="gray"]) {
color: #ffffff; color: #ffffff;
} }
[data-background-color]:not([data-background-color="gray"]) p { [data-background-color]:not([data-background-color="gray"]) p {
color: #ffffff; color: #ffffff;
} }
[data-background-color]:not([data-background-color="gray"]) [data-background-color]:not([data-background-color="gray"])
a:not(.btn):not(.dropdown-item) { a:not(.btn):not(.dropdown-item) {
color: #ffffff; color: #ffffff;
} }
[data-background-color]:not([data-background-color="gray"]) [data-background-color]:not([data-background-color="gray"])
.nav-tabs .nav-tabs
> .nav-item > .nav-item
> .nav-link > .nav-link
i.now-ui-icons { i.now-ui-icons {
color: #ffffff; color: #ffffff;
} }
@font-face { @font-face {
font-family: "Nucleo Outline"; font-family: "Nucleo Outline";
src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot"); src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot");
src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot") src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot")
format("embedded-opentype"); format("embedded-opentype");
src: url("https://raw.githack.com/creativetimofficial/now-ui-kit/master/assets/fonts/nucleo-outline.woff2"); src: url("https://raw.githack.com/creativetimofficial/now-ui-kit/master/assets/fonts/nucleo-outline.woff2");
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
.now-ui-icons { .now-ui-icons {
display: inline-block; display: inline-block;
font: normal normal normal 14px/1 "Nucleo Outline"; font: normal normal normal 14px/1 "Nucleo Outline";
font-size: inherit; font-size: inherit;
// speak: none; // speak: none;
text-transform: none; text-transform: none;
/* Better Font Rendering */ /* Better Font Rendering */
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
footer { footer {
margin-top: 50px; margin-top: 50px;
color: #555; color: #555;
background: #fff; background: #fff;
padding: 25px; padding: 25px;
font-weight: 300; font-weight: 300;
background: #f7f7f7; background: #f7f7f7;
} }
.footer p { .footer p {
margin-bottom: 0; margin-bottom: 0;
} }
footer p a { footer p a {
color: #555; color: #555;
font-weight: 400; font-weight: 400;
} }
footer p a:hover { footer p a:hover {
color: #e86c42; color: #e86c42;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.nav-tabs { .nav-tabs {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
padding-left: 100px; padding-left: 100px;
padding-right: 100px; padding-right: 100px;
text-align: center; text-align: center;
} }
.nav-tabs .nav-item > .nav-link { .nav-tabs .nav-item > .nav-link {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
.mat-dialog-container { .mat-dialog-container {
padding: 0px !important; padding: 0px !important;
} }

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,11 +71,11 @@
(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
style="margin-left: 13px;">Master</span></a> style="margin-left: 13px;">Master </span></a>
<ul class="dropdown-menu dropdown_style"> <ul class="dropdown-menu dropdown_style">
<li *ngIf="this.reportArray[3].Rstatus == true" class="dropdown_style" (click)="modelMaster('admin')" <li *ngIf="this.reportArray[3].Rstatus == true" class="dropdown_style" (click)="modelMaster('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;"> 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;">
@ -88,6 +88,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;"
@ -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

@ -1,18 +1,18 @@
.nav-link { .nav-link {
color: black; color: black;
} }
.actives { .actives {
background: #426e86; background: #426e86;
color: white; color: white;
} }
.selected-tab-0 md-ink-bar { .selected-tab-0 md-ink-bar {
background-color: red; background-color: red;
} }
.selected-tab-1 md-ink-bar { .selected-tab-1 md-ink-bar {
background-color: #426e86; background-color: #426e86;
} }
.selected-tab-2 md-ink-bar { .selected-tab-2 md-ink-bar {
background-color: green; background-color: green;
} }
// .mat-tab-body-content { // .mat-tab-body-content {
// } // }

View file

@ -261,7 +261,7 @@
<tbody style="cursor: pointer;"> <tbody style="cursor: pointer;">
<tr *ngFor="let device of deviceData | orderBy: key : reverse | filter:myInput ;let i = index" > <tr *ngFor="let device of deviceData | orderBy: key : reverse | filter:myInput ;let i = index" >
<td> <td>
<div *ngIf="iconCheck(device.status,device.iconType)"> <div *ngIf="iconCheck(device.status,device.iconType)">
<img *ngIf="device.iconType === 'jcb'" width ='30px' style="margin-left: 10px;" src={{devIcon}}> <img *ngIf="device.iconType === 'jcb'" width ='30px' style="margin-left: 10px;" src={{devIcon}}>
<img *ngIf="device.iconType != 'jcb'" width ='20px' style="margin-left: 10px;" src={{devIcon}}> <img *ngIf="device.iconType != 'jcb'" width ='20px' style="margin-left: 10px;" src={{devIcon}}>
@ -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;
@ -3127,7 +3140,6 @@ selectedlanguage:any
this.fuelShow = false; this.fuelShow = false;
} }
} }
var ls = res.currency_code ; var ls = res.currency_code ;
if(ls !=undefined){ if(ls !=undefined){
@ -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 }"
@ -200,7 +223,7 @@
<div *ngIf="inventoryManagement" class="form-group col-md-4"> <div *ngIf="inventoryManagement" class="form-group col-md-4">
<label for="inputCity">Device ID (IMEI)</label><span>*</span> <label for="inputCity">Device ID (IMEI)</label><span>*</span>
<div> <div>
<select id="inventory" multiple="multiple"> <select id="inventory" multiple="multiple">
<option <option
*ngFor="let option_1 of inventory" *ngFor="let option_1 of inventory"
[value]="option_1.IMEI" [value]="option_1.IMEI"
@ -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"
@ -216,7 +243,8 @@
<div *ngIf="f.device_id.errors.required"> <div *ngIf="f.device_id.errors.required">
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

@ -1,58 +1,58 @@
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
padding-left: 4px; padding-left: 4px;
padding-right: 3px; padding-right: 3px;
} }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 250px; max-width: 250px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 250px; width: 250px;
height: 50px; height: 50px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

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.from_date = new Date(); this.showAddButton=true;
// this.from_date.setDate(1); }else{
// this.to_date = new Date(); this.showAddButton = false;
}
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,10 +1558,11 @@ 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;
} }
}, },
{ {
"data": "created_by", "data": "created_by",
"defaultContent": "", "defaultContent": "",
@ -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; var table = $('#deviceTable1').clone();
this.tab = document.getElementById('deviceTable1'); // id of table table[0].querySelector("thead").remove();
console.log(table[0].querySelector("thead"));
// console.log(this.tab.rows.length)
var rowlength = 4; table[0].prepend($(".dataTable thead").clone()[0]);
if((this.superAdmin ==true)||(this.custtype ==true)||(this.dealerTocust=='ON')){ this.tab = table[0];//document.getElementById('deviceTable'); // id of table
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>";
} }
tab_text = tab_text + "</table>";
for(j = 0 ; j < this.tab.rows.length; j++) 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+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 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+
var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text)); .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));
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>
<img
src="{{ deviceImage[0] ? deviceImage[0] : img1 }}"
width="90px"
height="90px"
/>
</td> </td>
<td> <td>
<img
src="{{ deviceImage[0] ? deviceImage[0] : img1 }}"
width="80px"
height="80px"
/>
<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,20 +325,20 @@
</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>
<md-dialog-actions align="end"> <md-dialog-actions align="end">
<button md-button md-dialog-close>Cancel</button> <button md-button md-dialog-close >Cancel</button>
<button md-button (click)="exportAsPdf()" cdkFocusInitial>Export PDF</button> <button md-button (click)="exportAsPdf()" cdkFocusInitial>Export PDF</button>
</md-dialog-actions> </md-dialog-actions>

View file

@ -1,4 +1,4 @@
.html2canvas-container { .html2canvas-container {
width: 3000px !important; width: 3000px !important;
height: 3000px !important; height: 3000px !important;
} }

View file

@ -1,39 +1,39 @@
import { Component, Inject, OnInit } from '@angular/core'; import { Component, Inject, OnInit } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material'; import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
declare var jsPDF : any; declare var jsPDF: any;
declare var html2canvas:any; declare var html2canvas: any;
import * as moment from 'moment'; import * as moment from 'moment';
import { ContactService } from '../../contact.service'; import { ContactService } from '../../contact.service';
declare var $: any; declare var $: any;
declare var QRious:any; declare var QRious: any;
@Component({ @Component({
selector: 'app-download-certificate', selector: 'app-download-certificate',
templateUrl: './download-certificate.component.html', templateUrl: './download-certificate.component.html',
styleUrls: ['./download-certificate.component.scss'] styleUrls: ['./download-certificate.component.scss']
}) })
export class DownloadCertificateComponent implements OnInit { export class DownloadCertificateComponent implements OnInit {
devName:any; devName: any;
img1='/assets/images/liveTrackIcons/noImageAvailableIcon.jpg' img1 = '/assets/images/liveTrackIcons/noImageAvailableIcon.jpg'
stamp='/assets/images/liveTrackIcons/Stamp.png' stamp = '/assets/images/liveTrackIcons/Stamp.png'
phNum:any; phNum: any;
createdOn:any; createdOn: any;
expOn:any; expOn: any;
supAdmin supAdmin
DealerObj = []; DealerObj = [];
userObj = []; userObj = [];
// iconType:any; // iconType:any;
simNum:any; simNum: any;
todayODO:any; todayODO: any;
totalODO:any; totalODO: any;
useridd: any; useridd: any;
emailId:any =""; emailId: any = "";
costumers: any = []; costumers: any = [];
deviceID: any; deviceID: any;
userName:any; userName: any;
devmodel:any; devmodel: any;
newUserArr=[]; newUserArr = [];
editTemplate:boolean=true; editTemplate: boolean = true;
deletetemplate:boolean=false; deletetemplate: boolean = false;
orignalEmail: any; orignalEmail: any;
initialUser: any; initialUser: any;
ExportPdf: boolean; ExportPdf: boolean;
@ -67,14 +67,14 @@ deletetemplate:boolean=false;
numberOfSOS: any; numberOfSOS: any;
expiration_date: any; expiration_date: any;
organisationFlag: any; organisationFlag: any;
distributerName:any; distributerName: any;
distSelect: any=[]; distSelect: any = [];
superAdmin: any; superAdmin: any;
isDealer: any; isDealer: any;
dealerId: any; dealerId: any;
lastPingOn:any lastPingOn: any
lastDeviceTime:any lastDeviceTime: any
deviceImage=[]; deviceImage = [];
dealerName dealerName
installationDate; installationDate;
ICCICD ICCICD
@ -94,121 +94,122 @@ deletetemplate:boolean=false;
img: HTMLImageElement; img: HTMLImageElement;
gnnsModule gnnsModule
gsmModule gsmModule
constructor(public dialogRef: MdDialogRef<DownloadCertificateComponent>,private contactService:ContactService, constructor(public dialogRef: MdDialogRef<DownloadCertificateComponent>, private contactService: ContactService,
@Inject(MD_DIALOG_DATA) public data: any ) { @Inject(MD_DIALOG_DATA) public data: any) {
console.log(data); console.log(data);
} }
ngOnInit() { ngOnInit() {
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
} }
this.fitmentCertificateNo=this.data.deviceInfo.fitmentCertificateNo; this.fitmentCertificateNo = this.data.deviceInfo.fitmentCertificateNo;
this.ChassisNo=this.data.deviceInfo.ChassisNo; this.ChassisNo = this.data.deviceInfo.ChassisNo;
this.lastDeviceTime=this.data.deviceInfo.last_device_time; this.lastDeviceTime = this.data.deviceInfo.last_device_time;
this.numberOfSOS=this.data.deviceInfo.numberOfSOS this.numberOfSOS = this.data.deviceInfo.numberOfSOS
this.kycApprovalDate=this.data.deviceInfo.kycApprovalDate this.kycApprovalDate = this.data.deviceInfo.kycApprovalDate
this.model=this.data.deviceInfo.Model this.model = this.data.deviceInfo.Model
this.lastPingOn=this.data.deviceInfo.last_ping_on this.lastPingOn = this.data.deviceInfo.last_ping_on
this.devName = this.data.deviceInfo.Device_Name; this.devName = 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.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.simNum1 =this.data.deviceInfo.sim_number2; this.simNum1 = this.data.deviceInfo.sim_number2;
this.orignalEmail = this.data.deviceInfo.Email_ID this.orignalEmail = this.data.deviceInfo.Email_ID
this.emailId = this.data.deviceInfo.Email_ID; this.emailId = this.data.deviceInfo.Email_ID;
this.deviceImage=this.data.deviceInfo.deviceImage this.deviceImage = this.data.deviceInfo.deviceImage
if(this.org.imageDoc && this.org.imageDoc.length>0){ if (this.org.imageDoc && this.org.imageDoc.length > 0) {
this.org.imageDoc='https://www.oneqlik.in' + this.org.imageDoc[0].substring(6) this.org.imageDoc = 'https://www.oneqlik.in' + this.org.imageDoc[0].substring(6)
} }
this.supAdmin=this.data.deviceInfo.supAdmin; this.supAdmin = this.data.deviceInfo.supAdmin;
if(this.supAdmin.imageDoc && this.supAdmin.imageDoc.length>0){ if (this.supAdmin.imageDoc && this.supAdmin.imageDoc.length > 0) {
this.supAdmin.imageDoc='https://www.oneqlik.in' + this.supAdmin.imageDoc[0].substring(6) this.supAdmin.imageDoc = 'https://www.oneqlik.in' + this.supAdmin.imageDoc[0].substring(6)
} }
console.log(this.deviceImage); console.log(this.deviceImage);
this.installationDate=this.data.deviceInfo.created_on this.installationDate = this.data.deviceInfo.created_on
this.todayODO=this.data.deviceInfo.today_odo; this.todayODO = this.data.deviceInfo.today_odo;
this.totalODO =this.data.deviceInfo.total_odo; this.totalODO = this.data.deviceInfo.total_odo;
this.deviceID = this.data.deviceInfo.Device_ID; this.deviceID = this.data.deviceInfo.Device_ID;
this.initialUser = this.data.deviceInfo.user._id; this.initialUser = this.data.deviceInfo.user._id;
this.user=this.data.deviceInfo.user this.user = this.data.deviceInfo.user
this.userName = this.data.deviceInfo.OwnerName; this.userName = 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.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.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.CID_No = this.data.deviceInfo.CID_No this.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 : "";
if(this.devicetype=="Nippon-NVT-1820"){ if (this.devicetype == "Nippon-NVT-1820") {
this.gsmModule='Telit GE910' this.gsmModule = 'Telit GE910'
}else if(this.devicetype=="Nippon-NVT-1820"){ } else if (this.devicetype == "Nippon-NVT-1820") {
this.gnnsModule="Telit, Jupiter SL869T3-| Nav|C/IRNSS"; this.gnnsModule = "Telit, Jupiter SL869T3-| Nav|C/IRNSS";
this.gsmModule='Telit GE910' this.gsmModule = 'Telit GE910'
}else{ } else {
this.gnnsModule="Quectel L89(GPS+IRNSS)"; this.gnnsModule = "Quectel L89(GPS+IRNSS)";
this.gsmModule='Quectel M66' this.gsmModule = 'Quectel M66'
} }
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) : ''
} }
this.ICCICD = this.data.deviceInfo.IccidNo; this.ICCICD = this.data.deviceInfo.IccidNo;
this.IMSI = this.data.deviceInfo.IMSI; this.IMSI = this.data.deviceInfo.IMSI;
this.uniqueID = this.data.deviceInfo.uniqueID; this.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.typeOfVehicle = this.data.deviceInfo.typeOfVehicle; this.typeOfVehicle = this.data.deviceInfo.typeOfVehicle;
this.manufacturingCompany = this.data.deviceInfo.manufacturingCompany; this.manufacturingCompany = this.data.deviceInfo.manufacturingCompany;
this.vahanID= this.data.deviceInfo.vahanID?this.data.deviceInfo.vahanID:''; this.vahanID = this.data.deviceInfo.vahanID ? this.data.deviceInfo.vahanID : '';
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) : "";
this.vehicleManufacturingDate = this.data.deviceInfo.vehicleManufacturingDate?new Date(this.data.deviceInfo.vehicleManufacturingDate):""; this.vehicleManufacturingDate = this.data.deviceInfo.vehicleManufacturingDate ? new Date(this.data.deviceInfo.vehicleManufacturingDate) : "";
this.lattitude = this.data.deviceInfo.last_loc?this.data.deviceInfo.last_loc.coordinates[0]:""; this.lattitude = this.data.deviceInfo.last_loc ? this.data.deviceInfo.last_loc.coordinates[0] : "";
this.longitude = this.data.deviceInfo.last_loc?this.data.deviceInfo.last_loc.coordinates[1]:""; this.longitude = this.data.deviceInfo.last_loc ? this.data.deviceInfo.last_loc.coordinates[1] : "";
this.getLocationLink() this.getLocationLink()
var that=this var that = this
this.myImage = new Image(); this.myImage = new Image();
this.myImage.src = this.deviceImage[0]?this.deviceImage[0]:this.img1; this.myImage.src = this.deviceImage[0] ? this.deviceImage[0] : this.img1;
this.myImage.crossOrigin="anonymous"; this.myImage.crossOrigin = "anonymous";
this.myImage1 = new Image(); this.myImage1 = new Image();
this.myImage1.src = this.deviceImage[1]?this.deviceImage[1]:this.img1; this.myImage1.src = this.deviceImage[1] ? this.deviceImage[1] : this.img1;
this.myImage1.crossOrigin="anonymous"; this.myImage1.crossOrigin = "anonymous";
this.myImage2 = new Image(); this.myImage2 = new Image();
this.myImage2.src = this.deviceImage[2]?this.deviceImage[2]:this.img1; this.myImage2.src = this.deviceImage[2] ? this.deviceImage[2] : this.img1;
this.myImage2.crossOrigin="anonymous"; this.myImage2.crossOrigin = "anonymous";
this.stamp1=new Image(); this.stamp1 = new Image();
this.stamp1.src=this.stamp; this.stamp1.src = this.stamp;
this.stamp1.crossOrigin="anonymous"; this.stamp1.crossOrigin = "anonymous";
this.img = new Image(); this.img = new Image();
this.img.src = this.org.imageDoc?this.org.imageDoc:''; this.img.src = this.org.imageDoc ? this.org.imageDoc : '';
this.img.crossOrigin="anonymous"; this.img.crossOrigin = "anonymous";
// one() // one()
// function one(){ // function one(){
// stamp.onload = function(){ // stamp.onload = function(){
// two() // two()
// doc.addImage(stamp , 'png', 15,210,30,30); // doc.addImage(stamp , 'png', 15,210,30,30);
// }; // };
@ -227,7 +228,7 @@ deletetemplate:boolean=false;
// myImage.onload = function(){ // myImage.onload = function(){
// console.log("1"); // console.log("1");
// doc.addImage(myImage , 'png', 40, 170, 30, 20); // doc.addImage(myImage , 'png', 40, 170, 30, 20);
// }; // };
// } // }
@ -242,11 +243,11 @@ deletetemplate:boolean=false;
// function five(){ // function five(){
// myImage2.onload = function(){ // myImage2.onload = function(){
// console.log("3"); // console.log("3");
// doc.addImage(myImage2 , 'png', 120, 170, 30, 20); // doc.addImage(myImage2 , 'png', 120, 170, 30, 20);
// doc.save(name); // doc.save(name);
// }; // };
// } // }
@ -264,70 +265,73 @@ deletetemplate:boolean=false;
// img.onload = function(){ // img.onload = function(){
// console.log("-1"); // console.log("-1");
// doc.addImage(img , 'png', 15, 9,50,40) // doc.addImage(img , 'png', 15, 9,50,40)
// };doc.addImage(myImage , 'png', 40, 170, 30, 20); // };doc.addImage(myImage , 'png', 40, 170, 30, 20);
function f1() { function f1() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
that.myImage.onload = function(){ that.myImage.onload = function () {
console.log("1"); console.log("1");
}; };
// var isLoaded = this.myImage.complete && this.myImage.naturalHeight !== 0; // var isLoaded = this.myImage.complete && this.myImage.naturalHeight !== 0;
// if(isLoaded) // if(isLoaded)
resolve(''); resolve('');
}); });
} }
function f3() {
that.myImage2.onload = function () {
console.log("3");
function f3(){
that.myImage2.onload = function(){
console.log("3");
}; };
} }
function f2() { function f2() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
that.myImage1.onload = function(){ that.myImage1.onload = function () {
console.log("2"); console.log("2");
// doc.addImage(myImage1 , 'png', 80, 170, 30, 20); // doc.addImage(myImage1 , 'png', 80, 170, 30, 20);
// if(that.deviceImage.length==2){ // if(that.deviceImage.length==2){
// doc.save(name); // doc.save(name);
// } // }
};
// var isLoaded = this.myImage1.complete && this.myImage1.naturalHeight !== 0;
// if(isLoaded)
resolve('');
})
}
f1().then(res => f2().then(res1 => f3()));
}
closePopup() {
this.dialogRef.close(1);
}
getLocationLink() {
var data = {
id: this.data.deviceInfo._id,
imei: this.data.deviceInfo.Device_ID,
sh: this.data.deviceInfo.user._id,
ttl: 15 * 60
}; };
// var isLoaded = this.myImage1.complete && this.myImage1.naturalHeight !== 0;
// if(isLoaded) this.contactService.shareLiveLocation(data).subscribe(res => {
resolve(''); console.log(res);
console.log('shareToken', res);
this.link = 'http://nipponsecura.in' + "/share/liveShare?t=" + res.t;
console.log(this.link);
// this.shareLocationToDevice(link);
this.qrCodeGenerator()
}, err => {
console.log(err);
}) })
}
f1().then(res => f2().then(res1=>f3()));
} }
getLocationLink(){ qrCodeGenerator() {
var data = {
id: this.data.deviceInfo._id,
imei: this.data.deviceInfo.Device_ID,
sh: this.data.deviceInfo.user._id,
ttl: 15*60
};
this.contactService.shareLiveLocation(data).subscribe(res=>{
console.log(res);
console.log('shareToken',res);
this.link = 'http://nipponsecura.in' + "/share/liveShare?t=" + res.t;
console.log(this.link);
// this.shareLocationToDevice(link);
this.qrCodeGenerator()
},err=>{
console.log(err);
})
}
qrCodeGenerator() {
var qr = new QRious(); var qr = new QRious();
qr.set({ qr.set({
// background: 'green', // background: 'green',
@ -339,16 +343,16 @@ f1().then(res => f2().then(res1=>f3()));
size: 500, size: 500,
value: this.link value: this.link
}); });
this.imgURL= qr.toDataURL();
this.imgURL = qr.toDataURL();
} }
exportAsPdf() { exportAsPdf() {
var that=this var that = this
var name="Installation Certificate "+this.devName?this.devName:"Test"+".pdf" var name = "Installation Certificate " + this.devName ? this.devName : "Test" + ".pdf"
console.log(this.imgURL); console.log(this.imgURL);
var doc = new jsPDF(); var doc = new jsPDF();
var specialElementHandlers = { var specialElementHandlers = {
@ -356,91 +360,93 @@ f1().then(res => f2().then(res1=>f3()));
return true; return true;
} }
}; };
var stamp=new Image(); var stamp = new Image();
stamp.src=that.stamp; stamp.src = that.stamp;
stamp.crossOrigin="anonymous"; stamp.crossOrigin = "anonymous";
// stamp.onload = function(){ // stamp.onload = function(){
console.log("0"); console.log("0");
doc.addImage(that.stamp1 , 'png', 15,210,30,30) doc.setPage(1);
// }; doc.addImage(that.stamp1, 'png', 15, 210, 30, 30)
// };
var img = new Image(); var img = new Image();
img.src = this.org.imageDoc?this.org.imageDoc:''; img.src = this.org.imageDoc ? this.org.imageDoc : '';
img.crossOrigin="anonymous"; img.crossOrigin = "anonymous";
// if(this.org.imageDoc){ // if(this.org.imageDoc){
// img.onload = function(){ // img.onload = function(){
console.log("-1"); console.log("-1");
doc.addImage(that.img , 'png', 15, 9,50,40) doc.setPage(1);
doc.addImage(that.img, 'png', 15, 9, 50, 40)
// };
// };
// doc.text("Customer Copy", 110, 12); // doc.text("Customer Copy", 110, 12);
doc.setFontSize(3); doc.setFontSize(3);
doc.autoTable({ doc.autoTable({
theme: 'plain', theme: 'plain',
html: '#testPdf', html: '#testPdf',
tableWidth: 'auto', tableWidth: 'auto',
// styles : { // styles : {
// cellWidth : 10, // cellWidth : 10,
// overflow: "linebreak" // overflow: "linebreak"
// }, // },
willDrawCell: data => { willDrawCell: data => {
if(data.row.index === 0){ if (data.row.index === 0) {
data.row.height = 30; data.row.height = 30;
doc.setFontStyle('bold'); doc.setFontStyle('bold');
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);
} }
if(data.row.index ===1 ){ if (data.row.index === 1) {
// 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) {
// 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.cells[0].styles.halign = 'center'; // data.row.cells[0].styles.halign = 'center';
doc.halign = 'center'; doc.halign = 'center';
} }
if((data.row.index ===1) ||(data.row.index ===3) || (data.row.index ===5) || (data.row.index ===7) ||(data.row.index ===8) ||(data.row.index ===11) || (data.row.index ===13)){ if ((data.row.index === 1) || (data.row.index === 3) || (data.row.index === 5) || (data.row.index === 7) || (data.row.index === 8) || (data.row.index === 11) || (data.row.index === 13)) {
doc.setFontStyle('bold'); doc.setFontStyle('bold');
} }
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';
} }
doc.setLineWidth(1); doc.setLineWidth(1);
doc.rect(7, 7, 195, 285); doc.rect(7, 7, 195, 285);
} }
}); });
// var myImage = new Image(); // var myImage = new Image();
// myImage.src = that.deviceImage[0]?that.deviceImage[0]:this.img1; // myImage.src = that.deviceImage[0]?that.deviceImage[0]:this.img1;
@ -462,86 +468,87 @@ f1().then(res => f2().then(res1=>f3()));
// img.src = this.org.imageDoc?this.org.imageDoc:''; // img.src = this.org.imageDoc?this.org.imageDoc:'';
// img.crossOrigin="anonymous"; // img.crossOrigin="anonymous";
function f1() { function f1() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log("1"); console.log("1");
doc.addImage(that.myImage , 'png', 40, 170, 30, 20); doc.addImage(that.myImage, 'png', 40, 170, 30, 20);
resolve(''); resolve('');
}) })
} }
function f2() { function f2() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log("2"); console.log("2");
doc.addImage(that.myImage1 , 'png', 80, 170, 30, 20); doc.addImage(that.myImage1, 'png', 80, 170, 30, 20);
resolve(''); resolve('');
}) })
} }
function f3(){ function f3() {
// myImage2.onload = function(){ // myImage2.onload = function(){
console.log("3"); console.log("3");
doc.addImage(that.myImage2 , 'png', 120, 170, 30, 20);
doc.save(name);
}
// function f1() {
// return new Promise((resolve, reject) => {
// myImage.onload = function(){
// console.log("1");
// doc.addImage(myImage , 'png', 40, 170, 30, 20);
// };
// var isLoaded = myImage.complete && myImage.naturalHeight !== 0;
// if(isLoaded)
// resolve('');
// });
// }
// function f3(){ doc.addImage(that.myImage2, 'png', 120, 170, 30, 20);
// myImage2.onload = function(){ doc.save(name);
// console.log("3");
}
// doc.addImage(myImage2 , 'png', 120, 170, 30, 20); // function f1() {
// doc.save(name); // return new Promise((resolve, reject) => {
// myImage.onload = function(){
// console.log("1");
// }; // doc.addImage(myImage , 'png', 40, 170, 30, 20);
// }
// };
// var isLoaded = myImage.complete && myImage.naturalHeight !== 0;
// if(isLoaded)
// resolve('');
// });
// }
// function f3(){
// myImage2.onload = function(){
// console.log("3");
// doc.addImage(myImage2 , 'png', 120, 170, 30, 20);
// doc.save(name);
// };
// }
// function f2() {
// return new Promise((resolve, reject) => {
// myImage1.onload = function(){
// console.log("2");
// doc.addImage(myImage1 , 'png', 80, 170, 30, 20);
// // if(that.deviceImage.length==2){
// // doc.save(name);
// // }
// };
// var isLoaded = myImage1.complete && myImage1.naturalHeight !== 0;
// if(isLoaded)
// resolve('');
// })
// }
f1().then(res => f2().then(res1 => f3()));
// function f2() {
// return new Promise((resolve, reject) => {
// myImage1.onload = function(){
// console.log("2");
// doc.addImage(myImage1 , 'png', 80, 170, 30, 20);
// // if(that.deviceImage.length==2){
// // doc.save(name);
// // }
// };
// var isLoaded = myImage1.complete && myImage1.naturalHeight !== 0;
// if(isLoaded)
// resolve('');
// })
// }
f1().then(res => f2().then(res1=>f3()));
} }
toDataURL(url, callback) { toDataURL(url, callback) {
console.log(url); console.log(url);
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.onload = function () { xhr.onload = function () {
var reader = new FileReader(); var reader = new FileReader();
reader.onloadend = function () { reader.onloadend = function () {
callback(reader.result); callback(reader.result);
} }
reader.readAsDataURL(xhr.response); reader.readAsDataURL(xhr.response);
}; };
xhr.open('GET', url); xhr.open('GET', url);
xhr.responseType = 'blob'; xhr.responseType = 'blob';
xhr.send(); xhr.send();
} }
} }

View file

@ -1,49 +1,49 @@
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 250px; max-width: 250px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 250px; width: 250px;
height: 50px; height: 50px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

View file

@ -7,7 +7,7 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h4> <h4>
Update Device Update Device
<button type="button" class="close pull-right" (click)="back()"> <button type="button" class="close pull-right" (click)="back()">
<i class="fas fa-arrow-circle-left"></i> <i class="fas fa-arrow-circle-left"></i>
</button> </button>
@ -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

@ -1,7 +1,7 @@
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
padding-left: 4px; padding-left: 4px;
padding-right: 3px; padding-right: 3px;
} }

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:'':''],
@ -234,7 +235,7 @@ export class NewEditDeviceComponent implements OnInit {
this.location.back() this.location.back()
} }
this.loadropdown() this.loadropdown()
this.getDeviceModel(); this.getDeviceModel();
this.getvehDetail() this.getvehDetail()
this.getUserSetting(this.userId); this.getUserSetting(this.userId);
@ -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,8 +507,14 @@ 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')
this.router.navigateByUrl("dashboard"); if (localStorage.getItem('KycApprovalRedirect')) {
localStorage.removeItem('KycApprovalRedirect')
this.router.navigateByUrl("KycApproval")
} else {
this.router.navigateByUrl("dashboard");
}
} }
// this.Load = false // this.Load = false
) )

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,49 +56,101 @@ export class DatainjectionService {
// }); // });
// https://server2.oneqlik.in/ // https://server2.oneqlik.in/
if(window.localStorage.custumer_token){
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.emailid = JSON.parse(window.atob(window.localStorage.custumer_token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.custumer_token.split(".")[1]))._orgName;
this.useridd = JSON.parse(window.atob(window.localStorage.custumer_token.split('.')[1]))._id;
this.mb = JSON.parse(window.atob(window.localStorage.custumer_token.split('.')[1])).phn;
this.custtype = JSON.parse(window.atob(window.localStorage.custumer_token.split('.')[1])).isDealer;
if(this.custtype == true){
this.cust = true;
}
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
}
else{
console.log(router.url);
var url=(router.url).substring(0,12);
console.log(url);
if(url=="/ViewVehicle"){
}else{
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.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
if(this.custtype == true){
this.cust = true;
}
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
}
}
} }
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) {
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.emailid = JSON.parse(window.atob(window.localStorage.custumer_token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.custumer_token.split(".")[1]))._orgName;
this.useridd = JSON.parse(window.atob(window.localStorage.custumer_token.split('.')[1]))._id;
this.mb = JSON.parse(window.atob(window.localStorage.custumer_token.split('.')[1])).phn;
this.custtype = JSON.parse(window.atob(window.localStorage.custumer_token.split('.')[1])).isDealer;
if (this.custtype == true) {
this.cust = true;
}
if (this.mb.charAt(0) == "n") {
this.mb = ' '
}
}
else {
var url = (this.router.url).substring(0, 12);
console.log(url);
if (url == "/ViewVehicle") {
} else {
if (window.localStorage.token) {
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.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
if (this.custtype == true) {
this.cust = true;
}
if (this.mb.charAt(0) == "n") {
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

@ -1,17 +1,49 @@
.topDiv { .topDiv {
padding-top: 20px; padding-top: 20px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.bg-blue { .bg-blue {
background-color: #00c0ef !important; background-color: #00c0ef !important;
} }
.bg-green { .bg-green {
background-color: #00a65a !important; background-color: #00a65a !important;
} }
.bg-orange { .bg-orange {
background-color: #f39c12 !important; background-color: #f39c12 !important;
} }
.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,26 +193,29 @@ 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){
// url="/Device_inventory/getInventory?from="+this.from_date+'&to='+this.to_date // url="/Device_inventory/getInventory?from="+this.from_date+'&to='+this.to_date
// } // }
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

@ -1,93 +1,93 @@
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;
height: 84vh; height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae; // box-shadow: 3px 1px 5px 0px #b2b0ae;
} }
#deviceTable input { #deviceTable input {
border-radius: 5px; border-radius: 5px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(153, 153, 153); background: rgb(153, 153, 153);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184); // background: rgb(74, 118, 184);
background: #868e96; background: #868e96;
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }
#toast #img { #toast #img {
width: 250px; width: 250px;
height: 50px; height: 50px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 350px; max-width: 350px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
.card { .card {
padding: 5px; padding: 5px;
text-align: center; text-align: center;
margin: 5px; margin: 5px;
width: 160px; width: 160px;
color: white; color: white;
} }

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

@ -1,87 +1,87 @@
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;
height: 84vh; height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae; // box-shadow: 3px 1px 5px 0px #b2b0ae;
} }
#deviceTable input { #deviceTable input {
border-radius: 5px; border-radius: 5px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
height: 10px; height: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(153, 153, 153); background: rgb(153, 153, 153);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184); // background: rgb(74, 118, 184);
background: #868e96; background: #868e96;
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 250px; max-width: 250px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 250px; width: 250px;
height: 50px; height: 50px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

View file

@ -45,7 +45,7 @@ export class DayWiseReportComponent implements OnInit {
} }
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.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email; this.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin; this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;

View file

@ -1,3 +1,3 @@
.mat-dialog-container { .mat-dialog-container {
overflow: hidden !important; overflow: hidden !important;
} }

View file

@ -1,226 +1,226 @@
ul { ul {
list-style-type: none; list-style-type: none;
margin: 55px 0px 0px 0px; margin: 55px 0px 0px 0px;
padding: 0; padding: 0;
width: 25%; width: 25%;
background-color: #f1f1f1; background-color: #f1f1f1;
position: fixed; position: fixed;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
} }
li a { li a {
display: block; display: block;
color: #000; color: #000;
padding: 8px 0 8px 16px; padding: 8px 0 8px 16px;
text-decoration: none; text-decoration: none;
} }
li a.active { li a.active {
background-color: #4caf50; background-color: #4caf50;
color: white; color: white;
} }
li a:hover:not(.active) { li a:hover:not(.active) {
background-color: #555; background-color: #555;
color: white; color: white;
} }
.componentClass { .componentClass {
margin-left: 25%; margin-left: 25%;
padding: 64px 16px; padding: 64px 16px;
height: 1000px; height: 1000px;
} }
/* The sidebar menu */ /* The sidebar menu */
.sidebar { .sidebar {
height: 100%; /* 100% Full-height */ height: 100%; /* 100% Full-height */
width: 295px; /* 0 width - change this with JavaScript */ width: 295px; /* 0 width - change this with JavaScript */
position: fixed; /* Stay in place */ position: fixed; /* Stay in place */
z-index: 1; /* Stay on top */ z-index: 1; /* Stay on top */
top: 0; top: 0;
left: 0; left: 0;
top: 40px; top: 40px;
padding-left: 12px; padding-left: 12px;
padding-right: 12px; padding-right: 12px;
background: #f9f6f6 !important; background: #f9f6f6 !important;
padding-left: 3px; padding-left: 3px;
background-color: #111; /* Black*/ background-color: #111; /* Black*/
overflow-x: hidden; /* Disable horizontal scroll */ overflow-x: hidden; /* Disable horizontal scroll */
padding-top: 60px; /* Place content 60px from the top */ padding-top: 60px; /* Place content 60px from the top */
transition: 0.5s; /* 0.5 second transition effect to slide in the sidebar */ transition: 0.5s; /* 0.5 second transition effect to slide in the sidebar */
} }
/* The sidebar links */ /* The sidebar links */
.sidebar a { .sidebar a {
padding: 8px 8px 8px 32px; padding: 8px 8px 8px 32px;
text-decoration: none; text-decoration: none;
font-size: 25px; font-size: 25px;
color: #818181; color: #818181;
display: block; display: block;
transition: 0.3s; transition: 0.3s;
} }
/* When you mouse over the navigation links, change their color */ /* When you mouse over the navigation links, change their color */
.sidebar a:hover { .sidebar a:hover {
color: #f1f1f1; color: #f1f1f1;
} }
/* Position and style the close button (top right corner) */ /* Position and style the close button (top right corner) */
.sidebar .closebtn { .sidebar .closebtn {
position: absolute; position: absolute;
top: 0; top: 0;
right: 25px; right: 25px;
font-size: 36px; font-size: 36px;
margin-left: 50px; margin-left: 50px;
} }
/* The button used to open the sidebar */ /* The button used to open the sidebar */
.openbtn { .openbtn {
font-size: 20px; font-size: 20px;
cursor: pointer; cursor: pointer;
background-color: #111; background-color: #111;
color: white; color: white;
margin-top: 35px; margin-top: 35px;
padding: 10px 15px; padding: 10px 15px;
border: none; border: none;
} }
.openbtn:hover { .openbtn:hover {
background-color: #444; background-color: #444;
} }
/* Style page content - use this if you want to push the page content to the right when you open the side navigation */ /* Style page content - use this if you want to push the page content to the right when you open the side navigation */
#main { #main {
transition: margin-left 0.5s; /* If you want a transition effect */ transition: margin-left 0.5s; /* If you want a transition effect */
padding: 20px; padding: 20px;
margin-left: 295px; margin-left: 295px;
} }
/* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */ /* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */
@media screen and (max-height: 450px) { @media screen and (max-height: 450px) {
.sidebar { .sidebar {
padding-top: 15px; padding-top: 15px;
} }
.sidebar a { .sidebar a {
font-size: 18px; font-size: 18px;
} }
} }
.wrapper { .wrapper {
position: relative; position: relative;
width: 250px; width: 250px;
height: 300px; height: 300px;
border: 1px dashed #ccc; border: 1px dashed #ccc;
margin: 10px; margin: 10px;
} }
.line { .line {
position: absolute; position: absolute;
left: 0%; left: 0%;
top: 0; top: 0;
bottom: 0; bottom: 0;
// width: 20px; // width: 20px;
// width: 1px; // width: 1px;
margin-left: 295px; margin-left: 295px;
// background: #426e86; // background: #426e86;
z-index: 1; z-index: 1;
} }
.wordwrapper { .wordwrapper {
text-align: center; text-align: center;
height: 12px; height: 12px;
position: absolute; position: absolute;
left: 0; left: 0;
// right: 0; // right: 0;
top: 50%; top: 50%;
margin-top: -12px; margin-top: -12px;
z-index: 2; z-index: 2;
} }
.word { .word {
color: #ccc; color: #ccc;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
padding: 3px; padding: 3px;
margin-left: 295px; margin-left: 295px;
font: bold 12px arial, sans-serif; font: bold 12px arial, sans-serif;
// background: #fff; // background: #fff;
} }
.tabbable-panel { .tabbable-panel {
border: 1px solid #eee; border: 1px solid #eee;
padding: 10px; padding: 10px;
} }
.tabbable-line > .nav-tabs { .tabbable-line > .nav-tabs {
border: none; border: none;
margin: 0px; margin: 0px;
} }
.tabbable-line > .nav-tabs > li { .tabbable-line > .nav-tabs > li {
margin-right: 2px; margin-right: 2px;
} }
.tabbable-line > .nav-tabs > li > a { .tabbable-line > .nav-tabs > li > a {
border: 0; border: 0;
margin-right: 0; margin-right: 0;
color: #737373; color: #737373;
} }
.tabbable-line > .nav-tabs > li > a > i { .tabbable-line > .nav-tabs > li > a > i {
color: #a6a6a6; color: #a6a6a6;
} }
.tabbable-line > .nav-tabs > li.open, .tabbable-line > .nav-tabs > li.open,
.tabbable-line > .nav-tabs > li:hover { .tabbable-line > .nav-tabs > li:hover {
border-bottom: 4px solid rgb(80, 144, 247); border-bottom: 4px solid rgb(80, 144, 247);
} }
.tabbable-line > .nav-tabs > li.open > a, .tabbable-line > .nav-tabs > li.open > a,
.tabbable-line > .nav-tabs > li:hover > a { .tabbable-line > .nav-tabs > li:hover > a {
border: 0; border: 0;
background: none !important; background: none !important;
color: #333333; color: #333333;
} }
.tabbable-line > .nav-tabs > li.open > a > i, .tabbable-line > .nav-tabs > li.open > a > i,
.tabbable-line > .nav-tabs > li:hover > a > i { .tabbable-line > .nav-tabs > li:hover > a > i {
color: #a6a6a6; color: #a6a6a6;
} }
.tabbable-line > .nav-tabs > li.open .dropdown-menu, .tabbable-line > .nav-tabs > li.open .dropdown-menu,
.tabbable-line > .nav-tabs > li:hover .dropdown-menu { .tabbable-line > .nav-tabs > li:hover .dropdown-menu {
margin-top: 0px; margin-top: 0px;
} }
.tabbable-line > .nav-tabs > li.active { .tabbable-line > .nav-tabs > li.active {
border-bottom: 4px solid #32465b; border-bottom: 4px solid #32465b;
position: relative; position: relative;
} }
.tabbable-line > .nav-tabs > li.active > a { .tabbable-line > .nav-tabs > li.active > a {
border: 0; border: 0;
color: #333333; color: #333333;
} }
.tabbable-line > .nav-tabs > li.active > a > i { .tabbable-line > .nav-tabs > li.active > a > i {
color: #404040; color: #404040;
} }
.tabbable-line > .tab-content { .tabbable-line > .tab-content {
margin-top: -3px; margin-top: -3px;
background-color: #fff; background-color: #fff;
border: 0; border: 0;
border-top: 1px solid #eee; border-top: 1px solid #eee;
padding: 15px 0; padding: 15px 0;
} }
.portlet .tabbable-line > .tab-content { .portlet .tabbable-line > .tab-content {
padding-bottom: 0; padding-bottom: 0;
} }
.switch-toggle { .switch-toggle {
float: left; float: left;
background: #242729; background: #242729;
} }
.switch-toggle input { .switch-toggle input {
position: absolute; position: absolute;
opacity: 0; opacity: 0;
} }
.switch-toggle input + label { .switch-toggle input + label {
padding: 7px; padding: 7px;
float: left; float: left;
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
} }
.switch-toggle input:checked + label { .switch-toggle input:checked + label {
background: green; background: green;
} }

View file

@ -11,7 +11,7 @@
</div> </div>
</div> --> </div> -->
<div class="row rowStyle"> <div class="row rowStyle">
<div class="col-sm-3 col-md-3 col-lg-3" style="padding-left: 20px; padding-right: 5px; padding-top: 5px; padding-bottom: 5px;"> <div class="col-sm-3 col-md-3 col-lg-3" style="padding-left: 20px; padding-right: 5px; padding-top: 5px; padding-bottom: 5px;">
<div class="row" style="margin:0px;height: 84vh;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;"> <div class="row" style="margin:0px;height: 84vh;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;">
<div class="col-sm-12 col-md-12 col-lg-12" style="padding:0px"> <div class="col-sm-12 col-md-12 col-lg-12" style="padding:0px">
<app-report-filter (onReportFIlter)= "getReport($event)" [componentIdentifier]="identifier"></app-report-filter> <app-report-filter (onReportFIlter)= "getReport($event)" [componentIdentifier]="identifier"></app-report-filter>

View file

@ -30,7 +30,7 @@ export class GeofancingReportComponent implements OnInit {
userName:any; userName:any;
before:any; before:any;
deviceArr: any=[]; deviceArr: any=[];
constructor(private contactService: ContactService,private router: Router,public dialog: MdDialog) { } constructor(private contactService: ContactService,private router: Router,public dialog: MdDialog) { }
@ -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,19 +292,23 @@
</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">
</td> </ng-container>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">

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) => {
myImage.onload = function(){ if(myImage.src) {
console.log("1"); myImage.onload = function () {
doc.addImage(myImage , 'png', 40, 180, 30, 20); console.log("1");
if(that.deviceImage.length==1){ doc.setPage(1);
doc.save('sample-file.pdf'); doc.addImage(myImage, 'png', 160, 213, 20, 20);
if (that.deviceImage.length == 1) {
doc.save('sample-file.pdf');
}
};
} }
};
resolve(''); resolve('');
}); });
} }
function f3(){ function f3(){
myImage2.onload = function(){ if (myImage2) {
console.log("3"); myImage2.onload = function () {
console.log("3");
doc.addImage(myImage2 , 'png', 80, 180, 30, 20); doc.setPage(1);
doc.save('sample-file.pdf'); doc.addImage(myImage2, 'png', 100, 213, 20, 20);
doc.save('sample-file.pdf');
};
};
}
} }
function f2() { function f2() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
myImage1.onload = function(){ if (myImage1) {
myImage1.onload = function () {
console.log("2"); console.log("2");
doc.addImage(myImage1 , 'png', 60, 180, 30, 20); doc.setPage(1);
if(that.deviceImage.length==2){ doc.addImage(myImage1, 'png', 130, 213, 20, 20);
doc.save('sample-file.pdf'); if (that.deviceImage.length == 2) {
} 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,
callback(resp); "search":that.myInput,
"skip": dataTablesParameters.start / dataTablesParameters.length,
"limit": dataTablesParameters.length
}).subscribe(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 ;
@ -357,6 +362,12 @@ export class DistributersListComponent implements OnInit {
"render": function (data, type, row) { "render": function (data, type, row) {
return data ? data : ""; return data ? data : "";
} }
},
{
"data": "noOfDevices",
"render": function (data, type, row) {
return data ? data.total : 0;
}
}, },
// { // {
// "data" : "_id", // "data" : "_id",

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

@ -1,46 +1,46 @@
// #body{ // #body{
// overflow-x: hidden; // overflow-x: hidden;
// overflow-y: hidden; // overflow-y: hidden;
// } // }
#myInput { #myInput {
border-radius: 15px; border-radius: 15px;
/* border: 2px solid #18262F; */ /* border: 2px solid #18262F; */
padding: 7px; padding: 7px;
width: 116px; width: 116px;
height: 17px; height: 17px;
font-size: 9px; font-size: 9px;
outline: none; outline: none;
float: right; float: right;
margin-top: 2%; margin-top: 2%;
} }
.headStyle { .headStyle {
text-align: center; text-align: center;
font-size: 22px; font-size: 22px;
font-weight: 500; font-weight: 500;
color: #6b6a6a; color: #6b6a6a;
padding-top: 7px; padding-top: 7px;
margin: 0px; margin: 0px;
} }
.sidebar { .sidebar {
height: 84vh; height: 84vh;
width: 24%; width: 24%;
text-align: left; text-align: left;
background: white; background: white;
box-shadow: 3px 1px 5px 0px #b2b0ae; box-shadow: 3px 1px 5px 0px #b2b0ae;
position: fixed; position: fixed;
padding: 10px; padding: 10px;
} }
.main { .main {
box-shadow: 3px 1px 5px 0px #b2b0ae; box-shadow: 3px 1px 5px 0px #b2b0ae;
padding: 10px; padding: 10px;
background: white; background: white;
// margin-left: 5px; // margin-left: 5px;
} }
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }

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

@ -1,109 +1,109 @@
.headStyle { .headStyle {
text-align: center; text-align: center;
font-size: 22px; font-size: 22px;
font-weight: 500; font-weight: 500;
margin-top: 10px; margin-top: 10px;
color: #6b6a6a; color: #6b6a6a;
} }
.InputStyle { .InputStyle {
padding: 10px; padding: 10px;
padding-bottom: 20px; padding-bottom: 20px;
background-color: #efefef; background-color: #efefef;
margin-bottom: 10px; margin-bottom: 10px;
.selecStyle { .selecStyle {
display: inherit; display: inherit;
width: 56%; width: 56%;
padding-left: 16px; padding-left: 16px;
margin-left: 50px; margin-left: 50px;
border-radius: 10px; border-radius: 10px;
} }
} }
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;
height: 84vh; height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae; // box-shadow: 3px 1px 5px 0px #b2b0ae;
} }
#deviceTable input { #deviceTable input {
border-radius: 5px; border-radius: 5px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(153, 153, 153); background: rgb(153, 153, 153);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184); // background: rgb(74, 118, 184);
background: #868e96; background: #868e96;
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }
#toast { #toast {
visibility: hidden; visibility: hidden;
// max-width: 150px; // max-width: 150px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 150px; width: 150px;
height: 150px; height: 150px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

View file

@ -1,109 +1,109 @@
.headStyle { .headStyle {
text-align: center; text-align: center;
font-size: 22px; font-size: 22px;
font-weight: 500; font-weight: 500;
margin-top: 10px; margin-top: 10px;
color: #6b6a6a; color: #6b6a6a;
} }
.InputStyle { .InputStyle {
padding: 10px; padding: 10px;
padding-bottom: 20px; padding-bottom: 20px;
background-color: #efefef; background-color: #efefef;
margin-bottom: 10px; margin-bottom: 10px;
.selecStyle { .selecStyle {
display: inherit; display: inherit;
width: 56%; width: 56%;
padding-left: 16px; padding-left: 16px;
margin-left: 50px; margin-left: 50px;
border-radius: 10px; border-radius: 10px;
} }
} }
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;
height: 84vh; height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae; // box-shadow: 3px 1px 5px 0px #b2b0ae;
} }
#deviceTable input { #deviceTable input {
border-radius: 5px; border-radius: 5px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(153, 153, 153); background: rgb(153, 153, 153);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184); // background: rgb(74, 118, 184);
background: #868e96; background: #868e96;
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 150px; max-width: 150px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 150px; width: 150px;
height: 150px; height: 150px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

View file

@ -1,12 +1,12 @@
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;
height: 84vh; height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae; // box-shadow: 3px 1px 5px 0px #b2b0ae;
} }

View file

@ -1,109 +1,109 @@
.headStyle { .headStyle {
text-align: center; text-align: center;
font-size: 22px; font-size: 22px;
font-weight: 500; font-weight: 500;
margin-top: 10px; margin-top: 10px;
color: #6b6a6a; color: #6b6a6a;
} }
.InputStyle { .InputStyle {
padding: 10px; padding: 10px;
padding-bottom: 20px; padding-bottom: 20px;
background-color: #efefef; background-color: #efefef;
margin-bottom: 10px; margin-bottom: 10px;
.selecStyle { .selecStyle {
display: inherit; display: inherit;
width: 56%; width: 56%;
padding-left: 16px; padding-left: 16px;
margin-left: 50px; margin-left: 50px;
border-radius: 10px; border-radius: 10px;
} }
} }
.topDiv { .topDiv {
padding-top: 59px; padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;
height: 84vh; height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae; // box-shadow: 3px 1px 5px 0px #b2b0ae;
} }
#deviceTable input { #deviceTable input {
border-radius: 5px; border-radius: 5px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(153, 153, 153); background: rgb(153, 153, 153);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184); // background: rgb(74, 118, 184);
background: #868e96; background: #868e96;
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 150px; max-width: 150px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 150px; width: 150px;
height: 150px; height: 150px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

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

@ -1,121 +1,121 @@
.mainClass { .mainClass {
padding-top: 80px; padding-top: 80px;
margin-right: 10px; margin-right: 10px;
box-shadow: 4px 5px #ececec; box-shadow: 4px 5px #ececec;
} }
.mainClass p.head_style { .mainClass p.head_style {
padding-top: 8px; padding-top: 8px;
color: white; color: white;
margin-bottom: 0px; margin-bottom: 0px;
} }
/* .mainClass p.head_style1{ /* .mainClass p.head_style1{
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
color: #615c5c; color: #615c5c;
text-align: left; text-align: left;
padding-left: 1%; padding-left: 1%;
} */ } */
/* .rowStyle{ /* .rowStyle{
padding-right: 15%; padding-right: 15%;
} */ } */
.formfieldstyle { .formfieldstyle {
width: 40%; width: 40%;
} }
// .rowHeight { // .rowHeight {
// height: 145px; // height: 145px;
// overflow: auto; // overflow: auto;
// } // }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 150px; max-width: 150px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 150px; width: 150px;
height: 50px; height: 50px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }
/deep/ .mat-input-flex { /deep/ .mat-input-flex {
border: 1px solid #c1c1c1; border: 1px solid #c1c1c1;
background: #f2f2f2; background: #f2f2f2;
} }
.modal-class { .modal-class {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 0; right: 0;
} }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 250px; max-width: 250px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
.modal-lg { .modal-lg {
max-width: 1068px; max-width: 1068px;
} }
::ng-deep .modal-dialog { ::ng-deep .modal-dialog {
max-width: 1200px !important; max-width: 1200px !important;
width: 1200px; width: 1200px;
} }

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,9 +273,11 @@ 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 : '';
this.titleForDoc=doc.doctype?doc.doctype=="Adhar card1"?"Adhar card Front":doc.doctype=="Adhar card2"?"Adhar card Back":doc.doctype:doc.doctype 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.key=[]; this.key=[];
this.value=[] this.value=[]
if(doc.doctype=="Adhar card1" || doc.doctype=="Adhar card1 *"){ if(doc.doctype=="Adhar card1" || doc.doctype=="Adhar card1 *"){
@ -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

@ -1,65 +1,65 @@
.btn { .btn {
display: inline-block; display: inline-block;
margin-bottom: 0; margin-bottom: 0;
text-align: center; text-align: center;
text-transform: uppercase; text-transform: uppercase;
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
background-image: none; background-image: none;
padding: 6px 12px; padding: 6px 12px;
font-size: 1.4rem; font-size: 1.4rem;
border-radius: 0px; border-radius: 0px;
border: 1px solid transparent; border: 1px solid transparent;
text-decoration: none; text-decoration: none;
user-select: none; user-select: none;
background: #d8d8d8; background: #d8d8d8;
font-size: 12px; font-size: 12px;
&, &,
&:active, &:active,
&.active { &.active {
&:focus { &:focus {
outline: thin dotted; outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color; outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; outline-offset: -2px;
} }
} }
&:hover, &:hover,
&:focus, &:focus,
&.focus { &.focus {
text-decoration: none; text-decoration: none;
color: #fff; color: #fff;
} }
&:active, &:active,
&.active { &.active {
outline: 0; outline: 0;
background-image: none; background-image: none;
} }
&.disabled, &.disabled,
&[disabled], &[disabled],
fieldset[disabled] & { fieldset[disabled] & {
cursor: not-allowed; cursor: not-allowed;
pointer-events: none; pointer-events: none;
box-shadow: none; box-shadow: none;
} }
&.btn-xs { &.btn-xs {
padding: 3px 6px; padding: 3px 6px;
font-size: 1.2rem; font-size: 1.2rem;
} }
&.btn-sm { &.btn-sm {
padding: 4px 8px; padding: 4px 8px;
font-size: 1.3rem; font-size: 1.3rem;
} }
&.btn-lg { &.btn-lg {
padding: 8px 16px; padding: 8px 16px;
font-size: 1.6rem; font-size: 1.6rem;
} }
} }

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

@ -1,372 +1,372 @@
.btn { .btn {
display: inline-block; display: inline-block;
margin-bottom: 0; margin-bottom: 0;
text-align: center; text-align: center;
text-transform: uppercase; text-transform: uppercase;
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
background-image: none; background-image: none;
padding: 6px 12px; padding: 6px 12px;
font-size: 1.4rem; font-size: 1.4rem;
border-radius: 0px; border-radius: 0px;
border: 1px solid transparent; border: 1px solid transparent;
text-decoration: none; text-decoration: none;
user-select: none; user-select: none;
background: #d8d8d8; background: #d8d8d8;
font-size: 12px; font-size: 12px;
&, &,
&:active, &:active,
&.active { &.active {
&:focus { &:focus {
outline: thin dotted; outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color; outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; outline-offset: -2px;
} }
} }
&:hover, &:hover,
&:focus, &:focus,
&.focus { &.focus {
text-decoration: none; text-decoration: none;
color: #fff; color: #fff;
} }
&:active, &:active,
&.active { &.active {
outline: 0; outline: 0;
background-image: none; background-image: none;
} }
&.disabled, &.disabled,
&[disabled], &[disabled],
fieldset[disabled] & { fieldset[disabled] & {
cursor: not-allowed; cursor: not-allowed;
pointer-events: none; pointer-events: none;
box-shadow: none; box-shadow: none;
} }
&.btn-xs { &.btn-xs {
padding: 3px 6px; padding: 3px 6px;
font-size: 1.2rem; font-size: 1.2rem;
} }
&.btn-sm { &.btn-sm {
padding: 4px 8px; padding: 4px 8px;
font-size: 1.3rem; font-size: 1.3rem;
} }
&.btn-lg { &.btn-lg {
padding: 8px 16px; padding: 8px 16px;
font-size: 1.6rem; font-size: 1.6rem;
} }
} }
button, button,
input { input {
font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
} }
a { a {
color: #f96332; color: #f96332;
} }
a:hover, a:hover,
a:focus { a:focus {
color: #f96332; color: #f96332;
} }
p { p {
line-height: 1.61em; line-height: 1.61em;
font-weight: 300; font-weight: 300;
font-size: 1.2em; font-size: 1.2em;
} }
.category { .category {
text-transform: capitalize; text-transform: capitalize;
font-weight: 700; font-weight: 700;
color: #9a9a9a; color: #9a9a9a;
} }
body { body {
color: #2c2c2c; color: #2c2c2c;
font-size: 14px; font-size: 14px;
font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
overflow-x: hidden; overflow-x: hidden;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
.nav-item .nav-link, .nav-item .nav-link,
.nav-tabs .nav-link { .nav-tabs .nav-link {
-webkit-transition: all 300ms ease 0s; -webkit-transition: all 300ms ease 0s;
-moz-transition: all 300ms ease 0s; -moz-transition: all 300ms ease 0s;
-o-transition: all 300ms ease 0s; -o-transition: all 300ms ease 0s;
-ms-transition: all 300ms ease 0s; -ms-transition: all 300ms ease 0s;
transition: all 300ms ease 0s; transition: all 300ms ease 0s;
} }
.card a { .card a {
-webkit-transition: all 150ms ease 0s; -webkit-transition: all 150ms ease 0s;
-moz-transition: all 150ms ease 0s; -moz-transition: all 150ms ease 0s;
-o-transition: all 150ms ease 0s; -o-transition: all 150ms ease 0s;
-ms-transition: all 150ms ease 0s; -ms-transition: all 150ms ease 0s;
transition: all 150ms ease 0s; transition: all 150ms ease 0s;
} }
[data-toggle="collapse"][data-parent="#accordion"] i { [data-toggle="collapse"][data-parent="#accordion"] i {
-webkit-transition: transform 150ms ease 0s; -webkit-transition: transform 150ms ease 0s;
-moz-transition: transform 150ms ease 0s; -moz-transition: transform 150ms ease 0s;
-o-transition: transform 150ms ease 0s; -o-transition: transform 150ms ease 0s;
-ms-transition: all 150ms ease 0s; -ms-transition: all 150ms ease 0s;
transition: transform 150ms ease 0s; transition: transform 150ms ease 0s;
} }
[data-toggle="collapse"][data-parent="#accordion"][aria-expanded="true"] i { [data-toggle="collapse"][data-parent="#accordion"][aria-expanded="true"] i {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform: rotate(180deg); -webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg); -ms-transform: rotate(180deg);
transform: rotate(180deg); transform: rotate(180deg);
} }
.now-ui-icons { .now-ui-icons {
display: inline-block; display: inline-block;
font: normal normal normal 14px/1 "Nucleo Outline"; font: normal normal normal 14px/1 "Nucleo Outline";
font-size: inherit; font-size: inherit;
// speak: none; // speak: none;
text-transform: none; text-transform: none;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
@-webkit-keyframes nc-icon-spin { @-webkit-keyframes nc-icon-spin {
0% { 0% {
-webkit-transform: rotate(0deg); -webkit-transform: rotate(0deg);
} }
100% { 100% {
-webkit-transform: rotate(360deg); -webkit-transform: rotate(360deg);
} }
} }
@-moz-keyframes nc-icon-spin { @-moz-keyframes nc-icon-spin {
0% { 0% {
-moz-transform: rotate(0deg); -moz-transform: rotate(0deg);
} }
100% { 100% {
-moz-transform: rotate(360deg); -moz-transform: rotate(360deg);
} }
} }
@keyframes nc-icon-spin { @keyframes nc-icon-spin {
0% { 0% {
-webkit-transform: rotate(0deg); -webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg); -moz-transform: rotate(0deg);
-ms-transform: rotate(0deg); -ms-transform: rotate(0deg);
-o-transform: rotate(0deg); -o-transform: rotate(0deg);
transform: rotate(0deg); transform: rotate(0deg);
} }
100% { 100% {
-webkit-transform: rotate(360deg); -webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg); -moz-transform: rotate(360deg);
-ms-transform: rotate(360deg); -ms-transform: rotate(360deg);
-o-transform: rotate(360deg); -o-transform: rotate(360deg);
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.now-ui-icons.objects_umbrella-13:before { .now-ui-icons.objects_umbrella-13:before {
content: "\ea5f"; content: "\ea5f";
} }
.now-ui-icons.shopping_cart-simple:before { .now-ui-icons.shopping_cart-simple:before {
content: "\ea1d"; content: "\ea1d";
} }
.now-ui-icons.shopping_shop:before { .now-ui-icons.shopping_shop:before {
content: "\ea50"; content: "\ea50";
} }
.now-ui-icons.ui-2_settings-90:before { .now-ui-icons.ui-2_settings-90:before {
content: "\ea4b"; content: "\ea4b";
} }
.nav-tabs { .nav-tabs {
border: 0; border: 0;
padding: 15px 0.7rem; padding: 15px 0.7rem;
} }
.nav-tabs:not(.nav-tabs-neutral) > .nav-item > .nav-link.active { .nav-tabs:not(.nav-tabs-neutral) > .nav-item > .nav-link.active {
box-shadow: 0px 5px 35px 0px rgba(0, 0, 0, 0.3); box-shadow: 0px 5px 35px 0px rgba(0, 0, 0, 0.3);
} }
.card .nav-tabs { .card .nav-tabs {
border-top-right-radius: 0.1875rem; border-top-right-radius: 0.1875rem;
border-top-left-radius: 0.1875rem; border-top-left-radius: 0.1875rem;
} }
.nav-tabs > .nav-item > .nav-link { .nav-tabs > .nav-item > .nav-link {
color: #888888; color: #888888;
margin: 0; margin: 0;
margin-right: 5px; margin-right: 5px;
background-color: transparent; background-color: transparent;
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 30px; border-radius: 30px;
font-size: 14px; font-size: 14px;
padding: 11px 23px; padding: 11px 23px;
line-height: 1.5; line-height: 1.5;
} }
.nav-tabs > .nav-item > .nav-link:hover { .nav-tabs > .nav-item > .nav-link:hover {
background-color: transparent; background-color: transparent;
} }
.nav-tabs > .nav-item > .nav-link.active { .nav-tabs > .nav-item > .nav-link.active {
background-color: #444; background-color: #444;
border-radius: 30px; border-radius: 30px;
color: #ffffff; color: #ffffff;
} }
.nav-tabs > .nav-item > .nav-link i.now-ui-icons { .nav-tabs > .nav-item > .nav-link i.now-ui-icons {
font-size: 14px; font-size: 14px;
position: relative; position: relative;
top: 1px; top: 1px;
margin-right: 3px; margin-right: 3px;
} }
.nav-tabs.nav-tabs-neutral > .nav-item > .nav-link { .nav-tabs.nav-tabs-neutral > .nav-item > .nav-link {
color: #ffffff; color: #ffffff;
} }
.nav-tabs.nav-tabs-neutral > .nav-item > .nav-link.active { .nav-tabs.nav-tabs-neutral > .nav-item > .nav-link.active {
background-color: rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.2);
color: #ffffff; color: #ffffff;
} }
.card { .card {
border: 0; border: 0;
border-radius: 0.1875rem; border-radius: 0.1875rem;
display: inline-block; display: inline-block;
position: relative; position: relative;
width: 100%; width: 100%;
// margin-bottom: 30px; // margin-bottom: 30px;
// box-shadow: 0px 5px 25px 0px rgba(0, 0, 0, 0.2); // box-shadow: 0px 5px 25px 0px rgba(0, 0, 0, 0.2);
} }
.card .card-header { .card .card-header {
background-color: transparent; background-color: transparent;
border-bottom: 0; border-bottom: 0;
background-color: transparent; background-color: transparent;
border-radius: 0; border-radius: 0;
padding: 0; padding: 0;
} }
.card[data-background-color="orange"] { .card[data-background-color="orange"] {
// background-color: #2d4262; // background-color: #2d4262;
} }
.card[data-background-color="red"] { .card[data-background-color="red"] {
background-color: #ff3636; background-color: #ff3636;
} }
.card[data-background-color="yellow"] { .card[data-background-color="yellow"] {
background-color: #ffb236; background-color: #ffb236;
} }
.card[data-background-color="blue"] { .card[data-background-color="blue"] {
background-color: #2ca8ff; background-color: #2ca8ff;
} }
.card[data-background-color="green"] { .card[data-background-color="green"] {
background-color: #15b60d; background-color: #15b60d;
} }
[data-background-color="orange"] { [data-background-color="orange"] {
// background-color: #2d4262; // background-color: #2d4262;
} }
[data-background-color="black"] { [data-background-color="black"] {
// background-color: #2c2c2c; // background-color: #2c2c2c;
} }
[data-background-color]:not([data-background-color="gray"]) { [data-background-color]:not([data-background-color="gray"]) {
color: #ffffff; color: #ffffff;
} }
[data-background-color]:not([data-background-color="gray"]) p { [data-background-color]:not([data-background-color="gray"]) p {
color: #ffffff; color: #ffffff;
} }
[data-background-color]:not([data-background-color="gray"]) [data-background-color]:not([data-background-color="gray"])
a:not(.btn):not(.dropdown-item) { a:not(.btn):not(.dropdown-item) {
color: #ffffff; color: #ffffff;
} }
[data-background-color]:not([data-background-color="gray"]) [data-background-color]:not([data-background-color="gray"])
.nav-tabs .nav-tabs
> .nav-item > .nav-item
> .nav-link > .nav-link
i.now-ui-icons { i.now-ui-icons {
color: #ffffff; color: #ffffff;
} }
@font-face { @font-face {
font-family: "Nucleo Outline"; font-family: "Nucleo Outline";
src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot"); src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot");
src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot") src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot")
format("embedded-opentype"); format("embedded-opentype");
src: url("https://raw.githack.com/creativetimofficial/now-ui-kit/master/assets/fonts/nucleo-outline.woff2"); src: url("https://raw.githack.com/creativetimofficial/now-ui-kit/master/assets/fonts/nucleo-outline.woff2");
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
.now-ui-icons { .now-ui-icons {
display: inline-block; display: inline-block;
font: normal normal normal 14px/1 "Nucleo Outline"; font: normal normal normal 14px/1 "Nucleo Outline";
font-size: inherit; font-size: inherit;
// speak: none; // speak: none;
text-transform: none; text-transform: none;
/* Better Font Rendering */ /* Better Font Rendering */
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
footer { footer {
margin-top: 50px; margin-top: 50px;
color: #555; color: #555;
background: #fff; background: #fff;
padding: 25px; padding: 25px;
font-weight: 300; font-weight: 300;
background: #f7f7f7; background: #f7f7f7;
} }
.footer p { .footer p {
margin-bottom: 0; margin-bottom: 0;
} }
footer p a { footer p a {
color: #555; color: #555;
font-weight: 400; font-weight: 400;
} }
footer p a:hover { footer p a:hover {
color: #e86c42; color: #e86c42;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.nav-tabs { .nav-tabs {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
padding-left: 100px; padding-left: 100px;
padding-right: 100px; padding-right: 100px;
text-align: center; text-align: center;
} }
.nav-tabs .nav-item > .nav-link { .nav-tabs .nav-item > .nav-link {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
.mat-dialog-container { .mat-dialog-container {
padding: 0px !important; padding: 0px !important;
} }

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>
</div> <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>
<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); // trafficLayer.setMap(map);
if (outerThis.isTraffic) {
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);
@ -3609,7 +3625,8 @@ 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';
@ -3630,10 +3647,10 @@ zoomSet(){
tempObj["flag"] = this.tempMapHistory[playindex]['flag']; tempObj["flag"] = this.tempMapHistory[playindex]['flag'];
} }
if (this.flag == 'reset') { if (this.flag == 'reset') {
this.marker4.setPosition({ lat: this.latLngLine[0].lat, lng: this.latLngLine[0].lng }); this.marker4.setPosition({ lat: this.latLngLine[0].lat, lng: this.latLngLine[0].lng });
this.flag = 'init'; this.flag = 'init';
} }
} }
@ -3874,7 +3891,7 @@ zoomSet(){
// this.iconSelector("RUNNING","car",{}); // this.iconSelector("RUNNING","car",{});
var iconDest = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=D|FF0000|000000'; var iconDest = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=D|FF0000|000000';
// =====================================added============================== // =====================================added==============================
if (this.latlongObjArr[i].interpolated == null || this.latlongObjArr[i].interpolated == undefined || this.latlongObjArr[i].interpolated.length == 0) { if (this.latlongObjArr[i].interpolated == null || this.latlongObjArr[i].interpolated == undefined || this.latlongObjArr[i].interpolated.length == 0) {
@ -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) {
var geocoder = new google.maps.Geocoder(); try {
geocoder.geocode({ var geocoder = new google.maps.Geocoder();
latLng: pos geocoder.geocode({
}, function (responses) { latLng: pos
callback(responses[0].formatted_address) }, function (responses) {
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();
trafficLayer.setMap(map); if(outerThis.isTraffic){
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,104 +6769,113 @@ 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 (i == 6) {
this.skip = 0;
}
var vehStatus: string;
if(i!=undefined){
vehStatus = (i.toUpperCase() == 'INACTIVE') ? "OUT OF REACH" : (i.toUpperCase() == 'IDLE') ? "IDLING" : i.toUpperCase();
}else{
vehStatus = null;
if (this.currStatus =='Total'){
this.ngOnInit();
} }
var status_1 = false;
if(iden === 'tclick'){
this.showSocketData = false;
}
else{ else{
this.showSocketData = true; if (i == 6) {
} this.skip = 0;
this.deviceList =[]; }
this.foods=[]; var vehStatus: string;
// console.log('this.navId',this.navId); if (i != undefined) {
if(this.navId == 'locationHistory'){ vehStatus = (i.toUpperCase() == 'INACTIVE') ? "OUT OF REACH" : (i.toUpperCase() == 'IDLE') ? "IDLING" : i.toUpperCase();
iden='tclick'; } else {
this.devReady= false; vehStatus = null;
this.limit = 10000;
};
// console.log('limitfgdfgdfgdgdgdgfdgfdgdgfdgfdgdfg',this.limit);
this.contactService.getDeviceByFilter_dash(vehStatus, this.emailid, this.useridd, this.skip, this.limit, this.myInput, this.supadmin, this.dealerid, status_1)
.subscribe(res => {
// console.log("INside devList");
var aaaa = res;
this.deviceList = aaaa.devices;
this.devReady= true; }
if (this.deviceList.length === 0) {
this.lastcall = false;
this.firstcall = true
}
this.foods=[];
for (var k = 0; k < this.deviceList.length; k++) {
// if(this.deviceList[k].vehicleGroup){ var status_1 = false;
// if(!this.groups.includes({name:this.deviceList[k].vehicleGroup.name,id:this.deviceList[k].vehicleGroup._id})) if (iden === 'tclick') {
// this.groups.push({name:this.deviceList[k].vehicleGroup.name,id:this.deviceList[k].vehicleGroup._id}) this.showSocketData = false;
// }
}
this.deviceList[k]['playPause'] = true; else {
this.deviceList[k]['checked'] =true; this.showSocketData = true;
if(iden === 'tclick'){ }
if (this.deviceList[k].type_of_device == "Tracker") { this.deviceList = [];
let a = { this.foods = [];
value: this.deviceList[k].Device_Name, this.masterFoods = [];
viewValue: this.deviceList[k].Device_Name, // console.log('this.navId',this.navId);
did: this.deviceList[k].Device_ID, if (this.navId == 'locationHistory') {
id: this.deviceList[k]._id, iden = 'tclick';
user: this.deviceList[k].user, this.devReady = false;
email: this.deviceList[k].Email_ID, this.limit = 10000;
deviceType: this.deviceList[k].type_of_device, };
iconType: this.deviceList[k].iconType,
// checked: true // console.log('limitfgdfgdfgdgdgdgfdgfdgdgfdgfdgdfg',this.limit);
} this.contactService.getDeviceByFilter_dash(vehStatus, this.emailid, this.useridd, this.skip, this.limit, this.myInput, this.supadmin, this.dealerid, status_1)
this.foods.push(a); .subscribe(res => {
if(k === (this.deviceList.length -1)){ // console.log("INside devList");
// console.log("1111111110100000"); var aaaa = res;
if(this.navId!='locationHistory') this.deviceList = aaaa.devices;
{
this.showSocketData=false this.devReady = true;
if (this.deviceList.length === 0) {
this.lastcall = false;
this.firstcall = true
}
this.foods = [];
this.masterFoods = [];
for (var k = 0; k < this.deviceList.length; k++) {
// if(this.deviceList[k].vehicleGroup){
// if(!this.groups.includes({name:this.deviceList[k].vehicleGroup.name,id:this.deviceList[k].vehicleGroup._id}))
// this.groups.push({name:this.deviceList[k].vehicleGroup.name,id:this.deviceList[k].vehicleGroup._id})
// }
this.deviceList[k]['playPause'] = true;
this.deviceList[k]['checked'] = true;
if (iden === 'tclick') {
if (this.deviceList[k].type_of_device == "Tracker") {
let a = {
value: this.deviceList[k].Device_Name,
viewValue: this.deviceList[k].Device_Name,
did: this.deviceList[k].Device_ID,
id: this.deviceList[k]._id,
user: this.deviceList[k].user,
email: this.deviceList[k].Email_ID,
deviceType: this.deviceList[k].type_of_device,
iconType: this.deviceList[k].iconType,
// checked: true
} }
this.livetrack(null); this.foods.push(a);
if (k === (this.deviceList.length - 1)) {
// console.log("1111111110100000");
if (this.navId != 'locationHistory') {
this.showSocketData = false
}
this.livetrack(null);
}
} }
} }
} }
if (this.deviceList.length == 1) {
this.selectedDevice = this.deviceList[0]._id
this.parkingButtonShow = this.deviceList[0].theftAlert == null ? 'grey' : this.deviceList[0].theftAlert == undefined ? 'grey' : this.deviceList[0].theftAlert == true ? 'green' : 'red'
} this.DriverName = this.deviceList[0].driver_name;
if(this.deviceList.length==1){ // console.log("DRIVER NAME",this.DriverName,this.deviceList[0].ac);
this.selectedDevice=this.deviceList[0]._id this.ac = this.deviceList[0].ac ? this.deviceList[0].ac : 'NA'
this.parkingButtonShow=this.deviceList[0].theftAlert==null?'grey':this.deviceList[0].theftAlert==undefined?'grey':this.deviceList[0].theftAlert==true?'green':'red' this.DriverNumber = this.deviceList[0].contact_number
this.DriverName=this.deviceList[0].driver_name;
// console.log("DRIVER NAME",this.DriverName,this.deviceList[0].ac);
this.ac=this.deviceList[0].ac?this.deviceList[0].ac:'NA'
this.DriverNumber=this.deviceList[0].contact_number
} }
this.selectAllVehicles({checked:true}) this.selectAllVehicles({ checked: true })
// console.log('this.deviceList',this.deviceList,'GROUP===',this.groups);
this.masterFoods = JSON.parse(JSON.stringify(this.foods));
this.sortFoodDataByKey();
})
}
// console.log('this.deviceList',this.deviceList,'GROUP===',this.groups);
})
} }
@ -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); // trafficLayer.setMap(map);
if (this.isTraffic) {
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,17 +8616,20 @@ 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
} }
this.contactService.getTravel_path_report(payload).subscribe((resp:any)=>{ this.contactService.getTravel_path_report(payload).subscribe((resp:any)=>{
this.reportArr = []; this.reportArr = [];
this.reportArr= resp.filter(function (el) { if (resp && resp.length) {
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

@ -1,49 +1,49 @@
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 150px; max-width: 150px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 150px; width: 150px;
height: 50px; height: 50px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

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',
@ -96,7 +97,7 @@ passwordIcon:any = "visibility_off";
androidAppLink: any; androidAppLink: any;
iosAppLink: any; iosAppLink: any;
constructor(private titleServic: Title,public dialog: MdDialog,private dataService: ContactService,private _flashMessagesService: FlashMessagesService,private router: Router,public snackBar: MdSnackBar,public translate: TranslateService,@Inject(DOCUMENT) private _document: HTMLDocument) { constructor(private titleServic: Title, public dialog: MdDialog, private dataService: ContactService, private _flashMessagesService: FlashMessagesService, private router: Router, public snackBar: MdSnackBar,public translate: TranslateService,@Inject(DOCUMENT) private _document: HTMLDocument) {
let split1 = document.URL.split('//')[1]; let split1 = document.URL.split('//')[1];
console.log(split1,document); console.log(split1,document);
let split2 = split1.split('/')[0]; let split2 = split1.split('/')[0];
@ -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

@ -1,17 +1,17 @@
.topDiv { .topDiv {
padding-top: 20px; padding-top: 20px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.bg-blue { .bg-blue {
background-color: #00c0ef !important; background-color: #00c0ef !important;
} }
.bg-green { .bg-green {
background-color: #00a65a !important; background-color: #00a65a !important;
} }
.bg-orange { .bg-orange {
background-color: #f39c12 !important; background-color: #f39c12 !important;
} }
.bg-red { .bg-red {
background-color: #d9534f !important; background-color: #d9534f !important;
} }

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

@ -1,48 +1,48 @@
<div class="card" style="height:540px"> <div class="card" style="height:540px">
<div class="card-header"> <div class="card-header">
<h4>Add Multiple POI</h4> <h4>Add Multiple POI</h4>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-top: 10px;margin-bottom: 10px;"> <div class="row" style="margin-top: 10px;margin-bottom: 10px;">
<div class="col-sm-12" style="text-align: left;font-size: initial;"> <div class="col-sm-12" style="text-align: left;font-size: initial;">
<!-- <label >Choose an Excel File:</label> <!-- <label >Choose an Excel File:</label>
<input style="margin-left: 30px;" type="file" id="excelFile" multiple size="50"> --> <input style="margin-left: 30px;" type="file" id="excelFile" multiple size="50"> -->
<div class="col-sm-offset-2 col-sm-10" style="text-align: center;"> <div class="col-sm-offset-2 col-sm-10" style="text-align: center;">
<label style="background: MD_DIALOG_DATA;box-shadow: 2px 2px #a0a3a5;" <label style="background: MD_DIALOG_DATA;box-shadow: 2px 2px #a0a3a5;"
class="file-upload btn btn-primary">Browse class="file-upload btn btn-primary">Browse
for Excel file ... <input type="file" id="excelFile" multiple size="50" /> for Excel file ... <input type="file" id="excelFile" multiple size="50" />
</label> </label>
<button type="button" style="margin-top: 0px; margin-left: 15px;; width: 90px; box-shadow: 2px 2px #b1adad" <button type="button" style="margin-top: 0px; margin-left: 15px;; width: 90px; box-shadow: 2px 2px #b1adad"
class="btn btn-primary" data-toggle="collapse" data-target="#collapseZero" aria-expanded="true" class="btn btn-primary" data-toggle="collapse" data-target="#collapseZero" aria-expanded="true"
aria-controls="collapseZero" (click)="uploadExcel()">Upload</button> aria-controls="collapseZero" (click)="uploadExcel()">Upload</button>
</div> </div>
</div> </div>
</div> </div>
<div class="row" *ngIf="showErrorupload_1"> <div class="row" *ngIf="showErrorupload_1">
<div class=col-sm-12> <div class=col-sm-12>
<table class="table table-striped table-hover " style="overflow-y: hidden; overflow-x: hidden;font-size:12px"> <table class="table table-striped table-hover " style="overflow-y: hidden; overflow-x: hidden;font-size:12px">
<thead> <thead>
<tr> <tr>
<th>{{'Client Name' | translate}}</th> <th>{{'Client Name' | translate}}</th>
<th>{{'Altitude' | translate}}</th> <th>{{'Altitude' | translate}}</th>
<th>{{'Longitude' | translate}}</th> <th>{{'Longitude' | translate}}</th>
<th>{{'Address' | translate}}</th> <th>{{'Address' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let failedDevices of uploadJSON"> <tr *ngFor="let failedDevices of uploadJSON">
<td style="cursor:pointer">{{failedDevices['Client Name']}}</td> <td style="cursor:pointer">{{failedDevices['Client Name']}}</td>
<td style="cursor:pointer">{{failedDevices.Altitude}}</td> <td style="cursor:pointer">{{failedDevices.Altitude}}</td>
<td style="cursor:pointer">{{failedDevices.Longitude}}</td> <td style="cursor:pointer">{{failedDevices.Longitude}}</td>
<td style="cursor:pointer">{{failedDevices.Address}}</td> <td style="cursor:pointer">{{failedDevices.Address}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,3 +1,3 @@
.example-chip-list { .example-chip-list {
width: 100%; width: 100%;
} }

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

@ -1,234 +1,234 @@
.custom_style { .custom_style {
// position: fixed; // position: fixed;
// top:0 ; // top:0 ;
// left:0; // left:0;
// right :0; // right :0;
// background: #2D4262; // background: #2D4262;
// padding-top: 0%; // padding-top: 0%;
// padding-bottom: 0%; // padding-bottom: 0%;
// line-height: 2.8; // line-height: 2.8;
// box-shadow: -1px 7px 7px -5px rgb(48, 68, 99); // box-shadow: -1px 7px 7px -5px rgb(48, 68, 99);
// ================changed style================== // ================changed style==================
position: fixed; position: fixed;
background: #2d4262; background: #2d4262;
padding-top: 1%; padding-top: 1%;
padding: 0; padding: 0;
width: 100%; width: 100%;
box-shadow: -1px 7px 7px -5px #304463; box-shadow: -1px 7px 7px -5px #304463;
} }
.changePadding { .changePadding {
flex: 1; flex: 1;
text-align: center; text-align: center;
padding-left: 90px; padding-left: 90px;
} }
.changePadding1 { .changePadding1 {
flex: 1; flex: 1;
text-align: center; text-align: center;
padding-left: 15px; padding-left: 15px;
} }
.list_style { .list_style {
margin-left: 100px; margin-left: 100px;
ul { ul {
li { li {
a { a {
color: white; color: white;
} }
} }
} }
} }
.dropdown_style { .dropdown_style {
// background: #b9b7b7 ; // background: #b9b7b7 ;
// background: linear-gradient(to bottom, #2c3e50,#bdc3c7); // background: linear-gradient(to bottom, #2c3e50,#bdc3c7);
// background: #D42021; // background: #D42021;
background: #2d4262; background: #2d4262;
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
cursor: pointer; cursor: pointer;
a { a {
color: white; color: white;
} }
} }
.dropdown-menu > a:hover { .dropdown-menu > a:hover {
background-color: #2a3132; background-color: #2a3132;
background-image: none; background-image: none;
} }
.hoverStyle:hover { .hoverStyle:hover {
background-color: #2a3132; background-color: #2a3132;
background-image: none; background-image: none;
} }
.nav-item > a:hover { .nav-item > a:hover {
background-color: #2a3132; background-color: #2a3132;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(153, 153, 153); background: rgb(153, 153, 153);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: rgb(74, 118, 184); background: rgb(74, 118, 184);
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }
@media (max-width: 1540px) { @media (max-width: 1540px) {
#navbarSupportedContent { #navbarSupportedContent {
margin-left: 50px; margin-left: 50px;
} }
} }
@media (min-width: 1366px) { @media (min-width: 1366px) {
#navbarSupportedContent { #navbarSupportedContent {
margin-left: 50px; margin-left: 50px;
} }
} }
@media (max-width: 1366px) { @media (max-width: 1366px) {
.list_style { .list_style {
font-size: 13px; font-size: 13px;
} }
} }
@media (max-width: 1366px) { @media (max-width: 1366px) {
.changePadding { .changePadding {
padding-left: 0px; padding-left: 0px;
} }
.changePadding1 { .changePadding1 {
padding-left: 0px; padding-left: 0px;
} }
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
height: 10px; height: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(143, 215, 255); background: rgb(143, 215, 255);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: #dadada; background: #dadada;
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }
#navbarSupportedContent { #navbarSupportedContent {
margin-left: 100px; margin-left: 100px;
} }
@media (max-width: 1537px) { @media (max-width: 1537px) {
#navbarSupportedContent { #navbarSupportedContent {
margin-left: 0px; margin-left: 0px;
} }
} }
@media (max-width: 1537px) { @media (max-width: 1537px) {
.list_style { .list_style {
font-size: 13px; font-size: 13px;
} }
} }
// @media (min-width:1366px){ // @media (min-width:1366px){
// .list_style{ // .list_style{
// font-size: 14px; // font-size: 14px;
// } // }
// } // }
// @media (max-width:1476px){ // @media (max-width:1476px){
// .list_style{ // .list_style{
// font-size: 14px; // font-size: 14px;
// } // }
// } // }
// 1366,1440 // 1366,1440
// .bg-light{ // .bg-light{
// background: #737373; // background: #737373;
// } // }
// .bg-light :hover{ // .bg-light :hover{
// background: #dbd4d4; // background: #dbd4d4;
// } // }
// .navbar-nav > li > .dropdown-menu { background-color: #FF0000; } // .navbar-nav > li > .dropdown-menu { background-color: #FF0000; }
// .dropdown-menu > .active > a,.dropdown-menu > .active > a:hover.dropdown-menu > .active > a:focus {color: #555555!important; background-color: #e7e7e7!important;} // .dropdown-menu > .active > a,.dropdown-menu > .active > a:hover.dropdown-menu > .active > a:focus {color: #555555!important; background-color: #e7e7e7!important;}
li a.nav-link { li a.nav-link {
width: max-content !important; width: max-content !important;
// padding: 20px 5px !important; // padding: 20px 5px !important;
} }
.dropdown-submenu { .dropdown-submenu {
position: relative; position: relative;
} }
.dropdown-submenu > .dropdown-menu { .dropdown-submenu > .dropdown-menu {
top: 0; top: 0;
left: 100%; left: 100%;
margin-top: -6px; margin-top: -6px;
margin-left: -1px; margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px; -webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px; -moz-border-radius: 0 6px 6px;
border-radius: 0 6px 6px 6px; border-radius: 0 6px 6px 6px;
} }
.dropdown-submenu:hover > .dropdown-menu { .dropdown-submenu:hover > .dropdown-menu {
display: block; display: block;
} }
.dropdown-submenu > a:after { .dropdown-submenu > a:after {
display: block; display: block;
content: " "; content: " ";
float: right; float: right;
width: 0; width: 0;
height: 0; height: 0;
border-color: transparent; border-color: transparent;
border-style: solid; border-style: solid;
border-width: 5px 0 5px 5px; border-width: 5px 0 5px 5px;
border-left-color: #ccc; border-left-color: #ccc;
margin-top: 5px; margin-top: 5px;
margin-right: -10px; margin-right: -10px;
} }
.dropdown-submenu:hover > a:after { .dropdown-submenu:hover > a:after {
border-left-color: #fff; border-left-color: #fff;
} }
.dropdown-submenu.pull-left { .dropdown-submenu.pull-left {
float: none; float: none;
} }
.dropdown-submenu.pull-left > .dropdown-menu { .dropdown-submenu.pull-left > .dropdown-menu {
left: -100%; left: -100%;
margin-left: 10px; margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px; -webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px;
} }

View file

@ -1,146 +1,146 @@
ul { ul {
list-style-type: none; list-style-type: none;
margin: 55px 0px 0px 0px; margin: 55px 0px 0px 0px;
padding: 0; padding: 0;
width: 25%; width: 25%;
background-color: #f1f1f1; background-color: #f1f1f1;
position: fixed; position: fixed;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
} }
li a { li a {
display: block; display: block;
color: #000; color: #000;
padding: 8px 0 8px 16px; padding: 8px 0 8px 16px;
text-decoration: none; text-decoration: none;
} }
li a.active { li a.active {
background-color: #4caf50; background-color: #4caf50;
color: white; color: white;
} }
li a:hover:not(.active) { li a:hover:not(.active) {
background-color: #555; background-color: #555;
color: white; color: white;
} }
.componentClass { .componentClass {
margin-left: 25%; margin-left: 25%;
padding: 64px 16px; padding: 64px 16px;
height: 1000px; height: 1000px;
} }
/* The sidebar menu */ /* The sidebar menu */
.sidebar { .sidebar {
height: 100%; /* 100% Full-height */ height: 100%; /* 100% Full-height */
width: 295px; /* 0 width - change this with JavaScript */ width: 295px; /* 0 width - change this with JavaScript */
position: fixed; /* Stay in place */ position: fixed; /* Stay in place */
z-index: 1; /* Stay on top */ z-index: 1; /* Stay on top */
top: 0; top: 0;
left: 0; left: 0;
background: #f9f6f6 !important; background: #f9f6f6 !important;
padding-left: 3px; padding-left: 3px;
background-color: #111; /* Black*/ background-color: #111; /* Black*/
overflow-x: hidden; /* Disable horizontal scroll */ overflow-x: hidden; /* Disable horizontal scroll */
padding-top: 60px; /* Place content 60px from the top */ padding-top: 60px; /* Place content 60px from the top */
transition: 0.5s; /* 0.5 second transition effect to slide in the sidebar */ transition: 0.5s; /* 0.5 second transition effect to slide in the sidebar */
} }
/* The sidebar links */ /* The sidebar links */
.sidebar a { .sidebar a {
padding: 8px 8px 8px 32px; padding: 8px 8px 8px 32px;
text-decoration: none; text-decoration: none;
font-size: 25px; font-size: 25px;
color: #818181; color: #818181;
display: block; display: block;
transition: 0.3s; transition: 0.3s;
} }
/* When you mouse over the navigation links, change their color */ /* When you mouse over the navigation links, change their color */
.sidebar a:hover { .sidebar a:hover {
color: #f1f1f1; color: #f1f1f1;
} }
/* Position and style the close button (top right corner) */ /* Position and style the close button (top right corner) */
.sidebar .closebtn { .sidebar .closebtn {
position: absolute; position: absolute;
top: 0; top: 0;
right: 25px; right: 25px;
font-size: 36px; font-size: 36px;
margin-left: 50px; margin-left: 50px;
} }
/* The button used to open the sidebar */ /* The button used to open the sidebar */
.openbtn { .openbtn {
font-size: 20px; font-size: 20px;
cursor: pointer; cursor: pointer;
background-color: #111; background-color: #111;
color: white; color: white;
margin-top: 35px; margin-top: 35px;
padding: 10px 15px; padding: 10px 15px;
border: none; border: none;
} }
.openbtn:hover { .openbtn:hover {
background-color: #444; background-color: #444;
} }
/* Style page content - use this if you want to push the page content to the right when you open the side navigation */ /* Style page content - use this if you want to push the page content to the right when you open the side navigation */
#main { #main {
transition: margin-left 0.5s; /* If you want a transition effect */ transition: margin-left 0.5s; /* If you want a transition effect */
padding: 20px; padding: 20px;
margin-left: 295px; margin-left: 295px;
} }
/* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */ /* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */
@media screen and (max-height: 450px) { @media screen and (max-height: 450px) {
.sidebar { .sidebar {
padding-top: 15px; padding-top: 15px;
} }
.sidebar a { .sidebar a {
font-size: 18px; font-size: 18px;
} }
} }
.wrapper { .wrapper {
position: relative; position: relative;
width: 250px; width: 250px;
height: 300px; height: 300px;
border: 1px dashed #ccc; border: 1px dashed #ccc;
margin: 10px; margin: 10px;
} }
.line { .line {
position: absolute; position: absolute;
left: 0%; left: 0%;
top: 0; top: 0;
bottom: 0; bottom: 0;
// width: 20px; // width: 20px;
// width: 1px; // width: 1px;
margin-left: 295px; margin-left: 295px;
// background: #426e86; // background: #426e86;
z-index: 1; z-index: 1;
} }
.wordwrapper { .wordwrapper {
text-align: center; text-align: center;
height: 12px; height: 12px;
position: absolute; position: absolute;
left: 0; left: 0;
// right: 0; // right: 0;
top: 50%; top: 50%;
margin-top: -12px; margin-top: -12px;
z-index: 2; z-index: 2;
} }
.word { .word {
color: #ccc; color: #ccc;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
padding: 3px; padding: 3px;
margin-left: 295px; margin-left: 295px;
font: bold 12px arial, sans-serif; font: bold 12px arial, sans-serif;
// background: #fff; // background: #fff;
} }

View file

@ -1,52 +1,52 @@
col-sm-9 col-md-9 col-lg-9 .ms-parent { col-sm-9 col-md-9 col-lg-9 .ms-parent {
width: 100% !important; width: 100% !important;
} }
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 250px; max-width: 250px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 250px; width: 250px;
height: 50px; height: 50px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

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

@ -1,3 +1,3 @@
.mat-dialog-container { .mat-dialog-container {
overflow: hidden !important; overflow: hidden !important;
} }

View file

@ -1,49 +1,49 @@
#toast { #toast {
visibility: hidden; visibility: hidden;
max-width: 250px; max-width: 250px;
height: 50px; height: 50px;
/*margin-left: -125px;*/ /*margin-left: -125px;*/
margin: auto; margin: auto;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 60%; left: 60%;
right: 0; right: 0;
bottom: 80%; bottom: 80%;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
} }
#toast #img { #toast #img {
width: 250px; width: 250px;
height: 50px; height: 50px;
float: left; float: left;
padding-top: 16px; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #111; background-color: #111;
color: #fff; color: #fff;
} }
#toast #desc { #toast #desc {
color: #fff; color: #fff;
padding: 16px; padding: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
#toast.show { #toast.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
fadeout 0.5s 2.5s; fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
fadeout 0.5s 4.5s; fadeout 0.5s 4.5s;
} }

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,22 +19,161 @@
</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>
<th style="text-align: left;">{{'In/Out' | translate}}</th> <th style="text-align: left;">{{'In/Out' | translate}}</th>
<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

@ -1,36 +1,36 @@
.topDiv { .topDiv {
// padding-top: 59px; // padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;
height: 84vh; height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae; // box-shadow: 3px 1px 5px 0px #b2b0ae;
} }
#deviceTable input { #deviceTable input {
border-radius: 5px; border-radius: 5px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(153, 153, 153); background: rgb(153, 153, 153);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184); // background: rgb(74, 118, 184);
background: #868e96; background: #868e96;
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }

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

@ -1,7 +1,7 @@
.card { .card {
margin: 218px; margin: 218px;
float: none; float: none;
padding: 70px; padding: 70px;
text-align: center; text-align: center;
margin-bottom: 10px; margin-bottom: 10px;
} }

View file

@ -1,36 +1,36 @@
.topDiv { .topDiv {
// padding-top: 59px; // padding-top: 59px;
background: whitesmoke; background: whitesmoke;
height: 100vh; height: 100vh;
} }
.rowStyle { .rowStyle {
// margin: 5px; // margin: 5px;
// background: white; // background: white;
height: 84vh; height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae; // box-shadow: 3px 1px 5px 0px #b2b0ae;
} }
#deviceTable input { #deviceTable input {
border-radius: 5px; border-radius: 5px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 10px;
} }
/* Track */ /* Track */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: rgb(153, 153, 153); background: rgb(153, 153, 153);
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184); // background: rgb(74, 118, 184);
background: #868e96; background: #868e96;
} }
/* Handle on hover */ /* Handle on hover */
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #555; background: #555;
} }

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,7 +92,8 @@
</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>
<select id="dbselect" multiple="multiple"> <div *ngIf="componentIdentifier =='daywise_report'">
<select (change)="onDateChange()" id="dbselect_single">
<option <option
*ngFor="let option_1 of options" *ngFor="let option_1 of options"
[value]="option_1.selectedValue" [value]="option_1.selectedValue"
@ -99,6 +101,17 @@
{{ option_1.value }} {{ option_1.value }}
</option> </option>
</select> </select>
</div>
<div *ngIf="componentIdentifier !='daywise_report'">
<select id="dbselect" multiple="multiple">
<option
*ngFor="let option_1 of options"
[value]="option_1.selectedValue"
>
{{ option_1.value }}
</option>
</select>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -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
@ -589,7 +628,7 @@
}" }"
style="background-color: #1556b9; color: #fdfdfd" style="background-color: #1556b9; color: #fdfdfd"
[disabled]="clicked" [disabled]="clicked"
(click)="actionMethod('2'); clicked = true" (click)="actionMethod('2'); clicked = true "
md-raised-button md-raised-button
(click)="reportFilter_billing('data')" (click)="reportFilter_billing('data')"
> >
@ -618,7 +657,7 @@
<div class="col-3">{{ "Device" | translate }}</div> <div class="col-3">{{ "Device" | translate }}</div>
<div class="col-9"> <div class="col-9">
<div> <div>
<select id="dbselect" multiple="multiple"> <select id="dbselect" multiple="multiple" >
<option <option
*ngFor="let option_1 of options" *ngFor="let option_1 of options"
[value]="option_1.selectedValue" [value]="option_1.selectedValue"
@ -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=[]
this.deviceArr = $('#dbselect').multipleSelect('getSelects','value'); if (this.componentIdentifier == "daywise_report") {
this.deviceArr = $('#dbselect_single').multipleSelect('getSelects','value');
} else {
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)
@ -1488,6 +1536,10 @@ changeComponent(component){
this.ngOnInit() this.ngOnInit()
} }
onDateChange() {
console.log('on change triggered');
this.clicked = false;
}
onChangeGroup(event){ onChangeGroup(event){
console.log(event); console.log(event);
this.clicked=false this.clicked=false

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)

Some files were not shown because too many files have changed in this diff Show more