AutoLogin Code committed : ps
This commit is contained in:
parent
84c7521b13
commit
c9ce4038e7
@ -1953,7 +1953,7 @@ this.proceedonChangeProperty(modified)
|
||||
section_data.is_completed=true
|
||||
|
||||
let login_type_id = parseInt(localStorage.getItem('login_type_id')); // 1 na auto-login , 0 na manual-login
|
||||
if(params.status=="COMPLETED" && login_type_id == 0){
|
||||
if(params.status=="COMPLETED" && login_type_id == 1){
|
||||
let completedPD = localStorage.getItem('completedPD');
|
||||
completedPD = JSON.parse(completedPD)
|
||||
let applicant_id = completedPD['applicant_id']
|
||||
@ -2291,19 +2291,20 @@ this.proceedonChangeProperty(modified)
|
||||
}
|
||||
|
||||
redirectSMC(applicant_id){
|
||||
console.log("calling SMC redirect",environment.authorization);
|
||||
// window.location.href=data.records;
|
||||
let email = localStorage.getItem('officer_mail_id');
|
||||
// http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=4231&email=aniltiwari@smcfinance.com
|
||||
if(environment.authorization == 'TnAwuc64pVpcB9xf'){
|
||||
let salesapp_link ="https://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email=aniltiwari@smcfinance.com";
|
||||
console.log('salesapp_link = ',salesapp_link);
|
||||
let salesapp_url = salesapp_link;
|
||||
window.open(salesapp_url);
|
||||
|
||||
let salesapp_link ="http://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email=aniltiwari@smcfinance.com";
|
||||
console.log('2p salesapp_link = ',salesapp_link);
|
||||
window.open(salesapp_link, '_blank');
|
||||
}else if(environment.authorization == 'sparqvenba2018'){
|
||||
let salesapp_link ="http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email=aniltiwari@smcfinance.com";
|
||||
console.log('salesapp_link = ',salesapp_link);
|
||||
let salesapp_url = salesapp_link;
|
||||
window.open(salesapp_url);
|
||||
console.log('2t salesapp_link = ',salesapp_link);
|
||||
window.open(salesapp_link, '_blank');
|
||||
// this.router.navigate([salesapp_link]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,19 +243,18 @@
|
||||
matTooltip="View" matTooltipPosition="top" ><mat-icon>visibility</mat-icon></button>
|
||||
</div>
|
||||
<div *ngIf="roleID != 30">
|
||||
<div *ngIf="details.status == 'STARTED'; else elseBlock">
|
||||
<button [disabled]="details.status === 'COMPLETED'" mat-button mat-icon-button class="hover-icon" type="button" color="primary" (click)="editForm(details)"
|
||||
matTooltip="View" matTooltipPosition="top"><mat-icon>visibility</mat-icon></button>
|
||||
</div>
|
||||
<ng-template #elseBlock>
|
||||
<button [style.visibility]="(loginTypeId=='1') ? 'visible' : 'hidden'" [disabled]="details.status !== 'COMPLETED'"
|
||||
mat-button mat-icon-button class="hover-icon" type="button" color="primary"
|
||||
matTooltip="Redirected to Sales APP" matTooltipPosition="above" (click)="redirected(details)"><mat-icon>launch</mat-icon></button>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
||||
<button mat-button mat-icon-button (click)="newPortal()" type="button" matTooltip="link" matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||
<div *ngIf="loginTypeId=='1'; else elseBlock">
|
||||
<button mat-button mat-icon-button class="hover-icon" type="button" color="primary"
|
||||
matTooltip="Redirected to Sales APP" matTooltipPosition="above" (click)="redirected(details)"><mat-icon>link</mat-icon></button>
|
||||
</div>
|
||||
<ng-template #elseBlock>
|
||||
<button mat-button mat-icon-button (click)="newPortal()" type="button" matTooltip="link" matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||
</ng-template>
|
||||
</div>
|
||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
||||
<button [disabled]="details.status !== 'COMPLETED'" mat-button mat-icon-button class=" hover-icon" type="button" color="primary" (click)="uploadDatatoCET(details.sales_pd_id)"
|
||||
|
||||
@ -13,20 +13,20 @@ import { environment } from 'environments/environment';
|
||||
templateUrl: './sales-pd.component.html',
|
||||
styleUrls: ['./sales-pd.component.scss']
|
||||
})
|
||||
export class SalesPdComponent implements OnInit {
|
||||
export class SalesPdComponent implements OnInit {
|
||||
public dataLengthTab4: number;
|
||||
public dataSourceTab4 = new MatTableDataSource();
|
||||
|
||||
displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Officer Name','status','Create On','Action'];
|
||||
|
||||
displayedColumns = ['SalesPdId', 'SalesPdSno', 'Applicant Name', 'Short Name', 'Officer Name', 'status', 'Create On', 'Action'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
// data source variable details
|
||||
salesPdData:any[] = [];
|
||||
salesPdpdf:any[] = [];
|
||||
// data source variable details
|
||||
salesPdData: any[] = [];
|
||||
salesPdpdf: any[] = [];
|
||||
|
||||
errorMessage:any[]=[];
|
||||
errorMessage: any[] = [];
|
||||
recordStatus: boolean;
|
||||
|
||||
xpandStatus: boolean = false;
|
||||
@ -36,381 +36,381 @@ export class SalesPdComponent implements OnInit {
|
||||
pageIndex = 0;
|
||||
pageSize = 10;
|
||||
pageEvent: PageEvent;
|
||||
todaydate:Date = new Date();
|
||||
todaydate: Date = new Date();
|
||||
filter_drop_down_data: { product_ids: any[]; lender_ids: any[]; pd_status: any[]; };
|
||||
limitMsg: boolean = false;
|
||||
common: any;
|
||||
user_type: string ='';
|
||||
is_sales_login:boolean = false
|
||||
user_type: string = '';
|
||||
is_sales_login: boolean = false
|
||||
public finallink: any;
|
||||
roleID: any;
|
||||
loginTypeId : any;
|
||||
loginTypeId: any;
|
||||
|
||||
constructor(private loaderService:LoaderService,private constantProvider:ConstantsProvider,private dialog:MatDialog,private route: ActivatedRoute, private router: Router,private _creditPdService:ApiServiceService,private SalesPDService:SalesPdService) {
|
||||
constructor(private loaderService: LoaderService, private constantProvider: ConstantsProvider, private dialog: MatDialog, private route: ActivatedRoute, private router: Router, private _creditPdService: ApiServiceService, private SalesPDService: SalesPdService) {
|
||||
|
||||
// this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
||||
// this.common = this.common.count+' '+this.common.factor
|
||||
// this.user_type = localStorage.getItem('len_user_role')
|
||||
this.loginTypeId = localStorage.getItem('login_type_id');
|
||||
setTimeout(()=>{
|
||||
let userDetails = localStorage.getItem('user_details');
|
||||
console.log('userdetails');
|
||||
console.log(userDetails);
|
||||
|
||||
let role= this.constantProvider.takeDecisionRouting(JSON.parse(userDetails))
|
||||
console.log(role)
|
||||
if(role == 'sales'){
|
||||
this.is_sales_login = true
|
||||
this.getListofPD()
|
||||
}
|
||||
else {
|
||||
this.is_sales_login = false
|
||||
this.getListofPD()
|
||||
}
|
||||
},4000)
|
||||
setTimeout(() => {
|
||||
let userDetails = localStorage.getItem('user_details');
|
||||
console.log('userdetails');
|
||||
console.log(userDetails);
|
||||
|
||||
setTimeout(()=>{
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings'))
|
||||
if(this.common){
|
||||
this.common = this.common.default_pd_list_count;
|
||||
this.common = this.common.count+' '+this.common.factor
|
||||
let role = this.constantProvider.takeDecisionRouting(JSON.parse(userDetails))
|
||||
console.log(role)
|
||||
if (role == 'sales') {
|
||||
this.is_sales_login = true
|
||||
this.getListofPD()
|
||||
}
|
||||
},300)
|
||||
else {
|
||||
this.is_sales_login = false
|
||||
this.getListofPD()
|
||||
}
|
||||
}, 4000)
|
||||
|
||||
setTimeout(() => {
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings'))
|
||||
if (this.common) {
|
||||
this.common = this.common.default_pd_list_count;
|
||||
this.common = this.common.count + ' ' + this.common.factor
|
||||
}
|
||||
}, 300)
|
||||
// this.cameraProvider.checkGPSPermission();
|
||||
// this.salesPDService.clearLocalData();
|
||||
// setTimeout(()=>{
|
||||
// this.getListofPD()
|
||||
// },100)
|
||||
|
||||
|
||||
}
|
||||
// this.salesPDService.clearLocalData();
|
||||
// setTimeout(()=>{
|
||||
// this.getListofPD()
|
||||
// },100)
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// this.getListofPD();
|
||||
// this.salesPDpdf();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uploadDatatoCET(salespdid) {
|
||||
this.SalesPDService.uploadSalesDatatoCET(salespdid).subscribe(res=>{
|
||||
if(res['dataStatus']){
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user=(JSON.parse(user1))
|
||||
this.roleID = localStorage.getItem('user_role')
|
||||
alert(res['msg']);
|
||||
}else{ alert(res['msg']); }
|
||||
},error => {
|
||||
this.errorMessage.push(error);
|
||||
alert(error.html_format);
|
||||
});
|
||||
this.SalesPDService.uploadSalesDatatoCET(salespdid).subscribe(res => {
|
||||
if (res['dataStatus']) {
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user = (JSON.parse(user1))
|
||||
this.roleID = localStorage.getItem('user_role')
|
||||
alert(res['msg']);
|
||||
} else { alert(res['msg']); }
|
||||
}, error => {
|
||||
this.errorMessage.push(error);
|
||||
alert(error.html_format);
|
||||
});
|
||||
}
|
||||
getListofPD() {
|
||||
// this.SalesPDService.getSalesPDList()
|
||||
// .subscribe(
|
||||
// data => {
|
||||
// if (data.status == 200) {
|
||||
this.SalesPDService.getSalesPDList(this.is_sales_login).subscribe(res=>{
|
||||
if(res['dataStatus']){
|
||||
this.SalesPDService.getSalesPDList(this.is_sales_login).subscribe(res => {
|
||||
if (res['dataStatus']) {
|
||||
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user=(JSON.parse(user1))
|
||||
this.roleID = localStorage.getItem('user_role')
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user = (JSON.parse(user1))
|
||||
this.roleID = localStorage.getItem('user_role')
|
||||
|
||||
this.salesPdData = res['records'];
|
||||
this.dataLengthTab4 = res['records'].length;
|
||||
this.dataSourceTab4.data = this.salesPdData;
|
||||
this.recordStatus=false
|
||||
this.limitMsg = true
|
||||
if(this.salesPdData.length > 0){
|
||||
let products=[]
|
||||
let lenders=[]
|
||||
let pd_status=[]
|
||||
this.salesPdData.map(val=>{
|
||||
this.salesPdData = res['records'];
|
||||
this.dataLengthTab4 = res['records'].length;
|
||||
this.dataSourceTab4.data = this.salesPdData;
|
||||
this.recordStatus = false
|
||||
this.limitMsg = true
|
||||
if (this.salesPdData.length > 0) {
|
||||
let products = []
|
||||
let lenders = []
|
||||
let pd_status = []
|
||||
this.salesPdData.map(val => {
|
||||
|
||||
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
||||
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
console.log(environment)
|
||||
let link
|
||||
if(environment.authorization == 'TnAwuc64pVpcB9xf'){
|
||||
console.log('293')
|
||||
link ="https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}else if(environment.authorization == 'sparqvenba2018'){
|
||||
console.log('296')
|
||||
link ="http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}
|
||||
|
||||
var string:any = {
|
||||
EmpName:user.user_first_name,
|
||||
EmpCode:"",
|
||||
PDID:val.sales_pd_sno,
|
||||
//PD_NO:val.sales_pd_sno,
|
||||
}
|
||||
//console.log(string);
|
||||
//var encodedString = btoa(JSON.stringify(string));
|
||||
//console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||
//var decodedString = atob(encodedString);
|
||||
//console.log("decode",JSON.parse(decodedString));
|
||||
//let email="mwisesales1@sine.com";
|
||||
let PDID=val.sales_pd_sno;
|
||||
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||
this.finallink=link+"&PDID="+PDID+"&Email="+user.email;
|
||||
|
||||
console.log('this.finallink')
|
||||
console.log(this.finallink);
|
||||
val.link = this.finallink;
|
||||
|
||||
if(products.length > 0 ){
|
||||
if(products.filter(pro=>pro == val.product_id).length == 0 ){
|
||||
products.push(val.product_id)
|
||||
}
|
||||
}
|
||||
else{
|
||||
products.push(val.product_id)
|
||||
}
|
||||
if(lenders.length > 0 ){
|
||||
if(lenders.filter(pro=>pro == val.lender_id).length == 0 ){
|
||||
lenders.push(val.lender_id)
|
||||
}
|
||||
}
|
||||
else{
|
||||
lenders.push(val.lender_id)
|
||||
}
|
||||
if(pd_status.length > 0 ){
|
||||
if(pd_status.filter(pro=>pro == val.status).length == 0 ){
|
||||
pd_status.push(val.status)
|
||||
}
|
||||
}
|
||||
else{
|
||||
pd_status.push(val.status)
|
||||
}
|
||||
})
|
||||
this.filter_drop_down_data={product_ids:products,lender_ids:lenders,pd_status:pd_status}
|
||||
// console.log(this.filter_drop_down_data);
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.salesPdData=[];
|
||||
this.dataLengthTab4= null;
|
||||
this.recordStatus=true;
|
||||
this.limitMsg = false
|
||||
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
||||
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
console.log(environment)
|
||||
let link
|
||||
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||
console.log('293')
|
||||
link = "https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
} else if (environment.authorization == 'sparqvenba2018') {
|
||||
console.log('296')
|
||||
link = "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}
|
||||
|
||||
var string: any = {
|
||||
EmpName: user.user_first_name,
|
||||
EmpCode: "",
|
||||
PDID: val.sales_pd_sno,
|
||||
//PD_NO:val.sales_pd_sno,
|
||||
}
|
||||
//console.log(string);
|
||||
//var encodedString = btoa(JSON.stringify(string));
|
||||
//console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||
//var decodedString = atob(encodedString);
|
||||
//console.log("decode",JSON.parse(decodedString));
|
||||
//let email="mwisesales1@sine.com";
|
||||
let PDID = val.sales_pd_sno;
|
||||
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||
this.finallink = link + "&PDID=" + PDID + "&Email=" + user.email;
|
||||
|
||||
console.log('this.finallink')
|
||||
console.log(this.finallink);
|
||||
val.link = this.finallink;
|
||||
|
||||
if (products.length > 0) {
|
||||
if (products.filter(pro => pro == val.product_id).length == 0) {
|
||||
products.push(val.product_id)
|
||||
}
|
||||
}
|
||||
else {
|
||||
products.push(val.product_id)
|
||||
}
|
||||
if (lenders.length > 0) {
|
||||
if (lenders.filter(pro => pro == val.lender_id).length == 0) {
|
||||
lenders.push(val.lender_id)
|
||||
}
|
||||
}
|
||||
else {
|
||||
lenders.push(val.lender_id)
|
||||
}
|
||||
if (pd_status.length > 0) {
|
||||
if (pd_status.filter(pro => pro == val.status).length == 0) {
|
||||
pd_status.push(val.status)
|
||||
}
|
||||
}
|
||||
else {
|
||||
pd_status.push(val.status)
|
||||
}
|
||||
})
|
||||
this.filter_drop_down_data = { product_ids: products, lender_ids: lenders, pd_status: pd_status }
|
||||
// console.log(this.filter_drop_down_data);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.salesPdData = [];
|
||||
this.dataLengthTab4 = null;
|
||||
this.recordStatus = true;
|
||||
this.limitMsg = false
|
||||
}
|
||||
}
|
||||
// , error => this.errorMessage = <any> error);
|
||||
,error => {
|
||||
, error => {
|
||||
this.errorMessage.push(error);
|
||||
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||
alert(error.html_format);
|
||||
});
|
||||
});
|
||||
}
|
||||
// editForm(value_obj){
|
||||
// alert('abc');
|
||||
// console.log('value');
|
||||
// console.log(value_obj);
|
||||
// // let product= localStorage.getItem('product_id_salesPD')
|
||||
// // storing the sales_pd_id and product id in local storagey
|
||||
// let primary_key= 'sales_pd_id'
|
||||
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||
// primary_key = 'local_pd_id'
|
||||
// }
|
||||
// // this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||
// //this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||
// // localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||
// if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
||||
// value_obj.sales_pd_type = '1'
|
||||
// }
|
||||
// console.log('value');
|
||||
// console.log(value_obj);
|
||||
// this.router.navigate(['../sectionlist'])
|
||||
// // localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
||||
// //this.navigate.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
|
||||
// // })
|
||||
// //})
|
||||
// }
|
||||
// editForm(value_obj){
|
||||
// alert('abc');
|
||||
// console.log('value');
|
||||
// console.log(value_obj);
|
||||
// // let product= localStorage.getItem('product_id_salesPD')
|
||||
// // storing the sales_pd_id and product id in local storagey
|
||||
// let primary_key= 'sales_pd_id'
|
||||
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||
// primary_key = 'local_pd_id'
|
||||
// }
|
||||
// // this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||
// //this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||
// // localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||
// if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
||||
// value_obj.sales_pd_type = '1'
|
||||
// }
|
||||
// console.log('value');
|
||||
// console.log(value_obj);
|
||||
// this.router.navigate(['../sectionlist'])
|
||||
// // localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
||||
// //this.navigate.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
|
||||
// // })
|
||||
// //})
|
||||
// }
|
||||
|
||||
// editForm2(value_obj){
|
||||
// // let product= localStorage.getItem('product_id_salesPD')
|
||||
// // storing the sales_pd_id and product id in local storagey
|
||||
// let primary_key= 'sales_pd_id'
|
||||
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||
// primary_key = 'local_pd_id'
|
||||
// }
|
||||
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||
// this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||
// localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||
// if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
||||
// value_obj.sales_pd_type = '1'
|
||||
// }
|
||||
// console.log(value_obj);
|
||||
// localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
||||
// this.navCtrl.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
// editForm2(value_obj){
|
||||
// // let product= localStorage.getItem('product_id_salesPD')
|
||||
// // storing the sales_pd_id and product id in local storagey
|
||||
// let primary_key= 'sales_pd_id'
|
||||
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||
// primary_key = 'local_pd_id'
|
||||
// }
|
||||
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||
// this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||
// localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||
// if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
||||
// value_obj.sales_pd_type = '1'
|
||||
// }
|
||||
// console.log(value_obj);
|
||||
// localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
||||
// this.navCtrl.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
|
||||
editForm(value_obj){
|
||||
console.log(value_obj.sales_pd_id,value_obj.rand_string)
|
||||
// alert('abc');
|
||||
console.log('value');
|
||||
console.log(value_obj);
|
||||
let campletedCase = JSON.stringify(value_obj)
|
||||
localStorage.setItem('completedPD',campletedCase)
|
||||
// let product= localStorage.getItem('product_id_salesPD')
|
||||
// storing the sales_pd_id and product id in local storagey
|
||||
let primary_key= 'sales_pd_id'
|
||||
if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||
primary_key = 'local_pd_id'
|
||||
}
|
||||
console.log(value_obj[primary_key])
|
||||
localStorage.setItem('sales_pd_id_PRIMARYKEY',value_obj[primary_key]);
|
||||
localStorage.setItem('sales_rand_string',value_obj.rand_string);
|
||||
editForm(value_obj) {
|
||||
console.log(value_obj.sales_pd_id, value_obj.rand_string)
|
||||
// alert('abc');
|
||||
console.log('value');
|
||||
console.log(value_obj);
|
||||
let campletedCase = JSON.stringify(value_obj)
|
||||
localStorage.setItem('completedPD', campletedCase)
|
||||
// let product= localStorage.getItem('product_id_salesPD')
|
||||
// storing the sales_pd_id and product id in local storagey
|
||||
let primary_key = 'sales_pd_id'
|
||||
if (value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||
primary_key = 'local_pd_id'
|
||||
}
|
||||
console.log(value_obj[primary_key])
|
||||
localStorage.setItem('sales_pd_id_PRIMARYKEY', value_obj[primary_key]);
|
||||
localStorage.setItem('sales_rand_string', value_obj.rand_string);
|
||||
|
||||
|
||||
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||
//this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||
localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||
if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
||||
value_obj.sales_pd_type = '1'
|
||||
localStorage.setItem('product_id_salesPD', value_obj.product_id)
|
||||
if (!value_obj.hasOwnProperty('sales_pd_type') && !value_obj.sales_pd_type) {
|
||||
value_obj.sales_pd_type = '1'
|
||||
}
|
||||
console.log('value');
|
||||
console.log(value_obj);
|
||||
localStorage.setItem('sales_pd_type', value_obj.sales_pd_type)
|
||||
// this.router.navigate(['../sectionlist',value_obj.product_id,value_obj.sales_pd_type,value_obj.link],{ relativeTo: this.route })
|
||||
this.router.navigate(['../sectionlist', value_obj.product_id, value_obj.sales_pd_type], { relativeTo: this.route })
|
||||
// })
|
||||
//})
|
||||
}
|
||||
console.log('value');
|
||||
console.log(value_obj);
|
||||
localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
||||
// this.router.navigate(['../sectionlist',value_obj.product_id,value_obj.sales_pd_type,value_obj.link],{ relativeTo: this.route })
|
||||
this.router.navigate(['../sectionlist',value_obj.product_id,value_obj.sales_pd_type],{ relativeTo: this.route })
|
||||
// })
|
||||
//})
|
||||
}
|
||||
|
||||
redirected(value_obj){
|
||||
let campletedCase = JSON.stringify(value_obj)
|
||||
localStorage.getItem("completedPD") === null ? localStorage.setItem('completedPD',campletedCase) : '';
|
||||
localStorage.getItem("sales_pd_id_PRIMARYKEY") === null ? localStorage.setItem('sales_pd_id_PRIMARYKEY',value_obj.sales_pd_id) : '';
|
||||
localStorage.getItem("sales_rand_string") === null ? localStorage.setItem('sales_rand_string',value_obj.rand_string) : '';
|
||||
redirected(value_obj) {
|
||||
let campletedCase = JSON.stringify(value_obj)
|
||||
localStorage.getItem("completedPD") === null ? localStorage.setItem('completedPD', campletedCase) : '';
|
||||
localStorage.getItem("sales_pd_id_PRIMARYKEY") === null ? localStorage.setItem('sales_pd_id_PRIMARYKEY', value_obj.sales_pd_id) : '';
|
||||
localStorage.getItem("sales_rand_string") === null ? localStorage.setItem('sales_rand_string', value_obj.rand_string) : '';
|
||||
|
||||
// window.location.href=data.records;
|
||||
let email = localStorage.getItem('officer_mail_id');
|
||||
let applicant_id = value_obj.applicant_id;
|
||||
console.log(value_obj.applicant_id);
|
||||
if(environment.authorization == 'TnAwuc64pVpcB9xf'){
|
||||
let salesapp_link ="https://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email=aniltiwari@smcfinance.com";
|
||||
console.log('salesapp_link = ',salesapp_link);
|
||||
let salesapp_url = salesapp_link;
|
||||
window.open(salesapp_url);
|
||||
}else if(environment.authorization == 'sparqvenba2018'){
|
||||
let salesapp_link ="http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email=aniltiwari@smcfinance.com";
|
||||
console.log('salesapp_link = ',salesapp_link);
|
||||
let salesapp_url = salesapp_link;
|
||||
window.open(salesapp_url);
|
||||
// window.location.href=data.records;
|
||||
let email = localStorage.getItem('officer_mail_id');
|
||||
let applicant_id = value_obj.applicant_id;
|
||||
console.log(value_obj.applicant_id);
|
||||
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||
let salesapp_link = "https://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=" + applicant_id + "&email=aniltiwari@smcfinance.com";
|
||||
console.log('in list salesapp_link = ', salesapp_link);
|
||||
let salesapp_url = salesapp_link;
|
||||
window.open(salesapp_url);
|
||||
} else if (environment.authorization == 'sparqvenba2018') {
|
||||
let salesapp_link = "http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=" + applicant_id + "&email=aniltiwari@smcfinance.com";
|
||||
console.log('in list salesapp_link = ', salesapp_link);
|
||||
let salesapp_url = salesapp_link;
|
||||
window.open(salesapp_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
filteredDataSource(res){
|
||||
console.log("From Parent",res);
|
||||
if(res['dataStatus']){
|
||||
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user=(JSON.parse(user1))
|
||||
this.roleID = localStorage.getItem('user_role')
|
||||
filteredDataSource(res) {
|
||||
console.log("From Parent", res);
|
||||
if (res['dataStatus']) {
|
||||
|
||||
this.salesPdData=res['records']
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user = (JSON.parse(user1))
|
||||
this.roleID = localStorage.getItem('user_role')
|
||||
|
||||
this.salesPdData = res['records']
|
||||
this.dataLengthTab4 = res['records'].length;
|
||||
this.dataSourceTab4.data = this.salesPdData;
|
||||
this.recordStatus=false
|
||||
this.limitMsg = false
|
||||
if(this.salesPdData.length > 0){
|
||||
let products=[]
|
||||
let lenders=[]
|
||||
let pd_status=[]
|
||||
this.salesPdData.map(val=>{
|
||||
this.recordStatus = false
|
||||
this.limitMsg = false
|
||||
if (this.salesPdData.length > 0) {
|
||||
let products = []
|
||||
let lenders = []
|
||||
let pd_status = []
|
||||
this.salesPdData.map(val => {
|
||||
|
||||
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
||||
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
console.log(environment)
|
||||
let link
|
||||
if(environment.authorization == 'TnAwuc64pVpcB9xf'){
|
||||
console.log('293')
|
||||
link ="https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}else if(environment.authorization == 'sparqvenba2018'){
|
||||
console.log('296')
|
||||
link ="http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}
|
||||
|
||||
var string:any = {
|
||||
EmpName:user.user_first_name,
|
||||
EmpCode:"",
|
||||
PDID:val.sales_pd_sno,
|
||||
//PD_NO:val.sales_pd_sno,
|
||||
}
|
||||
//console.log(string);
|
||||
//var encodedString = btoa(JSON.stringify(string));
|
||||
//console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||
//var decodedString = atob(encodedString);
|
||||
//console.log("decode",JSON.parse(decodedString));
|
||||
//let email="mwisesales1@sine.com";
|
||||
let PDID=val.sales_pd_sno;
|
||||
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||
this.finallink=link+"&PDID="+PDID+"&Email="+user.email;
|
||||
|
||||
console.log('this.finallink')
|
||||
console.log(this.finallink);
|
||||
val.link = this.finallink;
|
||||
|
||||
if(products.length > 0 ){
|
||||
if(products.filter(pro=>pro == val.product_id).length == 0 ){
|
||||
products.push(val.product_id)
|
||||
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
||||
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
console.log(environment)
|
||||
let link
|
||||
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||
console.log('293')
|
||||
link = "https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
} else if (environment.authorization == 'sparqvenba2018') {
|
||||
console.log('296')
|
||||
link = "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}
|
||||
|
||||
var string: any = {
|
||||
EmpName: user.user_first_name,
|
||||
EmpCode: "",
|
||||
PDID: val.sales_pd_sno,
|
||||
//PD_NO:val.sales_pd_sno,
|
||||
}
|
||||
//console.log(string);
|
||||
//var encodedString = btoa(JSON.stringify(string));
|
||||
//console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||
//var decodedString = atob(encodedString);
|
||||
//console.log("decode",JSON.parse(decodedString));
|
||||
//let email="mwisesales1@sine.com";
|
||||
let PDID = val.sales_pd_sno;
|
||||
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||
this.finallink = link + "&PDID=" + PDID + "&Email=" + user.email;
|
||||
|
||||
console.log('this.finallink')
|
||||
console.log(this.finallink);
|
||||
val.link = this.finallink;
|
||||
|
||||
if (products.length > 0) {
|
||||
if (products.filter(pro => pro == val.product_id).length == 0) {
|
||||
products.push(val.product_id)
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
products.push(val.product_id)
|
||||
}
|
||||
if(lenders.length > 0 ){
|
||||
if(lenders.filter(pro=>pro == val.lender_id).length == 0 ){
|
||||
if (lenders.length > 0) {
|
||||
if (lenders.filter(pro => pro == val.lender_id).length == 0) {
|
||||
lenders.push(val.lender_id)
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
lenders.push(val.lender_id)
|
||||
}
|
||||
if(pd_status.length > 0 ){
|
||||
if(pd_status.filter(pro=>pro == val.status).length == 0 ){
|
||||
if (pd_status.length > 0) {
|
||||
if (pd_status.filter(pro => pro == val.status).length == 0) {
|
||||
pd_status.push(val.status)
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
pd_status.push(val.status)
|
||||
}
|
||||
})
|
||||
this.filter_drop_down_data={product_ids:products,lender_ids:lenders,pd_status:pd_status}
|
||||
this.filter_drop_down_data = { product_ids: products, lender_ids: lenders, pd_status: pd_status }
|
||||
// console.log(this.filter_drop_down_data);
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.salesPdData=[];
|
||||
this.dataLengthTab4= null;
|
||||
this.recordStatus=true;
|
||||
this.limitMsg = false
|
||||
}
|
||||
else {
|
||||
this.salesPdData = [];
|
||||
this.dataLengthTab4 = null;
|
||||
this.recordStatus = true;
|
||||
this.limitMsg = false
|
||||
}
|
||||
}
|
||||
|
||||
salesPDpdf(pdfdetail){
|
||||
salesPDpdf(pdfdetail) {
|
||||
this.loaderService.showMatSpinnerDialog('Processing...')
|
||||
this.SalesPDService.getSalesPdpdf(pdfdetail)
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
// window.location.href=res['records'];
|
||||
window.open(data.records, '_blank');
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
// window.location.href=res['records'];
|
||||
window.open(data.records, '_blank');
|
||||
}
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
|
||||
}
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
|
||||
}
|
||||
// , error => this.errorMessage = <any> error);
|
||||
,error => {
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
this.errorMessage.push(error);
|
||||
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||
alert(error.html_format);
|
||||
});
|
||||
// , error => this.errorMessage = <any> error);
|
||||
, error => {
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
this.errorMessage.push(error);
|
||||
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||
alert(error.html_format);
|
||||
});
|
||||
|
||||
}
|
||||
pageChange(e) {
|
||||
@ -426,26 +426,26 @@ redirected(value_obj){
|
||||
}
|
||||
newcreditTrigger(curr_list_obj) {
|
||||
console.log(curr_list_obj);
|
||||
|
||||
|
||||
const dialogRef = this.dialog.open(DialogOverviewExampleDialog, {
|
||||
width: '500px',
|
||||
data: curr_list_obj
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
console.log('The dialog was closed',result);
|
||||
if(result) {
|
||||
console.log('The dialog was closed', result);
|
||||
if (result) {
|
||||
let new_credit_pd_info = curr_list_obj
|
||||
// {fk_sales_pd_id:curr_list_obj.sales_pd_id,sales_pd_sno:curr_list_obj.sales_pd_sno,product_id:curr_list_obj.product_id,smc_credit_pd_type:result,smc_credit_pd:null,lender_id:curr_list_obj.lender_id,applicant_name:curr_list_obj.applicant_name,}
|
||||
new_credit_pd_info.fk_sales_pd_id = curr_list_obj.sales_pd_id
|
||||
new_credit_pd_info.smc_credit_pd_type = result
|
||||
new_credit_pd_info.smc_credit_pd = null
|
||||
this._creditPdService.curr_credit_pd_data = new_credit_pd_info
|
||||
this.router.navigate(['../credit_pd/pdQuestions'])
|
||||
this.router.navigate(['../credit_pd/pdQuestions'])
|
||||
}
|
||||
});
|
||||
}
|
||||
newForm(){
|
||||
newForm() {
|
||||
// this.salesPDService.getData_fromLocal('sec1').then(result=>{
|
||||
// console.log("image",result);
|
||||
// if(result){
|
||||
@ -461,33 +461,32 @@ redirected(value_obj){
|
||||
localStorage.removeItem('product_id_salesPD')
|
||||
localStorage.removeItem('sales_pd_type')
|
||||
// this.navCtrl.push(HomePage)
|
||||
this.router.navigate([ '../../sales-pd-list/add-pd'], { relativeTo: this.route });
|
||||
this.router.navigate(['../../sales-pd-list/add-pd'], { relativeTo: this.route });
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
newPortal() {
|
||||
console.log(this.finallink)
|
||||
window.open(this.finallink);
|
||||
}
|
||||
newPortal() {
|
||||
console.log(this.finallink)
|
||||
window.open(this.finallink);
|
||||
}
|
||||
|
||||
|
||||
regeneratereport(data,option)
|
||||
{
|
||||
|
||||
const dialogRef = this.dialog.open(ReGenerateReportComponent,{
|
||||
data: {pdid: data,option: option},
|
||||
regeneratereport(data, option) {
|
||||
|
||||
const dialogRef = this.dialog.open(ReGenerateReportComponent, {
|
||||
data: { pdid: data, option: option },
|
||||
disableClose: true,
|
||||
minWidth: '30%',
|
||||
maxWidth: '40%',
|
||||
|
||||
|
||||
})
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
// this.viewPdDetails(this.viewID,this.masterRandomString)
|
||||
// this.viewPdDetails(this.viewID,this.masterRandomString)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -495,58 +494,57 @@ redirected(value_obj){
|
||||
templateUrl: 'trigger-confirm-dialog.html',
|
||||
})
|
||||
export class DialogOverviewExampleDialog {
|
||||
pd_type_list:any=[{
|
||||
id:"1",
|
||||
dis_name:"Physical PD"
|
||||
},{
|
||||
id:"2",
|
||||
dis_name:"Telephonic PD"
|
||||
pd_type_list: any = [{
|
||||
id: "1",
|
||||
dis_name: "Physical PD"
|
||||
}, {
|
||||
id: "2",
|
||||
dis_name: "Telephonic PD"
|
||||
}]
|
||||
choosedPD:any=null
|
||||
choosedPD: any = null
|
||||
// notifier:NotifierService
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<DialogOverviewExampleDialog>,
|
||||
@Inject(MAT_DIALOG_DATA) public data) {
|
||||
// this.notifier=notifier
|
||||
}
|
||||
// this.notifier=notifier
|
||||
}
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
onSubmit(){
|
||||
onSubmit() {
|
||||
console.log(this.choosedPD);
|
||||
if(this.choosedPD != '' && !this.choosedPD) {
|
||||
if (this.choosedPD != '' && !this.choosedPD) {
|
||||
alert("Please choose the PD Type");
|
||||
return
|
||||
}
|
||||
this.dialogRef.close(this.choosedPD)
|
||||
}
|
||||
|
||||
getgst(pd_id)
|
||||
{
|
||||
getgst(pd_id) {
|
||||
|
||||
let link = "https://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&data="
|
||||
|
||||
var string:any = {
|
||||
var string: any = {
|
||||
|
||||
EmpName:"John Doe",
|
||||
EmpName: "John Doe",
|
||||
|
||||
EmpCode: "",
|
||||
PD_ID: "",
|
||||
PD_NO: "",
|
||||
}
|
||||
|
||||
EmpCode:"",
|
||||
PD_ID:"",
|
||||
PD_NO:"",
|
||||
}
|
||||
|
||||
var encodedString = btoa(JSON.stringify(string));
|
||||
|
||||
console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||
console.log("encode", encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||
|
||||
var decodedString = atob("eyJFbXBOYW1lIjoiTXdpc2UgU2FsZXMtMSIsIkVtcENvZGUiOiIiLCJQRF9JRCI6IjQzOCIsIlBEX05PIjoiTVdJU0UtV0NUTC0yMTAifQ==");
|
||||
console.log('jumbo');
|
||||
console.log("decode",JSON.parse(decodedString));
|
||||
let finallink=link+encodedString;
|
||||
console.log('finallink');
|
||||
console.log(finallink);
|
||||
window.open(finallink, '_system', 'location=yes');
|
||||
console.log("decode", JSON.parse(decodedString));
|
||||
let finallink = link + encodedString;
|
||||
console.log('finallink');
|
||||
console.log(finallink);
|
||||
window.open(finallink, '_system', 'location=yes');
|
||||
}
|
||||
|
||||
// viewReport(){
|
||||
@ -570,6 +568,6 @@ export class DialogOverviewExampleDialog {
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ export class AutoLoginComponent implements OnInit {
|
||||
console.log(today);
|
||||
|
||||
if(this.dateRangeValidator(date_timing,today)){
|
||||
console.log('Token vaild because 24 Hrs Not Expried ! So, permitted to log in');
|
||||
console.log('Token vaild because within 24 Hrs ! So, permitted to log in');
|
||||
// http://localhost:4200/#/auto?token=TXdpc2VTYWxlc0B5YWhvby5jb20jc2luZTEyMzQjMjkzIzE5IzA0LzA3LzIwMjMgMTk6MzE6MTYjbXdpc2VzYWxlczFAc2luZS5jb20%3D
|
||||
let auth = { 'Username': mailid, 'Password': password };
|
||||
this.aws.dologin(auth).subscribe(res => {
|
||||
@ -98,30 +98,65 @@ export class AutoLoginComponent implements OnInit {
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
dateRangeValidator(fromDate,toDate){
|
||||
// Perform validation logic
|
||||
if (fromDate && toDate) {
|
||||
const fromDateTime = new Date(fromDate).getTime();
|
||||
const toDateTime = new Date(toDate).getTime();
|
||||
const twentyFourHours = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
|
||||
// console.log('toDateTime - fromDateTime > twentyFourHours');
|
||||
// console.log(toDateTime,'-',fromDateTime,'>',twentyFourHours);
|
||||
// console.log(toDateTime - fromDateTime > twentyFourHours);
|
||||
if (toDateTime - fromDateTime >= twentyFourHours) {
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return true;
|
||||
}
|
||||
// Calculate the time difference in milliseconds
|
||||
// const diffInMilliseconds = Math.abs(toDateTime - fromDateTime);
|
||||
// const diffInHours = diffInMilliseconds / (1000 * 60 * 60);
|
||||
// Check if the difference is at least 24 hours if (diffInHours < 24)
|
||||
const inputDate = fromDate;
|
||||
const [day, month, year, hour, minute, second] = inputDate.split(/[/: ]/);
|
||||
|
||||
// Months in JavaScript are zero-indexed, so we need to subtract 1 from the month value
|
||||
const jsMonth = parseInt(month, 10) - 1;
|
||||
const date = new Date(parseInt(year, 10), jsMonth, parseInt(day, 10), parseInt(hour, 10), parseInt(minute, 10), parseInt(second, 10));
|
||||
const angularDate = date.toString();
|
||||
|
||||
const from_Date = new Date(angularDate);
|
||||
const to_Date = new Date(toDate);
|
||||
console.log("Aftr Date ",from_Date," to ",to_Date);
|
||||
|
||||
if (from_Date && to_Date) {
|
||||
const timeDifference = to_Date.getTime() - from_Date.getTime();
|
||||
console.log('time Difference',timeDifference);
|
||||
const hoursDifference = timeDifference / (1000 * 60 * 60);
|
||||
console.log('hours Difference',hoursDifference);
|
||||
if (hoursDifference <= 24) {
|
||||
// The time duration is within 24 hours
|
||||
console.log('Valid: Time duration is within 24 hours');
|
||||
return true;
|
||||
} else {
|
||||
// The time duration is more than 24 hours
|
||||
console.log('Invalid: Time duration exceeds 24 hours');
|
||||
return false;
|
||||
// http://localhost:4200/#/auto?token=TXdpc2VTYWxlc0B5YWhvby5jb20jc2luZTEyMzQjMjkzIzE5IzA3LzA3LzIwMjMgMTA6MDQ6NDkjbXdpc2VzYWxlczFAc2luZS5jb20jOTA2
|
||||
}
|
||||
|
||||
}else{
|
||||
console.log('Invalid: Date Not Founded');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// dateRangeValidator(fromDate,toDate){
|
||||
// // Perform validation logic
|
||||
// if (fromDate && toDate) {
|
||||
// const fromDateTime = new Date(fromDate).getTime();
|
||||
// const toDateTime = new Date(toDate).getTime();
|
||||
// const twentyFourHours = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
|
||||
// // console.log('toDateTime - fromDateTime > twentyFourHours');
|
||||
// // console.log(toDateTime,'-',fromDateTime,'>',twentyFourHours);
|
||||
// // console.log(toDateTime - fromDateTime > twentyFourHours);
|
||||
// if (toDateTime - fromDateTime >= twentyFourHours) {
|
||||
// return true;
|
||||
// }
|
||||
// else{
|
||||
// return true;
|
||||
// }
|
||||
// // Calculate the time difference in milliseconds
|
||||
// // const diffInMilliseconds = Math.abs(toDateTime - fromDateTime);
|
||||
// // const diffInHours = diffInMilliseconds / (1000 * 60 * 60);
|
||||
// // Check if the difference is at least 24 hours if (diffInHours < 24)
|
||||
// }else{
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
decodeBase64String(encodedString) {
|
||||
try {
|
||||
|
||||
@ -16,7 +16,7 @@ import { CognitoService } from '../../AwsService/cognito.service';
|
||||
import { DashboardService } from 'app/dashboard/dashboard.service';
|
||||
import { LoaderService } from 'app/shared/loaderService/loader.service';
|
||||
import { OtpComponent } from '../otp/otp.component';
|
||||
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'ms-login-session',
|
||||
@ -47,9 +47,8 @@ export class LoginComponent implements OnInit{
|
||||
dialogRef: MatDialogRef<OtpComponent, any>;
|
||||
hide: boolean;
|
||||
constructor(
|
||||
private router: Router, public aws: AwsService, public dialog: MatDialog,
|
||||
private router: Router, public aws: AwsService, public dialog: MatDialog,private route: ActivatedRoute,
|
||||
public shared:CognitoService,private dashBoardService:DashboardService , private loaderService:LoaderService) {
|
||||
|
||||
}
|
||||
ngOnInit(){
|
||||
this.hide = true;
|
||||
@ -117,6 +116,7 @@ export class LoginComponent implements OnInit{
|
||||
this.loaderService.closeMatSpinnerDialog();
|
||||
//alert(err.message);
|
||||
})
|
||||
// console.log("AWS getlocale = ",this.aws.getlocale());
|
||||
}
|
||||
/**
|
||||
* New password set
|
||||
|
||||
Loading…
Reference in New Issue
Block a user