final remarks form details : kdk

This commit is contained in:
dineshkumarkannan 2018-12-19 18:41:46 +05:30
parent 47dc9cedeb
commit da7fff44d4
6 changed files with 331 additions and 2 deletions

View File

@ -0,0 +1,31 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">{{pageTitle}}</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right"
mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
<div *ngIf="noRecordsFound" style="max-width: 100vw !important;width: 100% !important;height: 95% !important;">
<form [formGroup]="_finalRemarkForm" (submit)="onSubmit()" novalidate>
<mat-dialog-content>
<mat-card>
<mat-form-field style="width: 100%">
<mat-select placeholder="Customer Behaviour" formControlName="final_custormer_remark_type">
<mat-option *ngFor="let pm of m_remarkTypeCustomerBehaviour" [value]="pm.customer_behaviour_id">{{ pm.description }}</mat-option>
</mat-select>
</mat-form-field>
</mat-card>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="final_form_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
</form>
</div>

View File

@ -0,0 +1,96 @@
// .example-full-width{
// width : 100%;
// }
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
// ::ng-deep .cdk-overlay-pane{
// max-width: 100vw !important;
// width: 100% !important;
// height: 95% !important;
// }
.mat-card-content {
background-color: white;
}
.mat-card-actions {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-form-field {
margin: 0 2%;
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
$product-bg-color-hover: rgba(103, 58, 183, 0.7);
.p-list-main {
background: white;
margin: auto;
position: relative;
overflow: hidden !important;
border-radius: 10px 10px 10px 10px;
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
&:hover {
transform: scale(1);
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
}
.p-list {
position: relative;
.top {
height: 100%;
width: 100%;
// background: url(https://s-media-cache-ak0.pinimg.com/736x/49/80/6f/49806f3f1c7483093855ebca1b8ae2c4.jpg) no-repeat center center;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
}
.bottom {
width: 200%;
height: 15%;
transition: transform 0.5s;
h1 {
margin: 0;
padding: 0;
}
p {
margin: 0;
padding: 0;
}
.left {
height: 100%;
width: 50%;
background: #f4f4f4;
position: relative;
float: left;
.details {
padding: 5px;
float: left;
// width: calc(70% - 40px);
}
}
.right {
width: 50%;
background: #A6CDDE;
color: white;
float: right;
height: 200%;
overflow: hidden;
.details {
padding: 20px;
float: right;
width: calc(70% - 40px);
}
}
}
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FinalRemarksComponent } from './final-remarks.component';
describe('FinalRemarksComponent', () => {
let component: FinalRemarksComponent;
let fixture: ComponentFixture<FinalRemarksComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FinalRemarksComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FinalRemarksComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,162 @@
import {
Component,
OnInit,
Inject,
Input
} from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from '@angular/router';
import { analyzeAndValidateNgModules } from '@angular/compiler';
@Component({
selector: 'app-final-remarks',
templateUrl: './final-remarks.component.html',
styleUrls: ['./final-remarks.component.scss']
})
export class FinalRemarksComponent implements OnInit {
pageTitle: string = "Final Remarks Details";
//@Input() pdid: number;
pdid: string;
form_id: number;
public _finalRemarkForm: FormGroup;
public submitted = false;
public m_remarkTypeCustomerBehaviour = [];
private notifier: NotifierService;
constructor(
notifier: NotifierService,
private _formBuilder: FormBuilder,
private pdTrigerService: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 20;
this.notifier = notifier;
this._finalRemarkForm = this._formBuilder.group({
pdid: [this.pdid],
formid: ['20'],
final_custormer_remark_type : [],
final_form_remarks: []
});
this.getM_Type();
}
public viewerOptions: any = {
navbar: false,
toolbar: {
zoomIn: 4,
zoomOut: 4,
oneToOne: 4,
reset: 4,
prev: 4,
play: {
show: 4,
size: 'large',
},
next: 4,
rotateLeft: 4,
rotateRight: 4,
flipHorizontal: 4,
flipVertical: 4,
}
};
noRecordsFound: Boolean = false;
ngOnInit() {
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '20').subscribe(data=>{
if(data.dataStatus){
this._finalRemarkForm.controls.final_custormer_remark_type.setValue(data.records.final_custormer_remark_type);
this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks);
this.noRecordsFound = true;
} else {
this.noRecordsFound = true;
}
}, err => {
})
}
getM_Type() {
this.pdTrigerService.getAllMasterDatas('CUSTOMERBEHAVIOUR').subscribe(
data => {
this.m_remarkTypeCustomerBehaviour = data.records.filter(data => data.isactive == 1);
},
error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
// ==================
/** To Save/Edited Popup Data */
onSubmit() {
this.submitted = true;
// stop here if form is invalid
if (this._finalRemarkForm.invalid) {
return;
} else {
var answerFormValues = this._finalRemarkForm.value;
//To Remove The "Null" With Key also
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
console.log(JSON.stringify(answerFormValues));
//Add BRANCH data with help Service File
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {
if (dataresult.status == 200) {
// console.log(dataresult);
this.notifier.notify('success', 'Record Saved Successfully.!');
// this.dialogRef.close();
// alert("sample alert for Saving");
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// this.errorMessage = "Some Thing Wents Wrong Try Again !";
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// this.errorMessage = "Something Wents Wrong Try Again !";
// this.dialogRef.close();
});
// //After Saving the BRANCH data then popup close
// // this.dialogRef.close();
}
}
/** To Reset Popup Data */
onReset() {
// this._addQuesFrom.reset();
}
/** On Key Press Event For Mobile Number */
keyPress(event: any) {
const pattern = /[0-9]/;
let inputChar = String.fromCharCode(event.charCode);
if (event.keyCode != 8 && !pattern.test(inputChar)) {
event.preventDefault();
}
}
}

View File

@ -25,6 +25,8 @@ import {LenderRepresentativeComponent} from './forms/lender-representative/lende
import {LoanDetailsComponent} from './forms/loan-details/loan-details.component';
import {GeneralInfoComponent} from './forms/general-info/general-info.component';
import {NeighbourHoodComponent} from './forms/neighbour-hood/neighbour-hood.component';
import {FinalRemarksComponent} from './forms/final-remarks/final-remarks.component';
@Component({
selector: 'app-start-pd',
templateUrl: './start-pd.component.html',
@ -897,6 +899,18 @@ pdFullDetails:any=[];
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD);
});
}else if(this.selectedFormsCategory.form_id==20){
const generaldialogRef = this.dialog.open(FinalRemarksComponent, {
data: this.pdFullDetails,
position: { right: '0'},
width:'80%',
disableClose: true
});
generaldialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD);
});
}

View File

@ -82,6 +82,7 @@ import { NeighbourHoodComponent } from './list-pd/start-pd/forms/neighbour-hood/
// import ngx-viewer module
import { NgxViewerModule } from 'ngx-viewer';
import { FinalRemarksComponent } from './list-pd/start-pd/forms/final-remarks/final-remarks.component';
/**
* Custom angular notifier options
@ -259,7 +260,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
// OwlNativeDateTimeModule,
// ],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService],
@ -300,7 +301,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
providers: [PdTrigerService, GetGeometricLocationService],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion],
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent],
})
export class ManagePdModule {