Fairoj : Frontend watermark implemented & business document name mandatory

This commit is contained in:
venbatechnologies@gmail.com 2019-11-01 20:16:13 +05:30
parent 46139764b7
commit bd460ddd49
59 changed files with 1783 additions and 765 deletions

View File

@ -1 +1 @@
{"version":3,"sources":["../../@angular/common/http (ignored)"],"names":[],"mappings":";;;;;AAAA,e","file":"0.js","sourcesContent":["/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// @angular/common/http (ignored)\n// module id = 719\n// module chunks = 0"],"sourceRoot":""}
{"version":3,"sources":["../../@angular/common/http (ignored)"],"names":[],"mappings":";;;;;AAAA,e","file":"0.js","sourcesContent":["/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// @angular/common/http (ignored)\n// module id = 721\n// module chunks = 0"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,4 @@
{
"java.configuration.updateBuildConfiguration": "disabled"
"java.configuration.updateBuildConfiguration": "disabled",
"git.ignoreLimitWarning": true
}

5
package-lock.json generated
View File

@ -8244,6 +8244,11 @@
}
}
},
"watermarkjs": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/watermarkjs/-/watermarkjs-2.0.0.tgz",
"integrity": "sha1-adw+sb6qT3DBGJsgLj3mWF7NWyI="
},
"webpack": {
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-3.12.0.tgz",

View File

@ -79,6 +79,7 @@
"rxjs-compat": "^6.3.1",
"sw-toolbox": "3.6.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "~4.2.2",
"watermarkjs": "^2.0.0",
"zone.js": "0.8.18"
},
"devDependencies": {

View File

@ -142,6 +142,7 @@ import { OfficerNotesModalPage } from '../pages/officer-notes-modal/officer-note
import { QueriesDocsPage } from '../pages/queries-docs/queries-docs';
import {Market} from '@ionic-native/market'
import { PdGeneralImagesModule } from '../pages/pd-general-images/Pd-general-images.module';
@NgModule({
declarations: [
@ -191,7 +192,7 @@ import {Market} from '@ionic-native/market'
PdQuestionBusinessAssetsPage,
PdQuestionBusinessBankingPage,
PdQuestionAssessedBusinessIncomePage,
PdGeneralImagesPage,
PdQuestionSalaryInfoPage,
PdQuestionAssessedSummaryPage,
PdQuestionAssessedDailyPurchasePage,
@ -243,7 +244,8 @@ import {Market} from '@ionic-native/market'
MatStepperModule,HttpClientModule,IonicImageViewerModule,NgxMatSelectSearchModule,
ContentLoaderModule,
IonicStorageModule.forRoot(),
CacheModule.forRoot()
CacheModule.forRoot(),
PdGeneralImagesModule
],
bootstrap: [IonicApp],
@ -294,7 +296,7 @@ import {Market} from '@ionic-native/market'
PdQuestionBusinessAssetsPage,
PdQuestionBusinessBankingPage,
PdQuestionAssessedBusinessIncomePage,
PdGeneralImagesPage,
PdQuestionSalaryInfoPage,
PdQuestionAssessedSummaryPage,
PdQuestionAssessedDailyPurchasePage,

BIN
src/assets/img/PD_watermark.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -247,7 +247,7 @@
</mat-card-content>
</div>
</mat-card><br/>
<mat-card style="border-radius:10px">
<!-- <mat-card style="border-radius:10px">
<br/>
<mat-card-header>
<mat-card-title><h5>PD Photos</h5></mat-card-title>
@ -294,7 +294,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card><br/><br/>
</mat-card> -->
<div #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div><br/><br/>
</ion-content>
<ion-footer *ngIf="address_pd_id != null">

View File

@ -1,4 +1,4 @@
import { Component,ViewChild } from '@angular/core';
import { Component,ViewChild, ElementRef } from '@angular/core';
import { NavController, NavParams,AlertController, Content,ModalController,ModalOptions } from 'ionic-angular';
import { FormBuilder } from '@angular/forms';
// import {MomentDateAdapter} from '@angular/material-moment-adapter';
@ -36,6 +36,7 @@ import {BackgroundGeolocation,
BackgroundGeolocationResponse,
BackgroundGeolocationEvents} from '@ionic-native/background-geolocation'
import { OfficerNotesModalPage } from '../officer-notes-modal/officer-notes-modal';
/**
* Generated class for the InputPage page.
*
@ -89,6 +90,12 @@ checkOtpAccess:boolean = false;
docs_collected: any;
docs_collected_hide: boolean=true;
// address_child_schedule_time:any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
@ViewChild('picContent') picContent:ElementRef
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public statusBar:StatusBar,public platform: Platform,public launchNavigator:LaunchNavigator,
public aws:AwsServiceProvider,public pdDetails:PdtriggerProvider,public geolocation:Geolocation,
@ -116,6 +123,7 @@ checkOtpAccess:boolean = false;
this.applicatentDetails = this.navParams.get('pdDetails');
this.pd_value_params={pd_id:this.applicatentDetails.pd_id,form_id:null,company_id:null}
// this.getFullPD();
@ -154,7 +162,7 @@ checkOtpAccess:boolean = false;
ionViewDidLoad() {
this.setPermission();
console.log('ionViewDidLoad InputPage' );
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave()
{
@ -826,35 +834,42 @@ else{
this.imageBucket.splice(index,1)
}
capture(){
// capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
if(res != 'error'){
this.constant.getGeoTag().then(geoCoordinates=>{
// if(res != 'error'){
// this.constant.getGeoTag().then(geoCoordinates=>{
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
}
// }
capture(){
this.picContent.nativeElement.scrollIntoView({behaviour:"smooth",block:"start"})
setTimeout(()=>{
this.child.capture()
})
}
customfilter(res){

View File

@ -0,0 +1,55 @@
import { NgModule } from "@angular/core";
import { MatButtonModule, MatButtonToggleModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatDialogModule, MatListModule, MatExpansionModule, MatGridListModule, MatIconModule, MatInputModule, MatMenuModule, MatNativeDateModule, MatPaginatorModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatRippleModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSlideToggleModule, MatSnackBarModule, MatSortModule, MatTableModule, MatTabsModule, MatAutocompleteModule, MatToolbarModule, MatTooltipModule, MatStepperModule } from "@angular/material";
import { PdGeneralImagesPage } from "./pd-general-images";
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { IonicModule } from "ionic-angular";
import { MyApp } from "../../app/app.component";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { HttpClientModule } from "@angular/common/http";
import { IonicImageViewerModule } from "ionic-img-viewer";
@NgModule({
imports: [ BrowserModule,ReactiveFormsModule,FormsModule,
IonicModule.forRoot(MyApp),
BrowserAnimationsModule,
MatAutocompleteModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatDatepickerModule,
MatDialogModule,MatListModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatStepperModule,HttpClientModule,IonicImageViewerModule],
exports: [PdGeneralImagesPage],
declarations: [PdGeneralImagesPage],
providers: [],
})
export class PdGeneralImagesModule {
}

View File

@ -1,4 +1,4 @@
<ion-header>
<!-- <ion-header>
<ion-navbar color="optblue">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
@ -26,7 +26,7 @@
<div *ngIf="img.name == ''">
<input matInput type="text" name="docName" (blur)="docnames($event.target.value,i,img.image)" placeholder="File Name" required>
<!-- <mat-error *ngIf="pdforms.controls['docName'].hasError('required')">File Name Required</mat-error> -->
</div>
<div *ngIf="img.name !=''">
{{img.Name}}
@ -34,10 +34,10 @@
</ion-col>
</ion-row>
<ion-row>
<!-- <ion-buttons >
<ion-buttons >
<ion-button color="optblue"
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<!-- </ion-buttons> -->
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button>
</ion-buttons>
</ion-row>
</mat-card>
<ion-footer>
@ -49,4 +49,60 @@
</ion-row>
</ion-footer>
</ion-content>
</ion-content> -->
<mat-card>
<mat-card-header *ngIf="pdDetails.form_id == null">
<mat-card-title><h5>PD Photos</h5></mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
<ion-grid *ngIf="imageDisplay.length >0 ">
<ion-row>
<ion-col col-6 *ngFor="let image of imageDisplay; let i=index" no-padding>
<a *ngIf="image.type != 'jpg' && image.type != 'png' && image.type != 'jpeg'" class="doc-image-bucket" href="{{image.image}}" target="_blank" style="text-decoration: none"><img src="../../assets/icon/PDF_file_icon.svg" class="doc_icon"><br/> <strong>{{image.Name}}</strong></a>
<div *ngIf="image.type == 'jpg' || image.type == 'png' || image.type == 'jpeg'">
<img src="{{image.image}}" imageViewer class="doc-image-bucket"><br/>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<div *ngIf="pdDetails.form_id == '5'"> <label *ngIf="image.is_show_report != '0'"><small>Shown On Report</small></label></div>
<input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)">
<button *ngIf="image.option != 'dummy'" ion-button clear color="optblue" (click)="removeImg(i)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
</div>
</ion-col>
<hr/>
</ion-row>
<hr/>
<hr/>
</ion-grid>
<ion-grid *ngIf="imageBucket.length >0 ">
<label style="font-size:14px;color:gray">Newly Captured Pics</label><hr/><br/>
<ion-row>
<ion-col col-6 *ngFor="let image of imageBucket; let i=index" no-padding>
<img src="{{image.image}}" imageViewer class="doc-image-bucket"><br/>
<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)">
<div *ngIf="pdDetails.form_id == '5'">
<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-button value=1>Shown On Report</mat-radio-button>
<mat-radio-button value=0>Hide On Report</mat-radio-button>
</mat-radio-group>
</div>
<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>
<hr/>
</ion-row>
</ion-grid>
<div #atLast></div>
</mat-card-content>
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>

View File

@ -1,3 +1,20 @@
page-pd-general-images {
/*FOR IMAGES*/
.doc-image-bucket{
padding:0 5px 0 0 !important;
height: 180px !important;
color:black;
//width:130px;
//border:3px solid black;
//border-radius: 20px;
//background-color: gray;
}
input{
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
}

View File

@ -1,8 +1,11 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Component, ViewChild, NgModule, Input, ElementRef,OnDestroy, HostListener, Output, EventEmitter } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { CameraProvider } from '../../providers/common-provider/camera';
import { QuestionCategoryProvider } from '../../providers/question-category/question-category';
import { ToastProvider } from '../../providers/common-provider/toast';
import { LoadingProvider } from '../../providers/common-provider/loading';
import { ConstantsProvider } from '../../providers/constants/constants';
import * as watermark from 'watermarkjs'
/**
* Generated class for the PdGeneralImagesPage page.
@ -12,6 +15,7 @@ import { ToastProvider } from '../../providers/common-provider/toast';
*/
@Component({
selector: 'page-pd-general-images',
templateUrl: 'pd-general-images.html',
@ -23,53 +27,347 @@ export class PdGeneralImagesPage {
count:any = 0;
saveAccess:boolean =false;
FormId:any = '';
constructor(public navCtrl: NavController, public navParams: NavParams,public camera:CameraProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider) {
imageDisplay: any=[];
@Input()pd_values:any;
pdDetails: any={pd_id:'',form_id:'',company_id:''};
imageBucket:any=[]
@ViewChild('atLast') cardLast :ElementRef;
geoCoordinates: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) {
this.applicatentDetails = this.navParams.get('pdDetails');
this.FormId = this.navParams.get('FormId');
// this.applicatentDetails = this.navParams.get('pdDetails');
}
ngAfterViewInit(){
this.pdDetails=this.pd_values
console.log("ionViewDidEnter",this.pdDetails)
this.getPDImages()
console.log("avctrl",this.navCtrl)
}
// takePicture()
// {
// this.camera.getpicture().then(image=>
// {
// this.count = this.count+1;
// this.cameraArr.push({'image':image,'name':''});
// });
// }
// removeimage(i)
// {
// this.count = this.count - 1;
// this.cameraArr.splice(i,1);
// }
// docnames(doc,i,img)
// {
// this.cameraArr[i] = {'image':img,'Name':doc};
// // console.log(JSON.stringify(this.pddocdata));
// }
// savePDImages()
// {
// this.saveAccess = true;
// let records :any = {'pd_id':this.applicatentDetails.pd_id,'formid':''};
// records.images = this.cameraArr;
// this.qustCat.savePDImages(records).subscribe(res=>
// {
// if(res['dataStatus']==true){
// this.saveAccess = false;
// this.navCtrl.pop();
// this.toast.pdTriggerappmessage('Record Saved Successfully.!');
// }
// })
// }
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
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 }
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
if(val['records'].length>0){
val['records'].forEach(result=>{
if(result.pd_document_name != null){
let split=result.pd_document_name.split('.')
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy','type':split[1]})
}
else{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy','type':''})
}
})
console.log("dis",this.imageDisplay);
let imageData={imageDisplay:this.imageDisplay,imageBucket:this.imageBucket}
this.imageDatalength_forParent.emit(imageData)
}
}
})
}
capture(value?) {
console.log("value", value)
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res => {
if (res != 'error') {
// this.loading.imageWatermarkLoader()
// this.constant.getGeoTag().then(geoCoordinates=>{
// if(geoCoordinates){
// this.geoCoordinates=geoCoordinates
// }
// },err=>{
// // this.loading.dismissLoader()
// })
this.geoCoordinates=localStorage.getItem('current_coordinates')
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
let bucket_value: any;
if (this.pdDetails.form_id != "5") {
bucket_value = {
'image': watermarkedImage,
'Name': '',
'link': this.geoCoordinates,
}
}
else {
//for address form is_show_report handle
bucket_value = {
'image': watermarkedImage,
'Name': '',
'link': this.geoCoordinates,
'is_show_report': ''
}
}
// for name given from forms
if (value && value != '' && value != undefined) {
if (this.imageBucket.length != 0 && this.pdDetails.form_id == '13') { //FOR BUSINESS FORM NAME BOARD SEEN
this.imageBucket.forEach((res, index) => {
if (res.Name == value) {
// console.log("res[index]", res[index])
delete res[index]
}
bucket_value.Name = value
// this.imageBucket.push(bucket_value);
})
}
// this.loading.dismissLoader()
bucket_value.Name = value
// this.imageBucket.push({ 'image': res, 'Name': value, 'link': geoCoordinates });
this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
}
else {
bucket_value.Name = ''
// this.imageBucket.push({'image':raw_img,'Name':'','link':geoCoordinates});
console.log("3rd", watermarkedImage)
}
this.imageBucket.push(bucket_value)
// console.log("geo promise",geoCoordinates)
//FOR GETTING THE DOC NAME FROM ALERT
if (!value || value == '' || value == undefined) {
// this.loading.dismissLoader()
let alert = this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value => {
if (value) {
this.imageBucket[this.imageBucket.length - 1].Name = value.Name
}
this.cardLast.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
})
}
// this.loading.dismissLoader()
})
}
}, error => {
console.log("Camera Error ", JSON.stringify(error));
})
}
addWatermarks(base64Img){
return new Promise((resolve,reject)=>{
let raw_img=base64Img
this.constant.getGeoTag().then(geoCoordinates=>{
let geoCords=geoCoordinates
console.log("rawimg",raw_img)
watermark([raw_img, 'assets/img/PD_watermark.png'])
.image(watermark.image.upperRight())
.then(img => {
raw_img = img.src;
});
var today = new Date();
let today_loc=today.toLocaleString('en-US', {timeZone: "Asia/Kolkata"})
console.log(today_loc)
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = 'Date : '+today_loc;
let Location=`Location : `+geoCords
console.log(date)
let text=watermark.text
setTimeout(()=>{
watermark([raw_img])
.image(text.upperLeft(dateTime, '18px serif', '#b31105', 0.9,48))
.then(img => {
raw_img = img.src;
console.log("2d",raw_img)
});
setTimeout(()=>{
watermark([raw_img])
.image(text.upperLeft(Location, '18px serif', '#b31105', 0.9))
.then(img => {
raw_img=img.src
console.log("3rd",raw_img)
resolve(img.src)
});
})
},1000);
})
return raw_img
})
}
sendImage(){
this.loading.loaderForSendImage()
// console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.pdDetails.form_id,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id,
'rental_count_id':this.pdDetails.rental_count_id,
}
// console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
// this.imageDisplay.push(this.imageBucket)
// console.log("length",this.imageDisplay.length)
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Something went wrong');
}
this.loading.dismissLoader();
},err=>{
this.loading.dismissLoader();
this.toast.pdTriggerappmessage("Network Error")
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdGeneralImagesPage');
changeNameForBucket(value,index,img){
this.imageBucket[index]={'image':img,'Name':value}
}
removeImg(index){
this.imageDisplay.splice(index,1);
}
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
changeOptions(event: any,index: any){
let name = this.imageBucket[index].value
let length = this.imageDisplay.length;
this.imageDisplay.forEach(result=>{
if(name == 'Approach to PD Location ' && event == 1){
result.is_show_report = 0;
}
})
this.imageBucket.forEach(result=>{
if(name == 'Approach to PD Location ' && event == 1){
// this.AppxPDLocationImgValid = true;
// console.log('name',name);
// console.log('this.imageBucket.length',this.imageBucket.length);
result.is_show_report=0;
}
})
this.imageBucket[index].is_show_report=event;
}
ngCanDestroy() { // or some other name
console.log("canDestroy")
}
@HostListener('window:beforeunload', ['$event'])
ngOnDestroy($event){
console.log("Destroy event called")
console.log("leave")
// 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();
// }
// })
// })
// }
}
takePicture()
{
this.camera.getpicture().then(image=>
{
this.count = this.count+1;
this.cameraArr.push({'image':image,'name':''});
});
}
// ngOnChanges(){
// console.log("changes")
// }
// ngDoCheck(){
// console.log("ngDoCheck")
// }
// ionViewDidLoad() {
// console.log('ionViewDidLoad');
// }
// ionViewWillEnter() {
// console.log('ionViewWillEnter');
// }
// ionViewDidEnter() {
// console.log('ionViewDidEnter');
// }
// ionViewWillLeave() {
// console.log('ionViewWillLeave');
// }
// ionViewDidLeave() {
// console.log('ionViewDidLeave');
// }
// ionViewWillUnload() {
// console.log('ionViewWillUnload');
// }
// ionViewCanEnter() {
// console.log('ionViewCanEnter');
// }
removeimage(i)
{
this.count = this.count - 1;
this.cameraArr.splice(i,1);
}
docnames(doc,i,img)
{
this.cameraArr[i] = {'image':img,'Name':doc};
// console.log(JSON.stringify(this.pddocdata));
}
savePDImages()
{
this.saveAccess = true;
let records :any = {'pd_id':this.applicatentDetails.pd_id,'formid':''};
records.images = this.cameraArr;
this.qustCat.savePDImages(records).subscribe(res=>
{
if(res['dataStatus']==true){
this.saveAccess = false;
this.navCtrl.pop();
this.toast.pdTriggerappmessage('Record Saved Successfully.!');
}
})
}
}

