-
-
+
+
Lender Contact Details
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts
index 5385b47..1d2431e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts
@@ -135,6 +135,17 @@ export class ViewPdComponent implements OnInit, OnDestroy {
currentVendorStatus: any;
pdAgencyid: any;
dummyFlag:any;
+ defaultPDType: any ;
+ oldPDType :any;
+ credit_pd_type_list:any=[{
+ fk_pd_type:"1",
+ original_name:"Full PD",
+ display_name:"Physical PD"
+ },{
+ fk_pd_type:"3",
+ original_name:"Tele PD",
+ display_name:"Tele PD"
+ }];
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent,
@@ -190,6 +201,11 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2);
this.CustomerSegmentAbbr = this.pdMasterData[0].customer_segment_abbr;
this.product=this.pdMasterData[0].product_abbr;
+ this.defaultPDType = this.pdMasterData[0].fk_pd_type;
+ this.oldPDType = this.pdMasterData[0].fk_pd_type;
+ console.log("0) this.defaultPDType = ",this.defaultPDType);
+ console.log("0.1) this.oldPDType = ",this.oldPDType);
+
this.pdDocumentsData = data.records.pd_documnets;
this.masterPdLogsData = Object.keys(data.records.pd_logs.master).map(function (key) {
return data.records.pd_logs.master[key];
@@ -244,6 +260,40 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.ListPdComponent.pdListLoad(true);
}
+ changePDTypeValue(event: any) {
+ const isConfirmed = window.confirm(`Are you sure you want to change PD Type?`);
+ if (isConfirmed && event.value !== this.oldPDType) {
+
+ let template = {
+ "pd_id": this.viewID,
+ "random_string": this.pdMasterData[0].random_string,
+ "fk_pd_type": event.value
+ };
+
+ this._pd.changePDTypeValue(template).subscribe((data: any) => {
+ if (data.dataStatus) {
+ // Only update defaultPDType if the API call is successful
+ this.defaultPDType = event.value;
+ console.log('API call successful. Navigating to the same route...');
+ this.notifier.notify('success', 'Updated!');
+ window.location.reload();
+ } else {
+ // Handle error cases here
+ this.notifier.notify('warning', data.msg ? data.msg : 'Something Went Wrong. Try Again!');
+ window.location.reload();
+ }
+ }, (err: any) => {
+ // Handle error cases here
+ this.notifier.notify('warning', 'Something Went Wrong. Try Again!');
+ window.location.reload();
+ });
+ } else {
+ this.defaultPDType = this.oldPDType;
+ window.location.reload();
+ console.log('Canceled. PD Type remains unchanged.');
+ }
+ }
+
// isactiveBranch(id: number,isactive : number){
// let ActiveDatas = isactive == 0
diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
index f5e2760..7c8e4b4 100755
--- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
+++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
@@ -1093,4 +1093,11 @@ loadTemplate(form_id) {
)
}
+ changePDTypeValue(editData: any): Observable
{
+ editData.fk_updatedby = this._aws.getlocale();
+ // return this._http.post("http://localhost/AWSEC2/sparqapi/api/updatePDMaster", { records: editData })
+ return this._http.post(this.apiUrl + "updatePDMaster", { records: editData })
+ .pipe(catchError(this.handleError('operation', [])))
+ }
+
}