changes and issue fixes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-05-30 11:41:54 +05:30
parent bd5eadb7b1
commit bf73ca220c
7 changed files with 61 additions and 9 deletions

View File

@ -498,7 +498,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
"fk_pd_type": formValue.fk_pd_type, "fk_pd_type": formValue.fk_pd_type,
"fk_customer_segment": formValue.fk_customer_segment, "fk_customer_segment": formValue.fk_customer_segment,
"loan_amount": formValue.loan_amount, "loan_amount": formValue.loan_amount,
"addressline1": !formValue.addresses[0].addressline1 ? null : this.titleCase.transform(formValue.addresses[0]), "addressline1": !formValue.addresses[0].addressline1 ? null : this.titleCase.transform(formValue.addresses[0].addressline1),
"fk_city": formValue.addresses[0].fk_city, "fk_city": formValue.addresses[0].fk_city,
"fk_state": formValue.addresses[0].fk_state, "fk_state": formValue.addresses[0].fk_state,
"pincode": formValue.addresses[0].pincode, "pincode": formValue.addresses[0].pincode,

View File

@ -189,18 +189,20 @@ export class AllPdComponent implements OnInit, OnChanges {
this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd'); this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd');
this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd'); this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd');
console.log(JSON.stringify(this.searchForm.value)); console.log(JSON.stringify(this.searchForm.value));
this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res=> this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res=>
{ {
this.xpandStatus = false; this.xpandStatus = false;
if(res['dataStatus']==true) if(res['dataStatus']==true)
{ {
this.dataSourceTab1.data = res['records']; this.dataSourceTab1.data = res['records'];
console.log('res[records]',res['records']);
this.dataSourceTab1.paginator = this.paginator; this.dataSourceTab1.paginator = this.paginator;
}else{ }else{
// this.notifier.notify('warning', 'No Records Found'); // this.notifier.notify('warning', 'No Records Found');
this.dataSourceTab1 = this.tempStore; this.dataSourceTab1 = this.tempStore;
console.log('this.tempStore',this.tempStore);
this.dataSourceTab1.paginator = this.paginator; this.dataSourceTab1.paginator = this.paginator;
} }
}) })

View File

@ -109,7 +109,7 @@
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1" matTooltip="Add More Co-Applicant" matTooltipPosition="above" color="primary" type="button" (click)="addCoApplicant(emptyData)"><mat-icon>add</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1" matTooltip="Add More Co-Applicant" matTooltipPosition="above" color="primary" type="button" (click)="addCoApplicant(emptyData)"><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="updatePdApplicant(_EditApplicantForm.value)"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="updatePdApplicant(_EditApplicantForm.value)" [disabled]="disableAfterSubmit===true"><mat-icon>save</mat-icon></button>
</mat-dialog-actions> </mat-dialog-actions>
</form> </form>

View File