View File

@ -53,7 +53,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -97,7 +97,11 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="pdQuestionAddress" *ngSwitchCase="'0'">
<mat-card class="box">

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, AlertController, ModalController, ModalOptions } from 'ionic-angular';
import {FormBuilder,FormControl,FormArray, FormGroup,Validators} from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
@ -15,6 +15,7 @@ import {StorageProvider} from '../../../providers/storage/storage'
import 'rxjs/add/observable/interval';
import { DatePipe } from '@angular/common';
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
// import{CacheService} from 'ionic-cache-observable'
/**
* Generated class for the PdQuestionAddressPage page.
@ -91,6 +92,9 @@ export class PdQuestionAddressPage {
alertnativeCityData: any=[];
alertnativePincodeData: any=[];
lender_short_name: any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,
@ -161,6 +165,7 @@ export class PdQuestionAddressPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null,}
}
ionViewDidLoad() {
@ -168,7 +173,7 @@ export class PdQuestionAddressPage {
console.log("ionViewDidLoad PdQuestionAddressPage")
//this.getaddressForm();
// this.getaddressFormFromLocal(); //FOR GETTING DATA FROM LOCAL STORAGE IF IT IS TRUE
this.getPDImages();
// this.getPDImages();
}
tabChange(){
@ -1478,41 +1483,56 @@ else{
this.imageBucket.splice(index,1)
}
savePhoto(flag){
// savePhoto(flag){
let currentDate = this.pipe.transform(new Date(), 'yyyy-MM-dd hh:mm:ss');
this.camera.getPicture({
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
targetWidth: 500,
targetHeight: 600,
correctOrientation: true,
encodingType: this.camera.EncodingType.PNG,
saveToPhotoAlbum:false
}).then((imageData)=>{
// let currentDate = this.pipe.transform(new Date(), 'yyyy-MM-dd hh:mm:ss');
// this.camera.getPicture({
// quality: 100,
// destinationType: this.camera.DestinationType.DATA_URL,
// targetWidth: 500,
// targetHeight: 600,
// correctOrientation: true,
// encodingType: this.camera.EncodingType.PNG,
// saveToPhotoAlbum:false
// }).then((imageData)=>{
this.constant.getGeoTag().then(geoCoordinates=>{
// this.constant.getGeoTag().then(geoCoordinates=>{
this.base64='data:image/png;base64,'+imageData
if(flag == 1){
this.imageBucket.push({'image':this.base64,'link':geoCoordinates,'Name':'','is_show_report':''});
// this.imageDisplay.push({'image':this.base64,'Name':''})
// this.base64='data:image/png;base64,'+imageData
// if(flag == 1){
// this.imageBucket.push({'image':this.base64,'link':geoCoordinates,'Name':'','is_show_report':''});
// // this.imageDisplay.push({'image':this.base64,'Name':''})
this.getImageName(this.imageBucket.length-1)
}else if(flag == 2){
// this.getImageName(this.imageBucket.length-1)
// }else if(flag == 2){
this.imageBucket.push({'image':this.base64,'link':geoCoordinates,'Name':'Approach to PD Location ( ' + currentDate + ' )','is_show_report':''});
}
})
},(err)=>{
// this.imageBucket.push({'image':this.base64,'link':geoCoordinates,'Name':'Approach to PD Location ( ' + currentDate + ' )','is_show_report':''});
// }
// })
// },(err)=>{
})
// })
// this.tab='1';
// // this.content.scrollToBottom();
// // let dimensions = this.content.getContentDimensions();
// // this.content.scrollTo(0, dimensions.contentHeight+100, 100);
// // this.inputFocus.setFocus();
// }
savePhoto(flag){
this.tab='1';
// this.content.scrollToBottom();
// let dimensions = this.content.getContentDimensions();
// this.content.scrollTo(0, dimensions.contentHeight+100, 100);
// this.inputFocus.setFocus();
}
setTimeout(()=>{
if(flag == 1){
this.child.capture()
// this.imageDisplay.push({'image':this.base64,'Name':''})
}else if(flag == 2){
let currentDate = this.pipe.transform(new Date(), 'yyyy-MM-dd hh:mm:ss');
let name='Approach to PD Location ( ' + currentDate + ' )'
this.child.capture(name)
}
})
}
getImageName(index){

View File

@ -20,9 +20,9 @@
<ion-content padding>
<mat-card #picContent>
<!--<mat-card #picContent>
<mat-card-content>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button below to capture</strong></mat-label>
<ion-grid *ngIf="imageDisplay.length >0 ">
@ -59,7 +59,11 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<!-- <ion-fab bottom right mini>
<button mini style="margin-bottom: 10px" ion-fab color="optblue" slot="fixed" (click)="capture()"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button></ion-fab> -->
</ion-content>

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {CameraProvider} from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
@ -6,6 +6,7 @@ import {ToastProvider} from '../../../providers/common-provider/toast'
import {QuestionCategoryProvider} from '../../../providers/question-category/question-category'
import { QueueScheduler } from 'rxjs/internal/scheduler/QueueScheduler';
import {ConstantsProvider} from '../../../providers/constants/constants'
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionAssessedImagesPage page.
*
@ -23,6 +24,10 @@ export class PdQuestionAssessedImagesPage {
pdDetails:any;
FormId:any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,private cameraProvider:CameraProvider,
private loading:LoadingProvider,private toast:ToastProvider,public qustCat:QuestionCategoryProvider,private constantProvider:ConstantsProvider ) {
@ -30,11 +35,12 @@ export class PdQuestionAssessedImagesPage {
this.pdDetails=this.navParams.get('pdDetails');
this.FormId=this.navParams.get('formdetails')
console.log("pd",this.pdDetails,"form",this.FormId)
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:this.pdDetails.company_id}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionAssessedImagesPage');
this.getPDImages();
// this.getPDImages();
}
/*IMAGE SECTION*/
@ -73,31 +79,38 @@ export class PdQuestionAssessedImagesPage {
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constantProvider.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constantProvider.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// }
capture(){
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()

View File

@ -28,7 +28,7 @@
</ion-header>
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found</strong></mat-label>
@ -48,7 +48,7 @@
<hr/>
<hr/>
<!-- </ion-grid> -->
<ion-grid *ngIf="imageBucket.length >0 ">
<label style="font-size:14px;color:gray">Newly Captured Pics</label><br/>
<ion-row>
@ -66,7 +66,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="AssetsDetailsForm" *ngSwitchCase="'0'">
@ -349,7 +352,7 @@
<!-- <mat-label>Vintage</mat-label> -->
<mat-label>Age of Asset in Years</mat-label>
<input type="tel" matInput autocomplete="off" placeholder="eg.99" formControlName="vintage_personal" minlength="1" maxlength="2" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,3)">
<input type="tel" matInput autocomplete="off" placeholder="eg.99" formControlName="vintage_personal" minlength="1" maxlength="2" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,2)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>

