This commit is contained in:
venbatechnologies@gmail.com 2021-10-06 09:27:11 +05:30
parent 760d415837
commit f9354bfa0b
2 changed files with 97 additions and 11 deletions

View File

@ -28,7 +28,7 @@
[render-text]="true" [original-size]="false" [autoresize]="true"
style="display: block;"
></pdf-viewer>
</div>
</div>
<ion-list >
<ion-grid class="fadeIn">
<mat-card class="md-box" reorder="true">
@ -43,7 +43,7 @@
</div>
</div>
<ion-list [virtualScroll]="sales_displayValue">
<ion-item *virtualItem="let val" (click)="val.status != 'COMPLETED' ? editForm(val) :presentActionSheet(val)" style="padding:0px"
<ion-item *virtualItem="let val" style="padding:0px"
[ngStyle]="{'border-left':(val.hasOwnProperty('is_pd_synced') && val.is_pd_synced == false) ||
(val.hasOwnProperty('is_all_section_synced') && val.is_all_section_synced == false) ||
(val.hasOwnProperty('is_pd_completed_sync') && val.hasOwnProperty('is_pd_completed') && val.is_pd_completed == true &&
@ -54,6 +54,7 @@
<ion-row>
<ion-col class="applicant_name" col-6 *ngIf="val.applicant_name != null">
<h1>{{val.applicant_name}}</h1>
<!--<p>28 Sep 2018 10:00 AM</p>-->
</ion-col>
<ion-col col-6 *ngIf="val.applicant_name == null">
@ -77,7 +78,20 @@
</div>
</ion-col>
</ion-row>
</ion-item>
<ion-row>
<ion-col col-6 (click)="val.status != 'COMPLETED' ? editForm(val) :presentActionSheet(val)">
<ion-icon style="color: red; font-size: 20px;"
name="eye"></ion-icon>
</ion-col>
<ion-col text-right col-6 >
<a href={{val.link}}><ion-icon style="color: #008828; font-size: 20px;"
name="link"></ion-icon></a>
</ion-col>
</ion-row>
</ion-item>
</ion-list>

View File

@ -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');
}
}