@ -25,11 +25,14 @@ export class EditPdApplicantComponent implements OnInit {
relationShipList:any; relationShipList:any;
titleList: any; titleList: any;
CSAbbr:any; CSAbbr:any;
disableAfterSubmit: boolean;
constructor(private _fb: FormBuilder, constructor(private _fb: FormBuilder,
private _pd: PdTrigerService, notifier: NotifierService, private dialogRef: MatDialogRef<EditPdApplicantComponent>, private _pd: PdTrigerService, notifier: NotifierService, private dialogRef: MatDialogRef<EditPdApplicantComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) { @Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) {
this.notifier=notifier this.notifier=notifier;
this.disableAfterSubmit = false;
} }
ngOnInit() { ngOnInit() {
@ -249,15 +252,19 @@ export class EditPdApplicantComponent implements OnInit {
} }
pd_applicant_details.push(obj1) pd_applicant_details.push(obj1)
}); });
this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => { this.disableAfterSubmit = true;
this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => {
if (result.status == 200) { if (result.status == 200) {
this.disableAfterSubmit = false;
this.notifier.notify('success', 'PD Details Updated.'); this.notifier.notify('success', 'PD Details Updated.');
this.dialogRef.close(); this.dialogRef.close();
} }
else { else {
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
} }
}, error => { }, error => {
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur');
}); });
} }
@ -289,6 +296,7 @@ export class EditPdApplicantComponent implements OnInit {
} }
/** To Reset Popup Data */ /** To Reset Popup Data */
onReset() { onReset() {
this.disableAfterSubmit = false;
if(this.data.records.length>0){ if(this.data.records.length>0){
this.loadApplicantFormData(); this.loadApplicantFormData();
} }

View File

@ -144,7 +144,7 @@
<mat-form-field style="width: 96%"> <mat-form-field style="width: 96%">
<textarea matInput autocomplete="off" placeholder="Address at which PD is to be done" <textarea matInput autocomplete="off" placeholder="Address at which PD is to be done"
formControlName="addressline1" style="text-transform: uppercase"></textarea> formControlName="addressline1" [value]="addresses.get('addressline1').value | titlecase"></textarea>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 32%"> <mat-form-field style="width: 32%">
@ -223,7 +223,7 @@
<!-- <button *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(this._EditPDtriggerForm.value,pdStatusCheck.DRAFT)" type="button" matTooltip="Save As Draft" matTooltipPosition="above"><mat-icon>insert_drive_file</mat-icon></button> --> <!-- <button *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(this._EditPDtriggerForm.value,pdStatusCheck.DRAFT)" type="button" matTooltip="Save As Draft" matTooltipPosition="above"><mat-icon>insert_drive_file</mat-icon></button> -->
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Trigger PD" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value, pdStatusCheck.TRIGGERED)"><mat-icon>save</mat-icon></button> --> <!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Trigger PD" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value, pdStatusCheck.TRIGGERED)"><mat-icon>save</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save PD" <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save PD"
matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value,'')"> matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value,'')" [disabled]="disableAfterSubmit===true">
<mat-icon>save</mat-icon> <mat-icon>save</mat-icon>
</button> </button>
</div> </div>

View File

@ -35,6 +35,7 @@ export class EditPdMasterComponent implements OnInit {
// PDTriggerStatus: string; // PDTriggerStatus: string;
enablePDButton: boolean; enablePDButton: boolean;
currentPDStatus: string; currentPDStatus: string;
disableAfterSubmit: boolean;
pincodeflag : any = []; pincodeflag : any = [];
public _EditPDtriggerForm:FormGroup; public _EditPDtriggerForm:FormGroup;
@ -57,6 +58,7 @@ export class EditPdMasterComponent implements OnInit {
this.notifier=notifier this.notifier=notifier
this.currentPDStatus = data.records.pd_status; this.currentPDStatus = data.records.pd_status;
this.pdid = data.records.pd_id; this.pdid = data.records.pd_id;
this.disableAfterSubmit = false;
} }
ngOnInit() { ngOnInit() {
@ -471,17 +473,20 @@ export class EditPdMasterComponent implements OnInit {
// this.notifier.notify('warning', 'Something Wents Wrong in Address Try Again.!'); // this.notifier.notify('warning', 'Something Wents Wrong in Address Try Again.!');
this.notifier.notify('warning', 'Something Wents Wrong in Address Section Try Again.!' + '-' + error.error_text + ' occur'); this.notifier.notify('warning', 'Something Wents Wrong in Address Section Try Again.!' + '-' + error.error_text + ' occur');
}); });
this.disableAfterSubmit = true;
this._pd.editPdMasterDetails(lenderMasterArray, updateStatus).subscribe(result => { this._pd.editPdMasterDetails(lenderMasterArray, updateStatus).subscribe(result => {
if (result.status == 200) { if (result.status == 200) {
this.disableAfterSubmit = false;
this.notifier.notify('success', 'PD Details Updated.'); this.notifier.notify('success', 'PD Details Updated.');
this.dialogRef.close(); this.dialogRef.close();
} }
else { else {
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}//else }//else
}, error => { }, error => {
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur');
});//error closed });//error closed
}//else closed }//else closed
@ -489,6 +494,7 @@ export class EditPdMasterComponent implements OnInit {
} }
/** To Reset Popup Data */ /** To Reset Popup Data */
onReset() { onReset() {
this.disableAfterSubmit = false;
this.loadFormData(); this.loadFormData();
} }
/** For Popup Close Button */ /** For Popup Close Button */

View File

@ -46,7 +46,7 @@ export class OtherIncomeComponent implements OnInit {
parent_pdid: string; parent_pdid: string;
pdid: string; pdid: string;
form_id: number; form_id: number;
rental_form_id:number;
public otherIncomeForm: FormGroup; public otherIncomeForm: FormGroup;
private notifier: NotifierService; private notifier: NotifierService;
frequencyData: any = []; frequencyData: any = [];
@ -70,6 +70,7 @@ export class OtherIncomeComponent implements OnInit {
this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id; this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id;
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 9; this.form_id = 9;
this.rental_form_id = 17;
this.notifier = notifier; this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
@ -307,8 +308,43 @@ export class OtherIncomeComponent implements OnInit {
records.other_income = this.otherIncomeForm.controls['other_income'].value; records.other_income = this.otherIncomeForm.controls['other_income'].value;
records.otherincome_remarks = this.otherIncomeForm.controls['otherincome_remarks'].value; records.otherincome_remarks = this.otherIncomeForm.controls['otherincome_remarks'].value;
if (this.otherIncomeForm.controls['other_income'].value == 'Yes') { if (this.otherIncomeForm.controls['other_income'].value == 'Yes') {
records.income_details = this.otherIncomeForm.controls['income_details'].value; records.income_details = this.otherIncomeForm.controls['income_details'].value;
let s: number = 0;
let rentOptionCount: number = 0;
records.income_details.forEach(option => {
console.log(option);
console.log(option.source);
if (+option.source == 5) {
rentOptionCount++;
console.log(option.source);
let params: any = {};
params.parent_pdid = this.parent_pdid;
params.pd_id = this.pdid;
params.pd_form_id = this.rental_form_id;
this._pd.retriveForm(params).subscribe(data => {
data.dataStatus == false ? s = 1 : s = 0;
console.log(s);
if(s == 1){
this.notifier.notify('warning', "You have choose "+ rentOptionCount +" rent option but you didn't fill the rental verification form please fill it");
s = 0;
rentOptionCount = 0;
return;
}
});
}
});
if(s == 1){
this.notifier.notify('warning', "You have choose "+ rentOptionCount +" rent option but you didn't fill the rental verification form please fill it");
s = 0;
rentOptionCount = 0;
return;
}
} }
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {