multiple bugfixes from 20 Apr 2020 to 7 jan 2023
This commit is contained in:
parent
902e04c7e6
commit
63d062c4a7
122 changed files with 13163 additions and 12361 deletions
|
|
@ -28,7 +28,7 @@
|
|||
placeholder="Enter Contact number"
|
||||
[ngClass]="{ 'is-invalid': submitted && f.contactNo.errors }"
|
||||
/>
|
||||
<small *ngIf="message">{{ message }}</small>
|
||||
<small [class.d-none]="!contactMessage">{{contactMessage}}</small>
|
||||
<div
|
||||
*ngIf="submitted && f.contactNo.errors"
|
||||
class="invalid-feedback"
|
||||
|
|
@ -41,25 +41,47 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4">Owner Name</label> <span>*</span>
|
||||
<div class="form-group col-md-2">
|
||||
<label for="inputEmail4">Owner First Name</label> <span>*</span>
|
||||
<input
|
||||
formControlName="ownerName"
|
||||
formControlName="first_name"
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="inputEmail4"
|
||||
placeholder="Please Enter Owner Name"
|
||||
[ngClass]="{ 'is-invalid': submitted && f.ownerName.errors }"
|
||||
placeholder="Enter First Name"
|
||||
[ngClass]="{ 'is-invalid': submitted && f.first_name.errors }"
|
||||
/>
|
||||
<div
|
||||
*ngIf="submitted && f.ownerName.errors"
|
||||
*ngIf="submitted && f.first_name.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.ownerName.errors.required">
|
||||
Owner Name is required
|
||||
<div *ngIf="f.first_name.errors.required">
|
||||
Owner First Name is required
|
||||
</div>
|
||||
<div *ngIf="f.ownerName.errors.pattern">
|
||||
Please enter valid name
|
||||
<div *ngIf="f.first_name.errors.pattern">
|
||||
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>
|
||||
|
|
@ -184,6 +206,7 @@
|
|||
<input
|
||||
formControlName="device_id"
|
||||
type="text"
|
||||
(keyup)="removeSpecialChar()"
|
||||
class="form-control"
|
||||
id="inputCity"
|
||||
[ngClass]="{ 'is-invalid': submitted && f.email.errors }"
|
||||
|
|
@ -200,7 +223,7 @@
|
|||
<div *ngIf="inventoryManagement" class="form-group col-md-4">
|
||||
<label for="inputCity">Device ID (IMEI)</label><span>*</span>
|
||||
<div>
|
||||
<select id="inventory" multiple="multiple">
|
||||
<select id="inventory" multiple="multiple">
|
||||
<option
|
||||
*ngFor="let option_1 of inventory"
|
||||
[value]="option_1.IMEI"
|
||||
|
|
@ -209,6 +232,10 @@
|
|||
</option>
|
||||
</select>
|
||||
</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
|
||||
*ngIf="submitted && f.device_id.errors"
|
||||
class="invalid-feedback"
|
||||
|
|
@ -216,7 +243,8 @@
|
|||
<div *ngIf="f.device_id.errors.required">
|
||||
Device Id is required
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
|
|
|
|||
|
|
@ -1,58 +1,58 @@
|
|||
.topDiv {
|
||||
padding-top: 59px;
|
||||
background: whitesmoke;
|
||||
height: 100vh;
|
||||
padding-left: 4px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
#toast {
|
||||
visibility: hidden;
|
||||
max-width: 250px;
|
||||
height: 50px;
|
||||
/*margin-left: -125px;*/
|
||||
margin: auto;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 60%;
|
||||
right: 0;
|
||||
bottom: 80%;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#toast #img {
|
||||
width: 250px;
|
||||
height: 50px;
|
||||
|
||||
float: left;
|
||||
|
||||
padding-top: 16px;
|
||||
padding-bottom: 16px;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
background-color: #111;
|
||||
color: #fff;
|
||||
}
|
||||
#toast #desc {
|
||||
color: #fff;
|
||||
|
||||
padding: 16px;
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#toast.show {
|
||||
visibility: visible;
|
||||
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
|
||||
fadeout 0.5s 2.5s;
|
||||
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
|
||||
fadeout 0.5s 4.5s;
|
||||
}
|
||||
.topDiv {
|
||||
padding-top: 59px;
|
||||
background: whitesmoke;
|
||||
height: 100vh;
|
||||
padding-left: 4px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
#toast {
|
||||
visibility: hidden;
|
||||
max-width: 250px;
|
||||
height: 50px;
|
||||
/*margin-left: -125px;*/
|
||||
margin: auto;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 60%;
|
||||
right: 0;
|
||||
bottom: 80%;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#toast #img {
|
||||
width: 250px;
|
||||
height: 50px;
|
||||
|
||||
float: left;
|
||||
|
||||
padding-top: 16px;
|
||||
padding-bottom: 16px;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
background-color: #111;
|
||||
color: #fff;
|
||||
}
|
||||
#toast #desc {
|
||||
color: #fff;
|
||||
|
||||
padding: 16px;
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#toast.show {
|
||||
visibility: visible;
|
||||
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
|
||||
fadeout 0.5s 2.5s;
|
||||
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
|
||||
fadeout 0.5s 4.5s;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { FlashMessagesService } from 'angular2-flash-messages';
|
|||
import { BsDatepickerConfig, BsModalRef, BsModalService } from 'ngx-bootstrap';
|
||||
import { ContactService } from '../../contact.service';
|
||||
import {Location} from '@angular/common';
|
||||
import { T } from '../../../../node_modules3/@types/lodash/fp';
|
||||
declare var $:any;
|
||||
declare var swal: any;
|
||||
@Component({
|
||||
|
|
@ -15,6 +16,7 @@ declare var swal: any;
|
|||
export class AddNewDeviceComponent implements OnInit {
|
||||
DeviceModelValue: any;
|
||||
modalRef: BsModalRef;
|
||||
contactMessage= '';
|
||||
submitted = false;
|
||||
date=new Date()
|
||||
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({
|
||||
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}')]],
|
||||
device_id:[''],
|
||||
address:['',Validators.required],
|
||||
|
|
@ -228,6 +232,7 @@ export class AddNewDeviceComponent implements OnInit {
|
|||
var that=this
|
||||
$(document).on('change','#inventory',function() {
|
||||
var value = $('#inventory').val();
|
||||
that.checkDeviceEMI(value);
|
||||
for(var i=0;i<that.inventory.length;i++){
|
||||
if(value==that.inventory[i].IMEI){
|
||||
var date=new Date()
|
||||
|
|
@ -244,6 +249,9 @@ export class AddNewDeviceComponent implements OnInit {
|
|||
sim1:that.inventory[i].Mob1,
|
||||
sim2:that.inventory[i].Mob2,
|
||||
eSimExpiry:new Date(exp),
|
||||
|
||||
trackingExp: new Date(exp),
|
||||
|
||||
device_id:value,
|
||||
})
|
||||
that.vahanID=that.inventory[i]['SerialNo']
|
||||
|
|
@ -334,14 +342,14 @@ export class AddNewDeviceComponent implements OnInit {
|
|||
var expDate = new Date();
|
||||
expDate.setFullYear(expDate.getFullYear()+1);
|
||||
|
||||
var name=this.deviceForm.value.ownerName.split(' ')
|
||||
//var name=this.deviceForm.value.ownerName.split(' ')
|
||||
|
||||
var data={
|
||||
// Dealer:this.reactiveForm.value.manager,
|
||||
custumer: true,
|
||||
expdate:new Date(expDate).toISOString(),
|
||||
first_name:name[0]?name[0]:'',
|
||||
last_name:name[1]?name[1]:'',
|
||||
first_name: this.deviceForm.value.first_name ? this.deviceForm.value.first_name:'',
|
||||
last_name: this.deviceForm.value.last_name ? this.deviceForm.value.last_name : '',
|
||||
isDealer: false,
|
||||
phone:this.deviceForm.value.contactNo,
|
||||
user_id:"",
|
||||
|
|
@ -439,6 +447,10 @@ export class AddNewDeviceComponent implements OnInit {
|
|||
if(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){
|
||||
|
|
@ -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) {
|
||||
var numberChars = "0123456789";
|
||||
var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
|
@ -597,7 +613,7 @@ user
|
|||
userFound:boolean=false;
|
||||
onSearchChange(value){
|
||||
this.userFound=false
|
||||
this.message=undefined
|
||||
this.contactMessage = '';
|
||||
console.log(value);
|
||||
var phone=this.deviceForm.value.contactNo
|
||||
if(phone.length==10){
|
||||
|
|
@ -606,20 +622,25 @@ onSearchChange(value){
|
|||
console.log(res);
|
||||
if(res.message=="User already Present"){
|
||||
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:""
|
||||
})
|
||||
this.user=res.data[0]
|
||||
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();
|
||||
}else{
|
||||
this.userFound=false
|
||||
this.message=res.message
|
||||
this.contactMessage = res.message
|
||||
console.log('this.contactMessage', this.contactMessage);
|
||||
}
|
||||
},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;
|
||||
getvehDetail(){
|
||||
this.contactService.getvehType(this.userId)
|
||||
|
|
@ -709,6 +743,7 @@ getvehDetail(){
|
|||
this.loadropdown()
|
||||
})
|
||||
}
|
||||
|
||||
docRow:boolean=false;
|
||||
// AddDocumentsField(addedRow:any){
|
||||
// console.log("Inside function !!!");
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@
|
|||
</md-option>
|
||||
</md-select>
|
||||
<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> -->
|
||||
<!-- (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>
|
||||
<!-- *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>
|
||||
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import { Params,Router, ActivatedRoute, CanActivate, ActivatedRouteSnapshot, Rou
|
|||
import {ContactService} from '../contact.service';
|
||||
import { checkNoChangesNode } from '@angular/core/src/view/view';
|
||||
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 {DatainjectionService} from '../datainjection.service'
|
||||
import { isUndefined } from 'util';
|
||||
|
|
@ -165,22 +165,25 @@ modelChanged: Subject<string> = new Subject<string>();
|
|||
|
||||
}
|
||||
bussinessType;
|
||||
showButton:Boolean=false
|
||||
showButton:Boolean=false;
|
||||
showAddButton:Boolean=false;
|
||||
ngOnInit() {
|
||||
// this.updateFieldswithvalue()
|
||||
|
||||
this.showDemoVideo();
|
||||
this.socket_Ing = this.injectData.getSocket_gps();
|
||||
|
||||
// this.from_date = new Date();
|
||||
// this.from_date.setDate(1);
|
||||
// this.to_date = new Date();
|
||||
if (localStorage.getItem('addDev') == 'yes' || JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin || JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer){
|
||||
this.showAddButton=true;
|
||||
}else{
|
||||
this.showAddButton = false;
|
||||
}
|
||||
|
||||
this.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 });
|
||||
|
||||
this.socket_Ing.on('connect', function (this) {
|
||||
// console.log('Ignition IO Connected');
|
||||
})
|
||||
// this.socket_Ing.on('connect', function (this) {
|
||||
// // console.log('Ignition IO Connected');
|
||||
// })
|
||||
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
|
||||
this.adbtn = localStorage.getItem("dlrchk");
|
||||
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++){
|
||||
|
||||
|
||||
|
||||
// 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){
|
||||
let dev_status_1= this.deviceData[j].status?this.deviceData[j].status:"Not available";
|
||||
this.deviceData[j].status = dev_status_1 ;
|
||||
|
|
@ -1550,10 +1558,11 @@ testTable() {
|
|||
"render": function(data, type, row) {
|
||||
|
||||
var fn = data?data.first_name:'-' ;
|
||||
var ln = data?data.last_name:'-'
|
||||
return fn + ' ' + ln ;
|
||||
var ln = data && data.last_name?data.last_name:'';
|
||||
let ph = data && data.phone ? ' (' + data.phone +')' : ''
|
||||
return fn + ' ' + ln + '' + ph;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"data": "created_by",
|
||||
"defaultContent": "",
|
||||
|
|
@ -1582,7 +1591,7 @@ testTable() {
|
|||
"visible" :true,
|
||||
"render": function(data, type, row) {
|
||||
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,
|
||||
"render": function(data, type, row) {
|
||||
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,
|
||||
"render": function(data, type, row) {
|
||||
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": "",
|
||||
"render": function(data, type, row) {
|
||||
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 => {
|
||||
|
||||
// console.log(result);
|
||||
|
||||
// if (result == "advance") {
|
||||
|
|
@ -1894,7 +1904,72 @@ exportCertificate(data){
|
|||
}
|
||||
|
||||
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() {
|
||||
|
||||
var data = this.devicess.devices
|
||||
|
|
@ -1913,7 +1988,8 @@ exportCertificate(data){
|
|||
}
|
||||
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 : ""
|
||||
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 : "" :""
|
||||
}
|
||||
|
|
@ -2015,41 +2091,72 @@ exportCertificate(data){
|
|||
}
|
||||
|
||||
exportExcel() {
|
||||
|
||||
|
||||
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;
|
||||
window.open('data:application/csv,charset=utf-8,' + $('#deviceTable1').html());
|
||||
var tab_text = "<table border='2px'><tr bgcolor='#87AFC6'>";
|
||||
var textRange; var j = 0;
|
||||
var table = $('#deviceTable1').clone();
|
||||
table[0].querySelector("thead").remove();
|
||||
console.log(table[0].querySelector("thead"));
|
||||
|
||||
table[0].prepend($(".dataTable thead").clone()[0]);
|
||||
this.tab = table[0];//document.getElementById('deviceTable'); // id of table
|
||||
|
||||
for (j = 0; j < this.tab.rows.length; j++) {
|
||||
tab_text = tab_text + this.tab.rows[j].innerHTML + "</tr>";
|
||||
//tab_text=tab_text+"</tr>";
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
||||
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));
|
||||
|
||||
var msie = ua.indexOf("MSIE ");
|
||||
tab_text = tab_text.replace(/\s{2,}/g, '') // <-- Replace all consecutive spaces, 2+
|
||||
.replace(/%/g, '%25') // <-- Escape %
|
||||
.replace(/&/g, '%26') // <-- Escape &
|
||||
.replace(/#/g, '%23') // <-- Escape #
|
||||
.replace(/"/g, '%22') // <-- Escape "
|
||||
.replace(/'/g, '%27');
|
||||
console.log(tab_text.length, 32767 < tab_text.length);
|
||||
var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
|
||||
|
||||
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){
|
||||
|
|
@ -2060,7 +2167,7 @@ exportCertificate(data){
|
|||
|
||||
}
|
||||
pageLength:any;
|
||||
pageLengthArr=[10,25,50,100,200,500,"All"];
|
||||
pageLengthArr=[10,25,50,100,200,500,1000,2000,5000];
|
||||
callDataTable(){
|
||||
this.customDatafilter = true;
|
||||
this.skip = 0;
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@
|
|||
src="{{ org.imageDoc }}"
|
||||
width="100px"
|
||||
height="100px"
|
||||
/><br /><br />
|
||||
/><br />
|
||||
</div>
|
||||
</td>
|
||||
<td style="text-align: center; font-weight: 700">
|
||||
|
|
@ -190,28 +190,28 @@
|
|||
</td>
|
||||
<td style="text-align: center">
|
||||
<div>
|
||||
<img src="{{ imgURL }}" width="100px" height="150px" />
|
||||
<img src="{{ imgURL }}" width="100px" height="100px" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center">
|
||||
<h6 style="font-size: 18px"> .</h6>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<td width="200">
|
||||
TAC Reg.No <br />
|
||||
CoP No. <br />
|
||||
CoP Validity upto <br />
|
||||
Fitment Date <br />
|
||||
Fitment Renewal Date <br />
|
||||
</td>
|
||||
<td>
|
||||
<td colspan="2">
|
||||
: CK8077 <br />
|
||||
: CC0GP8551<br />
|
||||
: 30 September 2022 <br />
|
||||
: CC0GR8739<br />
|
||||
: 30 September 2023 <br />
|
||||
: {{ kycApprovalDate ? (kycApprovalDate | date: "dd/MM/yyyy") : ""
|
||||
}}<br />
|
||||
: {{ esim_validity ? esim_validity : "" }}<br />
|
||||
|
|
@ -219,7 +219,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<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
|
||||
</h6>
|
||||
</td>
|
||||
|
|
@ -247,7 +247,7 @@
|
|||
Secondary SIM<br />
|
||||
Secondary SIM Valid till<br />
|
||||
</td>
|
||||
<td>
|
||||
<td colspan="2">
|
||||
: {{ fitmentCertificateNo ? fitmentCertificateNo : "" }}<br />
|
||||
: {{ ChassisNo ? ChassisNo : "" }}<br />
|
||||
: {{ engineNo ? engineNo : "" }}<br />
|
||||
|
|
@ -265,35 +265,38 @@
|
|||
: {{ gsmModule ? gsmModule : "Telit GE910" }}<br />
|
||||
: {{ ICCICD ? ICCICD : "" }}<br />
|
||||
: {{ simNum ? simNum : "" }}<br />
|
||||
: {{ expiration_date ? (expiration_date | date: "dd/MM/yyyy") : ""
|
||||
: {{ esim_validity ? (esim_validity) : ""
|
||||
}}<br />
|
||||
: {{ simNum1 ? simNum1 : "" }}<br />
|
||||
: {{ expiration_date ? (expiration_date | date: "dd/MM/yyyy") : ""
|
||||
: {{ esim_validity ? (esim_validity) : ""
|
||||
}}<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="padding-top: 10px">
|
||||
<tr style="padding-top: 5px">
|
||||
<td>
|
||||
<img
|
||||
src="{{ deviceImage[0] ? deviceImage[0] : img1 }}"
|
||||
width="90px"
|
||||
height="90px"
|
||||
/>
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<img
|
||||
src="{{ deviceImage[0] ? deviceImage[0] : img1 }}"
|
||||
width="80px"
|
||||
height="80px"
|
||||
/>
|
||||
<img
|
||||
src="{{ deviceImage[1] ? deviceImage[1] : img1 }}"
|
||||
width="90px"
|
||||
height="90px"
|
||||
width="80px"
|
||||
height="80px"
|
||||
/>
|
||||
<img
|
||||
src="{{ deviceImage[2] ? deviceImage[2] : img1 }}"
|
||||
width="80px"
|
||||
height="80px"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<img
|
||||
src="{{ deviceImage[2] ? deviceImage[2] : img1 }}"
|
||||
width="90px"
|
||||
height="90px"
|
||||
/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -305,10 +308,10 @@
|
|||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="padding-top: 10px">
|
||||
<tr style="padding-top: 5px">
|
||||
<td>Authorised</td>
|
||||
</tr>
|
||||
<tr style="padding-top: 10px">
|
||||
<tr style="padding-top: 5px">
|
||||
<td>Undertaking</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -322,20 +325,20 @@
|
|||
</td>
|
||||
</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 : "" }}
|
||||
{{ user.last_name ? user.last_name : "" }}<br />
|
||||
Contact/Login ID : {{ user.phone ? user.phone : "" }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<td colspan="1">
|
||||
Customer Address: {{ user.address ? user.address : "" }}<br />
|
||||
Customer Sign :
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</md-dialog-content>
|
||||
<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>
|
||||
</md-dialog-actions>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.html2canvas-container {
|
||||
width: 3000px !important;
|
||||
height: 3000px !important;
|
||||
}
|
||||
.html2canvas-container {
|
||||
width: 3000px !important;
|
||||
height: 3000px !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,39 @@
|
|||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
|
||||
declare var jsPDF : any;
|
||||
declare var html2canvas:any;
|
||||
declare var jsPDF: any;
|
||||
declare var html2canvas: any;
|
||||
import * as moment from 'moment';
|
||||
import { ContactService } from '../../contact.service';
|
||||
declare var $: any;
|
||||
declare var QRious:any;
|
||||
declare var QRious: any;
|
||||
@Component({
|
||||
selector: 'app-download-certificate',
|
||||
templateUrl: './download-certificate.component.html',
|
||||
styleUrls: ['./download-certificate.component.scss']
|
||||
})
|
||||
export class DownloadCertificateComponent implements OnInit {
|
||||
devName:any;
|
||||
img1='/assets/images/liveTrackIcons/noImageAvailableIcon.jpg'
|
||||
stamp='/assets/images/liveTrackIcons/Stamp.png'
|
||||
phNum:any;
|
||||
createdOn:any;
|
||||
expOn:any;
|
||||
supAdmin
|
||||
DealerObj = [];
|
||||
userObj = [];
|
||||
// iconType:any;
|
||||
simNum:any;
|
||||
todayODO:any;
|
||||
totalODO:any;
|
||||
useridd: any;
|
||||
emailId:any ="";
|
||||
costumers: any = [];
|
||||
deviceID: any;
|
||||
userName:any;
|
||||
devmodel:any;
|
||||
newUserArr=[];
|
||||
editTemplate:boolean=true;
|
||||
deletetemplate:boolean=false;
|
||||
devName: any;
|
||||
img1 = '/assets/images/liveTrackIcons/noImageAvailableIcon.jpg'
|
||||
stamp = '/assets/images/liveTrackIcons/Stamp.png'
|
||||
phNum: any;
|
||||
createdOn: any;
|
||||
expOn: any;
|
||||
supAdmin
|
||||
DealerObj = [];
|
||||
userObj = [];
|
||||
// iconType:any;
|
||||
simNum: any;
|
||||
todayODO: any;
|
||||
totalODO: any;
|
||||
useridd: any;
|
||||
emailId: any = "";
|
||||
costumers: any = [];
|
||||
deviceID: any;
|
||||
userName: any;
|
||||
devmodel: any;
|
||||
newUserArr = [];
|
||||
editTemplate: boolean = true;
|
||||
deletetemplate: boolean = false;
|
||||
orignalEmail: any;
|
||||
initialUser: any;
|
||||
ExportPdf: boolean;
|
||||
|
|
@ -67,14 +67,14 @@ deletetemplate:boolean=false;
|
|||
numberOfSOS: any;
|
||||
expiration_date: any;
|
||||
organisationFlag: any;
|
||||
distributerName:any;
|
||||
distSelect: any=[];
|
||||
distributerName: any;
|
||||
distSelect: any = [];
|
||||
superAdmin: any;
|
||||
isDealer: any;
|
||||
dealerId: any;
|
||||
lastPingOn:any
|
||||
lastDeviceTime:any
|
||||
deviceImage=[];
|
||||
lastPingOn: any
|
||||
lastDeviceTime: any
|
||||
deviceImage = [];
|
||||
dealerName
|
||||
installationDate;
|
||||
ICCICD
|
||||
|
|
@ -94,121 +94,122 @@ deletetemplate:boolean=false;
|
|||
img: HTMLImageElement;
|
||||
gnnsModule
|
||||
gsmModule
|
||||
constructor(public dialogRef: MdDialogRef<DownloadCertificateComponent>,private contactService:ContactService,
|
||||
@Inject(MD_DIALOG_DATA) public data: any ) {
|
||||
console.log(data);
|
||||
|
||||
}
|
||||
constructor(public dialogRef: MdDialogRef<DownloadCertificateComponent>, private contactService: ContactService,
|
||||
@Inject(MD_DIALOG_DATA) public data: any) {
|
||||
console.log(data);
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.org=JSON.parse(localStorage.getItem('ORG'))
|
||||
if(!this.data.deviceInfo.esim_validity){
|
||||
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.org = JSON.parse(localStorage.getItem('ORG'))
|
||||
if (!this.data.deviceInfo.esim_validity) {
|
||||
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;
|
||||
}
|
||||
}else{
|
||||
this.esim_validity=this.data.deviceInfo.esim_validity?moment(new Date(this.data.deviceInfo.esim_validity)).format("DD/MM/YYYY"):undefined
|
||||
} else {
|
||||
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.ChassisNo=this.data.deviceInfo.ChassisNo;
|
||||
this.lastDeviceTime=this.data.deviceInfo.last_device_time;
|
||||
this.numberOfSOS=this.data.deviceInfo.numberOfSOS
|
||||
this.kycApprovalDate=this.data.deviceInfo.kycApprovalDate
|
||||
this.model=this.data.deviceInfo.Model
|
||||
this.lastPingOn=this.data.deviceInfo.last_ping_on
|
||||
this.fitmentCertificateNo = this.data.deviceInfo.fitmentCertificateNo;
|
||||
this.ChassisNo = this.data.deviceInfo.ChassisNo;
|
||||
this.lastDeviceTime = this.data.deviceInfo.last_device_time;
|
||||
this.numberOfSOS = this.data.deviceInfo.numberOfSOS
|
||||
this.kycApprovalDate = this.data.deviceInfo.kycApprovalDate
|
||||
this.model = this.data.deviceInfo.Model
|
||||
this.lastPingOn = this.data.deviceInfo.last_ping_on
|
||||
this.devName = this.data.deviceInfo.Device_Name;
|
||||
this.devID = this.data.deviceInfo.Device_ID?this.data.deviceInfo.Device_ID:"";
|
||||
this.phNum =this.data.deviceInfo.contact_number;
|
||||
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.devID = this.data.deviceInfo.Device_ID ? this.data.deviceInfo.Device_ID : "";
|
||||
this.phNum = this.data.deviceInfo.contact_number;
|
||||
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.iconType=this.data.deviceInfo.iconType;
|
||||
this.simNum =this.data.deviceInfo.sim_number;
|
||||
this.simNum1 =this.data.deviceInfo.sim_number2;
|
||||
this.orignalEmail = this.data.deviceInfo.Email_ID
|
||||
this.simNum = this.data.deviceInfo.sim_number;
|
||||
this.simNum1 = this.data.deviceInfo.sim_number2;
|
||||
this.orignalEmail = this.data.deviceInfo.Email_ID
|
||||
this.emailId = this.data.deviceInfo.Email_ID;
|
||||
this.deviceImage=this.data.deviceInfo.deviceImage
|
||||
if(this.org.imageDoc && this.org.imageDoc.length>0){
|
||||
this.org.imageDoc='https://www.oneqlik.in' + this.org.imageDoc[0].substring(6)
|
||||
this.deviceImage = this.data.deviceInfo.deviceImage
|
||||
if (this.org.imageDoc && this.org.imageDoc.length > 0) {
|
||||
this.org.imageDoc = 'https://www.oneqlik.in' + this.org.imageDoc[0].substring(6)
|
||||
}
|
||||
|
||||
this.supAdmin=this.data.deviceInfo.supAdmin;
|
||||
if(this.supAdmin.imageDoc && this.supAdmin.imageDoc.length>0){
|
||||
this.supAdmin.imageDoc='https://www.oneqlik.in' + this.supAdmin.imageDoc[0].substring(6)
|
||||
|
||||
this.supAdmin = this.data.deviceInfo.supAdmin;
|
||||
if (this.supAdmin.imageDoc && this.supAdmin.imageDoc.length > 0) {
|
||||
this.supAdmin.imageDoc = 'https://www.oneqlik.in' + this.supAdmin.imageDoc[0].substring(6)
|
||||
}
|
||||
console.log(this.deviceImage);
|
||||
this.installationDate=this.data.deviceInfo.created_on
|
||||
this.todayODO=this.data.deviceInfo.today_odo;
|
||||
this.totalODO =this.data.deviceInfo.total_odo;
|
||||
console.log(this.deviceImage);
|
||||
this.installationDate = this.data.deviceInfo.created_on
|
||||
this.todayODO = this.data.deviceInfo.today_odo;
|
||||
this.totalODO = this.data.deviceInfo.total_odo;
|
||||
this.deviceID = this.data.deviceInfo.Device_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.userAddress = this.data.deviceInfo?this.data.deviceInfo.user.address:"";
|
||||
this.dealerName = this.data.deviceInfo.Dealer_name ;
|
||||
this.dealerId = this.data.deviceInfo.Dealer?this.data.deviceInfo.Dealer._id : "";
|
||||
console.log('this.dealerId',this.dealerId);
|
||||
this.userAddress = this.data.deviceInfo ? this.data.deviceInfo.user.address : "";
|
||||
this.dealerName = this.data.deviceInfo.Dealer_name;
|
||||
this.dealerId = this.data.deviceInfo.Dealer ? this.data.deviceInfo.Dealer._id : "";
|
||||
console.log('this.dealerId', this.dealerId);
|
||||
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.CID_No = this.data.deviceInfo.CID_No
|
||||
this.devicetype = this.data.deviceInfo.device_model?this.data.deviceInfo.device_model.device_type:"";
|
||||
if(this.devicetype=="Nippon-NVT-1820"){
|
||||
this.gsmModule='Telit GE910'
|
||||
}else if(this.devicetype=="Nippon-NVT-1820"){
|
||||
this.gnnsModule="Telit, Jupiter SL869T3-| Nav|C/IRNSS";
|
||||
this.gsmModule='Telit GE910'
|
||||
}else{
|
||||
this.gnnsModule="Quectel L89(GPS+IRNSS)";
|
||||
this.gsmModule='Quectel M66'
|
||||
this.devicetype = this.data.deviceInfo.device_model ? this.data.deviceInfo.device_model.device_type : "";
|
||||
if (this.devicetype == "Nippon-NVT-1820") {
|
||||
this.gsmModule = 'Telit GE910'
|
||||
} else if (this.devicetype == "Nippon-NVT-1820") {
|
||||
this.gnnsModule = "Telit, Jupiter SL869T3-| Nav|C/IRNSS";
|
||||
this.gsmModule = 'Telit GE910'
|
||||
} else {
|
||||
this.gnnsModule = "Quectel L89(GPS+IRNSS)";
|
||||
this.gsmModule = 'Quectel M66'
|
||||
}
|
||||
|
||||
for(var i=0;i<this.deviceImage.length;i++){
|
||||
|
||||
this.deviceImage[i] = this.deviceImage[i] && this.deviceImage[i]!=""?'http://nipponsecura.in' + this.deviceImage[i].substring(6):''
|
||||
|
||||
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.ICCICD = this.data.deviceInfo.IccidNo;
|
||||
this.IMSI = this.data.deviceInfo.IMSI;
|
||||
this.uniqueID = this.data.deviceInfo.uniqueID;
|
||||
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.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.engineNo = this.data.deviceInfo.engineNo;
|
||||
this.typeOfVehicle = this.data.deviceInfo.typeOfVehicle;
|
||||
this.manufacturingCompany = this.data.deviceInfo.manufacturingCompany;
|
||||
this.vahanID= this.data.deviceInfo.vahanID?this.data.deviceInfo.vahanID:'';
|
||||
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.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.longitude = this.data.deviceInfo.last_loc?this.data.deviceInfo.last_loc.coordinates[1]:"";
|
||||
this.getLocationLink()
|
||||
var that=this
|
||||
this.myImage = new Image();
|
||||
this.myImage.src = this.deviceImage[0]?this.deviceImage[0]:this.img1;
|
||||
this.myImage.crossOrigin="anonymous";
|
||||
this.vahanID = this.data.deviceInfo.vahanID ? this.data.deviceInfo.vahanID : '';
|
||||
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.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.longitude = this.data.deviceInfo.last_loc ? this.data.deviceInfo.last_loc.coordinates[1] : "";
|
||||
this.getLocationLink()
|
||||
var that = this
|
||||
this.myImage = new Image();
|
||||
this.myImage.src = this.deviceImage[0] ? this.deviceImage[0] : this.img1;
|
||||
this.myImage.crossOrigin = "anonymous";
|
||||
|
||||
this.myImage1 = new Image();
|
||||
this.myImage1.src = this.deviceImage[1]?this.deviceImage[1]:this.img1;
|
||||
this.myImage1.crossOrigin="anonymous";
|
||||
this.myImage1.src = this.deviceImage[1] ? this.deviceImage[1] : this.img1;
|
||||
this.myImage1.crossOrigin = "anonymous";
|
||||
|
||||
this.myImage2 = new Image();
|
||||
this.myImage2.src = this.deviceImage[2]?this.deviceImage[2]:this.img1;
|
||||
this.myImage2.crossOrigin="anonymous";
|
||||
this.myImage2.src = this.deviceImage[2] ? this.deviceImage[2] : this.img1;
|
||||
this.myImage2.crossOrigin = "anonymous";
|
||||
|
||||
this.stamp1=new Image();
|
||||
this.stamp1.src=this.stamp;
|
||||
this.stamp1.crossOrigin="anonymous";
|
||||
this.stamp1 = new Image();
|
||||
this.stamp1.src = this.stamp;
|
||||
this.stamp1.crossOrigin = "anonymous";
|
||||
|
||||
this.img = new Image();
|
||||
this.img.src = this.org.imageDoc?this.org.imageDoc:'';
|
||||
this.img.crossOrigin="anonymous";
|
||||
this.img.src = this.org.imageDoc ? this.org.imageDoc : '';
|
||||
this.img.crossOrigin = "anonymous";
|
||||
// one()
|
||||
// function one(){
|
||||
// stamp.onload = function(){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// two()
|
||||
// doc.addImage(stamp , 'png', 15,210,30,30);
|
||||
// };
|
||||
|
|
@ -227,7 +228,7 @@ deletetemplate:boolean=false;
|
|||
// myImage.onload = function(){
|
||||
// console.log("1");
|
||||
// doc.addImage(myImage , 'png', 40, 170, 30, 20);
|
||||
|
||||
|
||||
// };
|
||||
// }
|
||||
|
||||
|
|
@ -242,11 +243,11 @@ deletetemplate:boolean=false;
|
|||
// function five(){
|
||||
// myImage2.onload = function(){
|
||||
// console.log("3");
|
||||
|
||||
|
||||
// doc.addImage(myImage2 , 'png', 120, 170, 30, 20);
|
||||
// doc.save(name);
|
||||
|
||||
|
||||
|
||||
|
||||
// };
|
||||
// }
|
||||
|
||||
|
|
@ -264,70 +265,73 @@ deletetemplate:boolean=false;
|
|||
// img.onload = function(){
|
||||
// console.log("-1");
|
||||
// doc.addImage(img , 'png', 15, 9,50,40)
|
||||
|
||||
|
||||
// };doc.addImage(myImage , 'png', 40, 170, 30, 20);
|
||||
|
||||
function f1() {
|
||||
return new Promise((resolve, reject) => {
|
||||
that.myImage.onload = function(){
|
||||
console.log("1");
|
||||
};
|
||||
// var isLoaded = this.myImage.complete && this.myImage.naturalHeight !== 0;
|
||||
// if(isLoaded)
|
||||
resolve('');
|
||||
});
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
that.myImage.onload = function () {
|
||||
console.log("1");
|
||||
};
|
||||
// var isLoaded = this.myImage.complete && this.myImage.naturalHeight !== 0;
|
||||
// if(isLoaded)
|
||||
resolve('');
|
||||
});
|
||||
}
|
||||
|
||||
function f3() {
|
||||
that.myImage2.onload = function () {
|
||||
console.log("3");
|
||||
|
||||
function f3(){
|
||||
that.myImage2.onload = function(){
|
||||
console.log("3");
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function f2() {
|
||||
return new Promise((resolve, reject) => {
|
||||
that.myImage1.onload = function(){
|
||||
console.log("2");
|
||||
// doc.addImage(myImage1 , 'png', 80, 170, 30, 20);
|
||||
// if(that.deviceImage.length==2){
|
||||
// doc.save(name);
|
||||
// }
|
||||
function f2() {
|
||||
return new Promise((resolve, reject) => {
|
||||
that.myImage1.onload = function () {
|
||||
console.log("2");
|
||||
// doc.addImage(myImage1 , 'png', 80, 170, 30, 20);
|
||||
// if(that.deviceImage.length==2){
|
||||
// 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)
|
||||
resolve('');
|
||||
|
||||
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);
|
||||
})
|
||||
|
||||
}
|
||||
f1().then(res => f2().then(res1=>f3()));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
getLocationLink(){
|
||||
var data = {
|
||||
id: this.data.deviceInfo._id,
|
||||
imei: this.data.deviceInfo.Device_ID,
|
||||
sh: this.data.deviceInfo.user._id,
|
||||
ttl: 15*60
|
||||
};
|
||||
qrCodeGenerator() {
|
||||
|
||||
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();
|
||||
qr.set({
|
||||
// background: 'green',
|
||||
|
|
@ -339,16 +343,16 @@ f1().then(res => f2().then(res1=>f3()));
|
|||
size: 500,
|
||||
value: this.link
|
||||
});
|
||||
|
||||
|
||||
this.imgURL= qr.toDataURL();
|
||||
|
||||
|
||||
|
||||
|
||||
this.imgURL = qr.toDataURL();
|
||||
|
||||
|
||||
|
||||
}
|
||||
exportAsPdf() {
|
||||
var that=this
|
||||
var name="Installation Certificate "+this.devName?this.devName:"Test"+".pdf"
|
||||
var that = this
|
||||
var name = "Installation Certificate " + this.devName ? this.devName : "Test" + ".pdf"
|
||||
console.log(this.imgURL);
|
||||
var doc = new jsPDF();
|
||||
var specialElementHandlers = {
|
||||
|
|
@ -356,91 +360,93 @@ f1().then(res => f2().then(res1=>f3()));
|
|||
return true;
|
||||
}
|
||||
};
|
||||
var stamp=new Image();
|
||||
stamp.src=that.stamp;
|
||||
stamp.crossOrigin="anonymous";
|
||||
// stamp.onload = function(){
|
||||
console.log("0");
|
||||
doc.addImage(that.stamp1 , 'png', 15,210,30,30)
|
||||
// };
|
||||
var stamp = new Image();
|
||||
stamp.src = that.stamp;
|
||||
stamp.crossOrigin = "anonymous";
|
||||
// stamp.onload = function(){
|
||||
console.log("0");
|
||||
doc.setPage(1);
|
||||
doc.addImage(that.stamp1, 'png', 15, 210, 30, 30)
|
||||
// };
|
||||
var img = new Image();
|
||||
img.src = this.org.imageDoc?this.org.imageDoc:'';
|
||||
img.crossOrigin="anonymous";
|
||||
// if(this.org.imageDoc){
|
||||
// img.onload = function(){
|
||||
console.log("-1");
|
||||
doc.addImage(that.img , 'png', 15, 9,50,40)
|
||||
|
||||
// };
|
||||
img.src = this.org.imageDoc ? this.org.imageDoc : '';
|
||||
img.crossOrigin = "anonymous";
|
||||
// if(this.org.imageDoc){
|
||||
// img.onload = function(){
|
||||
console.log("-1");
|
||||
doc.setPage(1);
|
||||
doc.addImage(that.img, 'png', 15, 9, 50, 40)
|
||||
|
||||
// };
|
||||
// doc.text("Customer Copy", 110, 12);
|
||||
doc.setFontSize(3);
|
||||
doc.autoTable({
|
||||
theme: 'plain',
|
||||
html: '#testPdf',
|
||||
|
||||
tableWidth: 'auto',
|
||||
html: '#testPdf',
|
||||
|
||||
tableWidth: 'auto',
|
||||
|
||||
// styles : {
|
||||
// cellWidth : 10,
|
||||
// overflow: "linebreak"
|
||||
// },
|
||||
willDrawCell: data => {
|
||||
if(data.row.index === 0){
|
||||
data.row.height = 30;
|
||||
doc.setFontStyle('bold');
|
||||
if (data.row.index === 0) {
|
||||
data.row.height = 30;
|
||||
doc.setFontStyle('bold');
|
||||
data.row.cells[0].styles.halign = 'center';
|
||||
data.row.cells[0].styles.fontSize = 25;
|
||||
data.row.cells[0].styles.overflow= "linebreak"
|
||||
data.row.cells[0].styles.lineHeight= "2.5";
|
||||
data.row.cells[0].styles.overflow = "linebreak"
|
||||
data.row.cells[0].styles.lineHeight = "1.5";
|
||||
// doc.setLineHeightFactor()
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// doc.addImage(this.supAdmin.imageDoc,'JPEG', 140, 9,40,40);
|
||||
|
||||
doc.addImage(this.imgURL,'JPEG',150, 9,50,40);
|
||||
|
||||
}
|
||||
if(data.row.index ===1 ){
|
||||
// data.row.cells[0].styles.halign = 'center';
|
||||
doc.setPage(1);
|
||||
doc.addImage(this.imgURL, 'JPEG', 150, 9, 50, 40);
|
||||
|
||||
}
|
||||
if (data.row.index === 1) {
|
||||
// data.row.cells[0].styles.halign = 'center';
|
||||
doc.halign = 'center';
|
||||
doc.setFontStyle('bold');
|
||||
doc.cellPadding=60
|
||||
doc.setFontStyle('bold');
|
||||
doc.cellPadding = 50
|
||||
}
|
||||
|
||||
if(data.row.index ===3 ){
|
||||
// data.row.cells[0].styles.halign = 'center';
|
||||
if (data.row.index === 3) {
|
||||
// data.row.cells[0].styles.halign = 'center';
|
||||
doc.halign = 'center';
|
||||
|
||||
|
||||
}
|
||||
if( data.row.index ===6){
|
||||
// data.row.cells[0].styles.halign = 'center';
|
||||
if (data.row.index === 6) {
|
||||
// data.row.cells[0].styles.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)){
|
||||
doc.setFontStyle('bold');
|
||||
|
||||
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');
|
||||
|
||||
}
|
||||
if(data.row.index ===5){
|
||||
data.row.height = 30;
|
||||
if (data.row.index === 5) {
|
||||
data.row.height = 25;
|
||||
// data.row.cells[0].styles.halign = 'center';
|
||||
// doc.halign = 'center';
|
||||
}
|
||||
|
||||
if(data.row.index ===6){
|
||||
data.row.height = 45;
|
||||
if (data.row.index === 6) {
|
||||
data.row.height = 40;
|
||||
// data.row.cells[0].styles.halign = 'center';
|
||||
// doc.halign = 'center';
|
||||
}
|
||||
doc.setLineWidth(1);
|
||||
doc.rect(7, 7, 195, 285);
|
||||
|
||||
doc.setLineWidth(1);
|
||||
doc.rect(7, 7, 195, 285);
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// var myImage = new Image();
|
||||
// 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.crossOrigin="anonymous";
|
||||
function f1() {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("1");
|
||||
doc.addImage(that.myImage , 'png', 40, 170, 30, 20);
|
||||
resolve('');
|
||||
})
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("1");
|
||||
doc.addImage(that.myImage, 'png', 40, 170, 30, 20);
|
||||
resolve('');
|
||||
})
|
||||
}
|
||||
|
||||
function f2() {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("2");
|
||||
doc.addImage(that.myImage1 , 'png', 80, 170, 30, 20);
|
||||
resolve('');
|
||||
})
|
||||
function f2() {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("2");
|
||||
doc.addImage(that.myImage1, 'png', 80, 170, 30, 20);
|
||||
resolve('');
|
||||
})
|
||||
}
|
||||
|
||||
function f3(){
|
||||
// myImage2.onload = function(){
|
||||
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() {
|
||||
// myImage2.onload = function(){
|
||||
console.log("3");
|
||||
|
||||
// function f3(){
|
||||
// myImage2.onload = function(){
|
||||
// console.log("3");
|
||||
|
||||
// doc.addImage(myImage2 , 'png', 120, 170, 30, 20);
|
||||
// doc.save(name);
|
||||
|
||||
|
||||
// };
|
||||
// }
|
||||
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(){
|
||||
// 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) {
|
||||
console.log(url);
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onload = function () {
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = function () {
|
||||
callback(reader.result);
|
||||
}
|
||||
reader.readAsDataURL(xhr.response);
|
||||
};
|
||||
xhr.open('GET', url);
|
||||
xhr.responseType = 'blob';
|
||||
xhr.send();
|
||||
}
|
||||
toDataURL(url, callback) {
|
||||
console.log(url);
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onload = function () {
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = function () {
|
||||
callback(reader.result);
|
||||
}
|
||||
reader.readAsDataURL(xhr.response);
|
||||
};
|
||||
xhr.open('GET', url);
|
||||
xhr.responseType = 'blob';
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,49 +1,49 @@
|
|||
#toast {
|
||||
visibility: hidden;
|
||||
max-width: 250px;
|
||||
height: 50px;
|
||||
/*margin-left: -125px;*/
|
||||
margin: auto;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 60%;
|
||||
right: 0;
|
||||
bottom: 80%;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#toast #img {
|
||||
width: 250px;
|
||||
height: 50px;
|
||||
|
||||
float: left;
|
||||
|
||||
padding-top: 16px;
|
||||
padding-bottom: 16px;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
background-color: #111;
|
||||
color: #fff;
|
||||
}
|
||||
#toast #desc {
|
||||
color: #fff;
|
||||
|
||||
padding: 16px;
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#toast.show {
|
||||
visibility: visible;
|
||||
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
|
||||
fadeout 0.5s 2.5s;
|
||||
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
|
||||
fadeout 0.5s 4.5s;
|
||||
}
|
||||
#toast {
|
||||
visibility: hidden;
|
||||
max-width: 250px;
|
||||
height: 50px;
|
||||
/*margin-left: -125px;*/
|
||||
margin: auto;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 60%;
|
||||
right: 0;
|
||||
bottom: 80%;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#toast #img {
|
||||
width: 250px;
|
||||
height: 50px;
|
||||
|
||||
float: left;
|
||||
|
||||
padding-top: 16px;
|
||||
padding-bottom: 16px;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
background-color: #111;
|
||||
color: #fff;
|
||||
}
|
||||
#toast #desc {
|
||||
color: #fff;
|
||||
|
||||
padding: 16px;
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#toast.show {
|
||||
visibility: visible;
|
||||
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s,
|
||||
fadeout 0.5s 2.5s;
|
||||
animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s,
|
||||
fadeout 0.5s 4.5s;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>
|
||||
Update Device
|
||||
Update Device
|
||||
<button type="button" class="close pull-right" (click)="back()">
|
||||
<i class="fas fa-arrow-circle-left"></i>
|
||||
</button>
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
</div>
|
||||
<div class="form-row">
|
||||
<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
|
||||
formControlName="dealerFollowup"
|
||||
type="text"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.topDiv {
|
||||
padding-top: 59px;
|
||||
background: whitesmoke;
|
||||
height: 100vh;
|
||||
padding-left: 4px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
.topDiv {
|
||||
padding-top: 59px;
|
||||
background: whitesmoke;
|
||||
height: 100vh;
|
||||
padding-left: 4px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ export class NewEditDeviceComponent implements OnInit {
|
|||
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 lname=this.deviceData.user?this.deviceData.user.last_name?this.deviceData.user.last_name:'':""
|
||||
|
|
@ -217,7 +218,7 @@ export class NewEditDeviceComponent implements OnInit {
|
|||
SMSPlan:[''],
|
||||
city:[this.deviceData.transportOfficeCity?this.deviceData.transportOfficeCity:''],
|
||||
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):''],
|
||||
model:[this.deviceData.Model?this.deviceData.Model:''],
|
||||
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.loadropdown()
|
||||
this.loadropdown()
|
||||
this.getDeviceModel();
|
||||
this.getvehDetail()
|
||||
this.getUserSetting(this.userId);
|
||||
|
|
@ -363,7 +364,12 @@ export class NewEditDeviceComponent implements OnInit {
|
|||
if(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);
|
||||
|
||||
this.contactService.post('/users/editUserDetails',data).subscribe((res:any)=>{
|
||||
|
|
@ -412,7 +418,7 @@ export class NewEditDeviceComponent implements OnInit {
|
|||
bussinessType:1
|
||||
}
|
||||
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') ) {
|
||||
newDevice['Dealer'] = this.DealerId
|
||||
}
|
||||
|
|
@ -463,6 +469,9 @@ export class NewEditDeviceComponent implements OnInit {
|
|||
|
||||
if(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){
|
||||
newDevice['vehicleCategory'] = this.deviceForm.value.vehicleCategory;
|
||||
|
|
@ -498,8 +507,14 @@ export class NewEditDeviceComponent implements OnInit {
|
|||
this.contactService.editdevice(newDevice)
|
||||
.subscribe((device) => {
|
||||
window.localStorage['DataUpdate'] = 'True';
|
||||
|
||||
this.router.navigateByUrl("dashboard");
|
||||
localStorage.getItem('KycApprovalRedirect')
|
||||
if (localStorage.getItem('KycApprovalRedirect')) {
|
||||
localStorage.removeItem('KycApprovalRedirect')
|
||||
this.router.navigateByUrl("KycApproval")
|
||||
} else {
|
||||
|
||||
this.router.navigateByUrl("dashboard");
|
||||
}
|
||||
}
|
||||
// this.Load = false
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue