Fairoj : image uploading handled and some issue fixes
This commit is contained in:
parent
af28503976
commit
efdf96c4c7
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<widget id="com.sineedge.pdgenie" version="0.0.20" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
<widget id="com.sineedge.pdgenie" version="0.0.21" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||||
<name>PD Genie Officer </name>
|
<name>PD Genie Officer </name>
|
||||||
<description>info@pdgenie.com</description>
|
<description>info@pdgenie.com</description>
|
||||||
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>
|
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>
|
||||||
|
|||||||
@ -83,19 +83,31 @@
|
|||||||
<label style="font-size:14px;color:gray">Newly Captured Pics</label><hr/><br/>
|
<label style="font-size:14px;color:gray">Newly Captured Pics</label><hr/><br/>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-6 *ngFor="let image of imageBucket; let i=index" no-padding>
|
<ion-col col-6 *ngFor="let image of imageBucket; let i=index" no-padding>
|
||||||
|
<!-- <ion-row> -->
|
||||||
|
<ion-col col-8>
|
||||||
<img src="{{image.image}}" imageViewer class="doc-image-bucket"><br/>
|
<img src="{{image.image}}" imageViewer class="doc-image-bucket"><br/>
|
||||||
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
|
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong> </label>
|
||||||
|
|
||||||
<input #focusName *ngIf="image.Name ==''" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeNameForBucket($event.target.value,i,image.image)">
|
<!-- <input #focusName *ngIf="image.Name ==''" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeNameForBucket($event.target.value,i,image.image)"> -->
|
||||||
<div *ngIf="pdDetails.form_id == '5'">
|
<span *ngIf="pdDetails.form_id == '5' && image.is_show_report == 1">
|
||||||
<label *ngIf="image.is_show_report == 1"><small>Showned on Report</small></label>
|
<br/> <label *ngIf="image.is_show_report == 1"><small>Showned on Report</small></label>
|
||||||
<br/>
|
|
||||||
<mat-radio-group aria-label="Select an option" (change)="changeOptions($event.value,i)">
|
<!-- <mat-radio-group aria-label="Select an option" (change)="changeOptions($event.value,i)">
|
||||||
<mat-radio-button value=1>Shown On Report</mat-radio-button>
|
<mat-radio-button value=1>Shown On Report</mat-radio-button>
|
||||||
<mat-radio-button value=0>Hide On Report</mat-radio-button>
|
<mat-radio-button value=0>Hide On Report</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group> -->
|
||||||
</div>
|
</span>
|
||||||
<button float-right ion-button clear color="optblue" (click)="removeImgForBucket(i)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
|
</ion-col>
|
||||||
|
<ion-col col-2>
|
||||||
|
<span *ngIf="image.isLoader && !image.isSaved" style="text-align: end;float:right;"><ion-spinner color="optblue" style="height: 24px;width: 24px" name="crescent" ></ion-spinner></span>
|
||||||
|
<span *ngIf="image.isSaved && image.isLoader == false" style="text-align: end;float:right;"><ion-icon style="margin-right: 3px;font-size: 20px;color: mediumseagreen;" name="checkmark"></ion-icon></span>
|
||||||
|
<span *ngIf="!image.isSaved && !image.isLoader" style="float:right;"><button ion-button clear (click)="reSendImage(image,i)"> <ion-icon style="margin-right:5px;font-size: 34px;color: orange;" name="cloud-upload"></ion-icon></button><br>
|
||||||
|
<label style="font-size: 8px;text-align: center;position: relative;
|
||||||
|
bottom: 15px;
|
||||||
|
left: 5px;">Click to Upload</label> </span>
|
||||||
|
</ion-col>
|
||||||
|
<!-- <button float-right ion-button clear color="optblue" (click)="removeImgForBucket(i)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button> -->
|
||||||
|
<!-- </ion-row> -->
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<hr/>
|
<hr/>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { LoadingProvider } from '../../providers/common-provider/loading';
|
|||||||
import { ConstantsProvider } from '../../providers/constants/constants';
|
import { ConstantsProvider } from '../../providers/constants/constants';
|
||||||
import * as watermark from 'watermarkjs'
|
import * as watermark from 'watermarkjs'
|
||||||
import { ImageNameModelPage } from '../Modal/image-name-model/image-name-model';
|
import { ImageNameModelPage } from '../Modal/image-name-model/image-name-model';
|
||||||
|
import { StorageProvider } from '../../providers/storage/storage';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated class for the PdGeneralImagesPage page.
|
* Generated class for the PdGeneralImagesPage page.
|
||||||
@ -36,7 +37,7 @@ export class PdGeneralImagesPage {
|
|||||||
geoCoordinates:any='-';
|
geoCoordinates:any='-';
|
||||||
@Output() imageDatalength_forParent = new EventEmitter<any>();
|
@Output() imageDatalength_forParent = new EventEmitter<any>();
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public camera:CameraProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,private loading:LoadingProvider,private cameraProvider:CameraProvider,private constant:ConstantsProvider,private modalCtrl:ModalController) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public camera:CameraProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,private loading:LoadingProvider,private cameraProvider:CameraProvider,private constant:ConstantsProvider,private modalCtrl:ModalController,private ionicStorageProvider:StorageProvider) {
|
||||||
|
|
||||||
// this.applicatentDetails = this.navParams.get('pdDetails');
|
// this.applicatentDetails = this.navParams.get('pdDetails');
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ export class PdGeneralImagesPage {
|
|||||||
this.pdDetails=this.pd_values
|
this.pdDetails=this.pd_values
|
||||||
console.log("ionViewDidEnter",this.pdDetails)
|
console.log("ionViewDidEnter",this.pdDetails)
|
||||||
this.getPDImages()
|
this.getPDImages()
|
||||||
|
this.getPDImagesFromLocal()
|
||||||
console.log("avctrl",this.navCtrl)
|
console.log("avctrl",this.navCtrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +94,7 @@ export class PdGeneralImagesPage {
|
|||||||
/*IMAGE SECTION*/
|
/*IMAGE SECTION*/
|
||||||
getPDImages(){
|
getPDImages(){
|
||||||
//FOR RETRIEVING PICTURES
|
//FOR RETRIEVING PICTURES
|
||||||
this.imageDisplay=[]
|
// this.imageDisplay=[]
|
||||||
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.pdDetails.form_id,'company_id':this.pdDetails.company_id,'rental_count_id':this.pdDetails.hasOwnProperty('rental_count_id') ?this.pdDetails.rental_count_id : null,'is_common':this.pdDetails.form_id == null ? 1 : null }
|
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.pdDetails.form_id,'company_id':this.pdDetails.company_id,'rental_count_id':this.pdDetails.hasOwnProperty('rental_count_id') ?this.pdDetails.rental_count_id : null,'is_common':this.pdDetails.form_id == null ? 1 : null }
|
||||||
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
|
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
|
||||||
if(!val['msg']){
|
if(!val['msg']){
|
||||||
@ -110,13 +112,75 @@ export class PdGeneralImagesPage {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log("dis",this.imageDisplay);
|
console.log("dis",this.imageDisplay);
|
||||||
|
|
||||||
|
|
||||||
|
//FOR TESTING PURPOSE
|
||||||
|
// this.imageBucket=[]
|
||||||
|
// let dis=this.imageDisplay.splice(1,1);
|
||||||
|
// // let dis3=this.imageDisplay.splice(1,1);
|
||||||
|
// dis[0].isLoader=true
|
||||||
|
// dis[0].isSaved=false
|
||||||
|
// // dis3[0].isLoader=true
|
||||||
|
// // dis3[0].isSaved=false
|
||||||
|
// // dis3[0].Name="ffRR"
|
||||||
|
|
||||||
|
|
||||||
|
// let dis1=this.imageDisplay.splice(0,1);
|
||||||
|
// dis1[0].isLoader=true
|
||||||
|
// dis1[0].isSaved=false
|
||||||
|
// dis1[0].Name="Approach to PD Location 11-12-19 Pictures"
|
||||||
|
|
||||||
|
// // let dis4=this.imageDisplay.splice(0,1);
|
||||||
|
// // dis4[0].isLoader=true
|
||||||
|
// // dis4[0].isSaved=false
|
||||||
|
// // dis4[0].Name="Sample chekc"
|
||||||
|
|
||||||
|
// this.imageBucket.push(dis[0])
|
||||||
|
// this.imageBucket.push(dis1[0])
|
||||||
|
// // this.imageBucket.push(dis3[0])
|
||||||
|
// // this.imageBucket.push(dis4[0])
|
||||||
|
|
||||||
|
// console.log("buckins",this.imageBucket)
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// this.sendImage(dis[0])
|
||||||
|
// console.log("First api called",dis)
|
||||||
|
// },7000)
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// this.sendImage(dis1[0])
|
||||||
|
// console.log("Second api called",dis1)
|
||||||
|
// },4000)
|
||||||
|
|
||||||
|
|
||||||
let imageData={imageDisplay:this.imageDisplay,imageBucket:this.imageBucket}
|
let imageData={imageDisplay:this.imageDisplay,imageBucket:this.imageBucket}
|
||||||
this.imageDatalength_forParent.emit(imageData)
|
this.imageDatalength_forParent.emit(imageData)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
getPDImagesFromLocal(){
|
||||||
|
this.ionicStorageProvider.getItem('pd_images').then(loc_result=>{
|
||||||
|
if(loc_result){
|
||||||
|
let local_bucket=loc_result.filter(val=>val.form_id == this.pdDetails.form_id)
|
||||||
|
console.log("local bu",local_bucket)
|
||||||
|
if(local_bucket.length > 0){
|
||||||
|
this.imageBucket=local_bucket[0].form_value
|
||||||
|
let check_status=this.imageBucket.filter(val=>val.isSaved == false && val.isLoader == false)
|
||||||
|
if(check_status.length > 0){
|
||||||
|
this.toast.pdTriggerappmessage("Some Images are not saved. click the upload to Save")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
reSendImage(img_data,index){
|
||||||
|
img_data.isLoader=true;
|
||||||
|
this.imageBucket[index].isLoader=true;
|
||||||
|
this.sendImage(img_data);
|
||||||
}
|
}
|
||||||
capture(value?) {
|
capture(value?) {
|
||||||
|
|
||||||
console.log("value", value)
|
console.log("value", value)
|
||||||
//FOR CAPTURING PICS
|
//FOR CAPTURING PICS
|
||||||
this.cameraProvider.getpicture().then(res => {
|
this.cameraProvider.getpicture().then(res => {
|
||||||
@ -133,12 +197,14 @@ export class PdGeneralImagesPage {
|
|||||||
this.geoCoordinates=localStorage.getItem('current_coordinates')
|
this.geoCoordinates=localStorage.getItem('current_coordinates')
|
||||||
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
||||||
|
|
||||||
let bucket_value: any;
|
let bucket_value: any=[];
|
||||||
if (this.pdDetails.form_id != "5") {
|
if (this.pdDetails.form_id != "5") {
|
||||||
bucket_value = {
|
bucket_value = {
|
||||||
'image': watermarkedImage,
|
'image': watermarkedImage,
|
||||||
'Name': '',
|
'Name': '',
|
||||||
'link': this.geoCoordinates,
|
'link': this.geoCoordinates,
|
||||||
|
'isLoader':true,
|
||||||
|
'isSaved':false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -148,7 +214,9 @@ export class PdGeneralImagesPage {
|
|||||||
'image': watermarkedImage,
|
'image': watermarkedImage,
|
||||||
'Name': '',
|
'Name': '',
|
||||||
'link': this.geoCoordinates,
|
'link': this.geoCoordinates,
|
||||||
'is_show_report': ''
|
'is_show_report': '',
|
||||||
|
'isLoader':true,
|
||||||
|
'isSaved':false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,13 +230,13 @@ export class PdGeneralImagesPage {
|
|||||||
}
|
}
|
||||||
bucket_value.Name = value
|
bucket_value.Name = value
|
||||||
this.imageBucket.push(bucket_value)
|
this.imageBucket.push(bucket_value)
|
||||||
this.sendImage()
|
this.sendImage(bucket_value)
|
||||||
// this.imageBucket.push(bucket_value);
|
// this.imageBucket.push(bucket_value);
|
||||||
})
|
})
|
||||||
}else if(this.pdDetails.form_id == '5' && value && value != '' && value != undefined){
|
}else if(this.pdDetails.form_id == '5' && value && value != '' && value != undefined){
|
||||||
bucket_value.Name=value
|
bucket_value.Name=value
|
||||||
this.imageBucket.push(bucket_value)
|
this.imageBucket.push(bucket_value)
|
||||||
this.modalForImageDet(value)
|
this.modalForImageDet(value,bucket_value)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -177,7 +245,7 @@ export class PdGeneralImagesPage {
|
|||||||
|
|
||||||
bucket_value.Name = value
|
bucket_value.Name = value
|
||||||
this.imageBucket.push(bucket_value)
|
this.imageBucket.push(bucket_value)
|
||||||
this.sendImage()
|
this.sendImage(bucket_value)
|
||||||
// this.imageBucket.push({ 'image': res, 'Name': value, 'link': geoCoordinates });
|
// this.imageBucket.push({ 'image': res, 'Name': value, 'link': geoCoordinates });
|
||||||
// this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
|
// this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
|
||||||
return
|
return
|
||||||
@ -207,7 +275,7 @@ export class PdGeneralImagesPage {
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// })
|
// })
|
||||||
this.modalForImageDet('')
|
this.modalForImageDet('',bucket_value)
|
||||||
}
|
}
|
||||||
// this.loading.dismissLoader()
|
// this.loading.dismissLoader()
|
||||||
})
|
})
|
||||||
@ -217,7 +285,7 @@ export class PdGeneralImagesPage {
|
|||||||
console.log("Camera Error ", JSON.stringify(error));
|
console.log("Camera Error ", JSON.stringify(error));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
modalForImageDet(doc_name?){
|
modalForImageDet(doc_name?,bucket_value?){
|
||||||
const modalOption:ModalOptions={
|
const modalOption:ModalOptions={
|
||||||
cssClass:'imageNameModal'
|
cssClass:'imageNameModal'
|
||||||
}
|
}
|
||||||
@ -227,12 +295,14 @@ export class PdGeneralImagesPage {
|
|||||||
modalCtrl.onDidDismiss((data)=>{
|
modalCtrl.onDidDismiss((data)=>{
|
||||||
console.log("Image Data",data);
|
console.log("Image Data",data);
|
||||||
if(data){
|
if(data){
|
||||||
|
bucket_value.Name=data.doc_name
|
||||||
this.imageBucket[this.imageBucket.length - 1].Name = data.doc_name
|
this.imageBucket[this.imageBucket.length - 1].Name = data.doc_name
|
||||||
if(this.pdDetails.form_id == '5'){
|
if(this.pdDetails.form_id == '5'){
|
||||||
|
bucket_value.is_show_report=data.is_show_report
|
||||||
this.imageBucket[this.imageBucket.length - 1].is_show_report = data.is_show_report
|
this.imageBucket[this.imageBucket.length - 1].is_show_report = data.is_show_report
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.sendImage();
|
this.sendImage(bucket_value);
|
||||||
// this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
|
// this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -283,35 +353,94 @@ export class PdGeneralImagesPage {
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
sendImage(){
|
sendImageDummy(bucket_value){
|
||||||
// this.loading.loaderForSendImage()
|
let records:any=[]
|
||||||
// console.log("ll",JSON.stringify(this.imageBucket));
|
let loca_buck:any=[]
|
||||||
|
loca_buck=bucket_value
|
||||||
let records:any={
|
records={
|
||||||
'pd_id':this.pdDetails.pd_id,
|
'pd_id':this.pdDetails.pd_id,
|
||||||
'formid':this.pdDetails.form_id,
|
'formid':this.pdDetails.form_id,
|
||||||
'images':this.imageBucket,
|
'images':loca_buck,
|
||||||
'company_id':this.pdDetails.company_id,
|
'company_id':this.pdDetails.company_id,
|
||||||
'rental_count_id':this.pdDetails.rental_count_id,
|
'rental_count_id':this.pdDetails.rental_count_id,
|
||||||
}
|
}
|
||||||
// console.log("records",JSON.stringify(records))
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
console.log("bb",loca_buck,this.imageBucket,records.images);
|
||||||
|
this.imageBucket.forEach(val=>{
|
||||||
|
console.log("response",val)
|
||||||
|
if(loca_buck[0].Name == val.Name){
|
||||||
|
val.isLoader=false;
|
||||||
|
val.isSaved=true
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},2000)
|
||||||
|
}
|
||||||
|
sendImage(bucket_value){
|
||||||
|
let local_bucket:any=[]
|
||||||
|
local_bucket.push(bucket_value)
|
||||||
|
this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
|
||||||
|
// this.loading.loaderForSendImage()
|
||||||
|
// console.log("ll",JSON.stringify(this.imageBucket));
|
||||||
|
let records:any=[]
|
||||||
|
records={
|
||||||
|
'pd_id':this.pdDetails.pd_id,
|
||||||
|
'formid':this.pdDetails.form_id,
|
||||||
|
'images':local_bucket,
|
||||||
|
'company_id':this.pdDetails.company_id,
|
||||||
|
'rental_count_id':this.pdDetails.rental_count_id,
|
||||||
|
}
|
||||||
|
// this.imageBucket=[]
|
||||||
|
console.log("records",JSON.stringify(records))
|
||||||
|
|
||||||
this.qustCat.savePDImages(records).subscribe(res=>{
|
this.qustCat.savePDImages(records).subscribe(res=>{
|
||||||
if(res['dataStatus']== true){
|
if(res['dataStatus']== true){
|
||||||
this.toast.pdTriggerappmessage(this.imageBucket[0].Name+" Saved Successfully")
|
let imageData={imageDisplay:this.imageDisplay,imageBucket:this.imageBucket}
|
||||||
|
this.imageDatalength_forParent.emit(imageData)
|
||||||
|
// local_arr.forEach(val=>{
|
||||||
|
// if(val.Name == this.)
|
||||||
|
// })
|
||||||
|
console.log("bb",local_bucket);
|
||||||
|
this.imageBucket.forEach(val=>{
|
||||||
|
|
||||||
|
if(local_bucket[0].Name == val.Name){
|
||||||
|
val.isLoader=false;
|
||||||
|
val.isSaved=true
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log("response",this.imageBucket)
|
||||||
|
// let img_name=records.images[0].Name
|
||||||
|
// this.imageBucket[0].Name
|
||||||
|
// this.toast.pdTriggerappmessage(img_name+" Saved Successfully")
|
||||||
// this.imageDisplay.push(this.imageBucket)
|
// this.imageDisplay.push(this.imageBucket)
|
||||||
// console.log("length",this.imageDisplay.length)
|
// console.log("length",this.imageDisplay.length)
|
||||||
this.imageBucket=[]
|
|
||||||
this.getPDImages();
|
// this.getPDImages();
|
||||||
this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
|
// this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.toast.pdTriggerappmessage('Something went wrong');
|
this.toast.pdTriggerappmessage('Something went wrong');
|
||||||
|
this.imageBucket.forEach(val=>{
|
||||||
|
if(local_bucket[0].Name == val.Name){
|
||||||
|
val.isLoader=false;
|
||||||
|
val.isSaved=false;
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// this.loading.dismissLoader();
|
// this.loading.dismissLoader();
|
||||||
},err=>{
|
},err=>{
|
||||||
// this.loading.dismissLoader();
|
// this.loading.dismissLoader();
|
||||||
this.toast.pdTriggerappmessage("Network Error")
|
this.toast.pdTriggerappmessage("Network Error")
|
||||||
|
this.imageBucket.forEach(val=>{
|
||||||
|
if(local_bucket[0].Name == val.Name){
|
||||||
|
val.isLoader=false;
|
||||||
|
val.isSaved=false;
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -359,7 +488,17 @@ export class PdGeneralImagesPage {
|
|||||||
ngOnDestroy($event){
|
ngOnDestroy($event){
|
||||||
|
|
||||||
console.log("Destroy event called")
|
console.log("Destroy event called")
|
||||||
console.log("leave")
|
console.log("leave",this.imageBucket.filter(val=>val.isSaved == false))
|
||||||
|
let unSavedImages:any=[]
|
||||||
|
unSavedImages.img_bucket=this.imageBucket.filter(val=>val.isSaved == false)
|
||||||
|
if(unSavedImages.img_bucket.length > 0){
|
||||||
|
unSavedImages.storage_key="pd_images"
|
||||||
|
unSavedImages.form_id=this.pdDetails.form_id //Storage Key
|
||||||
|
this.ionicStorageProvider.insertPDImageLocally(unSavedImages);
|
||||||
|
}
|
||||||
|
|
||||||
|
// let imageData={imageDisplay:this.imageDisplay,imageBucket:this.imageBucket}
|
||||||
|
// this.imageDatalength_forParent.emit(imageData)
|
||||||
// if (this.imageBucket.length > 0) {
|
// if (this.imageBucket.length > 0) {
|
||||||
// return new Promise((resolve, reject) => {
|
// return new Promise((resolve, reject) => {
|
||||||
// let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
// let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
||||||
|
|||||||
@ -102,7 +102,7 @@ searchitem:any;
|
|||||||
ionViewCanEnter()
|
ionViewCanEnter()
|
||||||
{
|
{
|
||||||
this.getcategoryList();
|
this.getcategoryList();
|
||||||
this.viewCtrl.dismiss();
|
// this.viewCtrl.dismiss();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
// this.storage.clearItem('qc_notes')
|
// this.storage.clearItem('qc_notes')
|
||||||
|
|||||||
@ -87,7 +87,7 @@ export class PdQuestionAddressPage {
|
|||||||
base64: string;
|
base64: string;
|
||||||
imageBucket: any=[];
|
imageBucket: any=[];
|
||||||
tab:string='0';
|
tab:string='0';
|
||||||
imageDisplay: any=[];
|
private imageDisplay: any=[];
|
||||||
public data$:Observable<any>
|
public data$:Observable<any>
|
||||||
timer:any;
|
timer:any;
|
||||||
alertnativeCityData: any=[];
|
alertnativeCityData: any=[];
|
||||||
@ -330,67 +330,12 @@ countRowsForTextarea(text){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
// this.timer.unsubscribe();
|
// this.timer.unsubscribe();
|
||||||
|
if(this.pdQuestionAddress.dirty){
|
||||||
if(this.pdQuestionAddress.dirty){
|
return this.constant.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Form is Modified","Are you sure want to Go Back")
|
}
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//For Inserting the data locally
|
|
||||||
// this.localInsert(true);
|
|
||||||
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/** To Get City And Pincode Data For Address Form
|
/** To Get City And Pincode Data For Address Form
|
||||||
* Param 'stateID' -> selected StateId
|
* Param 'stateID' -> selected StateId
|
||||||
@ -1633,15 +1578,36 @@ else{
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
imageDataFun($event){
|
imageDataFun(event){
|
||||||
console.log($event)
|
console.log(event)
|
||||||
this.imageDisplay=$event.imageDisplay
|
this.imageDisplay=event.imageDisplay
|
||||||
|
this.imageBucket=event.imageBucket
|
||||||
|
// this.imageDisplay.push(this.imageBucket)
|
||||||
|
// this.imageBucket=$event.imageBucket
|
||||||
|
// if($event.imageBucket != ''){
|
||||||
|
// this.imageDisplay.push($event.imageBucket);
|
||||||
|
// }
|
||||||
|
|
||||||
|
console.log("image display event emiiter",this.imageDisplay,this.imageBucket)
|
||||||
|
if(this.imageDisplay.length > 0){
|
||||||
this.imageDisplay.forEach(result=>{
|
this.imageDisplay.forEach(result=>{
|
||||||
let img_title = (result.Name).split('(');
|
let img_title = (result.Name).split('(');
|
||||||
if(img_title[0] == 'Approach to PD Location '){
|
if(img_title[0] == 'Approach to PD Location '){
|
||||||
this.AppxPDLocationImgValid = true;
|
this.AppxPDLocationImgValid = true;
|
||||||
//this.imageDisplay = this.imageDisplay.filter (value=>value.is_show_report != 0 && value.name.split('(')[0] != 'Approach to PD Location ')
|
//this.imageDisplay = this.imageDisplay.filter (value=>value.is_show_report != 0 && value.name.split('(')[0] != 'Approach to PD Location ')
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
if(this.imageBucket.length > 0){
|
||||||
|
this.imageBucket.forEach(result=>{
|
||||||
|
let img_title = (result.Name).split('(');
|
||||||
|
if(img_title[0] == 'Approach to PD Location '){
|
||||||
|
this.AppxPDLocationImgValid = true;
|
||||||
|
//this.imageDisplay = this.imageDisplay.filter (value=>value.is_show_report != 0 && value.name.split('(')[0] != 'Approach to PD Location ')
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,68 +147,10 @@ export class PdQuestionAssestsPage {
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.AssetsDetailsForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.AssetsDetailsForm.dirty){
|
if(this.AssetsDetailsForm.dirty){
|
||||||
// console.log("dirty",this.AssetsDetailsForm.dirty)
|
return this.constprovider.chekAlertOnLeave()
|
||||||
//return false;
|
}
|
||||||
// let val=this.toast.setAlert('Form is Modified','Are you sure want to Go Back');
|
|
||||||
// console.log("v",val)
|
|
||||||
// if(val==1){
|
|
||||||
|
|
||||||
// }
|
|
||||||
return new Promise((resolve,reject)=>{
|
|
||||||
let alert=this.toast.setAlert("Form is Modified","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tabChange(){
|
tabChange(){
|
||||||
|
|||||||
@ -99,60 +99,11 @@ export class PdQuestionBankingPage {
|
|||||||
this.getPDImages();
|
this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.bankDetails.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.bankDetails.dirty){
|
if(this.bankDetails.dirty){
|
||||||
|
return this.cons.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
|
||||||
let alert=this.toast.setAlert("Form is Modified","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
checkImage(){
|
checkImage(){
|
||||||
let value
|
let value
|
||||||
|
|||||||
@ -113,7 +113,7 @@
|
|||||||
<mat-select placeholder="Is this the business address ? "
|
<mat-select placeholder="Is this the business address ? "
|
||||||
(selectionChange)="setRequiredValidation($event.value,'',1,i);"
|
(selectionChange)="setRequiredValidation($event.value,'',1,i);"
|
||||||
formControlName="business_address_availability">
|
formControlName="business_address_availability">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option value="">Select</mat-option>
|
||||||
<mat-option value="yes">Yes</mat-option>
|
<mat-option value="yes">Yes</mat-option>
|
||||||
<mat-option value="no">No</mat-option>
|
<mat-option value="no">No</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
@ -137,7 +137,7 @@
|
|||||||
<mat-select
|
<mat-select
|
||||||
[placeholder]="placeholderName[i] ? placeholderName[i] :'Was any business activity seen at the Address Type during PD visit?'"
|
[placeholder]="placeholderName[i] ? placeholderName[i] :'Was any business activity seen at the Address Type during PD visit?'"
|
||||||
formControlName="business_is_pd_visited" (selectionChange)="setRequiredValidation($event.value,'',11,i)">
|
formControlName="business_is_pd_visited" (selectionChange)="setRequiredValidation($event.value,'',11,i)">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option value="">Select</mat-option>
|
||||||
<mat-option value="yes">Yes</mat-option>
|
<mat-option value="yes">Yes</mat-option>
|
||||||
<mat-option value="no">No</mat-option>
|
<mat-option value="no">No</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
|||||||
@ -120,63 +120,10 @@ export class PdQuestionBusinessAssetsPage {
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this._businessAssetsQuesFrom.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this._businessAssetsQuesFrom.dirty){
|
if(this._businessAssetsQuesFrom.dirty){
|
||||||
|
return this.cons.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -110,63 +110,10 @@ step:number
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.bankingForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.bankingForm.dirty){
|
if(this.bankingForm.dirty){
|
||||||
|
return this.cons.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -187,64 +187,14 @@ export class PdQuestionBusinessInfoPage {
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.businessForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.businessForm.dirty){
|
if(this.businessForm.dirty){
|
||||||
|
return this.cons.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
const modalOption:ModalOptions={
|
const modalOption:ModalOptions={
|
||||||
|
|||||||
@ -133,63 +133,10 @@ console.log("form values",this.clientInfoForm);
|
|||||||
|
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
// console.log("dirty",this.clientInfoForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.clientInfoForm.dirty){
|
if(this.clientInfoForm.dirty){
|
||||||
|
return this.constantProvider.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
@ -1142,6 +1089,8 @@ else{
|
|||||||
imageDataFun($event){
|
imageDataFun($event){
|
||||||
console.log($event)
|
console.log($event)
|
||||||
this.imageDisplay=$event.imageDisplay
|
this.imageDisplay=$event.imageDisplay
|
||||||
|
this.imageBucket=$event.imageBucket
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onBlurMethod(v,items,option) {
|
onBlurMethod(v,items,option) {
|
||||||
|
|||||||
@ -146,64 +146,11 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
// console.log("ngAfter View Init")
|
// console.log("ngAfter View Init")
|
||||||
|
|
||||||
// }
|
// }
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.financialForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.financialForm.dirty){
|
if(this.financialForm.dirty){
|
||||||
|
return this.cons.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
@ -1700,7 +1647,10 @@ calculateLossAmount( i, details){
|
|||||||
}
|
}
|
||||||
imageDataFun($event){
|
imageDataFun($event){
|
||||||
console.log($event)
|
console.log($event)
|
||||||
|
this.imageDisplay=$event.imageDisplay
|
||||||
|
this.imageBucket=$event.imageBucket;
|
||||||
this.picsArrayLength=$event.imageDisplay.length
|
this.picsArrayLength=$event.imageDisplay.length
|
||||||
|
this.picsArrayLength=this.picsArrayLength+(parseInt(this.imageBucket.length))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,64 +85,11 @@ export class PdQuestionFuturePlansAndBusinessEnvironmentPage {
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
ionViewCanLeave() {
|
ionViewCanLeave(){
|
||||||
|
// this.timer.unsubscribe();
|
||||||
if (this._futurePlansForm.dirty) {
|
if(this._futurePlansForm.dirty){
|
||||||
|
return this.constantProvider.chekAlertOnLeave()
|
||||||
return new Promise((resolve, reject) => {
|
}
|
||||||
let alert = this.toast.setAlert("Data will be Lost", "Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -124,63 +124,10 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.formDetails.form_i
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.stockForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.stockForm.dirty){
|
if(this.stockForm.dirty){
|
||||||
|
return this.constant.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -128,63 +128,10 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
this.getPDImages();
|
this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.supplierInfoForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.supplierInfoForm.dirty){
|
if(this.supplierInfoForm.dirty){
|
||||||
|
return this.constantProvider.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
@ -1124,6 +1071,7 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
imageDataFun($event){
|
imageDataFun($event){
|
||||||
console.log($event)
|
console.log($event)
|
||||||
this.imageDisplay=$event.imageDisplay
|
this.imageDisplay=$event.imageDisplay
|
||||||
|
this.imageBucket=$event.imageBucket
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -105,60 +105,11 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.currentLoans.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.currentLoans.dirty){
|
if(this.currentLoans.dirty){
|
||||||
|
return this.constant.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
const modalOption:ModalOptions={
|
const modalOption:ModalOptions={
|
||||||
|
|||||||
@ -138,63 +138,10 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.employmentForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.employmentForm.dirty){
|
if(this.employmentForm.dirty){
|
||||||
|
return this.constant.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -123,63 +123,10 @@ data:any;
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.familyForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.familyForm.dirty){
|
if(this.familyForm.dirty){
|
||||||
|
return this.cons.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -119,63 +119,10 @@ export class PdQuestionFinalRemarkPage {
|
|||||||
|
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this._finalRemarkForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this._finalRemarkForm.dirty){
|
if(this._finalRemarkForm.dirty){
|
||||||
|
return this.constantProvider.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tabChange(){
|
tabChange(){
|
||||||
|
|||||||
@ -195,65 +195,10 @@ export class PdQuestionGeneralInfoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.table("dirty",this.generalForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.generalForm.dirty){
|
if(this.generalForm.dirty){
|
||||||
|
return this.cons.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
// console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
// console.log('if part . this.imageBucket.length',this.imageBucket.length);
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
// console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
// console.log('else part . this.imageBucket.length',this.imageBucket.length)
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
// console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -63,63 +63,10 @@ export class PdQuestionLenderRepresentativePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.representativeForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.representativeForm.dirty){
|
if(this.representativeForm.dirty){
|
||||||
|
return this.constantProvider.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -201,64 +201,11 @@ export class PdQuestionLoansPage {
|
|||||||
this._onDestroy.complete();
|
this._onDestroy.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
// console.log("dirty",this.loanDetailsForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.loanDetailsForm.dirty){
|
if(this.loanDetailsForm.dirty){
|
||||||
|
return this.constant.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
// console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
// console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// this.localInsert(true)
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
// console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -92,63 +92,10 @@ export class PdQuestionNeighbourHoodPage {
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.neighbourhoodForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.neighbourhoodForm.dirty){
|
if(this.neighbourhoodForm.dirty){
|
||||||
|
return this.constant.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -106,63 +106,10 @@ export class PdQuestionOtherIncomePage {
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.otherIncomeForm.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.otherIncomeForm.dirty){
|
if(this.otherIncomeDetails.dirty){
|
||||||
|
return this.constant.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tabChange(){
|
tabChange(){
|
||||||
|
|||||||
@ -229,63 +229,10 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
|
|||||||
// this.getPDImages();
|
// this.getPDImages();
|
||||||
}
|
}
|
||||||
ionViewCanLeave(){
|
ionViewCanLeave(){
|
||||||
console.log("dirty",this.rentalForms.dirty);
|
// this.timer.unsubscribe();
|
||||||
if(this.rentalForms.dirty){
|
if(this.rentalForms.dirty){
|
||||||
|
return this.constprovider.chekAlertOnLeave()
|
||||||
return new Promise((resolve,reject)=>{
|
}
|
||||||
let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data)=>{
|
|
||||||
console.log("d",data);
|
|
||||||
if(data== false){
|
|
||||||
reject();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//AFTER FORM DIRTY CHECK
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve1, reject1) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
//reject1();
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve1();
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//REGULAR CHECK FOR IMAGE IS CAPTURED
|
|
||||||
if (this.imageBucket.length > 0) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
|
||||||
alert.present();
|
|
||||||
alert.onDidDismiss((data) => {
|
|
||||||
console.log("d", data);
|
|
||||||
if (data == false) {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
if(this.tab == '2'){
|
if(this.tab == '2'){
|
||||||
|
|||||||
@ -30,11 +30,14 @@
|
|||||||
<mat-card-content formArrayName="addtional_requirements">
|
<mat-card-content formArrayName="addtional_requirements">
|
||||||
<div *ngFor="let qu of docsCollectedForm.controls.addtional_requirements['controls'];let i=index;" [formGroupName]="i">
|
<div *ngFor="let qu of docsCollectedForm.controls.addtional_requirements['controls'];let i=index;" [formGroupName]="i">
|
||||||
<div *ngFor="let item of queries_docs">
|
<div *ngFor="let item of queries_docs">
|
||||||
<mat-form-field style="width:100%">
|
|
||||||
<mat-placeholder>
|
<mat-placeholder>
|
||||||
|
{{item.add_requirement}}
|
||||||
|
</mat-placeholder>
|
||||||
|
<mat-form-field style="width:100%">
|
||||||
|
<!-- <mat-placeholder>
|
||||||
{{item.add_requirement}}
|
{{item.add_requirement}}
|
||||||
</mat-placeholder>
|
</mat-placeholder> -->
|
||||||
<input matInput type="text" [formControlName]="item.add_req_id" >
|
<input matInput type="text" [formControlName]="item.add_req_id" placeholder="Enter the Text">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import {
|
|||||||
HttpUserEvent
|
HttpUserEvent
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
// import { AuthGuard } from './auth.guard';
|
// import { AuthGuard } from './auth.guard';
|
||||||
import { Observable, of, BehaviorSubject} from 'rxjs';
|
import { Observable, of, BehaviorSubject, throwError} from 'rxjs';
|
||||||
|
|
||||||
// import { Router } from '@angular/router';
|
// import { Router } from '@angular/router';
|
||||||
|
|
||||||
@ -23,6 +23,9 @@ import { ConstantsProvider } from '../constants/constants';
|
|||||||
// import { catchError } from 'rxjs/operators';
|
// import { catchError } from 'rxjs/operators';
|
||||||
import 'rxjs/add/operator/catch';
|
import 'rxjs/add/operator/catch';
|
||||||
import { AwsServiceProvider } from '../aws-service/aws-service';
|
import { AwsServiceProvider } from '../aws-service/aws-service';
|
||||||
|
import { ToastProvider } from '../common-provider/toast';
|
||||||
|
import { NavController, Nav } from 'ionic-angular';
|
||||||
|
import { LoginPage } from '../../pages/login/login';
|
||||||
|
|
||||||
// const cognitoService=this.injector.get(CognitoServiceProvider)
|
// const cognitoService=this.injector.get(CognitoServiceProvider)
|
||||||
// const constantProvider=this.injector.get(ConstantsProvider)
|
// const constantProvider=this.injector.get(ConstantsProvider)
|
||||||
@ -66,10 +69,14 @@ intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpSentEvent |
|
|||||||
}
|
}
|
||||||
return <any>next.handle(this.addToken(req, token)).pipe(
|
return <any>next.handle(this.addToken(req, token)).pipe(
|
||||||
catchError(error => {
|
catchError(error => {
|
||||||
|
console.log("Initial Error",error);
|
||||||
if (error instanceof HttpErrorResponse) {
|
if (error instanceof HttpErrorResponse) {
|
||||||
if((<HttpErrorResponse>error).status) {
|
if((<HttpErrorResponse>error).status) {
|
||||||
return this.handle401Error(req,next,error)
|
return this.handle401Error(req,next,error)
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
return this.handle401Error(req,next,error)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("observable error")
|
console.log("observable error")
|
||||||
return Observable.throw(error);
|
return Observable.throw(error);
|
||||||
@ -78,12 +85,14 @@ intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpSentEvent |
|
|||||||
}
|
}
|
||||||
|
|
||||||
handle401Error(req: HttpRequest<any>, next: HttpHandler,err) {
|
handle401Error(req: HttpRequest<any>, next: HttpHandler,err) {
|
||||||
console.log("err",err)
|
// console.log("err",err)
|
||||||
const cognitoService=this.injector.get(CognitoServiceProvider)
|
const cognitoService=this.injector.get(CognitoServiceProvider)
|
||||||
console.log("entered",this.isRefreshingToken,this.tokenSubject);
|
// console.log("entered",this.isRefreshingToken,this.tokenSubject);
|
||||||
|
|
||||||
if (err instanceof HttpErrorResponse) {
|
if (err instanceof HttpErrorResponse) {
|
||||||
|
|
||||||
if(err.status == 401 && err.error.error.toLowerCase() == 'invalid token!'){
|
if(err.status == 401 && err.error.error.toLowerCase() == 'invalid token!'){
|
||||||
|
console.log("Refreshing Token",err.status)
|
||||||
if (!this.isRefreshingToken) {
|
if (!this.isRefreshingToken) {
|
||||||
this.isRefreshingToken = true;
|
this.isRefreshingToken = true;
|
||||||
|
|
||||||
@ -136,7 +145,8 @@ intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpSentEvent |
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.handleError('Error From Token Interceptor',err);
|
// return Observable.throw("Observable throw",err);
|
||||||
|
return this.handleError('',err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -145,16 +155,25 @@ intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpSentEvent |
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private handleError<T> (operation = 'operation', result?: T) {
|
private handleError<T> (operation = 'operation', error?: HttpErrorResponse) {
|
||||||
return (error: any): Observable<T> => {
|
// return (error: any): Observable<T> => {
|
||||||
if(error instanceof HttpErrorResponse){
|
// if(error instanceof HttpErrorResponse){
|
||||||
console.error("Error: " + error.status);
|
console.log("Error: " ,error);
|
||||||
if(error.status == 401){
|
if(error.status == 401){
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
// this.router.navigate(['/authentication/login']);
|
const NavCtrl=this.injector.get(NavController)
|
||||||
|
NavCtrl.setRoot(LoginPage);
|
||||||
}
|
}
|
||||||
return of(result as T);
|
else
|
||||||
|
// if(error.status == 0)
|
||||||
|
{
|
||||||
|
const toastProvider=this.injector.get(ToastProvider)
|
||||||
|
toastProvider.pdTriggerappmessage("Network Error")
|
||||||
|
}
|
||||||
|
|
||||||
|
return throwError(error)
|
||||||
|
// return of(result as T);
|
||||||
}
|
}
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
@ -178,7 +178,10 @@ apiurl:any;
|
|||||||
|
|
||||||
getlocale(){
|
getlocale(){
|
||||||
let session:any = this.shared.getToken() || null;
|
let session:any = this.shared.getToken() || null;
|
||||||
let userid = session.idToken.payload.locale;
|
let userid=''
|
||||||
|
if(session != null){
|
||||||
|
userid = session.idToken.payload.locale;
|
||||||
|
}
|
||||||
return userid;
|
return userid;
|
||||||
}
|
}
|
||||||
getuserprofile(userid)
|
getuserprofile(userid)
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http';
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {Geolocation} from '@ionic-native/geolocation'
|
import {Geolocation} from '@ionic-native/geolocation'
|
||||||
import { LocationAccuracy } from '@ionic-native/location-accuracy';
|
import { LocationAccuracy } from '@ionic-native/location-accuracy';
|
||||||
|
import { ToastProvider } from '../common-provider/toast';
|
||||||
// import {C} from '../../constants'
|
// import {C} from '../../constants'
|
||||||
// import {environment as ENV} from '../../environments/environment'
|
// import {environment as ENV} from '../../environments/environment'
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ import { LocationAccuracy } from '@ionic-native/location-accuracy';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class ConstantsProvider {
|
export class ConstantsProvider {
|
||||||
public commonimage = "http://pdgenie.com/logo/avatar.jpg";
|
public commonimage = "http://pdgenie.com/logo/avatar.jpg";
|
||||||
constructor(public http: HttpClient,private geo:Geolocation,private locationAccuracy:LocationAccuracy) {
|
constructor(public http: HttpClient,private geo:Geolocation,private locationAccuracy:LocationAccuracy,private toastProvider:ToastProvider) {
|
||||||
console.log('Hello ConstantsProvider Provider');
|
console.log('Hello ConstantsProvider Provider');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +66,7 @@ public commonimage = "http://pdgenie.com/logo/avatar.jpg";
|
|||||||
userPoolId:'ap-south-1_qQ85yQZJO',
|
userPoolId:'ap-south-1_qQ85yQZJO',
|
||||||
clientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile
|
clientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile
|
||||||
}
|
}
|
||||||
return testing;
|
return production;
|
||||||
}
|
}
|
||||||
|
|
||||||
getcurrentDate()
|
getcurrentDate()
|
||||||
@ -312,4 +313,79 @@ searchData(data,val: any,option) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
chekAlertOnLeave(){
|
||||||
|
// ionViewCanLeave(){
|
||||||
|
// console.log("dirty",this.rentalForms.dirty);
|
||||||
|
// if(this.rentalForms.dirty){
|
||||||
|
|
||||||
|
// return new Promise((resolve,reject)=>{
|
||||||
|
// let alert=this.toast.setAlert("Data will be Lost","Are you sure want to Go Back")
|
||||||
|
// alert.present();
|
||||||
|
// alert.onDidDismiss((data)=>{
|
||||||
|
// console.log("d",data);
|
||||||
|
// if(data== false){
|
||||||
|
// reject();
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// //AFTER FORM DIRTY CHECK
|
||||||
|
// if (this.imageBucket.length > 0) {
|
||||||
|
// return new Promise((resolve1, reject1) => {
|
||||||
|
// let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
|
||||||
|
// alert.present();
|
||||||
|
// alert.onDidDismiss((data) => {
|
||||||
|
// console.log("d", data);
|
||||||
|
// if (data == false) {
|
||||||
|
// //reject1();
|
||||||
|
// reject();
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// resolve1();
|
||||||
|
// resolve();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// resolve();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// //REGULAR CHECK FOR IMAGE IS CAPTURED
|
||||||
|
// if (this.imageBucket.length > 0) {
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
|
||||||
|
// alert.present();
|
||||||
|
// alert.onDidDismiss((data) => {
|
||||||
|
// console.log("d", data);
|
||||||
|
// if (data == false) {
|
||||||
|
// reject();
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// resolve();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
return new Promise((resolve,reject)=>{
|
||||||
|
let alert=this.toastProvider.setAlert("Data will be Lost","Are you sure want to Go Back")
|
||||||
|
alert.present();
|
||||||
|
alert.onDidDismiss((data)=>{
|
||||||
|
console.log("d",data);
|
||||||
|
if(data== false){
|
||||||
|
reject();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import { Observable } from 'rxjs';
|
|||||||
import {CacheService} from 'ionic-cache'
|
import {CacheService} from 'ionic-cache'
|
||||||
import { state } from '@angular/animations';
|
import { state } from '@angular/animations';
|
||||||
import { AwsServiceProvider } from '../aws-service/aws-service';
|
import { AwsServiceProvider } from '../aws-service/aws-service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
import { StorageProvider } from '../storage/storage';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Generated class for the QuestionCategoryProvider provider.
|
Generated class for the QuestionCategoryProvider provider.
|
||||||
@ -17,7 +19,7 @@ const ttl = 60 * 60 * 24 * 7;
|
|||||||
|
|
||||||
export class QuestionCategoryProvider {
|
export class QuestionCategoryProvider {
|
||||||
apiurl:any;
|
apiurl:any;
|
||||||
constructor(private _aws: AwsServiceProvider,public http: HttpClient,public constant:ConstantsProvider,private cache:CacheService) {
|
constructor(private _aws: AwsServiceProvider,public http: HttpClient,public constant:ConstantsProvider,private cache:CacheService,private ionicStrorageService:StorageProvider) {
|
||||||
console.log('Hello QuestionCategoryProvider Provider');
|
console.log('Hello QuestionCategoryProvider Provider');
|
||||||
this.apiurl = constant.environment();
|
this.apiurl = constant.environment();
|
||||||
this.apiurl=this.apiurl.url
|
this.apiurl=this.apiurl.url
|
||||||
@ -142,15 +144,89 @@ stockFormAccess(pdid: any,companyid: any) {
|
|||||||
savePDImages(imagesDetails)
|
savePDImages(imagesDetails)
|
||||||
{
|
{
|
||||||
let record = {'records':imagesDetails};
|
let record = {'records':imagesDetails};
|
||||||
return this.http.post(this.apiurl+'savePDPhotos',record);
|
return this.http.post(this.apiurl+'savePDPhotos',record)
|
||||||
|
.map(response=>{
|
||||||
|
console.log(response);
|
||||||
|
this.checkSavedPics(response['dataStatus'],imagesDetails)
|
||||||
|
return response;
|
||||||
|
},err=>{
|
||||||
|
console.log("Error in savePDImages",err)
|
||||||
|
this.checkSavedPics('',imagesDetails)
|
||||||
|
// return err
|
||||||
|
})
|
||||||
}
|
}
|
||||||
getPDImages(records){
|
getPDImages(records){
|
||||||
let record={'records':records};
|
let record={'records':records};
|
||||||
return this.http.post(this.apiurl+'getPDImages',record);
|
return this.http.post(this.apiurl+'getPDImages',record)
|
||||||
|
// .map(response=>{
|
||||||
|
// console.log(response);
|
||||||
|
// this.checkSavedPics(response['dataStatus'],records)
|
||||||
|
// return response;
|
||||||
|
// },err=>{
|
||||||
|
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
getFamilyDetails(pdid:any){
|
getFamilyDetails(pdid:any){
|
||||||
return this.http.post<any>(this.apiurl+'getFamilyDetails',{"pd_id":pdid})
|
return this.http.post<any>(this.apiurl+'getFamilyDetails',{"pd_id":pdid})
|
||||||
}
|
}
|
||||||
|
checkSavedPics(response,sended_param){
|
||||||
|
console.log("checkSavedPics",response,sended_param);
|
||||||
|
this.ionicStrorageService.getItem('pd_images').then(local_arr=>{
|
||||||
|
switch(response){
|
||||||
|
case true:
|
||||||
|
if(local_arr){
|
||||||
|
console.log("local pics",local_arr)
|
||||||
|
let checked= local_arr.filter((val,index)=>{
|
||||||
|
if(val.form_value.length > 0){
|
||||||
|
let curr_form_value=val.form_value.filter(form_val=>form_val.Name != sended_param.images[0].Name)
|
||||||
|
console.log("filtered",curr_form_value);
|
||||||
|
if(curr_form_value.length > 0){
|
||||||
|
val.form_value=curr_form_value
|
||||||
|
// alert("Updated")
|
||||||
|
return val
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
val.form_value=[]
|
||||||
|
// alert("Deleted")
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(checked.length > 0){
|
||||||
|
this.ionicStrorageService.updateImagesLocally(checked[0]);
|
||||||
|
}
|
||||||
|
console.log(checked[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case false || '' :
|
||||||
|
if(local_arr){
|
||||||
|
let checked= local_arr.filter((val,index)=>{
|
||||||
|
if(val.form_value.length > 0){
|
||||||
|
let curr_form_value=val.form_value.filter(form_val=>form_val.Name == sended_param.images[0].Name)
|
||||||
|
console.log("Error filtered",curr_form_value);
|
||||||
|
if(curr_form_value.length > 0){
|
||||||
|
curr_form_value[0].isLoader=false;
|
||||||
|
curr_form_value[0].isSaved=false;
|
||||||
|
// alert("Updated status")
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// alert("Deleted status")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(checked.length > 0){
|
||||||
|
this.ionicStrorageService.updateImagesLocally(checked[0]);
|
||||||
|
}
|
||||||
|
console.log(checked);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
getAddressDetails(pdid:any){
|
getAddressDetails(pdid:any){
|
||||||
return this.http.post<any>(this.apiurl+'getPDAddress',{'pd_id':pdid})
|
return this.http.post<any>(this.apiurl+'getPDAddress',{'pd_id':pdid})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export class StorageProvider {
|
|||||||
console.log('Hello StorageProvider Provider');
|
console.log('Hello StorageProvider Provider');
|
||||||
}
|
}
|
||||||
insertData(data){
|
insertData(data){
|
||||||
this.toast.pdTriggerappmessage(this.storage.driver);
|
// this.toast.pdTriggerappmessage(this.storage.driver);
|
||||||
const storage_key=data.pd_id
|
const storage_key=data.pd_id
|
||||||
console.log("storage provider")
|
console.log("storage provider")
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@ -63,6 +63,67 @@ insertData(data){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
insertPDImageLocally(data){
|
||||||
|
this.toast.pdTriggerappmessage(this.storage.driver);
|
||||||
|
const storage_key=data.storage_key
|
||||||
|
console.log("storage provider")
|
||||||
|
console.log(data);
|
||||||
|
console.log(JSON.stringify(data));
|
||||||
|
|
||||||
|
console.log("sto",this.storage.get(storage_key))
|
||||||
|
return this.storage.get(storage_key).then((res)=>{
|
||||||
|
console.log("res",res)
|
||||||
|
if(res != null ){
|
||||||
|
|
||||||
|
if( res.length != 0 && res.length != undefined){
|
||||||
|
// res.forEach((value)=>{
|
||||||
|
// if(value.form_id==data.form_id){
|
||||||
|
// option=true
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
let current_form=res.filter(val=>val.form_id!=data.form_id)
|
||||||
|
console.log("current",current_form);
|
||||||
|
if(current_form.length > 0){
|
||||||
|
let value:any=current_form
|
||||||
|
let temp={form_id:data.form_id,form_value:data.img_bucket}
|
||||||
|
value.push(temp)
|
||||||
|
return this.storage.set(storage_key,value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// let old_Data:any=[]
|
||||||
|
// old_Data=res
|
||||||
|
// console.log("old data",old_Data)
|
||||||
|
// old_Data.push(data)
|
||||||
|
// return this.storage.set(storage_key,old_Data)
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
//res.push(data)
|
||||||
|
// let dataValue=Object.keys(data).map(function(key){
|
||||||
|
// return data[key];
|
||||||
|
// })
|
||||||
|
let value:any=[]
|
||||||
|
let temp={form_id:data.form_id,form_value:data.img_bucket}
|
||||||
|
value.push(temp)
|
||||||
|
return this.storage.set(storage_key,value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
updateImagesLocally(data){
|
||||||
|
let storage_key='pd_images'
|
||||||
|
this.getItem(storage_key).then(result=>{
|
||||||
|
if(result){
|
||||||
|
let filter_result=result.filter(val=>val.form_id != data.form_id)
|
||||||
|
filter_result.push(data)
|
||||||
|
return this.storage.set(storage_key,filter_result);
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
retrieveLocalStorage(data){
|
retrieveLocalStorage(data){
|
||||||
const storage_key=data.pd_id
|
const storage_key=data.pd_id
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user