trigger : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-12 00:51:26 +05:30
parent 70f7b67536
commit 2f9042c9c9
6 changed files with 49 additions and 29 deletions

View File

@ -39,7 +39,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required> <input matInput autocomplete="off" placeholder="Loan Applicant ID" formControlName="lender_applicant_id" type="text" required>
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> --> <!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
</mat-form-field> </mat-form-field>
@ -48,15 +48,14 @@
<!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> --> <!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="lender_contact_mobile" type="text" type="text" (keypress)="keyPress($event)" maxlength="10" required> <input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="lender_contact_mobile" type="text" (keypress)="keyPress($event)" maxlength="10">
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error> <mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field> </mat-form-field>
<!--<mat-form-field style="width: 32%"> <!--<mat-form-field style="width: 32%">
<input matInput autocomplete="off" placeholder="Lender Contact Number" formControlName="lender_contact_mobile" type="text" (keypress)="keyPress($event)" maxlength="10" required> <input matInput autocomplete="off" placeholder="Lender Contact Number" formControlName="lender_contact_mobile" type="text" (keypress)="keyPress($event)" maxlength="10" required>
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error> <mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>-->
</mat-form-field>-->
<mat-form-field style="width: 8%"> <mat-form-field style="width: 8%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="lender_stdcode" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="STD Code" formControlName="lender_stdcode" type="text" (keypress)="keyPress($event)">
@ -207,7 +206,7 @@
<mat-form-field style="width: 15%"> <mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="applicant_stdcode" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="STD Code" formControlName="applicant_stdcode" type="text" (keypress)="keyPress($event)">
<span matPrefix>+91</span> <!-- <span matPrefix>+91</span> -->
<mat-error *ngIf="pdMain.applicant_stdcode.hasError('maxlength') || pdMain.applicant_stdcode.hasError('minlength')">Enter Valid STD Code Number. </mat-error> <mat-error *ngIf="pdMain.applicant_stdcode.hasError('maxlength') || pdMain.applicant_stdcode.hasError('minlength')">Enter Valid STD Code Number. </mat-error>
</mat-form-field> &nbsp; - &nbsp; </mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 20%"> <mat-form-field style="width: 20%">

View File

