view pd changes
This commit is contained in:
parent
f7124e9869
commit
3e81c45cde
@ -20,7 +20,7 @@
|
||||
<span *ngIf="master.pd_status!=pdStatusCheck.SCHEDULED && master.pd_status!=pdStatusCheck.QC_COMPLETED " style="text-align:left">{{master.pd_status | titlecase}}</span>
|
||||
<span *ngIf="master.pd_status==pdStatusCheck.QC_COMPLETED " style="text-align:left">QC Completed</span>
|
||||
</button>
|
||||
<button *ngIf="master.pd_type_name && currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="directTriggerPD(master)"><mat-icon>flash_on</mat-icon></button>
|
||||
<button *ngIf="currentPDStatus==pdStatusCheck.DRAFT && mandatoryFieldsValidations.length==0" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="directTriggerPD(mandatoryFieldsValidations,master.pd_id)"><mat-icon>flash_on</mat-icon></button>
|
||||
<br>
|
||||
<small *ngIf="master.pd_allocated_to && master.fk_pd_type==1" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.pd_allocated_to | titlecase}}</small>
|
||||
<small *ngIf="master.executive_name && master.centralofficer && master.fk_pd_type==2" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}}</small>
|
||||
|
||||
@ -46,6 +46,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
"QC_COMPLETED" :'QC_COMPLETED',
|
||||
};
|
||||
|
||||
mandatoryFieldsValidations: any=[];
|
||||
|
||||
// @Input() childData: string;
|
||||
// @Output() loadParent = new EventEmitter<string>();
|
||||
public _EditPDtriggerForm:FormGroup;
|
||||
@ -70,13 +72,10 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
this._pd.editPdDetails(editID).subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
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);
|
||||
let masterData: any = data.records.pd_master_details;
|
||||
this.pdMasterData.push(masterData[0]);
|
||||
this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
|
||||
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
|
||||
this.pdApplicantData= data.records.applicants_details;
|
||||
this.pdDocumentsData=data.records.pd_documnets;
|
||||
this.masterPdLogsData=data.records.pd_logs.master;
|
||||
@ -234,8 +233,27 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
// direct trigger the pd
|
||||
directTriggerPD(data: any){
|
||||
//if(data.)
|
||||
directTriggerPD(data: any,pdid:string){
|
||||
if(data.length>0){
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
}
|
||||
else {
|
||||
let lenderMasterArray = {
|
||||
"pd_id": pdid,
|
||||
}
|
||||
this._pd.editPdMasterDetails(lenderMasterArray, this.pdStatusCheck.TRIGGERED).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
this.notifier.notify('success', 'PD Status Updated.');
|
||||
this.viewPdDetails(this.viewID);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
}//else
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});//error closed
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// updateViewComponent(editBack:string) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user