Fairoj: Flow changes and excel reupload feature added

This commit is contained in:
venbatechnologies@gmail.com 2021-02-02 18:41:36 +05:30
parent 10f664e22b
commit 7dc6fdab84
16 changed files with 360 additions and 71 deletions

View File

@ -218,7 +218,7 @@ private handleError<T> (operation = 'operation', error?: T) {
}
else if(error.status == 0){
console.log("NO Internet")
this.router.navigate(['/error/404']);
// this.router.navigate(['/error/404']);
}
else{
// alert("Please Check your Internet connection");

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { MatDialogRef, MatSnackBar } from '@angular/material';
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialogRef, MatSnackBar, MAT_DIALOG_DATA } from '@angular/material';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@ -13,7 +13,7 @@ export class ExcelUploadDialogComponent implements OnInit {
sheetBufferRender: File;
constructor(private snackBar:MatSnackBar,private loaderService:LoaderService,private _pdService:PdTrigerService,
private dialogRef:MatDialogRef<ExcelUploadDialogComponent>) { }
private dialogRef:MatDialogRef<ExcelUploadDialogComponent>, @Inject(MAT_DIALOG_DATA)public data:any) { }
ngOnInit() {
}
@ -68,7 +68,8 @@ export class ExcelUploadDialogComponent implements OnInit {
return;
}
this.loaderService.showMatSpinnerDialog("Upload is in progress.. Please wait..")
this._pdService.uploadSMCDataFile(this.sheetBufferRender).subscribe(res=>{
let pd_id = this.data && this.data.hasOwnProperty('pd_id') ? this.data.pd_id : null
this._pdService.uploadSMCDataFile(this.sheetBufferRender,pd_id).subscribe(res=>{
if(res['dataStatus']) {
this.dialogRef.close(res)
}

View File

@ -74,7 +74,7 @@
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/>
<div class="example-container">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' || LenderRoleID == '27' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<!--Start Mobile View Code-->
<!-- <div (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" class="webhide"> -->
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
@ -165,7 +165,7 @@
</span><br/>
<span class="fontsize" style="font-weight: bold;font-size: 1.1rem;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</span>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED'">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' || LenderRoleID == '27'">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">

View File

@ -56,6 +56,7 @@ export class AllPdComponent implements OnInit, OnChanges {
user_id: any;
constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService,
private _aws:AwsService) {
this.LenderRoleID = localStorage.getItem('LenderRoleID');
this.notifier = notifier;
this.searchForm = this._fb.group(
@ -99,9 +100,11 @@ export class AllPdComponent implements OnInit, OnChanges {
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus=false;
// this.loadPDDetails();
//this.getcommonDropDown();
@ -144,6 +147,7 @@ console.log(this.displayedColumns)
// load inprogress pd list
public LenderRoleID : string = localStorage.getItem('LenderRoleID');
loadPDDetails() {
this.LenderRoleID = localStorage.getItem('LenderRoleID');
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._pd.getPdDetails(this.LenderRoleID)
.subscribe(

View File

@ -74,7 +74,7 @@
<br/>
<div class="example-container">
<!--Start Mobile View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxLayout="row wrap" *ngFor="let details of pagedList" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' || LenderRoleID == '27' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
<p class="lettericon">{{details.pd_sno_split.lender_name}}<br/>
<span style="font-size: 90%">{{details.pd_sno_split.serial_no}}</span></p>
@ -157,7 +157,7 @@
</span><br/>
<span class="fontsize" style="font-weight: bold;font-size: 1.1rem;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</span>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED'">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' || LenderRoleID == '27'">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">

View File

@ -73,7 +73,7 @@
<br/>
<div class="example-container">
<!--Start Mobile View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxLayout="row wrap" *ngFor="let details of pagedList" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' || LenderRoleID == '27' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
<p class="lettericon">{{details.pd_sno_split.lender_name}}<br/>
<span style="font-size: 90%">{{details.pd_sno_split.serial_no}}</span></p>
@ -156,7 +156,7 @@
</span><br/>
<span class="fontsize" style="font-weight: bold;font-size: 1.1rem;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</span>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED'">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' || LenderRoleID == '27'">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">

View File

@ -0,0 +1,64 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" style="padding: 10px !important;">
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<!-- <button *ngIf="data.fk_pd_type == 2" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate Vendor" matTooltipPosition="above" (click)="viewVendorOfficer()"><mat-icon>verified_user</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="closeAllocationComponent()" matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content class="mat-typography">
<!-- <form [formGroup]="_pdAllocationForm" (submit)="onSubmit()"> -->
<mat-list role="list" *ngIf="pdOfficerList.length > 0">
<mat-list-item role="listitem" *ngFor="let officer of pdOfficerList; let i = index">
<div fxFlex="100">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30">
<mat-radio-button color="primary" [value]="officer" (change)="selectedItem = $event.value">
{{officer.first_name}} {{officer.last_name}}
</mat-radio-button>
</div>
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30">
<span>{{officer.mobile_no}}</span>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="40" fxFlex.lg="40" fxFlex.xl="40">
<span class="view_more" (click)="viewMoreDetails(officer)" matTooltip="View More" matTooltipPosition="right">PD in hand - {{officer.count}}</span>
</div> -->
</div>
</div>
</mat-list-item>
</mat-list>
<mat-list *ngIf="pdOfficerList.length == 0">
<mat-list-item>
<p>No Credit Managers available.</p>
</mat-list-item>
</mat-list>
<!-- </form> -->
</mat-dialog-content>
<mat-dialog-actions >
<div fxFlex="50" align="left">
<p *ngIf="selectedItem">Credit Manager: {{selectedItem.first_name}}</p>
</div>
<div fxFlex="50" align="right">
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="closeAllocationComponent()" matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button> -->
<button mat-raised-button mat-icon-button (click)="updatePdOfficer(selectedItem)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
<notifier-container></notifier-container>

View File

@ -0,0 +1,23 @@
.example-full-width{
width: 100%;
}
.view_more {
cursor: pointer;
color: #e00201 !important;
// text-decoration-line: underline;
// text-decoration-style: dotted;
// font-weight: bold;
}
.text_change {
color: #e00201 !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
// padding: 10px !important;
}

View File

@ -0,0 +1,116 @@
import { Component, OnInit, Inject, ViewEncapsulation } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
// import { AllocationViewMoreComponent } from './../allocation-view-more/allocation-view-more.component';
// import { VendorPdAllocationComponent } from '../vendor-pd-allocation/VendorPdAllocationComponent';
@Component({
selector: 'app-pd-allocation',
templateUrl: './pd-allocation.component.html',
styleUrls: ['./pd-allocation.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class PdAllocationComponent implements OnInit {
public pageTitle: string = "Allocation To PD Officer";
public _pdAllocationForm: FormGroup;
public pdOfficerList: any = [];
errorMessage: any;
notifier : NotifierService;
selectedItem:any;
isDisabled: boolean;
constructor( notifier: NotifierService,
private _fb: FormBuilder,
private dialogRef: MatDialogRef<PdAllocationComponent>,
private _pd: PdTrigerService, private dialog: MatDialog,
@Inject(MAT_DIALOG_DATA) public data: any) {
console.log(data)
this.notifier=notifier;
}
ngOnInit() {
this.isDisabled=true;
console.log(this.data)
this.getPDOfficerList(this.data.pd_id);
// this._pdAllocationForm = this._fb.group({
// pd_primary_id: [null],
// allocation_id: [null],
// });
}
// convenience getter for easy access to form fields
// get readForm() { return this._pdAllocationForm.controls; }
// pd officer list
getPDOfficerList(pdID:string){
this._pd.getCMUsers(this.data.city_id).subscribe(
data => {
if (data.status == 200) {
this.pdOfficerList= data.records
}
}, error => this.errorMessage = <any> error);
}
/** To update pd officer*/
updatePdOfficer(allocateDetails:any) {
if(!allocateDetails){
this.notifier.notify('warning', 'Please Choose PD Officer.!');
}
else {
let updateData = {
"pd_id":this.data.pd_id,
// "fk_pd_allocated_to":allocateDetails.fk_user_id,
"fk_pd_allocated_to":allocateDetails.userid,
}
this._pd.updatePdOfficer(updateData).subscribe(
result => {
if (result.status == 200) {
this.notifier.notify('success', 'PD Allocated.!');
this.dialogRef.close();
}
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.!";
// this.dialogRef.close();
});
}
}
/** For Popup Close Button */
closeAllocationComponent(): void {
this.dialogRef.close();
}
// pd officer view more
// viewMoreDetails(details:any){
// if(Number(details.count) > 0) {
// const dialogSchedule = this.dialog.open(AllocationViewMoreComponent, {
// data: details,
// disableClose: true,
// position: { right: '0'},
// width:'100%',
// // hasBackdrop:false
// });
// // dialogSchedule.afterClosed()
// // .subscribe(dataresult => {
// // });
// }
// else {
// this.notifier.notify('warning', 'No PD In Hand');
// }
// }
// pd Vendor officer
viewVendorOfficer(){
this.dialogRef.close('openvendorallocation');
}
}

View File

@ -25,8 +25,8 @@ export class PdStatusChangeDialogueComponent implements OnInit {
constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef<PdStatusChangeDialogueComponent>,@Inject(MAT_DIALOG_DATA) public data: any)
{
this.notifier = notifier;
this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Allocate to Self' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : 'Change Discussion';
this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion and forwarding for Quality Check ?' : this.data.pd_status=='ALLOCATED' ? 'Do you want to allocate the PD to yourself ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : 'Change Discussion';
this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Allocate to CPA' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : 'Change Discussion';
this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion and forwarding for Quality Check ?' : this.data.pd_status=='ALLOCATED' ? 'Do you want to allocate the PD to CPA ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : 'Change Discussion';
this.enableAddonPD = false;
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;

View File

@ -42,6 +42,7 @@ export class FormComponent implements OnInit {
private pdTriggerService:PdTrigerService,
private awsService:AwsService,private loaderService:LoaderService) {
// console.log(this.pd_all_details)
// debugger;
this.form_id = 24;
this.pd_all_details.pdmaster_details=this.pd_all_details.pdmaster_details[0]
this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id;
@ -135,10 +136,17 @@ export class FormComponent implements OnInit {
// this.commonFormGroup.patchValue(formValues)
}
}
if(this.pd_all_details.pdmaster_details.re_uploaded == '1' && this.pd_all_details.is_reupload_data_fetched != '1') {
console.log("Reuploaded excel")
// let data = {"permanant_employees_person_met":"1","temporary_employees_person_met":"2","permanant_employees_cm":"3","temporary_employees_cm":"45","permanant_employees_salary":"55","temporary_employees_salary":"55","common_remarks":"dummy datas"}
// setTimeout(()=>{
// this.commonFormGroup.patchValue(data)
// },1000)
this.getExcelData(1)
}
})
}
getExcelData() {
getExcelData(re_uploaded?) {
let params = {"pd_id":this.pd_all_details.pdmaster_details.pd_id,"random_string":this.pd_all_details.pdmaster_details.random_string,"form_id":this.pd_all_details.form_id}
this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{
if(result['dataStatus']) {
@ -153,10 +161,15 @@ export class FormComponent implements OnInit {
// })
console.log(formValues)
// debugger;
if(re_uploaded && re_uploaded == '1') {
this.commonFormGroup.patchValue(formValues)
}
else {
this.form_answers= formValues
setTimeout(()=>{
this.form_answers = null
},2500)
}
// this.commonFormGroup.patchValue(formValues)
}
}
@ -278,7 +291,10 @@ export class FormComponent implements OnInit {
return;
}
this.loaderService.showMatSpinnerDialog('')
let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id,"json":this.commonFormGroup.getRawValue(),createdby:''}
let params :any = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id,"json":this.commonFormGroup.getRawValue(),createdby:''}
if(this.pd_all_details.pdmaster_details.re_uploaded == '1') {
params.is_reupload_data_fetched = '1'
}
this.pdTriggerService.saveSMCCreditPDsection(params).subscribe(result=>{
if(result['dataStatus']) {
this.notifier.notify("success","Saved successfully..")

View File

@ -196,6 +196,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
this.pdFullDetails.pdmaster_details.curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status
this.pdFullDetails.form_id= this.selectedFormsCategory.fk_form_id
this.pdFullDetails.is_answered = this.selectedFormsCategory.is_answered
this.pdFullDetails.is_reupload_data_fetched = this.selectedFormsCategory.is_reupload_data_fetched
console.log(this.pdFullDetails);
let componen_name:any = FormComponent
if(this.pdFullDetails.form_id == '20') {

View File

@ -21,6 +21,10 @@
<mat-icon>videocam</mat-icon>&nbsp;
<strong>Call</strong>
</button>
<button mat-stroked-button class="mr-1 mb-1" color="primary" (click)="openExcelUpload()" *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '26'" >
<mat-icon>upload_file</mat-icon>&nbsp;
<strong>Upload Excel</strong>
</button>
<button mat-raised-button class="mr-1 mb-1" color="primary" style="cursor: not-allowed !important;">
<strong> {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Addon Pending' : master.pd_status | titlecase}}</strong>
</button>
@ -192,9 +196,10 @@
</div>
<div fxFlex="60" 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> -->
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"> <button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && master.pd_type_name && addresses.addtional_pd_data[0].pd_status == pdStatusCheck.ALLOCATED" 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>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.BOUNCED || currentPDStatus == pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation()"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><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.TRIGGERED" 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="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" 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>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID == '27'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.BOUNCED || currentPDStatus == pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="selfAllocation(addresses.fk_city)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID == '26' && userId == master.fk_pd_allocated_to"><button *ngIf="addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to CPA" matTooltipPosition="above" (click)="allocateToCpa()"><mat-icon>swap_vert</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><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 && (LenderRoleID == '27' || currentPDStatus!=pdStatusCheck.TRIGGERED)" 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>
</div>
</div>
</div>
@ -234,7 +239,7 @@
</div>
<div fxFlex="60" align="right">
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"> <button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && master.pd_type_name && addresses.addtional_pd_data[0].pd_status == pdStatusCheck.ALLOCATED" 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>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.BOUNCED || currentPDStatus == pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation()"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && LenderRoleID != '26'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.BOUNCED || currentPDStatus == pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation()"><mat-icon>verified_user</mat-icon></button></span>
<!-- <span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10 "><button *ngIf="roleAccessDetails.schedule && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.COMPLETED && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.ADD_ON_PENDING && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master,addresses)"><mat-icon>schedule</mat-icon></button></span> -->
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><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.TRIGGERED" 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>
</div>

View File

@ -5,9 +5,8 @@ import { MatDialog } from '@angular/material';
import { DatePipe } from '@angular/common';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
// import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component';
import { TelePdAllocationComponent } from './../tele-pd-allocation/tele-pd-allocation.component';
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
import { ListPdComponent } from '../list-pd.component';
// import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component';
import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component';
@ -20,6 +19,7 @@ import { InitiateAdditionalPdComponent } from './../initiate-additional-pd/initi
import Swal from 'sweetalert2';
import { VideoPlayerComponent } from 'app/video-player/video-player.component';
import { AwsService } from 'app/AwsService/aws.service';
import { ExcelUploadDialogComponent } from '../add-pd/excel-upload-dialog/excel-upload-dialog.component';
@Component({
selector: 'app-view-pd',
@ -123,6 +123,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// }
]
};
userId: any;
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent,
@ -133,6 +134,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.userId = this._aws.getlocale()
this.ListPdComponent.showListView(false);
this.route.params.subscribe(params => {
this.viewID = params['pdid'];
@ -504,46 +506,68 @@ else {
}
/** To update pd officer*/
selfAllocation() {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' },
selfAllocation(city_id) {
const dialogRef1 = this.dialog.open(PdAllocationComponent, {
data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly',city_id:city_id },
disableClose: true,
minWidth: '30%',
// maxWidth: '40%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if (dataresult.update_status == true) {
})
dialogRef1.afterClosed().subscribe(rr=>{
this.notifier.notify("success","Allocated Successfully")
})
// return;
let user_id = this._aws.getlocale();
if(!user_id) {
this.notifier.notify('error',"Something went wrong. Try again!!");
return;
}
let updateData = {
"pd_id":this.viewID,
"fk_pd_allocated_to":user_id,
}
this._pd.updatePdOfficer(updateData).subscribe(
result => {
if (result.status == 200) {
this.notifier.notify('success', 'PD Allocated Successfully.!');
this.viewPdDetails(this.viewID)
}
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.!";
// this.dialogRef.close();
});
}
});
// const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
// data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' },
// disableClose: true,
// minWidth: '30%',
// // maxWidth: '40%',
// });
// dialogRef.afterClosed()
// .subscribe(dataresult => {
// if (dataresult.update_status == true) {
// // return;
// let user_id = this._aws.getlocale();
// if(!user_id) {
// this.notifier.notify('error',"Something went wrong. Try again!!");
// return;
// }
// let updateData = {
// "pd_id":this.viewID,
// "fk_pd_allocated_to":user_id,
// }
// this._pd.updatePdOfficer(updateData).subscribe(
// result => {
// if (result.status == 200) {
// this.notifier.notify('success', 'PD Allocated Successfully.!');
// this.viewPdDetails(this.viewID)
// }
// 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.!";
// // this.dialogRef.close();
// });
// }
// });
}
openExcelUpload() {
const dialogRef = this.dialog.open(ExcelUploadDialogComponent,{
data:{pd_id:this.viewID},
minWidth:'50vw',
maxWidth:'75vw'
})
dialogRef.afterClosed().subscribe(rr=>{
if(rr.dataStatus) {
this.notifier.notify("success","Uploaded Successuflly")
}
})
}
rejectPD() {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid: this.viewID, pd_status: this.pdStatusCheck.BOUNCED,random_string:this.pdMasterData[0].random_string },
@ -559,6 +583,32 @@ else {
}
});
}
allocateToCpa() {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' },
disableClose: true,
minWidth: '30%',
// maxWidth: '40%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if (dataresult.update_status == true) {
// return;
let lenderMasterArray = { "pd_id": this.viewID,random_string:this.masterRandomString }
this._pd.editPdMasterDetails(lenderMasterArray, this.pdStatusCheck.TRIGGERED).subscribe(result => {
if (result.status == 200) {
this.notifier.notify('success', 'Updated successfully.');
this.viewPdDetails(this.viewID);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
});
}
// updateViewComponent(editBack:string) {

View File

@ -127,6 +127,7 @@ import { ExcelUploadDialogComponent } from './list-pd/add-pd/excel-upload-dialog
import { SpeedDialFabComponent } from './list-pd/view-pd/speed-dial-fab/speed-dial-fab.component';
import { VideoPlayerComponent } from 'app/video-player/video-player.component';
import { MatVideoModule } from 'mat-video';
import { PdAllocationComponent } from './list-pd/pd-allocation/pd-allocation.component';
/**
* Custom angular notifier options
@ -174,7 +175,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
@NgModule({
declarations: [TelePdAllocationComponent, ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, PdReportComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, DeleteRecordsCountPipe, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent, ExcelUploadDialogComponent,
SpeedDialFabComponent,VideoPlayerComponent],
SpeedDialFabComponent,VideoPlayerComponent,PdAllocationComponent],
imports: [
CommonModule,
ManagePdRoutingModule,
@ -216,7 +217,8 @@ const pdCustomNotifierOptions: NotifierOptions = {
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective],
entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent,VideoPlayerComponent],
entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent,VideoPlayerComponent,
PdAllocationComponent],
})
export class ManagePdModule {
}

View File

@ -175,9 +175,9 @@ export class PdTrigerService {
const Lender:any = entity_id ?
{ params: new HttpParams().set('lenderid', entity_id) } :
{ };
if(LenderRoleID == '25') {
// if(LenderRoleID == '25') {
Lender.params = Lender.params.set('createdby',userid)
}
// }
return this._http.get<any>(this.apiUrl + "listLessPDDetails/get",Lender)
.pipe(
catchError(this.handleError('operation', []))
@ -198,9 +198,9 @@ export class PdTrigerService {
// { params: new HttpParams().set('createdby', userid) };
let paramHttp:any= entity_id && status ?
{params : new HttpParams().set('lenderid', entity_id).set('status',status)} : {};
if(LenderRoleID == '25') {
// if(LenderRoleID == '25') {
paramHttp.params = paramHttp.params.set('createdby',userid)
}
// }
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", paramHttp)
.pipe(
catchError(this.handleError('operation', []))
@ -656,9 +656,9 @@ export class PdTrigerService {
overAllSearchFormDetails(searchItem) {
let LenderRoleID : any = localStorage.getItem('LenderRoleID');
let userid=this._aws.getlocale()
if(LenderRoleID == '25') {
// if(LenderRoleID == '25') {
searchItem.createdby = userid
}
// }
let records = { 'records': searchItem };
return this._http.post(this.apiUrl + 'filterPDList', records).pipe(
catchError(this.handleError('operation', []))
@ -813,8 +813,12 @@ checkExistPDDetails(datas,entity_id){
return this._http.post(this.apiUrl+'checkExistPDDetails',{records:datas,client:entity_id})
.pipe(catchError(this.handleError("checkExistPDDetails",[])))
}
uploadSMCDataFile(file) {
let records = {"rand_key":"qwerty1234"}
uploadSMCDataFile(file,pd_id ?) {
// let records = {"rand_key":"qwerty1234"}
let records :any= {}
if(pd_id) {
records.fk_pd_id = pd_id
}
let formData= new FormData()
formData.append("pd_excel_data",file)
formData.append("records",JSON.stringify(records))
@ -881,6 +885,9 @@ loadTemplate(form_id) {
return this._http.post(this.apiUrl+'updateTwlioVideoStatus',params)
.pipe(catchError(this.handleError("updateTwlioVideoStatus",[])))
}
getCMUsers(city_id):Observable<any> {
let param = new HttpParams().set('city_id',city_id)
return this._http.get(this.apiUrl+"getCMUsers",{params:param})
}
}