Fairoj: Camera Feature Enabled in all Forms

This commit is contained in:
saravanakumarkandasami 2019-04-11 19:08:25 +05:30
parent 61428f0f38
commit b0fc3b6a82
73 changed files with 508384 additions and 222 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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,4 +1,4 @@
#Tue Apr 02 20:03:20 IST 2019 #Thu Apr 11 13:00:27 IST 2019
base.0=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\transforms\\dexMerger\\debug\\0 base.0=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\transforms\\dexMerger\\debug\\0
path.0=classes.dex path.0=classes.dex
renamed.0=classes.dex renamed.0=classes.dex

View File

@ -1,5 +1,5 @@
#Internal package file, do not edit. #Internal package file, do not edit.
#Tue Apr 02 20:03:21 IST 2019 #Thu Apr 11 13:00:28 IST 2019
60.set=ASSET 60.set=ASSET
52.set=ASSET 52.set=ASSET
53.base=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\assets\\debug 53.base=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\assets\\debug

View File

@ -1 +1 @@
[{"name":":CordovaLib","index":0,"scopes":["SUB_PROJECTS"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"7ce5806ff30953ccbcdb2c9f572f42044dec879a","index":1,"scopes":["PROJECT"],"types":["CLASSES"],"format":"DIRECTORY","present":true},{"name":"android.local.jars:sqlite-connector.jar:9a16a924fa72b9fb127264a64dd09a7c2ff43fbc","index":2,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.local.jars:sqlite-native-driver.jar:0bb4244b79338092a1c2a9573543ef6da500a982","index":3,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-location:15.0.1","index":4,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-base:15.0.1","index":5,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-places-placereport:15.0.1","index":6,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-tasks:15.0.1","index":7,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-basement:15.0.1","index":8,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-v4:26.1.0","index":9,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-media-compat:26.1.0","index":10,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-fragment:26.1.0","index":11,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-core-utils:26.1.0","index":12,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-core-ui:26.1.0","index":13,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-compat:26.1.0","index":14,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-annotations:27.1.1","index":15,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.squareup.okhttp3:okhttp:3.13.1","index":16,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":false},{"name":"com.squareup.okio:okio:1.17.2","index":17,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.lifecycle:runtime:1.0.0","index":18,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.lifecycle:common:1.0.0","index":19,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.core:common:1.0.0","index":20,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.squareup.okhttp3:okhttp:3.14.0","index":21,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true}] [{"name":":CordovaLib","index":0,"scopes":["SUB_PROJECTS"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"7ce5806ff30953ccbcdb2c9f572f42044dec879a","index":1,"scopes":["PROJECT"],"types":["CLASSES"],"format":"DIRECTORY","present":true},{"name":"android.local.jars:sqlite-connector.jar:9a16a924fa72b9fb127264a64dd09a7c2ff43fbc","index":2,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.local.jars:sqlite-native-driver.jar:0bb4244b79338092a1c2a9573543ef6da500a982","index":3,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-location:15.0.1","index":4,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-base:15.0.1","index":5,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-places-placereport:15.0.1","index":6,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-tasks:15.0.1","index":7,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-basement:15.0.1","index":8,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-v4:26.1.0","index":9,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-media-compat:26.1.0","index":10,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-fragment:26.1.0","index":11,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-core-utils:26.1.0","index":12,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-core-ui:26.1.0","index":13,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-compat:26.1.0","index":14,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-annotations:27.1.1","index":15,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.squareup.okio:okio:1.17.2","index":17,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.lifecycle:runtime:1.0.0","index":18,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.lifecycle:common:1.0.0","index":19,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.core:common:1.0.0","index":20,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.squareup.okhttp3:okhttp:3.14.0","index":21,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":false},{"name":"com.squareup.okhttp3:okhttp:3.14.1","index":22,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true}]

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
[{"name":"main","index":0,"scopes":["SUB_PROJECTS","PROJECT","EXTERNAL_LIBRARIES"],"types":["DEX"],"format":"DIRECTORY","present":true}] [{"name":"main","index":0,"scopes":["EXTERNAL_LIBRARIES","PROJECT","SUB_PROJECTS"],"types":["DEX"],"format":"DIRECTORY","present":true}]

View File

@ -1 +1 @@
[{"name":"resources","index":0,"scopes":["SUB_PROJECTS","PROJECT","EXTERNAL_LIBRARIES"],"types":["RESOURCES"],"format":"JAR","present":true}] [{"name":"resources","index":0,"scopes":["EXTERNAL_LIBRARIES","PROJECT","SUB_PROJECTS"],"types":["RESOURCES"],"format":"JAR","present":true}]

View File

@ -1 +1 @@
[{"name":"resources","index":0,"scopes":["SUB_PROJECTS","PROJECT","EXTERNAL_LIBRARIES"],"types":["NATIVE_LIBS"],"format":"DIRECTORY","present":true}] [{"name":"resources","index":0,"scopes":["EXTERNAL_LIBRARIES","PROJECT","SUB_PROJECTS"],"types":["NATIVE_LIBS"],"format":"DIRECTORY","present":true}]

View File

@ -1 +1 @@
[{"name":"android.local.jars:sqlite-connector.jar:9a16a924fa72b9fb127264a64dd09a7c2ff43fbc","index":0,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.local.jars:sqlite-native-driver.jar:0bb4244b79338092a1c2a9573543ef6da500a982","index":1,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-location:15.0.1","index":2,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-base:15.0.1","index":3,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-places-placereport:15.0.1","index":4,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-tasks:15.0.1","index":5,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-basement:15.0.1","index":6,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-v4:26.1.0","index":7,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-media-compat:26.1.0","index":8,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-fragment:26.1.0","index":9,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-core-utils:26.1.0","index":10,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-core-ui:26.1.0","index":11,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-compat:26.1.0","index":12,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-annotations:27.1.1","index":13,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.squareup.okhttp3:okhttp:3.13.1","index":14,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":false},{"name":"com.squareup.okio:okio:1.17.2","index":15,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.lifecycle:runtime:1.0.0","index":16,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.lifecycle:common:1.0.0","index":17,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.core:common:1.0.0","index":18,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.squareup.okhttp3:okhttp:3.14.0","index":19,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true}] [{"name":"android.local.jars:sqlite-connector.jar:9a16a924fa72b9fb127264a64dd09a7c2ff43fbc","index":0,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.local.jars:sqlite-native-driver.jar:0bb4244b79338092a1c2a9573543ef6da500a982","index":1,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-location:15.0.1","index":2,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-base:15.0.1","index":3,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-places-placereport:15.0.1","index":4,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-tasks:15.0.1","index":5,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.google.android.gms:play-services-basement:15.0.1","index":6,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-v4:26.1.0","index":7,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-media-compat:26.1.0","index":8,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-fragment:26.1.0","index":9,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-core-utils:26.1.0","index":10,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-core-ui:26.1.0","index":11,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-compat:26.1.0","index":12,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.android.support:support-annotations:27.1.1","index":13,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.squareup.okio:okio:1.17.2","index":15,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.lifecycle:runtime:1.0.0","index":16,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.lifecycle:common:1.0.0","index":17,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"android.arch.core:common:1.0.0","index":18,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true},{"name":"com.squareup.okhttp3:okhttp:3.14.0","index":19,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":false},{"name":"com.squareup.okhttp3:okhttp:3.14.1","index":20,"scopes":["EXTERNAL_LIBRARIES"],"types":["CLASSES"],"format":"JAR","present":true}]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -121,6 +121,7 @@ import { NgxMatSelectSearchModule} from 'ngx-mat-select-search'
import { ContentLoaderModule } from '@netbasal/content-loader'; import { ContentLoaderModule } from '@netbasal/content-loader';
import {PdQuestionAssessedDailyPurchasePage} from '../pages/pd-question/pd-question-assessed-daily-purchase/pd-question-assessed-daily-purchase' import {PdQuestionAssessedDailyPurchasePage} from '../pages/pd-question/pd-question-assessed-daily-purchase/pd-question-assessed-daily-purchase'
import {RupeeCurrencyFormatPipe} from '../pipes/rupee-currency-format/rupee-currency-format' import {RupeeCurrencyFormatPipe} from '../pipes/rupee-currency-format/rupee-currency-format'
import {PdQuestionAssessedImagesPage} from '../pages/pd-question/pd-question-assessed-images/pd-question-assessed-images'
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -173,6 +174,7 @@ import {RupeeCurrencyFormatPipe} from '../pipes/rupee-currency-format/rupee-curr
PdQuestionSalaryInfoPage, PdQuestionSalaryInfoPage,
PdQuestionAssessedSummaryPage, PdQuestionAssessedSummaryPage,
PdQuestionAssessedDailyPurchasePage, PdQuestionAssessedDailyPurchasePage,
PdQuestionAssessedImagesPage,
RupeeCurrencyFormatPipe RupeeCurrencyFormatPipe
], ],
imports: [ imports: [
@ -263,7 +265,8 @@ import {RupeeCurrencyFormatPipe} from '../pipes/rupee-currency-format/rupee-curr
PdGeneralImagesPage, PdGeneralImagesPage,
PdQuestionSalaryInfoPage, PdQuestionSalaryInfoPage,
PdQuestionAssessedSummaryPage, PdQuestionAssessedSummaryPage,
PdQuestionAssessedDailyPurchasePage PdQuestionAssessedDailyPurchasePage,
PdQuestionAssessedImagesPage
], ],
providers: [ providers: [

View File

@ -145,6 +145,8 @@ export class PdQuestionAddressPage {
this.getPDImages(); this.getPDImages();
} }
searchFun(control:any,i:number,option){ searchFun(control:any,i:number,option){
// console.log(control,i) // console.log(control,i)
if (option == 'city') { if (option == 'city') {
@ -303,12 +305,50 @@ countRowsForTextarea(text){
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -648,6 +688,8 @@ countRowsForTextarea(text){
// this.toast.pdTriggerappmessage('Record Saved Successfully.!'); // this.toast.pdTriggerappmessage('Record Saved Successfully.!');
// },5000) // },5000)
if(data['dataStatus']==true){ if(data['dataStatus']==true){
//TO CHANGE THE FORM STATE
this.pdQuestionAddress.reset(this.pdQuestionAddress.value);
this.toast.pdTriggerappmessage('Record Saved Successfully'); this.toast.pdTriggerappmessage('Record Saved Successfully');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -864,7 +906,7 @@ countRowsForTextarea(text){
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -131,6 +131,16 @@
<h1 class="htag">SUMMARY</h1> <h1 class="htag">SUMMARY</h1>
</mat-card> </mat-card>
</ion-col> </ion-col>
<ion-col col-6 text-center >
<mat-card (click)="getViewPage(12)" style="height: 110px;">
<!-- <span class="ribbon cruzeiro">
<span>--</span>
</span> -->
<ion-icon class="ion-icon-custome" name="md-camera"></ion-icon>
<h1 class="htag">IMAGES</h1>
</mat-card>
</ion-col>
</ion-row> </ion-row>
<!-- <mat-card *ngIf="finalAccess" style="margin-bottom:10px;"> <!-- <mat-card *ngIf="finalAccess" style="margin-bottom:10px;">

View File

@ -6,6 +6,7 @@ import { QuestionCategoryProvider } from '../../../providers/question-category/q
import { ToastProvider } from '../../../providers/common-provider/toast'; import { ToastProvider } from '../../../providers/common-provider/toast';
import { PdQuestionAssessedInfoPage } from '../pd-question-assessed-info/pd-question-assessed-info'; import { PdQuestionAssessedInfoPage } from '../pd-question-assessed-info/pd-question-assessed-info';
import {PdQuestionAssessedSummaryPage} from '../pd-question-assessed-summary/pd-question-assessed-summary' import {PdQuestionAssessedSummaryPage} from '../pd-question-assessed-summary/pd-question-assessed-summary'
import {PdQuestionAssessedImagesPage} from '../../pd-question/pd-question-assessed-images/pd-question-assessed-images'
/** /**
* Generated class for the PdQuestionAssessedDashPage page. * Generated class for the PdQuestionAssessedDashPage page.
@ -67,6 +68,9 @@ export class PdQuestionAssessedDashPage {
if(pageId == 11){//Summary if(pageId == 11){//Summary
this.navCtrl.push(PdQuestionAssessedSummaryPage,{'pdDetails':this.pdDetails,'pageId':pageId}) this.navCtrl.push(PdQuestionAssessedSummaryPage,{'pdDetails':this.pdDetails,'pageId':pageId})
} }
else if(pageId == 12){//IMAGES
this.navCtrl.push(PdQuestionAssessedImagesPage,{'pdDetails':this.pdDetails,'pageId':pageId,'formdetails':this.FormId})
}
else{ else{
this.navCtrl.push(PdQuestionAssessedInfoPage,{'pdDetails':this.pdDetails,'pageId':pageId}); this.navCtrl.push(PdQuestionAssessedInfoPage,{'pdDetails':this.pdDetails,'pageId':pageId});
} }

View File

@ -0,0 +1,58 @@
<!--
Generated template for the PdQuestionAssessedImagesPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar color="optblue">
<ion-title>Images For Assessed Income</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<mat-card #picContent>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found</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>
<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>
</ion-grid>
<hr/>
<hr/>
<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>
<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>
<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

@ -0,0 +1,34 @@
page-pd-question-assessed-images {
.scroll-content {
padding: 16px;
}
.scroll-content{
background-color: #eee;
}
.mat-card{
margin-bottom: 15px;
border-radius: 10px !important;
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
}
.mat-card-content{
margin-bottom: 0px !important;
}
img{
padding:0 5px 0 0;
height: 180px;
//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

@ -0,0 +1,120 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {CameraProvider} from '../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../providers/common-provider/loading'
import {ToastProvider} from '../../../providers/common-provider/toast'
import {QuestionCategoryProvider} from '../../../providers/question-category/question-category'
import { QueueScheduler } from 'rxjs/internal/scheduler/QueueScheduler';
/**
* Generated class for the PdQuestionAssessedImagesPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@Component({
selector: 'page-pd-question-assessed-images',
templateUrl: 'pd-question-assessed-images.html',
})
export class PdQuestionAssessedImagesPage {
imageDisplay: any=[];
imageBucket: any=[];
pdDetails:any;
FormId:any;
constructor(public navCtrl: NavController, public navParams: NavParams,private cameraProvider:CameraProvider,
private loading:LoadingProvider,private toast:ToastProvider,public qustCat:QuestionCategoryProvider ) {
this.pdDetails=this.navParams.get('pdDetails');
this.FormId=this.navParams.get('formdetails')
console.log("pd",this.pdDetails,"form",this.FormId)
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionAssessedImagesPage');
this.getPDImages();
}
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':this.pdDetails.company_id}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
console.log(val['records'])
if(val['records'].length>0){
val['records'].forEach(result=>{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
})
console.log("imageBuck",this.imageDisplay);
}
}
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':''});
//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));
})
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.FormId.form_id,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id
}
console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
console.log("res",res);
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
console.log("Fail")
this.toast.pdTriggerappmessage('Fail');
}
},ERR=>{
console.log(JSON.stringify(ERR));
this.toast.pdTriggerappmessage(JSON.stringify(ERR));
})
}
}

View File

@ -100,29 +100,57 @@ export class PdQuestionAssestsPage {
// if(val==1){ // if(val==1){
// } // }
// if(val.__zone_symbol__state) return new Promise((resolve,reject)=>{
return new Promise((resolve, reject) => { let alert=this.toast.setAlert("Form is Modified","Are you sure want to Go Back")
let alert=this.alert.create({ alert.present();
title:'Form is Modified', alert.onDidDismiss((data)=>{
message:'Are you sure want to Go Back', console.log("d",data);
cssClass:'buttoncss', if(data== false){
buttons:[{ reject();
text:'Yes', return true;
cssClass:'btnYes',
handler:()=>{
resolve();
} }
}, else{
{ //AFTER FORM DIRTY CHECK
text:'No', if (this.imageBucket.length > 0) {
cssClass:'btnNo', return new Promise((resolve1, reject1) => {
handler:()=>{ let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject(); reject();
} }
}] else {
}); resolve1();
alert.present() resolve();
}
}) })
})
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
} }
@ -519,6 +547,8 @@ export class PdQuestionAssestsPage {
{ {
if(res['dataStatus']==true) if(res['dataStatus']==true)
{ {
//TO CHANGE THE FORM STATE
this.AssetsDetailsForm.reset(this.AssetsDetailsForm.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -777,7 +807,7 @@ export class PdQuestionAssestsPage {
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -98,15 +98,71 @@ export class PdQuestionBankingPage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve();
}
})
})
}
resolve(); resolve();
} }
}) })
}) })
} }
else{
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
}
}
checkImage(){
let value
if(this.imageDisplay.length>0){
// return new Promise((resolve,reject)=>{
let alert=this.toast.setAlert("<small>Captured Images are not Saved<small>","<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data)=>{
console.log("d",data);
if(data== false){
// reject();
value=false;
}
else{
// resolve();
value=true;
}
})
// })
}
return value
} }
searchFun(control){ searchFun(control){
control.controls['filterCtrl'].valueChanges control.controls['filterCtrl'].valueChanges
@ -302,6 +358,18 @@ inWords(e,i,flag){
if(data['dataStatus']==true) if(data['dataStatus']==true)
{ {
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
// this.bankDetails.dirty=false;
// this.bankDetails.markAsDirty();
// console.log("Dir",this.bankDetails.markAsDirty())
// console.log("pristine",this.bankDetails.markAsPristine());
// console.log("Touched",this.bankDetails.markAsTouched());
//TO CHANGE THE FORM STATE
// this.bankDetails.markAsUntouched();
// console.log("touched",this.bankDetails.touched)
// console.log("untouched",this.bankDetails.untouched)
// console.log("pristine",this.bankDetails.pristine)
this.bankDetails.reset(this.bankDetails.value)
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
},2000); },2000);
@ -359,7 +427,7 @@ inWords(e,i,flag){
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -12,12 +12,62 @@
</button> </button>
<ion-title *ngIf="!viewchange">{{formDetails.form_name}}</ion-title> <ion-title *ngIf="!viewchange">{{formDetails.form_name}}</ion-title>
</ion-navbar> </ion-navbar>
<ion-segment [(ngModel)]="tab" color="optblue">
<ion-segment-button value="0">
Form
</ion-segment-button>
<ion-segment-button value="1">
Pictures
</ion-segment-button>
</ion-segment>
</ion-header> </ion-header>
<ion-content padding> <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 below 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>
<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>
<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="'0'">
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom"> <form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom">
<div formArrayName="business_assets_for_address"> <div formArrayName="business_assets_for_address">
<div <div
@ -371,7 +421,12 @@
</mat-card> </mat-card>
</form> </form>
</div>
<!--END OF FORM SEGMENT-->
</div>
<!--END OF SWITCHCASES-->
<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> </ion-content>
<ion-footer> <ion-footer>
<button ion-button full color="optblue" (click)="onSubmit()"> Save</button> <button ion-button full color="optblue" (click)="onSubmit()"> Save</button>

View File

@ -23,5 +23,21 @@ page-pd-question-business-assets {
mat-select{ mat-select{
margin-top:7px; margin-top:7px;
} }
img{
padding:0 5px 0 0;
height: 180px;
//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

@ -6,7 +6,8 @@ import { QuestionCategoryProvider } from '../../../../providers/question-categor
import { ConstantsProvider } from '../../../../providers/constants/constants' import { ConstantsProvider } from '../../../../providers/constants/constants'
import { ToastProvider } from '../../../../providers/common-provider/toast' import { ToastProvider } from '../../../../providers/common-provider/toast'
import { controlNameBinding } from '@angular/forms/src/directives/reactive_directives/form_control_name'; import { controlNameBinding } from '@angular/forms/src/directives/reactive_directives/form_control_name';
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
/** /**
* Generated class for the PdQuestionBusinessAssetsPage page. * Generated class for the PdQuestionBusinessAssetsPage page.
* *
@ -62,8 +63,14 @@ export class PdQuestionBusinessAssetsPage {
pinArr: any=[]; pinArr: any=[];
m_state_for_address: any=[]; m_state_for_address: any=[];
@ViewChild('remarksFocus') focusRemark:ElementRef @ViewChild('remarksFocus') focusRemark:ElementRef
imageDisplay: any[];
imageBucket: any=[];
tab: any='0';
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustcat:QuestionCategoryProvider,public cons:ConstantsProvider,public toast:ToastProvider) { 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,
private cameraProvider:CameraProvider) {
this.pdDetails=this.navParams.get('pdDetails'); this.pdDetails=this.navParams.get('pdDetails');
@ -93,6 +100,7 @@ export class PdQuestionBusinessAssetsPage {
console.log('ionViewDidLoad PdQuestionBusinessAssetsPage'); console.log('ionViewDidLoad PdQuestionBusinessAssetsPage');
this.getDetails() this.getDetails()
//this.getAddress() //this.getAddress()
this.getPDImages();
} }
getAddress(){ getAddress(){
let params:any={}; let params:any={};
@ -939,4 +947,81 @@ if(flag== 11){
} }
} }
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.formDetails.form_id,'company_id':this.pdDetails.company_id}
this.qustcat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
console.log(val['records'])
if(val['records'].length>0){
val['records'].forEach(result=>{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
})
console.log("imageBuck",this.imageDisplay);
}
}
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':''});
//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';
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.formDetails.form_id,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id
}
console.log("records",JSON.stringify(records))
this.qustcat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');
}
})
}
} }

View File

@ -9,12 +9,60 @@
<ion-navbar color="optblue"> <ion-navbar color="optblue">
<ion-title>{{formDetails.form_name}}</ion-title> <ion-title>{{formDetails.form_name}}</ion-title>
</ion-navbar> </ion-navbar>
<ion-segment [(ngModel)]="tab" color="optblue">
<ion-segment-button value="0">
Form
</ion-segment-button>
<ion-segment-button value="1">
Pictures
</ion-segment-button>
</ion-segment>
</ion-header> </ion-header>
<ion-content padding> <ion-content padding>
<form [formGroup]="bankingForm"> <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 below 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>
<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>
<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>
<form [formGroup]="bankingForm" *ngSwitchCase="'0'">
<div formArrayName="itemRows" class="accordion"> <div formArrayName="itemRows" class="accordion">
<mat-accordion *ngFor="let itemrow of bankingForm.controls.itemRows['controls']; let i=index;let last=last" <mat-accordion *ngFor="let itemrow of bankingForm.controls.itemRows['controls']; let i=index;let last=last"
[formGroupName]="i"> [formGroupName]="i">
@ -152,6 +200,10 @@
</ion-row> </ion-row>
</form> </form>
</div>
<!--END OF SWITCHCASES-->
<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> </ion-content>
<ion-footer> <ion-footer>
<button ion-button full color="optblue" (click)="savepdBank(bankingForm.value)"> Save</button> <button ion-button full color="optblue" (click)="savepdBank(bankingForm.value)"> Save</button>

View File

@ -15,4 +15,20 @@ page-pd-question-business-banking {
.scroll-content{ .scroll-content{
background-color: #eee; background-color: #eee;
} }
img{
padding:0 5px 0 0;
height: 180px;
//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

@ -7,7 +7,8 @@ import { QuestionCategoryProvider } from '../../../../providers/question-categor
import {ConstantsProvider} from '../../../../providers/constants/constants' import {ConstantsProvider} from '../../../../providers/constants/constants'
import {ToastProvider} from '../../../../providers/common-provider/toast' import {ToastProvider} from '../../../../providers/common-provider/toast'
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
/** /**
* Generated class for the PdQuestionBusinessBankingPage page. * Generated class for the PdQuestionBusinessBankingPage page.
@ -49,7 +50,13 @@ step:number
monthErrorMessage: any=[]; monthErrorMessage: any=[];
m_btLenderListValue:any=[] m_btLenderListValue:any=[]
protected _onDestroy = new Subject<void>(); protected _onDestroy = new Subject<void>();
constructor(public navCtrl: NavController, public navParams: NavParams,public aws: AwsServiceProvider,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public cons:ConstantsProvider,public toast:ToastProvider) { imageDisplay: any[];
imageBucket: any=[];
tab: string='0';
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,
private cameraProvider:CameraProvider) {
this.pdDetails=this.navParams.get('pdDetails') this.pdDetails=this.navParams.get('pdDetails')
this.pd_cus_segment=this.pdDetails.customer_segment_abbr.toUpperCase(); this.pd_cus_segment=this.pdDetails.customer_segment_abbr.toUpperCase();
@ -85,6 +92,7 @@ step:number
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionBusinessBankingPage'); console.log('ionViewDidLoad PdQuestionBusinessBankingPage');
this.getPDImages();
} }
searchFun(control){ searchFun(control){
if(!this.m_btLenderListValue){ if(!this.m_btLenderListValue){
@ -369,6 +377,7 @@ console.log(this.generalExistBusinessYear)
if(data['dataStatus']==true) if(data['dataStatus']==true)
{ {
this.bankingForm.markAsUntouched();
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -381,6 +390,82 @@ console.log(this.generalExistBusinessYear)
} }
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.formDetails.form_id,'company_id':this.pdDetails.company_id}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
console.log(val['records'])
if(val['records'].length>0){
val['records'].forEach(result=>{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
})
console.log("imageBuck",this.imageDisplay);
}
}
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':''});
//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';
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.formDetails.form_id,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id
}
console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');
}
})
}

View File

@ -8,11 +8,60 @@
</ion-navbar> </ion-navbar>
<ion-segment [(ngModel)]="tab" color="optblue">
<ion-segment-button value="0">
Form
</ion-segment-button>
<ion-segment-button value="1">
Pictures
</ion-segment-button>
</ion-segment>
</ion-header> </ion-header>
<ion-content padding> <ion-content padding>
<form [formGroup]="businessForm" class="address"> <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 below 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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" *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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" #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>
<form [formGroup]="businessForm" class="address" *ngSwitchCase="'0'">
<div formArrayName="partners"> <div formArrayName="partners">
<mat-accordion *ngFor="let member of businessForm.controls.partners['controls']; let i=index ; let l=last" <mat-accordion *ngFor="let member of businessForm.controls.partners['controls']; let i=index ; let l=last"
@ -1608,6 +1657,10 @@
</ion-row> </ion-row>
</form> </form>
</div>
<!--END OF SWITCHCASES-->
<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> </ion-content>
<ion-footer> <ion-footer>
<button ion-button full color="optblue" (click)="submitDetails()">Save</button> <button ion-button full color="optblue" (click)="submitDetails()">Save</button>

View File

@ -59,4 +59,21 @@ page-pd-question-business-info {
.checkbo{ .checkbo{
margin:15px; margin:15px;
} }
img{
padding:0 5px 0 0;
height: 180px;
//width:130px;
//border:3px solid black;
//border-radius: 20px;
//background-color: gray;
}
.docName{
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
} }

View File

@ -9,7 +9,8 @@ import { elementAt, takeUntil } from 'rxjs/operators';
import { ConstantsProvider } from '../../../../providers/constants/constants' import { ConstantsProvider } from '../../../../providers/constants/constants'
import { Subject, ReplaySubject } from 'rxjs'; import { Subject, ReplaySubject } from 'rxjs';
import {searchValue} from '../../search' import {searchValue} from '../../search'
import { CameraProvider } from '../../../../providers/common-provider/camera'
import { LoadingProvider } from '../../../../providers/common-provider/loading'
/** /**
* Generated class for the PdQuestionBusinessInfoPage page. * Generated class for the PdQuestionBusinessInfoPage page.
* *
@ -78,8 +79,14 @@ export class PdQuestionBusinessInfoPage {
public filteredState:ReplaySubject<searchValue[]>=new ReplaySubject<searchValue[]>(1) public filteredState:ReplaySubject<searchValue[]>=new ReplaySubject<searchValue[]>(1)
cityData:any=[] cityData:any=[]
cityDataValue:any=[] cityDataValue:any=[]
imageDisplay: any[];
imageBucket: any=[];
tab: string='0';
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public toast:ToastProvider,public qustCat:QuestionCategoryProvider,public fb:FormBuilder,public cons:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,
public aws:AwsServiceProvider,public toast:ToastProvider,
public qustCat:QuestionCategoryProvider,public fb:FormBuilder,public cons:ConstantsProvider,
private loading:LoadingProvider,private cameraProvider:CameraProvider) {
this.getStateCityDet(); this.getStateCityDet();
// console.log(typeof this.filteredCity) // console.log(typeof this.filteredCity)
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
@ -150,7 +157,7 @@ export class PdQuestionBusinessInfoPage {
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionBusinessInfoPage'); console.log('ionViewDidLoad PdQuestionBusinessInfoPage');
this.getPDImages();
} }
@ -1583,7 +1590,7 @@ createPOSMachinesDetails(data){
public initBusinessForm(): void { public initBusinessForm(): void {
this.businessForm = this.fb.group({ this.businessForm = this.fb.group({
pdid: this.pdDetails.pd_id, pdid: this.pdDetails.pd_id,
formid: this.FormId.form_id, formid: this.FormId,
fk_createdby: this.users, fk_createdby: this.users,
profession_name: ['', Validators.compose([Validators.required])], profession_name: ['', Validators.compose([Validators.required])],
business_years: ['', Validators.compose([Validators.required])], business_years: ['', Validators.compose([Validators.required])],
@ -1820,6 +1827,7 @@ if(records.pos_machines_details){
this.qustCat.saveForm(records).subscribe(data => { this.qustCat.saveForm(records).subscribe(data => {
if(data['dataStatus']==true) if(data['dataStatus']==true)
{ {
this.businessForm.markAsUntouched();
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -1829,7 +1837,7 @@ if(records.pos_machines_details){
} }
getBuisnessDetails() getBuisnessDetails()
{ {
let records = {'pd_id':this.pdDetails.pd_id,'pd_form_id':this.FormId.form_id}; let records = {'pd_id':this.pdDetails.pd_id,'pd_form_id':this.FormId};
this.qustCat.retiverForm(records).subscribe(data => { this.qustCat.retiverForm(records).subscribe(data => {
let businessVal = data['records']; let businessVal = data['records'];
@ -1891,7 +1899,7 @@ if(records.pos_machines_details){
} }
businessVal.family_members_involved = enduse; businessVal.family_members_involved = enduse;
businessVal.pdid = this.pdDetails.pd_id; businessVal.pdid = this.pdDetails.pd_id;
businessVal.formid = this.FormId.form_id; businessVal.formid = this.FormId;
businessVal.fk_createdby = this.users; businessVal.fk_createdby = this.users;
businessVal.designation = DesgnArray; businessVal.designation = DesgnArray;
businessVal.partners = PartnrArray; businessVal.partners = PartnrArray;
@ -2111,6 +2119,82 @@ toGetPOSMachinesDetails(e,flag){
) )
} }
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId,'company_id':this.pdDetails.company_id}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
console.log(val['records'])
if(val['records'].length>0){
val['records'].forEach(result=>{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
})
console.log("imageBuck",this.imageDisplay);
}
}
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':''});
//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';
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.FormId,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id
}
console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');
}
})
}

View File

@ -6,8 +6,59 @@
<ion-title *ngIf="!viewchange">{{formDetails.form_name}}</ion-title> <ion-title *ngIf="!viewchange">{{formDetails.form_name}}</ion-title>
</ion-navbar> </ion-navbar>
<!-- --> <!-- -->
<ion-segment [(ngModel)]="tab" color="optblue">
<ion-segment-button value="0">
Form
</ion-segment-button>
<ion-segment-button value="1">
Pictures
</ion-segment-button>
</ion-segment>
</ion-header> </ion-header>
<ion-content padding> <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 below 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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" *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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" #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="'0'">
<div *ngIf="noRecordsFound"> <div *ngIf="noRecordsFound">
<form [formGroup]="clientInfoForm"> <form [formGroup]="clientInfoForm">
<div fxLayout="row" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutAlign="start none">
@ -391,6 +442,12 @@
</div> </div>
</mat-card> </mat-card>
</div> </div>
</div>
<!--END OF FORM SEGMENT-->
</div>
<!--END OF SWITCHCASES-->
<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> </ion-content>
<ion-footer> <ion-footer>
<button ion-button full color="optblue" (click)="saveClientInfo(clientInfoForm.value)"> Save</button> <button ion-button full color="optblue" (click)="saveClientInfo(clientInfoForm.value)"> Save</button>

View File

@ -13,4 +13,22 @@ page-pd-question-client-info {
.mat-card-content{ .mat-card-content{
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
img{
padding:0 5px 0 0;
height: 180px;
//width:130px;
//border:3px solid black;
//border-radius: 20px;
//background-color: gray;
}
.docName{
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
} }

View File

@ -4,7 +4,8 @@ import { QuestionCategoryProvider } from '../../../../providers/question-categor
import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service'; import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service';
import { ToastProvider } from '../../../../providers/common-provider/toast'; import { ToastProvider } from '../../../../providers/common-provider/toast';
import { FormGroup, FormBuilder, FormArray } from '@angular/forms'; import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
/** /**
* Generated class for the PdQuestionClientInfoPage page. * Generated class for the PdQuestionClientInfoPage page.
* *
@ -42,9 +43,15 @@ export class PdQuestionClientInfoPage {
m_manufacturingProducts: any = []; m_manufacturingProducts: any = [];
m_tradingProducts: any = []; m_tradingProducts: any = [];
m_suplierProducts: any = []; m_suplierProducts: any = [];
imageDisplay: any[];
imageBucket: any=[];
tab: string='0';
constructor(public navCtrl: NavController, public navParams: NavParams, public qustCat: QuestionCategoryProvider, public aws: AwsServiceProvider, public toast: ToastProvider, public fb: FormBuilder) { constructor(public navCtrl: NavController, public navParams: NavParams,
public qustCat: QuestionCategoryProvider, public aws: AwsServiceProvider,
public toast: ToastProvider, public fb: FormBuilder,private loading:LoadingProvider,private cameraProvider:CameraProvider)
{
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
this.formDetails = this.navParams.get('formDetails'); this.formDetails = this.navParams.get('formDetails');
this.users = this.aws.getlocale(); this.users = this.aws.getlocale();
@ -97,6 +104,7 @@ export class PdQuestionClientInfoPage {
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionClientInfoPage'); console.log('ionViewDidLoad PdQuestionClientInfoPage');
this.getPDImages();
} }
initFormLoadDetails(record) { initFormLoadDetails(record) {
@ -557,7 +565,7 @@ export class PdQuestionClientInfoPage {
Object.keys(answerFormValues).forEach((key) => { if (answerFormValues[key] === null || answerFormValues[key] === undefined || answerFormValues[key] === '') { delete answerFormValues[key] }; }); Object.keys(answerFormValues).forEach((key) => { if (answerFormValues[key] === null || answerFormValues[key] === undefined || answerFormValues[key] === '') { delete answerFormValues[key] }; });
this.qustCat.saveForm(answerFormValues).subscribe(responsed => { this.qustCat.saveForm(answerFormValues).subscribe(responsed => {
if (responsed['status'] == 200) { if (responsed['status'] == 200) {
this.clientInfoForm.markAsUntouched();
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -624,4 +632,82 @@ export class PdQuestionClientInfoPage {
} }
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.formDetails.form_id,'company_id':this.pdDetails.company_id}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
console.log(val['records'])
if(val['records'].length>0){
val['records'].forEach(result=>{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
})
console.log("imageBuck",this.imageDisplay);
}
}
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':''});
//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';
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.formDetails.form_id,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id
}
console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');
}
})
}
} }

View File

@ -10,12 +10,61 @@
<!-- <ion-title>Financial Information</ion-title> --> <!-- <ion-title>Financial Information</ion-title> -->
<ion-title>{{formDetails.form_name}}</ion-title> <ion-title>{{formDetails.form_name}}</ion-title>
</ion-navbar> </ion-navbar>
<ion-segment [(ngModel)]="tab" color="optblue">
<ion-segment-button value="0">
Form
</ion-segment-button>
<ion-segment-button value="1">
Pictures
</ion-segment-button>
</ion-segment>
</ion-header> </ion-header>
<ion-content padding> <ion-content padding>
<form [formGroup]="financialForm"> <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 below 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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" *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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" #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>
<form [formGroup]="financialForm" *ngSwitchCase="'0'">
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>
<mat-card-title> <mat-card-title>
@ -338,6 +387,10 @@
</ion-row> </ion-row>
</form> </form>
</div>
<!--END OF SWITCHCASES-->
<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> </ion-content>
<ion-footer> <ion-footer>
<button ion-button full color="optblue" (click)="submitDetails()"> Save</button> <button ion-button full color="optblue" (click)="submitDetails()"> Save</button>

View File

@ -49,6 +49,21 @@ page-pd-question-financial-info {
white-space: normal; white-space: normal;
} }
img{
padding:0 5px 0 0;
height: 180px;
//width:130px;
//border:3px solid black;
//border-radius: 20px;
//background-color: gray;
}
.docName{
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
} }

View File

@ -5,7 +5,8 @@ import {ToastProvider} from '../../../../providers/common-provider/toast'
import {QuestionCategoryProvider} from '../../../../providers/question-category/question-category' import {QuestionCategoryProvider} from '../../../../providers/question-category/question-category'
import { FormGroup,Validators,FormBuilder, FormArray } from '@angular/forms' import { FormGroup,Validators,FormBuilder, FormArray } from '@angular/forms'
import {ConstantsProvider} from '../../../../providers/constants/constants' import {ConstantsProvider} from '../../../../providers/constants/constants'
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
/** /**
* Generated class for the PdQuestionFinancialInfoPage page. * Generated class for the PdQuestionFinancialInfoPage page.
* *
@ -54,9 +55,14 @@ export class PdQuestionFinancialInfoPage {
{id:4, name:'Factoring'}, {id:4, name:'Factoring'},
{id:5, name:'Forfaiting'}, {id:5, name:'Forfaiting'},
{id:1, name:'Others'}] {id:1, name:'Others'}]
imageDisplay: any[];
imageBucket: any=[];
tab: string='0';
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider, constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,
public toast:ToastProvider, public qustCat:QuestionCategoryProvider,public fb:FormBuilder,public cons:ConstantsProvider) { public toast:ToastProvider, public qustCat:QuestionCategoryProvider,
public fb:FormBuilder,public cons:ConstantsProvider,private cameraProvider:CameraProvider,
private loading:LoadingProvider) {
this.pdDetails=this.navParams.get('pdDetails'); this.pdDetails=this.navParams.get('pdDetails');
this.formDetails=this.navParams.get('formDetails'); this.formDetails=this.navParams.get('formDetails');
this.FormId = this.formDetails.form_id; this.FormId = this.formDetails.form_id;
@ -81,6 +87,7 @@ export class PdQuestionFinancialInfoPage {
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionFinancialInfoPage'); console.log('ionViewDidLoad PdQuestionFinancialInfoPage');
this.getDetails() this.getDetails()
this.getPDImages();
} }
AllCalculation(control,index){ AllCalculation(control,index){
@ -310,6 +317,7 @@ submitDetails(){
let records=this.financialForm.value; let records=this.financialForm.value;
this.qustCat.saveForm(records).subscribe(res=>{ this.qustCat.saveForm(records).subscribe(res=>{
if(res['status']== 200){ if(res['status']== 200){
this.financialForm.markAsUntouched();
this.toast.pdTriggerappmessage("Record Saved Successfully"); this.toast.pdTriggerappmessage("Record Saved Successfully");
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -1239,4 +1247,82 @@ calculateLossAmount( i, details){
break; break;
} }
} }
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.formDetails.form_id,'company_id':this.pdDetails.company_id}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
console.log(val['records'])
if(val['records'].length>0){
val['records'].forEach(result=>{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
})
console.log("imageBuck",this.imageDisplay);
}
}
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':''});
//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';
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.formDetails.form_id,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id
}
console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');
}
})
}
} }

View File

@ -5,8 +5,59 @@
</button> </button>
<ion-title>{{formDetails.form_name}}</ion-title> <ion-title>{{formDetails.form_name}}</ion-title>
</ion-navbar> </ion-navbar>
<ion-segment [(ngModel)]="tab" color="optblue">
<ion-segment-button value="0">
Form
</ion-segment-button>
<ion-segment-button value="1">
Pictures
</ion-segment-button>
</ion-segment>
</ion-header> </ion-header>
<ion-content padding> <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 below 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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" *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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" #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="'0'">
<div *ngIf="noRecordsFound"> <div *ngIf="noRecordsFound">
<form [formGroup]="stockForm"> <form [formGroup]="stockForm">
<div fxLayout="row" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutAlign="start none">
@ -388,6 +439,12 @@
</div> </div>
</mat-card> </mat-card>
</div> </div>
</div>
<!--END OF FORM SEGMENT-->
</div>
<!--END OF SWITCHCASES-->
<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> </ion-content>
<ion-footer> <ion-footer>
<button ion-button full color="optblue" (click)="saveStockInfo(stockForm.value)"> Save</button> <button ion-button full color="optblue" (click)="saveStockInfo(stockForm.value)"> Save</button>

View File

@ -29,4 +29,21 @@ page-pd-question-stock-info {
margin:5px 0; margin:5px 0;
} }
img{
padding:0 5px 0 0;
height: 180px;
//width:130px;
//border:3px solid black;
//border-radius: 20px;
//background-color: gray;
}
.docName{
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
} }

View File

@ -7,7 +7,8 @@ import { FormArray, FormGroup, FormBuilder } from '@angular/forms';
import { ConstantsProvider } from '../../../../providers/constants/constants'; import { ConstantsProvider } from '../../../../providers/constants/constants';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
/** /**
* Generated class for the PdQuestionStockInfoPage page. * Generated class for the PdQuestionStockInfoPage page.
* *
@ -53,8 +54,14 @@ export class PdQuestionStockInfoPage {
TGCommentCard: boolean = false TGCommentCard: boolean = false
public RMsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",disabled:false},{value:"no",isdisplayvalue:"No",disabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",disabled:false}]; public RMsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",disabled:false},{value:"no",isdisplayvalue:"No",disabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",disabled:false}];
public TGsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",isdisabled:false},{value:"no",isdisplayvalue:"No",isdisabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",isdisabled:false}]; public TGsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",isdisabled:false},{value:"no",isdisplayvalue:"No",isdisabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",isdisabled:false}];
imageDisplay: any[];
imageBucket: any=[];
tab: string='0';
constructor(public navCtrl: NavController, public navParams: NavParams, public qustCat: QuestionCategoryProvider, public aws: AwsServiceProvider, public toast: ToastProvider, public fb: FormBuilder, public constant: ConstantsProvider) { 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,private loading:LoadingProvider)
{
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
this.formDetails = this.navParams.get('formDetails'); this.formDetails = this.navParams.get('formDetails');
this.users = this.aws.getlocale(); this.users = this.aws.getlocale();
@ -84,6 +91,11 @@ export class PdQuestionStockInfoPage {
this.getdropdown(); this.getdropdown();
} }
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionStockInfoPage');
this.getPDImages();
}
public initstockForm(record) { public initstockForm(record) {
let api = Object.keys(record.from_business).map(function (key) { let api = Object.keys(record.from_business).map(function (key) {
return record.from_business[key]; return record.from_business[key];
@ -287,9 +299,7 @@ export class PdQuestionStockInfoPage {
} }
} }
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionStockInfoPage');
}
getdropdown() { getdropdown() {
@ -773,10 +783,24 @@ export class PdQuestionStockInfoPage {
/** To Save/Edited Popup Data */ /** To Save/Edited Popup Data */
saveStockInfo(answerFormValues) { saveStockInfo(answerFormValues) {
//To Remove The "Null" With Key also //To Remove The "Null" With Key also
// if(answerFormValues.manufacturing_details){
// answerFormValues.manufacturing_details.forEach(parent=>{
// if(parent.manufacturing_finished_goods){
// parent.manufacturing_finished_goods.forEach(finish_goods=>{
// delete finish_goods.uomSearch
// })
// }
// if(parent.manufacturing_raw_materials){
// parent.manufacturing_raw_materials.forEach(raw_mat=>{
// delete raw_mat.uomSearch
// })
// }
// })
// }
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
this.qustCat.saveForm(answerFormValues).subscribe(responsed => { this.qustCat.saveForm(answerFormValues).subscribe(responsed => {
if (responsed['status'] == 200) { if (responsed['status'] == 200) {
this.stockForm.markAsUntouched();
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(() => { setTimeout(() => {
this.navCtrl.pop(); this.navCtrl.pop();
@ -814,4 +838,81 @@ export class PdQuestionStockInfoPage {
}) })
} }
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.formDetails.form_id,'company_id':this.pdDetails.company_id}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
console.log(val['records'])
if(val['records'].length>0){
val['records'].forEach(result=>{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
})
console.log("imageBuck",this.imageDisplay);
}
}
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':''});
//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';
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.formDetails.form_id,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id
}
console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');
}
})
}
} }

View File

@ -5,8 +5,59 @@
</button> </button>
<ion-title>{{formDetails.form_name}}</ion-title> <ion-title>{{formDetails.form_name}}</ion-title>
</ion-navbar> </ion-navbar>
<ion-segment [(ngModel)]="tab" color="optblue">
<ion-segment-button value="0">
Form
</ion-segment-button>
<ion-segment-button value="1">
Pictures
</ion-segment-button>
</ion-segment>
</ion-header> </ion-header>
<ion-content padding> <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 below 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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" *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>
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input class="docName" #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="'0'">
<div *ngIf="noRecordsFound"> <div *ngIf="noRecordsFound">
<form [formGroup]="supplierInfoForm"> <form [formGroup]="supplierInfoForm">
<div fxLayout="row" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutAlign="start none">
@ -251,6 +302,12 @@
</div> </div>
</mat-card> </mat-card>
</div> </div>
</div>
<!--END OF FORM SEGMENT-->
</div>
<!--END OF SWITCHCASES-->
<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> </ion-content>
<ion-footer> <ion-footer>
<button ion-button full color="optblue" (click)="saveSupplierInfo(supplierInfoForm.value)"> Save</button> <button ion-button full color="optblue" (click)="saveSupplierInfo(supplierInfoForm.value)"> Save</button>

View File

@ -13,4 +13,20 @@ page-pd-question-supplier-info {
.mat-card-content{ .mat-card-content{
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
img{
padding:0 5px 0 0;
height: 180px;
//width:130px;
//border:3px solid black;
//border-radius: 20px;
//background-color: gray;
}
.docName{
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
} }

View File

@ -4,7 +4,8 @@ import { FormBuilder, FormGroup, FormArray } from '@angular/forms';
import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service'; import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service';
import { QuestionCategoryProvider } from '../../../../providers/question-category/question-category'; import { QuestionCategoryProvider } from '../../../../providers/question-category/question-category';
import { ToastProvider } from '../../../../providers/common-provider/toast'; import { ToastProvider } from '../../../../providers/common-provider/toast';
import {CameraProvider} from '../../../../providers/common-provider/camera'
import {LoadingProvider} from '../../../../providers/common-provider/loading'
/** /**
* Generated class for the PdQuestionSupplsierInfoPage page. * Generated class for the PdQuestionSupplsierInfoPage page.
* *
@ -35,8 +36,14 @@ export class PdQuestionSupplierInfoPage {
noRecordsFound: Boolean = false; noRecordsFound: Boolean = false;
public submitted = false; public submitted = false;
errorMessage: any = ''; errorMessage: any = '';
imageDisplay: any[];
imageBucket: any=[];
tab: string='0';
constructor(public navCtrl: NavController, public navParams: NavParams, public fb: FormBuilder, public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider, public toast: ToastProvider) { 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)
{
this.questionDetails = this.navParams.get('questionDetails'); this.questionDetails = this.navParams.get('questionDetails');
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
@ -93,6 +100,7 @@ export class PdQuestionSupplierInfoPage {
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionSupplierInfoPage'); console.log('ionViewDidLoad PdQuestionSupplierInfoPage');
this.getPDImages();
} }
@ -411,7 +419,7 @@ export class PdQuestionSupplierInfoPage {
this.qustCat.saveForm(answerFormValues).subscribe(responsed => { this.qustCat.saveForm(answerFormValues).subscribe(responsed => {
if (responsed['status'] == 200) { if (responsed['status'] == 200) {
this.supplierInfoForm.markAsUntouched();
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(() => { setTimeout(() => {
this.navCtrl.pop(); this.navCtrl.pop();
@ -491,4 +499,82 @@ export class PdQuestionSupplierInfoPage {
items.controls['manufacturing_credit_days_to'].updateValueAndValidity(); items.controls['manufacturing_credit_days_to'].updateValueAndValidity();
} }
} }
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.formDetails.form_id,'company_id':this.pdDetails.company_id}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){
console.log(val['records'])
if(val['records'].length>0){
val['records'].forEach(result=>{
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
})
console.log("imageBuck",this.imageDisplay);
}
}
})
}
changeName(value,index,img){
console.log(value);
this.imageDisplay[index]={'image':img,'Name':value}
}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getpicture().then(res=>{
console.log("Value",res)
if(res != 'error'){
this.imageBucket.push({'image':res,'Name':''});
//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';
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.pdDetails.pd_id,
'formid':this.formDetails.form_id,
'images':this.imageBucket,
'company_id':this.pdDetails.company_id
}
console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');
}
})
}
} }

View File

@ -97,16 +97,50 @@ applicants: any;
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve();
}
})
})
}
resolve(); resolve();
} }
}) })
}) })
} }
else{
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
} }
else {
resolve();
}
})
})
}
}
}
getdropdown() getdropdown()
{ {
@ -358,7 +392,12 @@ submitCurrentloan(answerData) {
if(data['dataStatus']==true) if(data['dataStatus']==true)
{ {
//TO CHANGE THE FORM STATE
// this.currentLoans.markAsUntouched();
this.currentLoans.reset(this.currentLoans.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
},2000); },2000);
@ -660,7 +699,7 @@ submitCurrentloan(answerData) {
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])
@ -722,14 +761,19 @@ submitCurrentloan(answerData) {
console.log("records",JSON.stringify(records)) console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{ this.qustCat.savePDImages(records).subscribe(res=>{
console.log("res",res);
if(res['dataStatus']== true){ if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully") this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[] this.imageBucket=[]
this.getPDImages(); this.getPDImages();
} }
else{ else{
console.log("Fail")
this.toast.pdTriggerappmessage('Fail'); this.toast.pdTriggerappmessage('Fail');
} }
},ERR=>{
console.log(JSON.stringify(ERR));
this.toast.pdTriggerappmessage(JSON.stringify(ERR));
}) })
} }
} }

View File

@ -133,12 +133,50 @@ export class PdQuestionEmpInfoPage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -287,6 +325,9 @@ export class PdQuestionEmpInfoPage {
if(data['dataStatus']== true){ if(data['dataStatus']== true){
//TO CHANGE THE FORM STATE
// this.employmentForm.markAsUntouched();
this.employmentForm.reset(this.employmentForm.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -490,7 +531,7 @@ inWords(val,flag:number){
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -113,12 +113,50 @@ data:any;
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -571,7 +609,8 @@ savepdfamily(answerData)
}) })
}) })
this.qustCat.saveForm(records).subscribe(res=>{ this.qustCat.saveForm(records).subscribe(res=>{
//TO CHANGE THE FORM STATE
this.familyForm.reset(this.familyForm.value);
this.toast.pdTriggerappmessage("Record Saved Successfully"); this.toast.pdTriggerappmessage("Record Saved Successfully");
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -989,7 +1028,7 @@ searchFun(control:any,i:number,option){
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -79,12 +79,50 @@ export class PdQuestionFinalRemarkPage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -385,6 +423,8 @@ RecommendationChange(e) {
Object.keys(answerData).forEach((key) => (answerData[key] == null) && delete answerData[key]); Object.keys(answerData).forEach((key) => (answerData[key] == null) && delete answerData[key]);
this.qustcat.saveForm(answerData).subscribe(res=>{ this.qustcat.saveForm(answerData).subscribe(res=>{
if(res['dataStatus']==true){ if(res['dataStatus']==true){
//TO CHANGE THE FORM STATE
this._finalRemarkForm.reset(this._finalRemarkForm.value);
this.toast.pdTriggerappmessage("Record Saved Successfully"); this.toast.pdTriggerappmessage("Record Saved Successfully");
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -400,7 +440,7 @@ RecommendationChange(e) {
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustcat.getPDImages(record_for_pic).subscribe(val=>{ this.qustcat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -176,12 +176,50 @@ export class PdQuestionGeneralInfoPage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -1031,6 +1069,8 @@ console.log('1)',this.temp);
this.qustCat.saveForm(saveRecords).subscribe(dataResult=>{ this.qustCat.saveForm(saveRecords).subscribe(dataResult=>{
if(dataResult['dataStatus']==true){ if(dataResult['dataStatus']==true){
//TO CHANGE THE FORM STATE
this.generalForm.reset(this.generalForm.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -1286,7 +1326,7 @@ console.log('1)',this.temp);
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -63,12 +63,50 @@ export class PdQuestionLenderRepresentativePage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -102,7 +140,8 @@ export class PdQuestionLenderRepresentativePage {
{ {
if(res['dataStatus']==true) if(res['dataStatus']==true)
{ {
//TO CHANGE THE FORM STATE
this.representativeForm.reset(this.representativeForm.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -157,7 +196,7 @@ export class PdQuestionLenderRepresentativePage {
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -176,14 +176,51 @@ export class PdQuestionLoansPage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve();
}
})
})
}
resolve(); resolve();
} }
}) })
}) })
} }
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
}
} }
protected filterBank(){ protected filterBank(){
@ -595,6 +632,9 @@ export class PdQuestionLoansPage {
records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value; records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value;
this.qustCat.saveForm(records).subscribe(data => { this.qustCat.saveForm(records).subscribe(data => {
if(data['dataStatus']== true){ if(data['dataStatus']== true){
//TO CHANGE THE FORM STATE
// this.loanDetailsForm.markAsUntouched();
this.loanDetailsForm.reset(this.loanDetailsForm.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -760,7 +800,7 @@ export class PdQuestionLoansPage {
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -85,12 +85,50 @@ export class PdQuestionNeighbourHoodPage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -414,7 +452,8 @@ ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
{ {
if(res['dataStatus']==true) if(res['dataStatus']==true)
{ {
//TO CHANGE THE FORM STATE
this.neighbourhoodForm.reset(this.neighbourhoodForm.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -503,7 +542,7 @@ ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -100,12 +100,50 @@ export class PdQuestionOtherIncomePage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -274,7 +312,8 @@ submitOtherIncome(answerData)
records.income_details = answerData.income_details; records.income_details = answerData.income_details;
records.otherincome_remarks = answerData.otherincome_remarks; records.otherincome_remarks = answerData.otherincome_remarks;
this.qustCat.saveForm(records).subscribe(data => { this.qustCat.saveForm(records).subscribe(data => {
//TO CHANGE THE FORM STATE
this.otherIncomeForm.reset(this.otherIncomeDetails.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -337,7 +376,7 @@ getOtherIncome()
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -213,12 +213,50 @@ export class PdQuestionRentalInfoPage {
console.log("d",data); console.log("d",data);
if(data== false){ if(data== false){
reject(); reject();
return true;
} }
else{ else{
//AFTER FORM DIRTY CHECK
if (this.imageBucket.length > 0) {
return new Promise((resolve1, reject1) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve(); resolve();
} }
}) })
}) })
}
resolve();
}
})
})
}
else{
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
console.log("d", data);
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
} }
@ -999,6 +1037,8 @@ compareSingleObjects(o1: any, o2: any) {
{ {
if(res['dataStatus']==true) if(res['dataStatus']==true)
{ {
//TO CHANGE THE FORM STATE
this.rentalForms.reset(this.rentalForms.value);
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
setTimeout(()=>{ setTimeout(()=>{
this.navCtrl.pop(); this.navCtrl.pop();
@ -1424,7 +1464,7 @@ forSearchableDropdown(val:any,Flag:any){
getPDImages(){ getPDImages(){
//FOR RETRIEVING PICTURES //FOR RETRIEVING PICTURES
this.imageDisplay=[] this.imageDisplay=[]
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id} let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null}
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
if(!val['msg']){ if(!val['msg']){
console.log(val['records']) console.log(val['records'])

View File

@ -17,9 +17,10 @@ public commonimage = "http://ssa.sineedge.com/sparqapi/logo/avatar.jpg";
apiurl() apiurl()
{ {
let testapiurl = 'http://ssa.sineedge.com/sparqtest/api/'; let testapiurl = 'http://ssa.sineedge.com/sparqtest/api/';
let devapiurl_beta = 'http://ssa.sineedge.com/sparqapi_beta/api/';
let devapiurl = 'http://ssa.sineedge.com/sparqapi/api/'; let devapiurl = 'http://ssa.sineedge.com/sparqapi/api/';
let localapiurl = 'http://192.168.0.9/sparqapi/api/'; let localapiurl = 'http://192.168.0.9/sparqapi/api/';
return devapiurl; return devapiurl_beta;
} }
getcurrentDate() getcurrentDate()

View File

@ -29300,6 +29300,38 @@ page-pd-question-assessed-household .mat-card-content {
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
page-pd-question-assessed-images .scroll-content {
padding: 16px;
}
page-pd-question-assessed-images .scroll-content {
background-color: #eee;
}
page-pd-question-assessed-images .mat-card {
margin-bottom: 15px;
border-radius: 10px !important;
-webkit-box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
}
page-pd-question-assessed-images .mat-card-content {
margin-bottom: 0px !important;
}
page-pd-question-assessed-images img {
padding: 0 5px 0 0;
height: 180px;
}
page-pd-question-assessed-images input {
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
page-pd-question-assessed-info ion-scroll.scroll-y .scroll-content { page-pd-question-assessed-info ion-scroll.scroll-y .scroll-content {
width: 100%; width: 100%;
height: 200px; height: 200px;
@ -29599,6 +29631,19 @@ page-pd-question-business-assets mat-select {
margin-top: 7px; margin-top: 7px;
} }
page-pd-question-business-assets img {
padding: 0 5px 0 0;
height: 180px;
}
page-pd-question-business-assets input {
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
page-pd-question-business-banking .mat-card { page-pd-question-business-banking .mat-card {
margin-bottom: 15px; margin-bottom: 15px;
border-radius: 10px !important; border-radius: 10px !important;
@ -29621,6 +29666,19 @@ page-pd-question-business-banking .scroll-content {
background-color: #eee; background-color: #eee;
} }
page-pd-question-business-banking img {
padding: 0 5px 0 0;
height: 180px;
}
page-pd-question-business-banking input {
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
page-pd-question-business-info mat-card-title { page-pd-question-business-info mat-card-title {
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
@ -29687,6 +29745,19 @@ page-pd-question-business-info .checkbo {
margin: 15px; margin: 15px;
} }
page-pd-question-business-info img {
padding: 0 5px 0 0;
height: 180px;
}
page-pd-question-business-info .docName {
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
page-pd-question-client-info mat-hint { page-pd-question-client-info mat-hint {
font-size: 12px; font-size: 12px;
} }
@ -29706,6 +29777,19 @@ page-pd-question-client-info .mat-card-content {
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
page-pd-question-client-info img {
padding: 0 5px 0 0;
height: 180px;
}
page-pd-question-client-info .docName {
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
page-pd-question-financial-info mat-form-field { page-pd-question-financial-info mat-form-field {
width: 100%; width: 100%;
} }
@ -29762,6 +29846,19 @@ page-pd-question-financial-info .mat-input-placeholder {
white-space: normal; white-space: normal;
} }
page-pd-question-financial-info img {
padding: 0 5px 0 0;
height: 180px;
}
page-pd-question-financial-info .docName {
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
page-pd-question-stock-info mat-hint { page-pd-question-stock-info mat-hint {
font-size: 12px; font-size: 12px;
} }
@ -29798,6 +29895,19 @@ page-pd-question-stock-info mat-select {
margin: 5px 0; margin: 5px 0;
} }
page-pd-question-stock-info img {
padding: 0 5px 0 0;
height: 180px;
}
page-pd-question-stock-info .docName {
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
page-pd-question-supplier-info mat-hint { page-pd-question-supplier-info mat-hint {
font-size: 12px; font-size: 12px;
} }
@ -29817,6 +29927,19 @@ page-pd-question-supplier-info .mat-card-content {
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
page-pd-question-supplier-info img {
padding: 0 5px 0 0;
height: 180px;
}
page-pd-question-supplier-info .docName {
width: 100px;
border-radius: 4px;
border-color: gray;
font-size: 12px;
height: 28px;
}
page-pd-question-current-loans mat-form-field { page-pd-question-current-loans mat-form-field {
width: 100%; width: 100%;
} }