test doc sn.1 changes only : ps

This commit is contained in:
venbatechnologies@gmail.com 2018-12-26 14:37:48 +05:30
parent de879e3659
commit eb333ca20e
6 changed files with 65 additions and 34 deletions

View File

@ -81,13 +81,14 @@
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
</mat-form-field>
<!-- {{customerSegmentList | json}} -->
<mat-form-field style="width: 32%">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
{{CSL.customer_segment}}
{{CSL.abbr}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
@ -106,8 +107,9 @@
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 24%">
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)">
<mat-form-field style="width: 32%">
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required autocomplete="off">
<mat-hint align="end" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
@ -184,8 +186,9 @@
<mat-error *ngIf="pdMain.mobile_no.hasError('maxlength') || pdMain.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 10%">
<mat-form-field style="width: 15%">
<input matInput placeholder="STD Code" formControlName="stdcode" type="text" (keypress)="keyPress($event)">
<span matPrefix>+91</span>
<mat-error *ngIf="pdMain.stdcode.hasError('maxlength') || pdMain.stdcode.hasError('minlength')">Enter Valid STD Code Number. </mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 20%">
@ -264,14 +267,15 @@
<div fxFlex="30" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(_PDtriggerForm.value,draftStatus)" matTooltip="PD Draft" matTooltipPosition="above" type="button"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Process" matTooltipPosition="above" (click)="triggerPD(_PDtriggerForm.value,PDTriggerStatus)"><mat-icon>save</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(_PDtriggerForm.value,draftStatus)" matTooltip="Save as Draft" matTooltipPosition="above" type="button"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger PD" matTooltipPosition="above" (click)="triggerPD(_PDtriggerForm.value,PDTriggerStatus)"><mat-icon>save</mat-icon></button>
</div>
</mat-card-actions>
</form>
</mat-card-content>
</mat-card>
<notifier-container></notifier-container>

View File

