From 5dd3425a793a217b9215a70109691b34d8a62966 Mon Sep 17 00:00:00 2001 From: saravanakumarkandasami Date: Thu, 13 Jun 2019 19:21:13 +0530 Subject: [PATCH] clix changes :ps --- src/app/app.module.ts | 4 +- src/pages/input/input.ts | 2 +- .../pd-question-category.ts | 5 + .../pd-question-address.ts | 24 ++ .../pd-question-business-info.html | 31 +++ .../pd-question-business-info.ts | 16 +- .../pd-question-financial-info.html | 9 +- .../pd-question-financial-info.ts | 50 ++-- .../pd-question-supplier-info.html | 2 + .../pd-question-final-remark.html | 82 ++++++ .../pd-question-final-remark.scss | 4 + .../pd-question-final-remark.ts | 91 ++++++- ...future-plans-and-business-environment.html | 149 +++++++++++ ...future-plans-and-business-environment.scss | 55 ++++ ...n-future-plans-and-business-environment.ts | 250 ++++++++++++++++++ .../pd-question-loans/pd-question-loans.html | 20 +- .../pd-question-loans/pd-question-loans.ts | 29 +- 17 files changed, 776 insertions(+), 47 deletions(-) create mode 100644 src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.html create mode 100644 src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.scss create mode 100644 src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 80dee8d7..a769879b 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -107,7 +107,7 @@ import { PdQuestionGeneralInfoPage } from '../pages/pd-question/pd-question-gene import { PdQuestionGeneralOtherApplicantPage } from '../pages/pd-question/pd-question-general-info/pd-question-general-other-applicant/pd-question-general-other-applicant'; import { PdQuestionNeighbourHoodPage } from '../pages/pd-question/pd-question-neighbour-hood/pd-question-neighbour-hood'; import { PdQuestionFinalRemarkPage } from '../pages/pd-question/pd-question-final-remark/pd-question-final-remark'; - +import { PdQuestionFuturePlansAndBusinessEnvironmentPage } from '../pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment'; import { PdQuestionBusinessPage } from '../pages/pd-question/pd-question-business/pd-question-business' import { PdQuestionBusinessGroupPage } from '../pages/pd-question/pd-question-business-group/pd-question-business-group' import { PdQuestionBusinessAssetsPage } from '../pages/pd-question/pd-question-business-group/pd-question-business-assets/pd-question-business-assets' @@ -175,6 +175,7 @@ import { CompleteListPage } from '../pages/complete-list/complete-list'; PdQuestionGeneralOtherApplicantPage, PdQuestionNeighbourHoodPage, PdQuestionFinalRemarkPage, + PdQuestionFuturePlansAndBusinessEnvironmentPage, PdQuestionBusinessPage, PdQuestionBusinessGroupPage, PdQuestionBusinessAssetsPage, @@ -274,6 +275,7 @@ import { CompleteListPage } from '../pages/complete-list/complete-list'; PdQuestionGeneralOtherApplicantPage, PdQuestionNeighbourHoodPage, PdQuestionFinalRemarkPage, + PdQuestionFuturePlansAndBusinessEnvironmentPage, PdQuestionBusinessPage, PdQuestionBusinessGroupPage, PdQuestionBusinessAssetsPage, diff --git a/src/pages/input/input.ts b/src/pages/input/input.ts index 28f236b9..d3472351 100755 --- a/src/pages/input/input.ts +++ b/src/pages/input/input.ts @@ -662,7 +662,7 @@ else{ getPDImages(){ //FOR RETRIEVING PICTURES this.imageDisplay=[] - let record_for_pic = {'pd_id':this.applicatentDetails.pd_id,'form_id':null,'company_id':null} + let record_for_pic = {'pd_id':this.applicatentDetails.pd_id,'form_id':null,'company_id':null,'is_common':1} this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ if(!val['msg']){ diff --git a/src/pages/pd-question-category/pd-question-category.ts b/src/pages/pd-question-category/pd-question-category.ts index a155fc84..4fff6293 100755 --- a/src/pages/pd-question-category/pd-question-category.ts +++ b/src/pages/pd-question-category/pd-question-category.ts @@ -33,6 +33,7 @@ import { PdQuestionFinalRemarkPage } from '../pd-question/pd-question-final-rema import { PdQuestionBusinessPage } from '../pd-question/pd-question-business/pd-question-business' import { PdQuestionBusinessGroupPage } from '../pd-question/pd-question-business-group/pd-question-business-group' import {PdQuestionRentalDashPage} from '../pd-question/pd-question-rental-info/pd-question-rental-dash/pd-question-rental-dash' +import { PdQuestionFuturePlansAndBusinessEnvironmentPage } from '../pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment' /** * Generated class for the PdQuestionCategoryPage page. * @@ -311,6 +312,10 @@ searchitem:any; { this.navCtrl.push(PdQuestionFinalRemarkPage,{'FormId':formName,'pdDetails':this.pdinfo}); } + else if(categroyId==23) + { + this.navCtrl.push(PdQuestionFuturePlansAndBusinessEnvironmentPage,{'FormId':formName,'pdDetails':this.pdinfo}); + } } filter(view){ if(!view){ diff --git a/src/pages/pd-question/pd-question-address/pd-question-address.ts b/src/pages/pd-question/pd-question-address/pd-question-address.ts index 190d9432..b9c0d04e 100755 --- a/src/pages/pd-question/pd-question-address/pd-question-address.ts +++ b/src/pages/pd-question/pd-question-address/pd-question-address.ts @@ -985,14 +985,17 @@ countRowsForTextarea(text){ //FOR RETRIEVING PICTURES this.imageDisplay=[] let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id,'company_id':null} + console.log('record_for_pic',record_for_pic); this.qustCat.getPDImages(record_for_pic).subscribe(val=>{ if(!val['msg']){ if(val['records'].length>0){ val['records'].forEach(result=>{ + console.log('records result',result); this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy','is_show_report': result.is_show_report == null ? 0 : result.is_show_report }) let img_title = (result.pd_document_title).split('('); if(img_title[0] == 'Approach to PD Location '){ this.AppxPDLocationImgValid = true; + this.imageDisplay = this.imageDisplay.filter (value=>value.is_show_report != 0 && value.name.split('(')[0] != 'Approach to PD Location ') } }) console.log("image Display Data Are",this.imageDisplay); @@ -1014,6 +1017,24 @@ countRowsForTextarea(text){ } changeOptions(event: any,index: any){ // console.log('Option Changed ' + event); + let name = this.imageBucket[index].value + let length = this.imageDisplay.length; + console.log('image display length',length); + this.imageDisplay.forEach(result=>{ + if(name == 'Approach to PD Location ' && event == 1){ + result.is_show_report = 0; + } + }) + console.log('this.imageDisplay',this.imageDisplay); + this.imageBucket.forEach(result=>{ + if(name == 'Approach to PD Location ' && event == 1){ + // this.AppxPDLocationImgValid = true; + console.log('name',name); + console.log('this.imageBucket.length',this.imageBucket.length); + result.is_show_report=0; + } + }) + console.log('this.imageBucket',this.imageBucket); this.imageBucket[index].is_show_report=event; // console.log('this.imageBucket',JSON.stringify(this.imageBucket)); } @@ -1096,6 +1117,9 @@ countRowsForTextarea(text){ // al(){ // this.toast.pdTriggerappmessage("touched"); // } + + updateImage(){ + } sendImage(){ this.loading.loaderForSendImage() diff --git a/src/pages/pd-question/pd-question-business-group/pd-question-business-info/pd-question-business-info.html b/src/pages/pd-question/pd-question-business-group/pd-question-business-info/pd-question-business-info.html index 8a5db1e6..82a24f88 100755 --- a/src/pages/pd-question/pd-question-business-group/pd-question-business-info/pd-question-business-info.html +++ b/src/pages/pd-question/pd-question-business-group/pd-question-business-info/pd-question-business-info.html @@ -1842,6 +1842,37 @@ + + +

Fire NOC

+ + + Yes + No + NA + + + +
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+

Do You Want to Add Other Documents?

diff --git a/src/pages/pd-question/pd-question-business-group/pd-question-business-info/pd-question-business-info.ts b/src/pages/pd-question/pd-question-business-group/pd-question-business-info/pd-question-business-info.ts index 43348f96..cb09db64 100755 --- a/src/pages/pd-question/pd-question-business-group/pd-question-business-info/pd-question-business-info.ts +++ b/src/pages/pd-question/pd-question-business-group/pd-question-business-info/pd-question-business-info.ts @@ -72,6 +72,8 @@ export class PdQuestionBusinessInfoPage { monthErrorMessage: any = []; errorMessageForExistTotalWorkExperience : any = []; countryDataListValue: any = []; + product_abbr: any; + lender_short_name : any; @ViewChild('shareholding') share_focus:ElementRef private search:searchValue[] @@ -107,6 +109,8 @@ export class PdQuestionBusinessInfoPage { this.generalExistEntityType_other=this.pdDetails.business_entity_type_other this.generalExistBusinessYear=this.pdDetails.business_years; this.generalExistBusinessMonth = this.pdDetails.business_month; + this.lender_short_name = this.pdDetails.lender_short_name; + this.product_abbr = this.pdDetails.product_abbr; this.step=0 @@ -295,6 +299,7 @@ changeOfStartedBusiness(members,i,e){ // country_sale.push(this.createCountrySale()); //const max_sale_state:any= this.businessForm.controls['manufacturing_activity_details']['controls'][0].controls.max_sale_state_name; //max_sale_state.push(this.maxSaleState()) + this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP' ? this.businessForm.addControl('fire_noc', new FormControl('', Validators.required)) : this.businessForm.removeControl('fire_noc'); if(data['status']==200){ @@ -794,6 +799,7 @@ changeOfStartedBusiness(members,i,e){ if(data['records'].pf_regn =='yes'){ this.businessForm.addControl('pf_regn_pic', new FormControl('')); }else{ this.businessForm.removeControl('pf_regn_pic');} if(data['records'].esic_regn =='yes'){ this.businessForm.addControl('esic_regn_pic', new FormControl('')); }else{ this.businessForm.removeControl('esic_regn_pic');} if(data['records'].export_import_cert =='yes'){ this.businessForm.addControl('export_import_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('export_import_cert_pic');} + if(data['records'].fire_noc =='yes'){ this.businessForm.addControl('fire_noc_pic', new FormControl('')); }else{ this.businessForm.removeControl('fire_noc_pic');} this.businessForm.setValue(businessVal); @@ -803,7 +809,6 @@ changeOfStartedBusiness(members,i,e){ console.log('console.log 2'); Partnr.push(this.createPartners()); control1.push(this.createRelationShip()) - //otherDoc.push(this.createDocument()); // find business activity type businees activity type list @@ -1082,8 +1087,14 @@ changeBusinessActivity(event: any){ this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl(this.businessForm.value.applicant_use_mobile_wallets)) : this.businessForm.removeControl('applicant_use_mobile_wallets'); this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl(this.businessForm.value.applicant_use_pos_machines)) : this.businessForm.removeControl('applicant_use_pos_machines'); + if (this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0) { + if(this.businessForm.controls['applicant_use_pos_machines'] && (this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP' )){ + this.businessForm.controls['applicant_use_pos_machines'].setValue('yes'); + } + this.changePOSMachinesAvailablity(this.businessForm.value.applicant_use_pos_machines, 2); + } - if(this.ManufacturingChecked || this.ManufacturingChecked==undefined && this.RetailedChecked || this.RetailedChecked==undefined && this.WholeSalesChecked ||this.WholeSalesChecked==undefined && this.ServiceChecked || this.ServiceChecked==undefined){ + if(this.ManufacturingChecked || this.ManufacturingChecked==undefined && this.RetailedChecked || this.RetailedChecked==undefined && this.WholeSalesChecked ||this.WholeSalesChecked==undefined && this.ServiceChecked || this.ServiceChecked==undefined){ this.ExportFlag = false; } } @@ -2385,5 +2396,6 @@ toGetPOSMachinesDetails(e,flag){ if(Flag == 6) {event.value =='yes' ? this.businessForm.addControl('pf_regn_pic', new FormControl('')) : this.businessForm.removeControl('pf_regn_pic');} if(Flag == 7) {event.value =='yes' ? this.businessForm.addControl('esic_regn_pic', new FormControl('')) : this.businessForm.removeControl('esic_regn_pic');} if(Flag == 3) {event.value =='yes' ? this.businessForm.addControl('export_import_cert_pic', new FormControl('')) : this.businessForm.removeControl('export_import_cert_pic');} + if(Flag == 8) {event.value =='yes' ? this.businessForm.addControl('fire_noc_pic', new FormControl('')) : this.businessForm.removeControl('fire_noc_pic');} } } diff --git a/src/pages/pd-question/pd-question-business-group/pd-question-financial-info/pd-question-financial-info.html b/src/pages/pd-question/pd-question-business-group/pd-question-financial-info/pd-question-financial-info.html index 888a4e7d..55b26d9d 100755 --- a/src/pages/pd-question/pd-question-business-group/pd-question-financial-info/pd-question-financial-info.html +++ b/src/pages/pd-question/pd-question-business-group/pd-question-financial-info/pd-question-financial-info.html @@ -75,10 +75,10 @@
- +
Data As Per Financial Statements
-
+
@@ -268,6 +268,11 @@ {{"₹"}} {{AV_netProfitAmtInwords[i]}} Only + + + + {{"₹"}} {{AV_CCAnnualSalesAmtInwords[i]}} Only +
+ + + CLIX + + + Select + Heavy Footfall (lots of customers in the locality / marketplace). + Medium Footfall (Medium no of customers in the locality / marketplace). + Low Footfall (Few customers seen in the locality / marketplace). + + Comment on Footfall in the market where the B2C outlet is located Required + + +
+ + Is there Competition to the applicant’s business in the location ( {{ _finalRemarkForm.value.is_competition ===true ? 'Yes' : 'No'}} ) + +
+ + + Approximate No of similar outlets / stores seen by PD officer during the visit to that location Required + + + + +
+ + Any demolition activity seen in the locality by PD officer ( {{ _finalRemarkForm.value.demolition_activity ===true ? 'Yes' : 'No'}} ) +
+ + + + + + Specify The Demolition Activity Comment Required + + + +
+ +
+
+ +
+
+ +
+
+
+ +
+ + Any sealing activity observed in the locality by PD office ( {{ _finalRemarkForm.value.sealing_activity ===true ? 'Yes' : 'No'}} ) +
+ + + + + Specify The Sealing Activity Comment Required + + + +
+ +
+
+ +
+
+ +
+
+
+ +
+
Other Remarks diff --git a/src/pages/pd-question/pd-question-final-remark/pd-question-final-remark.scss b/src/pages/pd-question/pd-question-final-remark/pd-question-final-remark.scss index 5dd2b1f3..023a4621 100755 --- a/src/pages/pd-question/pd-question-final-remark/pd-question-final-remark.scss +++ b/src/pages/pd-question/pd-question-final-remark/pd-question-final-remark.scss @@ -36,6 +36,10 @@ page-pd-question-final-remark { margin : 5px 0; } + .mat-checkbox-layout { + white-space: normal !important; + } + /*FOR IMAGES*/ img{ padding:0 5px 0 0; diff --git a/src/pages/pd-question/pd-question-final-remark/pd-question-final-remark.ts b/src/pages/pd-question/pd-question-final-remark/pd-question-final-remark.ts index d275c260..c41f9ec2 100755 --- a/src/pages/pd-question/pd-question-final-remark/pd-question-final-remark.ts +++ b/src/pages/pd-question/pd-question-final-remark/pd-question-final-remark.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; -import { FormGroup, FormBuilder,Validators,FormArray} from '@angular/forms'; +import { FormGroup, FormBuilder,FormArray,FormControl,Validators} from '@angular/forms'; // import { t } from '@angular/core/src/render3'; import { AwsServiceProvider } from '../../../providers/aws-service/aws-service'; import { QuestionCategoryProvider } from '../../../providers/question-category/question-category'; @@ -33,6 +33,8 @@ export class PdQuestionFinalRemarkPage { imageDisplay: any=[]; imageBucket: any=[]; tab: any='0'; + product_abbr: any; + lender_short_name : any; mode_of_transport_values=[{'id':'two_wheeler','name':'Two Wheeler'}, {'id':'four_wheeler','name':'Four Wheeler'}, {'id':'public_transport','name':'Public Transport'}, @@ -44,7 +46,9 @@ export class PdQuestionFinalRemarkPage { this.pdDetails=this.navParams.get('pdDetails'); this.pdid=this.pdDetails.pd_id this.FormId=this.navParams.get('FormId'); - this.users=aws.getlocale() + this.users=aws.getlocale(); + this.lender_short_name = this.pdDetails.lender_short_name; + this.product_abbr = this.pdDetails.product_abbr; this._finalRemarkForm=this.fb.group({ fk_createdby:[this.users], @@ -69,6 +73,20 @@ export class PdQuestionFinalRemarkPage { others_transport:['',Validators.compose([Validators.required])] }) + + if(this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP'){ + this._finalRemarkForm.addControl('outlet_location', new FormControl('', Validators.required)) ; + this._finalRemarkForm.addControl('is_competition', new FormControl('')); + this._finalRemarkForm.addControl('sealing_activity', new FormControl('')); + this._finalRemarkForm.addControl('demolition_activity', new FormControl('')); + } + else{ + this._finalRemarkForm.removeControl('outlet_location'); + this._finalRemarkForm.removeControl('is_competition'); + this._finalRemarkForm.removeControl('sealing_activity'); + this._finalRemarkForm.removeControl('demolition_activity'); + } + this.getDropDown(); //To checking Completed Status For CompleteList Menu @@ -418,6 +436,24 @@ RecommendationChange(e) { }) } this._finalRemarkForm.controls.final_form_remarks.setValue(data['records'].final_form_remarks); + + if(this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP'){ + + this._finalRemarkForm.controls.outlet_location.setValue(data['records'].outlet_location); + this._finalRemarkForm.controls.is_competition.setValue(data['records'].is_competition); + this._finalRemarkForm.controls.sealing_activity.setValue(data['records'].sealing_activity); + this._finalRemarkForm.controls.demolition_activity.setValue(data['records'].demolition_activity); + this.clixChange(data['records'].is_competition,1); + this.clixChange(data['records'].sealing_activity,2); + this.clixChange(data['records'].demolition_activity,3); + + if(data['records'].is_competition ==true){ this._finalRemarkForm.controls.appx_outlet_or_stores.setValue(data['records'].appx_outlet_or_stores);} + if(data['records'].sealing_activity ==true){ this._finalRemarkForm.controls.comment_of_demolition_activity.setValue(data['records'].comment_of_demolition_activity); + this._finalRemarkForm.controls.demolition_activity_pic.setValue(data['records'].demolition_activity_pic); } + if(data['records'].demolition_activity ==true) {this._finalRemarkForm.controls.comment_of_sealing_activity.setValue(data['records'].comment_of_sealing_activity); + this._finalRemarkForm.controls.sealing_activity_pic.setValue(data['records'].sealing_activity_pic); } + } + } else{ let recommendationPositiveCtrl: any = this._finalRemarkForm.get('recommendation_positive') as FormArray; @@ -430,6 +466,24 @@ RecommendationChange(e) { }) } + + clixChange(e,flag){ + if(flag == 1){ + console.log(e,flag); + e==true ? this._finalRemarkForm.addControl('appx_outlet_or_stores', new FormControl('', Validators.required)) : this._finalRemarkForm.removeControl('appx_outlet_or_stores'); + } + if(flag == 2){ + console.log(e,flag); + e==true ? this._finalRemarkForm.addControl('comment_of_demolition_activity', new FormControl('', Validators.required)) : this._finalRemarkForm.removeControl('comment_of_demolition_activity'); + e==true ? this._finalRemarkForm.addControl('demolition_activity_pic', new FormControl('')) : this._finalRemarkForm.removeControl('demolition_activity_pic'); + } + if(flag == 3){ + console.log(e,flag); + e==true ? this._finalRemarkForm.addControl('comment_of_sealing_activity', new FormControl('', Validators.required)) : this._finalRemarkForm.removeControl('comment_of_sealing_activity'); + e==true ? this._finalRemarkForm.addControl('sealing_activity_pic', new FormControl('')) : this._finalRemarkForm.removeControl('sealing_activity_pic'); + } + } + saveFinalRemark(){ if(this._finalRemarkForm.invalid){ this.toast.pdTriggerappmessage("Please Fill all the Fields marked with '*' ") @@ -454,6 +508,33 @@ RecommendationChange(e) { } } + ImageUpload(Flag : any){ + if(Flag == 1){ + this.cameraProvider.getpicture().then(res=>{ + if(res != 'error'){ + this._finalRemarkForm.controls['demolition_activity_pic'].setValue(res); + } + else{ + this._finalRemarkForm.controls['demolition_activity_pic'].setValue(''); + } + },error=>{ + console.log("Camera Error ",JSON.stringify(error)); + }) + } + else if(Flag == 2){ + this.cameraProvider.getpicture().then(res=>{ + if(res != 'error'){ + this._finalRemarkForm.controls['sealing_activity_pic'].setValue(res); + } + else{ + this._finalRemarkForm.controls['sealing_activity_pic'].setValue(''); + } + },error=>{ + console.log("Camera Error ",JSON.stringify(error)); + }) + } +} + getPDImages(){ //FOR RETRIEVING PICTURES this.imageDisplay=[] @@ -533,9 +614,9 @@ capture(){ setValidation(){ console.log("enter"); if(this._finalRemarkForm.controls['mode_of_transport_during_visit'].value == 'others'){ - this._finalRemarkForm.controls['others_transport'].setValue(''); - this._finalRemarkForm.controls['others_transport'].setValidators(Validators.compose([Validators.required])) - this._finalRemarkForm.controls['others_transport'].updateValueAndValidity() + this._finalRemarkForm.controls['others_transport'].setValue(''); + this._finalRemarkForm.controls['others_transport'].setValidators(Validators.compose([Validators.required])) + this._finalRemarkForm.controls['others_transport'].updateValueAndValidity() } else{ this._finalRemarkForm.controls['others_transport'].setValue(''); diff --git a/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.html b/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.html new file mode 100644 index 00000000..48f48ea7 --- /dev/null +++ b/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.html @@ -0,0 +1,149 @@ + + + + + {{FormId.form_name}} + + + + + + + + + + + + + + + + Form + + + Pictures + + + + + + + +
+ + + + No Documents Found. Press the + camera button below to capture + + + + +
+ + + + +
+
+
+
+
+
+ + + + +
+ + +
+ + + + +
+
+
+
+
+
+ + +
+ + + + + + USP of the + business Required + + + + + + Future plans for business expansion Required + + + + + Impact + of GST on the business Required + + + + + Key Competitors + Required + + + + + Succession plan + Required + + + + + + Brief of Other Group Concerns / Businesses run by the applicants Required + + + + + + Other Remarks + + + + + + +
+ +
+ \ No newline at end of file diff --git a/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.scss b/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.scss new file mode 100644 index 00000000..978615db --- /dev/null +++ b/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.scss @@ -0,0 +1,55 @@ +page-pd-question-future-plans-and-business-environment { + + 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-form-field{ + width:100%; + } + .scroll-content{ + background-color: #eee; + } + .mat-form-field-label { + white-space: normal; + } + + textarea.mat-input-element { + padding: 0px 0; + margin: 10px 0; + } + + ion-icon[class*="fn-save"] { + -webkit-mask-size: 30px !important; + } + + .mat-input-placeholder { + white-space: normal; + } + + mat-placeholder{ + font-size:15px; + } + + input-placeholder{ + margin:10px; + } + + + /*FOR IMAGES*/ + img{ + padding:0 5px 0 0; + height: 180px; + } + input{ + width: 100px; + border-radius: 4px; + border-color: gray; + font-size: 12px; + height: 28px; + } + + +} diff --git a/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.ts b/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.ts new file mode 100644 index 00000000..558bc3d0 --- /dev/null +++ b/src/pages/pd-question/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment.ts @@ -0,0 +1,250 @@ +import { Component } from '@angular/core'; +import { IonicPage, NavController, NavParams } from 'ionic-angular'; +import { FormGroup, FormBuilder } from '@angular/forms'; +import { AwsServiceProvider } from '../../../providers/aws-service/aws-service'; +import { QuestionCategoryProvider } from '../../../providers/question-category/question-category'; +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 PdQuestionFuturePlansAndBusinessEnvironmentPage page. + * + * See https://ionicframework.com/docs/components/#navigation for more info on + * Ionic pages and navigation. + */ + +@Component({ + selector: 'page-pd-question-future-plans-and-business-environment', + templateUrl: 'pd-question-future-plans-and-business-environment.html', +}) +export class PdQuestionFuturePlansAndBusinessEnvironmentPage { + + + pdDetails: any; + pdid: any; + FormId: any; + users: any; + product_abbr: any; + lender_short_name: any; + complete_status: boolean = false; + tab: any = '0'; + imageDisplay: any = []; + imageBucket: any = []; + public _futurePlansForm: FormGroup; + + + constructor(public navCtrl: NavController, public navParams: NavParams, public fb: FormBuilder, + public qustcat: QuestionCategoryProvider, public aws: AwsServiceProvider, + public toast: ToastProvider, private cameraProvider: CameraProvider, private loading: LoadingProvider) { + + this.pdDetails = this.navParams.get('pdDetails'); + this.pdid = this.pdDetails.pd_id + this.FormId = this.navParams.get('FormId'); + this.users = aws.getlocale(); + this.lender_short_name = this.pdDetails.lender_short_name; + this.product_abbr = this.pdDetails.product_abbr; + this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false; + + this._futurePlansForm = this.fb.group({ + parent_pdid: [this.pdDetails.parent_pd_id], + pdid: [this.pdid], + formid: ['23'], + usp_of_the_business: [''], + future_plans_for_business_expansion: [''], + impact_of_gst_on_the_business: [''], + key_competitors: [''], + succession_plan: [''], + brief_of_other_group_concerns_or_businesses_run_by_the_applicants: [''], + remarks: [''], + fk_createdby:[this.users] + }); + + } + + ionViewDidLoad() { + console.log('ionViewDidLoad PdQuestionFuturePlansAndBusinessEnvironmentPage'); + this.getFuturePlans(); + this.getPDImages(); + } + + ionViewCanLeave() { + + if (this._futurePlansForm.dirty) { + + return new Promise((resolve, reject) => { + let alert = this.toast.setAlert("Data will be Lost", "Are you sure want to Go Back") + alert.present(); + alert.onDidDismiss((data) => { + + if (data == false) { + reject(); + return true; + } + else { + //AFTER FORM DIRTY CHECK + if (this.imageBucket.length > 0) { + return new Promise((resolve1, reject1) => { + let alert = this.toast.setAlert("Captured Images are not Saved", "Note:To Save the image press the Save Image button
Are you sure want to Go Back?") + alert.present(); + alert.onDidDismiss((data) => { + + if (data == false) { + //reject1(); + reject(); + } + else { + resolve1(); + resolve(); + } + }) + }) + } + resolve(); + } + }) + }) + + } + else { + //REGULAR CHECK FOR IMAGE IS CAPTURED + if (this.imageBucket.length > 0) { + return new Promise((resolve, reject) => { + let alert = this.toast.setAlert("Captured Images are not Saved", "Note:To Save the image press the 'Save Image' button
Are you sure want to Go Back?") + alert.present(); + alert.onDidDismiss((data) => { + + if (data == false) { + reject(); + } + else { + resolve(); + } + }) + }) + } + + } + + } + + getFuturePlans() { + let saveRecords = { 'parent_pdid': this.pdDetails.parent_pd_id, 'pd_id': this.pdid, 'pd_form_id': this.FormId.form_id } + this.qustcat.retiverForm(saveRecords).subscribe(data => { + if (data['dataStatus'] == true) { + this._futurePlansForm.controls.usp_of_the_business.setValue(data['records'].usp_of_the_business); + this._futurePlansForm.controls.future_plans_for_business_expansion.setValue(data['records'].future_plans_for_business_expansion); + this._futurePlansForm.controls.impact_of_gst_on_the_business.setValue(data['records'].impact_of_gst_on_the_business); + this._futurePlansForm.controls.key_competitors.setValue(data['records'].key_competitors); + this._futurePlansForm.controls.succession_plan.setValue(data['records'].succession_plan); + this._futurePlansForm.controls.brief_of_other_group_concerns_or_businesses_run_by_the_applicants.setValue(data['records'].brief_of_other_group_concerns_or_businesses_run_by_the_applicants); + this._futurePlansForm.controls.remarks.setValue(data['records'].remarks); + } + else { }; + }) + + } + + saveFuturePlan() { + if (this._futurePlansForm.invalid) { + this.toast.pdTriggerappmessage("Please Fill all the Fields marked with '*' ") + } + else { + var answerData = this._futurePlansForm.value + //To Remove The "Null" With Key also + Object.keys(answerData).forEach((key) => (answerData[key] == null) && delete answerData[key]); + this.qustcat.saveForm(answerData).subscribe(res => { + if (res['dataStatus'] == true) { + //TO CHANGE THE FORM STATE + this._futurePlansForm.reset(this._futurePlansForm.value); + this.toast.pdTriggerappmessage("Record Saved Successfully"); + setTimeout(() => { + this.navCtrl.pop(); + }, 2000); + } + else { + this.toast.pdTriggerappmessage("Sorry!! Something Went Wrong"); + } + }); + } + } + + getPDImages() { + //FOR RETRIEVING PICTURES + this.imageDisplay = [] + 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 => { + if (!val['msg']) { + + if (val['records'].length > 0) { + val['records'].forEach(result => { + this.imageDisplay.push({ 'image': result.doc_url, 'Name': result.pd_document_title, 'option': 'dummy' }) + }) + + } + } + }) + } + + changeName(value, index, img) { + 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 => { + + 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 => { + 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() + + let records: any = { + 'pd_id': this.pdDetails.pd_id, + 'formid': this.FormId.form_id, + 'images': this.imageBucket, + 'company_id': '' + } + + 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'); + } + }) + } + +} \ No newline at end of file diff --git a/src/pages/pd-question/pd-question-loans/pd-question-loans.html b/src/pages/pd-question/pd-question-loans/pd-question-loans.html index d386d938..3b3d6c77 100755 --- a/src/pages/pd-question/pd-question-loans/pd-question-loans.html +++ b/src/pages/pd-question/pd-question-loans/pd-question-loans.html @@ -106,8 +106,24 @@ + + + Select + Yes, Disclosed + No, not Disclosed + + + + + + + {{"₹"}} {{fundAmtInWords}} Only + + - Select Yes @@ -146,7 +162,7 @@ {{"₹"}} {{topUpAmtInWords}} Only - + diff --git a/src/pages/pd-question/pd-question-loans/pd-question-loans.ts b/src/pages/pd-question/pd-question-loans/pd-question-loans.ts index b329b3e8..a9ef483c 100755 --- a/src/pages/pd-question/pd-question-loans/pd-question-loans.ts +++ b/src/pages/pd-question/pd-question-loans/pd-question-loans.ts @@ -33,7 +33,8 @@ export class PdQuestionLoansPage { propertyType: any; mortagetypeAccess: boolean; mortageAccess: boolean = false; - mortageCardAccess: boolean; + mortageCardAccess: boolean; + lender_short_name : any; topUpAmtInWords: any; ownContributionInWords: any; valAsPerAgmtInWords: any; @@ -42,7 +43,7 @@ export class PdQuestionLoansPage { emiAmtInWords:any; emvAmtInWords:any; - + fundAmtInWords : any; m_btLenderList: any; applicants: any; m_endUseofLoad: any; @@ -93,6 +94,7 @@ export class PdQuestionLoansPage { this.subProductName = this.pdDetails.subproduct_name; this.users = this.aws.getlocale(); this.pdid=this.pdDetails.pd_id; + this.lender_short_name = this.pdDetails.lender_short_name; this.getDropdown(); this.loanDetailsForm = this.fb.group({ @@ -102,6 +104,8 @@ export class PdQuestionLoansPage { end_use: ['', Validators.compose([Validators.required])], end_use_other: [''], is_transfer: ['', Validators.compose([Validators.required])], + is_there_total_fund:[''], + fund_amt:[''], //is_topup: ['', Validators.compose([Validators.required])], // is_topup: [''], balance_transfer_amount: [''], @@ -390,7 +394,7 @@ export class PdQuestionLoansPage { // this.loanDetailsForm.controls['is_topup'].setValidators([Validators.required]); //this.loanDetailsForm.controls['is_topup'].updateValueAndValidity(); // } - if (event.value == 'no') { + if (event == 'no') { this.loanDetailsForm.controls['source'].setValidators([Validators.required]); this.loanDetailsForm.controls['source'].updateValueAndValidity(); @@ -406,7 +410,7 @@ export class PdQuestionLoansPage { this.topUpAmtInWords='' } - else if (event.value == 'yes') { + else if (event == 'yes') { this.loanDetailsForm.controls['source'].setValue(''); this.loanDetailsForm.controls['source'].clearValidators(); this.loanDetailsForm.controls['source'].updateValueAndValidity(); @@ -533,6 +537,8 @@ export class PdQuestionLoansPage { break; case 7: this.emvAmtInWords=this.constant.convertNumberToWords(e.target.value); + case 8: + this.fundAmtInWords=this.constant.convertNumberToWords(e.target.value); default: break; } @@ -546,7 +552,9 @@ export class PdQuestionLoansPage { records.fk_createdby = this.users; records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value; records.loan_tenure=this.loanDetailsForm.controls['loan_tenure'].value; - records.sub_product=this.loanDetailsForm.controls['sub_product'].value; + records.sub_product=this.loanDetailsForm.controls['sub_product'].value; + records.is_there_total_fund = this.loanDetailsForm.controls['is_there_total_fund'].value; + records.fund_amt = this.loanDetailsForm.controls['fund_amt'].value; // get end user final group data let dataEnd_user_data = []; this.loanDetailsForm.controls['end_use'].value.forEach(element => { @@ -690,6 +698,8 @@ export class PdQuestionLoansPage { if(loanDetails.loan_amount){ this.loanAmtInWords = this.constant.convertNumberToWords(loanDetails.loan_amount); } this.loanDetailsForm.controls['sub_product'].setValue(loanDetails.sub_product) this.loanDetailsForm.controls['end_use'].setValue(this.enduse); + this.loanDetailsForm.controls['is_there_total_fund'].setValue(loanDetails.is_there_total_fund); + this.loanDetailsForm.controls['fund_amt'].setValue(loanDetails.fund_amt); this.endUserChange(this.enduse); if (loanDetails.end_use_other!='') { @@ -729,6 +739,7 @@ export class PdQuestionLoansPage { // this.ownContributionInWords = this.constant.convertNumberToWords(loanDetails.own_contribution); // } //this.loanDetailsForm.controls['source'].setValue(loanDetails.source); + if(loanDetails.fund_amt){this.fundAmtInWords = this.constant.convertNumberToWords(loanDetails.fund_amt); } if ((this.isContribution == true) && (loanDetails.is_transfer != 'yes')) { this.loanDetailsForm.controls['own_contribution'].setValue(''); this.loanDetailsForm.controls['other_source'].setValue(''); @@ -787,10 +798,14 @@ export class PdQuestionLoansPage { // this.loanDetailsForm.controls['value_per_agreement'].setValue(loanDetails.value_per_agreement); this.loanDetailsForm.controls['loandetails_remarks'].setValue(loanDetails.loandetails_remarks); } else { - + if(this.lender_short_name == 'CLIX'){ + + this.loanDetailsForm.controls['is_transfer'].setValue("no"); + this.selectedBalancesTransferChanges("no") + } } }) - if(this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LL'){ + if(this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LL' || this.productAbbr == 'LAEP'){ this.mortageCardAccess = false; this.loanDetailsForm.controls['owner_name'].setValue(''); this.loanDetailsForm.controls['owner_name'].clearValidators();