url-random string changes

This commit is contained in:
venbatechnologies@gmail.com 2019-07-10 18:28:04 +05:30
parent 8100012549
commit 83dc38377e
38 changed files with 402 additions and 183 deletions

View File

@ -1,10 +1,11 @@
<div class="pad-wrap" [style.minHeight]="'100%'">
<div fxFlex.gt-sm="100" fxFlex.gt-xs="100" fxFlex="100">
<mat-card>
<mat-card *ngIf="access; else unauthorized;">
<mat-card-title style="background-color:#e00201;padding: 23px;">
{{dashboardTitle}}
</mat-card-title>
<mat-card-content>
<!-- -->
<div fxFlex="row">
<div fxFlex="100">
<div fxFlex="50" align="center" *ngIf="total1 != 0">
@ -156,10 +157,24 @@
</div>
</div>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
<ng-template #unauthorized>
<div class="relative">
<div class="form-back">
<div class="relative error-wrapper">
<mat-icon class="error-icon" style="color:red;">notification_important</mat-icon>
<h1 style="color:red;"> Permissions Deined! </h1>
<span class="error-text" style="color:red;">401</span>
<h2 style="color:red;"> Unauthorized access </h2>
<div class="error-details" style="color:red;">
<p>Sorry, but the page you were trying to view does not exist</p>
</div>
</div>
</div>
</div>
</ng-template>
</div>
</div>

View File

@ -13,4 +13,24 @@ mat-card-content{
width: 125px;
text-align: center;
margin: 1px;
}
}
/* Error Text Font Size*/
.error-text{
font-size: 6rem !important;
}
.error-wrapper{
padding-top: 2rem !important;//default is 5 rem
}
.error-icon{
width: 100px;
font-size: 79px !important;
}
.form-back{
background-position: top center;
min-height: calc(100vh + 100px);
height: auto;
background-color: #fff !important;
color:red !important;
}

View File

@ -15,7 +15,8 @@ import { BaseChartDirective } from 'ng2-charts/ng2-charts';
export class DashboardComponent {
dashboardTitle = 'PD Status';
dashboardTitle : any = 'PD Status';
access : boolean;
/** Declaration Part Of Doughnut Chart */
doughnutChartLabels: string[] = ['Triggered','Allocated','Scheduled','InProgress','Completed','QC Completed'];
@ -31,6 +32,8 @@ export class DashboardComponent {
total1: number = 0;
total2: number = 0;
total3: number = 0;
public userRoleID = +localStorage.getItem('user_role');
// doughnutChartColors: any[] = [{
// backgroundColor: ['#c1c1c1','#f44336','#ffa500','#ffeb3b','#3f51b5','#00ff00','#4caf50']
@ -42,7 +45,8 @@ export class DashboardComponent {
ngOnInit(){
// console.clear();
this.getDoughnutChartData();
this.access = this.userRoleID == 3 || this.userRoleID == 4 || this.userRoleID == 6 ? false : true;
this.getDoughnutChartData();
}

View File

@ -33,7 +33,7 @@
</a>-->
</div>
</div>
<mat-nav-list appAccordion class="navigation relative">
<mat-nav-list appAccordion class="navigation relative" *ngIf="permissionDeined">
<mat-list-item appAccordionLink *ngFor="let menuitem of menuItems.getAll() | roleMenuItems:'2'">
<a appAccordionToggle class="relative" mat-ripple [routerLink]="['/', menuitem.state]" *ngIf="menuitem.type === 'link'">
@ -215,7 +215,7 @@
Calendar Settings
</button>
</mat-menu> -->
<button (click)="end.toggle()" matTooltip="Notifications" matTooltipPosition="below" mat-icon-button class="ml-xs overflow-visible">
<button *ngIf="permissionDeined" (click)="end.toggle()" matTooltip="Notifications" matTooltipPosition="below" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>notifications</mat-icon>
<!-- <span class="notification-label">2</span> -->
<span *ngIf="alertCount != 0" style = "width:23px" class="notification-label">{{alertCount}}</span>
@ -306,7 +306,7 @@
Calendar Settings
</button>
</mat-menu> -->
<button (click)="end.toggle()" mat-icon-button class="ml-xs overflow-visible">
<button *ngIf="permissionDeined" (click)="end.toggle()" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>notifications</mat-icon>
<span *ngIf="alertCount != 0" style = "width:23px" class="notification-label" >{{alertCount}}</span>
</button>

View File

@ -50,7 +50,9 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
alertMsgTriggerType : any[];
alertMsgAllocateType : any[];
alertCount: any;
userRoleType: String;
userRoleType: String;
permissionDeined : boolean;
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService) {
const browserLang: string = translate.getBrowserLang();
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
@ -106,6 +108,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
ngOnInit(): void {
this.userRoleType=localStorage.getItem('user_role');
this.permissionDeined = this.userRoleType == '3' || this.userRoleType == '4' || this.userRoleType == '6' ? false : true;
// console.clear();
const elemSidebar = <HTMLElement>document.querySelector('.sidebar-container ');

View File

@ -11,14 +11,17 @@ export class RoleMenuItemsPipe implements PipeTransform {
switch(localStorage.getItem('user_role')){
case '1': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
case '2': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
case '3': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
case '4': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="reports");
case '3': return;
case '4': return;
case '5': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="reports");
case '6': return value.filter(val=>val.state!="settings" && val.state!="personal_discussion" && val.state!="reports");
case '6': return;
case '7': return value.filter(val=>val.state!="settings" && val.state!="personal_discussion" && val.state!="reports");
case '8': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
case '9': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
case '10': return value;
// case '3': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
// case '4': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="reports");
// case '6': return value.filter(val=>val.state!="settings" && val.state!="personal_discussion" && val.state!="reports");
// default: return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
}
}

View File

@ -130,7 +130,7 @@
<mat-icon>my_location</mat-icon>
</button>
</a>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)"
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)"
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>

View File

@ -35,7 +35,8 @@ export class AllPdComponent implements OnInit, OnChanges {
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
// @Output() loadPdView = new EventEmitter<string>();
@Output() loadPdView = new EventEmitter<any>();
// data source variable details
PdListData:any[] = [];
@ -105,9 +106,11 @@ export class AllPdComponent implements OnInit, OnChanges {
pageChange(e) {
console.log(e);
}
viewPD(pdid:string){
this.loadPdView.next(pdid);
viewPD(pdid:string,randomString){
console.log(pdid,randomString);
let pdidwithRandomString = {'id':pdid,'string': randomString};
console.log(pdidwithRandomString);
this.loadPdView.emit(pdidwithRandomString);
}
titleCaseWord(word:string) {

View File

@ -111,7 +111,8 @@
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)" matTooltip="View"
<!-- <button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)" -->
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" matTooltip="View"
matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>

View File

@ -35,7 +35,8 @@ export class CompletedPdComponent implements OnInit, OnChanges {
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
@Output() loadPdView = new EventEmitter<any>();
// data source variable details
completedPdListData:any[] = [];
@ -108,9 +109,15 @@ export class CompletedPdComponent implements OnInit, OnChanges {
pageChange(e) {
console.log(e);
}
viewPD(pdid:string){
this.loadPdView.next(pdid);
// viewPD(pdid:string){
// this.loadPdView.next(pdid);
// }
viewPD(pdid:string,randomString){
console.log(pdid,randomString);
let pdidwithRandomString = {'id':pdid,'string': randomString};
console.log(pdidwithRandomString);
this.loadPdView.emit(pdidwithRandomString);
}
titleCaseWord(word:string) {

View File

@ -5,6 +5,7 @@ import { CustomValidators } from 'ng2-validation';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
import { TitleCasePipe } from '@angular/common';
import { getRandomString } from 'selenium-webdriver/safari';
@Component({
selector: 'app-edit-pd-master',
@ -42,6 +43,8 @@ export class EditPdMasterComponent implements OnInit {
public _EditPDtriggerForm:FormGroup;
public notifier: NotifierService;
addresses: FormArray;
public masterRandomString : string;
// create values for status check
pdStatusCheck :any={
@ -62,6 +65,7 @@ export class EditPdMasterComponent implements OnInit {
this.notifier=notifier
this.currentPDStatus = data.records.pd_status;
this.pdid = data.records.pd_id;
this.masterRandomString = data.records.random_string;
this.disableAfterSubmit = false;
}
@ -573,7 +577,8 @@ export class EditPdMasterComponent implements OnInit {
}
this.disableAfterSubmit = true;
this._pd.editPdMasterDetails(lenderMasterArray, updateStatus).subscribe(result => {
console.log('this.masterRandomString',this.masterRandomString);
this._pd.editPdMasterDetails(lenderMasterArray, updateStatus,this.masterRandomString).subscribe(result => {
if (result.status == 200) {
this.disableAfterSubmit = false;
this._pd.updatePDAddress(my_array.addresses).subscribe(result => {

View File

@ -15,11 +15,13 @@ export class InitiateAdditionalPdComponent implements OnInit {
additionalPDForm:FormGroup;
customerSegmentList: any=[];
applicantList: any =[];
MasterRandomString : string;
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<InitiateAdditionalPdComponent>) {
this.notifier = notifier;
this.pageTitle="Choose customer segment For this PD address"
this.applicantList = this.data.applicants_details;
this.applicantList = this.applicantList.filter(appt => appt.applicant_type != 2 && appt.applicant_type != 3);
this.MasterRandomString = this.data.random_string;
}
ngOnInit() {
@ -85,7 +87,8 @@ submitDetails(values: any) {
"pd_status":"TRIGGERED",
"parent_pd_id":values.parent_pd_id,
"fk_customer_segment":values.fk_customer_segment ,
"fk_primary_address_id":values.fk_address_id};
"fk_primary_address_id":values.fk_address_id,
"random_string":this.MasterRandomString};
}
this._pd.initiateAddressPdProcess(update_details).subscribe(data => {

View File

@ -108,7 +108,7 @@
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)" matTooltip="View" matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" matTooltip="View" matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">

View File

@ -33,7 +33,7 @@ export class InprogressPdComponent implements OnInit, OnChanges {
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
@Output() loadPdView = new EventEmitter<any>();
// data source variable details
progressPdListData:any[] = [];
@ -101,10 +101,18 @@ export class InprogressPdComponent implements OnInit, OnChanges {
pageChange(e) {
console.log(e);
}
viewPD(pdid:string){
this.loadPdView.next(pdid);
// viewPD(pdid:string){
// this.loadPdView.next(pdid);
// }
viewPD(pdid:string,randomString){
console.log(pdid,randomString);
let pdidwithRandomString = {'id':pdid,'string': randomString};
console.log(pdidwithRandomString);
this.loadPdView.emit(pdidwithRandomString);
}
titleCaseWord(word:string) {
if (!word) return word;
return word[0].toUpperCase() + word.substr(1).toLowerCase();

View File

@ -77,16 +77,19 @@ export class ListPdComponent implements OnInit, OnDestroy {
this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.scheduledTabC.loadPDDetails() : this.getTabIndex==2 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==3 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails();
}
viewPDDetails(pdid:string){
viewPDDetails(event){
console.log('after clicking view icon',event)
let pdid = event.id;
let rdmstr = event.string;
console.log("pdid = " + event.id);
console.log("randomString = " + event.string);
this.viewPdList = !this.viewPdList;
this.router.navigate([ '../pdlist/viewpd',pdid], { relativeTo: this.route });
this.router.navigate([ '../pdlist/viewpd',pdid,rdmstr], { relativeTo: this.route });
}
//get tab changes
onTabClick(event: MatTabChangeEvent) {
this.getTabIndex=event.index;
this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.scheduledTabC.loadPDDetails() : this.getTabIndex==2 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==3 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails();
}
ngOnDestroy(): void {

View File

@ -35,6 +35,7 @@ export class PdReportComponent implements OnInit {
public generateBtn: Boolean = false;
public reGenerateBtn: Boolean = false;
public pdReportVersionList = [];
public masterRandomString : string;
// public src;
pdReportRecords: any;
latestPDDetails: any;
@ -45,6 +46,7 @@ export class PdReportComponent implements OnInit {
private router: Router, public pdTrigerService: PdTrigerService, private listPDComponent: ListPdComponent,
private dialog: MatDialog, private sanitizer: DomSanitizer) {
this.startPD = this.route.snapshot.params['pdid'];
this.masterRandomString = this.route.snapshot.params['rdmstr'];
this.notifier = notifier;
// this.src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T073026Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=35aa183cbbfc835f96719a5e9aa552c79b3a1b7d8bca043f7d738d730755dcbb';
// this.src = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b");
@ -94,7 +96,8 @@ export class PdReportComponent implements OnInit {
reGeneratePFReport() {
let data = {
"pd_id": this.startPD,
"regenerate": "1"
"regenerate": "1",
// "random_string":this.masterRandomString,
};
this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data => {
if (data.dataStatus) {
@ -109,7 +112,8 @@ export class PdReportComponent implements OnInit {
}
generateNewPDReport() {
let data = {
"pd_id": this.startPD
"pd_id": this.startPD,
// "random_string":this.masterRandomString,
};
this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data => {
if (data.dataStatus) {
@ -145,7 +149,7 @@ export class PdReportComponent implements OnInit {
}
getPdReportDetails() {
this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => {
this.pdTrigerService.getPdFinalReportDetails(this.startPD,this.masterRandomString).subscribe(data => {
if (data.status == 200) {
// this.pdReportRecords = data.records.question_answers;
this.pdReportRecords = data.records;
@ -190,7 +194,7 @@ export class PdReportComponent implements OnInit {
reportReview(status): void {
const dialogRef = this.dialog.open(QcReviewComponent, {
data: { startId: this.startPD, data_status: status },
data: { startId: this.startPD, data_status: status ,random_string:this.masterRandomString},
disableClose: true
});
dialogRef.afterClosed()

View File

@ -84,6 +84,7 @@ export class QcReviewComponent implements OnInit {
myClick(): void {
let template = this.ngForm.value;
template.pd_id = this.data.startId;
template.random_String = this.data.random_string;
this.pdTrigerService.pdReviewStatusUpdate(template).subscribe(data=>{
this.notifier.notify('success', 'Your Changes Updated.!');
this.dialogRef.close({

View File

@ -20,6 +20,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
CompletenessCheck: boolean;
addonStatus: string ="ADD_ON_PENDING";
public Loading: boolean;
public masterRandomString : string;
constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef<PdStatusChangeDialogueComponent>,@Inject(MAT_DIALOG_DATA) public data: any)
{
@ -29,6 +30,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
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;
this.masterRandomString = this.data.random_string;
}
ngOnInit() {
@ -61,7 +63,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
let update_status = {
"pd_id":this.data.pdid,
};
this.pd.editPdMasterDetails(update_status, status).subscribe(result => {
this.pd.editPdMasterDetails(update_status, status,this.masterRandomString).subscribe(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' ? 'Discussions Completed Successfully' : 'Discussions Updated Successfully');

View File

@ -110,7 +110,8 @@
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)" matTooltip="View" matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button>
<!-- <button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)" matTooltip="View" matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button> -->
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" color="primary" matTooltip="View" matTooltipPosition="above"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">

View File

@ -35,7 +35,7 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
@Output() loadPdView = new EventEmitter<any>();
// data source variable details
qcCompletedPdListData: any[] = [];
@ -110,9 +110,15 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
pageChange(e) {
console.log(e);
}
viewPD(pdid: string) {
this.loadPdView.next(pdid);
// viewPD(pdid: string) {
// this.loadPdView.next(pdid);
// }
viewPD(pdid:string,randomString){
console.log(pdid,randomString);
let pdidwithRandomString = {'id':pdid,'string': randomString};
console.log(pdidwithRandomString);
this.loadPdView.emit(pdidwithRandomString);
}
titleCaseWord(word: string) {
if (!word) return word;

View File

@ -111,7 +111,7 @@
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)" color="primary" matTooltip="View" matTooltipPosition="above"><mat-icon>visibility</mat-icon></button>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" color="primary" matTooltip="View" matTooltipPosition="above"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">

View File

@ -34,7 +34,7 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
@Output() loadPdView = new EventEmitter<any>();
// data source variable details
scheduledPdListData:any[] = [];
@ -108,10 +108,13 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
pageChange(e) {
console.log(e);
}
viewPD(pdid:string){
this.loadPdView.next(pdid);
viewPD(pdid:string,randomString){
console.log(pdid,randomString);
let pdidwithRandomString = {'id':pdid,'string': randomString};
console.log(pdidwithRandomString);
this.loadPdView.emit(pdidwithRandomString);
}
titleCaseWord(word:string) {
if (!word) return word;
return word[0].toUpperCase() + word.substr(1).toLowerCase();

View File

@ -597,7 +597,7 @@ export class BusinessInfoComponent implements OnInit {
// this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP' ? this.businessForm.addControl('fire_noc', new FormControl('', Validators.required)) : this.businessForm.removeControl('fire_noc');
if(data.records.gst_Regn_cert =='yes'){ this.businessForm.addControl('gst_Regn_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('gst_Regn_cert_pic');}
if(data.records.factory_cert =='yes'){ this.businessForm.addControl('factory_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('factory_cert_pic');}
if(data.records.practice_cert_cert =='yes'){ this.businessForm.addControl('practice_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('practice_cert_pic');}
if(data.records.practice_cert =='yes'){ this.businessForm.addControl('practice_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('practice_cert_pic');}
if(data.records.shop_eat_act_cert =='yes'){ this.businessForm.addControl('shop_eat_act_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('shop_eat_act_cert_pic');}
if(data.records.pf_regn =='yes'){ this.businessForm.addControl('pf_regn_pic', new FormControl('')); }else{ this.businessForm.removeControl('pf_regn_pic');}
if(data.records.esic_regn =='yes'){ this.businessForm.addControl('esic_regn_pic', new FormControl('')); }else{ this.businessForm.removeControl('esic_regn_pic');}

View File

@ -194,7 +194,7 @@
</mat-form-field>
<mat-form-field style="width:46%;">
<mat-select multiple placeholder="Name of the Owner" formControlName="owner_name"
<mat-select multiple placeholder="Name of the proposed owner" formControlName="owner_name"
[compareWith]="compareObjects">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
@ -243,6 +243,49 @@
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{ loanDetailsForm.controls['emv_per_customer'].value | numberToWords }} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="productAbbr !== 'LAP'" style="width:96%;">
<input matInput placeholder="Name of current owner(s)/ Seller(s) of the property" formControlName="property_seller"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:96%;">
<input matInput
placeholder="Address"
formControlName="address"
required autocomplete="off">
</mat-form-field>
<mat-form-field style="width:46%;">
<mat-select placeholder="State" formControlName="state"
(selectionChange)="getCityAndPincodeDetails($event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let SL of m_stateLists" [value]="SL.state_id">{{SL.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:46%;">
<mat-select placeholder="City" formControlName="city">
<mat-option> Select </mat-option>
<mat-option *ngFor="let CL of m_cityList"
[value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:46%;">
<mat-select placeholder="Pincode" formControlName="pincode">
<mat-option>Select</mat-option>
<mat-option *ngFor="let PL of m_pincodeList"
[value]="PL.pincode_id">{{PL.pincode}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:46%;" *ngIf="loanDetailsForm.controls['pincode'].value == 1">
<input matInput autocomplete="off"
placeholder="Specify Pincode *"
formControlName="other_pincode" OnlyNumber type="text">
<mat-error *ngIf="loanDetailsForm.controls['other_pincode'].hasError('required')">Pincode Required</mat-error>
</mat-form-field>
</mat-card-content>
</mat-card>
</mat-card>

View File

@ -70,6 +70,9 @@ export class LoanDetailsComponent implements OnInit {
m_statusofCunstruction = [];
m_btLenderList = [];
m_endUseOFTopUpList = [];
m_stateLists= [];
m_cityList= [];
m_pincodeList= [];
// existCompanyList: any =[];
CompanyApplicantGroupList: any = [];
CompanyApplicantGroupList2: any = [];
@ -124,6 +127,7 @@ export class LoanDetailsComponent implements OnInit {
this.getM_StatusofCunstruction();
this.getM_BTLenderList();
this.getM_EndUseofTopUpList();
this.getM_State();
// note : Details of Property being Mortgaged section, In Name of the owner drop down list currently show all names (Applicants & In Person Met) need to change show Applicant names only.
let param: any = {};
@ -291,6 +295,14 @@ export class LoanDetailsComponent implements OnInit {
// this.emvAmtInWords = this._pd.convertNumberToWords(value.records.emv_per_customer);
}
this.loanDetailsForm.controls['property_seller'].setValue(this.productAbbr != 'LAP' ? value.records.property_seller || null : '');
this.loanDetailsForm.controls['address'].setValue(value.records.address || null);
this.loanDetailsForm.controls['state'].setValue(value.records.state || null );
if(value.records.state != ''){this.getCityAndPincodeDetails(value.records.state);}
this.loanDetailsForm.controls['city'].setValue(value.records.city || null);
this.loanDetailsForm.controls['pincode'].setValue(value.records.pincode || null);
this.loanDetailsForm.controls['other_pincode'].setValue(value.records.other_pincode || null);
}
this.loanDetailsForm.controls['loandetails_remarks'].setValue(value.records.loandetails_remarks);
@ -307,7 +319,7 @@ export class LoanDetailsComponent implements OnInit {
}
})
if (this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LL' || this.productAbbr == 'LAEP') {
if (this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LAEP') {
this.mortageCardAccess = false;
this.loanDetailsForm.controls['owner_name'].setValue('');
this.loanDetailsForm.controls['owner_name'].clearValidators();
@ -406,6 +418,13 @@ export class LoanDetailsComponent implements OnInit {
});
}
getM_State() {
this._pd.getAllMasterDatas('STATE').subscribe(
data => {
this.m_stateLists = data.records.filter(data => data.is_active == 1);
});
}
/** Loan Form Elements */
public initloanDetailsForm(): void {
this.loanDetailsForm = this.fb.group({
@ -433,6 +452,12 @@ export class LoanDetailsComponent implements OnInit {
owner_name: [''],
construction_status: [''],
emv_per_customer: [''],
property_seller:[''],
address: [''],
state: [''],
city: [''],
pincode: [''],
other_pincode:[''],
loandetails_remarks: [''],
});
}
@ -682,6 +707,16 @@ export class LoanDetailsComponent implements OnInit {
});
}
getCityAndPincodeDetails(stateID: string) {
this._pd.getStateWiseCities(stateID).subscribe(data => {
if (data.status == 200) {
this.m_cityList = data.records.cities;
this.m_pincodeList = data.records.pincode;
}
});
}
/** To save Loan FOrm Details */
submitLoanDetails() {

View File

@ -38,6 +38,7 @@ import {RentalVerificationComponent} from './forms/rental-verification/rental-ve
export class StartPdComponent implements OnInit, OnDestroy {
public startPD: string;
public mainApplicantName: string;
public randomString: string;
//public remarks: string;
errorMessage: any;
selectedCategory: any = [];
@ -68,6 +69,9 @@ export class StartPdComponent implements OnInit, OnDestroy {
private router: Router,
private listPDComponent: ListPdComponent, private _pd: PdTrigerService,) {
this.startPD = this.route.snapshot.params['pdid'];
this.randomString = this.route.snapshot.params['rdmstr'];
console.log(this.route.snapshot.params['pdid'],this.route.snapshot.params['rdmstr']);
console.log('this.randomString',this.randomString);
this.notifier = notifier;
this.currentPDStatus = false;
}
@ -84,7 +88,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
// Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true });
// Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true });
}
this.loadTemplates(this.startPD,1);
this.loadTemplates(this.startPD,1,this.randomString);
}
isMac(): boolean {
@ -101,9 +105,11 @@ export class StartPdComponent implements OnInit, OnDestroy {
// load templates details
loadTemplates(startID:string,type:number){
this._pd.loadPDTemplates(startID).subscribe(
loadTemplates(startID:string,type:number,randomString:string){
console.log('start pd component inside - loadTemplates params are,',startID,type,randomString);
this._pd.loadPDTemplates(startID,randomString).subscribe(
data => {
console.log("after reponse = ", data);
if (data.status == 200) {
this.pdMasterList=data.records.pdmaster_details;
// this.categoryList=data.records.question_answers;
@ -134,7 +140,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
// load pd status change dialogue
pdStatusDialogue(status: string, checkType: number): void {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid: this.startPD, pd_status: status },
data: { pdid: this.startPD, pd_status: status ,random_string:this.randomString },
disableClose: true,
minWidth:'30%',
maxWidth:'40%',
@ -142,10 +148,10 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.update_status==true){
checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2);
checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
}
else {
checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2);
checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
}
});
@ -170,7 +176,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==2){
@ -186,7 +192,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==3){
@ -202,7 +208,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==4){
@ -218,7 +224,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==5){
@ -234,7 +240,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==6){
@ -250,7 +256,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==7){
@ -266,7 +272,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else
@ -283,7 +289,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else
@ -300,7 +306,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==10){
@ -316,7 +322,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==11){
@ -332,7 +338,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==12){
@ -348,7 +354,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==13){
@ -364,7 +370,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==14){
@ -380,7 +386,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==15){
@ -396,7 +402,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else
@ -413,7 +419,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else if(this.selectedFormsCategory.form_id==18){
@ -429,7 +435,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
generaldialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else if(this.selectedFormsCategory.form_id==19){
@ -445,7 +451,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
generaldialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else if(this.selectedFormsCategory.form_id==20){
const generaldialogRef = this.dialog.open(FinalRemarksComponent, {
@ -460,7 +466,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
generaldialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==22){
@ -476,7 +482,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
}
@ -486,7 +492,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
}
// load pd view component
loadPdViewCompoent() {
this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route});
this.router.navigate(['../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
}
}

View File

@ -81,6 +81,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// roles checks for enables events
roleAccessDetails:any;
masterRandomString: string;
// @Input() childData: string;
@ -97,19 +98,25 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.ListPdComponent.showListView(false);
this.route.params.subscribe(params => {
this.viewID = params['pdid'];
this.masterRandomString = params['rdmstr'];
console.log('View PD COmponet Random String',this.viewID,this.masterRandomString);
});
this.viewPdDetails(this.viewID);
// this.viewID = this.route.snapshot.params['pdid'];
// this.masterRandomString = this.route.snapshot.params['rdmstr'];
this.viewPdDetails(this.viewID,this.masterRandomString);
}
pd_QC_Rating: Number;
viewPdDetails(editID: string) {
viewPdDetails(editID: string,masterRandomString : string) {
console.log('inside Function',masterRandomString);
this.pdMasterData = [];
this._pd.editPdDetails(editID).subscribe(
this._pd.editPdDetails(editID,masterRandomString).subscribe(
data => {
if (data.status == 200) {
let masterData: any = data.records.pd_master_details;
this.pdMasterData.push(masterData[0]);
this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
// this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
this.pdApplicantData = data.records.applicants_details;
this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2);
@ -140,12 +147,14 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.enableStartPD = false;
}
}
}, error => this.errorMessage = <any>error);
}, error => {
console.log('%c Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!', 'font-weight: bold; font-size: 50px;color: red; ');
});
}
loadPdListCompoent() {
this.destroyType = 2;
this.router.navigate(['../../'], { relativeTo: this.route });
this.router.navigate(['../../../'], { relativeTo: this.route });
this.ListPdComponent.pdListLoad(true);
}
@ -200,7 +209,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
editPdMaster(masterData: any, flag) {
let record = {
"records": masterData,
"applicantLength": this.pdApplicantData.length
"applicantLength": this.pdApplicantData.length,
"random_string":this.masterRandomString
}
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
data: record,
@ -233,7 +243,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
});
dialogPDMaster.afterClosed().subscribe(dataresult => {
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
editPdApplicant(applicantData: any,CSAbbr : any) {
@ -251,7 +261,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
dialogApplicant.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
// edit pd addtional requirements
@ -269,7 +279,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
dialogRequirement.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
// pd allocation to
@ -285,7 +295,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
else if (pdData.fk_pd_type == 2) {
@ -299,7 +309,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
else if (pdData.fk_pd_type == 3) {
@ -313,7 +323,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
@ -330,7 +340,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
dialogSchedule.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
@ -339,7 +349,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.destroyType = 3;
if (status == this.pdStatusCheck.ALLOCATED || status == this.pdStatusCheck.SCHEDULED) {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid: pdDetails.assigned_pd, pd_status: this.pdStatusCheck.INPROGRESS },
data: { pdid: pdDetails.assigned_pd, pd_status: this.pdStatusCheck.INPROGRESS ,random_string:this.masterRandomString},
disableClose: true,
minWidth: '30%',
maxWidth: '40%',
@ -347,18 +357,20 @@ export class ViewPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
if (dataresult.update_status == true) {
this.router.navigate(['../../startpd',pdDetails.assigned_pd], { relativeTo: this.route });
this.router.navigate(['../../../startpd',pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route });
}
});
}
else {
this.router.navigate(['../../startpd', pdDetails.assigned_pd], { relativeTo: this.route });
this.router.navigate(['../../../startpd', pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route });
}
}
getPDIDReport(pdID: any) {
console.log('getPDIDReport',pdID);
console.log('getPDIDReport',this.masterRandomString);
this.destroyType = 3;
this.router.navigate(['../../pd_report', pdID], { relativeTo: this.route });
this.router.navigate(['../../../pd_report', pdID,this.masterRandomString], { relativeTo: this.route });
}
// // direct trigger the pd
@ -382,7 +394,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// this._pd.editPdMasterDetails(lenderMasterArray, this.pdStatusCheck.TRIGGERED).subscribe(result => {
// if (result.status == 200) {
// this.notifier.notify('success', 'PD Status Updated.');
// this.viewPdDetails(this.viewID);
// this.viewPdDetails(this.viewID,this.masterRandomString);
// }
// else {
// this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
@ -411,10 +423,10 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
else {
let lenderMasterArray = { "pd_id": pdid }
this._pd.editPdMasterDetails(lenderMasterArray, this.pdStatusCheck.TRIGGERED).subscribe(result => {
this._pd.editPdMasterDetails(lenderMasterArray, this.pdStatusCheck.TRIGGERED,this.masterRandomString).subscribe(result => {
if (result.status == 200) {
this.notifier.notify('success', 'PD Status Updated.');
this.viewPdDetails(this.viewID);
this.viewPdDetails(this.viewID,this.masterRandomString);
}
else {
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
@ -432,7 +444,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
if(parentData.main_applicant){
masterApplicantID = this.pdApplicantData.filter(appt => appt.applicant_name == parentData.main_applicant)[0].pd_co_applicant_id;}
const dialogRef = this.dialog.open(InitiateAdditionalPdComponent, {
data: { "type":type,"pd_id":parentData.pd_id,"fk_customer_segment":parentData.fk_customer_segment, "pd_status":parentData.pd_status, "pd_address_id": childData.pd_address_id,"applicant_id":masterApplicantID,"applicants_details":this.pdApplicantData},
data: { "type":type,"pd_id":parentData.pd_id,"fk_customer_segment":parentData.fk_customer_segment, "pd_status":parentData.pd_status, "pd_address_id": childData.pd_address_id,"applicant_id":masterApplicantID,"applicants_details":this.pdApplicantData,"random_string":this.masterRandomString},
disableClose: true,
// position: { right: '0' },
minWidth: '40%',
@ -441,7 +453,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
if (dataresult.update_status == true) {
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
}
});
}

View File

@ -32,15 +32,15 @@ const routes: Routes = [
component: AddPdComponent,
},
{
path: 'viewpd/:pdid',
component: ViewPdComponent,
path: 'viewpd/:pdid/:rdmstr',
component: ViewPdComponent,
},
{
path: 'startpd/:pdid',
path: 'startpd/:pdid/:rdmstr',
component: StartPdComponent,
},
{
path: 'pd_report/:pdid',
path: 'pd_report/:pdid/:rdmstr',
component: PdReportComponent,
}
]

View File

@ -185,8 +185,11 @@ export class PdTrigerService {
}
// get edit row pd details
editPdDetails(editId: string): Observable<any> {
editPdDetails(editId: string,randomString): Observable<any> {
// { pdid:100, randon_string:'aTeWbidm451' }
let httpParams = new HttpParams().set('pdid', editId);
httpParams = httpParams.append('random_string',randomString);
return this._http.post<any>(this.apiUrl + "getFullPDDetails", httpParams)
.pipe(
catchError(this.handleError('operation', []))
@ -194,10 +197,13 @@ export class PdTrigerService {
}
// update pd master details
editPdMasterDetails(editData: any, status: string): Observable<any> {
editPdMasterDetails(editData: any, status: string,randomString): Observable<any> {
editData.pd_status = status;
editData.fk_updatedby = this._aws.getlocale();
editData.random_string = randomString;
// editData.random_string = 'qRanHRk8mngFPRqU';
// editData.updatedon = currentdate;
console.log('pd Trigger edit data',editData);
return this._http.post<any>(this.apiUrl + "updatePDMaster", { records: editData })
.pipe(
@ -255,9 +261,11 @@ export class PdTrigerService {
}
//load pd template details
loadPDTemplates(pdId: string): Observable<any> {
const options = pdId ?
{ params: new HttpParams().set('pd_id', pdId) } : {};
loadPDTemplates(pdId: string,randomString): Observable<any> {
let httpParams = new HttpParams().set('pd_id', pdId);
httpParams = httpParams.append('random_string',randomString);
// console.log('loadFullTemplate api load httpParams are',httpParams);
const options = pdId ? { params: httpParams } : {};
return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
.pipe(
catchError(this.handleError('operation', []))
@ -346,8 +354,8 @@ export class PdTrigerService {
// get Pd Final report Question Answer
getPdFinalReportDetails(pdId: number): Observable<any> {
return this._http.post<any>(this.apiUrl + "getFinalPDReportQuestions", { "pd_id": pdId })
getPdFinalReportDetails(pdId: number,random:string): Observable<any> {
return this._http.post<any>(this.apiUrl + "getFinalPDReportQuestions", {"pd_id":pdId,'random_string':random})
.pipe(
catchError(this.handleError('operation', []))
)

View File

@ -53,10 +53,19 @@ export class QcListComponent implements OnInit {
this.getTabIndex==0 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails();
}
viewPDDetails(pdid:string){
this.viewPdList = !this.viewPdList;
this.router.navigate([ '../qclist/viewpd',pdid], { relativeTo: this.route });
// viewPDDetails(pdid:string){
// this.viewPdList = !this.viewPdList;
// this.router.navigate([ '../qclist/viewpd',pdid], { relativeTo: this.route });
// }
viewPDDetails(event){
let pdid = event.id;
let rdmstr = event.string;
// console.log("pdid = " + event.id);
// console.log("randomString = " + event.string);
this.viewPdList = !this.viewPdList;
this.router.navigate([ '../qclist/viewpd',pdid,rdmstr], { relativeTo: this.route });
}
//get tab changes
onTabClick(event: MatTabChangeEvent) {

View File

@ -42,7 +42,7 @@ export class QcPdReportComponent implements OnInit {
selectedIndex: Number;
urlSafe: SafeResourceUrl;
apiUrl:string = environment.apiEndpoint;
randomString : string;
reportRandomString : string;
arra:any;
private notifier: NotifierService;
@ -50,7 +50,8 @@ export class QcPdReportComponent implements OnInit {
private router: Router, public pdTrigerService: QcService, private listPDComponent: QcListComponent,
private dialog: MatDialog, private sanitizer: DomSanitizer) {
this.startPD = this.route.snapshot.params['pdid'];
this.randomString = this.apiUrl+'getPDReportHTML/'+atob(this.route.snapshot.params['string']);
let encryptReportRandomString = atob(this.route.snapshot.params['string']);
this.reportRandomString = this.apiUrl+'getPDReportHTML/'+encryptReportRandomString+'/'+this.startPD;
this.notifier = notifier;
// this.src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T073026Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=35aa183cbbfc835f96719a5e9aa552c79b3a1b7d8bca043f7d738d730755dcbb';
// this.src = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b");
@ -80,7 +81,7 @@ export class QcPdReportComponent implements OnInit {
// this.loadTemplates(this.startPD);
// this.next = 1;
// this.previous = 2;
this.urlSafe= this.sanitizer.bypassSecurityTrustResourceUrl(this.randomString);
this.urlSafe= this.sanitizer.bypassSecurityTrustResourceUrl(this.reportRandomString);
}
getFrameContent(content: any)
@ -91,7 +92,7 @@ export class QcPdReportComponent implements OnInit {
// console.log('Dat is value');
this.pdTrigerService.setHTMLContent(this.startPD,getItem).subscribe(data => {
this.pdTrigerService.setHTMLContent(this.startPD,getItem,atob(this.route.snapshot.params['string'])).subscribe(data => {
if (data.status == 200) {
localStorage.removeItem('userEdits');
this.notifier.notify('success', 'Your Changes Updated.!');
@ -146,7 +147,7 @@ export class QcPdReportComponent implements OnInit {
generateNewPDReport() {
let data = {
"pd_id": this.startPD
"pd_id": this.startPD,
};
this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data => {
if (data.dataStatus) {
@ -165,6 +166,7 @@ export class QcPdReportComponent implements OnInit {
downloadPDReport(){
let data = {
"pd_id": this.startPD,
"random_string":atob(this.route.snapshot.params['string'])
};
this.pdTrigerService.generatePDReportPDF(data).subscribe(data => {
if (data.dataStatus) {
@ -182,7 +184,8 @@ export class QcPdReportComponent implements OnInit {
archivePDImages(){
let data = {
"pd_id": this.startPD,
"form_id":""
"form_id":"",
"random_string":atob(this.route.snapshot.params['string'])
};
this.pdTrigerService.archivePDImages(data).subscribe(data => {
if (data.dataStatus) {
@ -222,7 +225,7 @@ export class QcPdReportComponent implements OnInit {
}
getPdReportDetails() {
this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => {
this.pdTrigerService.getPdFinalReportDetails(this.startPD,atob(this.route.snapshot.params['string'])).subscribe(data => {
if (data.status == 200) {
// console.log('getPdReportDetails',data);
this.pdReportRecords = data.records;
@ -282,7 +285,7 @@ export class QcPdReportComponent implements OnInit {
reportReview(status): void {
const dialogRef = this.dialog.open(QcReviewComponent, {
data: { startId: this.startPD, data_status: status },
data: { startId: this.startPD, data_status: status,random_string : atob(this.route.snapshot.params['string']) },
disableClose: true
});
dialogRef.afterClosed()

View File

@ -86,6 +86,7 @@ export class QcReviewComponent implements OnInit {
myClick(): void {
let template = this.ngForm.value;
template.pd_id = this.data.startId;
template.random_String = this.data.random_string;
this.pdTrigerService.pdReviewStatusUpdate(template).subscribe(data=>{
this.notifier.notify('success', 'Your Changes Updated.!');
this.dialogRef.close({

View File

@ -40,6 +40,7 @@ import {FuturePlansAndBusinessEnvironmentComponent} from './../../../personal-d
export class QcStartComponent implements OnInit, OnDestroy {
public startPD: string;
public mainApplicantName: string;
public randomString: string;
//public remarks: string;
errorMessage: any;
selectedCategory: any = [];
@ -71,6 +72,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
private router: Router,
private listPDComponent: QcListComponent, private _pd: QcService,) {
this.startPD = this.route.snapshot.params['pdid'];
this.randomString = this.route.snapshot.params['rdmstr'];
this.notifier = notifier;
this.currentPDStatus = false;
}
@ -87,7 +89,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
// Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true });
// Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true });
}
this.loadTemplates(this.startPD,1);
this.loadTemplates(this.startPD,1,this.randomString);
}
isMac(): boolean {
@ -104,8 +106,8 @@ export class QcStartComponent implements OnInit, OnDestroy {
// load templates details
loadTemplates(startID:string,type:number){
this._pd.loadPDTemplates(startID).subscribe(
loadTemplates(startID:string,type:number,randomString:string){
this._pd.loadPDTemplates(startID,randomString).subscribe(
data => {
if (data.status == 200) {
this.pdMasterList=data.records.pdmaster_details;
@ -150,7 +152,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.update_status==true){
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
}
});
}
@ -171,7 +173,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==2){
@ -185,7 +187,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==3){
@ -199,7 +201,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==4){
@ -213,7 +215,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==5){
@ -227,7 +229,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==6){
@ -241,7 +243,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==7){
@ -255,7 +257,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else
@ -270,7 +272,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else
@ -285,7 +287,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==10){
@ -299,7 +301,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==11){
@ -313,7 +315,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==12){
@ -328,7 +330,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==13){
@ -342,7 +344,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==14){
@ -356,7 +358,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==15){
@ -370,7 +372,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else
@ -385,7 +387,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else if(this.selectedFormsCategory.form_id==18){
@ -399,7 +401,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
generaldialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
else if(this.selectedFormsCategory.form_id==19){
@ -413,7 +415,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
generaldialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else if(this.selectedFormsCategory.form_id==20){
const generaldialogRef = this.dialog.open(FinalRemarksComponent, {
@ -426,7 +428,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
generaldialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if(this.selectedFormsCategory.form_id==22){
@ -440,7 +442,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}else
if((this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP') && this.selectedFormsCategory.form_id==23){
@ -454,7 +456,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
this.loadTemplates(this.startPD,2,this.randomString);
});
}
@ -466,8 +468,8 @@ export class QcStartComponent implements OnInit, OnDestroy {
}
// load pd view component
loadPdViewCompoent() {
this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route});
// this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route});
this.router.navigate(['../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
}
}

View File

@ -38,6 +38,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
pdAdditionalReqData: any=[];
enableStartPD: boolean;
reportRandomString: string;
masterRandomString: string;
public userRoleID = +localStorage.getItem('user_role');
// create values for status check
pdStatusCheck :any={
@ -62,19 +63,20 @@ export class QcViewComponent implements OnInit, OnDestroy {
this.QcListComponent.showListView(false);
this.route.params.subscribe(params => {
this.viewID = params['pdid'];
this.masterRandomString = params['rdmstr'];
});
this.viewPdDetails(this.viewID);
this.viewPdDetails(this.viewID,this.masterRandomString);
}
viewPdDetails(editID:string){
viewPdDetails(editID:string,randomString:string){
this.pdMasterData = [];
this._qc.editPdDetails(editID).subscribe(
this._qc.editPdDetails(editID,randomString).subscribe(
data => {
if (data.status == 200) {
let masterData: any = data.records.pd_master_details;
this.pdMasterData.push(masterData[0]);
this.reportRandomString = btoa(masterData[0].random_string);
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
this.pdApplicantData= data.records.applicants_details;
this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2);
this.pdDocumentsData=data.records.pd_documnets;
@ -105,14 +107,15 @@ export class QcViewComponent implements OnInit, OnDestroy {
loadPdListCompoent() {
this.destroyType=2;
this.router.navigate([ '../../' ], { relativeTo: this.route });
this.router.navigate([ '../../../' ], { relativeTo: this.route });
this.QcListComponent.pdListLoad(true);
}
editPdMaster(masterData:any){
let record = {
"records":masterData,
"applicantLength": this.pdApplicantData.length
"applicantLength": this.pdApplicantData.length,
"random_string":this.masterRandomString
}
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
data: record,
@ -123,7 +126,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
dialogPDMaster.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
editPdApplicant(applicantData:any){
@ -140,7 +143,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
dialogApplicant.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
// edit pd addtional requirements
@ -158,7 +161,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
dialogRequirement.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
// pd allocation to
@ -174,7 +177,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
else if(pdData.fk_pd_type == 2){
@ -188,7 +191,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
else if(pdData.fk_pd_type == 3){
@ -202,7 +205,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
@ -219,14 +222,15 @@ export class QcViewComponent implements OnInit, OnDestroy {
dialogSchedule.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
// this is for initiate additional pd
initiateAddtionalPD(parentData: any, childData: any, type: boolean){
const dialogRef = this.dialog.open(InitiateAdditionalPdComponent, {
data: { "type":type,"pd_id":parentData.pd_id,"fk_customer_segment":parentData.fk_customer_segment, "pd_status":parentData.pd_status, "pd_address_id": childData.pd_address_id},
data: { "type":type,"pd_id":parentData.pd_id,"fk_customer_segment":parentData.fk_customer_segment, "pd_status":parentData.pd_status, "pd_address_id": childData.pd_address_id,"random_string":this.masterRandomString},
disableClose: true,
// position: { right: '0' },
minWidth: '40%',
@ -235,7 +239,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
if (dataresult.update_status == true) {
this.viewPdDetails(this.viewID)
this.viewPdDetails(this.viewID,this.masterRandomString)
}
});
}
@ -246,12 +250,12 @@ export class QcViewComponent implements OnInit, OnDestroy {
// console.log('childData',childData);
// return;
this.destroyType=3;
this.router.navigate([ '../../startpd',pdID], { relativeTo: this.route });
this.router.navigate([ '../../startpd',pdID,this.masterRandomString], { relativeTo: this.route });
}
// pd report
getPDIDReport(pdID:any) {
this.destroyType=3;
this.router.navigate([ '../../pd_report',pdID,this.reportRandomString], { relativeTo: this.route });
this.router.navigate([ '../../../pd_report',pdID,this.reportRandomString], { relativeTo: this.route });
}
ngOnDestroy(): void {
if(this.destroyType==1){

View File

@ -142,8 +142,9 @@ export class QcService {
}
// get edit row pd details
editPdDetails(editId: string): Observable<any> {
editPdDetails(editId: string,randomString): Observable<any> {
let httpParams = new HttpParams().set('pdid', editId);
httpParams = httpParams.append('random_string',randomString);
return this._http.post<any>(this.apiUrl + "getFullPDDetails", httpParams)
.pipe(
catchError(this.handleError('operation', []))
@ -151,9 +152,10 @@ export class QcService {
}
// update pd master details
editPdMasterDetails(editData: any, status: string): Observable<any> {
editPdMasterDetails(editData: any, status: string,randomString): Observable<any> {
editData.pd_status = status;
editData.fk_updatedby = this._aws.getlocale();
editData.random_string = randomString;
// editData.updatedon = currentdate;
return this._http.post<any>(this.apiUrl + "updatePDMaster", { records: editData })
@ -212,9 +214,11 @@ export class QcService {
}
//load pd template details
loadPDTemplates(pdId: string): Observable<any> {
loadPDTemplates(pdId: string,randomString :string): Observable<any> {
let httpParams = new HttpParams().set('pd_id', pdId);
httpParams = httpParams.append('random_string',randomString);
const options = pdId ?
{ params: new HttpParams().set('pd_id', pdId) } : {};
{ params: httpParams } : {};
return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
.pipe(
catchError(this.handleError('operation', []))
@ -303,8 +307,11 @@ export class QcService {
// get Pd Final report Question Answer
getPdFinalReportDetails(pdId: number): Observable<any> {
return this._http.post<any>(this.apiUrl + "getFinalPDReportQuestions", { "pd_id": pdId })
getPdFinalReportDetails(pdId: number,randomString: string): Observable<any> {
// getPdFinalReportDetails(pdId: number,random:string): Observable<any> {
return this._http.post<any>(this.apiUrl + "getFinalPDReportQuestions", {"pd_id":pdId,'random_string':randomString})
.pipe(
catchError(this.handleError('operation', []))
)
@ -607,8 +614,8 @@ export class QcService {
return this._http.post<any>(this.apiUrl+"getHTMLContent", {"pd_id":id});
}
setHTMLContent(id:any,content:any): Observable<any> {
let records = { 'records': { "pdid":id,"content":content,"fk_createdby":this._aws.getlocale()}};
setHTMLContent(id:any,content:any,randomString : any): Observable<any> {
let records = { 'records': { "pdid":id,"content":content,"fk_createdby":this._aws.getlocale(),'random_string':randomString}};
return this._http.post<any>(this.apiUrl+"saveHTMLReport", records);
}
}

View File

@ -20,11 +20,11 @@ const routes: Routes =[
component: QcListComponent,
children: [
{
path: 'viewpd/:pdid',
path: 'viewpd/:pdid/:rdmstr',
component: QcViewComponent,
},
{
path: 'startpd/:pdid',
path: 'startpd/:pdid/:rdmstr',
component: QcStartComponent,
},
{

View File

@ -30,9 +30,9 @@
<button mat-raised-button mat-icon-button type="button" matTooltip="Change Password" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" data-scribe-element="profile_edit_button" (click)="changePassword()">
<mat-icon>https</mat-icon>
</button>
<button mat-raised-button mat-icon-button type="button" matTooltip="Edit Profile" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" data-scribe-element="profile_edit_button" (click)="editprofile()">
<span *ngIf="userRoleID == '10'"><button mat-raised-button mat-icon-button type="button" matTooltip="Edit Profile" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" data-scribe-element="profile_edit_button" (click)="editprofile()">
<mat-icon>edit</mat-icon>
</button>
</button></span>
</div>
</div>

View File

@ -25,16 +25,13 @@ export class UserProfileComponent implements OnInit {
}
};
userDetails:any=[];
public userRoleID = +localStorage.getItem('user_role');
constructor(public AWS:AwsService,public dialog: MatDialog,public users:UserService,public router:Router ) {
this.getuser();
}
ngOnInit() {
}
ngOnInit() {}
getuser(){
//console.log(this.AWS.getUser());