merge : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-12 12:32:08 +05:30
parent c08762cce3
commit 39ca8d1f0b
2 changed files with 32 additions and 9 deletions

View File

@ -15,12 +15,12 @@
<small> {{master.lender_applicant_id}}</small> <br> <small> {{master.lender_applicant_id}}</small> <br>
<small>{{master.pd_date_of_initiation}}</small><br> <small>{{master.pd_date_of_initiation}}</small><br>
<br> <br>
<button mat-raised-button color="primary"> <button mat-raised-button color="primary" style="cursor: not-allowed !important;">
<span *ngIf="master.pd_status==pdStatusCheck.SCHEDULED" style="text-align:left">{{master.pd_status | titlecase}}</span> <span *ngIf="master.pd_status==pdStatusCheck.SCHEDULED" style="text-align:left">{{master.pd_status | titlecase}}</span>
<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.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> <span *ngIf="master.pd_status==pdStatusCheck.QC_COMPLETED " style="text-align:left">QC Completed</span>
</button>&nbsp;&nbsp; </button>&nbsp;&nbsp;
<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)="editPdMaster(master)" style="cursor: not-allowed !important;"><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> <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.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> <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>

View File

@ -46,6 +46,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
"QC_COMPLETED" :'QC_COMPLETED', "QC_COMPLETED" :'QC_COMPLETED',
}; };
mandatoryFieldsValidations: any=[];
// @Input() childData: string; // @Input() childData: string;
// @Output() loadParent = new EventEmitter<string>(); // @Output() loadParent = new EventEmitter<string>();
public _EditPDtriggerForm:FormGroup; public _EditPDtriggerForm:FormGroup;
@ -70,13 +72,10 @@ 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; let masterData: any = data.records.pd_master_details;
this.pdMasterData = Object.keys(data.records.pd_master_details).map(function (key) this.pdMasterData.push(masterData[0]);
{ this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
return data.records.pd_master_details[key]; this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
});
// console.log(this.pdMasterData);
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;
this.masterPdLogsData=data.records.pd_logs.master; this.masterPdLogsData=data.records.pd_logs.master;
@ -233,6 +232,30 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.router.navigate([ '../../pdRecord',pdID], { relativeTo: this.route }); this.router.navigate([ '../../pdRecord',pdID], { relativeTo: this.route });
} }
// direct trigger the pd
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) { // updateViewComponent(editBack:string) {
// if(editBack=='1'){ // if(editBack=='1'){