Fairoj : PD cancel remark, sales pd type option in filter, date picker issue, form changed to details label change and backend message displayed in pd report generation

This commit is contained in:
venbatechnologies@gmail.com 2021-01-05 13:49:24 +05:30
parent 6f0886ec76
commit 6d00e17b64
33 changed files with 191 additions and 45 deletions

View File

@ -17,6 +17,13 @@
</div> </div>
</span> </span>
</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> </div>
</mat-dialog-content> </mat-dialog-content>

View File

@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core';
import { NotifierService } from "angular-notifier"; import { NotifierService } from "angular-notifier";
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material'; import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material';
import { PdTrigerService } from '../../../pd-service/pd-triger.service'; import { PdTrigerService } from '../../../pd-service/pd-triger.service';
import { FormControl, Validators } from '@angular/forms';
@Component({ @Component({
selector: 'app-pd-status-change-dialogue', selector: 'app-pd-status-change-dialogue',
@ -23,7 +24,8 @@ export class PdStatusChangeDialogueComponent implements OnInit {
public masterRandomString : string; public masterRandomString : string;
fk_pd_type: any; fk_pd_type: any;
pd_completeness_override: String = '0'; 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) constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef<PdStatusChangeDialogueComponent>,@Inject(MAT_DIALOG_DATA) public data: any)
{ {
this.notifier = notifier; this.notifier = notifier;
@ -35,6 +37,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
this.masterRandomString = this.data.random_string; this.masterRandomString = this.data.random_string;
this.fk_pd_type = this.data.pd_type this.fk_pd_type = this.data.pd_type
console.log("sdf@@@@@@@@@@2",this.fk_pd_type) console.log("sdf@@@@@@@@@@2",this.fk_pd_type)
this.is_remarks_enabled = this.data.pd_status == 'CANCELLED'
} }
ngOnInit() { ngOnInit() {
@ -71,6 +74,14 @@ export class PdStatusChangeDialogueComponent implements OnInit {
if(this.pd_completeness_override == '1') { if(this.pd_completeness_override == '1') {
update_status.complete_override_data = this.dialoge_subcontent 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 => { this.pd.editPdMasterDetails(update_status, status,this.masterRandomString).subscribe(result => {
if (result.status == 200) { if (result.status == 200) {
this.dialogRef.close({update_status:true}); this.dialogRef.close({update_status:true});

View File

@ -20,7 +20,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<mat-card style="min-height: 550px" > <mat-card style="min-height: 550px" >
<mat-card-title> <mat-card-title>

View File

@ -84,7 +84,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<mat-card> <mat-card>
<mat-card-content> <mat-card-content>
<mat-form-field style="width:60% !important;"> <mat-form-field style="width:60% !important;">

View File

@ -14,7 +14,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<mat-card> <mat-card>
<mat-card-content> <mat-card-content>
<mat-form-field style="width:60% !important;"> <mat-form-field style="width:60% !important;">

View File

@ -19,7 +19,7 @@
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">

View File

@ -14,7 +14,7 @@
<form [formGroup]="_supplierQuesFrom" (submit)="onSubmit()" novalidate> <form [formGroup]="_supplierQuesFrom" (submit)="onSubmit()" novalidate>
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<mat-card> <mat-card>

View File

@ -18,7 +18,7 @@
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">

View File

@ -14,7 +14,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">

View File

@ -13,7 +13,7 @@
<form *ngIf="noRecordsFound" class="address" [formGroup]="familyForm"> <form *ngIf="noRecordsFound" class="address" [formGroup]="familyForm">
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">

View File

@ -13,7 +13,7 @@
</h2> </h2>
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<!-- <div *ngIf="noRecordsFound" style="max-width: 100vw !important;width: 100% !important;height: 95% !important;"> --> <!-- <div *ngIf="noRecordsFound" style="max-width: 100vw !important;width: 100% !important;height: 95% !important;"> -->
<mat-card *ngIf="noRecordsFound"> <mat-card *ngIf="noRecordsFound">

View File

@ -27,6 +27,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { analyzeAndValidateNgModules } from '@angular/compiler'; import { analyzeAndValidateNgModules } from '@angular/compiler';
import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component';
import { CdkTextareaAutosize } from '@angular/cdk/text-field'; import { CdkTextareaAutosize } from '@angular/cdk/text-field';
import { distinctUntilChanged, pairwise } from 'rxjs/operators';
@Component({ @Component({
selector: 'app-final-remarks', selector: 'app-final-remarks',
@ -145,6 +146,7 @@ export class FinalRemarksComponent implements OnInit {
this.getM_Type(); this.getM_Type();
this.getM_Recommendation(); this.getM_Recommendation();
this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''} this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''}
this.listenRecommendationChange()
} }
@ViewChild('autosize') autosize: CdkTextareaAutosize; @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']; const control = <FormArray>this._finalRemarkForm.controls['recommendation_positive'];
control.push(this.CreateRecommendationPositive(null)); control.push(this.CreateRecommendationPositive(data));
} }
deleteRecommendationPositive(index) { deleteRecommendationPositive(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_positive']; 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], reason_for_negative: data == null ? [''] : [data.reason_for_negative],
}); });
} }
addRecommendationNegative() { addRecommendationNegative(data=null) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_negative']; const control = <FormArray>this._finalRemarkForm.controls['recommendation_negative'];
control.push(this.CreateRecommendationNegative(null)); control.push(this.CreateRecommendationNegative(data));
} }
deleteRecommendationNegative(index) { deleteRecommendationNegative(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_negative']; 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], 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']; const control = <FormArray>this._finalRemarkForm.controls['recommendation_refer_to_credit'];
control.push(this.CreateRecommendationReferToCredit(null)); control.push(this.CreateRecommendationReferToCredit(data));
} }
deleteRecommendationReferToCredit(index) { deleteRecommendationReferToCredit(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_refer_to_credit']; const control = <FormArray>this._finalRemarkForm.controls['recommendation_refer_to_credit'];
@ -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) { RecommendationChange2(e) {
// if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){ // 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'); 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 */ /** To validate All Form Fields */
validateAllFormFields(formGroup: any) { validateAllFormFields(formGroup: any) {

View File

@ -13,7 +13,7 @@
</h2> </h2>
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">

View File

@ -13,7 +13,7 @@
</h2> </h2>
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<mat-card *ngIf="noRecordsFound"> <mat-card *ngIf="noRecordsFound">
<mat-form-field style="width:94%;"> <mat-form-field style="width:94%;">

View File

@ -16,7 +16,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<!-- individuals details start--> <!-- individuals details start-->
<mat-card> <mat-card>

View File

@ -18,7 +18,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">

View File

@ -15,7 +15,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">

View File

@ -17,7 +17,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">

View File

@ -15,7 +15,7 @@
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">

View File

@ -13,7 +13,7 @@
<form [formGroup]="docsCollectedForm"> <form [formGroup]="docsCollectedForm">
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div *ngIf="loadComponent"> <div *ngIf="loadComponent">
<mat-card *ngIf="queries_docs.length !=0"> <mat-card *ngIf="queries_docs.length !=0">

View File

@ -19,7 +19,7 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<mat-card> <mat-card>

View File

@ -15,7 +15,7 @@
<form [formGroup]="stockForms" (submit)="submitDetails($event.value); "> <form [formGroup]="stockForms" (submit)="submitDetails($event.value); ">
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">

View File

@ -14,7 +14,7 @@
<form [formGroup]="_supplierQuesFrom" (submit)="onSubmit()" novalidate> <form [formGroup]="_supplierQuesFrom" (submit)="onSubmit()" novalidate>
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Details">
<ng-template matTabContent> <ng-template matTabContent>
<mat-card> <mat-card>
<mat-form-field style="width:60% !important;"> <mat-form-field style="width:60% !important;">

View File

@ -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> <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> </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/> --> <!-- <hr/> -->
<div fxLayout="row wrap"> <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 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;"> <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--> <!-- this is for set primary address of the PD actions-->

View File

@ -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].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.currentPDStatus = data.records.pd_master_details[0].pd_status;
this.pdAdditionalReqData = data.records.pd_additional_requirements; this.pdAdditionalReqData = data.records.pd_additional_requirements;
this.pdCollectedDocument = data.records.docs_to_be_collected; this.pdCollectedDocument = data.records.docs_to_be_collected;

View File

@ -193,7 +193,9 @@ export class QcPdReportComponent implements OnInit {
this.ngOnInit(); this.ngOnInit();
// this.getPdReportVersionList(); // this.getPdReportVersionList();
} else { } 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 => { }, 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.!');
@ -233,10 +235,11 @@ export class QcPdReportComponent implements OnInit {
window.open(data.records); window.open(data.records);
this.notifier.notify('success', 'Done Successfully..!'); this.notifier.notify('success', 'Done Successfully..!');
} else { } 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 => { }, 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); // alert(err.html_format);
}); });
} }

View File

@ -50,12 +50,12 @@
<mat-form-field class="ml-xs mr-xs" style="width:30%"> <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)"> <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-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker> <mat-datepicker touchUi #picker></mat-datepicker>
</mat-form-field> </mat-form-field>
<mat-form-field class="ml-xs mr-xs" style="width:30%"> <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"> <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-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1 ></mat-datepicker> <mat-datepicker touchUi #picker1 ></mat-datepicker>
</mat-form-field> </mat-form-field>
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;"> <mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">

View File

@ -51,12 +51,12 @@
<mat-form-field class="ml-xs mr-xs" style="width:30%"> <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)"> <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-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker> <mat-datepicker touchUi #picker></mat-datepicker>
</mat-form-field> </mat-form-field>
<mat-form-field class="ml-xs mr-xs" style="width:30%"> <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"> <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-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1 ></mat-datepicker> <mat-datepicker touchUi #picker1 ></mat-datepicker>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;"> <!-- <mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">

View File

@ -14,6 +14,12 @@
</mat-expansion-panel-header> </mat-expansion-panel-header>
<mat-list class="m-gap p-gap" > <mat-list class="m-gap p-gap" >
<div [formGroup]="searchForm" fxLayout="row wrap" fxFlex="100%" fxLayoutGap="35px" fxLayoutAlign="flex-start stretch"> <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-form-field style="width: 20%">
<mat-select multiple formControlName="pd_status" placeholder="PD Status"> <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}} <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" <input matInput [matDatepicker]="picker" [max]="todaydate"
formControlName="pd_from_date" placeholder="Choose a From date"> formControlName="pd_from_date" placeholder="Choose a From date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> <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>
<mat-form-field style="width:20%"> <mat-form-field style="width:20%">
<input matInput [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" [max]="todaydate" <input matInput [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" [max]="todaydate"
formControlName="pd_to_date" placeholder="Choose a To date"> formControlName="pd_to_date" placeholder="Choose a To date">
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle> <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>
<mat-form-field style="width:20%"> <mat-form-field style="width:20%">
<mat-select multiple formControlName="pd_products" placeholder="Products"> <mat-select multiple formControlName="pd_products" placeholder="Products">

View File

@ -22,6 +22,16 @@ export class AdvanceFilterComponent implements OnInit {
PRODUCTS: any =[]; PRODUCTS: any =[];
xpandStatus:boolean=false; xpandStatus:boolean=false;
pipe=new DatePipe('en-US'); 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) { constructor(private _fb:FormBuilder,private _pd:PdTrigerService,private salesPDService:SalesPdService) {
this.todaydate = new Date(); this.todaydate = new Date();
this.getDropdown(); this.getDropdown();
@ -36,6 +46,7 @@ export class AdvanceFilterComponent implements OnInit {
pd_lender:[''], pd_lender:[''],
pd_applicant_name:[''], pd_applicant_name:[''],
pd_officer:[''], pd_officer:[''],
sales_pd_type:['']
}) })
console.log(this.drop_down_datas) console.log(this.drop_down_datas)
} }

