diff --git a/ng6-seed/src/app/sales-pd/sales-pd-list/sales-pd.component.ts b/ng6-seed/src/app/sales-pd/sales-pd-list/sales-pd.component.ts index 3557a63..b9491d3 100644 --- a/ng6-seed/src/app/sales-pd/sales-pd-list/sales-pd.component.ts +++ b/ng6-seed/src/app/sales-pd/sales-pd-list/sales-pd.component.ts @@ -157,6 +157,7 @@ export class SalesPdComponent implements OnInit { console.log('Listing Page '+inx+') Final Link = '+this.finallink); val.link = this.finallink; + localStorage.setItem('redirect_salesapp_link', this.redirect_salesapp_link); if (products.length > 0) { if (products.filter(pro => pro == val.product_id).length == 0) { @@ -204,7 +205,8 @@ export class SalesPdComponent implements OnInit { editForm (value_obj) { - let campletedCase = JSON.stringify(value_obj) + let campletedCase = JSON.stringify(value_obj); + console.log("completePD Setted Here when editform function called \n ",campletedCase); localStorage.setItem('completedPD', campletedCase) // let product= localStorage.getItem('product_id_salesPD') // storing the sales_pd_id and product id in local storagey diff --git a/ng6-seed/src/app/sales-pd/section-list/section-list.component.ts b/ng6-seed/src/app/sales-pd/section-list/section-list.component.ts index 32ab40d..7ac84ff 100644 --- a/ng6-seed/src/app/sales-pd/section-list/section-list.component.ts +++ b/ng6-seed/src/app/sales-pd/section-list/section-list.component.ts @@ -613,8 +613,25 @@ getListofPD() { this.salesPdData = res['records']; console.log(this.salesPdData) console.log(this.salesPdData[0].status) + if (this.salesPdData[0].link === undefined || this.salesPdData[0].link === null) { + // Link is not available (either this.salesPdData is null/undefined or link is null/undefined) + console.log("Link is not available. So I attached Here"); + let applicant_id = this.salesPdData[0].applicant_id; + let PDSno = this.salesPdData[0].sales_pd_sno; + let status = 1; + if(this.salesPdData[0].status == 'COMPLETED'){ status = 2; } + let link = localStorage.getItem('redirect_salesapp_link'); + let login_type_id : any = localStorage.getItem('login_type_id'); + let user_details = localStorage.getItem('user_details'); + let user_details_json = (JSON.parse(user_details)); + let email = (login_type_id == 1) ? localStorage.getItem('officer_mail_id') : user_details_json.email; + this.salesPdData[0].link = link +"&applicantid=" + applicant_id + "&email="+email+"&status="+status+"&PDID="+PDSno + } + + // console.log("completePD Setted Here when getListofPD function called \n ",this.salesPdData[0].link); let campletedCase = JSON.stringify(this.salesPdData[0]) localStorage.setItem('completedPD',campletedCase) + console.log("completePD Setted Here. when getListofPD function called \n ",campletedCase); // this.dataLengthTab4 = res['records'].length; // this.dataSourceTab4.data = this.salesPdData; // this.recordStatus=false