@ -33,6 +33,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
billingList: any;
relationShipList: any;
errorMessage: any;
loanAmtInWords : any;
// Dynamic co applicant
createWithLongContent = false;
dynamicCoApplicant = [];
@ -272,6 +273,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
// save pd in draft
saveDraftPD(formValue: any, status:string){
alert('Inside The Draft PD');
this.submitPdDetails(formValue, status);
}
//trigger pd
@ -360,8 +362,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
// common function for both draft and process pd
submitPdDetails(formValue: any, status:string) {
alert('Inside Function Submit Function');
if(this._PDtriggerForm.invalid) {
this.validateAllFormFields(this._PDtriggerForm)
this.validateAllFormFields(this._PDtriggerForm);
alert('validationError');
console.log(this._PDtriggerForm);
return;
}
else {
@ -433,7 +438,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
if(formValue.addtional_requirements.length > 0){
pd_form.append("addtional_requirements",JSON.stringify(formValue.addtional_requirements))
}
}
this._pd.addPdDetails(pd_form).subscribe(result => {
if (result.status == 200) {
this.notifier.notify('success', 'PD Saved.');
@ -490,4 +495,16 @@ validateAllFormFields(formGroup: any) {
});
}
/** To Convert Amount into Words */
inWords(e,flag:number){
switch(flag){
case 1 :
this.loanAmtInWords = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}

View File

@ -31,8 +31,9 @@
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" (keypress)="keyPress($event)" required>
<mat-error *ngIf="pdMainApplicant.mobile_no.hasError('maxlength') || pdMainApplicant.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 10%">
<mat-form-field style="width: 15%">
<input matInput placeholder="STD Code" formControlName="stdcode" type="text" (keypress)="keyPress($event)">
<span matPrefix>+91</span>
<mat-error *ngIf="pdMainApplicant.stdcode.hasError('maxlength') || pdMainApplicant.stdcode.hasError('minlength')">Enter Valid STD Code. </mat-error>
</mat-form-field> &nbsp;-&nbsp;
<mat-form-field style="width: 25%">
@ -64,8 +65,9 @@
<input matInput placeholder="LandLine Number" formControlName="coapplicant_landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf=" coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field> -->
<mat-form-field style="width: 10%">
<mat-form-field style="width: 15%">
<input matInput placeholder="STD Code" formControlName="coapplicant_stdcode" type="text" (keypress)="keyPress($event)">
<span matPrefix>+91</span>
<mat-error *ngIf="coDetails['controls'].coapplicant_stdcode.hasError('maxlength') || coDetails['controls'].coapplicant_stdcode.hasError('minlength')">Enter Valid STD Number. </mat-error>
</mat-form-field> &nbsp;-&nbsp;
<mat-form-field style="width: 25%">

View File

@ -71,7 +71,7 @@
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
<mat-option>Select</mat-option>
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
{{CSL.customer_segment}}
<!-- {{CSL.customer_segment}} -->{{CSL.abbr}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
@ -88,7 +88,9 @@
</mat-form-field>
<mat-form-field style="width: 24%">
<input matInput placeholder="Loan Amount" formControlName="loan_amount">
<!-- <input matInput placeholder="Loan Amount" formControlName="loan_amount"> -->
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required autocomplete="off">
<mat-hint align="end" *ngIf="pdMain.loan_amount.value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>

View File

@ -26,6 +26,7 @@ export class EditPdMasterComponent implements OnInit {
// PDTriggerStatus: string;
enablePDButton: boolean;
currentPDStatus: string;
loanAmtInWords : any;
public _EditPDtriggerForm:FormGroup;
public notifier: NotifierService;
// create values for status check
@ -43,6 +44,7 @@ export class EditPdMasterComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public data: any) {
this.notifier=notifier
this.currentPDStatus = data.records.pd_status;
if(this.data.records.loan_amount){ this.loanAmtInWords = this._pd.convertNumberToWords(this.data.records.loan_amount); }
}
ngOnInit() {
@ -279,6 +281,17 @@ validateAllFormFields(formGroup: any) {
}
});
}
/** To Convert Amount into Words */
inWords(e,flag:number){
switch(flag){
case 1 :
this.loanAmtInWords = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}

View File

@ -35,7 +35,7 @@
</mat-card>
<mat-card-content>
<div fxLayout="row wrap">
<div fxLayout="row wrap">
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<!--pd master -->
@ -64,13 +64,11 @@
<p><span>{{master.addressline1}}</span></p>
<p *ngIf="master.remarks"><span style="font-size:13px;"> Remarks : </span> <span style="color:red">{{master.remarks}}</span></p>
</mat-card-content>
</mat-card>
</div>
<div fxFlex.xs="100" class="m-gap p-gap" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
</mat-card>
</div>
<div fxFlex.xs="100" class="m-gap p-gap" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<!-- applicant card -->
<mat-card class="minheight">
<mat-card class="minheight">
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdApplicant(pdApplicantData)"><mat-icon>edit</mat-icon></button>
</div>
@ -91,7 +89,7 @@
</span> &nbsp;&nbsp;&nbsp;
<span *ngIf="applicant.landline != '' && applicant.landline != 'null-null' && applicant.landline != null " class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-phone"></i>
&nbsp;{{applicant.landline}}
&nbsp;<span matPrefix>+91</span>{{applicant.landline}}
</span>
<br><span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">Main Applicant </span>
<ng-template #codetails><span>{{applicant.relation_name}}</span></ng-template>
@ -101,10 +99,10 @@
</mat-card-content>
<ng-template #noApplicant><mat-card-content><p>No Applicant</p></mat-card-content></ng-template>
</mat-card>
</div>
<div fxFlex.xs="100" class="m-gap p-gap" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="100" fxFlex.xl="100">
</div>
<div fxFlex.xs="100" class="m-gap p-gap" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="100" fxFlex.xl="100">
<!-- applicant card -->
<mat-card class="minheight">
<mat-card class="minheight">
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editAdditionalRequirement(pdAdditionalReqData)"><mat-icon>edit</mat-icon></button>
</div>
@ -121,13 +119,8 @@
</mat-card-content>
<ng-template #noRequirement><mat-card-content><p>No Additional Requirements</p></mat-card-content></ng-template>
</mat-card>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
<!-- pd documents card -->
<mat-expansion-panel *ngIf="pdDocumentsData.length>0; else nodocument">
<mat-expansion-panel-header>
@ -148,8 +141,8 @@
<mat-card-content><p>No Document</p></mat-card-content>
</mat-card>
</ng-template>
</div>
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
</div>
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<!--pd logs card -->
<mat-expansion-panel *ngIf="masterPdLogsData.length>0; else nohistory">
<mat-expansion-panel-header>
@ -174,8 +167,8 @@
</mat-card>
</ng-template>
</div>
</div>
</div>
</div>
</mat-card-content>
</div>
</mat-card-content>