sales pd B4 Auto Login : ps
This commit is contained in:
parent
d3f1b28d77
commit
fabfde8335
Binary file not shown.
@ -51,7 +51,7 @@
|
||||
<div fxFlex.xs="10" fxFlex.sm="10" class="webhide" style="text-align: right;">
|
||||
<button style="width: 43px !important;height: 23px !important;line-height: 0px !important;" mat-button mat-icon-button type="button" [disabled]="details.status != 'COMPLETED'"
|
||||
color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button><br>
|
||||
<button mat-button mat-icon-button (click)="newPortal()" type="button" matTooltip="link" matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||
<button mat-button mat-icon-button (click)="callAPIForPortals(details)" type="button" matTooltip="link." matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||
</div>
|
||||
<mat-divider></mat-divider>
|
||||
</div>
|
||||
@ -118,7 +118,7 @@
|
||||
</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>
|
||||
<button mat-button mat-icon-button (click)="newPortals(details)" type="button" matTooltip="link" matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||
</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)"
|
||||
@ -248,7 +248,7 @@
|
||||
</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>
|
||||
<button mat-button mat-icon-button (click)="callAPIForPortals(details)" type="button" matTooltip="Link." matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||
</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)"
|
||||
|
||||
@ -17,16 +17,16 @@ 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[] = [];
|
||||
salesPdData: any[] = [];
|
||||
salesPdpdf: any[] = [];
|
||||
|
||||
errorMessage:any[]=[];
|
||||
errorMessage: any[] = [];
|
||||
recordStatus: boolean;
|
||||
|
||||
xpandStatus: boolean = false;
|
||||
@ -36,28 +36,28 @@ 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;
|
||||
|
||||
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')
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
let userDetails = localStorage.getItem('user_details');
|
||||
console.log('userdetails');
|
||||
console.log(userDetails);
|
||||
|
||||
let role= this.constantProvider.takeDecisionRouting(JSON.parse(userDetails))
|
||||
let role = this.constantProvider.takeDecisionRouting(JSON.parse(userDetails))
|
||||
console.log(role)
|
||||
if(role == 'sales'){
|
||||
if (role == 'sales') {
|
||||
this.is_sales_login = true
|
||||
this.getListofPD()
|
||||
}
|
||||
@ -65,15 +65,15 @@ export class SalesPdComponent implements OnInit {
|
||||
this.is_sales_login = false
|
||||
this.getListofPD()
|
||||
}
|
||||
},4000)
|
||||
}, 4000)
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings'))
|
||||
if(this.common){
|
||||
if (this.common) {
|
||||
this.common = this.common.default_pd_list_count;
|
||||
this.common = this.common.count+' '+this.common.factor
|
||||
this.common = this.common.count + ' ' + this.common.factor
|
||||
}
|
||||
},300)
|
||||
}, 300)
|
||||
// this.cameraProvider.checkGPSPermission();
|
||||
// this.salesPDService.clearLocalData();
|
||||
// setTimeout(()=>{
|
||||
@ -91,14 +91,14 @@ export class SalesPdComponent implements OnInit {
|
||||
|
||||
|
||||
uploadDatatoCET(salespdid) {
|
||||
this.SalesPDService.uploadSalesDatatoCET(salespdid).subscribe(res=>{
|
||||
if(res['dataStatus']){
|
||||
this.SalesPDService.uploadSalesDatatoCET(salespdid).subscribe(res => {
|
||||
if (res['dataStatus']) {
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user=(JSON.parse(user1))
|
||||
let user = (JSON.parse(user1))
|
||||
this.roleID = localStorage.getItem('user_role')
|
||||
alert(res['msg']);
|
||||
}else{ alert(res['msg']); }
|
||||
},error => {
|
||||
} else { alert(res['msg']); }
|
||||
}, error => {
|
||||
this.errorMessage.push(error);
|
||||
alert(error.html_format);
|
||||
});
|
||||
@ -108,40 +108,40 @@ export class SalesPdComponent implements OnInit {
|
||||
// .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))
|
||||
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.recordStatus = false
|
||||
this.limitMsg = true
|
||||
if(this.salesPdData.length > 0){
|
||||
let products=[]
|
||||
let lenders=[]
|
||||
let pd_status=[]
|
||||
this.salesPdData.map(val=>{
|
||||
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'){
|
||||
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||
console.log('293')
|
||||
link ="https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}else if(environment.authorization == 'sparqvenba2018'){
|
||||
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"
|
||||
link = "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}
|
||||
|
||||
var string:any = {
|
||||
EmpName:user.user_first_name,
|
||||
EmpCode:"",
|
||||
PDID:val.sales_pd_sno,
|
||||
var string: any = {
|
||||
EmpName: user.user_first_name,
|
||||
EmpCode: "",
|
||||
PDID: val.sales_pd_sno,
|
||||
//PD_NO:val.sales_pd_sno,
|
||||
}
|
||||
//console.log(string);
|
||||
@ -150,170 +150,170 @@ export class SalesPdComponent implements OnInit {
|
||||
//var decodedString = atob(encodedString);
|
||||
//console.log("decode",JSON.parse(decodedString));
|
||||
//let email="mwisesales1@sine.com";
|
||||
let PDID=val.sales_pd_sno;
|
||||
let PDID = val.sales_pd_sno;
|
||||
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||
this.finallink=link+"&PDID="+PDID+"&Email="+user.email;
|
||||
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 ){
|
||||
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;
|
||||
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)
|
||||
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)
|
||||
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) {
|
||||
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);
|
||||
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_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) {
|
||||
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)
|
||||
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 })
|
||||
// })
|
||||
//})
|
||||
}
|
||||
this.router.navigate(['../sectionlist', value_obj.product_id, value_obj.sales_pd_type], { relativeTo: this.route })
|
||||
// })
|
||||
//})
|
||||
}
|
||||
|
||||
filteredDataSource(res){
|
||||
console.log("From Parent",res);
|
||||
if(res['dataStatus']){
|
||||
filteredDataSource(res) {
|
||||
console.log("From Parent", res);
|
||||
if (res['dataStatus']) {
|
||||
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user=(JSON.parse(user1))
|
||||
let user = (JSON.parse(user1))
|
||||
this.roleID = localStorage.getItem('user_role')
|
||||
|
||||
this.salesPdData=res['records']
|
||||
this.salesPdData = res['records']
|
||||
this.dataLengthTab4 = res['records'].length;
|
||||
this.dataSourceTab4.data = this.salesPdData;
|
||||
this.recordStatus=false
|
||||
this.recordStatus = false
|
||||
this.limitMsg = false
|
||||
if(this.salesPdData.length > 0){
|
||||
let products=[]
|
||||
let lenders=[]
|
||||
let pd_status=[]
|
||||
this.salesPdData.map(val=>{
|
||||
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'){
|
||||
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||
console.log('293')
|
||||
link ="https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}else if(environment.authorization == 'sparqvenba2018'){
|
||||
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"
|
||||
link = "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||
}
|
||||
|
||||
var string:any = {
|
||||
EmpName:user.user_first_name,
|
||||
EmpCode:"",
|
||||
PDID:val.sales_pd_sno,
|
||||
var string: any = {
|
||||
EmpName: user.user_first_name,
|
||||
EmpCode: "",
|
||||
PDID: val.sales_pd_sno,
|
||||
//PD_NO:val.sales_pd_sno,
|
||||
}
|
||||
//console.log(string);
|
||||
@ -322,52 +322,52 @@ editForm(value_obj){
|
||||
//var decodedString = atob(encodedString);
|
||||
//console.log("decode",JSON.parse(decodedString));
|
||||
//let email="mwisesales1@sine.com";
|
||||
let PDID=val.sales_pd_sno;
|
||||
let PDID = val.sales_pd_sno;
|
||||
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||
this.finallink=link+"&PDID="+PDID+"&Email="+user.email;
|
||||
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 ){
|
||||
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;
|
||||
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(
|
||||
@ -380,7 +380,7 @@ editForm(value_obj){
|
||||
|
||||
}
|
||||
// , error => this.errorMessage = <any> error);
|
||||
,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.!');
|
||||
@ -408,8 +408,8 @@ editForm(value_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
|
||||
@ -420,7 +420,7 @@ editForm(value_obj){
|
||||
}
|
||||
});
|
||||
}
|
||||
newForm(){
|
||||
newForm() {
|
||||
// this.salesPDService.getData_fromLocal('sec1').then(result=>{
|
||||
// console.log("image",result);
|
||||
// if(result){
|
||||
@ -436,22 +436,37 @@ editForm(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 });
|
||||
}
|
||||
|
||||
callAPIForPortals(value_obj) {
|
||||
let user1 = localStorage.getItem('user_details');
|
||||
let user = (JSON.parse(user1))
|
||||
let temp_PDID = value_obj.sales_pd_sno;
|
||||
let link_url = (environment.authorization == 'TnAwuc64pVpcB9xf') ? "https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U" :
|
||||
(environment.authorization == 'sparqvenba2018') ? "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U" : "";
|
||||
if (temp_PDID && user.email) {
|
||||
link_url += "&PDID=" + temp_PDID + "&Email=" + user.email;
|
||||
console.log("link = " + link_url);
|
||||
this.SalesPDService.callAPIForPortals(value_obj, user, link_url).subscribe(res => {
|
||||
if (res['dataStatus']) {
|
||||
window.open(link_url);
|
||||
} else { alert(res['message']); }
|
||||
}, error => {
|
||||
this.errorMessage.push(error);
|
||||
alert(error.html_format);
|
||||
});
|
||||
} else {
|
||||
alert("Email And PDID not Found");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
newPortal() {
|
||||
console.log(this.finallink)
|
||||
window.open(this.finallink);
|
||||
}
|
||||
|
||||
regeneratereport(data, option) {
|
||||
|
||||
regeneratereport(data,option)
|
||||
{
|
||||
|
||||
const dialogRef = this.dialog.open(ReGenerateReportComponent,{
|
||||
data: {pdid: data,option: option},
|
||||
const dialogRef = this.dialog.open(ReGenerateReportComponent, {
|
||||
data: { pdid: data, option: option },
|
||||
disableClose: true,
|
||||
minWidth: '30%',
|
||||
maxWidth: '40%',
|
||||
@ -470,14 +485,14 @@ editForm(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>,
|
||||
@ -488,63 +503,39 @@ export class DialogOverviewExampleDialog {
|
||||
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("decode", JSON.parse(decodedString));
|
||||
let finallink = link + encodedString;
|
||||
console.log('finallink');
|
||||
console.log(finallink);
|
||||
window.open(finallink, '_system', 'location=yes');
|
||||
}
|
||||
|
||||
// viewReport(){
|
||||
// const dialogRef = this.dialog.open(componen_name, {
|
||||
// data: {data:this.raw_data,section_id:section_id},
|
||||
// // position: { right: '0'},
|
||||
// maxWidth: '100vw',
|
||||
// maxHeight: '100vh',
|
||||
// height: '100%',
|
||||
// width: '100%',
|
||||
// disableClose: true,
|
||||
// closeOnNavigation:true,
|
||||
// panelClass:'no-padding'
|
||||
// });
|
||||
// dialogRef.afterClosed()
|
||||
// .subscribe(dataresult => {
|
||||
// // this.notifier.notify('success', 'Successfully allocated.!');
|
||||
// // if(dataresult == 'refresh') {
|
||||
// // this.loadTemplates(this.product_id,2,this.sales_pd_type);
|
||||
// // }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -724,6 +724,10 @@ generatesateliteimage(param:any): Observable<any>{
|
||||
return this._http.get<any[]>(api_url +"uploadSalesPDDataToCETApp/"+id);
|
||||
}
|
||||
|
||||
callAPIForPortals(row_obj,user_obj,link_url) {
|
||||
return this._http.post<any[]>(api_url + "callAPIForPortals", {'sales_object': row_obj,'user_object':user_obj,'link_url':link_url});
|
||||
}
|
||||
|
||||
loadTemplatelocal(){
|
||||
|
||||
return this._http.get('assets/data/flyhi.json').map(rr=>{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user