clix changes :ps

This commit is contained in:
saravanakumarkandasami 2019-06-13 19:21:13 +05:30
parent baf1976d40
commit 5dd3425a79
17 changed files with 776 additions and 47 deletions

View File

@ -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,

View File

@ -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']){

View File

@ -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){

View File

@ -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()

View File

@ -1842,6 +1842,37 @@
</ion-col>
</ion-row>
<ion-row *ngIf="businessForm.controls['fire_noc']">
<ion-col>
<p>Fire NOC</p>
<mat-radio-group formControlName="fire_noc" (change)="radioChange($event,8)">
<mat-radio-button value="yes">Yes</mat-radio-button>
<mat-radio-button value="no">No</mat-radio-button>
<mat-radio-button value="not applicable">NA</mat-radio-button>
</mat-radio-group>
</ion-col>
<ion-col>
<div float-right *ngIf="businessForm.controls['fire_noc'].value == 'yes'">
<br>
<div *ngIf="businessForm.controls['fire_noc_pic']" >
<div *ngIf="businessForm.controls['fire_noc_pic'].value !== ''" >
<img src="{{businessForm.controls['fire_noc_pic'].value}}" imageViewer style ="width: 40px;height: 35px;">
</div>
<div *ngIf="businessForm.controls['fire_noc_pic'].value === ''" >
<label style="display: block; text-align: center !important;"> Fire NOC
Image </label>
</div>
<div style="text-align: -webkit-center;" >
<ion-icon title="Click Here For Fire NOC Image" name="md-camera" (click)="ImageUpload(8)"></ion-icon>
</div>
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
<p>Do You Want to Add Other Documents?</p>

View File

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

View File

@ -75,10 +75,10 @@
<form [formGroup]="financialForm" *ngSwitchCase="'0'">
<mat-card>
<mat-card-header>
<mat-card-title>
<mat-card-title style="padding-top: 2rem">
<h5>Data As Per Financial Statements</h5>
<button mini ion-fab color="optblue" slot="fixed" (click)="capture()"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
</mat-card-title>
<button mini ion-fab color="optblue" slot="fixed" (click)="capture()"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
</mat-card-header>
<mat-form-field>
@ -268,6 +268,11 @@
<mat-hint align="end" style="font-size:11px" *ngIf="details.get('estimate_net_profit').value != ''">{{"&#8377;"}} {{AV_netProfitAmtInwords[i]}} Only </mat-hint>
<!-- // -->
</mat-form-field>
<mat-form-field *ngIf="lender_short_name == 'CLIX' || product_abbr == 'LAEP'">
<input matInput autocomplete="off" placeholder="Annual Sales through Credit Card / POS machines" formControlName="estimate_posmachine_or_cc_annual_sales" type="number" (keyup)="inWords($event,i,13)">
<mat-hint align="end" style="font-size:11px" *ngIf="details.get('estimate_posmachine_or_cc_annual_sales').value != ''">{{"&#8377;"}} {{AV_CCAnnualSalesAmtInwords[i]}} Only </mat-hint>
</mat-form-field>
</div>
<!--Temporary-->
<!-- <div *ngIf="details.get('estimate_net_profit').value != ''">

View File

@ -29,6 +29,8 @@ export class PdQuestionFinancialInfoPage {
users:any;
company_id:any;
isDisplay:boolean;
product_abbr: any;
lender_short_name : any;
customerCommentsFlag:boolean;
FY_annualSalesInwords: any =[]
FY_netProfitAmtInwords: any=[]
@ -45,6 +47,7 @@ export class PdQuestionFinancialInfoPage {
AV_SalesInwords: any=[];
AV_marginProfitAmtInwords: any=[];
AV_marginLossAmtInwords: any=[];
AV_CCAnnualSalesAmtInwords:any = [];
formDetails: any;
CustSegAbbr:any;
temparray : any = [];
@ -75,7 +78,8 @@ export class PdQuestionFinancialInfoPage {
this.users=this.aws.getlocale();
let x = this.pdDetails.customer_segment_abbr.split("-");
this.CustSegAbbr=x[1]
this.lender_short_name = this.pdDetails.lender_short_name;
this.product_abbr = this.pdDetails.product_abbr;
this.initFinancialForm()
this.qustCat.getTypeofActivityForSuppliedInfoForm(this.pdDetails.pd_id, this.company_id).subscribe(data => {
if (data.dataStatus) {
@ -298,6 +302,7 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
estimate_net_loss_percent:[''],
estimate_net_loss:[''],
estimate_reason_for_loss:[''],
estimate_posmachine_or_cc_annual_sales:[''],
// estimate_receive_the_money_in_days:[''],
// estimate_pay_the_money_in_days:[''],
// estimate_unsold_stock_lies_in_days:[''],
@ -389,7 +394,7 @@ submitDetails(){
params.pd_form_id=this.FormId
params.company_id=this.company_id
this.qustCat.retiverForm(params).subscribe(value=>{
console.log('Params',value['records']);
if(value['dataStatus']==true){
let retrieveData=value['records'];
// Financial part 1 : Date
@ -416,7 +421,7 @@ submitDetails(){
// Financial part 2 : based on Customersegment we have to Fetch The Estimate Value.
if(this.CustSegAbbr != 'AI'){
console.log('adadssdsadsdasadsasdasd - hjhdhjjdfsfhgdfshg');
if(value['records'].is_financial_customer == 'no'){
let result_val=Object.keys(value['records'].estimated_value).map(function(key){
return value['records'].estimated_value[key]
@ -427,13 +432,14 @@ submitDetails(){
this.AV_SalesFrmInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_sales_from));
this.AV_SalesToInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_sales_to));
this.AV_marginProfitAmtInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtFrmInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtToInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtFrmInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_net_profit_from));
this.AV_netProfitAmtToInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_net_profit_to));
this.AV_netProfitAmtInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_net_profit));
this.AV_marginLossAmtInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_loss_margin));
this.AV_netLossAmtFrmInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netLossAmtToInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netLossAmtFrmInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_net_loss_from));
this.AV_netLossAmtToInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_net_loss_to));
this.AV_netLossAmtInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_net_loss));
this.AV_CCAnnualSalesAmtInwords[index] = this.cons.convertNumberToWords(Math.round(val.estimate_posmachine_or_cc_annual_sales));
estimate.push(this.createValue(''))
});
retrieveData.estimated_value=result_val;
@ -444,7 +450,6 @@ submitDetails(){
}
}
else if(this.CustSegAbbr == 'AI'){
console.log('asd');
retrieveData.estimated_value = [];
}
@ -453,7 +458,7 @@ submitDetails(){
retrieveData.company_id=this.company_id
retrieveData.fk_createdby=this.users
retrieveData.formid=this.FormId
console.log('retrieveData.select_working_capital_facilities_availed',retrieveData.select_working_capital_facilities_availed);
let avData = this.av.map(item => ({ name: item.name, id: item.id }))
let exist_av_data: any = [];
@ -462,9 +467,9 @@ submitDetails(){
return retrieveData.select_working_capital_facilities_availed[key].id;
});
}
console.log('exist_av_data',exist_av_data);
let actual_av = avData.map(item => item.id);
console.log('actual_av',actual_av);
let check_exist_av = actual_av.map((id, index) => {
if (exist_av_data.indexOf(id) < 0) {
avData[index].exist_status = 0;
@ -475,7 +480,7 @@ submitDetails(){
return avData[index];
}
}).filter(item => item != undefined);
console.log('check_exist_av ',check_exist_av );
if (check_exist_av.length > 0) {
check_exist_av.forEach(val => {
workingCptlControl.push(this.workingCptl(val));
@ -502,9 +507,9 @@ submitDetails(){
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl(''));
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl(''));
}
console.log(val);
});
console.log('check_exist_businees_activity',check_exist_av);
retrieveData.select_working_capital_facilities_availed = check_exist_av;
}
@ -552,7 +557,7 @@ submitDetails(){
}
changeWorkingCapitalFacilities(event: any) {
console.log('event',event);
if (event.value.exist_status == true && event.value.id == 2) {
console.log('event.value.exist_status == true && event.value.id == 2',event.value.exist_status,event.value.id)
@ -773,23 +778,11 @@ submitDetails(){
if ((profit_margin != '' || loss_margin != '') && index != 0) {
// console.log('temp_prev_losses',prev_loss_margin);
// console.log('temp_prev_profits',prev_profit_margin);
// console.log('curr index',index);
loss_margin = loss_margin !== undefined ? loss_margin : 0;
profit_margin = profit_margin !== undefined ? profit_margin:0;
let temp_prev_loss_margin = prev_loss_margin[index-1] !== undefined ? prev_loss_margin[index-1] : 0 ;
let temp_prev_profit_margin = prev_profit_margin[index-1] !== undefined ? prev_profit_margin[index-1] : 0 ;
// console.log('profit_margin',profit_margin);
// console.log('pre year loss_margin',temp_prev_loss_margin);
// console.log('loss_margin',loss_margin);
// console.log('pre year profit_margin',temp_prev_profit_margin);
if(annual_sale != ''){
let current_margin : number =(profit_margin != '' ? parseFloat(profit_margin.toFixed(2)) :
@ -1465,6 +1458,9 @@ calculateLossAmount( i, details){
case 12 :
this.AV_SalesToInwords[i] = this.cons.convertNumberToWords(e.target.value);
break;
case 13 :
this.AV_CCAnnualSalesAmtInwords[i] = this.cons.convertNumberToWords(e.target.value);
break;
default:
break;
}

View File

@ -140,6 +140,7 @@
<mat-option value="Payment made in Cash.">Payment made in Cash.</mat-option>
<mat-option value="Payment made through Banking channels.">Payment made through Banking
channels.</mat-option>
<mat-option value="Payment made through Cash and Banking channels.">Payment made through Cash and Banking Channels.</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="items.get('manufacturing_payment_type').value == 3">
@ -250,6 +251,7 @@
<mat-option value="Payment made in Cash.">Payment made in Cash.</mat-option>
<mat-option value="Payment made through Banking channels.">Payment made through Banking
channels.</mat-option>
<mat-option value="Payment made through Cash and Banking channels.">Payment made through Cash and Banking Channels.</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="items.get('trade_product_payment_type').value == 3">

View File

@ -197,6 +197,88 @@
</mat-form-field> -->
</mat-card-content>
</mat-card>
<mat-card *ngIf="lender_short_name == 'CLIX' || product_abbr == 'LAEP'">
<mat-card-content>
<mat-card-subtitle>CLIX</mat-card-subtitle>
<mat-form-field *ngIf="_finalRemarkForm.controls['outlet_location']">
<mat-select placeholder="Comment on Footfall in the market where the B2C outlet is located…" formControlName="outlet_location"
required>
<mat-option>Select</mat-option>
<mat-option value="heavy_footfall"> Heavy Footfall (lots of customers in the locality / marketplace).</mat-option>
<mat-option value="medium_footfall"> Medium Footfall (Medium no of customers in the locality / marketplace).</mat-option>
<mat-option value="low_footfall"> Low Footfall (Few customers seen in the locality / marketplace).</mat-option>
</mat-select>
<mat-error style="color:red;font-size:12px;margin:0;padding:0;font-weight: normal;float:right" *ngIf="_finalRemarkForm.controls['outlet_location'].hasError('required')">Comment on Footfall in the market where the B2C outlet is located Required</mat-error>
</mat-form-field>
<div class="toggle" *ngIf="_finalRemarkForm.controls['is_competition']">
<mat-checkbox color="primary" formControlName="is_competition" (change)="clixChange($event.checked,1)">
Is there Competition to the applicants business in the location <strong>( {{ _finalRemarkForm.value.is_competition ===true ? 'Yes' : 'No'}} )</strong>
</mat-checkbox>
</div>
<mat-form-field *ngIf="_finalRemarkForm.controls['appx_outlet_or_stores']">
<input matInput autocomplete="off"
placeholder="Approximate No of similar outlets / stores seen by PD officer during the visit to that location"
formControlName="appx_outlet_or_stores" required OnlyNumber
type="text">
<mat-error *ngIf="_finalRemarkForm.controls['appx_outlet_or_stores'].hasError('required')">Approximate No of similar outlets / stores seen by PD officer during the visit to that location Required</mat-error>
</mat-form-field>
<div class="toggle" *ngIf="_finalRemarkForm.controls['demolition_activity']">
<mat-checkbox color="primary" formControlName="demolition_activity" (change)="clixChange($event.checked,2)">
Any demolition activity seen in the locality by PD officer <strong>( {{ _finalRemarkForm.value.demolition_activity ===true ? 'Yes' : 'No'}} )</strong></mat-checkbox>
</div>
<ion-row>
<ion-col>
<mat-form-field *ngIf="_finalRemarkForm.controls['comment_of_demolition_activity']">
<input matInput autocomplete="off" type="text" placeholder="Specify The Demolition Activity Comment" formControlName="comment_of_demolition_activity" required>
<mat-error *ngIf="_finalRemarkForm.controls['comment_of_demolition_activity'].hasError('required')">Specify The Demolition Activity Comment Required</mat-error>
</mat-form-field>
</ion-col>
<ion-col float-right *ngIf="_finalRemarkForm.controls['demolition_activity_pic']">
<div *ngIf="_finalRemarkForm.controls['demolition_activity_pic'].value !== ''" >
<img src="{{_finalRemarkForm.controls['demolition_activity_pic'].value}}" imageViewer style ="width: 40px;height: 35px;">
</div>
<div *ngIf="_finalRemarkForm.controls['demolition_activity_pic'].value === ''" >
<label style="display: block; text-align: center !important;"> Demolition Activity Locality
Image </label>
</div>
<div style="text-align: -webkit-center;" >
<ion-icon title="Click Here For Demolition Activity Locality Image" name="md-camera" (click)="ImageUpload(1)"></ion-icon>
</div>
</ion-col>
</ion-row>
<div *ngIf="_finalRemarkForm.controls['sealing_activity']">
<mat-checkbox color="primary" formControlName="sealing_activity" (change)="clixChange($event.checked,3)">
Any sealing activity observed in the locality by PD office <strong>( {{ _finalRemarkForm.value.sealing_activity ===true ? 'Yes' : 'No'}} )</strong></mat-checkbox>
</div>
<ion-row>
<ion-col>
<mat-form-field *ngIf="_finalRemarkForm.controls['comment_of_sealing_activity']">
<input matInput autocomplete="off" type="text" placeholder="Specify The Sealing Activity Comment " formControlName="comment_of_sealing_activity" required>
<mat-error *ngIf="_finalRemarkForm.controls['comment_of_sealing_activity'].hasError('required')">Specify The Sealing Activity Comment Required</mat-error>
</mat-form-field>
</ion-col>
<ion-col float-right *ngIf="_finalRemarkForm.controls['sealing_activity_pic']">
<div *ngIf="_finalRemarkForm.controls['sealing_activity_pic'].value !== ''" >
<img src="{{_finalRemarkForm.controls['sealing_activity_pic'].value}}" imageViewer style ="width: 40px;height: 35px;">
</div>
<div *ngIf="_finalRemarkForm.controls['sealing_activity_pic'].value === ''" >
<label style="display: block; text-align: center !important;"> Sealing Activity Locality
Image </label>
</div>
<div style="text-align: -webkit-center;" >
<ion-icon title="Click Here For Sealing Activity Locality Image" name="md-camera" (click)="ImageUpload(2)"></ion-icon>
</div>
</ion-col>
</ion-row>
</mat-card-content>
</mat-card>
<mat-card>
<mat-form-field appearance="outline">
<mat-label>Other Remarks</mat-label>

View File

@ -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;

View File

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

View File

@ -0,0 +1,149 @@
<ion-header>
<ion-navbar color="optblue">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
<ion-buttons end>
<a (click)="capture()">
<span style="padding: 0px;margin-right: 14px;color:white;font-size:25px;">
<ion-icon name="md-camera"></ion-icon>
</span>
</a>
<a (click)="saveFuturePlan()" *ngIf="!complete_status">
<span style="padding: 0px;margin-right: 14px;color:white;font-size:20px;">
<ion-icon name="fn-save"></ion-icon>
</span>
</a>
</ion-buttons>
</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-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><br />
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text"
placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)">
<button *ngIf="image.option != 'dummy'" ion-button clear color="optblue" (click)="removeImg(i)">
<ion-icon style="font-size:22px" name="md-trash"></ion-icon>
</button>
</ion-col>
<hr />
</ion-row>
<hr />
<hr />
</ion-grid>
<ion-grid *ngIf="imageBucket.length >0 ">
<label style="font-size:14px;color:gray">Newly Captured Pics</label><br />
<ion-row>
<ion-col col-6 *ngFor="let image of imageBucket; let i=index" no-padding>
<img src="{{image.image}}" imageViewer><br />
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
<input #focusName *ngIf="image.Name ==''" width="20px" ion-input type="text" placeholder="Document Name"
(blur)="changeNameForBucket($event.target.value,i,image.image)">
<button float-right ion-button clear color="optblue" (click)="removeImgForBucket(i)">
<ion-icon style="font-size:22px" name="md-trash"></ion-icon>
</button>
</ion-col>
<hr />
</ion-row>
</ion-grid>
</mat-card-content>
<br />
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary"
(click)="sendImage()">save Images</button>
</mat-card>
<form [formGroup]="_futurePlansForm" novalidate *ngSwitchCase="'0'">
<mat-card>
<mat-card-content>
<mat-form-field >
<input matInput autocomplete="off"
placeholder="USP of the business - How is the applicants business different from others in the same line of business?"
formControlName="usp_of_the_business">
<mat-error *ngIf="_futurePlansForm.controls['usp_of_the_business'].hasError('required')">USP of the
business Required</mat-error>
</mat-form-field>
<mat-form-field >
<input matInput autocomplete="off" placeholder="Future plans for business expansion"
formControlName="future_plans_for_business_expansion">
<mat-error *ngIf="_futurePlansForm.controls['future_plans_for_business_expansion'].hasError('required')">
Future plans for business expansion Required</mat-error>
</mat-form-field>
<mat-form-field >
<input matInput autocomplete="off" placeholder="Impact of GST on the business"
formControlName="impact_of_gst_on_the_business">
<mat-error *ngIf="_futurePlansForm.controls['impact_of_gst_on_the_business'].hasError('required')">Impact
of GST on the business Required</mat-error>
</mat-form-field>
<mat-form-field >
<input matInput autocomplete="off" placeholder="Key Competitors" formControlName="key_competitors">
<mat-error *ngIf="_futurePlansForm.controls['key_competitors'].hasError('required')">Key Competitors
Required</mat-error>
</mat-form-field>
<mat-form-field >
<input matInput autocomplete="off"
placeholder="Succession plan - who will look after the business after applicants retire / are unable to run the business due to any reason?"
formControlName="succession_plan">
<mat-error *ngIf="_futurePlansForm.controls['succession_plan'].hasError('required')">Succession plan
Required</mat-error>
</mat-form-field>
<mat-form-field >
<input matInput autocomplete="off"
placeholder="Brief of Other Group Concerns / Businesses run by the applicants"
formControlName="brief_of_other_group_concerns_or_businesses_run_by_the_applicants">
<mat-error
*ngIf="_futurePlansForm.controls['brief_of_other_group_concerns_or_businesses_run_by_the_applicants'].hasError('required')">
Brief of Other Group Concerns / Businesses run by the applicants Required</mat-error>
</mat-form-field>
</mat-card-content>
</mat-card>
<mat-card>
<mat-form-field appearance="outline">
<mat-label>Other Remarks</mat-label>
<textarea matInput placeholder="Other Remarks" formControlName="remarks"></textarea>
</mat-form-field>
</mat-card>
</form>
</div>
<!-- <ion-fab bottom right mini>
<button mini style="margin-bottom: 10px" ion-fab color="optblue" slot="fixed" (click)="capture()"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button></ion-fab> -->
</ion-content>
<!-- <ion-footer>
<span *ngIf='!complete_status'>
<button ion-button full color="optblue" type="submit" (click)="saveFinalRemark()"> Save</button>
</span>
</ion-footer> -->

View File

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

View File

@ -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("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the Save Image button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
if (data == false) {
//reject1();
reject();
}
else {
resolve1();
resolve();
}
})
})
}
resolve();
}
})
})
}
else {
//REGULAR CHECK FOR IMAGE IS CAPTURED
if (this.imageBucket.length > 0) {
return new Promise((resolve, reject) => {
let alert = this.toast.setAlert("<small>Captured Images are not Saved<small>", "<strong><small>Note:To Save the image press the 'Save Image' button</small></strong><br> Are you sure want to Go Back?")
alert.present();
alert.onDidDismiss((data) => {
if (data == false) {
reject();
}
else {
resolve();
}
})
})
}
}
}
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');
}
})
}
}

