LIve issues fixes : ps
This commit is contained in:
parent
33dff7b464
commit
1d286555a4
@ -26,12 +26,10 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
usertype: string;
|
||||
vendorOfficerList: any;
|
||||
errorMessage: any;
|
||||
updateData: {
|
||||
pd_id: any;
|
||||
// "fk_pd_allocated_to":allocateDetails.fk_user_id,
|
||||
fk_pd_allocated_to: any; pd_agency_id: any;
|
||||
};
|
||||
|
||||
updateData:any = {};
|
||||
public userRoleID = +localStorage.getItem('user_role');
|
||||
public userID = +localStorage.getItem('userid');
|
||||
|
||||
constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef<PdStatusChangeDialogueComponent>,@Inject(MAT_DIALOG_DATA) public data: any)
|
||||
{
|
||||
this.notifier = notifier;
|
||||
@ -41,6 +39,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true;
|
||||
this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false;
|
||||
this.dialogType = this.data.dialogType;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -76,8 +75,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
|
||||
this.pd.getvendorlist(this.data.state_id).subscribe(
|
||||
list => {
|
||||
console.log('list');
|
||||
console.log(list);
|
||||
// console.log('getSmcVendorPdOfficerList1 fns entered result => ',list);
|
||||
if(list['status'] == '200') {
|
||||
this.vendorOfficerList= list['records']
|
||||
|
||||
@ -95,14 +93,15 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
|
||||
changePDStatus(status: string,pdid): void {
|
||||
let pd=pdid;
|
||||
// console.log(status);
|
||||
// //return;
|
||||
// console.log("At changePDStatus fns, Status = ",status);
|
||||
this.usertype=localStorage.getItem('usertype');
|
||||
console.log(this.dialogType,this.enableAddonPD)
|
||||
// console.log("Dialog Type = ",this.dialogType);
|
||||
// console.log("enableAddonPD = ",this.enableAddonPD);
|
||||
if(this.dialogType == 'actionOnly' && !this.enableAddonPD) {
|
||||
this.dialogRef.close({update_status:true});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(this.usertype=='true')
|
||||
{
|
||||
@ -112,8 +111,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
"random_string":this.data.random_string
|
||||
};
|
||||
this.pd.updateVendorStatus(update_status, status).subscribe(result => {
|
||||
console.log('result');
|
||||
console.log(result);
|
||||
// console.log('updateVendorStatus api Result = ',result);
|
||||
if (result.status == 200) {
|
||||
this.dialogRef.close({update_status:true});
|
||||
this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :'Discussions Updated Successfully');
|
||||
@ -149,10 +147,6 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
}
|
||||
if(status=='INPROGRESS')
|
||||
{
|
||||
this.selfallocate(pd);
|
||||
}
|
||||
}
|
||||
selfallocate(pd)
|
||||
{
|
||||
@ -160,9 +154,12 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
this.updateData = {
|
||||
"pd_id":pd,
|
||||
"fk_pd_allocated_to":localStorage.getItem('userid'),
|
||||
"pd_agency_id":localStorage.getItem('user_role')=='28'|| localStorage.getItem('user_role')=='29'?localStorage.getItem('smc_agency_id'):localStorage.getItem('user_role')
|
||||
}
|
||||
console.log(this.updateData);
|
||||
if((localStorage.getItem('smc_agency_id') != "") && (this.userRoleID==28|| this.userRoleID==29)){
|
||||
this.updateData.pd_agency_id =localStorage.getItem('smc_agency_id');
|
||||
}
|
||||
// else{ this.notifier.notify('warning', 'agency-id not available');}
|
||||
|
||||
// return
|
||||
this.pd.updatePdOfficer(this.updateData).subscribe(
|
||||
result => {
|
||||
@ -184,4 +181,4 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -205,19 +205,15 @@
|
||||
|
||||
<div fxLayout="row nowrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
<div *ngIf="is_agency_logged_in == false" fxFlex="100" align="left" style="color: #e00201">
|
||||
<div *ngIf="is_agency_logged_in == false" fxFlex="38" align="left" style="color: #e00201">
|
||||
{{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status==pdStatusCheck.ALLOCATED_TO_FIA ?'Allocated to vendor':master.pd_status | titlecase}}
|
||||
</div>
|
||||
<div *ngIf="is_agency_logged_in == true" fxFlex="100" align="left" style="color: #e00201">
|
||||
<div *ngIf="is_agency_logged_in == true" fxFlex="38" align="left" style="color: #e00201">
|
||||
{{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status==pdStatusCheck.ALLOCATED_TO_FIA ?'Allocated to vendor':master.pd_status | titlecase}}
|
||||
<br>
|
||||
<p style="color:blue;font-size: small;">{{(master.vendor_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : (master.vendor_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.vendor_status)) | titlecase}}</p>
|
||||
</div>
|
||||
</div><!-- 207 closed here -->
|
||||
<!-- </div>
|
||||
<div fxLayout="row nowrap"> -->
|
||||
<div fxFlex="100" align="right">
|
||||
<div fxFlex="62" align="right">
|
||||
<!-- <span><button *ngIf="roleAccessDetails.trigger && addresses.assigned_pd==null || addresses.assigned_pd==''" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" [matTooltip]="master.fk_primary_address_id ? 'Initiate PD for this address' : 'Initiate Address for PD Process'" matTooltipPosition="above" (click)="initiateAddtionalPD(master,addresses,master.fk_primary_address_id ? true : false)"><mat-icon>where_to_vote</mat-icon></button></span> -->
|
||||
<!-- {{userId == master.fk_pd_allocated_to}} -->
|
||||
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && userId == master.fk_pd_allocated_to"> <button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && master.pd_type_name && addresses.addtional_pd_data[0].pd_status == pdStatusCheck.ALLOCATED || currentPDStatus!=pdStatusCheck.CANCELLED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Reject" matTooltipPosition="above" (click)="rejectPD()"><mat-icon>settings_backup_restore</mat-icon></button></span>
|
||||
@ -228,9 +224,10 @@
|
||||
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.ALLOCATED || currentPDStatus == pdStatusCheck.INPROGRESS)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Send back to CPA" matTooltipPosition="above" (click)="allocateToCpa()"><mat-icon>swap_vert</mat-icon></button></span>
|
||||
<span *ngIf="is_agency_logged_in == false && master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.BOUNCED && currentPDStatus!=pdStatusCheck.CANCELLED && (LenderRoleID == '27' || LenderRoleID == '28'||currentPDStatus!=pdStatusCheck.TRIGGERED)||LenderRoleID == '29'" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
|
||||
<span *ngIf="is_agency_logged_in == true && master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '29' || userId == master.fk_pd_allocated_to && currentVendorStatus!='QC COMPLETED')"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].vendor_status!=pdStatusCheck.DRAFT && currentVendorStatus!=pdStatusCheck.BOUNCED && currentVendorStatus!='QC COMPLETED'&& (LenderRoleID == '27' || LenderRoleID == '28'||currentVendorStatus!=pdStatusCheck.TRIGGERED)|| currentPDStatus!=pdStatusCheck.CANCELLED || LenderRoleID == '29'" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].vendor_status)"><mat-icon>question_answer</mat-icon></button></span>
|
||||
<span *ngIf="currentPDStatus!=pdStatusCheck.CANCELLED && currentPDStatus != pdStatusCheck.ALLOCATED_TO_FIA"><button mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Cancel PD" matTooltipPosition="above" (click)="cancelPD(addresses)"><mat-icon>cancel_presentation</mat-icon></button></span>
|
||||
<span *ngIf="((currentPDStatus!=pdStatusCheck.CANCELLED) && (currentVendorStatus != pdStatusCheck.CANCELLED)) && (userRoleID == '28' || userRoleID == '26' || userRoleID == '27') "><button mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Cancel PD" matTooltipPosition="above" (click)="cancelPD(addresses)"><mat-icon>cancel_presentation</mat-icon></button></span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- div @207 closed here -->
|
||||
</div><!-- div @206 closed here -->
|
||||
<div fxLayout="row nowrap">
|
||||
<div fxFlex="100">
|
||||
<div fxFlex="100" align="left" style="color: #e00201">
|
||||
|
||||
@ -147,7 +147,6 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
ngOnInit() {
|
||||
|
||||
this.userRoleType=localStorage.getItem('user_role');
|
||||
|
||||
if(this.userRoleType=='28' || this.userRoleType=='29')
|
||||
{
|
||||
this.is_agency_logged_in=true;
|
||||
@ -358,11 +357,17 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
// start pd
|
||||
getPDStart(pdDetails: any, status: string) {
|
||||
|
||||
console.log(pdDetails);
|
||||
// console.log(pdDetails.fk_pd_id);
|
||||
// console.log('pddetails');
|
||||
// console.log("status = ",status);
|
||||
// console.log("pdDetails",pdDetails,pdDetails.fk_pd_id);
|
||||
localStorage.setItem('pdid',pdDetails.fk_pd_id)
|
||||
this.destroyType = 3;
|
||||
let doSelfAllocated = 0;/** this for flag **/
|
||||
if((status == this.pdStatusCheck.ALLOCATED || status == this.pdStatusCheck.ALLOCATED_TO_FIA) && (this.userRoleID == 27 || this.userRoleID == 28) && this.userId != pdDetails.fk_pd_allocated_to){
|
||||
/* console.log("if for flag",status);
|
||||
doSelfAllocated = 1;*/
|
||||
this.selfallocate(pdDetails.fk_pd_id);
|
||||
// new Promise( resolve => setTimeout(resolve, 300) );
|
||||
}
|
||||
if (status == this.pdStatusCheck.ALLOCATED || status == this.pdStatusCheck.SCHEDULED || status == this.pdStatusCheck.TRIGGERED||status == this.pdStatusCheck.ALLOCATED_TO_FIA) {
|
||||
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
|
||||
data: { pdid: pdDetails.assigned_pd, pd_status: this.pdStatusCheck.INPROGRESS,random_string:this.pdMasterData[0].random_string },
|
||||
@ -378,7 +383,6 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
this.router.navigate(['../../../startpd', pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route });
|
||||
}
|
||||
}
|
||||
@ -603,8 +607,8 @@ dialogRef1.afterClosed().subscribe(rr=>{
|
||||
}
|
||||
/** To update pd officer*/
|
||||
selfAllocation(state_id) {
|
||||
// console.log('allocate');
|
||||
// console.log(this.pdMasterData[0].fk_city);
|
||||
// console.log('selfAllocation city = ',this.pdMasterData[0].fk_city);
|
||||
// console.log(this.pdMasterData[0]);
|
||||
// return
|
||||
if((this.LenderRoleID == '27') || (this.LenderRoleID == '25') || (this.LenderRoleID == '28')){
|
||||
const dialogRef1 = this.dialog.open(PdAllocationComponent, {
|
||||
@ -717,7 +721,6 @@ dialogRef1.afterClosed().subscribe(rr=>{
|
||||
}
|
||||
|
||||
cancelPD(pdDetails: any){
|
||||
console.log("cancelPD fns entered");
|
||||
const dialogRef = this.dialog.open(PdCancellationDialogueComponent, {
|
||||
data: { pdid: pdDetails.assigned_pd, pd_status: this.pdStatusCheck.CANCELLED ,random_string:this.masterRandomString},
|
||||
disableClose: true,
|
||||
@ -743,6 +746,30 @@ dialogRef1.afterClosed().subscribe(rr=>{
|
||||
// }
|
||||
// this.viewPdDetails(this.childData);
|
||||
// }
|
||||
selfallocate(pd)
|
||||
{
|
||||
|
||||
let updateData : any = {
|
||||
"pd_id":pd,
|
||||
"fk_pd_allocated_to":localStorage.getItem('userid'),
|
||||
}
|
||||
console.log('updateData obj gotten -> ',updateData);
|
||||
// return
|
||||
this._pd.updatePdOfficer(updateData).subscribe(
|
||||
result => {
|
||||
if (result.status == 200) {
|
||||
this.notifier.notify('success', 'Self Allocated.!');
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
|
||||
this.errorMessage = "Something Went Wrong Try Again.!";
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.destroyType == 1) {
|
||||
this.ListPdComponent.pdListLoad(true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user