Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
30b360bf44
@ -17,8 +17,15 @@
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
<div *ngIf="is_remarks_enabled" align="center">
|
||||
<mat-form-field appearance="outline" style="width: 100%;">
|
||||
<mat-label>Remarks</mat-label>
|
||||
<textarea matInput autocomplete="off" placeholder="Reason for cancelling PD" type="text" [formControl] = "remarks"></textarea>
|
||||
<mat-error align="end" *ngIf="remarks.hasError('required')">Remarks required</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end" *ngIf="CompletenessCheck">
|
||||
<button *ngIf="enableAddonPD===true" mat-raised-button color="primary" (click)="changePDStatus(addonStatus)"><strong> Yes / Allow Addon PD</strong></button>
|
||||
|
||||
@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core';
|
||||
import { NotifierService } from "angular-notifier";
|
||||
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||
import { FormControl, Validators } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pd-status-change-dialogue',
|
||||
@ -23,7 +24,8 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
public masterRandomString : string;
|
||||
fk_pd_type: any;
|
||||
pd_completeness_override: String = '0';
|
||||
|
||||
is_remarks_enabled:boolean = false
|
||||
remarks:FormControl = new FormControl('',Validators.compose([Validators.required]))
|
||||
constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef<PdStatusChangeDialogueComponent>,@Inject(MAT_DIALOG_DATA) public data: any)
|
||||
{
|
||||
this.notifier = notifier;
|
||||
@ -35,6 +37,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
this.masterRandomString = this.data.random_string;
|
||||
this.fk_pd_type = this.data.pd_type
|
||||
console.log("sdf@@@@@@@@@@2",this.fk_pd_type)
|
||||
this.is_remarks_enabled = this.data.pd_status == 'CANCELLED'
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -71,6 +74,14 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
if(this.pd_completeness_override == '1') {
|
||||
update_status.complete_override_data = this.dialoge_subcontent
|
||||
}
|
||||
if(this.is_remarks_enabled) {
|
||||
console.log(this.remarks);
|
||||
if(this.remarks.invalid) {
|
||||
this.notifier.notify("warning","Remarks is Required");
|
||||
return;
|
||||
}
|
||||
update_status.remark = this.remarks.value
|
||||
}
|
||||
this.pd.editPdMasterDetails(update_status, status,this.masterRandomString).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
this.dialogRef.close({update_status:true});
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<mat-card style="min-height: 550px" >
|
||||
<mat-card-title>
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width:60% !important;">
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width:60% !important;">
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
<mat-tab-group>
|
||||
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<form [formGroup]="_supplierQuesFrom" (submit)="onSubmit()" novalidate>
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
|
||||
<mat-card>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
<mat-tab-group>
|
||||
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<form *ngIf="noRecordsFound" class="address" [formGroup]="familyForm">
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
</h2>
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<!-- <div *ngIf="noRecordsFound" style="max-width: 100vw !important;width: 100% !important;height: 95% !important;"> -->
|
||||
<mat-card *ngIf="noRecordsFound">
|
||||
|
||||
@ -27,6 +27,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { analyzeAndValidateNgModules } from '@angular/compiler';
|
||||
import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component';
|
||||
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
||||
import { distinctUntilChanged, pairwise } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-final-remarks',
|
||||
@ -145,6 +146,7 @@ export class FinalRemarksComponent implements OnInit {
|
||||
this.getM_Type();
|
||||
this.getM_Recommendation();
|
||||
this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''}
|
||||
this.listenRecommendationChange()
|
||||
}
|
||||
@ViewChild('autosize') autosize: CdkTextareaAutosize;
|
||||
|
||||
@ -154,9 +156,9 @@ export class FinalRemarksComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
addRecommendationPositive() {
|
||||
addRecommendationPositive(data=null) {
|
||||
const control = <FormArray>this._finalRemarkForm.controls['recommendation_positive'];
|
||||
control.push(this.CreateRecommendationPositive(null));
|
||||
control.push(this.CreateRecommendationPositive(data));
|
||||
}
|
||||
deleteRecommendationPositive(index) {
|
||||
const control = <FormArray>this._finalRemarkForm.controls['recommendation_positive'];
|
||||
@ -168,9 +170,9 @@ export class FinalRemarksComponent implements OnInit {
|
||||
reason_for_negative: data == null ? [''] : [data.reason_for_negative],
|
||||
});
|
||||
}
|
||||
addRecommendationNegative() {
|
||||
addRecommendationNegative(data=null) {
|
||||
const control = <FormArray>this._finalRemarkForm.controls['recommendation_negative'];
|
||||
control.push(this.CreateRecommendationNegative(null));
|
||||
control.push(this.CreateRecommendationNegative(data));
|
||||
}
|
||||
deleteRecommendationNegative(index) {
|
||||
const control = <FormArray>this._finalRemarkForm.controls['recommendation_negative'];
|
||||
@ -181,9 +183,9 @@ export class FinalRemarksComponent implements OnInit {
|
||||
reason_for_refer_to_credit: data == null ? [''] : [data.reason_for_refer_to_credit],
|
||||
});
|
||||
}
|
||||
addRecommendationReferToCredit() {
|
||||
addRecommendationReferToCredit(data=null) {
|
||||
const control = <FormArray>this._finalRemarkForm.controls['recommendation_refer_to_credit'];
|
||||
control.push(this.CreateRecommendationReferToCredit(null));
|
||||
control.push(this.CreateRecommendationReferToCredit(data));
|
||||
}
|
||||
deleteRecommendationReferToCredit(index) {
|
||||
const control = <FormArray>this._finalRemarkForm.controls['recommendation_refer_to_credit'];
|
||||
@ -540,7 +542,7 @@ export class FinalRemarksComponent implements OnInit {
|
||||
if (recommendationNegativeCtrl.controls.length > 0) {
|
||||
let i: number = 0;
|
||||
for (i; i < recommendationNegativeCtrl.controls.length; i++) {
|
||||
|
||||
|
||||
recommendationNegativeCtrl.removeAt(i + 1);
|
||||
|
||||
recommendationNegativeCtrl = recommendationNegativeCtrl.controls[0];
|
||||
@ -641,6 +643,63 @@ export class FinalRemarksComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// addRecommendationData(e,value,index,old_key) {
|
||||
|
||||
// console.log(value[index],old_key)
|
||||
// if(!value[index][old_key]) {
|
||||
// return
|
||||
// }
|
||||
// if(e == 2) {
|
||||
// value[index].reason_for_positive = value[index][old_key]
|
||||
// if(index == 0) {
|
||||
// this.deleteRecommendationPositive(0)
|
||||
// }
|
||||
// this.addRecommendationPositive(value[index])
|
||||
// if(index+1 == value.length-1) {
|
||||
// if(value[index+1]){
|
||||
// value[index+1].reason_for_positive = value[index+1][old_key]
|
||||
// this.addRecommendationPositive(value[index+1])
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if(e == 3) {
|
||||
// value[index].reason_for_negative = value[index][old_key]
|
||||
// if(index == 0) {
|
||||
// this.deleteRecommendationNegative(0)
|
||||
// }
|
||||
// this.addRecommendationNegative(value[index])
|
||||
// if(index+1 == value.length-1) {
|
||||
// if(value[index+1]){
|
||||
// value[index+1].reason_for_negative = value[index+1][old_key]
|
||||
// this.addRecommendationNegative(value[index+1])
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// // value.reason_for_negative = value[old_key]
|
||||
// // this.deleteRecommendationNegative(0)
|
||||
// // this.addRecommendationNegative(value)
|
||||
// }
|
||||
// if(e == 4) {
|
||||
// value[index].reason_for_refer_to_credit = value[index][old_key]
|
||||
// if(index == 0) {
|
||||
// this.deleteRecommendationReferToCredit(0)
|
||||
// }
|
||||
// this.addRecommendationReferToCredit(value[index])
|
||||
// if(index+1 == value.length-1) {
|
||||
// if(value[index+1]){
|
||||
// value[index+1].reason_for_refer_to_credit = value[index+1][old_key]
|
||||
// this.addRecommendationReferToCredit(value[index+1])
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// // value.reason_for_refer_to_credit = value[old_key]
|
||||
// // this.deleteRecommendationReferToCredit(0)
|
||||
// // this.addRecommendationReferToCredit(value)
|
||||
// }
|
||||
// }
|
||||
RecommendationChange2(e) {
|
||||
// if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){
|
||||
|
||||
@ -729,6 +788,43 @@ export class FinalRemarksComponent implements OnInit {
|
||||
e== 'yes' ? this._finalRemarkForm.addControl('sealing_activity_pic', new FormControl('')) : this._finalRemarkForm.removeControl('sealing_activity_pic');
|
||||
}
|
||||
}
|
||||
listenRecommendationChange() {
|
||||
this._finalRemarkForm.get('pd_officers_recommendation').valueChanges.pipe(distinctUntilChanged(), pairwise() // gets a pair of old and new value
|
||||
).subscribe(([old_value,new_value])=>{
|
||||
if((old_value != '2' && old_value != '3' && old_value != '4') || (new_value != '2' && new_value != '3' && new_value != '4')) {
|
||||
return;
|
||||
}
|
||||
console.log(old_value, new_value)
|
||||
let control2: any = this._finalRemarkForm.get('recommendation_positive') as FormArray;
|
||||
let control3: any = this._finalRemarkForm.get('recommendation_negative') as FormArray;
|
||||
let control4: any = this._finalRemarkForm.get('recommendation_refer_to_credit') as FormArray;
|
||||
let key2 = 'reason_for_positive'
|
||||
let key3 = 'reason_for_negative'
|
||||
let key4 = 'reason_for_refer_to_credit'
|
||||
let temp_data = eval('control'+old_value)
|
||||
if(temp_data) {
|
||||
temp_data = JSON.parse(JSON.stringify(temp_data.value))
|
||||
console.log(temp_data)
|
||||
if(eval('control'+new_value)) {
|
||||
if(temp_data.length > 1) {
|
||||
for (let i=1;i<temp_data.length;i++) {
|
||||
temp_data[i][eval('key'+new_value)] = temp_data[i][eval('key'+old_value)]
|
||||
if(eval('control'+new_value)) {
|
||||
eval('control'+new_value).push(
|
||||
new_value == '2' ? this.CreateRecommendationPositive(null) :
|
||||
new_value == '3' ? this.CreateRecommendationNegative(null) :
|
||||
new_value == '4' ? this.CreateRecommendationReferToCredit(null) : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
// temp_data[0][eval('key'+new_value)] = temp_data[0][old_value == '2' ? 'recommendation_positive' : old_value == '3' ? 'recommendation_negative' : old_value == '4' ? 'recommendation_refer_to_credit' : '']
|
||||
temp_data[0][eval('key'+new_value)] = temp_data[0][eval('key'+old_value)]
|
||||
console.log(temp_data,)
|
||||
eval('control'+new_value).patchValue(temp_data)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** To validate All Form Fields */
|
||||
validateAllFormFields(formGroup: any) {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
</h2>
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
</h2>
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<mat-card *ngIf="noRecordsFound">
|
||||
<mat-form-field style="width:94%;">
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<!-- individuals details start-->
|
||||
<mat-card>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<form [formGroup]="docsCollectedForm">
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div *ngIf="loadComponent">
|
||||
<mat-card *ngIf="queries_docs.length !=0">
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
|
||||
<mat-card>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<form [formGroup]="stockForms" (submit)="submitDetails($event.value); ">
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<form [formGroup]="_supplierQuesFrom" (submit)="onSubmit()" novalidate>
|
||||
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<mat-tab label="Details">
|
||||
<ng-template matTabContent>
|
||||
<mat-card>
|
||||
<mat-form-field style="width:60% !important;">
|
||||
|
||||
@ -187,10 +187,16 @@
|
||||
<span><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button></span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div style="padding: 0.7rem;
|
||||
font-size: 16px;
|
||||
border-radius: 4px;
|
||||
background-color: #e001014a;" *ngIf="master.pd_status == 'CANCELLED' && master.hasOwnProperty('cancel_remark') && master.cancel_remark">
|
||||
<span style="font-weight: bold;">Reason for Cancellation </span>: PD cancelled remarks displayed here {{master.cancel_remark}}
|
||||
</div> -->
|
||||
<!-- <hr/> -->
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="50" *ngFor="let addresses of master.addresses;">
|
||||
<div fxFlex="50" fxFlex.xs="100" *ngFor="let addresses of master.addresses;">
|
||||
<mat-card style="box-shadow: 0 5px 11px 0 rgba(0,0,0,.18), 0 4px 15px 0 rgba(0,0,0,.15) !important;border-radius: 5px !important;border-bottom:1px solid #e00201 !important;" *ngIf="addresses.pincode">
|
||||
<mat-card-title class="headerdesign" style="margin:0px !important;padding: 0px !important;height: 95px !important;">
|
||||
<!-- this is for set primary address of the PD actions-->
|
||||
|
||||
@ -186,6 +186,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.pdMasterData[0].addresses = data.records.pd_address.filter(item => item.isactive == 1);
|
||||
|
||||
// this.pdMasterData[0].cancel_remark = "Applicant reject the loan in bank. so that he is not available to attend the pd visit"
|
||||
|
||||
this.currentPDStatus = data.records.pd_master_details[0].pd_status;
|
||||
this.pdAdditionalReqData = data.records.pd_additional_requirements;
|
||||
this.pdCollectedDocument = data.records.docs_to_be_collected;
|
||||
|
||||
@ -193,7 +193,9 @@ export class QcPdReportComponent implements OnInit {
|
||||
this.ngOnInit();
|
||||
// this.getPdReportVersionList();
|
||||
} else {
|
||||
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
|
||||
let msg = data.hasOwnProperty('msg') && data.msg ? data.msg : 'Something Went Wrong Try Again.!'
|
||||
this.notifier.notify('warning', msg);
|
||||
// this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
|
||||
}
|
||||
}, err => {
|
||||
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!');
|
||||
@ -233,10 +235,11 @@ export class QcPdReportComponent implements OnInit {
|
||||
window.open(data.records);
|
||||
this.notifier.notify('success', 'Done Successfully..!');
|
||||
} else {
|
||||
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
|
||||
let msg = data.hasOwnProperty('msg') && data.msg ? data.msg : 'Something Went Wrong Try Again.!'
|
||||
this.notifier.notify('warning', msg);
|
||||
}
|
||||
}, err => {
|
||||
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!');
|
||||
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!');
|
||||
// alert(err.html_format);
|
||||
});
|
||||
}
|
||||
|
||||
@ -130,13 +130,23 @@
|
||||
</mat-card>
|
||||
</div>
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="60" fxFlex.lg="70" fxFlex.xl="70" class="content-data" *ngFor="let master of pdMasterData">
|
||||
<div fxLayout="row">
|
||||
<div fxFlex="100" align="right">
|
||||
<div fxLayout="row" fxLayoutAlign="flex-end" fxLayoutGap="68px" fxLayoutGap.xs="8px">
|
||||
<!-- ENABLING THE FAB COPY LINK IMAGE CAPTURE AND VIDEO CALL BUTTON FOR TELE PD -->
|
||||
<div fxLayout="column">
|
||||
<app-speed-dial-fab fxFlex="30" class="fab-group" *ngIf="master.fk_pd_type == '2'" [options]="FabOptions" (fabClick)="fabAction($event,master)"></app-speed-dial-fab>
|
||||
</div>
|
||||
<!-- END OF COPY LINK IMAGE CAPTURE AND VIDEO CALL BUTTON FOR TELE PD -->
|
||||
<div align="right">
|
||||
<button *ngIf="master.fk_pd_type == '2'"
|
||||
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="confirmFieldVisit()"
|
||||
matTooltip="Is Field visit done ?" matTooltipPosition="above" >
|
||||
<mat-icon>how_to_reg</mat-icon>
|
||||
</button>
|
||||
<button *ngIf="master.fk_pd_type == '2'" mat-stroked-button class="mr-1 mb-1" color="primary" (click)="uploadRecordedVideo()">
|
||||
<mat-icon>videocam</mat-icon>
|
||||
<strong>Upload</strong>
|
||||
</button>
|
||||
<span> <button *ngIf="master.fk_pd_type == '2'"
|
||||
<!-- <span> <button *ngIf="master.fk_pd_type == '2'"
|
||||
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="copyCusURL()"
|
||||
matTooltip="Copy Customer Image Recapture Link" matTooltipPosition="above" >
|
||||
<mat-icon>link</mat-icon>
|
||||
@ -149,7 +159,7 @@
|
||||
<button *ngIf="master.fk_pd_type == '2'" mat-stroked-button class="mr-1 mb-1" color="primary" (click)="openCusImages()">
|
||||
<mat-icon>collections</mat-icon>
|
||||
<strong>Customer Images</strong>
|
||||
</button>
|
||||
</button> -->
|
||||
<!-- <span matTooltip="{{!videoplayback.enableBtn ? 'Recorded video is available after the PD is completed' : 'Play Recorded Video'}}" matTooltipPosition="above"> -->
|
||||
<button *ngIf="master.fk_pd_type == '3' || master.fk_pd_type == '2'" mat-stroked-button matTooltip="Play Recorded Video" matTooltipPosition="above" class="mr-1 mb-1" color="primary" (click)="openPlayer()" [disabled]="!videoplayback.enableBtn">
|
||||
<mat-icon>play_circle_filled</mat-icon>
|
||||
|
||||
@ -23,6 +23,7 @@ import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.se
|
||||
import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component';
|
||||
import { PdVisitTimeComponent } from '../pd-visit-time/pd-visit-time.component';
|
||||
import { UploadVideoComponent } from 'app/quality-check/upload-video/upload-video.component';
|
||||
import { DecisionDialogComponent } from 'app/shared/decision-dialog/decision-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-qc-view',
|
||||
@ -64,6 +65,37 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
pdCollectedDocument:any=[];
|
||||
pd_QC_Rating: Number;
|
||||
videoplayback: any = {enableBtn:true,url:null};
|
||||
FabOptions = {
|
||||
icon:'collections',
|
||||
placeholder:"Customer Images",
|
||||
buttons: [
|
||||
{
|
||||
icon: 'link',
|
||||
placeholder:'Copy Customer Image Recapture Link',
|
||||
btnValue:'copy_cus_images_link'
|
||||
},
|
||||
{
|
||||
icon: 'description',
|
||||
placeholder:'Send Customer Image Recapture Link via SMS',
|
||||
btnValue:'send_cus_images_link'
|
||||
},
|
||||
{
|
||||
icon: 'collections',
|
||||
placeholder:'Open Customer Images',
|
||||
btnValue:'open_cus_images'
|
||||
},
|
||||
// {
|
||||
// icon: 'room'
|
||||
// },
|
||||
// {
|
||||
// icon: 'lightbulb_outline'
|
||||
// },
|
||||
// {
|
||||
// icon: 'lock'
|
||||
// }
|
||||
]
|
||||
};
|
||||
|
||||
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
|
||||
private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent,private pdService:PdTrigerService) {
|
||||
this.notifier=notifier
|
||||
@ -369,6 +401,19 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
this.notifier.notify('info','Customer Image Recapture link copied');
|
||||
}
|
||||
|
||||
fabAction(event,master) {
|
||||
console.log(event);
|
||||
event = event.btnValue
|
||||
if(event == 'open_cus_images') {
|
||||
this.openCusImages()
|
||||
}
|
||||
if(event == 'send_cus_images_link') {
|
||||
this.onClickSmsLink(master)
|
||||
}
|
||||
if(event == 'copy_cus_images_link') {
|
||||
this.copyCusURL()
|
||||
}
|
||||
}
|
||||
onClickSmsLink(master){
|
||||
console.log('SMS',master);
|
||||
let param={
|
||||
@ -385,6 +430,10 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
if(res['dataStatus']){
|
||||
this.notifier.notify("info","SMS Sent Successfully")
|
||||
}
|
||||
else{
|
||||
let msg = res.hasOwnProperty('msg') ? res.msg : "Something Went wrong";
|
||||
this.notifier.notify("warning",msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
openPlayer(){
|
||||
@ -418,6 +467,43 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
// maxWidth:'75vw'
|
||||
})
|
||||
}
|
||||
|
||||
confirmFieldVisit() {
|
||||
// minimum 1 button required for this reusable dialog
|
||||
let params = {title : "PD Visit", message:"Is Field visit done for this PD ?", buttons:["Yes","No"]}
|
||||
const dialogRef = this.dialog.open(DecisionDialogComponent,{
|
||||
minWidth:'30%',
|
||||
disableClose:false,
|
||||
data:params
|
||||
// maxWidth:'75vw'
|
||||
})
|
||||
dialogRef.afterClosed().subscribe(res=>{
|
||||
console.log(res)
|
||||
let param = ''
|
||||
if(res && res.toLowerCase() == 'yes') {
|
||||
param = '1'
|
||||
}
|
||||
else if(res && res.toLowerCase() == 'no') {
|
||||
param = '0'
|
||||
}
|
||||
if(param) {
|
||||
this.updateFieldVisitStatus(param)
|
||||
}
|
||||
})
|
||||
}
|
||||
updateFieldVisitStatus(field_visit_done) {
|
||||
let params = {is_field_visit_done:field_visit_done, "pd_id":this.viewID,random_string:this.masterRandomString}
|
||||
this._qc.pdReviewStatusUpdate(params).subscribe(res=>{
|
||||
if(res['dataStatus']) {
|
||||
this.notifier.notify("success","Updated Successfully")
|
||||
}
|
||||
else{
|
||||
this.notifier.notify("warning","Something went wrong")
|
||||
}
|
||||
},err=>{
|
||||
this.notifier.notify("error","Network Error")
|
||||
})
|
||||
}
|
||||
// getVideoUrl(pd_id,randomStr){
|
||||
// let params = {"pd_id":pd_id,"random_string":randomStr}
|
||||
// this.pdService.getRecordedPlaybackUrl(params).subscribe(result=>{
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
import {
|
||||
animate,
|
||||
keyframes,
|
||||
query,
|
||||
stagger,
|
||||
state,
|
||||
style,
|
||||
transition,
|
||||
trigger
|
||||
} from '@angular/animations';
|
||||
|
||||
export const speedDialFabAnimations = [
|
||||
trigger('fabToggler', [
|
||||
state('inactive', style({
|
||||
transform: 'rotate(0deg)'
|
||||
})),
|
||||
state('active', style({
|
||||
transform: 'rotate(225deg)'
|
||||
})),
|
||||
transition('* <=> *', animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
||||
]),
|
||||
trigger('speedDialStagger', [
|
||||
transition('* => *', [
|
||||
|
||||
query(':enter', style({ opacity: 0 }), {optional: true}),
|
||||
|
||||
query(':enter', stagger('40ms',
|
||||
[
|
||||
animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)',
|
||||
keyframes(
|
||||
[
|
||||
style({opacity: 0, transform: 'translateY(10px)'}),
|
||||
style({opacity: 1, transform: 'translateY(0)'}),
|
||||
]
|
||||
)
|
||||
)
|
||||
]
|
||||
), {optional: true}),
|
||||
|
||||
query(':leave',
|
||||
animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)',
|
||||
keyframes([
|
||||
style({opacity: 1}),
|
||||
style({opacity: 0}),
|
||||
])
|
||||
), {optional: true}
|
||||
)
|
||||
|
||||
])
|
||||
])
|
||||
];
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
<div id="fab-dismiss"
|
||||
*ngIf="fabTogglerState==='active'"
|
||||
(click)="onToggleFab()">
|
||||
</div>
|
||||
|
||||
<div class="fab-container">
|
||||
<button mat-icon-button mat-raised-button class="fab-toggler mr-1 mb-1 hover-icon" color="optblue"
|
||||
(click)="onToggleFab()" [matTooltip]="options.placeholder" matTooltipPosition="above">
|
||||
<!-- <i class="material-icons" [@fabToggler]="{value: fabTogglerState}">link</i> -->
|
||||
<mat-icon [@fabToggler]="{value: fabTogglerState}">{{options.icon}}</mat-icon>
|
||||
</button>
|
||||
<div [@speedDialStagger]="buttons.length">
|
||||
<button *ngFor="let btn of buttons" (click)="onBtnClick(btn)"
|
||||
mat-mini-fab
|
||||
class="fab-secondary mr-1 mb-1 hover-icon"
|
||||
color="secondary"
|
||||
[matTooltip]="btn.placeholder" matTooltipPosition="above">
|
||||
<mat-icon>{{btn.icon}}</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <button *ngIf="master.fk_pd_type == '3'"
|
||||
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="copyCusURL(master.random_string)"
|
||||
matTooltip="Copy Customer Link" matTooltipPosition="above">
|
||||
<mat-icon>link</mat-icon>
|
||||
</button> -->
|
||||
@ -0,0 +1,50 @@
|
||||
.fab-container {
|
||||
position: absolute;
|
||||
// top: 1%;
|
||||
// right: 35%;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
> div {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
// margin-top: 5px;
|
||||
// margin-top: 5px;
|
||||
position: absolute;
|
||||
right: 67px;
|
||||
// top: -13px;
|
||||
|
||||
button {
|
||||
// margin-top: 17px;
|
||||
background: #cfdd49;
|
||||
margin-left:10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media(max-width:580px) {
|
||||
.fab-container {
|
||||
> div {
|
||||
flex-direction: column !important;
|
||||
right: 0px;
|
||||
top: 53px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fab-toggler {
|
||||
float: right;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#fab-dismiss {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SpeedDialFabComponent } from './speed-dial-fab.component';
|
||||
|
||||
describe('SpeedDialFabComponent', () => {
|
||||
let component: SpeedDialFabComponent;
|
||||
let fixture: ComponentFixture<SpeedDialFabComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SpeedDialFabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SpeedDialFabComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,42 @@
|
||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { speedDialFabAnimations } from './speed-dial-fab.animations';
|
||||
|
||||
@Component({
|
||||
selector: 'app-speed-dial-fab',
|
||||
templateUrl: './speed-dial-fab.component.html',
|
||||
styleUrls: ['./speed-dial-fab.component.scss'],
|
||||
animations: speedDialFabAnimations
|
||||
})
|
||||
export class SpeedDialFabComponent implements OnInit {
|
||||
|
||||
@Input() options;
|
||||
@Output() fabClick = new EventEmitter()
|
||||
buttons = [];
|
||||
fabTogglerState = 'inactive';
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
const maxButtons = 6;
|
||||
if (this.options.buttons.length > maxButtons) {
|
||||
this.options.buttons.splice(5, this.options.buttons.length - maxButtons);
|
||||
}
|
||||
}
|
||||
|
||||
showItems() {
|
||||
this.fabTogglerState = 'active';
|
||||
this.buttons = this.options.buttons;
|
||||
}
|
||||
|
||||
hideItems() {
|
||||
this.fabTogglerState = 'inactive';
|
||||
this.buttons = [];
|
||||
}
|
||||
|
||||
onToggleFab() {
|
||||
this.buttons.length ? this.hideItems() : this.showItems();
|
||||
}
|
||||
onBtnClick(btnValue) {
|
||||
this.fabClick.emit(btnValue)
|
||||
}
|
||||
}
|
||||
@ -109,6 +109,7 @@ import { QcCusImagesComponent } from './qc-cus-images/qc-cus-images.component';
|
||||
import { PdVisitTimeComponent } from './qc-list/pd-visit-time/pd-visit-time.component';
|
||||
import { UploadVideoComponent } from './upload-video/upload-video.component'
|
||||
import { MatVideoModule } from 'mat-video';
|
||||
import { SpeedDialFabComponent } from './qc-list/qc-view/speed-dial-fab/speed-dial-fab.component';
|
||||
// import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||
|
||||
|
||||
@ -184,7 +185,7 @@ const customNotifierOptions: NotifierOptions = {
|
||||
AngularSplitModule.forRoot(),
|
||||
MatVideoModule
|
||||
],
|
||||
declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent, PdVisitTimeComponent, UploadVideoComponent],
|
||||
declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent, PdVisitTimeComponent, UploadVideoComponent,SpeedDialFabComponent],
|
||||
entryComponents: [PdVisitTimeComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, InitiateAdditionalPdComponent,QcNewComponent,
|
||||
BusinessAssetsInfoComponent,
|
||||
ClientInfoComponent,
|
||||
|
||||
@ -50,12 +50,12 @@
|
||||
<mat-form-field class="ml-xs mr-xs" style="width:30%">
|
||||
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="from_date" placeholder="From Date" (dateChange)="getDateObjects($event.target.value)">
|
||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker></mat-datepicker>
|
||||
<mat-datepicker touchUi #picker></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="ml-xs mr-xs" style="width:30%">
|
||||
<input matInput [matDatepicker]="picker1" [min]="minDate" [max]="maxDate" formControlName="to_date" placeholder="To Date">
|
||||
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker1 ></mat-datepicker>
|
||||
<mat-datepicker touchUi #picker1 ></mat-datepicker>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
|
||||
@ -51,12 +51,12 @@
|
||||
<mat-form-field class="ml-xs mr-xs" style="width:30%">
|
||||
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="from_date" placeholder="From Date" (dateChange)="getDateObjects($event.target.value)">
|
||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker></mat-datepicker>
|
||||
<mat-datepicker touchUi #picker></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="ml-xs mr-xs" style="width:30%">
|
||||
<input matInput [matDatepicker]="picker1" [min]="minDate" [max]="maxDate" formControlName="to_date" placeholder="To Date">
|
||||
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker1 ></mat-datepicker>
|
||||
<mat-datepicker touchUi #picker1 ></mat-datepicker>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
|
||||
@ -14,6 +14,12 @@
|
||||
</mat-expansion-panel-header>
|
||||
<mat-list class="m-gap p-gap" >
|
||||
<div [formGroup]="searchForm" fxLayout="row wrap" fxFlex="100%" fxLayoutGap="35px" fxLayoutAlign="flex-start stretch">
|
||||
<mat-form-field style="width: 20%">
|
||||
<mat-select multiple formControlName="sales_pd_type" placeholder="PD Type">
|
||||
<mat-option *ngFor="let status of saledPDTypeList" [value]="status.id">{{status.pd_status_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 20%">
|
||||
<mat-select multiple formControlName="pd_status" placeholder="PD Status">
|
||||
<mat-option *ngFor="let status of pdStatus" [value]="status.pd_status_name">{{status.pd_status_name}}
|
||||
@ -24,13 +30,13 @@
|
||||
<input matInput [matDatepicker]="picker" [max]="todaydate"
|
||||
formControlName="pd_from_date" placeholder="Choose a From date">
|
||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker></mat-datepicker>
|
||||
<mat-datepicker touchUi #picker></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:20%">
|
||||
<input matInput [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" [max]="todaydate"
|
||||
formControlName="pd_to_date" placeholder="Choose a To date">
|
||||
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker1></mat-datepicker>
|
||||
<mat-datepicker touchUi #picker1></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:20%">
|
||||
<mat-select multiple formControlName="pd_products" placeholder="Products">
|
||||
|
||||
@ -22,6 +22,16 @@ export class AdvanceFilterComponent implements OnInit {
|
||||
PRODUCTS: any =[];
|
||||
xpandStatus:boolean=false;
|
||||
pipe=new DatePipe('en-US');
|
||||
saledPDTypeList :any = [
|
||||
{
|
||||
id:'1',
|
||||
pd_status_name:'Physical PD'
|
||||
},
|
||||
{
|
||||
id:'2',
|
||||
pd_status_name:'Telephonic PD'
|
||||
},
|
||||
]
|
||||
constructor(private _fb:FormBuilder,private _pd:PdTrigerService,private salesPDService:SalesPdService) {
|
||||
this.todaydate = new Date();
|
||||
this.getDropdown();
|
||||
@ -36,6 +46,7 @@ export class AdvanceFilterComponent implements OnInit {
|
||||
pd_lender:[''],
|
||||
pd_applicant_name:[''],
|
||||
pd_officer:[''],
|
||||
sales_pd_type:['']
|
||||
})
|
||||
console.log(this.drop_down_datas)
|
||||
}
|
||||
|
||||
@ -32,7 +32,9 @@
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="SalesPdSno">
|
||||
<mat-cell fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="16" fxFlex.xl="15" class="cell" *matCellDef="let details;" style="color:rgb(224, 2, 1);font-weight: bold;text-align: left" >
|
||||
<small mat-line>{{details.sales_pd_sno}}</small>
|
||||
<small mat-line>{{details.sales_pd_sno}}</small><br/>
|
||||
<span style="font-weight:500;color: black;font-size: 16.5px;" *ngIf="details.sales_pd_type == 2"> <small mat-line>Telephonic PD</small></span>
|
||||
<span style="font-weight:500;color: black;font-size: 16.5px;" *ngIf="details.sales_pd_type == 1"> <small mat-line>Physical PD</small></span>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="Applicant Name">
|
||||
@ -52,12 +54,12 @@
|
||||
<span style="text-align: center;font-weight:400;font-size: 17px;"> <small mat-line>{{details.abbr}}</small></span>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="Sales PD Type">
|
||||
<!-- <ng-container matColumnDef="Sales PD Type">
|
||||
<mat-cell class="cell" *matCellDef="let details" fxLayoutAlign="start" fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="10" fxFlex.lg="10">
|
||||
<span style="font-weight:500" *ngIf="details.sales_pd_type == 2"> <small mat-line>Telephonic PD</small></span>
|
||||
<span style="font-weight:500" *ngIf="details.sales_pd_type == 1"> <small mat-line>Physical PD</small></span>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
</ng-container> -->
|
||||
<ng-container matColumnDef="Officer Name">
|
||||
<mat-cell fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="10" fxFlex.lg="13" class="cell" *matCellDef="let details;" fxLayoutAlign="center start" style="text-align: center;">
|
||||
<span *ngIf="!details.officer_name" mat-line>
|
||||
|
||||
@ -13,7 +13,7 @@ export class SalesPdComponent implements OnInit {
|
||||
public dataSourceTab4 = new MatTableDataSource();
|
||||
filter_input:string='';
|
||||
|
||||
displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Sales PD Type','Officer Name','status','Create On','Action'];
|
||||
displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Officer Name','status','Create On','Action'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
@ -5,8 +5,9 @@ import { SalesPdRoutingModule } from './sales-pd-routing.module';
|
||||
import { SalesPdComponent } from './sales-pd-list/sales-pd.component';
|
||||
import { MaterialModule } from './material_modules/material.module';
|
||||
import { MisReportsComponent } from './mis-reports/mis-reports.component';
|
||||
import { MAT_DATE_LOCALE } from '@angular/material';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material';
|
||||
import { AdvanceFilterComponent } from './sales-pd-list/advance-filter/advance-filter.component';
|
||||
import { MAT_MOMENT_DATE_FORMATS, MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@ -15,6 +16,7 @@ import { AdvanceFilterComponent } from './sales-pd-list/advance-filter/advance-f
|
||||
MaterialModule
|
||||
],
|
||||
declarations: [SalesPdComponent, MisReportsComponent, AdvanceFilterComponent],
|
||||
providers:[{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' }]
|
||||
providers:[{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
|
||||
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}]
|
||||
})
|
||||
export class SalesPdModule { }
|
||||
|
||||
@ -108,7 +108,7 @@ export class UserService {
|
||||
let data: any = '';
|
||||
|
||||
if (cognitousers != '' && cognitousers !== undefined) {
|
||||
//console.log(users);
|
||||
// console.log(users);
|
||||
let aws_name :any;
|
||||
let updateby:any;
|
||||
let createdby:any;
|
||||
@ -188,6 +188,9 @@ export class UserService {
|
||||
};
|
||||
//console.log(roles);
|
||||
formData.append('records',JSON.stringify(records));
|
||||
if(users.hasOwnProperty('user_config') && users.user_config) {
|
||||
formData.append('user_config',JSON.stringify(users.user_config));
|
||||
}
|
||||
formData.append('roles',JSON.stringify(({ "user_role": users.role.role_id})));
|
||||
formData.append('profilepic',users.userpic);
|
||||
formData.append('pdofficer',JSON.stringify(pdofficer));
|
||||
@ -236,6 +239,9 @@ export class UserService {
|
||||
return this.http.get<any>(apiurl + 'getListOfLenders');
|
||||
|
||||
}
|
||||
getEntityPreferences(entity_id){
|
||||
return this.http.get(apiurl+'getEntityPreferences/'+entity_id)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -162,6 +162,19 @@
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<mat-card *ngIf="regForm.controls['user_config']">
|
||||
<mat-card-title>Configurations</mat-card-title><hr/>
|
||||
<mat-card-content>
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 50%;">
|
||||
<mat-select multiple placeholder="Sales Products" [formControl]="regForm.get('user_config')['controls']['salespd_products']" [disabled] = "productsList.length == 0">
|
||||
<mat-option *ngFor="let pd of productsList" [value]="pd.product_id" >
|
||||
{{pd.product_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error align="end" *ngIf="regForm.get('user_config')['controls']['salespd_products'].hasError('required')">Sales Products required</mat-error>
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
<hr>
|
||||
|
||||
@ -63,6 +63,7 @@ export class RegisterComponent implements OnInit {
|
||||
entity_for_branch: any;
|
||||
branchList: any;
|
||||
enableBranch: boolean=false;
|
||||
productsList: any = [];
|
||||
constructor(
|
||||
private router: Router, public fb: FormBuilder, public AWS: AwsService, private cd: ChangeDetectorRef
|
||||
,private elementRef: ElementRef,public users:UserService,notifier:NotifierService) {
|
||||
@ -94,13 +95,16 @@ export class RegisterComponent implements OnInit {
|
||||
pdteam:[null],
|
||||
pdtype:[null],
|
||||
fk_lender_branch_id:[null]
|
||||
|
||||
});
|
||||
});
|
||||
this.userupdate();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
addUserConfigControls() {
|
||||
return this.fb.group({
|
||||
salespd_products:['',Validators.compose([Validators.required])]
|
||||
})
|
||||
}
|
||||
regdata() {
|
||||
this.users.entityType().subscribe(res => {
|
||||
this.types = res;
|
||||
@ -119,7 +123,14 @@ export class RegisterComponent implements OnInit {
|
||||
// this.checktype(this.types[0]);
|
||||
// }
|
||||
// });
|
||||
this.callrole(1,this.types[0],'');
|
||||
this.users.entitiesDetails().subscribe(res=>{
|
||||
this.entitiesDetails = res;
|
||||
if(this.entitiesDetails.dataStatus == true){
|
||||
this.entitiesDetails = this.entitiesDetails.records;
|
||||
this.callrole(this.types[0].entity_type_id,this.types[0],'');
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
this.users.City().subscribe(res => {
|
||||
@ -148,15 +159,6 @@ export class RegisterComponent implements OnInit {
|
||||
this.pdType = this.pdType.records.filter(pdty=>pdty.isactive ==1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.users.entitiesDetails().subscribe(res=>{
|
||||
this.entitiesDetails = res;
|
||||
if(this.entitiesDetails.dataStatus == true){
|
||||
this.entitiesDetails = this.entitiesDetails.records;
|
||||
}
|
||||
})
|
||||
this.users.getLenderDetails().subscribe(res=>{
|
||||
this.entity_for_branch=res
|
||||
if(this.entity_for_branch.dataStatus == true){
|
||||
@ -280,6 +282,7 @@ console.log("cog",userData,this.usersData)
|
||||
this.getBranch(flag);
|
||||
}
|
||||
getBranch(flag?){
|
||||
this.checkUserConfigAvail()
|
||||
if(this.regForm.value.role != null && (this.regForm.value.role.role_name == "Branch Credit" || this.regForm.value.role.role_name == "Branch Sales") && this.regForm.value.lenVenName != null){
|
||||
console.log(this.regForm.value.role,this.entity_for_branch,this.regForm.value.lenVenName);
|
||||
if(this.entity_for_branch.length > 0){
|
||||
@ -316,6 +319,27 @@ getBranch(flag?){
|
||||
this.City = this.Cities.filter(city=>city.fk_state_id == e.value.state_id);
|
||||
|
||||
|
||||
}
|
||||
checkUserConfigAvail() {
|
||||
console.log(this.types[0].entity_type_id,this.regForm.value.lenVenName)
|
||||
if(this.types[0].entity_type_id == '2' && this.regForm.value.lenVenName.short_name == 'MWISE') {
|
||||
this.regForm.addControl('user_config',this.addUserConfigControls())
|
||||
this.users.getEntityPreferences(this.regForm.value.lenVenName.entity_id).subscribe(res=>{
|
||||
if(res['dataStatus']) {
|
||||
this.productsList = res['records'].salespd_products
|
||||
if (this.users.localUserId != '' && this.users.localUserId != null && this.users.localUserId !== undefined && this.users.localUserId.user_config) {
|
||||
this.regForm.get('user_config')['controls']['salespd_products'].setValue(this.users.localUserId.user_config.salespd_products)
|
||||
}
|
||||
else {
|
||||
this.regForm.get('user_config')['controls']['salespd_products'].setValue(this.productsList.map(item=>item.product_id))
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(this.regForm.value)
|
||||
}
|
||||
else {
|
||||
this.regForm.removeControl('user_config')
|
||||
}
|
||||
}
|
||||
userupdate() {
|
||||
|
||||
@ -336,7 +360,9 @@ getBranch(flag?){
|
||||
this.entitiesDetails = this.entitiesDetails.records.filter(ent=>ent.isactive ==1);
|
||||
let entitiy = this.entitiesDetails.filter(ent=>this.usersData.fk_entity_id == ent.entity_id)[0];
|
||||
this.regForm.controls['lenVenName'].setValue(entitiy);
|
||||
|
||||
this.callrole(2,this.types[0],this.usersData);
|
||||
this.checkUserConfigAvail()
|
||||
}
|
||||
else{
|
||||
this.callrole(2,this.types[0],this.usersData);
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
<h2 mat-dialog-title>{{data.title}}</h2>
|
||||
<mat-dialog-content>
|
||||
<div fxFlex="100">
|
||||
<p align="center">
|
||||
{{data.message}}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end" >
|
||||
<button mat-raised-button color="primary" (click)="updateString(data.buttons[0])"><strong>{{data.buttons[0]}}</strong></button>
|
||||
<button mat-raised-button *ngIf="data.buttons[1]" (click)="updateString(data.buttons[1])"><strong> {{data.buttons[1]}} </strong></button>
|
||||
</mat-dialog-actions>
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DecisionDialogComponent } from './decision-dialog.component';
|
||||
|
||||
describe('DecisionDialogComponent', () => {
|
||||
let component: DecisionDialogComponent;
|
||||
let fixture: ComponentFixture<DecisionDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DecisionDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DecisionDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,20 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'app-decision-dialog',
|
||||
templateUrl: './decision-dialog.component.html',
|
||||
styleUrls: ['./decision-dialog.component.scss']
|
||||
})
|
||||
export class DecisionDialogComponent implements OnInit {
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data:any, private dialogRef:MatDialogRef<DecisionDialogComponent>) { }
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.data);
|
||||
}
|
||||
updateString(result) {
|
||||
this.dialogRef.close(result)
|
||||
}
|
||||
|
||||
}
|
||||
@ -8,10 +8,12 @@ import { RatingComponent} from './rating/rating.component';
|
||||
import { NumbersOnlyDirective } from './numbers-only/numbers-only.directive';
|
||||
import { ForMobileNumbersDirective } from './for-mobile-numbers/for-mobile-numbers.directive';
|
||||
import { ProgressSpineerDialogComponent } from './progress-spineer-dialog/progress-spineer-dialog.component';
|
||||
import { MatProgressSpinnerModule } from '@angular/material';
|
||||
import { MatButtonModule, MatDialogModule, MatProgressSpinnerModule } from '@angular/material';
|
||||
import { DecisionDialogComponent } from './decision-dialog/decision-dialog.component';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@NgModule({
|
||||
entryComponents:[ProgressSpineerDialogComponent],
|
||||
entryComponents:[ProgressSpineerDialogComponent,DecisionDialogComponent],
|
||||
declarations: [
|
||||
AccordionAnchorDirective,
|
||||
AccordionLinkDirective,
|
||||
@ -20,9 +22,10 @@ import { MatProgressSpinnerModule } from '@angular/material';
|
||||
RatingComponent,
|
||||
NumbersOnlyDirective,
|
||||
ForMobileNumbersDirective,
|
||||
ProgressSpineerDialogComponent
|
||||
ProgressSpineerDialogComponent,
|
||||
DecisionDialogComponent
|
||||
],
|
||||
imports:[MatProgressSpinnerModule],
|
||||
imports:[MatProgressSpinnerModule,MatDialogModule,CommonModule,MatButtonModule],
|
||||
exports: [
|
||||
AccordionAnchorDirective,
|
||||
AccordionLinkDirective,
|
||||
@ -31,7 +34,10 @@ import { MatProgressSpinnerModule } from '@angular/material';
|
||||
RatingComponent,
|
||||
NumbersOnlyDirective,
|
||||
ForMobileNumbersDirective,
|
||||
ProgressSpineerDialogComponent
|
||||
ProgressSpineerDialogComponent,
|
||||
DecisionDialogComponent,
|
||||
CommonModule,
|
||||
MatButtonModule
|
||||
],
|
||||
providers: [ MenuItems, HorizontalMenuItems ]
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user