View File

@ -32,7 +32,9 @@
</ng-container> </ng-container>
<ng-container matColumnDef="SalesPdSno"> <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" > <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> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="Applicant Name"> <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> <span style="text-align: center;font-weight:400;font-size: 17px;"> <small mat-line>{{details.abbr}}</small></span>
</mat-cell> </mat-cell>
</ng-container> </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"> <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 == 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> <span style="font-weight:500" *ngIf="details.sales_pd_type == 1"> <small mat-line>Physical PD</small></span>
</mat-cell> </mat-cell>
</ng-container> </ng-container> -->
<ng-container matColumnDef="Officer Name"> <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;"> <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> <span *ngIf="!details.officer_name" mat-line>

View File

@ -13,7 +13,7 @@ export class SalesPdComponent implements OnInit {
public dataSourceTab4 = new MatTableDataSource(); public dataSourceTab4 = new MatTableDataSource();
filter_input:string=''; 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(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;

View File

@ -5,8 +5,9 @@ import { SalesPdRoutingModule } from './sales-pd-routing.module';
import { SalesPdComponent } from './sales-pd-list/sales-pd.component'; import { SalesPdComponent } from './sales-pd-list/sales-pd.component';
import { MaterialModule } from './material_modules/material.module'; import { MaterialModule } from './material_modules/material.module';
import { MisReportsComponent } from './mis-reports/mis-reports.component'; 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 { AdvanceFilterComponent } from './sales-pd-list/advance-filter/advance-filter.component';
import { MAT_MOMENT_DATE_FORMATS, MomentDateAdapter } from '@angular/material-moment-adapter';
@NgModule({ @NgModule({
imports: [ imports: [
@ -15,6 +16,7 @@ import { AdvanceFilterComponent } from './sales-pd-list/advance-filter/advance-f
MaterialModule MaterialModule
], ],
declarations: [SalesPdComponent, MisReportsComponent, AdvanceFilterComponent], 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 { } export class SalesPdModule { }