View File

@ -106,8 +106,24 @@
<mat-form-field *ngIf="isOtherPurpose" style="width: 100%">
<input matInput placeholder="Specify End Use" formControlName="end_use_other">
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="lender_short_name == 'CLIX'">
<mat-select placeholder="Is there a Total Fund is Disclose ? "
formControlName="is_there_total_fund">
<mat-option>Select</mat-option>
<mat-option value="yes disclose">Yes, Disclosed</mat-option>
<mat-option value="no not disclosed">No, not Disclosed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="loanDetailsForm.controls['is_there_total_fund'].value == 'yes disclose'">
<mat-form-field style="width: 100%">
<input matInput placeholder="Total Fund Required for the End use mentioned? " formControlName="fund_amt"
type="number"(keyup)="inWords($event,8)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['fund_amt'].value != '' && fundAmtInWords !=''">{{"&#8377;"}} {{fundAmtInWords}} Only</mat-hint>
</mat-form-field>
</span>
<mat-form-field style="width: 100%">
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)"
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event.value)"
formControlName="is_transfer" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
@ -146,7 +162,7 @@
<input matInput placeholder="Top Up Amt" type="number" formControlName="topup_amount" (keyup)="inWords($event,5)">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field >
<mat-form-field style="width:100%" *ngIf="loanDetailsForm.controls['topup_amount'].value > 0 " >
<mat-form-field style="width:100%" *ngIf="loanDetailsForm.controls['topup_amount'].value > 0 && lenderShortName != 'CLIX'" >
<mat-select placeholder="What is the End Use of the Top Up?"
formControlName="end_use_topup" >

View File

@ -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();