From f9354bfa0bd43d88db4018f77a6d8b708960a044 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Wed, 6 Oct 2021 09:27:11 +0530 Subject: [PATCH] gst link --- .../pages/sales-p-dlist/sales-p-dlist.html | 20 ++++- .../pages/sales-p-dlist/sales-p-dlist.ts | 88 +++++++++++++++++-- 2 files changed, 97 insertions(+), 11 deletions(-) diff --git a/src/pages/sales_pd/pages/sales-p-dlist/sales-p-dlist.html b/src/pages/sales_pd/pages/sales-p-dlist/sales-p-dlist.html index 61f8505..a469c73 100755 --- a/src/pages/sales_pd/pages/sales-p-dlist/sales-p-dlist.html +++ b/src/pages/sales_pd/pages/sales-p-dlist/sales-p-dlist.html @@ -28,7 +28,7 @@ [render-text]="true" [original-size]="false" [autoresize]="true" style="display: block;" > - + @@ -43,7 +43,7 @@ -

{{val.applicant_name}}

+ @@ -77,7 +78,20 @@ -
+ + + + + + + + + + + +
diff --git a/src/pages/sales_pd/pages/sales-p-dlist/sales-p-dlist.ts b/src/pages/sales_pd/pages/sales-p-dlist/sales-p-dlist.ts index 4eb8047..73e1547 100755 --- a/src/pages/sales_pd/pages/sales-p-dlist/sales-p-dlist.ts +++ b/src/pages/sales_pd/pages/sales-p-dlist/sales-p-dlist.ts @@ -15,6 +15,7 @@ import { SectionListPageModule } from '../section-list/section-list.module'; import { CreditSectionListPageModule } from '../../../credit_pd/pages/credit-section-list/credit-section-list.module'; import { CreditSectionListPage } from '../../../credit_pd/pages/credit-section-list/credit-section-list'; import { ApiServiceProvider } from '../../../credit_pd/providers/api-service/api-service'; +import { BrowserTab } from '@ionic-native/browser-tab'; /** @@ -31,6 +32,7 @@ const pd_key ='local_sales_PDs' }) export class SalesPDlistPage { sales_displayValue: any=[]; + findListIndex:any; loader_access:any=true reportSrc: any; filter_drop_down_data: { product_ids: any[]; lender_ids: any[]; pd_status: any[]; }; @@ -74,6 +76,7 @@ export class SalesPDlistPage { }, 1000); } getListofLocalPD() { + return this.ionicStorageService.getLocalDataWithFilter(pd_key,{name:'local_pd_id',type:'filter',value :null}).then(result=>{ console.log(result,this.sales_displayValue) if(result && result.length > 0){ @@ -88,30 +91,42 @@ export class SalesPDlistPage { }) } getListofPD(){ + return this.ionicStorageService.getLocalDataWithFilter(pd_key,{name:'sales_pd_id',type:'filter',value:null}).then(local_res=>{ - console.log(local_res); + console.log('local_res'); this.salesPDService.getSalesPDList(this.is_sales_login).subscribe(res=>{ if(res['dataStatus']){ this.sales_displayValue=res['records'] + + console.log(this.sales_displayValue) + + let user1 = localStorage.getItem('user_details'); + let user=(JSON.parse(user1)) + if(local_res && local_res.length > 0) { + local_res.forEach(local_obj=>{ + + if(local_obj && local_obj.sales_pd_id && local_obj.sales_pd_id != null) { console.log(local_obj) - let findListIndex = this.sales_displayValue.findIndex(val=>val.sales_pd_id == local_obj.sales_pd_id) - if(this.sales_displayValue[findListIndex]) { - this.sales_displayValue[findListIndex].is_pd_synced = local_obj.is_pd_synced - this.sales_displayValue[findListIndex].is_all_section_synced = local_obj.is_all_section_synced - this.sales_displayValue[findListIndex].is_pd_completed = local_obj.is_pd_completed - this.sales_displayValue[findListIndex].is_pd_completed_sync = local_obj.is_pd_completed_sync + this.findListIndex = this.sales_displayValue.findIndex(val=>val.sales_pd_id == local_obj.sales_pd_id) + if(this.sales_displayValue[this.findListIndex]) { + this.sales_displayValue[this.findListIndex].is_pd_synced = local_obj.is_pd_synced + this.sales_displayValue[this.findListIndex].is_all_section_synced = local_obj.is_all_section_synced + this.sales_displayValue[this.findListIndex].is_pd_completed = local_obj.is_pd_completed + this.sales_displayValue[this.findListIndex].is_pd_completed_sync = local_obj.is_pd_completed_sync if(local_obj.hasOwnProperty('status') && local_obj.status){ - this.sales_displayValue[findListIndex].status = local_obj.status + this.sales_displayValue[this.findListIndex].status = local_obj.status } } } + }) } if(this.sales_displayValue.length > 0){ + console.log(this.sales_displayValue); if(!this.is_sales_login) { this.sales_displayValue = this.sales_displayValue.filter(vll=>vll.status == 'COMPLETED'); } @@ -120,9 +135,24 @@ export class SalesPDlistPage { let lenders=[] let pd_status=[] this.sales_displayValue.map(val=>{ + + let link = "https://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&data=" + var string:any = { + EmpName:user.user_first_name, + EmpCode:"", + PD_ID:val.sales_pd_id, + PD_NO:val.sales_pd_sno, + } + var encodedString = btoa(JSON.stringify(string)); + console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh" + var decodedString = atob(encodedString); + console.log("decode",JSON.parse(decodedString)); + let finallink=link+encodedString; + val.link = finallink; if(products.length > 0 ){ if(products.filter(pro=>pro == val.product_id).length == 0 ){ products.push(val.product_id) + } } else{ @@ -144,6 +174,21 @@ export class SalesPDlistPage { else{ pd_status.push(val.status) } + if(pd_status.length > 0 ){ + if(pd_status.filter(pro=>pro == val.status).length == 0 ){ + + pd_status.push(val.status) + } + } + //let link='a'; + + + + // val.link = finallink; + console.log('val'); + console.log(val) + // link.push(val.status) + }) this.filter_drop_down_data={product_ids:products,lender_ids:lenders,pd_status:pd_status} console.log(this.sales_displayValue); @@ -161,6 +206,7 @@ export class SalesPDlistPage { this.loader_access=false }) }) + } newForm(){ // this.salesPDService.getData_fromLocal('sec1').then(result=>{ @@ -360,5 +406,31 @@ export class SalesPDlistPage { } + getgst(pd_id) + { + + let link = "https://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&data=" + + var string:any = { + + EmpName:"John Doe", + + EmpCode:"", + PD_ID:"", + PD_NO:"", + } + + var encodedString = btoa(JSON.stringify(string)); + + console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh" + + var decodedString = atob(encodedString); + + console.log("decode",JSON.parse(decodedString)); + let finallink=link+encodedString; + console.log('finallink'); + console.log(finallink); + window.open(finallink, '_system', 'location=yes'); + } }