@ -71,7 +71,9 @@ export class AddPdComponent implements OnInit, OnDestroy {
pd_branch_id: [null], pd_branch_id: [null],
lender_applicant_id: [null, Validators.compose([Validators.required])], lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_contact_person: [null, Validators.compose([Validators.required])], lender_contact_person: [null, Validators.compose([Validators.required])],
lender_contact_mobile: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12),Validators.required,Validators.pattern('^[0-9]*$')])], lender_contact_mobile: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
lender_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
lender_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
//lender_billing: [null], //lender_billing: [null],
fk_product_id: [null], fk_product_id: [null],
fk_subproduct_id: [null], fk_subproduct_id: [null],
@ -83,8 +85,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
// landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])], // landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])],
// email: [null], // email: [null],
lender_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
lender_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
applicant_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], applicant_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
applicant_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], applicant_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
company_name: [null], company_name: [null],
@ -220,8 +220,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
} }
generateDocuments(): FormGroup { generateDocuments(): FormGroup {
return this._fb.group({ return this._fb.group({
doc_name: [null, Validators.compose([Validators.required])], doc_name: [null],//Validators.compose([Validators.required])
documentFile : [null, Validators.compose([Validators.required])], documentFile : [null],//, Validators.compose([Validators.required])
}); });
} }
@ -385,14 +385,18 @@ export class AddPdComponent implements OnInit, OnDestroy {
// common function for both draft and process pd // common function for both draft and process pd
submitPdDetails(formValue: any, status:string) { submitPdDetails(formValue: any, status:string) {
//alert('Inside Function Submit Function');
if(this._PDtriggerForm.invalid) { if(this._PDtriggerForm.invalid) {
this.validateAllFormFields(this._PDtriggerForm); this.validateAllFormFields(this._PDtriggerForm);
//alert('validationError'); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
//console.log(this._PDtriggerForm);
return; return;
} }
else { else {
if((formValue.lender_contact_mobile == '') || (formValue.lender_stdcode == '' && formValue.lender_landline == '')){
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
else{
this.disableAfterSubmit=true; this.disableAfterSubmit=true;
let pd_details:any={ let pd_details:any={
"fk_lender_id":formValue.fk_lender_id, "fk_lender_id":formValue.fk_lender_id,
@ -479,7 +483,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}); });
} }
}
} }
loadPdListCompoent(from:boolean) { loadPdListCompoent(from:boolean) {
if(from){ if(from){

View File

@ -134,10 +134,16 @@ export class EditPdApplicantComponent implements OnInit {
get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; } get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; }
updatePdApplicant(formValue: any) { updatePdApplicant(formValue: any) {
if(this._EditApplicantForm.invalid) { if(this._EditApplicantForm.invalid) {
this.validateAllFormFields(this._EditApplicantForm) this.validateAllFormFields(this._EditApplicantForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return; return;
} }
else { else {
if((formValue.mobile_no == '') || (formValue.stdcode == '' && formValue.landline == '')){
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
else{
let pd_applicant_details : any=[{ let pd_applicant_details : any=[{
"fk_pd_id": this.data.pdID, "fk_pd_id": this.data.pdID,
"pd_co_applicant_id": formValue.fk_applicant_primary_id, "pd_co_applicant_id": formValue.fk_applicant_primary_id,
@ -195,7 +201,7 @@ export class EditPdApplicantComponent implements OnInit {
// }, error => { // }, error => {
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// }); // });
} }}
} }
// get relation master details // get relation master details

View File

@ -245,14 +245,18 @@ export class EditPdMasterComponent implements OnInit {
submitPdDetails(formValue: any, status:string) { submitPdDetails(formValue: any, status:string) {
let updateStatus = this.currentPDStatus == this.pdStatusCheck.DRAFT ? status : this.currentPDStatus == this.pdStatusCheck.TRIGGERED ? status : this.currentPDStatus; let updateStatus = this.currentPDStatus == this.pdStatusCheck.DRAFT ? status : this.currentPDStatus == this.pdStatusCheck.TRIGGERED ? status : this.currentPDStatus;
if(this._EditPDtriggerForm.invalid) { if(this._EditPDtriggerForm.invalid) {
this.validateAllFormFields(this._EditPDtriggerForm) this.validateAllFormFields(this._EditPDtriggerForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return; return;
} }
else{ else{
let my_array = this._EditPDtriggerForm.value; let my_array = this._EditPDtriggerForm.value;
if((my_array.pd_contact_person == '') || (my_array.lender_stdcode == '' && my_array.lender_landline == '')){
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
else{
let concat_landline let concat_landline
if(my_array.lender_stdcode != null && my_array.lender_landline != null){ if(my_array.lender_stdcode != null && my_array.lender_landline != null){
if(my_array.lender_stdcode == '' && my_array.lender_landline == ''){ if(my_array.lender_stdcode == '' && my_array.lender_landline == ''){
concat_landline = null; concat_landline = null;
@ -299,6 +303,7 @@ export class EditPdMasterComponent implements OnInit {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});//error closed });//error closed
}//else closed }//else closed
}
} }
/** To Reset Popup Data */ /** To Reset Popup Data */
onReset() { onReset() {

View File

@ -40,16 +40,17 @@
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="70" fxFlex.xl="70" class="content-data"> <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="70" fxFlex.xl="70" class="content-data">
<figure> <figure>
<mat-card-content style="padding:0px !important;"> <mat-card-content style="padding:0px !important;">
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs">
<div fxLayout="row"> <div fxLayout="row" class="ml-xs mr-xs">
<div fxFlex="100" style="text-align: right;"> <div fxFlex="100" style="text-align: right;">
<div *ngFor="let master of pdMasterData">
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button> <button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button> <button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT && enableStartPD" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button> <button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT && enableStartPD" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus===pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button> <button *ngIf="master.pd_type_name && currentPDStatus===pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button> </div>
</div> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
</div> </div>
</div> </div>
</mat-card-content> </mat-card-content>
<hr> <hr>

View File

@ -70,7 +70,12 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this._pd.editPdDetails(editID).subscribe( this._pd.editPdDetails(editID).subscribe(
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.pdMasterData=data.records.pd_master_details; this.pdMasterData = data.records.pd_master_details;
this.pdMasterData = Object.keys(data.records.pd_master_details).map(function (key)
{
return data.records.pd_master_details[key];
});
// console.log(this.pdMasterData);
this.pd_QC_Rating = Number(this.pdMasterData[0].qc_rating); this.pd_QC_Rating = Number(this.pdMasterData[0].qc_rating);
this.pdApplicantData= data.records.applicants_details; this.pdApplicantData= data.records.applicants_details;
this.pdDocumentsData=data.records.pd_documnets; this.pdDocumentsData=data.records.pd_documnets;