View File

@ -8,6 +8,7 @@ import { ToastProvider } from '../../../providers/common-provider/toast';
import {Camera} from '@ionic-native/camera'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { LoadingProvider } from '../../../providers/common-provider/loading';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
// import {CacheService} from 'ionic-cache-observable'
// import { Observable } from 'rxjs/Observable';
@ -66,6 +67,8 @@ export class PdQuestionAssestsPage {
complete_status: boolean = false;
spinner_access:boolean=false
lender_short_name: any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
// data:Observable <any>;
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,
@ -95,11 +98,12 @@ export class PdQuestionAssestsPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionAssestsPage');
console.log("Form",this.AssetsDetailsForm)
this.getPDImages();
// this.getPDImages();
this.getAssetDetails();
}
// present_actionsheet(){
@ -842,6 +846,7 @@ export class PdQuestionAssestsPage {
calculateVintagePurchase(value: any, controlKey: any, type: number) {
if (type == 1) { }
else if (type == 2) {
let control: any = <FormArray>this.AssetsDetailsForm.controls['assets_details'];
let vintage_personal=control.controls[controlKey].controls['vintage_personal'].value
@ -854,21 +859,34 @@ export class PdQuestionAssestsPage {
let years = Math.floor(value/12);
let months = value % 12;
console.log(years,months);
vintage_personal=vintage_personal == '' ? 0 : vintage_personal
vintage_personal=parseInt(vintage_personal)+ years
control.controls[controlKey].controls['asset_months'].setValue(months)
}
let currentMonth:any=new Date().getMonth()+1
let monthMinus:any=0;
control.controls[controlKey].controls['vintage_personal'].setValue(vintage_personal)
control.controls[controlKey].controls['purchase_year'].setValue(vintage_personal != '' ? parseInt(this.currentYear) - parseInt(vintage_personal) : '');
if(control.controls[controlKey].controls['asset_months'].value != ''){
if(parseInt(currentMonth)-parseInt(control.controls[controlKey].controls['asset_months'].value) < 0){
monthMinus=parseInt(currentMonth)-parseInt(control.controls[controlKey].controls['asset_months'].value)
if(monthMinus > -12){
monthMinus=1
}
else{
monthMinus=2
}
}
}
if(control.controls[controlKey].controls['asset_months'].value > 0 && (vintage_personal != '' || vintage_personal != 0)){
// vintage_personal=parseInt(vintage_personal)-1
control.controls[controlKey].controls['purchase_year'].setValue(control.controls[controlKey].controls['purchase_year'].value - 1);
control.controls[controlKey].controls['purchase_year'].setValue(control.controls[controlKey].controls['purchase_year'].value - monthMinus);
}
else if(control.controls[controlKey].controls['asset_months'].value > 0 && control.controls[controlKey].controls['asset_months'].value <12 && (vintage_personal == '' || vintage_personal == 0)){
control.controls[controlKey].controls['purchase_year'].setValue(parseInt(this.currentYear));
control.controls[controlKey].controls['purchase_year'].setValue(parseInt(this.currentYear)-monthMinus);
}
}
else if (type == 3) {
@ -937,39 +955,46 @@ export class PdQuestionAssestsPage {
}
})
}
// savePhoto(){
// let num_of_images=(this.imageBucket.length+1)+(this.imageDisplay.length+1)
// console.log("num of images",num_of_images)
// // if(num_of_images <=10){
// this.camera.getPicture({
// quality: 100,
// destinationType: this.camera.DestinationType.DATA_URL,
// targetWidth: 500,
// targetHeight: 600,
// correctOrientation: true,
// encodingType: this.camera.EncodingType.PNG,
// saveToPhotoAlbum:false
// }).then((imageData)=>{
// this.constprovider.getGeoTag().then(geoCoordinates=>{
// // console.log("geo promise",geoCoordinates)
// this.base64='data:image/png;base64,'+imageData
// this.imageBucket.push({'image':this.base64,'Name':'','link':geoCoordinates});
// // this.imageDisplay.push({'image':this.base64,'Name':''})
// this. getImageName(this.imageBucket.length-1)
// })
// },(err)=>{
// console.log("error",err);
// })
// this.tab='1';
// // this.content.scrollToBottom();
// // let dimensions = this.content.getContentDimensions();
// // this.content.scrollTo(0, dimensions.contentHeight+100, 100);
// // this.inputFocus.setFocus();
// // }
// // else{
// // this.toast.pdTriggerappmessage("You are reached the image Limit. To Capture new one Delete the Previous image");
// // }
// }
savePhoto(){
let num_of_images=(this.imageBucket.length+1)+(this.imageDisplay.length+1)
console.log("num of images",num_of_images)
// if(num_of_images <=10){
this.camera.getPicture({
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
targetWidth: 500,
targetHeight: 600,
correctOrientation: true,
encodingType: this.camera.EncodingType.PNG,
saveToPhotoAlbum:false
}).then((imageData)=>{
this.constprovider.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
this.base64='data:image/png;base64,'+imageData
this.imageBucket.push({'image':this.base64,'Name':'','link':geoCoordinates});
// this.imageDisplay.push({'image':this.base64,'Name':''})
this. getImageName(this.imageBucket.length-1)
})
},(err)=>{
console.log("error",err);
})
this.tab='1';
// this.content.scrollToBottom();
// let dimensions = this.content.getContentDimensions();
// this.content.scrollTo(0, dimensions.contentHeight+100, 100);
// this.inputFocus.setFocus();
// }
// else{
// this.toast.pdTriggerappmessage("You are reached the image Limit. To Capture new one Delete the Previous image");
// }
}
setTimeout(()=>{
this.child.capture()
})
}
getImageName(index){
console.log("index",index);
let alert=this.alert.create({

View File

@ -30,7 +30,7 @@
</ion-header>
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -69,7 +69,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<!-- <ion-fab middle right>
<button ion-fab color="optblue" (click)="addBankDetails()">

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, ModalController, ModalOptions } from 'ionic-angular';
import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
@ -11,6 +11,7 @@ import { takeUntil } from 'rxjs/operators';
import {CameraProvider} from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionBankingPage page.
*
@ -49,6 +50,8 @@ export class PdQuestionBankingPage {
tab: any='0';
complete_status: boolean = false;
spinner_access:boolean=false;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,
@ -87,6 +90,7 @@ export class PdQuestionBankingPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
}
@ -484,32 +488,38 @@ inWords(e,i,flag){
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.cons.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.cons.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
@ -527,7 +537,7 @@ inWords(e,i,flag){
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
// this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');

View File

@ -38,7 +38,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -77,7 +77,11 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<div *ngSwitchCase="'0'">
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom">
@ -216,7 +220,7 @@
<mat-label>Age of Asset in Years</mat-label>
<input matInput autocomplete="off" placeholder="eg.99" formControlName="business_vintage"
minlength="1" maxlength="2" type='tel'
(keyup)="calculateVintagePurchase($event.target.value,i,3)">
(keyup)="calculateVintagePurchase($event.target.value,i,5)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>
<mat-form-field style="width:100%">
@ -428,7 +432,7 @@
<input matInput autocomplete="off" type="tel" placeholder="eg.99"
formControlName="business_vintage" minlength="1" maxlength="2"
(keyup)="calculateVintagePurchase($event.target.value,i,1)">
(keyup)="calculateVintagePurchase($event.target.value,i,6)">
</mat-form-field>
<mat-form-field style="width:100%">
<mat-label>Age of Asset in Months</mat-label>

View File

@ -9,6 +9,7 @@ import { ToastProvider } from '../../../../providers/common-provider/toast'
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionBusinessAssetsPage page.
*
@ -72,6 +73,9 @@ export class PdQuestionBusinessAssetsPage {
addressList: any=[];
spinner_access;boolean=false;
lender_short_name: any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,
public aws:AwsServiceProvider,public fb:FormBuilder,public qustcat:QuestionCategoryProvider,
@ -102,7 +106,7 @@ export class PdQuestionBusinessAssetsPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.formDetails.form_id,company_id:this.pdDetails.company_id}
}
@ -110,7 +114,7 @@ export class PdQuestionBusinessAssetsPage {
console.log('ionViewDidLoad PdQuestionBusinessAssetsPage');
this.getDetails()
//this.getAddress()
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this._businessAssetsQuesFrom.dirty);
@ -949,6 +953,7 @@ createBusinessAssetsForAddress(): FormGroup {
value != '' && value <= this.currentYear ? control.controls[controlKey].controls['business_purchase_year'].setValue(value) : control.controls[controlKey].controls['business_purchase_year'].setValue('');
value != '' && value <= this.currentYear ? control.controls[controlKey].controls['business_vintage'].setValue(parseInt(this.currentYear) - parseInt(value)) : control.controls[controlKey].controls['business_vintage'].setValue('')
}
else if(type == 5 || type == 6){
let control:any;
if(type == 5){
@ -969,20 +974,33 @@ createBusinessAssetsForAddress(): FormGroup {
let months = value % 12;
console.log(years,months);
vintage_personal=vintage_personal == '' ? 0 : vintage_personal
vintage_personal=parseInt(vintage_personal)+ years
control.controls[controlKey].controls['asset_months'].setValue(months)
}
let currentMonth:any=new Date().getMonth()+1
let monthMinus:any=0;
control.controls[controlKey].controls['business_vintage'].setValue(vintage_personal)
control.controls[controlKey].controls['business_purchase_year'].setValue(vintage_personal != '' ? parseInt(this.currentYear) - parseInt(vintage_personal) : '');
if(control.controls[controlKey].controls['asset_months'].value != ''){
if(parseInt(currentMonth)-parseInt(control.controls[controlKey].controls['asset_months'].value) < 0){
monthMinus=parseInt(currentMonth)-parseInt(control.controls[controlKey].controls['asset_months'].value)
if(monthMinus > -12){
monthMinus=1
}
else{
monthMinus=2
}
}
}
if(control.controls[controlKey].controls['asset_months'].value > 0 && (vintage_personal != '' || vintage_personal != 0)){
// vintage_personal=parseInt(vintage_personal)-1
control.controls[controlKey].controls['business_purchase_year'].setValue(control.controls[controlKey].controls['business_purchase_year'].value - 1);
control.controls[controlKey].controls['business_purchase_year'].setValue(control.controls[controlKey].controls['business_purchase_year'].value - monthMinus);
}
else if(control.controls[controlKey].controls['asset_months'].value > 0 && control.controls[controlKey].controls['asset_months'].value <12 && (vintage_personal == '' || vintage_personal == 0)){
control.controls[controlKey].controls['business_purchase_year'].setValue(parseInt(this.currentYear));
control.controls[controlKey].controls['business_purchase_year'].setValue(parseInt(this.currentYear)-monthMinus);
}
}
}
@ -1252,31 +1270,38 @@ if(flag== 11){
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
if(res != 'error'){
this.cons.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
// console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// // console.log("Value",res)
// if(res != 'error'){
// this.cons.getGeoTag().then(geoCoordinates=>{
// // console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// // console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()

View File

@ -34,7 +34,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -73,7 +73,12 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="bankingForm" *ngSwitchCase="'0'">
<mat-card>
<div>

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, ModalOptions, ModalController } from 'ionic-angular';
import { FormBuilder,FormGroup,FormArray,Validators} from '@angular/forms';
import {AwsServiceProvider} from '../../../../providers/aws-service/aws-service';
@ -10,6 +10,7 @@ import { Subject } from 'rxjs';
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionBusinessBankingPage page.
@ -56,6 +57,11 @@ step:number
tab: string='0';
complete_status: boolean = false;
spinner_access:boolean=false
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,
public aws: AwsServiceProvider,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,
public cons:ConstantsProvider,public toast:ToastProvider,private loading:LoadingProvider,
@ -95,11 +101,13 @@ step:number
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.form_id,company_id:this.pdDetails.company_id}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionBusinessBankingPage');
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.bankingForm.dirty);
@ -534,32 +542,39 @@ removeImg(index){
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
if(res != 'error'){
this.cons.getGeoTag().then(geoCoordinates=>{
// if(res != 'error'){
// this.cons.getGeoTag().then(geoCoordinates=>{
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -35,7 +35,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press
@ -81,11 +81,15 @@
</ion-row>
</ion-grid>
</mat-card-content>
<br />
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary"
(click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="businessForm" class="address" *ngSwitchCase="'0'">
<div formArrayName="partners">

View File

@ -12,6 +12,7 @@ import { searchValue } from '../../search'
import { CameraProvider } from '../../../../providers/common-provider/camera'
import { LoadingProvider } from '../../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionBusinessInfoPage page.
*
@ -93,6 +94,11 @@ export class PdQuestionBusinessInfoPage {
@ViewChild('businessActivityScroll') businessActivityScroll:ElementRef
@ViewChild('docsSightedScroll') docsSightedScroll: ElementRef
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,
public aws: AwsServiceProvider, public toast: ToastProvider,
public qustCat: QuestionCategoryProvider, public fb: FormBuilder, public cons: ConstantsProvider,
@ -172,11 +178,13 @@ export class PdQuestionBusinessInfoPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId,company_id:this.pdDetails.company_id}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionBusinessInfoPage');
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.businessForm.dirty);
@ -1773,8 +1781,9 @@ export class PdQuestionBusinessInfoPage {
let img_name=control_with_index.controls['document'].value
if(res != 'error'){
this.cons.getGeoTag().then(geoCoordinates=>{
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
let bucket:any=[]
bucket.push({ 'image': res, 'Name': img_name, 'link': geoCoordinates });
bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates });
let records: any = {
'pd_id': this.pdDetails.pd_id,
'formid': this.FormId,
@ -1788,6 +1797,7 @@ export class PdQuestionBusinessInfoPage {
}
})
})
})
}
}, error => {
console.log("Camera Error ", JSON.stringify(error));
@ -2210,6 +2220,10 @@ export class PdQuestionBusinessInfoPage {
// });
// }
// console.log('records',records);
if(records.documents.filter(val=>val.document == '').length > 0 ){
this.toast.pdTriggerappmessage("Please Fill the Document Name");
return;
}
this.spinner_access=true;
//FOR REMOVING THE base64 data from json
console.log("record params1",records.gst_Regn_cert_pic)
@ -2226,10 +2240,13 @@ export class PdQuestionBusinessInfoPage {
if(records.hasOwnProperty('documents')){
if(records.documents.length >0){
records.documents.forEach(value=>{
value.document_pic != '' ? value.document_pic = 'SAVED' :''
})
}
}
this.cons.getGeoTag().then(geoCordinates=>{
if(!records.business_info_location){
records.business_info_location=geoCordinates
@ -2608,49 +2625,55 @@ export class PdQuestionBusinessInfoPage {
removeImgForBucket(index) {
this.imageBucket.splice(index, 1)
}
capture(value) {
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res => {
// console.log("Value", res)
if (res != 'error') {
this.cons.getGeoTag().then(geoCoordinates => {
// console.log("geo promise", geoCoordinates)
if (value != '') {
if (this.imageBucket.length != 0) {
this.imageBucket.forEach((res, index) => {
if (res.Name == value) {
// console.log("res[index]", res[index])
delete res[index]
}
this.imageBucket.push({ 'image': res, 'Name': value, 'link': geoCoordinates });
})
}
this.imageBucket.push({ 'image': res, 'Name': value, 'link': geoCoordinates });
// capture(value) {
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res => {
// // console.log("Value", res)
// if (res != 'error') {
// this.cons.getGeoTag().then(geoCoordinates => {
// // console.log("geo promise", geoCoordinates)
// if (value != '') {
// if (this.imageBucket.length != 0) {
// this.imageBucket.forEach((res, index) => {
// if (res.Name == value) {
// // console.log("res[index]", res[index])
// delete res[index]
// }
// this.imageBucket.push({ 'image': res, 'Name': value, 'link': geoCoordinates });
// })
// }
// this.imageBucket.push({ 'image': res, 'Name': value, 'link': geoCoordinates });
}
else {
this.imageBucket.push({ 'image': res, 'Name': '', 'link': geoCoordinates });
// }
// else {
// this.imageBucket.push({ 'image': res, 'Name': '', 'link': geoCoordinates });
//FOR GETTING THE DOC NAME FROM ALERT
let alert = this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value => {
// console.log("alert value", value);
if (value) {
this.imageBucket[this.imageBucket.length - 1].Name = value.Name
}
})
} // Else End
})
}
}, error => {
console.log("Camera Error ", JSON.stringify(error));
})
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert = this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value => {
// // console.log("alert value", value);
// if (value) {
// this.imageBucket[this.imageBucket.length - 1].Name = value.Name
// }
// })
// } // Else End
// })
// }
// }, error => {
// console.log("Camera Error ", JSON.stringify(error));
// })
this.tab = '1';
// this.tab = '1';
}
// }
capture(value){
this.tab='1';
setTimeout(()=>{
this.child.capture(value)
})
}
sendImage() {
this.loading.loaderForSendImage()
// console.log("about business - Images bucket", JSON.stringify(this.imageBucket));
@ -2701,8 +2724,9 @@ export class PdQuestionBusinessInfoPage {
if (Flag == 9) { this.businessForm.controls.eb_bill_pic.setValue(res != 'error' ? res : ''); img_name="eb_bill_pic"}//alert('Inside Mobile Upload Function' + Flag);}
if(res != 'error'){
this.cons.getGeoTag().then(geoCoordinates=>{
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
let bucket:any=[]
bucket.push({ 'image': res, 'Name': img_name, 'link': geoCoordinates });
bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates });
let records: any = {
'pd_id': this.pdDetails.pd_id,
'formid': this.FormId,
@ -2716,6 +2740,7 @@ export class PdQuestionBusinessInfoPage {
}
})
})
})
}
}, error => {
console.log("Camera Error ", JSON.stringify(error));

View File

@ -30,7 +30,7 @@
</ion-header>
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -69,7 +69,11 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp (imageDatalength_forParent)="imageDataFun($event)" [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<div *ngSwitchCase="'0'">
<div *ngIf="noRecordsFound">

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, Form, ModalController, ModalOptions } from 'ionic-angular';
import { QuestionCategoryProvider } from '../../../../providers/question-category/question-category';
import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service';
@ -8,6 +8,7 @@ import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
import {ConstantsProvider} from '../../../../providers/constants/constants'
import { OfficerNotesModalPage } from '../../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionClientInfoPage page.
*
@ -53,6 +54,10 @@ export class PdQuestionClientInfoPage {
camera_enable: boolean;
spinner_access:boolean=false
lender_short_name: any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,
@ -67,6 +72,7 @@ export class PdQuestionClientInfoPage {
this.users = this.aws.getlocale();
this.pdid = this.pdDetails.pd_id;
this.company_id = this.pdDetails.company_id;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.formDetails.form_id,company_id:this.pdDetails.company_id}
this.qustCat.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => {
@ -1066,32 +1072,38 @@ else{
}
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constantProvider.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constantProvider.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
@ -1121,6 +1133,10 @@ else{
})
}
imageDataFun($event){
console.log($event)
this.imageDisplay=$event.imageDisplay
}
}

View File

@ -35,7 +35,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -74,7 +74,11 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp (imageDatalength_forParent)="imageDataFun($event)" [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="financialForm" *ngSwitchCase="'0'">
<mat-card>

View File

@ -1,4 +1,4 @@
import { Component,ViewEncapsulation } from '@angular/core';
import { Component,ViewEncapsulation, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController, ModalOptions } from 'ionic-angular';
import {AwsServiceProvider} from '../../../../providers/aws-service/aws-service'
import {ToastProvider} from '../../../../providers/common-provider/toast'
@ -8,6 +8,7 @@ import {ConstantsProvider} from '../../../../providers/constants/constants'
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionFinancialInfoPage page.
*
@ -69,6 +70,12 @@ export class PdQuestionFinancialInfoPage {
spinner_access:boolean=false;
tot_business_FY_inWords: string;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
@ViewChild(PdGeneralImagesPage) imagesValue
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,
public toast:ToastProvider, public qustCat:QuestionCategoryProvider,
public fb:FormBuilder,public cons:ConstantsProvider,private cameraProvider:CameraProvider,
@ -87,6 +94,8 @@ export class PdQuestionFinancialInfoPage {
this.product_abbr = this.pdDetails.product_abbr;
this.initFinancialForm()
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId,company_id:this.pdDetails.company_id}
if(this.lender_short_name == "IIB"){
this.financialForm.addControl('tot_business_FY',new FormControl())
this.financialForm.addControl('remarks_tot_business_FY',new FormControl())
@ -131,8 +140,12 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionFinancialInfoPage');
this.getDetails()
this.getPDImages();
this.getPDImages();
}
// ngAfterViewInit() {
// console.log("ngAfter View Init")
// }
ionViewCanLeave(){
console.log("dirty",this.financialForm.dirty);
if(this.financialForm.dirty){
@ -202,6 +215,10 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
modalCtrl.present();
this.tab='0';
}
if(this.tab == '0'){
// this.picsArrayLength = this.imagesValue.imageDisplay
// this.imageDisplay=this.picsArrayLength
}
}
AllCalculation(control,index){
@ -1614,32 +1631,39 @@ calculateLossAmount( i, details){
alert('No Need');
}
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.cons.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.cons.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
@ -1674,5 +1698,9 @@ calculateLossAmount( i, details){
this.financialForm.controls.kuccha_bill_allowed.setValue('')
}
}
imageDataFun($event){
console.log($event)
this.picsArrayLength=$event.imageDisplay.length
}
}

View File

@ -36,7 +36,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the
@ -83,7 +83,11 @@
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary"
(click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="_futurePlansForm" novalidate *ngSwitchCase="'0'">
<mat-card>
<mat-card-content>

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController, ModalOptions } from 'ionic-angular';
import { FormGroup, FormBuilder } from '@angular/forms';
@ -9,6 +9,7 @@ import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
import {ConstantsProvider} from '../../../../providers/constants/constants'
import { OfficerNotesModalPage } from '../../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionFuturePlansAndBusinessEnvironmentPage page.
@ -39,6 +40,9 @@ export class PdQuestionFuturePlansAndBusinessEnvironmentPage {
public _futurePlansForm: FormGroup;
spinner_access:boolean=false
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams, public fb: FormBuilder,
public qustcat: QuestionCategoryProvider, public aws: AwsServiceProvider,
@ -71,12 +75,14 @@ export class PdQuestionFuturePlansAndBusinessEnvironmentPage {
fk_createdby:[this.users]
});
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId,company_id:this.pdDetails.company_id}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionFuturePlansAndBusinessEnvironmentPage');
this.getFuturePlans();
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave() {
@ -238,31 +244,37 @@ export class PdQuestionFuturePlansAndBusinessEnvironmentPage {
this.imageBucket.splice(index, 1)
}
capture() {
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res => {
// capture() {
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res => {
if (res != 'error') {
this.constantProvider.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({ 'image': res, 'Name': '' ,'link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert = this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value => {
if (value) {
this.imageBucket[this.imageBucket.length - 1].Name = value.Name
}
})
})
// if (res != 'error') {
// this.constantProvider.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({ 'image': res, 'Name': '' ,'link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert = this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value => {
// if (value) {
// this.imageBucket[this.imageBucket.length - 1].Name = value.Name
// }
// })
// })
// }
// }, error => {
// console.log("Camera Error ", JSON.stringify(error));
// })
// this.tab = '1';
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
}, error => {
console.log("Camera Error ", JSON.stringify(error));
})
this.tab = '1';
}
sendImage() {
this.loading.loaderForSendImage()

View File

@ -28,7 +28,7 @@
</ion-header>
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -67,7 +67,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<div *ngSwitchCase="'0'">
<div *ngIf="noRecordsFound">

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController, ModalOptions } from 'ionic-angular';
import { QuestionCategoryProvider } from '../../../../providers/question-category/question-category';
import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service';
@ -10,6 +10,7 @@ import { Subject } from 'rxjs';
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionStockInfoPage page.
*
@ -67,7 +68,10 @@ export class PdQuestionStockInfoPage {
complete_status: boolean = false;
spinner_access:boolean=false;
lender_short_name: any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams, public qustCat: QuestionCategoryProvider,
public aws: AwsServiceProvider, public toast: ToastProvider, public fb: FormBuilder,
public constant: ConstantsProvider,private cameraProvider:CameraProvider,
@ -107,11 +111,14 @@ export class PdQuestionStockInfoPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.formDetails.form_id,company_id:this.pdDetails.company_id}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionStockInfoPage');
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.stockForm.dirty);
@ -1129,32 +1136,38 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constant.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constant.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -28,7 +28,7 @@
</ion-header>
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -67,7 +67,11 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp (imageDatalength_forParent)="imageDataFun($event)" [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<div *ngSwitchCase="'0'">

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalOptions, ModalController } from 'ionic-angular';
import { FormBuilder, FormGroup, FormArray, Validators } from '@angular/forms';
import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service';
@ -9,6 +9,7 @@ import { LoadingProvider } from '../../../../providers/common-provider/loading'
import { ConstantsProvider } from '../../../../providers/constants/constants'
import { ThrowStmt } from '@angular/compiler';
import { OfficerNotesModalPage } from '../../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionSupplsierInfoPage page.
*
@ -50,6 +51,9 @@ export class PdQuestionSupplierInfoPage {
spinner_access:boolean=false
lender_short_name: any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams, public fb: FormBuilder,
public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider,
public toast: ToastProvider, private cameraProvider: CameraProvider, private loading: LoadingProvider,
@ -66,6 +70,9 @@ export class PdQuestionSupplierInfoPage {
this.users = this.aws.getlocale();
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.formDetails.form_id,company_id:this.pdDetails.company_id}
this.qustCat.getTypeofActivityForSuppliedInfoForm(this.pdDetails.pd_id, this.company_id).subscribe(data => {
if(data.dataStatus){
@ -1046,32 +1053,40 @@ export class PdQuestionSupplierInfoPage {
return mandatory_check.length >= 3 ? true : false
}
capture() {
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res => {
console.log("Value", res)
if (res != 'error') {
this.constantProvider.getGeoTag().then(geoCoordinates => {
console.log("geo promise", geoCoordinates)
this.imageBucket.push({ 'image': res, 'Name': '', 'link': geoCoordinates });
//FOR GETTING THE DOC NAME FROM ALERT
let alert = this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value => {
console.log("alert value", value);
if (value) {
this.imageBucket[this.imageBucket.length - 1].Name = value.Name
}
})
})
// capture() {
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res => {
// console.log("Value", res)
// if (res != 'error') {
// this.constantProvider.getGeoTag().then(geoCoordinates => {
// console.log("geo promise", geoCoordinates)
// this.imageBucket.push({ 'image': res, 'Name': '', 'link': geoCoordinates });
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert = this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value => {
// console.log("alert value", value);
// if (value) {
// this.imageBucket[this.imageBucket.length - 1].Name = value.Name
// }
// })
// })
// }
// }, error => {
// console.log("Camera Error ", JSON.stringify(error));
// })
// this.tab = '1';
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
}, error => {
console.log("Camera Error ", JSON.stringify(error));
})
this.tab = '1';
}
sendImage() {
this.loading.loaderForSendImage()
console.log("ll", JSON.stringify(this.imageBucket));
@ -1100,5 +1115,10 @@ export class PdQuestionSupplierInfoPage {
})
}
imageDataFun($event){
console.log($event)
this.imageDisplay=$event.imageDisplay
}
}

View File

@ -63,7 +63,7 @@
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -102,7 +102,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="currentLoans" *ngSwitchCase="'0'">

View File

@ -10,6 +10,7 @@ import { takeUntil } from 'rxjs/operators';
import {CameraProvider} from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionCurrentLoansPage page.
*
@ -58,6 +59,9 @@ applicants: any;
productAbbr: any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public toast:ToastProvider,
public aws:AwsServiceProvider,public constant:ConstantsProvider,
@ -88,12 +92,17 @@ applicants: any;
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionCurrentLoansPage');
console.log('{{FormId.form_name}}',this.FormId.form_name,this.FormId);
this.getcurrentLoans()
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.currentLoans.dirty);
@ -856,32 +865,38 @@ else{
tapEvent(value){
console.log("dd",value);
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constant.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constant.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -29,7 +29,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -68,7 +68,12 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="employmentForm" *ngSwitchCase="'0'">
<mat-card>

View File

@ -9,6 +9,7 @@ import { max } from 'rxjs/operators';
import {CameraProvider} from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionEmpInfoPage page.
*
@ -59,6 +60,10 @@ export class PdQuestionEmpInfoPage {
@ViewChild('yearFocus') inputYearFocus :ElementRef
complete_status: boolean = false;
spinner_access:boolean=false;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider,
public toast: ToastProvider,public constant:ConstantsProvider,
@ -122,11 +127,15 @@ export class PdQuestionEmpInfoPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionEmpInfoPage');
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.employmentForm.dirty);
@ -594,32 +603,38 @@ inWords(val,flag:number){
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constant.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constant.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -29,7 +29,7 @@
</ion-header>
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -68,7 +68,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form class="address" [formGroup]="familyForm" *ngSwitchCase="'0'">
<div formArrayName="family_details">

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController, ModalOptions } from 'ionic-angular';
import { FormGroup, FormBuilder, FormArray, Validators } from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
@ -11,6 +11,7 @@ import { Subject } from 'rxjs';
import {CameraProvider} from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionFamilyPage page.
@ -75,6 +76,9 @@ data:any;
spinner_access:boolean=false;
lender_short_name: any;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,
public toast:ToastProvider,public cons:ConstantsProvider,
@ -104,13 +108,17 @@ data:any;
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
}
ionViewDidLoad() {
console.log("ionViewDidLoad PdQuestionFamilyPage")
this.getFamilyData();
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.familyForm.dirty);
@ -429,13 +437,13 @@ data:any;
}
});
this.qustCat.getcommondrop('PERSONSMET').subscribe(res=>
{
if(res['dataStatus']==true)
{
this.filteredStates = res['records'].filter(per=>per.isactive==1);
}
});
// this.qustCat.getcommondrop('PERSONSMET').subscribe(res=>
// {
// if(res['dataStatus']==true)
// {
// this.filteredStates = res['records'].filter(per=>per.isactive==1);
// }
// });
// this.qustCat.getcommondrop('CUSTOMERSEGMENT').subscribe(res=>
// {
// if(res['dataStatus']==true)
@ -1100,34 +1108,40 @@ searchFun(control:any,i:number,option){
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
// capture(){
// //FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.cons.getGeoTag().then(geoCoordinates=>{
console.log("geo location promise",geoCoordinates)
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.cons.getGeoTag().then(geoCoordinates=>{
// console.log("geo location promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -38,7 +38,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -77,7 +77,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="_finalRemarkForm" novalidate *ngSwitchCase="'0'">
<mat-card>

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController, ModalOptions } from 'ionic-angular';
import { FormGroup, FormBuilder,FormArray,FormControl,Validators} from '@angular/forms';
// import { t } from '@angular/core/src/render3';
@ -9,6 +9,7 @@ import { CameraProvider } from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
import {ConstantsProvider} from '../../../providers/constants/constants'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionFinalRemarkPage page.
@ -43,6 +44,10 @@ export class PdQuestionFinalRemarkPage {
{'id':'others','name':'Others'}]
complete_status: boolean = false;
spinner_access:boolean=false
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams, public fb:FormBuilder,
public qustcat:QuestionCategoryProvider,public aws:AwsServiceProvider,
public toast:ToastProvider,private cameraProvider:CameraProvider,private loading:LoadingProvider,private constantProvider:ConstantsProvider,
@ -102,12 +107,15 @@ export class PdQuestionFinalRemarkPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionFinalRemarkPage');
this.getFinalRemark();
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
@ -602,33 +610,40 @@ removeImg(index){
}
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constantProvider.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
}
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constantProvider.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -30,7 +30,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -69,7 +69,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="generalForm" *ngSwitchCase="'0'">
<mat-card style="padding: 0px 10px !important;">
@ -138,8 +141,8 @@
</div>
</ion-col>
</ion-row>
<div *ngIf="buttonClick">
<div #individualPersonScroll></div>
<div *ngIf="buttonClick" >
<mat-card-header>
<mat-card-title *ngIf="addIndi">Add Name of Person(s) Met and Individual Loan Applicant(s)</mat-card-title>
<mat-card-title *ngIf="!addIndi">Update Name of Person(s) Met and Individual Loan Applicant(s)</mat-card-title>
@ -328,7 +331,8 @@
</div>
</ion-col>
</ion-row>
<div #companyScroll></div>
<div *ngIf="h_companies">
<mat-card-header>
<mat-card-title *ngIf="addComp && customer_segment_abbr == 'SEP_INDV'" > Add Nature of Service</mat-card-title>

File diff suppressed because one or more lines are too long

View File

@ -32,46 +32,9 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
<ion-grid *ngIf="imageDisplay.length >0 ">
<ion-row>
<ion-col col-6 *ngFor="let image of imageDisplay; let i=index" no-padding>
<img src="{{image.image}}" imageViewer><br/>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)">
<button *ngIf="image.option != 'dummy'" ion-button clear color="optblue" (click)="removeImg(i)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
</ion-col>
<hr/>
</ion-row>
<hr/>
<hr/>
</ion-grid>
<ion-grid *ngIf="imageBucket.length >0 ">
<label style="font-size:14px;color:gray">Newly Captured Pics</label><br/>
<ion-row>
<ion-col col-6 *ngFor="let image of imageBucket; let i=index" no-padding>
<img src="{{image.image}}" imageViewer><br/>
<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)">
<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>
<hr/>
</ion-row>
</ion-grid>
</mat-card-content>
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="loanDetailsForm" class="address" *ngSwitchCase="'0'">
<mat-card style="padding: 12px;">

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import {NavController, NavParams, ModalController, ModalOptions } from 'ionic-angular';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
@ -11,6 +11,8 @@ import {CameraProvider} from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
import {StorageProvider} from '../../../providers/storage/storage'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import * as watermark from 'watermarkjs'
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionLoansPage page.
@ -91,6 +93,8 @@ export class PdQuestionLoansPage {
original_mortageTypeProperty: any=[];
spinner_access:boolean=false
address_placeholder: string;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams, public fb: FormBuilder,
public qustCat: QuestionCategoryProvider, public aws: AwsServiceProvider,
@ -100,6 +104,7 @@ export class PdQuestionLoansPage {
this.loading.dataLoader();
this.FormId = this.navParams.get('FormId');
this.pdDetails = this.navParams.get('pdDetails');
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
// console.log("pd",this.pdDetails);
this.applicants = this.pdDetails.applicat_details
this.applicants = this.applicants.filter(appt => appt.applicant_type != 2 && appt.applicant_type != 3);
@ -189,7 +194,7 @@ export class PdQuestionLoansPage {
ionViewDidLoad() {
console .log('ionViewDidLoad PdQuestionLoansPage');
this.getDropdown();
this.getPDImages();
}
ngOnDestroy() {
this._onDestroy.next();
@ -1014,32 +1019,101 @@ export class PdQuestionLoansPage {
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
if(res != 'error'){
this.constant.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
// if(res != 'error'){
// this.constant.getGeoTag().then(geoCoordinates=>{
// // console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
// }
//FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// if(res != 'error'){
// this.constant.getGeoTag().then(geoCoordinates=>{
// let raw_img=res
// let geoCords=geoCoordinates
// console.log("rawimg",raw_img)
// watermark([raw_img, 'assets/img/PD_watermark.png'])
// .image(watermark.image.upperRight())
// .then(img => {
// raw_img = img.src;
// });
// var today = new Date();
// let today_loc=today.toLocaleString('en-US', {timeZone: "Asia/Kolkata"})
// console.log(today_loc)
// var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
// var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
// var dateTime = 'Date : '+today_loc;
// let Location=`Location : `+geoCords
// console.log(date)
// let text=watermark.text
// setTimeout(()=>{
// watermark([raw_img])
// .image(text.upperLeft(dateTime, '18px serif', '#b31105', 0.9,48))
// .then(img => {
// raw_img = img.src;
// console.log("2d",raw_img)
// });
// setTimeout(()=>{
// watermark([raw_img])
// .image(text.upperLeft(Location, '18px serif', '#b31105', 0.9))
// .then(img => {
// raw_img=img.src
// this.imageBucket.push({'image':raw_img,'Name':'','link':geoCoordinates});
// console.log("3rd",raw_img)
// });
// })
// },1000);
// // console.log("geo promise",geoCoordinates)
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
// console.log("ll",JSON.stringify(this.imageBucket));
@ -1052,7 +1126,6 @@ export class PdQuestionLoansPage {
}
// console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")

View File

@ -32,7 +32,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -71,7 +71,10 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="neighbourhoodForm" *ngSwitchCase="'0'">
<!-- <mat-card>
<mat-label>Please Select the type</mat-label><br/>

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController, ModalOptions } from 'ionic-angular';
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
@ -8,6 +8,7 @@ import { ConstantsProvider } from '../../../providers/constants/constants'
import {CameraProvider} from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionNeighbourHoodPage page.
*
@ -45,6 +46,10 @@ export class PdQuestionNeighbourHoodPage {
tab: any='0';
complete_status: boolean = false;
spinner_access:boolean=false;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,
public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,
@ -77,12 +82,14 @@ export class PdQuestionNeighbourHoodPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionNeighbourHoodPage');
this.getneighbourhood();
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.neighbourhoodForm.dirty);
@ -612,32 +619,38 @@ ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constant.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constant.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -32,7 +32,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -71,7 +71,12 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="otherIncomeForm" class="address" *ngSwitchCase="'0'">
<!-- <mat-form-field style="width: 100%" >
<mat-select placeholder="Other Income"

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams,AlertController, ModalController,ModalOptions } from 'ionic-angular';
import { FormGroup, FormBuilder,FormArray, Validators } from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
@ -11,6 +11,7 @@ import {LoadingProvider} from '../../../providers/common-provider/loading'
import { PdtriggerProvider } from '../../../providers/pdtrigger/pdtrigger';
import {FormCompleteCheckModalPage} from '../../form-complete-check-modal/form-complete-check-modal'
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionOtherIncomePage page.
@ -50,6 +51,9 @@ export class PdQuestionOtherIncomePage {
complete_status: boolean = false;
spinner_access:boolean=false;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,
public toast:ToastProvider, public constant:ConstantsProvider,private cameraProvider:CameraProvider,
@ -92,12 +96,14 @@ export class PdQuestionOtherIncomePage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionOtherIncomePage');
this.getOtherIncome();
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.otherIncomeForm.dirty);
@ -518,32 +524,38 @@ removeImg(index){
removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constant.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
// }
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constant.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
this.tab='1';
}
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -30,7 +30,7 @@
<ion-content padding>
<div [ngSwitch]="tab">
<mat-card *ngSwitchCase="'1'" #picContent>
<!-- <mat-card *ngSwitchCase="'1'" #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button above to capture</strong></mat-label>
@ -69,7 +69,13 @@
<br/>
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
</mat-card> -->
<div *ngSwitchCase="'1'" #picContent>
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
</div>
<form [formGroup]="rentalForms" *ngSwitchCase="'0'">
<mat-card>

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams ,AlertController, ModalController, ModalOptions} from 'ionic-angular';
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
import { ToastProvider } from '../../../providers/common-provider/toast';
@ -12,6 +12,7 @@ import {CameraProvider} from '../../../providers/common-provider/camera'
import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { OfficerNotesModalPage } from '../../officer-notes-modal/officer-notes-modal';
import { PdGeneralImagesPage } from '../../pd-general-images/pd-general-images';
/**
* Generated class for the PdQuestionRentalInfoPage page.
@ -76,7 +77,10 @@ export class PdQuestionRentalInfoPage {
data:any;
complete_status: boolean = false;
spinner_access:boolean=false;
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
constructor(public navCtrl: NavController, public navParams: NavParams,
public aws:AwsServiceProvider,public toast:ToastProvider,
public qustCat:QuestionCategoryProvider,public fb:FormBuilder,
@ -84,7 +88,7 @@ export class PdQuestionRentalInfoPage {
private loading:LoadingProvider,private cameraProvider:CameraProvider,private modalCtrl:ModalController)
{
this.loading.dataLoader();
this.data=this.navParams.get('values'); // for get the data from dash page
console.log("From Dashboard of Rental - values are ",this.data);
@ -214,11 +218,15 @@ export class PdQuestionRentalInfoPage {
//To checking Completed Status For CompleteList Menu
this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,company_id:null,rental_count_id:this.data.existing_rental_count_id}
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionRentalInfoPage');
this.getPDImages();
// this.getPDImages();
}
ionViewCanLeave(){
console.log("dirty",this.rentalForms.dirty);
@ -1121,7 +1129,7 @@ this.spinner_access=true;
getRentalDetails()
{
this.loading.dataLoader();
// let records = { 'parent_pdid':this.pdDetails.parent_pd_id,'pd_id': this.pdDetails.pd_id, 'pd_form_id': this.FormId.form_id };
@ -1536,44 +1544,57 @@ removeImgForBucket(index){
this.imageBucket.splice(index,1)
}
// captureThePropertyPics(){
// // alert('rentalDataCount '+this.data.existing_rental_count_id);
// this.cameraProvider.getpicture().then(res=>{
// if(res != 'error'){
// this.imageBucket.push({'image':res,'Name':'Property '+this.data.existing_rental_count_id});
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
// }
captureThePropertyPics(){
// alert('rentalDataCount '+this.data.existing_rental_count_id);
this.cameraProvider.getpicture().then(res=>{
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':'Property '+this.data.existing_rental_count_id});
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
this.tab='1';
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.constprovider.getGeoTag().then(geoCoordinates=>{
console.log("geo promise",geoCoordinates)
this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
let name='Property '+this.data.existing_rental_count_id
this.tab='1';
setTimeout(()=>{
this.child.capture(name)
})
this.tab='1';
}
// capture(){
// //FOR CAPTURING PICS
// this.cameraProvider.getpicture().then(res=>{
// console.log("Value",res)
// if(res != 'error'){
// this.constprovider.getGeoTag().then(geoCoordinates=>{
// console.log("geo promise",geoCoordinates)
// this.imageBucket.push({'image':res,'Name':'','link':geoCoordinates});
// //FOR GETTING THE DOC NAME FROM ALERT
// let alert =this.toast.setAlertForDocName()
// alert.present()
// alert.onDidDismiss(value=>{
// console.log("alert value",value);
// if(value){
// this.imageBucket[this.imageBucket.length-1].Name=value.Name
// }
// })
// })
// }
// },error=>{
// console.log("Camera Error ",JSON.stringify(error));
// })
// this.tab='1';
}
// }
capture(){
this.tab='1';
setTimeout(()=>{
this.child.capture()
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));

View File

@ -2,6 +2,9 @@ import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Camera } from '@ionic-native/camera';
import { Platform } from 'ionic-angular';
import { ConstantsProvider } from '../constants/constants';
import * as watermark from 'watermarkjs'
/*
Generated class for the CameraProvider provider.
@ -11,8 +14,9 @@ import { Platform } from 'ionic-angular';
@Injectable()
export class CameraProvider {
myObject: any;
geoCords: any='-';
constructor(public http: HttpClient,public camera:Camera,private platform:Platform) {
constructor(public http: HttpClient,public camera:Camera,private platform:Platform,private constant:ConstantsProvider) {
console.log(
"%cWelcome, Camera Provider",
"font-size:300%;color:purple;font-weight:bold;font-family:Mongoose; text-transform: uppercase;"
@ -34,30 +38,43 @@ export class CameraProvider {
// }
getpicture()
{
localStorage.removeItem('current_coordinates')
const options = {
quality: 100,
quality: 60,
destinationType: this.camera.DestinationType.DATA_URL,
targetWidth: 500,
targetHeight: 600,
correctOrientation: true,
encodingType: this.camera.EncodingType.PNG,
saveToPhotoAlbum:false
saveToPhotoAlbum:false,
};
console.log(localStorage.getItem('current_coordinates'))
// If set to crop, restricts the image to a square of 600 by 600
return this.saveRecovery().then(()=>{
return this.camera.getPicture(options).then(imageData => {
return this.constant.getGeoTag().then(geoCoordinates => {
this.geoCords = geoCoordinates
localStorage.setItem('current_coordinates',this.geoCords)
console.log('From Camera.ts - getPicture fn image are',imageData)
const base64Image = 'data:image/png;base64,' + imageData;
this.myObject=base64Image
// console.log("base 64",base64Image);
return base64Image;
});
}, error => {
localStorage.removeItem('current_coordinates')
console.log('CAMERA ERROR -> ' + JSON.stringify(error));
return "error"
});
})
}, error => {
console.log('CAMERA ERROR -> ' + JSON.stringify(error));
return "error"
});
}
getcommonpicture()
@ -79,9 +96,59 @@ export class CameraProvider {
console.log("base 64",base64Image);
return base64Image;
}, error => {
localStorage.removeItem('current_coordinates')
console.log('CAMERA ERROR -> ' + JSON.stringify(error));
return "error"
});
}
addWatermarks(base64Img) {
return new Promise((resolve, reject) => {
// this.constant.getGeoTag().then(geoCoordinates => {
// this.geoCords = geoCoordinates
// });
this.geoCords=localStorage.getItem('current_coordinates')
console.log("corrds",this.geoCords)
let raw_img = base64Img
var today = new Date();
let today_loc = today.toLocaleString('en-US', { timeZone: "Asia/Kolkata" })
var date = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
// var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = 'Date : ' + today_loc;
console.log(date)
// fetch(raw_img)
// .then(res => res.blob())
// .then(blob => {
watermark([raw_img, 'assets/img/PD_watermark.png'])
.image(watermark.image.upperRight())
.then(img => {
raw_img = img.src;
let text = watermark.text
watermark([raw_img])
.image(text.upperLeft(dateTime, '18px sans-serif', '#ff0000', 1.0, 40))
.then(img => {
raw_img = img.src;
console.log("2d", raw_img)
let Location = `Location : ` + this.geoCords
watermark([raw_img])
.image(text.upperLeft(Location, '18px sans-serif', '#ff0000', 1.0))
.then(img => {
raw_img = img.src
console.log("3rd", raw_img)
resolve(img.src)
localStorage.removeItem('current_coordinates')
});
});
});
})
// });
}
}

View File

@ -44,6 +44,14 @@ export class LoadingProvider {
})
this.loading.present();
}
imageWatermarkLoader(){
this.loading=this.loadingCtrl.create({
content:"Please Wait...",
enableBackdropDismiss:true,
duration:20000
})
this.loading.present();
}
dismissLoader(){
this.loading.dismiss()
}

View File

@ -283,7 +283,10 @@ searchData(data,val: any,option) {
return this.getGeoTag();
// this.getcurrentBackgroundLocation();
},
error => console.log('Error requesting location permissions'+JSON.stringify(error))
error =>{ console.log('Error requesting location permissions'+JSON.stringify(error))
alert("We need location access to capture the geocoordinates of your place. Please turn on the location to continue");
this.enableAccuracy()
}
);
}
});
@ -298,4 +301,15 @@ searchData(data,val: any,option) {
return curr_pos
}).catch(err=>console.log("error in getGeoTag",err))
}
generalCheck(x,y):Promise<any>{
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve(x+y)
},2000)
})
}
}