forms : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-03-11 19:54:15 +05:30
parent c23addbc7c
commit 1fff549130
35 changed files with 9756 additions and 8547 deletions

View File

@ -3,7 +3,8 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">-
{{subproduct_abbr}} </span></span><br>
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
@ -138,8 +139,8 @@
<div fxFlex="100" fxLayout="nowrap">
<mat-form-field style="width: 46%;">
<input matInput [placeholder]="placeholderName[i] ? placeholderName[i] : 'Estimated area of the (Address Type)'" formControlName="estimated_area"
OnlyNumber type="text">
<input matInput [placeholder]="placeholderName[i] ? placeholderName[i] : 'Estimated area of the (Address Type)'"
formControlName="estimated_area" OnlyNumber type="text">
</mat-form-field>
<mat-form-field style="width: 46%;">

View File

@ -28,7 +28,7 @@ export class AddressComponent implements OnInit {
main_applicant: any;
pageTitle: string = "PD Address Details";
disableAfterSubmit : boolean = false;
disableAfterSubmit: boolean = false;
/**Declaration of FormField Variables */
//@Input() pdid: number;
pdid: number;
@ -54,7 +54,7 @@ export class AddressComponent implements OnInit {
uomData: any = [];
addressesList: any = [];
otherPincodeFlag:any = [];
otherPincodeFlag: any = [];
/**Declaration of FormField Variables */
private notifier: NotifierService;
@ -113,40 +113,40 @@ export class AddressComponent implements OnInit {
this._pd.retriveForm(params).subscribe(data => {
const control = <FormArray>this.addressForm.controls['addresses'];
if (data.status == 200) {
// console.log('data.records',data.records);
// console.log('data.records.addresses',data.records.addresses);
if (data.records.addresses.length == 0) {
control.push(this.createAddresses(null));
// this.loadPDAddressesDetails();
} else {
data.records.addresses.forEach((datas,index) => {
let obj = {
'address': datas.address,
'address_type': datas.address_type,
'address_type_others': datas.address_type_others,
'state': datas.state,
'city': datas.city,
'pincode': datas.pincode,
'pincode_others': datas.pincode_others,
'locality': datas.locality,
'locality_others': datas.locality_others,
'locality_mixuse': datas.locality_mixuse,
'pd_location': datas.pd_location,
'comment_locality': datas.comment_locality,
'estimated_area': datas.estimated_area,
'uom': datas.uom,
'uom_others': datas.uom_others
}
this.getCityAndPincodeDetails(datas.state,index);
this.getOtherPincode(datas.pincode,index);
let selectedAddressType = this.addressData.filter(element => element.address_type_id == datas.address_type)[0];
this.selectedAddressType(selectedAddressType.address_type,index);
if (datas.address_type == 1) {
this.selectedAddressType(datas.address_type_others,index);
}
control.push(this.createAddresses(obj));
});
// console.log('data.records',data.records);
// console.log('data.records.addresses',data.records.addresses);
if (data.records.addresses.length == 0) {
control.push(this.createAddresses(null));
// this.loadPDAddressesDetails();
} else {
data.records.addresses.forEach((datas, index) => {
let obj = {
'address': datas.address,
'address_type': datas.address_type,
'address_type_others': datas.address_type_others,
'state': datas.state,
'city': datas.city,
'pincode': datas.pincode,
'pincode_others': datas.pincode_others,
'locality': datas.locality,
'locality_others': datas.locality_others,
'locality_mixuse': datas.locality_mixuse,
'pd_location': datas.pd_location,
'comment_locality': datas.comment_locality,
'estimated_area': datas.estimated_area,
'uom': datas.uom,
'uom_others': datas.uom_others
}
this.getCityAndPincodeDetails(datas.state, index);
this.getOtherPincode(datas.pincode, index);
let selectedAddressType = this.addressData.filter(element => element.address_type_id == datas.address_type)[0];
this.selectedAddressType(selectedAddressType.address_type, index);
if (datas.address_type == 1) {
this.selectedAddressType(datas.address_type_others, index);
}
control.push(this.createAddresses(obj));
});
}
// this.addressForm.controls.address.setValue(data.records.address);
@ -201,7 +201,7 @@ export class AddressComponent implements OnInit {
this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
}
else{
else {
this.loadPDAddressesDetails();
}
// else {
@ -210,45 +210,45 @@ export class AddressComponent implements OnInit {
});
}
loadPDAddressesDetails(){
loadPDAddressesDetails() {
const control = <FormArray>this.addressForm.controls['addresses'];
this._pd.getAddressesDetails(this.pdid).subscribe(
data => {
if (data.status == 200) {
this.addressesList = data.records.filter(item => item.isactive == 1);
// console.log('this.addressesList',this.addressesList);
if (data.status == 200) {
this.addressesList = data.records.filter(item => item.isactive == 1);
// console.log('this.addressesList',this.addressesList);
if (this.addressesList.length > 0) {
this.addressesList.forEach((val,index)=>{
let obj = {
'address': val.addressline1,
'address_type': '',
'address_type_others': '',
'state': val.fk_state,
'city': val.fk_city,
'pincode': val.pincode_id,
'pincode_others': val.other_pincode,
'locality': '',
'locality_others': '',
'locality_mixuse': '',
'pd_location': '',
'comment_locality': '',
'estimated_area': '',
'uom': '',
'uom_others': ''
if (this.addressesList.length > 0) {
this.addressesList.forEach((val, index) => {
let obj = {
'address': val.addressline1,
'address_type': '',
'address_type_others': '',
'state': val.fk_state,
'city': val.fk_city,
'pincode': val.pincode_id,
'pincode_others': val.other_pincode,
'locality': '',
'locality_others': '',
'locality_mixuse': '',
'pd_location': '',
'comment_locality': '',
'estimated_area': '',
'uom': '',
'uom_others': ''
}
this.getCityAndPincodeDetails(val.fk_state, index);
this.getOtherPincode(val.pincode_id, index);
control.push(this.createAddresses(obj));
});
}
this.getCityAndPincodeDetails(val.fk_state,index);
this.getOtherPincode(val.pincode_id,index);
control.push(this.createAddresses(obj));
});
// else{
// control.push(this.createAddresses(null));
// }
}
// else{
// else{
// control.push(this.createAddresses(null));
// }
}
// else{
// control.push(this.createAddresses(null));
// }
// }
});
}
// getM_Address_Type() {
@ -282,58 +282,58 @@ export class AddressComponent implements OnInit {
// this.uom = this.addressForm.controls['uom'];
}
/** FOR Adress */
createAddresses(AddressDetails): FormGroup {
if(AddressDetails != null){
return this.fb.group({
address: [AddressDetails.address, Validators.compose([Validators.required])],
address_type: [AddressDetails.address_type, Validators.compose([Validators.required])],
address_type_others: [AddressDetails.address_type_others],
state: [AddressDetails.state],
city: [AddressDetails.city],
pincode: [AddressDetails.pincode],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
pincode_others: [AddressDetails.pincode_others, Validators.compose([Validators.minLength(6), Validators.maxLength(6)])],
locality: [AddressDetails.locality, Validators.compose([Validators.required])],
locality_others: [AddressDetails.locality_others],
locality_mixuse: [AddressDetails.locality_mixuse],
pd_location: [AddressDetails.pd_location, Validators.compose([Validators.required])],
comment_locality: [AddressDetails.comment_locality, Validators.compose([Validators.required])],
estimated_area: [AddressDetails.estimated_area],
uom: [AddressDetails.uom],
uom_others: [AddressDetails.uom_others]
});
/** FOR Adress */
createAddresses(AddressDetails): FormGroup {
if (AddressDetails != null) {
return this.fb.group({
address: [AddressDetails.address, Validators.compose([Validators.required])],
address_type: [AddressDetails.address_type, Validators.compose([Validators.required])],
address_type_others: [AddressDetails.address_type_others],
state: [AddressDetails.state],
city: [AddressDetails.city],
pincode: [AddressDetails.pincode],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
pincode_others: [AddressDetails.pincode_others, Validators.compose([Validators.minLength(6), Validators.maxLength(6)])],
locality: [AddressDetails.locality, Validators.compose([Validators.required])],
locality_others: [AddressDetails.locality_others],
locality_mixuse: [AddressDetails.locality_mixuse],
pd_location: [AddressDetails.pd_location, Validators.compose([Validators.required])],
comment_locality: [AddressDetails.comment_locality, Validators.compose([Validators.required])],
estimated_area: [AddressDetails.estimated_area],
uom: [AddressDetails.uom],
uom_others: [AddressDetails.uom_others]
});
}
else {
return this.fb.group({
address: ['', Validators.compose([Validators.required])],
address_type: ['', Validators.compose([Validators.required])],
address_type_others: [''],
state: [''],
city: [''],
pincode: [''],
pincode_others: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(6)])],
locality: ['', Validators.compose([Validators.required])],
locality_others: [''],
locality_mixuse: [''],
pd_location: ['', Validators.compose([Validators.required])],
comment_locality: ['', Validators.compose([Validators.required])],
estimated_area: [''],
uom: [''],
uom_others: ['']
});
}
}
else{
return this.fb.group({
address: ['', Validators.compose([Validators.required])],
address_type: ['', Validators.compose([Validators.required])],
address_type_others: [''],
state: [''],
city: [''],
pincode: [''],
pincode_others: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(6)])],
locality: ['', Validators.compose([Validators.required])],
locality_others: [''],
locality_mixuse: [''],
pd_location: ['', Validators.compose([Validators.required])],
comment_locality: ['', Validators.compose([Validators.required])],
estimated_area: [''],
uom: [''],
uom_others: ['']
});
}
}
// addAddresses() {
// const address_control = <FormArray>this.addressForm.controls['addresses'];
// address_control.push(this.createAddresses(null));
// }
// addAddresses() {
// const address_control = <FormArray>this.addressForm.controls['addresses'];
// address_control.push(this.createAddresses(null));
// }
// removeAddresses(index: number) {
// const address_control = <FormArray>this.addressForm.controls['addresses'];
// address_control.removeAt(index);
// }
// removeAddresses(index: number) {
// const address_control = <FormArray>this.addressForm.controls['addresses'];
// address_control.removeAt(index);
// }
/** To Get Dropdown Data For Address Form */
getMasterDetails(table: string, type: number) {
@ -364,7 +364,7 @@ createAddresses(AddressDetails): FormGroup {
/** To Get City And Pincode Data For Address Form
* Param 'stateID' -> selected StateId
*/
getCityAndPincodeDetails(stateID: string,index) {
getCityAndPincodeDetails(stateID: string, index) {
this._pd.getStateWiseCities(stateID).subscribe(data => {
if (data.status == 200) {
this.cityData[index] = data.records.cities;
@ -373,7 +373,7 @@ createAddresses(AddressDetails): FormGroup {
});
}
getOtherPincode(e,i){ this.otherPincodeFlag[i] = e == 1 ? true : false;}
getOtherPincode(e, i) { this.otherPincodeFlag[i] = e == 1 ? true : false; }
/** TO Save Address Forms Details*/
onSubmit() {
// let addressesArrayValues = this.addressForm.controls.addresses.value;
@ -436,7 +436,7 @@ createAddresses(AddressDetails): FormGroup {
return;
}
if(this.addressForm.value.bussiness_activity_remark == ''){
if (this.addressForm.value.bussiness_activity_remark == '') {
this.notifier.notify('warning', 'Fill Remark!');
this.disableAfterSubmit = false;
return;
@ -471,7 +471,7 @@ createAddresses(AddressDetails): FormGroup {
// records.uom = this.uom.value;
// records.uom_others = records.uom == 1 ?
// this.addressForm.controls.uom_others.value : '';
// this.addressForm.controls.uom_others.value : '';
records.pdid = this.pdid;
records.formid = '5';
@ -500,7 +500,7 @@ createAddresses(AddressDetails): FormGroup {
/** For PlaceHolder
* selected AddressType is concate with label */
selectedAddressType(e: any,i) {
selectedAddressType(e: any, i) {
this.placeholderName[i] = 'Estimated area of the ' + e;
}

View File

@ -1,132 +1,147 @@
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_assetsQuesFrom" (submit)="onSubmit()" novalidate>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
{{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>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">-
{{subproduct_abbr}} </span></span><br>
{{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>
<mat-dialog-content>
<mat-dialog-content>
<mat-tab-group>
<mat-tab label={{pageTitle}}>
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-tab-group>
<mat-tab label={{pageTitle}}>
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card style="min-height: 550px;">
<mat-card-content>
<div fxLayout="row" fxLayoutAlign="start none">
<div formArrayName="assets_details" fxFill>
<div *ngFor="let sup of _assetsQuesFrom.controls.assets_details['controls']; let i=index; let last=last">
<mat-card>
<mat-card-content>
<div [formGroupName]="i">
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width:100%">
<mat-select (selectionChange)="selectedAssetsType($event,i,1)" placeholder="Assets Type" formControlName="assets_mode" requried>
<mat-option>Select</mat-option>
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<!--Desction Dynamic details: START-->
<div formArrayName="details" class="example-full-width">
<!--Property-->
<div *ngIf="sup.get('assets_mode').value == 2 ">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<mat-select placeholder="Property Type" formControlName="property_type" (selectionChange)="setRequiredValidation($event.value,i,s,1)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="detail.get('property_type').value == 1" style="width:45%">
<input matInput placeholder="Specify Other Property Type" formControlName="other_property_type" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != ''">
<input matInput placeholder="Address of the Property" formControlName="address_of_the_property"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != ''">
<input matInput placeholder="Description of the Property" formControlName="describe_of_the_property_asset"
autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<input matInput placeholder="Area Covered" formControlName="area_covered_by_this_property"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select placeholder="Unit of Measurement" formControlName="uom_of_the_property" (selectionChange)="setRequiredValidation($event.value,detail,6)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let uom of m_uom_type" [value]="uom.uom_id">{{ uom.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="detail.get('uom_of_the_property').value == 1" style="width:45%">
<input matInput placeholder="Specify Unit of Measurement" formControlName="other_uom" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Four Wheeler-->
<div *ngIf="sup.get('assets_mode').value == 3">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<mat-select placeholder="Type of Vehicle" formControlName="vehicle_type" (selectionChange)="setRequiredValidation($event.value,detail,5)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let vehicle of m_vehicle_type" [value]="vehicle.vehicle_type_id">{{ vehicle.vehicle_type_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('vehicle_type').value == 1">
<input matInput placeholder=" Specify Vehicle" formControlName="other_vehicle_type" autocomplete="off">
</mat-form-field>
<!-- <mat-form-field style="width:40%"> -->
<!--<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" autocomplete="off">
<mat-card style="min-height: 550px;">
<mat-card-content>
<div fxLayout="row" fxLayoutAlign="start none">
<div formArrayName="assets_details" fxFill>
<div *ngFor="let sup of _assetsQuesFrom.controls.assets_details['controls']; let i=index; let last=last">
<mat-card>
<mat-card-content>
<div [formGroupName]="i">
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width:100%">
<mat-select (selectionChange)="selectedAssetsType($event,i,1)" placeholder="Assets Type"
formControlName="assets_mode" requried>
<mat-option>Select</mat-option>
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<!--Desction Dynamic details: START-->
<div formArrayName="details" class="example-full-width">
<!--Property-->
<div *ngIf="sup.get('assets_mode').value == 2 ">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<mat-select placeholder="Property Type" formControlName="property_type"
(selectionChange)="setRequiredValidation($event.value,i,s,1)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{
prop.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="detail.get('property_type').value == 1" style="width:45%">
<input matInput placeholder="Specify Other Property Type" formControlName="other_property_type"
autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != ''">
<input matInput placeholder="Address of the Property" formControlName="address_of_the_property"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != ''">
<input matInput placeholder="Description of the Property" formControlName="describe_of_the_property_asset"
autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<input matInput placeholder="Area Covered" formControlName="area_covered_by_this_property"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select placeholder="Unit of Measurement" formControlName="uom_of_the_property"
(selectionChange)="setRequiredValidation($event.value,detail,6)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let uom of m_uom_type" [value]="uom.uom_id">{{ uom.name
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="detail.get('uom_of_the_property').value == 1" style="width:45%">
<input matInput placeholder="Specify Unit of Measurement" formControlName="other_uom"
autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Four Wheeler-->
<div *ngIf="sup.get('assets_mode').value == 3">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<mat-select placeholder="Type of Vehicle" formControlName="vehicle_type"
(selectionChange)="setRequiredValidation($event.value,detail,5)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let vehicle of m_vehicle_type" [value]="vehicle.vehicle_type_id">{{
vehicle.vehicle_type_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('vehicle_type').value == 1">
<input matInput placeholder=" Specify Vehicle" formControlName="other_vehicle_type"
autocomplete="off">
</mat-form-field>
<!-- <mat-form-field style="width:40%"> -->
<!--<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" autocomplete="off">
<mat-form-field style="width:30%">-->
<!-- <input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_vehicle" autocomplete="off"> -->
<!-- </mat-form-field> -->
<mat-form-field style="width:45%">
<input matInput placeholder="Description of Vehicle (example -Toyota Altis)" formControlName="manufacturer_model_vehicle" autocomplete="off">
</mat-form-field>
<!-- <input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_vehicle" autocomplete="off"> -->
<!-- </mat-form-field> -->
<mat-form-field style="width:45%">
<input matInput placeholder="Description of Vehicle (example -Toyota Altis)"
formControlName="manufacturer_model_vehicle" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!-- Eqipment Manufacturing -->
</div>
</div>
</div>
</div>
<!-- Eqipment Manufacturing -->
<div *ngIf="sup.get('assets_mode').value == 4">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div *ngIf="sup.get('assets_mode').value == 4">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<!--<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<!--<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" autocomplete="off">-->
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description" formControlName="equipment_manufacturing_description" >
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description" formControlName="equipment_manufacturing_description">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--jwell details -->
<!--<div *ngIf="sup.get('assets_mode').value == 5">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--jwell details -->
<!--<div *ngIf="sup.get('assets_mode').value == 5">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
@ -139,8 +154,8 @@
</div>
</div>
</div>-->
<!--Consumer Durable-->
<!-- <div *ngIf="sup.get('assets_mode').value == 6">
<!--Consumer Durable-->
<!-- <div *ngIf="sup.get('assets_mode').value == 6">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -152,95 +167,111 @@
</div>
</div> -->
<!--Insurance-->
<div *ngIf="sup.get('assets_mode').value == 6">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,s,6)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}} {{OtherPremiumPaidInwords[s]}} Only</mat-hint>
<!-- <mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{ "&#8377;" + detail.get('premium_paid').value | numberToWords + 'Only'}} </mat-hint> -->
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" (selectionChange)="setRequiredValidation($event.value,detail,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('frequency_mode').value == 1 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
</mat-form-field>
</div>
<!--Insurance-->
<div *ngIf="sup.get('assets_mode').value == 6">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,s,6)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}}
{{OtherPremiumPaidInwords[s]}} Only</mat-hint>
<!-- <mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{ "&#8377;" + detail.get('premium_paid').value | numberToWords + 'Only'}} </mat-hint> -->
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select placeholder="Frequency" formControlName="frequency_mode"
(selectionChange)="setRequiredValidation($event.value,detail,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{
freqn.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('frequency_mode').value == 1 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode"
autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,s,8)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}} {{OtherSumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,s,8)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}}
{{OtherSumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:45%">
<input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%">
<input matInput placeholder="Members Covered" formControlName="members_coverd"
autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Investments-->
<div *ngIf="sup.get('assets_mode').value == 7">
<div>
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!--Investments-->
<div *ngIf="sup.get('assets_mode').value == 7">
<div>
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<mat-select placeholder="Type" formControlName="investments_type" (selectionChange)="setRequiredValidation($event.value,detail,3)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select placeholder="Type" formControlName="investments_type"
(selectionChange)="setRequiredValidation($event.value,detail,3)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{
ins_type.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('investments_type').value == 1">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('investments_type').value == 1">
<input matInput placeholder="Specify Type" formControlName="other_investments_type"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:54%" *ngIf="detail.get('investments_type').value == 6 || detail.get('investments_type').value == 5 || detail.get('investments_type').value == 4">
<input matInput autocomplete="off" placeholder="Name of organisation in which investment done" formControlName="in_which_organisation">
</mat-form-field>
<mat-form-field style="width:54%" *ngIf="detail.get('investments_type').value == 6 || detail.get('investments_type').value == 5 || detail.get('investments_type').value == 4">
<input matInput autocomplete="off" placeholder="Name of organisation in which investment done"
formControlName="in_which_organisation">
</mat-form-field>
<mat-form-field style="width:45%">
<input matInput placeholder="Current Market Value" formControlName="amount_of_invest" OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,10)">
<mat-form-field style="width:45%">
<input matInput placeholder="Current Market Value" formControlName="amount_of_invest"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,10)">
<!--<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>-->
<!--<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>-->
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}}
{{OtherAmtInvestInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%" *ngIf="detail.get('investments_type').value == 1 || detail.get('investments_type').value == 2 || detail.get('investments_type').value == 3">
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<mat-form-field style="width:45%" *ngIf="detail.get('investments_type').value == 1 || detail.get('investments_type').value == 2 || detail.get('investments_type').value == 3">
<input matInput placeholder="Bank Name" formControlName="bank_name"
autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<!--other assets-->
<div *ngIf="sup.get('assets_mode').value == 1">
<!--other assets-->
<div *ngIf="sup.get('assets_mode').value == 1">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" autocomplete="off">
</mat-form-field>
</div>
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets"
autocomplete="off">
</mat-form-field>
</div>
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<mat-select placeholder="Relation" formControlName="relation" >
@ -252,7 +283,7 @@
</mat-form-field>
</div> -->
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,12)" OnlyNumber type="text">
@ -265,22 +296,26 @@
</mat-select>
</mat-form-field>
</div> -->
</div>
</div>
</div>
</div>
<!--Desction Dynamic details : END -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 5" style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,2)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}} {{OtherAppxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Desction Dynamic details : END -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 5"
style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,2)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}}
{{OtherAppxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:45%"><!-- 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5 || sup.get('assets_mode').value == 6" style="width:45%"> -->
<!-- <mat-select placeholder="Name of the Owner" formControlName="name_of_the_owner" >
<mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:45%">
<!-- 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5 || sup.get('assets_mode').value == 6" style="width:45%"> -->
<!-- <mat-select placeholder="Name of the Owner" formControlName="name_of_the_owner" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option>
</mat-select> -->
<!-- <mat-select multiple placeholder="Name of the Owner"
<!-- <mat-select multiple placeholder="Name of the Owner"
formControlName="name_of_the_owner" [compareWith]="compareObjects" required (selectionChange)="setRequiredValidation($event.value,i,'',4)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
@ -288,22 +323,22 @@
</mat-option>
</mat-optgroup>
</mat-select> -->
<mat-select multiple placeholder="Name of the Owner" formControlName="name_of_the_owner"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,i,'',4)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-select multiple placeholder="Name of the Owner" formControlName="name_of_the_owner"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,i,'',4)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="isOtherOwner[i]" style="width:45%">
<input matInput placeholder="Specify Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
<!-- check -->
<!-- <mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:40%">
<mat-form-field *ngIf="isOtherOwner[i]" style="width:45%">
<input matInput placeholder="Specify Owner Name" formControlName="other_owner"
autocomplete="off">
</mat-form-field>
<!-- check -->
<!-- <mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:40%">
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
@ -311,39 +346,42 @@
</mat-option>
</mat-select>
</mat-form-field> -->
</div>
</div>
<span *ngIf="sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 1">
<span *ngIf="sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 1">
<mat-form-field style="width:45%">
<mat-form-field style="width:45%">
<mat-label>Age of Asset in Years</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="vintage_personal" minlength="1" maxlength="3" OnlyNumber type="text" (keyup)="calculateVintagePurchase($event.target.value,i,3)">
<!-- <mat-error> Invalid format</mat-error> -->
<mat-label>Age of Asset in Years</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="vintage_personal"
minlength="1" maxlength="3" OnlyNumber type="text" (keyup)="calculateVintagePurchase($event.target.value,i,3)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>
<mat-form-field style="width:45%">
</mat-form-field>
<mat-form-field style="width:45%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="purchase_year" minlength="4" maxlength="4" OnlyNumber type="text" (keyup)="calculateVintagePurchase($event.target.value,i,4)">
<!-- <mat-error> Invalid year format</mat-error> -->
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="purchase_year"
minlength="4" maxlength="4" OnlyNumber type="text" (keyup)="calculateVintagePurchase($event.target.value,i,4)">
<!-- <mat-error> Invalid year format</mat-error> -->
</mat-form-field>
</span>
</mat-form-field>
</span>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:95%">
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="emi">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:95%">
<mat-select placeholder="Is There a Loan Existing Against This Asset?"
formControlName="emi">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<!-- <div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
</div>
</div>
<!-- <div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
<div fxFlex="20">
<span *ngIf="_assetsQuesFrom.controls.assets_details.controls.length > 1" (click)="removeAssetsDetails(i,1)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
@ -351,156 +389,208 @@
</div>
</div> -->
</mat-card-content>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="removeAssetsDetails(i,1)"
matTooltip="Delete Other Assets" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="_assetsQuesFrom.controls.assets_details.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addAssetDetails($event,1); false"
matTooltip="Add More" matTooltipPosition="above" color="primary" *ngIf="last">
<strong>Add More Other Asset </strong>
</button>
</div>
<!-- <button type="button" mat-flat-button (click)="removeAssetsDetails(i,1)"
</mat-card-content>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="removeAssetsDetails(i,1)"
matTooltip="Delete Other Assets" matTooltipPosition="above" class="mr-1 mb-1 hover-icon"
*ngIf="_assetsQuesFrom.controls.assets_details.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addAssetDetails($event,1); false"
matTooltip="Add More" matTooltipPosition="above" color="primary" *ngIf="last">
<strong>Add More Other Asset </strong>
</button>
</div>
<!-- <button type="button" mat-flat-button (click)="removeAssetsDetails(i,1)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Other Assets </strong>
</button> -->
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
<!-- <div class="row" style="text-align:right;">
<!-- <div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Asset Details" matTooltipPosition="above"
class="mr-1 mb-1 hover-icon" (click)="addAssetDetails($event,1); false"><mat-icon>add</mat-icon></button>
</div> -->
</mat-card-content>
</mat-card-content>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-dialog-content>
<mat-dialog-actions>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20"
fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20"
fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20"
fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20"
fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20"
fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20"
fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25"
fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25"
fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25"
fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25"
fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20"
fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20"
fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</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="assets_form_remark" autocomplete="off"></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="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="disableAfterSubmit===true" ><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="assets_form_remark" autocomplete="off"></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="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above"
type="submit" [disabled]="disableAfterSubmit===true">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>
<notifier-container></notifier-container>

View File

@ -35,7 +35,7 @@ export class AssetsInfoComponent implements OnInit {
main_applicant: any;
pageTitle: string = "Other Assets Details";
//@Input() pdid: number;
pdid:string;
pdid: string;
//businessProfessionName :string;
public _assetsQuesFrom: FormGroup;
@ -43,18 +43,18 @@ export class AssetsInfoComponent implements OnInit {
public m_assets_type = [];
public applicants: any;
otherEmiamtFlag : boolean = false;
businessEmiAmtFlag : boolean = false;
isOtherOwner:any = [];
disableAfterSubmit : boolean = false;
otherEmiamtFlag: boolean = false;
businessEmiAmtFlag: boolean = false;
isOtherOwner: any = [];
disableAfterSubmit: boolean = false;
public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"},
{'value': "no",'viewValue': "No"},
{'value': "nan",'viewValue': "NA"}]
public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" },
{ 'value': "no", 'viewValue': "No" },
{ 'value': "nan", 'viewValue': "NA" }]
// appxMarketAmtInwords : any = [];
OtherAppxMarketAmtInwords : any = [];
OtherAppxMarketAmtInwords: any = [];
// emiAmtInwords : any = [];
OtherEmiAmtInwords : any = [];
OtherEmiAmtInwords: any = [];
// PremiumPaidInwords : any = [];
OtherPremiumPaidInwords: any = [];
// SumAssuredInwords: any = [];
@ -77,95 +77,95 @@ export class AssetsInfoComponent implements OnInit {
public m_uom_type = [];
private notifier: NotifierService;
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
currentYear:any=new Date().getFullYear();
existCompanyList: any = [];
mergeCompanyApplicant: any = [];
currentYear: any = new Date().getFullYear();
constructor(
notifier: NotifierService,
private _formBuilder: FormBuilder,
private pdTrigerService: PdTrigerService,
private dialogRef: MatDialogRef<AssetsInfoComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(val=>val.applicant_type==0 || val.applicant_type==1)
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(val => val.applicant_type == 0 || val.applicant_type == 1)
this.applicants.push({ 'pd_co_applicant_id': '0', 'applicant_name': 'Others' });
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
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,
}
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,
}
};
ngOnInit() {
// this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
// this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
// });
// this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
// this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
// });
this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if (data.dataStatus) {
this.existCompanyList = data.records.filter(val => val.is_active === true);
}
this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data => {
if (data.dataStatus) {
this.existCompanyList = data.records.filter(val => val.is_active === true);
}
// get company list
let modifyCompanyList: any = [];
if (this.existCompanyList.length > 0) {
modifyCompanyList = this.existCompanyList.map(element => {
return { id: element.company_order_id.toString(), name: element.company_name, group_id: 1 };
});
this.mergeCompanyApplicant.push({ groupName: 'COMPANIES', groupValues: modifyCompanyList })
}
// get applicant list
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
// get company list
let modifyCompanyList: any = [];
if (this.existCompanyList.length > 0) {
modifyCompanyList = this.existCompanyList.map(element => {
return { id: element.company_order_id.toString(), name: element.company_name, group_id: 1 };
});
this.mergeCompanyApplicant.push({ groupName: 'COMPANIES', groupValues: modifyCompanyList })
}
// get applicant list
let modifyApplicantList: any = [];
if (this.applicants.length > 0) {
modifyApplicantList = this.applicants.map(element => {
return { id: element.pd_co_applicant_id, name: element.applicant_name, group_id: 2 };
});
this.mergeCompanyApplicant.push({ groupName: 'APPLICANTS', groupValues: modifyApplicantList })
}
}
})
this.getPdSupplierFormDetails();
this.getM_Assets_Type();
this.getM_PropertyType();
this.getM_InvestmentType();
this.getM_FreqOfPurchase();
//this.getM_Relation();
//this.getM_InsuranceType();
this.getM_Vehicle_Type();
this.getM_UOM_Type();
})
this.getPdSupplierFormDetails();
this.getM_Assets_Type();
this.getM_PropertyType();
this.getM_InvestmentType();
this.getM_FreqOfPurchase();
//this.getM_Relation();
//this.getM_InsuranceType();
this.getM_Vehicle_Type();
this.getM_UOM_Type();
}
// ======================
// ======================
getM_Assets_Type() {
this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe(
data => {
this.m_assets_type = data.records.filter(data => data.isactive == 1 && data.id != 5
);
);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
@ -174,7 +174,7 @@ export class AssetsInfoComponent implements OnInit {
)
}
getM_PropertyType() {
getM_PropertyType() {
this.pdTrigerService.getAllMasterDatas('PROPERTIES').subscribe(
data => {
this.m_propertyType = data.records.filter(data => data.isactive == 1);
@ -186,7 +186,7 @@ export class AssetsInfoComponent implements OnInit {
)
}
getM_InvestmentType() {
getM_InvestmentType() {
this.pdTrigerService.getAllMasterDatas('INVESTMENTTYPE').subscribe(
data => {
this.m_investmentType = data.records.filter(data => data.isactive == 1);
@ -221,7 +221,7 @@ export class AssetsInfoComponent implements OnInit {
)
}
getM_Vehicle_Type(){
getM_Vehicle_Type() {
this.pdTrigerService.getAllMasterDatas('VEHICLETYPE').subscribe(
data => {
this.m_vehicle_type = data.records.filter(data => data.is_active == 1);
@ -231,25 +231,25 @@ export class AssetsInfoComponent implements OnInit {
getM_UOM_Type() {
this.pdTrigerService.getAllMasterDatas('UOM').subscribe(
data => {
this.m_uom_type = data.records.filter(data => data.isactive == 1 && data. is_land_uom == 1 || data. is_land_uom == 2);
// console.log('this.m_uom_type',data.records,this.m_uom_type);
//
this.m_uom_type = data.records.filter(data => data.isactive == 1 && data.is_land_uom == 1 || data.is_land_uom == 2);
})
}
// getM_InsuranceType() {
// this.pdTrigerService.getAllMasterDatas('INSURANCETYPE').subscribe(
// data => {
// this.m_insuranceType = data.records.filter(data => data.isactive == 1);
// },
// error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
// }
// )
// this.pdTrigerService.getAllMasterDatas('INSURANCETYPE').subscribe(
// data => {
// this.m_insuranceType = data.records.filter(data => data.isactive == 1);
// },
// error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
// }
// )
//}
// =============================
// =============================
apiLoadFinish: boolean = false;
getPdSupplierFormDetails() {
@ -279,7 +279,7 @@ export class AssetsInfoComponent implements OnInit {
// this.initDetails(),
]),
// business_assets_details : this._formBuilder.array([]),
assets_form_remark:[value.assets_form_remark]
assets_form_remark: [value.assets_form_remark]
});
this.addAssetsDetailsWithData(value.assets_details);
// this.addBusinessAssetsDetailsWithData(value.business_assets_details);
@ -293,7 +293,7 @@ export class AssetsInfoComponent implements OnInit {
// business_assets_details : this._formBuilder.array([
// this.initBusinessDetails(),
// ]),
assets_form_remark:['']
assets_form_remark: ['']
});
}
this.loadDetails = true;
@ -313,19 +313,19 @@ export class AssetsInfoComponent implements OnInit {
details: this._formBuilder.array([]),
approximate_market_value: [''],
name_of_the_owner: [''],
other_owner:[''],
// relation: [''],
vintage_personal : [''],
purchase_year: ['',Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
other_owner: [''],
// relation: [''],
vintage_personal: [''],
purchase_year: ['', Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
//purchase_month: [''],
emi: [''],
});
}
show: boolean;
selectedAssetsType(e: any, i: any,flag : any): void {
selectedAssetsType(e: any, i: any, flag: any): void {
let val = i;
if(flag == 1){
if (flag == 1) {
const arr = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
arr.controls.splice(0);
}
@ -336,10 +336,10 @@ export class AssetsInfoComponent implements OnInit {
switch (e.value) {
case '1': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray ;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.otherAssetsDescription());
break;
}
break;
}
case '2': {
let val = i;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
@ -347,32 +347,32 @@ export class AssetsInfoComponent implements OnInit {
break;
}
case '3': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.load_Four_Weeler());
break;
}
case '4': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadEquipmentManufacturingDescription());
break;
}
case '5': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
//control.push(this.loadJwellDescription());
break;
}
case '6': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInsuranceDescription());
break;
}
case '7': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInvestDescription());
break;
@ -389,11 +389,11 @@ export class AssetsInfoComponent implements OnInit {
return this._formBuilder.group({
property_type: [''],
other_property_type: [''],
address_of_the_property :[''],
describe_of_the_property_asset :[''],
area_covered_by_this_property :[''],
uom_of_the_property:[''],
other_uom:['']
address_of_the_property: [''],
describe_of_the_property_asset: [''],
area_covered_by_this_property: [''],
uom_of_the_property: [''],
other_uom: ['']
});
}
@ -440,7 +440,7 @@ export class AssetsInfoComponent implements OnInit {
//insurance_type: [''],
premium_paid: [''],
frequency_mode: [''],
other_frequency_mode:[''],
other_frequency_mode: [''],
sum_assured: [''],
members_coverd: ['']
});
@ -449,22 +449,22 @@ export class AssetsInfoComponent implements OnInit {
loadInvestDescription() {
return this._formBuilder.group({
investments_type: [''],
other_investments_type:[''],
other_investments_type: [''],
amount_of_invest: [''],
bank_name: [''],
in_which_organisation:['']
in_which_organisation: ['']
});
}
load_Four_Weeler() {
return this._formBuilder.group({
manufacturer_model_vehicle: [''],
vehicle_type:[''],
other_vehicle_type:['']
vehicle_type: [''],
other_vehicle_type: ['']
});
}
load_Two_Weeler() {
load_Two_Weeler() {
return this._formBuilder.group({
manufacturer_model_vehicle: ['']
});
@ -474,11 +474,11 @@ export class AssetsInfoComponent implements OnInit {
return this._formBuilder.group({
property_type: [data.property_type],
other_property_type: [data.other_property_type],
address_of_the_property :[data.address_of_the_property],
describe_of_the_property_asset :[data.describe_of_the_property_asset],
area_covered_by_this_property :[data.area_covered_by_this_property],
uom_of_the_property:[data.uom_of_the_property],
other_uom : [data.other_uom]
address_of_the_property: [data.address_of_the_property],
describe_of_the_property_asset: [data.describe_of_the_property_asset],
area_covered_by_this_property: [data.area_covered_by_this_property],
uom_of_the_property: [data.uom_of_the_property],
other_uom: [data.other_uom]
//property_type:['']
});
}
@ -503,9 +503,9 @@ export class AssetsInfoComponent implements OnInit {
otherAssetsDescriptionWithData(data) {
return this._formBuilder.group({
any_other_assets: [data.any_other_assets],
// name_of_the_owner:[data.name_of_the_owner],
// other_owner:[data.other_owner],
// relation:[data.relation],
// name_of_the_owner:[data.name_of_the_owner],
// other_owner:[data.other_owner],
// relation:[data.relation],
// any_other_asset_value : [data.any_other_asset_value],
// any_other_asset_loan : [data.any_other_asset_loan],
});
@ -526,7 +526,7 @@ export class AssetsInfoComponent implements OnInit {
//insurance_type: [data.insurance_type],
premium_paid: [data.premium_paid],
frequency_mode: [data.frequency_mode],
other_frequency_mode:[data.other_frequency_mode],
other_frequency_mode: [data.other_frequency_mode],
sum_assured: [data.sum_assured],
members_coverd: [data.members_coverd]
});
@ -535,9 +535,9 @@ export class AssetsInfoComponent implements OnInit {
loadInvestDescriptionWithData(data) {
return this._formBuilder.group({
investments_type: [data.investments_type],
other_investments_type : [data.other_investments_type],
other_investments_type: [data.other_investments_type],
amount_of_invest: [data.amount_of_invest],
in_which_organisation:[data.in_which_organisation],
in_which_organisation: [data.in_which_organisation],
bank_name: [data.bank_name]
});
}
@ -545,12 +545,12 @@ export class AssetsInfoComponent implements OnInit {
load_Four_WeelerWithData(data) {
return this._formBuilder.group({
manufacturer_model_vehicle: [data.manufacturer_model_vehicle],
vehicle_type:[data.vehicle_type],
other_vehicle_type:[data.other_vehicle_type]
vehicle_type: [data.vehicle_type],
other_vehicle_type: [data.other_vehicle_type]
});
}
load_Two_WeelerWithData(data) {
load_Two_WeelerWithData(data) {
return this._formBuilder.group({
manufacturer_model_vehicle: [data.manufacturer_model_vehicle]
});
@ -564,10 +564,10 @@ export class AssetsInfoComponent implements OnInit {
details: this._formBuilder.array([]),
approximate_market_value: [data.approximate_market_value],
name_of_the_owner: [data.name_of_the_owner],
other_owner:[data.other_owner || ''],
other_owner: [data.other_owner || ''],
//relation: [data.relation || ''],
vintage_personal : [data. vintage_personal],
purchase_year: [data. purchase_year,Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
vintage_personal: [data.vintage_personal],
purchase_year: [data.purchase_year, Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
// purchase_month: [data.purchase_month],
emi: [data.emi || 0],
});
@ -602,8 +602,8 @@ export class AssetsInfoComponent implements OnInit {
assets_mode: val.assets_mode,
approximate_market_value: val.approximate_market_value,
name_of_the_owner: val.name_of_the_owner,
other_owner:val.other_owner,
// relation: val.relation,
other_owner: val.other_owner,
// relation: val.relation,
vintage_personal: val.vintage_personal,
purchase_year: val.purchase_year,
// purchase_month: val.purchase_month,
@ -615,7 +615,7 @@ export class AssetsInfoComponent implements OnInit {
control.push(this.initDetailsWithdata(vals));
this.setAssetsDetailsWithData(vals.assets_mode, val.details, control.length - 1)
}
result.forEach((datas,index) => {
result.forEach((datas, index) => {
// let Avaliablity = 1;
// if(datas.name_of_the_owner.length>0){
// datas.name_of_the_owner.forEach(option => {
@ -626,7 +626,7 @@ export class AssetsInfoComponent implements OnInit {
// }
// this.isOtherOwner[index] = Avaliablity == 0 ? true : false;
this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.approximate_market_value);
this.setRequiredValidation(datas.name_of_the_owner,index,'',4);
this.setRequiredValidation(datas.name_of_the_owner, index, '', 4);
});
}
this.loadDetails = true;
@ -645,15 +645,16 @@ export class AssetsInfoComponent implements OnInit {
switch (assets_details_mode) {
case '1': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'any_other_assets': datas.any_other_assets,
// 'name_of_the_owner':datas.name_of_the_owner,
// 'other_owner':datas.other_owner,
//'relation':datas.relation,
// 'any_other_asset_value' : datas.any_other_asset_value,
// 'any_other_asset_loan' : datas.any_other_asset_loan,
};
let array_data: any;
data.forEach((datas, i) => {
array_data = {
'any_other_assets': datas.any_other_assets,
// 'name_of_the_owner':datas.name_of_the_owner,
// 'other_owner':datas.other_owner,
//'relation':datas.relation,
// 'any_other_asset_value' : datas.any_other_asset_value,
// 'any_other_asset_loan' : datas.any_other_asset_loan,
};
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value);
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
@ -661,31 +662,35 @@ export class AssetsInfoComponent implements OnInit {
break;
}
case '2': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type,
'address_of_the_property' :datas.address_of_the_property,'describe_of_the_property_asset' :datas.describe_of_the_property_asset,
'uom_of_the_property':datas.uom_of_the_property,
'area_covered_by_this_property' :datas.area_covered_by_this_property,'other_uom':datas.other_uom };
let array_data: any;
data.forEach((datas, i) => {
array_data = {
'property_type': datas.property_type, 'other_property_type': datas.other_property_type,
'address_of_the_property': datas.address_of_the_property, 'describe_of_the_property_asset': datas.describe_of_the_property_asset,
'uom_of_the_property': datas.uom_of_the_property,
'area_covered_by_this_property': datas.area_covered_by_this_property, 'other_uom': datas.other_uom
};
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadPropertyWithData(array_data));
break;
}
case '3': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle,
'vehicle_type':datas.vehicle_type,
'other_vehicle_type':datas.other_vehicle_type};
let array_data: any;
data.forEach((datas, i) => {
array_data = {
'manufacturer_model_vehicle': datas.manufacturer_model_vehicle,
'vehicle_type': datas.vehicle_type,
'other_vehicle_type': datas.other_vehicle_type
};
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.load_Four_WeelerWithData(array_data));
break;
}
case '4': {
let array_data : any;
data.forEach((datas,i) => {
let array_data: any;
data.forEach((datas, i) => {
array_data = { 'equipment_manufacturing_description': datas.equipment_manufacturing_description };
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
@ -699,14 +704,14 @@ export class AssetsInfoComponent implements OnInit {
}
case '6': {
let array_data : any;
data.forEach((datas,i) => {
let array_data: any;
data.forEach((datas, i) => {
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
array_data = {
'premium_paid': datas.premium_paid,
'frequency_mode': datas.frequency_mode,
'other_frequency_mode':datas.other_frequency_mode,
'other_frequency_mode': datas.other_frequency_mode,
'sum_assured': datas.sum_assured,
'members_coverd': datas.members_coverd
};
@ -716,14 +721,16 @@ export class AssetsInfoComponent implements OnInit {
break;
}
case '7': {
let array_data : any;
data.forEach((datas,i) => {
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
array_data = { 'investments_type': datas.investments_type,
'other_investments_type' : datas.other_investments_type,
'in_which_organisation' : datas.in_which_organisation,
let array_data: any;
data.forEach((datas, i) => {
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
array_data = {
'investments_type': datas.investments_type,
'other_investments_type': datas.other_investments_type,
'in_which_organisation': datas.in_which_organisation,
'amount_of_invest': datas.amount_of_invest,
'bank_name': datas.bank_name };
'bank_name': datas.bank_name
};
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInvestDescriptionWithData(array_data));
@ -738,19 +745,19 @@ export class AssetsInfoComponent implements OnInit {
/** Add More Asset using Flag Both "Other Asset" And "Business Asset" */
addAssetDetails(e,flag) {
if(flag == 1){
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.push(this.initDetails());
addAssetDetails(e, flag) {
if (flag == 1) {
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.push(this.initDetails());
}
}
/** To remove The Added Asset using Flag Both "Other Asset" And "Business Asset" */
removeAssetsDetails(i: number,flag) {
if(flag == 1){
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.removeAt(i);
}
removeAssetsDetails(i: number, flag) {
if (flag == 1) {
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.removeAt(i);
}
}
public paymentModeTextBox: number;
@ -765,15 +772,15 @@ export class AssetsInfoComponent implements OnInit {
}
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
if (o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
// check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
checkOthers(values) {
if (values != null) {
return values.id == 0 ? true : false;
}
else {
return false;
@ -782,17 +789,17 @@ export class AssetsInfoComponent implements OnInit {
}
// calculate vintage and purchase {}
calculateVintagePurchase(value: any, controlKey: any,type: number){
if(type==1){}
else if(type==2) {}
else if(type==3){
calculateVintagePurchase(value: any, controlKey: any, type: number) {
if (type == 1) { }
else if (type == 2) { }
else if (type == 3) {
let control: any = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.controls[controlKey].controls['purchase_year'].setValue(value!='' ? parseInt(this.currentYear)-parseInt(value) : '');
control.controls[controlKey].controls['purchase_year'].setValue(value != '' ? parseInt(this.currentYear) - parseInt(value) : '');
}
else if(type==4) {
let control: any = <FormArray>this._assetsQuesFrom.controls['assets_details'];
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['purchase_year'].setValue(value) : control.controls[controlKey].controls['purchase_year'].setValue('');
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['vintage_personal'].setValue(parseInt(this.currentYear)-parseInt(value)) : control.controls[controlKey].controls['vintage_personal'].setValue('')
else if (type == 4) {
let control: any = <FormArray>this._assetsQuesFrom.controls['assets_details'];
value != '' && value <= this.currentYear ? control.controls[controlKey].controls['purchase_year'].setValue(value) : control.controls[controlKey].controls['purchase_year'].setValue('');
value != '' && value <= this.currentYear ? control.controls[controlKey].controls['vintage_personal'].setValue(parseInt(this.currentYear) - parseInt(value)) : control.controls[controlKey].controls['vintage_personal'].setValue('')
}
}
@ -815,17 +822,17 @@ export class AssetsInfoComponent implements OnInit {
// Save the data with help of Service
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {
if(dataresult.status == 200) {
if (dataresult.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
this.dialogRef.close();
this.disableAfterSubmit = false;
},3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.disableAfterSubmit = false;
}
setTimeout(() => {
this.dialogRef.close();
this.disableAfterSubmit = false;
}, 3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.disableAfterSubmit = false;
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.disableAfterSubmit = false;
@ -844,150 +851,149 @@ export class AssetsInfoComponent implements OnInit {
// }
/** To calculating Loan Elapsed Tenure both "Other Asset" And "Business Asset" using Flag */
loanTenureCalc(details ,flag)
{
if(flag == 1){
let ElapsedValues;
loanTenureCalc(details, flag) {
if (flag == 1) {
let ElapsedValues;
if(details.value.original_loan_tenure != null && details.value.original_loan_tenure != '' && details.value.balance_tenure != null && details.value.balance_tenure != ''){
ElapsedValues = details.value.original_loan_tenure - details.value.balance_tenure ;
details.controls['elapsed_tenure'].setValue(ElapsedValues);
if (details.value.original_loan_tenure != null && details.value.original_loan_tenure != '' && details.value.balance_tenure != null && details.value.balance_tenure != '') {
ElapsedValues = details.value.original_loan_tenure - details.value.balance_tenure;
details.controls['elapsed_tenure'].setValue(ElapsedValues);
}
}
}
// else if(flag == 2){
// let BusinessElapsedValues;
// else if(flag == 2){
// let BusinessElapsedValues;
// if(details.value.business_original_loan_tenure != null && details.value.business_original_loan_tenure != '' && details.value.business_balance_tenure != null && details.value.business_balance_tenure != ''){
// BusinessElapsedValues = details.value.business_original_loan_tenure - details.value.business_balance_tenure ;
// details.controls['business_elapsed_tenure'].setValue(BusinessElapsedValues);
// }
// }
// if(details.value.business_original_loan_tenure != null && details.value.business_original_loan_tenure != '' && details.value.business_balance_tenure != null && details.value.business_balance_tenure != ''){
// BusinessElapsedValues = details.value.business_original_loan_tenure - details.value.business_balance_tenure ;
// details.controls['business_elapsed_tenure'].setValue(BusinessElapsedValues);
// }
// }
}
setRequiredValidation(value,ParInx,ChdInx,flag) {
console.log('value',value,'ParInx',ParInx,'ChdInx',ChdInx,'flag',flag);
setRequiredValidation(value, ParInx, ChdInx, flag) {
let ParCtrls = <FormArray>this._assetsQuesFrom.controls.assets_details;
// console.log('ParCtrls',ParCtrls);
let ChdCtrls:any = <FormArray>ParCtrls.controls[ParInx];
// console.log('ChdCtrls',ChdCtrls);
if(flag == 1){
value==1
// ? controls2[ChdInx].controls.other_property_type.setValidators([Validators.required])
// : item.controls.other_property_type.clearValidators();
// item.controls.other_property_type.updateValueAndValidity();
}
// if(flag == 2){
// value==1
// ? item.controls.other_frequency_mode.setValidators([Validators.required])
// : item.controls.other_frequency_mode.clearValidators();
// item.controls.other_frequency_mode.updateValueAndValidity();
// }
// if(flag == 3){
// value==1
// ? item.controls.other_investments_type.setValidators([Validators.required])
// : item.controls.other_investments_type.clearValidators();
// item.controls.other_investments_type.updateValueAndValidity();
// }
// if(flag == 4){
// value==0
// ? item.controls.other_owner.setValidators([Validators.required])
// : item.controls.other_owner.clearValidators();
// item.controls.other_owner.updateValueAndValidity();
// }
if (flag == 4) {
let Avaliablity = 1;
// console.log('val',value);
if(value.length>0){
let ChdCtrls: any = <FormArray>ParCtrls.controls[ParInx];
if (flag == 1) {
value == 1
// ? controls2[ChdInx].controls.other_property_type.setValidators([Validators.required])
// : item.controls.other_property_type.clearValidators();
// item.controls.other_property_type.updateValueAndValidity();
}
// if(flag == 2){
// value==1
// ? item.controls.other_frequency_mode.setValidators([Validators.required])
// : item.controls.other_frequency_mode.clearValidators();
// item.controls.other_frequency_mode.updateValueAndValidity();
// }
// if(flag == 3){
// value==1
// ? item.controls.other_investments_type.setValidators([Validators.required])
// : item.controls.other_investments_type.clearValidators();
// item.controls.other_investments_type.updateValueAndValidity();
// }
// if(flag == 4){
// value==0
// ? item.controls.other_owner.setValidators([Validators.required])
// : item.controls.other_owner.clearValidators();
// item.controls.other_owner.updateValueAndValidity();
// }
if (flag == 4) {
let Avaliablity = 1;
if (value.length > 0) {
value.forEach(option => {
if(option.id == 0 && option.group_id == 2){
if (option.id == 0 && option.group_id == 2) {
Avaliablity = option.id;
}
});
}
if(Avaliablity == 0){
console.log('if Avaliablity',Avaliablity);
// console.log('if this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]);
ChdCtrls.controls.other_owner.setValidators([Validators.required]);
this.isOtherOwner[ParInx] = true;
// console.log('if this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]);
}else if(Avaliablity == 1){
console.log('else Avaliablity',Avaliablity);
// console.log('esle this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]);
ChdCtrls.controls.other_owner.setValue('');
ChdCtrls.controls.other_owner.clearValidators();
this.isOtherOwner[ParInx] = false;
// console.log('else this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]);
if (Avaliablity == 0) {
ChdCtrls.controls.other_owner.setValidators([Validators.required]);
this.isOtherOwner[ParInx] = true;
} else if (Avaliablity == 1) {
ChdCtrls.controls.other_owner.setValue('');
ChdCtrls.controls.other_owner.clearValidators();
this.isOtherOwner[ParInx] = false;
}
ChdCtrls.controls.other_owner.updateValueAndValidity();
}
ChdCtrls.controls.other_owner.updateValueAndValidity();
// if(flag == 5){
// value==1
// ? item.controls.other_vehicle_type.setValidators([Validators.required])
// : item.controls.other_vehicle_type.clearValidators();
// item.controls.other_vehicle_type.updateValueAndValidity();
// }
// if(flag == 6){
// value==1
// ? item.controls.other_uom.setValidators([Validators.required])
// : item.controls.other_uom.clearValidators();
// item.controls.other_uom.updateValueAndValidity();
// }
}
// if(flag == 5){
// value==1
// ? item.controls.other_vehicle_type.setValidators([Validators.required])
// : item.controls.other_vehicle_type.clearValidators();
// item.controls.other_vehicle_type.updateValueAndValidity();
// }
// if(flag == 6){
// value==1
// ? item.controls.other_uom.setValidators([Validators.required])
// : item.controls.other_uom.clearValidators();
// item.controls.other_uom.updateValueAndValidity();
// }
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
// this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 2 :
this.OtherAppxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 3 :
// this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 4 :
this.OtherEmiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 5 :
// this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 6 :
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 7 :
// this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 8 :
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 9 :
// this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 10 :
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 11 :
// this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 12 :
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 13:
// this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 14:
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
default:
break;
/** Amount InWords */
inWords(e, i, flag) {
switch (flag) {
case 1:
// this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 2:
this.OtherAppxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 3:
// this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 4:
this.OtherEmiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 5:
// this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 6:
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 7:
// this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 8:
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 9:
// this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 10:
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 11:
// this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 12:
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 13:
// this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 14:
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}
}

View File

@ -1,132 +1,142 @@
<!--<<<<<<< HEAD-->
<!--<mat-card style="padding: 12px;">-->
<!--<form [formGroup]="bankingForm" class="bankForm">-->
<!--<div formArrayName="itemRows">-->
<!--<mat-accordion-->
<!--*ngFor="let itemrow of bankingForm.controls.itemRows.controls; let i=index"-->
<!--[formGroupName]="i">-->
<!--<mat-expansion-panel class="banlFields" [expanded]="step == i" (opened)="setStep(i)">-->
<!--<mat-expansion-panel-header>-->
<!--<mat-panel-title>-->
<!--<h4>{{i+1}} Banking details<span *ngIf="i==0" style="float: right;">-->
<!--<mat-icon (click)="addBankdetails($event)">add</mat-icon>-->
<!--</span>-->
<!--<span *ngIf="i > 0">-->
<!--<mat-icon (click)="deleteBankdetails(i, $event)">delete</mat-icon>-->
<!--</span></h4>-->
<!--</mat-panel-title>-->
<!--</mat-expansion-panel-header>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Applicant Name"-->
<!--formControlName="applicant_name">-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Bank Name" formControlName="bank_name">-->
<!--</mat-form-field>-->
<!--<div formArrayName="itemRows">-->
<!--<mat-accordion-->
<!--*ngFor="let itemrow of bankingForm.controls.itemRows.controls; let i=index"-->
<!--[formGroupName]="i">-->
<!--<mat-expansion-panel class="banlFields" [expanded]="step == i" (opened)="setStep(i)">-->
<!--<mat-expansion-panel-header>-->
<!--<mat-panel-title>-->
<!--<h4>{{i+1}} Banking details<span *ngIf="i==0" style="float: right;">-->
<!--<mat-icon (click)="addBankdetails($event)">add</mat-icon>-->
<!--</span>-->
<!--<span *ngIf="i > 0">-->
<!--<mat-icon (click)="deleteBankdetails(i, $event)">delete</mat-icon>-->
<!--</span></h4>-->
<!--</mat-panel-title>-->
<!--</mat-expansion-panel-header>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Applicant Name"-->
<!--formControlName="applicant_name">-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Bank Name" formControlName="bank_name">-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Account Type"-->
<!--formControlName="account_type">-->
<!--<mat-option value="Savings">Savings</mat-option>-->
<!--<mat-option value="Current">Current</mat-option>-->
<!--<mat-option value="OD">OD</mat-option>-->
<!--<mat-option value="CC">CC</mat-option>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Account Type"-->
<!--formControlName="account_type">-->
<!--<mat-option value="Savings">Savings</mat-option>-->
<!--<mat-option value="Current">Current</mat-option>-->
<!--<mat-option value="OD">OD</mat-option>-->
<!--<mat-option value="CC">CC</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Salary Credited in this account"-->
<!--formControlName="salary">-->
<!--<mat-option value="Yes">Yes</mat-option>-->
<!--<mat-option value="No">No</mat-option>-->
<!--<mat-option value="NA">NA</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Limit in case of OD / CC account"-->
<!--formControlName="limit">-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Is this the main business account"-->
<!--formControlName="is_main">-->
<!--<mat-option value="Yes">Yes</mat-option>-->
<!--<mat-option value="No">No</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Approximate Vintage"-->
<!--formControlName="vintage">-->
<!--</mat-form-field>-->
<!--</mat-expansion-panel>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Salary Credited in this account"-->
<!--formControlName="salary">-->
<!--<mat-option value="Yes">Yes</mat-option>-->
<!--<mat-option value="No">No</mat-option>-->
<!--<mat-option value="NA">NA</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Limit in case of OD / CC account"-->
<!--formControlName="limit">-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Is this the main business account"-->
<!--formControlName="is_main">-->
<!--<mat-option value="Yes">Yes</mat-option>-->
<!--<mat-option value="No">No</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Approximate Vintage"-->
<!--formControlName="vintage">-->
<!--</mat-form-field>-->
<!--</mat-expansion-panel>-->
<!--</mat-accordion>-->
<!--</div>-->
<!--<button mat-raised-button class="button" (click)="bankSubmit()">Submit-->
<!--</button>-->
<!--</mat-accordion>-->
<!--</div>-->
<!--<button mat-raised-button class="button" (click)="bankSubmit()">Submit-->
<!--</button>-->
<!--</form>-->
<!--</mat-card>-->
<!--=======-->
<form [formGroup]="bankingForm" class="bankForm">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
{{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>
<mat-dialog-content>
<mat-tab-group>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">-
{{subproduct_abbr}} </span></span><br>
{{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>
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<mat-card>
<mat-card-content>
<div formArrayName="itemRows" autocomplete="off">
<mat-accordion
*ngFor="let itemrow of bankingForm.controls.itemRows['controls']; let i=index;let last=last"
<mat-tab label="Questions">
<mat-card>
<mat-card-content>
<div formArrayName="itemRows" autocomplete="off">
<mat-accordion *ngFor="let itemrow of bankingForm.controls.itemRows['controls']; let i=index;let last=last"
[formGroupName]="i">
<mat-expansion-panel class="banlFields" [expanded]="step == i">
<mat-expansion-panel-header>
<mat-panel-title>
<p>Banking Details #{{i+1}}
</p>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name" [compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.values.id,itemrow,1)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
<mat-expansion-panel class="banlFields" [expanded]="step == i">
<mat-expansion-panel-header>
<mat-panel-title>
<p>Banking Details #{{i+1}}
</p>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.values.id,itemrow,1)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true" style="width:45%">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant" autocomplete="off">
</mat-form-field>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true"
style="width:45%">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant"
autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name" (selectionChange)="setRequiredValidation($event.value,itemrow,2)">
<mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name"
(selectionChange)="setRequiredValidation($event.value,itemrow,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('bank_name').value == 1">
<input matInput placeholder="Specify Bank Name"
formControlName="other_bank" autocomplete="off">
</mat-form-field>
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{
btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('bank_name').value == 1">
<input matInput placeholder="Specify Bank Name" formControlName="other_bank"
autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)" placeholder="Account Type" formControlName="account_type" >
<mat-option>Select</mat-option>
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)"
placeholder="Account Type" formControlName="account_type">
<mat-option>Select</mat-option>
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{
prop.name }}</mat-option>
</mat-select>
</mat-form-field>
<!--<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<!--<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<mat-select placeholder="Is this the main business account"
formControlName="is_main" >
<mat-option value="Yes">Yes</mat-option>
@ -134,10 +144,9 @@
</mat-select>
</mat-form-field>-->
<div fxLayout="row" fxLayoutAlign="start none">
<div fxLayout="row" fxLayoutAlign="start none">
<mat-form-field style="width: 35%;" *ngIf="salaryField">
<mat-select placeholder="Salary Credited in this account"
formControlName="salary" >
<mat-select placeholder="Salary Credited in this account" formControlName="salary">
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
@ -145,170 +154,225 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]"> <!-- *ngIf="itemrow.get('account_type').value != 2"> -->
<mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]">
<!-- *ngIf="itemrow.get('account_type').value != 2"> -->
<input matInput autocomplete="off" placeholder="Limit in case of OD / CC account"
formControlName="limit" OnlyNumber type="text" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
formControlName="limit" OnlyNumber type="text" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}}
{{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
<div>
</div>
<div>
<label>Number of Years / Months since account was started</label>
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="vintage_year" OnlyNumber type="text">
<input matInput autocomplete="off" placeholder="Year(s)"
formControlName="vintage_year" OnlyNumber type="text">
</mat-form-field>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="vintage_month" OnlyNumber type="text" (change)="ConvertMonthintoYear(itemrow,$event.target.value)">
<input matInput autocomplete="off" placeholder="Month(s)"
formControlName="vintage_month" OnlyNumber type="text" (change)="ConvertMonthintoYear(itemrow,$event.target.value)">
</mat-form-field>
</div>
</div>
<mat-action-row>
<div fxFlex="100" align="center">
<button type="button" mat-flat-button color="primary" (click)="addBankdetails(i, $event)"
matTooltip="Add More" matTooltipPosition="above" *ngIf="last">
<strong>Add More Banking Details</strong>
</button>
</div>
<mat-action-row>
<div fxFlex="100" align="center">
<button type="button" mat-flat-button color="primary" (click)="addBankdetails(i, $event)"
matTooltip="Add More" matTooltipPosition="above" *ngIf="last">
<strong>Add More Banking Details</strong>
</button>
</div>
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Banking Details" matTooltipPosition="above" (click)="deleteBankdetails(i)" *ngIf="bankingForm.controls.itemRows.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
<!-- <button type="button" mat-button (click)="deleteBankdetails(i)" color="warn"
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Banking Details"
matTooltipPosition="above" (click)="deleteBankdetails(i)" *ngIf="bankingForm.controls.itemRows.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
<!-- <button type="button" mat-button (click)="deleteBankdetails(i)" color="warn"
matTooltip="Delete"matTooltipPosition="left" *ngIf="!last">
<strong>Delete Banking Details</strong>
</button> -->
<!-- <button mat-button color="warn" (click)="prevStep()">Previous</button>
<!-- <button mat-button color="warn" (click)="prevStep()">Previous</button>
<button mat-button color="primary" (click)="nextStep()">End</button> -->
<!-- ngIf="i > 0" -->
<!-- ngIf="i > 0" -->
</mat-action-row>
</mat-expansion-panel>
<!-- <div style="text-align: right;" class="pt-1" *ngIf="bankingForm.controls.itemRows['controls'].length == (i+1)">
</mat-action-row>
</mat-expansion-panel>
<!-- <div style="text-align: right;" class="pt-1" *ngIf="bankingForm.controls.itemRows['controls'].length == (i+1)">
<button class="mr-1 mb-1 hover-icon" color="primary" mat-raised-button mat-icon-button matTooltip="Add More Banking Details" matTooltipPosition="above" >
<mat-icon >add</mat-icon>
</button></div> -->
</mat-accordion>
</mat-accordion>
</div>
</mat-card-content>
</mat-card>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-card-content>
</mat-card>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-dialog-content>
<mat-dialog-actions>
</mat-tab-group>
</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="banking_form_remark" ></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button class="mr-1 mb-1 hover-icon" type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="bankSubmit()"><mat-icon>save</mat-icon>
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="banking_form_remark"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button class="mr-1 mb-1 hover-icon" type="submit" mat-raised-button mat-icon-button type="submit"
matTooltip="Submit" matTooltipPosition="above" (click)="bankSubmit()">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
</div>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>

View File

@ -21,7 +21,7 @@ import {
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from "@angular/router";
import { ActivatedRoute, Router } from "@angular/router";
@Component({
selector: 'app-banking-details',
templateUrl: './banking-details.component.html',
@ -33,88 +33,88 @@ export class BankingDetailsComponent implements OnInit {
lender_applicant_id: any;
main_applicant: any;
pdid: number;
pageTitle: string ="Banking Details of Individuals";
pageTitle: string = "Banking Details of Individuals";
public bankingForm: FormGroup;
step: number;
private notifier: NotifierService;
public pd_cus_segment:string;
public pd_cus_segment: string;
public applicants: any;
public companies: any;
m_accountType= [];
m_accountType = [];
m_btLenderList = [];
salaryField : boolean;
OtherFlag : any = [];
limitCaseFlag : any = [];
amtInwords : any = [];
emiAmtInwords : any = [];
salaryField: boolean;
OtherFlag: any = [];
limitCaseFlag: any = [];
amtInwords: any = [];
emiAmtInwords: any = [];
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
existCompanyList: any = [];
mergeCompanyApplicant: any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<BankingDetailsComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.pd_cus_segment = this.pd_cus_segment.substring(0,3);
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(val=>val.applicant_type==0 || val.applicant_type==1)
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.companies = this.pd_all_details.pdapplicants_detials.filter(val=>val.applicant_type==2)
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<BankingDetailsComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.pd_cus_segment = this.pd_cus_segment.substring(0, 3);
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(val => val.applicant_type == 0 || val.applicant_type == 1)
this.applicants.push({ 'pd_co_applicant_id': '0', 'applicant_name': 'Others' });
this.companies = this.pd_all_details.pdapplicants_detials.filter(val => val.applicant_type == 2)
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
}
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,
}
};
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,
}
};
ngOnInit() {
this.step = 0;
this.initBankingForm();
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active===true);
}
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data => {
if (data.dataStatus) {
this.existCompanyList = data.records.filter(val => val.is_active === true);
}
// let modifyCompanyList : any=[];
// if(this.existCompanyList.length>0){
// modifyCompanyList = this.existCompanyList.map(element => {
// return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
// });
// this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
// }
// let modifyCompanyList : any=[];
// if(this.existCompanyList.length>0){
// modifyCompanyList = this.existCompanyList.map(element => {
// return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
// });
// this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
// }
});
let modifyApplicantList: any=[];
});
let modifyApplicantList: any = [];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
if (this.applicants.length > 0) {
modifyApplicantList = this.applicants.map(element => {
return { id: element.pd_co_applicant_id, name: element.applicant_name, group_id: 2 };
});
this.mergeCompanyApplicant.push({ groupName: 'APPLICANTS', groupValues: modifyApplicantList })
}
// let modifyCompanyList : any=[];
@ -129,7 +129,7 @@ export class BankingDetailsComponent implements OnInit {
this.getM_AccountType();
this.getM_BTLenderList();
this.salaryField = this.pd_cus_segment.substring(0,2) == 'SE' ? false : true ;
this.salaryField = this.pd_cus_segment.substring(0, 2) == 'SE' ? false : true;
// this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
// // console.log("(0,3): " + this.pd_cus_segment.substring(0,3));
// this.pd_cus_segment = this.pd_cus_segment.substring(0,3);
@ -148,12 +148,12 @@ export class BankingDetailsComponent implements OnInit {
if (result.length == 0) {
control.push(this.createBankarray());
} else {
result.forEach((datas,index) => {
result.forEach((datas, index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit);
// this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(+datas.account_type,index)
this.selectedAccTypeChanges(+datas.account_type, index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
control.push(this.createBankarray());
});
this.bankingForm.controls.itemRows.setValue(result);
@ -166,24 +166,24 @@ export class BankingDetailsComponent implements OnInit {
// ======================
getM_AccountType() {
this._pd.getAllMasterDatas('ACCOUNTTYPE').subscribe(
data => {
this.m_accountType = data.records.filter(data => data.isactive == 1);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
getM_AccountType() {
this._pd.getAllMasterDatas('ACCOUNTTYPE').subscribe(
data => {
this.m_accountType = data.records.filter(data => data.isactive == 1);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
getM_BTLenderList(){
this._pd.getAllMasterDatas('BTLENDERLIST').subscribe(
data => {
this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1);
})
}
getM_BTLenderList() {
this._pd.getAllMasterDatas('BTLENDERLIST').subscribe(
data => {
this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1);
})
}
public initBankingForm(): void {
this.bankingForm = this.fb.group({
@ -195,12 +195,12 @@ export class BankingDetailsComponent implements OnInit {
createBankarray() {
return this.fb.group({
applicant_name: [''],
other_applicant : [''],
other_applicant: [''],
bank_name: [''],
other_bank: [''],
account_type: [''],
//salary: [''],
salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : [''],
salary: this.pd_cus_segment.substring(0, 2) == 'SE' ? [''] : [''],
limit: [''],
//is_main: [''],
//is_main: [this.pd_cus_segment == 'SAL' ? '' : ''],
@ -229,20 +229,20 @@ export class BankingDetailsComponent implements OnInit {
const control = <FormArray>this.bankingForm.controls['itemRows'];
control.removeAt(index);
}
setRequiredValidation(value,item,flag) {
setRequiredValidation(value, item, flag) {
if(flag == 1){
value==0
? item.controls.other_applicant.setValidators([Validators.required])
: item.controls.other_applicant.clearValidators();
item.controls.other_applicant.updateValueAndValidity();
}
if(flag == 2){
value==1
? item.controls.other_bank.setValidators([Validators.required])
: item.controls.other_bank.clearValidators();
item.controls.other_bank.updateValueAndValidity();
}
if (flag == 1) {
value == 0
? item.controls.other_applicant.setValidators([Validators.required])
: item.controls.other_applicant.clearValidators();
item.controls.other_applicant.updateValueAndValidity();
}
if (flag == 2) {
value == 1
? item.controls.other_bank.setValidators([Validators.required])
: item.controls.other_bank.clearValidators();
item.controls.other_bank.updateValueAndValidity();
}
}
@ -251,34 +251,34 @@ export class BankingDetailsComponent implements OnInit {
}
bankSubmit() {
let records: any = {};
records.pdid = this.pdid;
records.formid = '7';
records.banking_form_remark = this.bankingForm.controls.banking_form_remark.value;
// records.fk_createdby = '252';
records.banking_details = this.bankingForm.controls['itemRows'].value;
let records: any = {};
records.pdid = this.pdid;
records.formid = '7';
records.banking_form_remark = this.bankingForm.controls.banking_form_remark.value;
// records.fk_createdby = '252';
records.banking_details = this.bankingForm.controls['itemRows'].value;
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
// this.dialogRef.close();
setTimeout(() =>{
this.dialogRef.close();
},3000);
}
else{
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this._pd.saveForm(records).subscribe(data => {
if (data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
// this.dialogRef.close();
setTimeout(() => {
this.dialogRef.close();
}, 3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({onlySelf: true});
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
}
@ -296,27 +296,27 @@ export class BankingDetailsComponent implements OnInit {
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
compareObjects(o1: any, o2: any) {
if (o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
// check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
}
else {
return false;
checkOthers(values) {
if (values != null) {
return values.id == 0 ? true : false;
}
else {
return false;
}
}
}
selectedAccTypeChanges(event: any, i) {
selectedAccTypeChanges(event: any,i){
if(event == 2 || event == 1) {
if (event == 2 || event == 1) {
this.limitCaseFlag[i] = false;
// const control = <FormArray>this.bankingForm.controls['itemRows'];
@ -325,18 +325,18 @@ export class BankingDetailsComponent implements OnInit {
// control.controls[0].get('limit').updateValueAndValidity();
}
else{
else {
this.limitCaseFlag[i] = true;
}
}
/** To Convert Month into Year */
ConvertMonthintoYear(itemrow,e){
ConvertMonthintoYear(itemrow, e) {
let year = itemrow.controls.vintage_year.value;
let converted_month : number = e%12;
let converted_year : number = e/12;
let converted_month: number = e % 12;
let converted_year: number = e / 12;
itemrow.controls.vintage_year.setValue(+year + +Math.floor(converted_year));
itemrow.controls.vintage_month.setValue(Math.floor(converted_month));
@ -344,17 +344,17 @@ export class BankingDetailsComponent implements OnInit {
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
inWords(e, i, flag) {
switch (flag) {
case 1:
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2:
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}
}

View File

@ -1,7 +1,8 @@
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom" (submit)="onSubmit()" novalidate>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}}</span> </span><br>
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">-
{{subproduct_abbr}}</span> </span><br>
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
@ -15,149 +16,150 @@
<mat-tab-group>
<mat-tab label={{pageTitle}}>
<ng-template matTabContent>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="100">
<div formArrayName="business_assets_for_address" fxFill>
<div *ngFor="let itemrow of _businessAssetsQuesFrom.controls.business_assets_for_address['controls']; let i=index; let last=last;">
<div [formGroupName]="i">
<mat-card>
<mat-card-header>
<mat-card-title>
<p>Address Details {{ " : " + itemrow.get('address_label').value | titlecase}}</p>
</mat-card-title>
</mat-card-header>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="100">
<div formArrayName="business_assets_for_address" fxFill>
<div *ngFor="let itemrow of _businessAssetsQuesFrom.controls.business_assets_for_address['controls']; let i=index; let last=last;">
<div [formGroupName]="i">
<mat-card>
<mat-card-header>
<mat-card-title>
<p>Address Details {{ " : " + itemrow.get('address_label').value | titlecase}}</p>
</mat-card-title>
</mat-card-header>
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width: 95%;">
<mat-select placeholder="is this the business address ? " (selectionChange)="setRequiredValidation($event.value,itemrow,1);"
formControlName="business_address_availability" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none" *ngIf=" itemrow.get('business_address_availability').value == 'yes'">
<div style="width:95%">
<label style="padding-left:2%">How long has business been operated from this premise?</label>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="business_years"
(change)="checkWithExistBusinessYear($event.target.value,i)" OnlyNumber type="text">
<mat-hint style="color: red;">{{yearErrorMessage[i]}}</mat-hint>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_years'].value.valid">Year's
Required</mat-error> -->
</mat-form-field>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month"
OnlyNumber type="text" (change)="ConvertMonthintoYear($event.target.value,i)">
<mat-hint style="color: red;">{{monthErrorMessage[i]}}</mat-hint>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_month'].value.valid">Month's
Required</mat-error> -->
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width: 95%;">
<mat-select placeholder="is this the business address ? " (selectionChange)="setRequiredValidation($event.value,itemrow,1);"
formControlName="business_address_availability" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none" *ngIf=" itemrow.get('business_address_availability').value == 'yes'">
<div style="width:95%">
<label style="padding-left:2%">How long has business been operated from this premise?</label>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="business_years"
(change)="checkWithExistBusinessYear($event.target.value,i)" OnlyNumber type="text">
<mat-hint style="color: red;">{{yearErrorMessage[i]}}</mat-hint>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_years'].value.valid">Year's
Required</mat-error> -->
</mat-form-field>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month"
OnlyNumber type="text" (change)="ConvertMonthintoYear($event.target.value,i)">
<mat-hint style="color: red;">{{monthErrorMessage[i]}}</mat-hint>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_month'].value.valid">Month's
Required</mat-error> -->
</mat-form-field>
</div>
<mat-form-field style="width: 95%;">
<mat-select [placeholder]="placeholderName[i] ? placeholderName[i] :'Was any business activity seen at the Address Type during PD visit?'" formControlName="business_is_pd_visited">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_is_pd_visited'].value.valid">Field
<mat-form-field style="width: 95%;">
<mat-select [placeholder]="placeholderName[i] ? placeholderName[i] :'Was any business activity seen at the Address Type during PD visit?'"
formControlName="business_is_pd_visited">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_is_pd_visited'].value.valid">Field
Required</mat-error> -->
</mat-form-field>
</mat-form-field>
<mat-form-field *ngIf=" itemrow.get('business_is_pd_visited').value != ''" style="width: 95%;">
<input matInput autocomplete="off" placeholder="Remarks" formControlName="business_pd_visited_remark">
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_pd_visited_remark'].value.valid">Remarks
<mat-form-field *ngIf=" itemrow.get('business_is_pd_visited').value != ''" style="width: 95%;">
<input matInput autocomplete="off" placeholder="Remarks" formControlName="business_pd_visited_remark">
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_pd_visited_remark'].value.valid">Remarks
Required</mat-error> -->
</mat-form-field>
</mat-form-field>
</div>
</div>
<div *ngIf="itemrow.get('business_address_availability').value == 'yes'">
<mat-form-field style="width:45%">
<mat-select placeholder="Ownership Type" formControlName="business_ownership_type"
(selectionChange)="setRequiredValidation($event.value,itemrow,7)">
<!-- (selectionChange)="selectedPropertyOwnedType($event.value,s,i)" -->
<div *ngIf="itemrow.get('business_address_availability').value == 'yes'">
<mat-form-field style="width:45%">
<mat-select placeholder="Ownership Type" formControlName="business_ownership_type"
(selectionChange)="setRequiredValidation($event.value,itemrow,7)">
<!-- (selectionChange)="selectedPropertyOwnedType($event.value,s,i)" -->
<mat-option>Select</mat-option>
<mat-option value="owned">Owned</mat-option>
<mat-option value="rented">Rented</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="(itemrow.get('business_ownership_type').value == 'rented')">
<input matInput autocomplete="off" placeholder="Monthly Rent Amount" formControlName="business_monthly_rented_amt"
OnlyNumber type="text" (keyup)="inWords($event,i,9)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('business_monthly_rented_amt').value != ''">{{"&#8377;"}}
{{RentAmtInwordsForAddress[i]}} Only</mat-hint>
<mat-error>Monthly Rent Amount Required</mat-error>
</mat-form-field>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="(itemrow.get('business_ownership_type').value == 'owned')">
<mat-form-field style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,10)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('business_approximate_market_value').value != ''">{{"&#8377;"}}
{{appxMarketAmtInwordsForAddress[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select multiple placeholder="Asset Owned by" formControlName="business_name_of_the_owner"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,itemrow,8)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
<mat-error>Asset Owned by Required</mat-error>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="isOtherOwnerForAddress[i]">
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%">
<mat-label>Approx Vintage</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage"
minlength="1" maxlength="3" OnlyNumber type="text" (keyup)="calculateVintagePurchase($event.target.value,i,3)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>
<mat-form-field style="width:45%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="business_purchase_year"
minlength="4" maxlength="4" OnlyNumber type="text" (keyup)="calculateVintagePurchase($event.target.value,i,4)">
<!-- <mat-error> Invalid year format</mat-error> -->
</mat-form-field>
</div>
<span>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%" *ngIf="(itemrow.get('business_ownership_type').value == 'owned')">
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="business_emi">
<mat-option>Select</mat-option>
<mat-option value="owned">Owned</mat-option>
<mat-option value="rented">Rented</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="(itemrow.get('business_ownership_type').value == 'rented')">
<input matInput autocomplete="off" placeholder="Monthly Rent Amount" formControlName="business_monthly_rented_amt"
OnlyNumber type="text" (keyup)="inWords($event,i,9)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('business_monthly_rented_amt').value != ''">{{"&#8377;"}}
{{RentAmtInwordsForAddress[i]}} Only</mat-hint>
<mat-error>Monthly Rent Amount Required</mat-error>
</mat-form-field>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="(itemrow.get('business_ownership_type').value == 'owned')">
<mat-form-field style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,10)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('business_approximate_market_value').value != ''">{{"&#8377;"}}
{{appxMarketAmtInwordsForAddress[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select multiple placeholder="Asset Owned by" formControlName="business_name_of_the_owner"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,itemrow,8)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
<mat-error>Asset Owned by Required</mat-error>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="isOtherOwnerForAddress[i]">
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%">
<mat-label>Approx Vintage</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage"
minlength="1" maxlength="3" OnlyNumber type="text" (keyup)="calculateVintagePurchase($event.target.value,i,3)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>
<mat-form-field style="width:45%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="business_purchase_year"
minlength="4" maxlength="4" OnlyNumber type="text" (keyup)="calculateVintagePurchase($event.target.value,i,4)">
<!-- <mat-error> Invalid year format</mat-error> -->
</mat-form-field>
</div>
<span>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%" *ngIf="(itemrow.get('business_ownership_type').value == 'owned')">
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="business_emi">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
</span>
</div>
</span>
</mat-card>
</div>
</div>
</div>
</div>
</mat-card>
</div>
</div>
</div>
</div>
<div fxFlex="100">
<mat-card style="min-height: 550px;">
<mat-card-header>

View File

@ -33,8 +33,8 @@ export class BusinessAssetsInfoComponent implements OnInit {
private notifier: NotifierService;
public _businessAssetsQuesFrom: FormGroup;
public submitted = false;
isOtherOwnerForAddress : any = [];
isOtherOwner : any = [];
isOtherOwnerForAddress: any = [];
isOtherOwner: any = [];
loadDetails: boolean;
CustSegAbbr: any;
@ -48,7 +48,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
/**Declaration of Dropdown And Array */
public applicants: any;
public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" },
{ 'value': "no", 'viewValue': "No" }]
{ 'value': "no", 'viewValue': "No" }]
public m_assets_type = [];
public m_propertyType = [];
public m_address_type = [];
@ -185,24 +185,22 @@ export class BusinessAssetsInfoComponent implements OnInit {
}
);
}
loadaddresses(){
// console.log('function inside loaded');
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '5';
loadaddresses() {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '5';
this.pdTrigerService.retriveForm(params).subscribe(data => {
// console.log('response',data);
if (data.status == 200) {
let dataOfAddress = data.records.addresses.filter(item => item.isactive == 1);
// console.log(data.records);
// console.log(data.records.addresses);
// console.log(dataOfAddress);
// // const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
if(data.records.addresses.length > 0){
data.records.addresses.forEach((data,inx)=>{
// console.log(data);
if (data.records.addresses.length > 0) {
data.records.addresses.forEach((data, inx) => {
this.addressLabel[inx] = '';
@ -213,38 +211,38 @@ export class BusinessAssetsInfoComponent implements OnInit {
this.placeholderName[inx] = 'Was any business activity seen at the ' + addressType + ' during PD visit?';
let addressLabel = address + ' / ' + addressType;
let vals = {
address_label:addressLabel,
business_years: '',
business_month: '',
business_address_availability: '',
business_is_pd_visited: '',
business_pd_visited_remark: '',
business_approximate_market_value: '',
business_ownership_type: '',
business_monthly_rented_amt: '',
business_name_of_the_owner: '',
business_name_of_the_other_owner: '',
business_vintage: '',
business_purchase_year: '',
business_emi: ''
}
let vals = {
address_label: addressLabel,
business_years: '',
business_month: '',
business_address_availability: '',
business_is_pd_visited: '',
business_pd_visited_remark: '',
business_approximate_market_value: '',
business_ownership_type: '',
business_monthly_rented_amt: '',
business_name_of_the_owner: '',
business_name_of_the_other_owner: '',
business_vintage: '',
business_purchase_year: '',
business_emi: ''
}
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
control.push(this.initBusinessAddressDetailsWithdata(vals));
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
control.push(this.initBusinessAddressDetailsWithdata(vals));
});
}
else{
else {
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
control.push(this.initBusinessAddressDetails());
}
}
else{
else {
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
control.push(this.initBusinessAddressDetails());
}
});
}
}
// business_years: [value.business_years],
// business_month: [value.business_month],
// business_address_availability: [value.business_address_availability],
@ -252,12 +250,12 @@ export class BusinessAssetsInfoComponent implements OnInit {
// business_pd_visited_remark: [value.business_pd_visited_remark],
// business_assets_for_address: this._formBuilder.array([]),
// business_years: [''],
// business_month: [''],
// business_address_availability: [''],
// business_is_pd_visited: [''],
// business_pd_visited_remark: [''],
// business_assets_for_address: this._formBuilder.array([ this.createBusinessAssetsForAddress() ]),
// business_years: [''],
// business_month: [''],
// business_address_availability: [''],
// business_is_pd_visited: [''],
// business_pd_visited_remark: [''],
// business_assets_for_address: this._formBuilder.array([ this.createBusinessAssetsForAddress() ]),
/** load Form Data */
formLoadData(val) {
@ -288,7 +286,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
formid: ['22'],
company_id: [this.company_id],
business_assets_for_address: this._formBuilder.array([]),
business_assets_details: this._formBuilder.array([ this.initBusinessDetails() ]),
business_assets_details: this._formBuilder.array([this.initBusinessDetails()]),
business_assets_form_remark: ['']
});
this.loadaddresses();
@ -319,22 +317,22 @@ export class BusinessAssetsInfoComponent implements OnInit {
initBusinessAddressDetails() {
return this._formBuilder.group({
address_label:[''],
business_years: [''],
business_month: [''],
business_address_availability: [''],
business_is_pd_visited: [''],
business_pd_visited_remark: [''],
// this.createBusinessAssetsForAddress()
// business_details: this._formBuilder.array([]),
business_approximate_market_value: [''],
business_ownership_type: [''],
business_monthly_rented_amt: [''],
business_name_of_the_owner: [''],
business_name_of_the_other_owner: [''],
business_vintage: [''],
business_purchase_year: ['', Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
business_emi: [''],
address_label: [''],
business_years: [''],
business_month: [''],
business_address_availability: [''],
business_is_pd_visited: [''],
business_pd_visited_remark: [''],
// this.createBusinessAssetsForAddress()
// business_details: this._formBuilder.array([]),
business_approximate_market_value: [''],
business_ownership_type: [''],
business_monthly_rented_amt: [''],
business_name_of_the_owner: [''],
business_name_of_the_other_owner: [''],
business_vintage: [''],
business_purchase_year: ['', Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
business_emi: [''],
});
}
@ -489,20 +487,20 @@ export class BusinessAssetsInfoComponent implements OnInit {
initBusinessAddressDetailsWithdata(data) {
return this._formBuilder.group({
address_label:[data.address_label],
business_years: [data.business_years],
business_month: [data.business_month],
business_address_availability: [data.business_address_availability],
business_is_pd_visited: [data.business_is_pd_visited],
business_pd_visited_remark: [data.business_pd_visited_remark],
business_approximate_market_value: [data.business_approximate_market_value],
business_ownership_type: [data.business_ownership_type],
business_monthly_rented_amt: [data.business_monthly_rented_amt],
business_name_of_the_owner: [data.business_name_of_the_owner],
business_name_of_the_other_owner: [data.business_name_of_the_other_owner || ''],
business_vintage: [data.business_vintage],
business_purchase_year: [data.business_purchase_year, Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
business_emi: [data.business_emi || ''],
address_label: [data.address_label],
business_years: [data.business_years],
business_month: [data.business_month],
business_address_availability: [data.business_address_availability],
business_is_pd_visited: [data.business_is_pd_visited],
business_pd_visited_remark: [data.business_pd_visited_remark],
business_approximate_market_value: [data.business_approximate_market_value],
business_ownership_type: [data.business_ownership_type],
business_monthly_rented_amt: [data.business_monthly_rented_amt],
business_name_of_the_owner: [data.business_name_of_the_owner],
business_name_of_the_other_owner: [data.business_name_of_the_other_owner || ''],
business_vintage: [data.business_vintage],
business_purchase_year: [data.business_purchase_year, Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
business_emi: [data.business_emi || ''],
});
}
@ -550,52 +548,52 @@ export class BusinessAssetsInfoComponent implements OnInit {
addBusinessAddressAssetsDetailsWithData(data) {
var result = Object.keys(data).map(function (key) {
return data[key];
});
if (result.length > 0) {
result.forEach((datas, index) => {
this.RentAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_monthly_rented_amt);
this.appxMarketAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_approximate_market_value);
let Avaliablity = 1;
var result = Object.keys(data).map(function (key) {
return data[key];
});
if (result.length > 0) {
result.forEach((datas, index) => {
this.RentAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_monthly_rented_amt);
this.appxMarketAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_approximate_market_value);
let Avaliablity = 1;
if(datas.business_name_of_the_owner.length > 0){
datas.business_name_of_the_owner.forEach(option => {
if(option.id == 0 && option.group_id == 2){
Avaliablity = option.id;
}
});
if (datas.business_name_of_the_owner.length > 0) {
datas.business_name_of_the_owner.forEach(option => {
if (option.id == 0 && option.group_id == 2) {
Avaliablity = option.id;
}
this.isOtherOwnerForAddress[index] = Avaliablity == 0 ? true : false;
});
for (let val of result) {
let vals = {
address_label:val.address_label,
business_years: val.business_years,
business_month: val.business_month,
business_address_availability: val.business_address_availability,
business_is_pd_visited: val.business_is_pd_visited,
business_pd_visited_remark: val.business_pd_visited_remark,
business_approximate_market_value: val.business_approximate_market_value,
business_ownership_type: val.business_ownership_type,
business_monthly_rented_amt: val.business_monthly_rented_amt,
business_name_of_the_owner: val.business_name_of_the_owner,
business_name_of_the_other_owner: val.business_name_of_the_other_owner,
business_vintage: val.business_vintage,
business_purchase_year: val.business_purchase_year,
business_emi: val.business_emi
};
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
control.push(this.initBusinessAddressDetailsWithdata(vals));
// this.initBusinessDetailsWithdata(vals)
});
}
} else {
this.isOtherOwnerForAddress[index] = Avaliablity == 0 ? true : false;
});
for (let val of result) {
let vals = {
address_label: val.address_label,
business_years: val.business_years,
business_month: val.business_month,
business_address_availability: val.business_address_availability,
business_is_pd_visited: val.business_is_pd_visited,
business_pd_visited_remark: val.business_pd_visited_remark,
business_approximate_market_value: val.business_approximate_market_value,
business_ownership_type: val.business_ownership_type,
business_monthly_rented_amt: val.business_monthly_rented_amt,
business_name_of_the_owner: val.business_name_of_the_owner,
business_name_of_the_other_owner: val.business_name_of_the_other_owner,
business_vintage: val.business_vintage,
business_purchase_year: val.business_purchase_year,
business_emi: val.business_emi
};
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
control.push(this.initBusinessAddressDetails());
control.push(this.initBusinessAddressDetailsWithdata(vals));
// this.initBusinessDetailsWithdata(vals)
}
} else {
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
control.push(this.initBusinessAddressDetails());
}
}
addBusinessAssetsDetailsWithData(supp_data) {
@ -608,13 +606,13 @@ export class BusinessAssetsInfoComponent implements OnInit {
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value);
this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt);
let Avaliablity = 1;
console.log('datas.business_name_of_the_owner.length',datas.business_name_of_the_owner.length);
if(datas.business_name_of_the_owner.length > 0){
datas.business_name_of_the_owner.forEach(option => {
if(option.id == 0 && option.group_id == 2){
Avaliablity = option.id;
}
});
if (datas.business_name_of_the_owner.length > 0) {
datas.business_name_of_the_owner.forEach(option => {
if (option.id == 0 && option.group_id == 2) {
Avaliablity = option.id;
}
});
}
this.isOtherOwner[index] = Avaliablity == 0 ? true : false;
@ -780,18 +778,17 @@ export class BusinessAssetsInfoComponent implements OnInit {
}
/** To Convert Month into Year */
ConvertMonthintoYear(e,i) {
ConvertMonthintoYear(e, i) {
// const address_control = <FormArray>this._EditPDtriggerForm.controls['addresses'];
// console.log(e);
// console.log(i);
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
// control.controls[i]['controls'].isactive.setValue(0);
// address_control.controls[index].disable();
// console.log(by);
// return;
// console.log('address_control',address_control);
let business_year = control.controls[i]['controls'].business_years.value;
@ -827,7 +824,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
}
}
checkWithExistBusinessYear(e,i) {
checkWithExistBusinessYear(e, i) {
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
if (+e > this.generalExistBusinessYear) {
this.yearErrorMessage[i] = "Higher than Business Vintage";
@ -838,51 +835,51 @@ export class BusinessAssetsInfoComponent implements OnInit {
this.yearErrorMessage[i] = '';
}
}
setRequiredValidation2(value, ParInx,ChdInx, flag) {
setRequiredValidation2(value, ParInx, ChdInx, flag) {
if (flag == 4) {
let ParCtrls = <FormArray>this._businessAssetsQuesFrom.controls.assets_details;
let ChdCtrls:any = <FormArray>ParCtrls.controls[ParInx];
let ChdCtrls: any = <FormArray>ParCtrls.controls[ParInx];
let Avaliablity = 1;
value.forEach(option => {
if(option.id == 0 && option.group_id == 2){
Avaliablity = option.id;
}
});
if(Avaliablity == 0){
value.forEach(option => {
if (option.id == 0 && option.group_id == 2) {
Avaliablity = option.id;
}
});
if (Avaliablity == 0) {
ChdCtrls.controls.business_name_of_the_other_owner.setValidators([Validators.required]);
this.isOtherOwner[ParInx] = true;
}else{
this.isOtherOwner[ParInx] = true;
} else {
ChdCtrls.controls.business_name_of_the_other_owner.setValue('');
ChdCtrls.controls.business_name_of_the_other_owner.clearValidators();
this.isOtherOwner[ParInx] = false;
this.isOtherOwner[ParInx] = false;
}
ChdCtrls.controls.business_name_of_the_other_owner.updateValueAndValidity();
}
if(flag == 8){
if (flag == 8) {
let ParCtrls = <FormArray>this._businessAssetsQuesFrom.controls.business_assets_for_address;
let ChdCtrls:any = <FormArray>ParCtrls.controls[ParInx];
let ChdCtrls: any = <FormArray>ParCtrls.controls[ParInx];
let Avaliablity = 1;
value.forEach(option => {
if(option.id == 0 && option.group_id == 2){
Avaliablity = option.id;
}
});
value.forEach(option => {
if (option.id == 0 && option.group_id == 2) {
Avaliablity = option.id;
}
});
if(Avaliablity == 0){
if (Avaliablity == 0) {
ChdCtrls.controls.business_name_of_the_other_owner.setValidators([Validators.required]);
this.isOtherOwnerForAddress[ParInx] = true;
}else{
this.isOtherOwnerForAddress[ParInx] = true;
} else {
ChdCtrls.controls.business_name_of_the_other_owner.setValue('');
ChdCtrls.controls.business_name_of_the_other_owner.clearValidators();
this.isOtherOwnerForAddress[ParInx] = false;
this.isOtherOwnerForAddress[ParInx] = false;
}
ChdCtrls.controls.business_name_of_the_other_owner.updateValueAndValidity();

View File

@ -1,249 +1,310 @@
<form [formGroup]="bankingForm" class="bankForm">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<mat-dialog-content>
<mat-tab-group>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<mat-card>
<mat-card-content>
<div formArrayName="itemRows" autocomplete="off">
<mat-accordion
*ngFor="let itemrow of bankingForm.controls.itemRows['controls']; let i=index;let last=last"
[formGroupName]="i">
<mat-expansion-panel class="banlFields" [expanded]="step == i">
<mat-expansion-panel-header>
<mat-panel-title>
<p>Banking Details #{{i+1}}
</p>
</mat-panel-title>
<!-- <mat-panel-description end>
<mat-tab label="Questions">
<mat-card>
<mat-card-content>
<div formArrayName="itemRows" autocomplete="off">
<mat-accordion *ngFor="let itemrow of bankingForm.controls.itemRows['controls']; let i=index;let last=last"
[formGroupName]="i">
<mat-expansion-panel class="banlFields" [expanded]="step == i">
<mat-expansion-panel-header>
<mat-panel-title>
<p>Banking Details #{{i+1}}
</p>
</mat-panel-title>
<!-- <mat-panel-description end>
<mat-icon (click)="deleteBankdetails(i)" *ngIf="!last" style = "padding-top: 2%" matTooltip="Delete Banking Details" matTooltipPosition="above" >delete</mat-icon>
</mat-panel-description> -->
</mat-expansion-panel-header>
<mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name" [compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,itemrow,1)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true" style="width:45%">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant" autocomplete="off">
</mat-form-field>
</mat-expansion-panel-header>
<mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,itemrow,1)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true"
style="width:45%">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant"
autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name" (selectionChange)="setRequiredValidation($event.values,itemrow,2)">
<mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name"
(selectionChange)="setRequiredValidation($event.values,itemrow,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('bank_name').value == 1">
<input matInput placeholder="Specify Bank Name"
formControlName="other_bank" autocomplete="off">
</mat-form-field>
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{
btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('bank_name').value == 1">
<input matInput placeholder="Specify Bank Name" formControlName="other_bank"
autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)" placeholder="Account Type" formControlName="account_type" >
<mat-option>Select</mat-option>
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)"
placeholder="Account Type" formControlName="account_type">
<mat-option>Select</mat-option>
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{
prop.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<mat-select placeholder="Is this the main business account"
formControlName="is_main" >
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<mat-select placeholder="Is this the main business account" formControlName="is_main">
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<div fxLayout="row" fxLayoutAlign="start none">
<mat-form-field style="width: 35%;" *ngIf="salaryField">
<mat-select placeholder="Salary Credited in this account"
formControlName="salary" >
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
<mat-option value="NA">NA</mat-option>
</mat-select>
</mat-form-field>
<div fxLayout="row" fxLayoutAlign="start none">
<mat-form-field style="width: 35%;" *ngIf="salaryField">
<mat-select placeholder="Salary Credited in this account" formControlName="salary">
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
<mat-option value="NA">NA</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]"> <!-- *ngIf="itemrow.get('account_type').value != 2"> -->
<input matInput autocomplete="off" placeholder="Limit in case of OD / CC account"
formControlName="limit" OnlyNumber type="text" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
<div>
<label>Number of Years / Months since account was started</label>
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="vintage_year" OnlyNumber type="text">
</mat-form-field>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="vintage_month" OnlyNumber type="text" (change)="ConvertMonthintoYear(itemrow,$event.target.value)">
</mat-form-field>
</div>
</div>
<mat-action-row>
<div fxFlex="100" align="center">
<button type="button" mat-flat-button color="primary" (click)="addBankdetails(i, $event)"
matTooltip="Add More" matTooltipPosition="above" *ngIf="last">
<strong>Add More Banking Details</strong>
</button>
</div>
<!-- <button type="button" mat-button (click)="deleteBankdetails(i)" color="warn"
<mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]">
<!-- *ngIf="itemrow.get('account_type').value != 2"> -->
<input matInput autocomplete="off" placeholder="Limit in case of OD / CC account"
formControlName="limit" OnlyNumber type="text" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}}
{{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
<div>
<label>Number of Years / Months since account was started</label>
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)"
formControlName="vintage_year" OnlyNumber type="text">
</mat-form-field>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)"
formControlName="vintage_month" OnlyNumber type="text" (change)="ConvertMonthintoYear(itemrow,$event.target.value)">
</mat-form-field>
</div>
</div>
<mat-action-row>
<div fxFlex="100" align="center">
<button type="button" mat-flat-button color="primary" (click)="addBankdetails(i, $event)"
matTooltip="Add More" matTooltipPosition="above" *ngIf="last">
<strong>Add More Banking Details</strong>
</button>
</div>
<!-- <button type="button" mat-button (click)="deleteBankdetails(i)" color="warn"
matTooltip="Delete"matTooltipPosition="left" *ngIf="!last">
<strong>Delete Banking Details</strong>
</button> -->
<!-- <button mat-button color="warn" (click)="prevStep()">Previous</button>
<!-- <button mat-button color="warn" (click)="prevStep()">Previous</button>
<button mat-button color="primary" (click)="nextStep()">End</button> -->
<!-- ngIf="i > 0" -->
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Banking Details" matTooltipPosition="above" (click)="deleteBankdetails(i)"
*ngIf="bankingForm.controls.itemRows.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
<!-- ngIf="i > 0" -->
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Banking Details"
matTooltipPosition="above" (click)="deleteBankdetails(i)" *ngIf="bankingForm.controls.itemRows.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-action-row>
</mat-expansion-panel>
<!-- <div style="text-align: right;" class="pt-1" *ngIf="bankingForm.controls.itemRows['controls'].length == (i+1)">
</mat-action-row>
</mat-expansion-panel>
<!-- <div style="text-align: right;" class="pt-1" *ngIf="bankingForm.controls.itemRows['controls'].length == (i+1)">
<button class="mr-1 mb-1 hover-icon" color="primary" mat-raised-button mat-icon-button matTooltip="Add More Banking Details" matTooltipPosition="above" >
<mat-icon >add</mat-icon>
</button></div> -->
</mat-accordion>
</div>
</mat-accordion>
</div>
</mat-card-content>
</mat-card>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</mat-card-content>
</mat-card>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</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="banking_form_remark" ></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button class="mr-1 mb-1 hover-icon" type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="bankSubmit()"><mat-icon>save</mat-icon>
</button>
</mat-tab-group>
</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="banking_form_remark"></textarea>
</mat-form-field>
</div>
</mat-dialog-actions>
<div fxFlex="40" align="end">
<button class="mr-1 mb-1 hover-icon" type="submit" mat-raised-button mat-icon-button type="submit"
matTooltip="Submit" matTooltipPosition="above" (click)="bankSubmit()">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>
</form>
<notifier-container></notifier-container>

View File

@ -1,32 +1,32 @@
import {
Component,
OnInit,
Inject,
Input
Component,
OnInit,
Inject,
Input
} from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl, AbstractControl,
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl, AbstractControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from "@angular/router";
import { ActivatedRoute, Router } from "@angular/router";
@Component({
selector: 'app-business-banking-details',
templateUrl: './business-banking-details.component.html',
styleUrls: ['./business-banking-details.component.scss']
selector: 'app-business-banking-details',
templateUrl: './business-banking-details.component.html',
styleUrls: ['./business-banking-details.component.scss']
})
export class BusinessBankingDetailsComponent implements OnInit {
customer_segment_abbr: any;
@ -34,93 +34,93 @@ export class BusinessBankingDetailsComponent implements OnInit {
lender_applicant_id: any;
main_applicant: any;
pdid: number;
pageTitle: string ="Banking Information";
pdid: number;
pageTitle: string = "Banking Information";
public bankingForm: FormGroup;
step: number;
private notifier: NotifierService;
public pd_cus_segment:string;
public pd_cus_segment: string;
public applicants: any;
m_accountType= [];
m_accountType = [];
m_btLenderList = [];
salaryField : boolean;
OtherFlag : any = [];
limitCaseFlag : any = [];
amtInwords : any = [];
emiAmtInwords : any = [];
salaryField: boolean;
OtherFlag: any = [];
limitCaseFlag: any = [];
amtInwords: any = [];
emiAmtInwords: any = [];
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
existCompanyList: any = [];
mergeCompanyApplicant: any = [];
company_id: String;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<BusinessBankingDetailsComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.pd_cus_segment = this.pd_cus_segment.substring(0,3);
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2)
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.notifier = notifier;
this.company_id = this.pd_all_details.company_id;
this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<BusinessBankingDetailsComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.pd_cus_segment = this.pd_cus_segment.substring(0, 3);
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(appt => appt.applicant_type != 2)
this.applicants.push({ 'pd_co_applicant_id': '0', 'applicant_name': 'Others' });
this.notifier = notifier;
this.company_id = this.pd_all_details.company_id;
this.pageTitle = this.pd_all_details.company_name + ' - ' + this.pageTitle;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
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,
}
};
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,
}
};
ngOnInit() {
this.step = 0;
this.initBankingForm();
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active===true);/* && val.is_company_applicant===true && val.company_order_id==this.company_id */
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data => {
if (data.dataStatus) {
this.existCompanyList = data.records.filter(val => val.is_active === true);/* && val.is_company_applicant===true && val.company_order_id==this.company_id */
}
let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){
modifyCompanyList = this.existCompanyList.map(element => {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
});
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
let modifyCompanyList: any = [];
if (this.existCompanyList.length > 0) {
modifyCompanyList = this.existCompanyList.map(element => {
return { id: element.company_order_id.toString(), name: element.company_name, group_id: 1 };
});
this.mergeCompanyApplicant.push({ groupName: 'COMPANIES', groupValues: modifyCompanyList })
}
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
}
let modifyApplicantList: any = [];
if (this.applicants.length > 0) {
modifyApplicantList = this.applicants.map(element => {
return { id: element.pd_co_applicant_id, name: element.applicant_name, group_id: 2 };
});
this.mergeCompanyApplicant.push({ groupName: 'APPLICANTS', groupValues: modifyApplicantList })
}
})
this.getM_AccountType();
this.getM_BTLenderList();
this.salaryField = this.pd_cus_segment.substring(0,2) == 'SE' ? false : true ;
this.salaryField = this.pd_cus_segment.substring(0, 2) == 'SE' ? false : true;
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '21';
@ -136,12 +136,12 @@ export class BusinessBankingDetailsComponent implements OnInit {
if (result.length == 0) {
control.push(this.createBankarray());
} else {
result.forEach((datas,index) => {
result.forEach((datas, index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit);
// this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(+datas.account_type,index)
this.selectedAccTypeChanges(+datas.account_type, index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
control.push(this.createBankarray());
});
this.bankingForm.controls.itemRows.setValue(result);
@ -154,24 +154,24 @@ export class BusinessBankingDetailsComponent implements OnInit {
// ======================
getM_AccountType() {
this._pd.getAllMasterDatas('ACCOUNTTYPE').subscribe(
data => {
this.m_accountType = data.records.filter(data => data.isactive == 1);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
getM_AccountType() {
this._pd.getAllMasterDatas('ACCOUNTTYPE').subscribe(
data => {
this.m_accountType = data.records.filter(data => data.isactive == 1);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
getM_BTLenderList(){
this._pd.getAllMasterDatas('BTLENDERLIST').subscribe(
data => {
this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1);
})
}
getM_BTLenderList() {
this._pd.getAllMasterDatas('BTLENDERLIST').subscribe(
data => {
this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1);
})
}
public initBankingForm(): void {
this.bankingForm = this.fb.group({
@ -183,12 +183,12 @@ export class BusinessBankingDetailsComponent implements OnInit {
createBankarray() {
return this.fb.group({
applicant_name: [''],
other_applicant : [''],
other_applicant: [''],
bank_name: [''],
other_bank: [''],
account_type: [''],
//salary: [''],
salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : [''],
salary: this.pd_cus_segment.substring(0, 2) == 'SE' ? [''] : [''],
limit: [''],
//is_main: [''],
//is_main: [this.pd_cus_segment == 'SAL' ? '' : ''],
@ -223,34 +223,34 @@ export class BusinessBankingDetailsComponent implements OnInit {
}
bankSubmit() {
let records: any = {};
records.pdid = this.pdid;
records.formid = '21';
records.company_id = this.company_id; records.banking_form_remark = this.bankingForm.controls.banking_form_remark.value;
// records.fk_createdby = '252';
records.banking_details = this.bankingForm.controls['itemRows'].value;
let records: any = {};
records.pdid = this.pdid;
records.formid = '21';
records.company_id = this.company_id; records.banking_form_remark = this.bankingForm.controls.banking_form_remark.value;
// records.fk_createdby = '252';
records.banking_details = this.bankingForm.controls['itemRows'].value;
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
// this.dialogRef.close();
setTimeout(() =>{
this.dialogRef.close();
},3000);
}
else{
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this._pd.saveForm(records).subscribe(data => {
if (data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
// this.dialogRef.close();
setTimeout(() => {
this.dialogRef.close();
}, 3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({onlySelf: true});
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
}
@ -268,27 +268,27 @@ export class BusinessBankingDetailsComponent implements OnInit {
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
compareObjects(o1: any, o2: any) {
if (o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
// check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
}
else {
return false;
checkOthers(values) {
if (values != null) {
return values.id == 0 ? true : false;
}
else {
return false;
}
}
}
selectedAccTypeChanges(event: any, i) {
selectedAccTypeChanges(event: any,i){
if(event == 2 || event == 1) {
if (event == 2 || event == 1) {
this.limitCaseFlag[i] = false;
// const control = <FormArray>this.bankingForm.controls['itemRows'];
@ -297,19 +297,19 @@ export class BusinessBankingDetailsComponent implements OnInit {
// control.controls[0].get('limit').updateValueAndValidity();
}
else{
else {
this.limitCaseFlag[i] = true;
}
}
/** To Convert Month into Year */
ConvertMonthintoYear(itemrow,e){
ConvertMonthintoYear(itemrow, e) {
let year = itemrow.controls.vintage_year.value;
let converted_month : number = e%12;
let converted_year : number = e/12;
let converted_month: number = e % 12;
let converted_year: number = e / 12;
itemrow.controls.vintage_year.setValue(+year + +Math.floor(converted_year));
itemrow.controls.vintage_month.setValue(Math.floor(converted_month));
@ -317,33 +317,33 @@ export class BusinessBankingDetailsComponent implements OnInit {
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
inWords(e, i, flag) {
switch (flag) {
case 1:
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2:
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}
setRequiredValidation(value,item,flag) {
setRequiredValidation(value, item, flag) {
if(flag == 1){
value==0
? item.controls.other_applicant.setValidators([Validators.required])
: item.controls.other_applicant.clearValidators();
item.controls.other_applicant.updateValueAndValidity();
}
if(flag == 2){
value==1
? item.controls.other_bank.setValidators([Validators.required])
: item.controls.other_bank.clearValidators();
item.controls.other_bank.updateValueAndValidity();
}
if (flag == 1) {
value == 0
? item.controls.other_applicant.setValidators([Validators.required])
: item.controls.other_applicant.clearValidators();
item.controls.other_applicant.updateValueAndValidity();
}
if (flag == 2) {
value == 1
? item.controls.other_bank.setValidators([Validators.required])
: item.controls.other_bank.clearValidators();
item.controls.other_bank.updateValueAndValidity();
}
}

View File

@ -1,11 +1,13 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{pageTitle}}
</div>
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<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;">
@ -14,16 +16,19 @@
<mat-card *ngIf="manufacturingForm">
<h5 style="margin: 12px;padding:10px !important;">Manufacturing Product Details</h5>
<div formArrayName="manufacturing_details">
<div *ngFor="let item of _supplierQuesFrom.controls.manufacturing_details['controls']; let i=index" [formGroupName]="i">
<div *ngFor="let item of _supplierQuesFrom.controls.manufacturing_details['controls']; let i=index"
[formGroupName]="i">
<div formArrayName="main_raw_materials">
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index" [formGroupName]="l">
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index"
[formGroupName]="l">
<mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Product #{{l+1}}</h6>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<mat-select placeholder="Manufacturing Product Name" formControlName="manufacturing_product_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_manufacturingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
<mat-option *ngFor="let pm of m_manufacturingProducts[0]" [value]="pm.name">{{
pm.name }}</mat-option>
</mat-select>
</mat-form-field>
@ -35,112 +40,128 @@
</mat-form-field>
</div>
<div fxLayout="row nowrap">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,1)" >
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"
(selectionChange)="selectedPersonDesignation(items,$event.value,1)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number">
<input matInput placeholder="Client Contact Person Mobile Number"
formControlName="manufacturing_contact_person_mobile_number">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field>
<mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode"
type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number"
formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<!-- <mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> -->
<mat-select placeholder="Payment Terms" formControlName="manufacturing_payment_type" (selectionChange)="checkCard($event.value,1,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
<mat-select placeholder="Payment Terms" formControlName="manufacturing_payment_type"
(selectionChange)="checkCard($event.value,1,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="manufacturing_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
</mat-select>
<mat-select placeholder="Payment Mode" formControlName="manufacturing_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment
received through Banking channels.</mat-option>
</mat-select>
</mat-form-field>
</mat-form-field>
</div>
<div fxLayout="row nowrap" style="padding-left: 2%;" *ngIf="items.get('manufacturing_payment_type').value == 3">
<mat-label>No of days of Credit provided to Client for payment</mat-label>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days From" formControlName="manufacturing_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days To" formControlName="manufacturing_credit_days_to" type="number">
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days From" formControlName="manufacturing_credit_days_from"
type="number">
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days To" formControlName="manufacturing_credit_days_to"
type="number">
</mat-form-field>
</div>
<div align="end">
<span *ngIf="item.controls.main_raw_materials.controls.length > 1" (click)="removeRawMaterials(l)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon"
color="primary" matTooltip="Delete" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</span>
</div>
</mat-card>
</div>
</div>
<div fxlayout="row">
<div fxFlex="100" align="center">
<button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above" type="button"
class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><strong>Add More Client</strong></button>
</div>
</div>
<div fxlayout="row">
<div fxlayout="row">
<div fxFlex="100" align="center">
<button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above"
type="button" class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><strong>Add
More Client</strong></button>
</div>
</div>
<div fxlayout="row">
<mat-form-field style="width: 80%" *ngIf="mfgCreditCardFlag">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="main_raw_materials_total_payments_percent_on_credit"
type="number">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?"
formControlName="main_raw_materials_total_payments_percent_on_credit" type="number">
</mat-form-field>
</div>
</div>
</div>
</div>
</mat-card>
<mat-card *ngIf="tradingForm">
<h5 style="margin: 12px;padding:10px !important;">Trading Product Details</h5>
<div formArrayName="trade_details">
<div *ngFor="let item of _supplierQuesFrom.controls.trade_details['controls']; let i=index" [formGroupName]="i">
<div *ngFor="let item of _supplierQuesFrom.controls.trade_details['controls']; let i=index"
[formGroupName]="i">
<div formArrayName="trading_products">
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index" [formGroupName]="l">
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index"
[formGroupName]="l">
<mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Trading Product #{{l+1}}</h6>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<mat-select placeholder="Trading Product Name" formControlName="trade_product_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_tradingProducts" [value]="pm.name">{{ pm.name }}</mat-option>
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_tradingProducts" [value]="pm.name">{{
pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<!--<mat-form-field style="width: 100%">
@ -150,63 +171,71 @@
<input matInput placeholder="Client Name" formControlName="trade_client_name">
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Name" formControlName="trade_product_contact_person_name">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"
(selectionChange)="selectedPersonDesignation(items,$event.value,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number" OnlyNumber type="text">
<input matInput placeholder="Client Contact Person Mobile Number"
formControlName="trade_product_contact_person_mobile_number" OnlyNumber
type="text">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field>
<mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode"
type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number"
formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<!-- <mat-select placeholder="Payment Type" formControlName="trade_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> -->
<mat-select placeholder="Payment Terms" formControlName="trade_product_payment_type" (selectionChange)="checkCard($event.value,2,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
<mat-select placeholder="Payment Terms" formControlName="trade_product_payment_type"
(selectionChange)="checkCard($event.value,2,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="trade_product_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
</mat-select>
<mat-select placeholder="Payment Mode" formControlName="trade_product_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment
received through Banking channels.</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-form-field style="width: 45%" *ngIf="items.get('trade_product_payment_type').value == 3">
@ -215,33 +244,39 @@
</div>
<div fxLayout="row nowrap" style="padding-left: 2%;" *ngIf="items.get('trade_product_payment_type').value == 3">
<mat-label>No of days of Credit provided to Client for payment</mat-label>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days From" formControlName="trade_product_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days To" formControlName="trade_product_credit_days_to" type="number">
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days From" formControlName="trade_product_credit_days_from"
type="number">
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days To" formControlName="trade_product_credit_days_to"
type="number">
</mat-form-field>
</div>
<div align="end">
<span *ngIf="item.controls.trading_products.controls.length > 1" (click)="removeTradingProduct(l)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
</span>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon"
color="primary" matTooltip="Delete" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</span>
</div>
</mat-card>
</div>
</div>
<div fxlayout="row">
<div fxFlex="100" align="center">
<button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above" type="button"
class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><strong>Add More Client</strong></button>
</div>
</div>
<div fxlayout="row">
<mat-form-field style="width: 80%" *ngIf="trdCreditCardFlag">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="trading_products_total_payments_percent_on_credit"
type="number">
</mat-form-field>
</div>
<div fxlayout="row">
<div fxFlex="100" align="center">
<button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above"
type="button" class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><strong>Add
More Client</strong></button>
</div>
</div>
<div fxlayout="row">
<mat-form-field style="width: 80%" *ngIf="trdCreditCardFlag">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?"
formControlName="trading_products_total_payments_percent_on_credit" type="number">
</mat-form-field>
</div>
</div>
</div>
</mat-card>
@ -249,118 +284,134 @@
<mat-card *ngIf="serviceProviderForm">
<!--<h5 style="margin: 12px;padding:10px !important;">Service Provider Product Details</h5>-->
<div formArrayName="service_provider_details">
<div *ngFor="let item of _supplierQuesFrom.controls.service_provider_details['controls']; let i=index" [formGroupName]="i">
<div *ngFor="let item of _supplierQuesFrom.controls.service_provider_details['controls']; let i=index"
[formGroupName]="i">
<div formArrayName="service_products">
<div *ngFor="let items of item.controls.service_products['controls']; let l=index" [formGroupName]="l">
<div *ngFor="let items of item.controls.service_products['controls']; let l=index"
[formGroupName]="l">
<mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Service Provided #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<mat-select placeholder="Select the Service Provided" formControlName="service_provider_product_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_suplierProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
<mat-option *ngFor="let pm of m_suplierProducts[0]" [value]="pm.name">{{
pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<input matInput placeholder="Client Name" formControlName="service_provider_client_name">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<input matInput placeholder="Client Name" formControlName="service_provider_client_name">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!--<mat-form-field style="width: 100%">
<input matInput placeholder="Trade Product Name" formControlName="trade_product_name">
</mat-form-field>-->
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Name" formControlName="service_provider_product_contact_person_name">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,3)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"
(selectionChange)="selectedPersonDesignation(items,$event.value,3)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Mobile Number" formControlName="service_provider_product_contact_person_mobile_number">
<input matInput placeholder="Client Contact Person Mobile Number"
formControlName="service_provider_product_contact_person_mobile_number">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field>
<mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode"
type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number"
formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<!-- <mat-select placeholder="Payment Type" formControlName="service_provider_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> -->
<mat-select placeholder="Payment Terms" formControlName="service_provider_product_payment_type" (selectionChange)="checkCard($event.value,3,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
<mat-select placeholder="Payment Terms" formControlName="service_provider_product_payment_type"
(selectionChange)="checkCard($event.value,3,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="service_provider_product_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
</mat-select>
<mat-select placeholder="Payment Mode" formControlName="service_provider_product_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment
received through Banking channels.</mat-option>
</mat-select>
</mat-form-field>
</mat-form-field>
<!-- <mat-form-field style="width: 45%" *ngIf="items.get('service_provider_product_payment_type').value == 3">
<input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="service_provider_product_credit_days">
</mat-form-field> -->
</div>
<div fxLayout="row nowrap" style="padding-left: 2%;" *ngIf="items.get('service_provider_product_payment_type').value == 3">
<mat-label>No of days of Credit provided to Client for payment</mat-label>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days From" formControlName="service_provider_product_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days To" formControlName="service_provider_product_credit_days_to" type="number">
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days From" formControlName="service_provider_product_credit_days_from"
type="number">
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days To" formControlName="service_provider_product_credit_days_to"
type="number">
</mat-form-field>
</div>
<div align="end">
<span *ngIf="item.controls.service_products.controls.length > 1" (click)="removeServiceProduct(l)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon"
color="primary" matTooltip="Delete" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</span>
</div>
</mat-card>
</div>
</div>
<div fxlayout="row">
<div fxFlex="100" align="center">
<button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above" type="button"
class="mr-1 mb-1 hover-icon" (click)="addMoreServiceProduct($event); false"><strong>Add More Client</strong></button>
</div>
<div fxFlex="100" align="center">
<button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above"
type="button" class="mr-1 mb-1 hover-icon" (click)="addMoreServiceProduct($event); false"><strong>Add
More Client</strong></button>
</div>
</div>
<div fxlayout="row">
<mat-form-field style="width: 80%" *ngIf="spCreditCardFlag">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="service_products_total_payments_percent_on_credit"
type="number">
</mat-form-field>
</div>
<mat-form-field style="width: 80%" *ngIf="spCreditCardFlag">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?"
formControlName="service_products_total_payments_percent_on_credit" type="number">
</mat-form-field>
</div>
</div>
</div>
</mat-card>
<!-- <mat-card *ngIf="retaildTradingForm">
@ -376,14 +427,17 @@
</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>
<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>
<div *ngIf="!noRecordsFound">
<div style="margin: 12px; font-size: 18px;"> {{ errorMessage }} </div>
<div style="margin: 12px; font-size: 18px;"> {{ errorMessage }} </div>
</div>
<notifier-container></notifier-container>

View File

@ -45,8 +45,8 @@ export class ClientInfoComponent implements OnInit {
public m_paymentType = [];
private notifier: NotifierService;
companyRelationShipList: any=[];
titleList: any=[];
companyRelationShipList: any = [];
titleList: any = [];
public m_manufacturingProducts = [
{
@ -85,11 +85,11 @@ export class ClientInfoComponent implements OnInit {
this.form_id = 2;
this.company_id = this.pd_all_details.company_id;
this.notifier = notifier;
this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.pageTitle = this.pd_all_details.company_name + ' - ' + this.pageTitle;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
public viewerOptions: any = {
navbar: false,
@ -114,54 +114,54 @@ export class ClientInfoComponent implements OnInit {
noRecordsFound: Boolean = false;
errorMessage: any = '';
ngOnInit() {
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,this.company_id).subscribe(data => {
if(data.dataStatus){
// let datas = {
// "profession_name": "Others",
// "type_of_activity": [
// {
// "type_of_activity_id": 1,
// "name": "Manufacturing Details"
// },
// {
// "type_of_activity_id": 2,
// "name": "Retail trading"
// },
// {
// "type_of_activity_id": 3,
// "name": "Wholesale trading"
// },
// {
// "type_of_activity_id": 4,
// "name": "Service Providers"
// }
// ]
// };
let datas = data.records;
this.m_manufacturingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 2 ){return data}}).map(data=> [...data.prodcuts]);
// this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]);
this.m_suplierProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 5 ){return data}}).map(data=> [...data.prodcuts]);
let api = Object.keys(datas.type_of_activity).map(function (key) {
return datas.type_of_activity[key];
});
if(api.length > 0){
api.forEach(val => {
if (val.type_of_activity_id == 3) {
if(val.prodcuts){
this.m_tradingProducts.push(val.prodcuts);
}
}
if (val.type_of_activity_id == 4) {
if(val.prodcuts){
this.m_tradingProducts.push(val.prodcuts);
}
}
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => {
if (data.dataStatus) {
// let datas = {
// "profession_name": "Others",
// "type_of_activity": [
// {
// "type_of_activity_id": 1,
// "name": "Manufacturing Details"
// },
// {
// "type_of_activity_id": 2,
// "name": "Retail trading"
// },
// {
// "type_of_activity_id": 3,
// "name": "Wholesale trading"
// },
// {
// "type_of_activity_id": 4,
// "name": "Service Providers"
// }
// ]
// };
let datas = data.records;
this.m_manufacturingProducts = datas.type_of_activity.filter(data => { if (data.type_of_activity_id == 2) { return data } }).map(data => [...data.prodcuts]);
// this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]);
this.m_suplierProducts = datas.type_of_activity.filter(data => { if (data.type_of_activity_id == 5) { return data } }).map(data => [...data.prodcuts]);
let api = Object.keys(datas.type_of_activity).map(function (key) {
return datas.type_of_activity[key];
});
}
this.m_tradingProducts = [].concat.apply([], this.m_tradingProducts);
this.initFormLoadDetails(datas.type_of_activity);
}else {
if (api.length > 0) {
api.forEach(val => {
if (val.type_of_activity_id == 3) {
if (val.prodcuts) {
this.m_tradingProducts.push(val.prodcuts);
}
}
if (val.type_of_activity_id == 4) {
if (val.prodcuts) {
this.m_tradingProducts.push(val.prodcuts);
}
}
});
}
this.m_tradingProducts = [].concat.apply([], this.m_tradingProducts);
this.initFormLoadDetails(datas.type_of_activity);
} else {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
this.errorMessage = data.msg;
@ -175,16 +175,16 @@ export class ClientInfoComponent implements OnInit {
// this.getM_FreqOfPurchase();
this.getM_PaymentModeType();
// this.getPdSupplierFormDetails();
this.getMasterDetails('COMPANYRELATIONSHIPS',1);
this.getMasterDetails('TITLES',2);
this.getMasterDetails('COMPANYRELATIONSHIPS', 1);
this.getMasterDetails('TITLES', 2);
}
// retaildTradingForm: Boolean = false;
initFormLoadDetails(record) {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
params.company_id = this.company_id;
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
params.company_id = this.company_id;
this.pdTrigerService.retriveForm(params).subscribe(
data => {
if (data.dataStatus) {
@ -194,7 +194,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['2'],
company_id:[this.company_id],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
@ -207,12 +207,12 @@ export class ClientInfoComponent implements OnInit {
// let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
// return dataForm.main_raw_materials[key];
// });
if(dataForm.manufacturing_details){
if (dataForm.manufacturing_details) {
let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials;
this.initManufacturingProductsDetails(api_main_raw_materials);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null);
}
else{
else {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
@ -224,13 +224,13 @@ export class ClientInfoComponent implements OnInit {
// let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
// return dataForm.trading_products[key];
// });
if(dataForm.trade_details){
let api_trading_products = dataForm.trade_details[0].trading_products;
this.initTradingProductsDetails(api_trading_products);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null);
if (dataForm.trade_details) {
let api_trading_products = dataForm.trade_details[0].trading_products;
this.initTradingProductsDetails(api_trading_products);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null);
}
else{
this.initTradingProductsDetails(null);-
else {
this.initTradingProductsDetails(null); -
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
@ -245,12 +245,12 @@ export class ClientInfoComponent implements OnInit {
// let api_service_provider_products = dataForm.service_provider_details[0].service_products;
// this.initServiceProviderProductsDetails(api_service_provider_products);
// this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null);
if(dataForm.service_provider_details){
if (dataForm.service_provider_details) {
let api_service_provider_products = dataForm.service_provider_details[0].service_products;
this.initServiceProviderProductsDetails(api_service_provider_products);
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null);
}
else{
else {
this.initServiceProviderProductsDetails(null);
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(null);
}
@ -265,7 +265,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['2'],
company_id:[this.company_id],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
@ -301,7 +301,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['2'],
company_id:[this.company_id],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
@ -386,10 +386,10 @@ export class ClientInfoComponent implements OnInit {
if (datas === null) {
control.push(this.initManufacturingProducts(null));
} else {
datas.forEach((val,inx) => {
this.checkCard(val.manufacturing_payment_type,1,inx);
datas.forEach((val, inx) => {
this.checkCard(val.manufacturing_payment_type, 1, inx);
control.push(this.initManufacturingProducts(val));
});
});
// for (let val of datas) {
// control.push(this.initManufacturingProducts(val));
// }
@ -402,34 +402,34 @@ export class ClientInfoComponent implements OnInit {
manufacturing_product_name: [''],
manufacturing_client_name: [''],
manufacturing_contact_person_name: [''],
manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_contact_person_mobile_number: ['', Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
manufacturing_payment_type: [''],
manufacturing_payment_mode:[''],
manufacturing_payment_mode: [''],
// manufacturing_credit_days: [''],
person_title_name:[''],
person_designation:[''],
person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[''],
manufacturing_credit_days_from:[''],
manufacturing_credit_days_to:['']
person_title_name: [''],
person_designation: [''],
person_stdcode: ['', Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
other_person_designation: [''],
manufacturing_credit_days_from: [''],
manufacturing_credit_days_to: ['']
})
} else {
return this._formBuilder.group({
manufacturing_product_name: [records.manufacturing_product_name || null],
manufacturing_client_name: [records.manufacturing_client_name || null],
manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null],
manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null, Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
manufacturing_payment_type: [records.manufacturing_payment_type || null],
manufacturing_payment_mode:[records.manufacturing_payment_mode || null],
manufacturing_payment_mode: [records.manufacturing_payment_mode || null],
manufacturing_credit_days: [records.manufacturing_credit_days || null],
person_title_name:[records.person_title_name || null],
person_designation:[records.person_designation || null],
person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[records.other_person_designation || null],
manufacturing_credit_days_from:[records.manufacturing_credit_days_from || null],
manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null]
person_title_name: [records.person_title_name || null],
person_designation: [records.person_designation || null],
person_stdcode: [records.person_stdcode || null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: [records.person_landline || null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
other_person_designation: [records.other_person_designation || null],
manufacturing_credit_days_from: [records.manufacturing_credit_days_from || null],
manufacturing_credit_days_to: [records.manufacturing_credit_days_to || null]
})
}
}
@ -439,8 +439,8 @@ export class ClientInfoComponent implements OnInit {
if (datas === null) {
control.push(this.initTradingProducts(null));
} else {
datas.forEach((val,inx) => {
this.checkCard(val.trade_product_payment_type,2,inx);
datas.forEach((val, inx) => {
this.checkCard(val.trade_product_payment_type, 2, inx);
control.push(this.initTradingProducts(val));
});
// for (let val of datas) {
@ -455,34 +455,34 @@ export class ClientInfoComponent implements OnInit {
trade_product_name: [''],
trade_client_name: [''],
trade_product_contact_person_name: [''],
trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
trade_product_contact_person_mobile_number: ['', Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
trade_product_payment_type: [''],
trade_product_payment_mode:[''],
trade_product_payment_mode: [''],
trade_product_frequency_of_purchase: [''],
trade_product_credit_days_from: [''],
trade_product_credit_days_to: [''],
person_title_name:[''],
person_designation:[''],
person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[''],
person_title_name: [''],
person_designation: [''],
person_stdcode: ['', Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
other_person_designation: [''],
})
} else {
return this._formBuilder.group({
trade_product_name: [records.trade_product_name],
trade_client_name: [records.trade_client_name],
trade_product_contact_person_name: [records.trade_product_contact_person_name],
trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number, Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
trade_product_payment_type: [records.trade_product_payment_type],
trade_product_payment_mode:[records.trade_product_payment_mode],
trade_product_payment_mode: [records.trade_product_payment_mode],
trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase],
trade_product_credit_days_from: [records.trade_product_credit_days_from],
trade_product_credit_days_to: [records.trade_product_credit_days_to],
person_title_name:[records.person_title_name || null],
person_designation:[records.person_designation || null],
person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[records.other_person_designation || null],
person_title_name: [records.person_title_name || null],
person_designation: [records.person_designation || null],
person_stdcode: [records.person_stdcode || null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: [records.person_landline || null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
other_person_designation: [records.other_person_designation || null],
})
}
}
@ -492,8 +492,8 @@ export class ClientInfoComponent implements OnInit {
if (datas === null) {
control.push(this.initServiceProviderProducts(null));
} else {
datas.forEach((val,inx) => {
this.checkCard(val.service_provider_product_payment_type,3,inx);
datas.forEach((val, inx) => {
this.checkCard(val.service_provider_product_payment_type, 3, inx);
control.push(this.initServiceProviderProducts(val));
});
// for (let val of datas) {
@ -508,34 +508,34 @@ export class ClientInfoComponent implements OnInit {
service_provider_product_name: [''],
service_provider_client_name: [''],
service_provider_product_contact_person_name: [''],
service_provider_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
service_provider_product_contact_person_mobile_number: ['', Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
service_provider_product_payment_type: [''],
service_provider_product_payment_mode:[''],
service_provider_product_payment_mode: [''],
service_provider_product_frequency_of_purchase: [''],
service_provider_product_credit_days_from: [''],
service_provider_product_credit_days_to: [''],
person_title_name:[''],
person_designation:[''],
person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[''],
person_title_name: [''],
person_designation: [''],
person_stdcode: ['', Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
other_person_designation: [''],
})
} else {
return this._formBuilder.group({
service_provider_product_name: [records.service_provider_product_name],
service_provider_client_name: [records.service_provider_client_name],
service_provider_product_contact_person_name: [records.service_provider_product_contact_person_name],
service_provider_product_contact_person_mobile_number: [records.service_provider_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
service_provider_product_contact_person_mobile_number: [records.service_provider_product_contact_person_mobile_number, Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
service_provider_product_payment_type: [records.service_provider_product_payment_type],
service_provider_product_payment_mode: [records.service_provider_product_payment_mode],
service_provider_product_frequency_of_purchase: [records.service_provider_product_frequency_of_purchase],
service_provider_product_credit_days_from: [records.service_provider_product_credit_days_from],
service_provider_product_credit_days_to: [records.service_provider_product_credit_days_to],
person_title_name:[records.person_title_name || null],
person_designation:[records.person_designation || null],
person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[records.other_person_designation || null],
person_title_name: [records.person_title_name || null],
person_designation: [records.person_designation || null],
person_stdcode: [records.person_stdcode || null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: [records.person_landline || null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
other_person_designation: [records.other_person_designation || null],
})
}
}
@ -603,22 +603,22 @@ export class ClientInfoComponent implements OnInit {
)
}
// get all master details
getMasterDetails(table:string,type:number){
// get all master details
getMasterDetails(table: string, type: number) {
this.pdTrigerService.getAllMasterDatas(table).subscribe(
data => {
if (data.dataStatus) {
if(type==1){
this.companyRelationShipList=data.records;// .filter(item => item.name != 'Others');
if (type == 1) {
this.companyRelationShipList = data.records;// .filter(item => item.name != 'Others');
}
if(type==2){
this.titleList=data.records.filter(val=>val.isactive==1);
if (type == 2) {
this.titleList = data.records.filter(val => val.isactive == 1);
}
}
}, error => this.errorMessage = <any> error);
}, error => this.errorMessage = <any>error);
}
@ -635,14 +635,14 @@ export class ClientInfoComponent implements OnInit {
var answerFormValues = this._supplierQuesFrom.value;
//To Remove The "Null" With Key also
Object.keys(answerFormValues).forEach((key) => {if(answerFormValues[key] === null || answerFormValues[key] === undefined || answerFormValues[key] === ''){ delete answerFormValues[key]}; });
if(answerFormValues.manufacturing_details[0]==null){
Object.keys(answerFormValues).forEach((key) => { if (answerFormValues[key] === null || answerFormValues[key] === undefined || answerFormValues[key] === '') { delete answerFormValues[key] }; });
if (answerFormValues.manufacturing_details[0] == null) {
delete answerFormValues['manufacturing_details'];
}
if(answerFormValues.trade_details[0]==null){
if (answerFormValues.trade_details[0] == null) {
delete answerFormValues['trade_details'];
}
if(answerFormValues.service_provider_details[0]==null){
if (answerFormValues.service_provider_details[0] == null) {
delete answerFormValues['service_provider_details'];
}
// Add data with help of Service.
@ -651,9 +651,9 @@ export class ClientInfoComponent implements OnInit {
if (dataresult.status == 200) {
this.notifier.notify('success', 'Saved Successfully.!');
setTimeout(() =>{
setTimeout(() => {
this.dialogRef.close();
},3000);
}, 3000);
// this.dialogRef.close();
// alert("sample alert for Saving");
}
@ -676,58 +676,58 @@ export class ClientInfoComponent implements OnInit {
// this._addQuesFrom.reset();
}
selectedPersonDesignation(items,e,flag){
if(flag == 1){
e==1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
selectedPersonDesignation(items, e, flag) {
if (flag == 1) {
e == 1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(), items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
else if(flag == 2){
e==1 ?items.controls['other_person_designation'].setValidators([Validators.required])
:items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
else if (flag == 2) {
e == 1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(), items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
else if(flag == 3){
e==1 ?items.controls['other_person_designation'].setValidators([Validators.required])
:items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
else if (flag == 3) {
e == 1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(), items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
}
mfgCreditCardFlag : boolean = false;
trdCreditCardFlag : boolean = false;
spCreditCardFlag : boolean = false;
mfgCreditCardFlag: boolean = false;
trdCreditCardFlag: boolean = false;
spCreditCardFlag: boolean = false;
mfgCounter: any = [];
trdCounter: any = [];
spCounter: any =[];
checkCard(e,flag,index){
spCounter: any = [];
checkCard(e, flag, index) {
if(flag == 3 && e==3){
if (flag == 3 && e == 3) {
this.spCounter[index] = 1;
}
else if(flag == 3 && e!=3){
else if (flag == 3 && e != 3) {
this.spCounter[index] = 0;
}
let SP = this.spCounter.reduce((sum, val) => sum + +val, 0);
this.spCreditCardFlag = SP > 0 ? true : false ;
this.spCreditCardFlag = SP > 0 ? true : false;
if(flag == 2 && e==3){
if (flag == 2 && e == 3) {
this.trdCounter[index] = 1;
}
else if(flag == 2 && e!=3){
else if (flag == 2 && e != 3) {
this.trdCounter[index] = 0;
}
let TRD = this.trdCounter.reduce((sum, val) => sum + +val, 0);
this.trdCreditCardFlag = TRD > 0 ? true : false ;
this.trdCreditCardFlag = TRD > 0 ? true : false;
if(flag == 1 && e==3){
if (flag == 1 && e == 3) {
this.mfgCounter[index] = 1;
}
else if(flag == 1 && e!=3){
else if (flag == 1 && e != 3) {
this.mfgCounter[index] = 0;
}
let MFG = this.mfgCounter.reduce((sum, val) => sum + +val, 0);
this.mfgCreditCardFlag = MFG > 0 ? true : false ;
this.mfgCreditCardFlag = MFG > 0 ? true : false;
}

View File

@ -1,123 +1,147 @@
<form [formGroup]="currentLoanForm" class="address">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
</h2>
<mat-dialog-content>
<mat-dialog-content>
<mat-tab-group>
<mat-tab-group>
<mat-tab label="Questions">
<ng-template matTabContent>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card>
<!-- <mat-card-title></mat-card-title> -->
<mat-card-content>
<mat-form-field style="width:60% !important;">
<mat-select (selectionChange)="selectedLoanChanges($event.value)" placeholder="Do you have any other existing loan"
formControlName="existing_loan" >
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card>
<!-- <mat-card-title></mat-card-title> -->
<mat-card-content>
<mat-form-field style="width:60% !important;">
<mat-select (selectionChange)="selectedLoanChanges($event.value)" placeholder="Do you have any other existing loan"
formControlName="existing_loan">
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
<div formArrayName="loan_details">
<div *ngFor="let details of currentLoanForm.get('loan_details').controls; let i=index; let last=last"
[formGroupName]="i">
<mat-card-header>
<mat-card-title>
<p>Loan Details {{details.get('label').value}}</p>
</mat-card-title>
</mat-card-header>
<!-- {{frequencyData | json}} -->
<!-- Loan type, Loan amount, Lender, Loan Taken By, Instalment Frequency, Instalment Amount, Original Tenure, Balance Tenure -->
<mat-card-content class="matcard">
<mat-form-field style="width:45%;">
<mat-select placeholder="Loan Type" formControlName="loan_type"
(selectionChange)="setRequiredValidation($event.value,details,1)">
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
<mat-option value="{{types.existing_loan_type_id}}" *ngFor="let types of loanTypeData">{{types.loan_type_name}}</mat-option>
</mat-select>
<!-- <input matInput autocomplete="off" placeholder="Loan Type" formControlName="loan_type" > -->
</mat-form-field>
<mat-form-field *ngIf="details.get('loan_type').value == 1 " style="width:45%;">
<input matInput autocomplete="off" placeholder="Specify Loan Type"
formControlName="others_loan_type">
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput autocomplete="off" placeholder="Loan Amount"
formControlName="loan_amount" OnlyNumber type="text"
(keyup)="inWords($event,i,1)">
<mat-hint my-mat-hint align="start" style="font-size:90%" *ngIf="details.get('loan_amount').value != ''">{{"&#8377;"}}
{{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:45%;">
<mat-select placeholder="Lender" formControlName="lender"
(selectionChange)="setRequiredValidation($event.value,details,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let btLen of lenderData" [value]="btLen.bt_lender_list_id">{{
btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
<div formArrayName="loan_details">
<div *ngFor="let details of currentLoanForm.get('loan_details').controls; let i=index; let last=last"
[formGroupName]="i">
<mat-card-header>
<mat-card-title><p>Loan Details {{details.get('label').value}}</p></mat-card-title>
</mat-card-header>
<!-- {{frequencyData | json}} -->
<!-- Loan type, Loan amount, Lender, Loan Taken By, Instalment Frequency, Instalment Amount, Original Tenure, Balance Tenure -->
<mat-card-content class="matcard">
<mat-form-field style="width:45%;">
<mat-select placeholder="Loan Type" formControlName="loan_type" (selectionChange)="setRequiredValidation($event.value,details,1)">
<mat-option>Select</mat-option>
<mat-option value="{{types.existing_loan_type_id}}" *ngFor="let types of loanTypeData">{{types.loan_type_name}}</mat-option>
</mat-select>
<!-- <input matInput autocomplete="off" placeholder="Loan Type" formControlName="loan_type" > -->
</mat-form-field>
<mat-form-field *ngIf="details.get('loan_type').value == 1 " style="width:45%;">
<input matInput autocomplete="off" placeholder="Specify Loan Type" formControlName="others_loan_type">
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" OnlyNumber type="text" (keyup)="inWords($event,i,1)">
<mat-hint my-mat-hint align="start" style="font-size:90%" *ngIf="details.get('loan_amount').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:45%;">
<mat-select placeholder="Lender" formControlName="lender" (selectionChange)="setRequiredValidation($event.value,details,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let btLen of lenderData" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('lender').value == 1" style="width:45%;">
<input matInput autocomplete="off" placeholder="Specify Lender" formControlName="others_lender" >
</mat-form-field>
<mat-form-field style="width:45%;">
<!-- <mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" (selectionChange)="selectedBorrower($event.value,i)">
<mat-form-field *ngIf="details.get('lender').value == 1" style="width:45%;">
<input matInput autocomplete="off" placeholder="Specify Lender"
formControlName="others_lender">
</mat-form-field>
<mat-form-field style="width:45%;">
<!-- <mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" (selectionChange)="selectedBorrower($event.value,i)">
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
<!-- <mat-option value= 0 >Others</mat-option> ->
</mat-select> -->
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" [compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value.id,details,3)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<!-- {{details.get('loan_taken_by').value}} -->
<!-- <mat-form-field *ngIf="details.get('loan_taken_by').value == 0"> -->
<mat-form-field style="width:45%;" *ngIf="checkOthers(details.get('loan_taken_by').value)===true">
<input matInput autocomplete="off" placeholder="Specify Borrower" formControlName="others_loan_taken">
</mat-form-field>
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value.id,details,3)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant"
[label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues"
[value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<!-- {{details.get('loan_taken_by').value}} -->
<!-- <mat-form-field *ngIf="details.get('loan_taken_by').value == 0"> -->
<mat-form-field style="width:45%;" *ngIf="checkOthers(details.get('loan_taken_by').value)===true">
<input matInput autocomplete="off" placeholder="Specify Borrower"
formControlName="others_loan_taken">
</mat-form-field>
<mat-form-field style="width:45%;">
<mat-select placeholder="Instalment Frequency" (selectionChange)="selectedfrequency($event.value,i);setRequiredValidation($event.value,details,4);"
formControlName="frequency" >
<mat-option>Select</mat-option>
<mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value == 1" style="width:45%">
<input matInput autocomplete="off" placeholder="Specify Frequency" formControlName="other_frequency">
</mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value != ''" style="width:45%">
<input matInput autocomplete="off" [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" OnlyNumber type="text" (keyup)="inWords($event,i,2)">
<!-- <input matInput autocomplete="off" placeholder="details.get('loan_type').value + Instalment Amount " formControlName="emi" OnlyNumber type="text" (keyup)="inWords($event,i,2)"> -->
<mat-hint my-mat-hint align="start" style="font-size:90%" *ngIf="details.get('emi').value != ''">{{"&#8377;"}} {{emiAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field>
<mat-form-field style="width:45%;">
<mat-select placeholder="Instalment Frequency"
(selectionChange)="selectedfrequency($event.value,i);setRequiredValidation($event.value,details,4);"
formControlName="frequency">
<mat-option>Select</mat-option>
<mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value == 1" style="width:45%">
<input matInput autocomplete="off" placeholder="Specify Frequency"
formControlName="other_frequency">
</mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value != ''" style="width:45%">
<input matInput autocomplete="off" [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' "
formControlName="emi" OnlyNumber type="text" (keyup)="inWords($event,i,2)">
<!-- <input matInput autocomplete="off" placeholder="details.get('loan_type').value + Instalment Amount " formControlName="emi" OnlyNumber type="text" (keyup)="inWords($event,i,2)"> -->
<mat-hint my-mat-hint align="start" style="font-size:90%" *ngIf="details.get('emi').value != ''">{{"&#8377;"}}
{{emiAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field>
<input matInput autocomplete="off" placeholder="Lender" formControlName="lender" >
</mat-form-field> -->
<div style="width:100%">
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Original Tenure in Months" formControlName="original_tenure" (change)="checkTenure(details);calculateTenure(details)">
</mat-form-field>
<mat-form-field style="width:35%">
<input matInput autocomplete="off" placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" (change)="calculateTenure(details)">
<mat-error>Invalid Balance Tenure.</mat-error>
<!-- //*ngIf="current_balance_tenure.hasError('min')" class="mat-text-warn" -->
</mat-form-field>
<mat-form-field style="width:25%">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off">
</mat-form-field>
</div>
<div style="width:100%">
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Original Tenure in Months"
formControlName="original_tenure" (change)="checkTenure(details);calculateTenure(details)">
</mat-form-field>
<mat-form-field style="width:35%">
<input matInput autocomplete="off" placeholder="Current Balance Tenure in Months"
formControlName="current_balance_tenure" (change)="calculateTenure(details)">
<mat-error>Invalid Balance Tenure.</mat-error>
<!-- //*ngIf="current_balance_tenure.hasError('min')" class="mat-text-warn" -->
</mat-form-field>
<mat-form-field style="width:25%">
<input matInput placeholder="Elapsed Tenure in Months"
formControlName="elapsed_tenure" autocomplete="off">
</mat-form-field>
</div>
<!-- <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteLoanDetails(i)"
<!-- <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteLoanDetails(i)"
*ngIf="i>0">
<mat-icon>delete</mat-icon>
</button>
@ -125,152 +149,206 @@
*ngIf="last">
<mat-icon>add</mat-icon>
</button> -->
</mat-card-content>
<mat-card-actions>
<div align="right">
<button *ngIf="currentLoanForm.controls.loan_details.controls.length > 1" type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteLoanDetails(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addLoanDetails()"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Loan Details </strong>
</button>
</div>
</mat-card-actions>
</mat-card-content>
<mat-card-actions>
<div align="right">
<button *ngIf="currentLoanForm.controls.loan_details.controls.length > 1"
type="button" class="mr-1 mb-1 hover-icon"
mat-raised-button mat-icon-button matTooltip="Delete"
matTooltipPosition="above" (click)="deleteLoanDetails(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addLoanDetails()"
matTooltip="Add More" matTooltipPosition="left" color="primary"
*ngIf="last">
<strong>Add More Loan Details </strong>
</button>
</div>
</mat-card-actions>
</div>
</div>
</mat-card>
</div>
</div>
</mat-card>
</mat-card-content>
</mat-card-content>
<mat-card-actions align="end">
<!-- <span *ngIf="_supplierQuesFrom.controls.supplier_details.controls.length > 1" (click)="removeLanguage(i)">
<mat-card-actions align="end">
<!-- <span *ngIf="_supplierQuesFrom.controls.supplier_details.controls.length > 1" (click)="removeLanguage(i)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
</span> -->
</mat-card-actions>
</mat-card-actions>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-tab-group>
</mat-dialog-content>
</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 autocomplete="off" placeholder="Remarks" formControlName="currentloan_remarks" ></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit" matTooltipPosition="above" (click)="submitCurrentloan()"><mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
<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 autocomplete="off" placeholder="Remarks" formControlName="currentloan_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit"
matTooltipPosition="above" (click)="submitCurrentloan()">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>
@ -280,28 +358,28 @@
<mat-card-content>
<p>Existing Loan Obligations</p>
<form [formGroup]="currentLoanForm" class="address"> -->
<!-- <div fxLayout="row">
<!-- <div fxLayout="row">
<div fxFlex="60" class="pb-0 text-sm-left"> -->
<!-- <mat-form-field style="width:60% !important;">
<!-- <mat-form-field style="width:60% !important;">
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Do you have any other existing loan"
formControlName="existing_loan" >
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field> -->
<!-- </div>
<!-- </div>
</div> -->
<!-- <mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
<!-- <mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
<mat-card-header>
<p>Loan Details<p>
</mat-card-header>
<div formArrayName="loan_details">
<div *ngFor="let details of currentLoanForm.get('loan_details').controls; let i=index"
[formGroupName]="i"> -->
<!-- {{frequencyData | json}} -->
<!-- <mat-card-content class="matcard">
<!-- {{frequencyData | json}} -->
<!-- <mat-card-content class="matcard">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" OnlyNumber type="text" >
</mat-form-field>
@ -334,10 +412,10 @@
<mat-form-field *ngIf="details.get('lender').value == 3">
<input matInput autocomplete="off" placeholder="Specify Others Loan Taken" formControlName="others_loan_taken">
</mat-form-field> -->
<!-- <mat-form-field>
<!-- <mat-form-field>
<input matInput autocomplete="off" placeholder="Lender" formControlName="lender" >
</mat-form-field> -->
<!-- <mat-form-field>
<!-- <mat-form-field>
<input matInput autocomplete="off" placeholder="Original Tenure in Months" formControlName="original_tenure" >
</mat-form-field>
<mat-form-field>
@ -371,4 +449,3 @@
</form>
</mat-card-content>
</mat-card> -->

View File

@ -35,8 +35,8 @@ export class CurrentLoanComponent implements OnInit {
main_applicant: any;
public currentLoanForm: FormGroup;
private notifier: NotifierService;
pageTitle: string ="Existing Loan Obligations";
pdid : number;
pageTitle: string = "Existing Loan Obligations";
pdid: number;
form_id: number;
applicant_details: any;
// @Input() pdid: number;
@ -49,81 +49,81 @@ export class CurrentLoanComponent implements OnInit {
propertyTypeData: any = [];
addressTypeData: any = [];
applicants: any;
placeholderName : any = [];
IDXval : any;
OtherFlag : any = [];
amtInwords : any = [];
labelArr : any = [];
emiAmtInwords : any = [];
dataFromAssets : any = [];
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
placeholderName: any = [];
IDXval: any;
OtherFlag: any = [];
amtInwords: any = [];
labelArr: any = [];
emiAmtInwords: any = [];
dataFromAssets: any = [];
existCompanyList: any = [];
mergeCompanyApplicant: any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<CurrentLoanComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 8;
this.notifier = notifier;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
//this.OtherFlag[0] = false;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 8;
this.notifier = notifier;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants.push({ 'pd_co_applicant_id': '0', 'applicant_name': 'Others' });
//this.OtherFlag[0] = false;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
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,
}
};
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,
}
};
ngOnInit() {
console.clear();
this.getMasterDetails('BTLENDERLIST',1);
this.getMasterDetails('FREQUENCY',2);
this.getMasterDetails('EXISTINGLOANTYPES',3);
this.getMasterDetails('INVESTMENTTYPE',4);
this.getMasterDetails('PROPERTIES',5);
this.getMasterDetails('ADDRESSTYPE',6);
this.getMasterDetails('BTLENDERLIST', 1);
this.getMasterDetails('FREQUENCY', 2);
this.getMasterDetails('EXISTINGLOANTYPES', 3);
this.getMasterDetails('INVESTMENTTYPE', 4);
this.getMasterDetails('PROPERTIES', 5);
this.getMasterDetails('ADDRESSTYPE', 6);
this.initCurrentloanForm();
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active===true);
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data => {
if (data.dataStatus) {
this.existCompanyList = data.records.filter(val => val.is_active === true);
}
let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){
modifyCompanyList = this.existCompanyList.map(element => {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
});
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
let modifyCompanyList: any = [];
if (this.existCompanyList.length > 0) {
modifyCompanyList = this.existCompanyList.map(element => {
return { id: element.company_order_id.toString(), name: element.company_name, group_id: 1 };
});
this.mergeCompanyApplicant.push({ groupName: 'COMPANIES', groupValues: modifyCompanyList })
}
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
let modifyApplicantList: any = [];
if (this.applicants.length > 0) {
modifyApplicantList = this.applicants.map(element => {
return { id: element.pd_co_applicant_id, name: element.applicant_name, group_id: 2 };
});
this.mergeCompanyApplicant.push({ groupName: 'APPLICANTS', groupValues: modifyApplicantList })
}
})
@ -150,27 +150,27 @@ export class CurrentLoanComponent implements OnInit {
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
if (result.length > 0) {
result.forEach((val,index) => {
result.forEach((val, index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(val.loan_amount);
this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
this.selectedfrequency(val.frequency,index);
this.selectedfrequency(val.frequency, index);
//this.selectedLoanTakenBy(val.loan_taken_by,index);
let objs = {
'label': val.label,
'loan_amount': val.loan_amount,
'frequency':val.frequency,
'other_frequency':val.other_frequency,
'frequency': val.frequency,
'other_frequency': val.other_frequency,
'emi': val.emi,
'loan_type': val.loan_type,
'others_loan_type': val.others_loan_type,
'loan_taken_by':val.loan_taken_by,
'others_loan_taken':val.others_loan_taken,
'loan_taken_by': val.loan_taken_by,
'others_loan_taken': val.others_loan_taken,
'lender': val.lender,
'others_lender':val.others_lender,
'others_lender': val.others_lender,
'original_tenure': val.original_tenure,
'current_balance_tenure': val.current_balance_tenure,
'elapsed_tenure':val.elapsed_tenure
'elapsed_tenure': val.elapsed_tenure
}
control.push(this.createLoanDetail(objs));
@ -183,44 +183,47 @@ export class CurrentLoanComponent implements OnInit {
}
} else {
this._pd.getAssetsWithLoanFromBusiness(this.pdid).subscribe(data=>{
// console.log('data',data);
this._pd.getAssetsWithLoanFromBusiness(this.pdid).subscribe(data => {
if(data.dataStatus == true){
// console.log('data',data.record);
// return;
if (data.dataStatus == true) {
let AssetData = data.record;
if(AssetData.business_address_asset.length>0){
if (AssetData.business_address_asset.length > 0) {
AssetData.business_address_asset.map(element => {
this.dataFromAssets.push({mode:0,
mode_name:element.address_label,
details:[],
owner_name:element.business_name_of_the_owner,
form_type:'Data From Bussiness Address'})
});
}
if(AssetData.business_assets.length>0){
AssetData.business_assets.map(element => {
this.dataFromAssets.push({mode:element.business_assets_mode,
mode_name:element.business_assets_mode_name,
details:element.business_details,
owner_name:element.business_name_of_the_owner,
form_type:'Data From Business Assets'})
});
}
if(AssetData.other_assests.length > 0){
AssetData.other_assests.map(element => {
this.dataFromAssets.push({mode:element.assets_mode,
mode_name:element.assets_mode_name,
details:element.details,
owner_name:element.name_of_the_owner,
form_type:'Data From Other Asset'
this.dataFromAssets.push({
mode: 0,
mode_name: element.address_label,
details: [],
owner_name: element.business_name_of_the_owner,
form_type: 'Data From Bussiness Address'
})
});
});
}
if (AssetData.business_assets.length > 0) {
AssetData.business_assets.map(element => {
this.dataFromAssets.push({
mode: element.business_assets_mode,
mode_name: element.business_assets_mode_name,
details: element.business_details,
owner_name: element.business_name_of_the_owner,
form_type: 'Data From Business Assets'
})
});
}
if (AssetData.other_assests.length > 0) {
AssetData.other_assests.map(element => {
this.dataFromAssets.push({
mode: element.assets_mode,
mode_name: element.assets_mode_name,
details: element.details,
owner_name: element.name_of_the_owner,
form_type: 'Data From Other Asset'
})
});
}
// id: "4", name: "Equipments and machinaries", isactive: "1", flag: "1", is_others: "0"
@ -230,153 +233,153 @@ export class CurrentLoanComponent implements OnInit {
// id: "3", name: "Vehicle", isactsive: "1", flag: "1", is_others: "0"
// id: "1", name: "Others", isactive: "1", flag: "1", is_others: "1"}
if(this.dataFromAssets.length > 0){
let labelarray : any = [];
if (this.dataFromAssets.length > 0) {
let labelarray: any = [];
this.dataFromAssets.forEach((val,index) => {
if(val.mode == 0){
let owner = val.owner_name.map((e => {
this.dataFromAssets.forEach((val, index) => {
if (val.mode == 0) {
let owner = val.owner_name.map((e => {
return e.name.split(',')
}));
// labelarray[index] = ' : '+owner +' - '+ val.mode_name.split("/")[0] + ' ( ' + val.mode_name.split("/")[1] + ' )';
labelarray[index] = ' : '+owner +' - '+ val.mode_name;
}
}));
// labelarray[index] = ' : '+owner +' - '+ val.mode_name.split("/")[0] + ' ( ' + val.mode_name.split("/")[1] + ' )';
labelarray[index] = ' : ' + owner + ' - ' + val.mode_name;
}
if(val.mode == 1){
let data;
let owner : any = "Owner Not Mentioned";
val.details.forEach((v,index) => {
data = v.any_other_assets;
});
if(val.owner_name.length>0){
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
if (val.mode == 1) {
let data;
let owner: any = "Owner Not Mentioned";
val.details.forEach((v, index) => {
data = v.any_other_assets;
});
if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
let description = data != '' ? ' ( '+ data +' )' : '';
labelarray[index] = ' : '+owner +' - '+ val.mode_name + description;
}
if(val.mode == 2){
let description = data != '' ? ' ( ' + data + ' )' : '';
labelarray[index] = ' : ' + owner + ' - ' + val.mode_name + description;
}
if (val.mode == 2) {
let data;
let owner : any = "Owner Not Mentioned";
val.details.forEach((v,index) => {
data = v.property_type;
if(v.property_type != 1){
if(val.form_type == 'Data From Business Assets'){
let data;
let owner: any = "Owner Not Mentioned";
val.details.forEach((v, index) => {
data = v.property_type;
if (v.property_type != 1) {
if (val.form_type == 'Data From Business Assets') {
data = this.addressTypeData.filter(item => item.address_type_id == v.property_type)[0].address_type;
}
else if(val.form_type == 'Data From Other Asset'){
else if (val.form_type == 'Data From Other Asset') {
data = this.propertyTypeData.filter(item => item.id == v.property_type)[0].name;
}
else{
else {
data = '';
}
}else{
data=v.other_property_type;
}
if(val.owner_name.length>0){
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
} else {
data = v.other_property_type;
}
if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
});
let description = data != '' ? ' ( '+ data +' )' : '';
labelarray[index] = ' : '+owner +' - '+ val.mode_name + description;
}
if(val.mode == 3){
let data;let owner : any = "Owner Not Mentioned";
val.details.forEach((v,index) => {
data = v.manufacturer_model_vehicle;
});
if(val.owner_name.length>0){
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
let description = data != '' ? ' ( '+ data +' )' : '';
labelarray[index] = ' : '+owner +' - '+ val.mode_name + description;
}
if(val.mode == 4){
let data;let owner : any = "Owner Not Mentioned";
val.details.forEach((v,index) => {
data = v.equipment_manufacturing_description;
});
if(val.owner_name.length>0){
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
let description = data != '' ? ' ( '+ data +' )' : '';
labelarray[index] = ' : '+owner +' - '+ val.mode_name + description;
}
if(val.mode == 6){
let owner : any = "Owner Not Mentioned";
if(val.owner_name.length>0){
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
});
let description = data != '' ? ' ( ' + data + ' )' : '';
labelarray[index] = ' : ' + owner + ' - ' + val.mode_name + description;
}
if (val.mode == 3) {
let data; let owner: any = "Owner Not Mentioned";
val.details.forEach((v, index) => {
data = v.manufacturer_model_vehicle;
});
if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
let description = data != '' ? ' ( ' + data + ' )' : '';
labelarray[index] = ' : ' + owner + ' - ' + val.mode_name + description;
}
if (val.mode == 4) {
let data; let owner: any = "Owner Not Mentioned";
val.details.forEach((v, index) => {
data = v.equipment_manufacturing_description;
});
if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
let description = data != '' ? ' ( ' + data + ' )' : '';
labelarray[index] = ' : ' + owner + ' - ' + val.mode_name + description;
}
if (val.mode == 6) {
let owner: any = "Owner Not Mentioned";
if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
labelarray[index] = ' : '+owner+' - '+ val.mode_name;
}
if(val.mode == 7){
let data;let owner : any = "Owner Not Mentioned";
val.details.forEach((v,index) => {
data = v.investments_type != 1
? this.investmentTypeData.filter(data => data.id == v.investments_type)[0].name
: v.other_investments_type ;
labelarray[index] = ' : ' + owner + ' - ' + val.mode_name;
}
if (val.mode == 7) {
let data; let owner: any = "Owner Not Mentioned";
val.details.forEach((v, index) => {
data = v.investments_type != 1
? this.investmentTypeData.filter(data => data.id == v.investments_type)[0].name
: v.other_investments_type;
});
if(val.owner_name.length>0){
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
let description = data != '' ? '( '+ data +' )' : '';
labelarray[index] = ' : '+owner +' - '+ val.mode_name + description;
}
});
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
this.labelArr = labelarray;
let arr : any = [];
if(this.labelArr.length > 0){
this.currentLoanForm.controls['existing_loan'].setValue('Yes');
this.labelArr.forEach((v,index) => {
arr = {
'label': v,
'loan_amount': '',
'frequency':'',
'other_frequency':'',
'emi': '',
'loan_type': '',
'others_loan_type': '',
'loan_taken_by':'',
'others_loan_taken':'',
'lender': '',
'others_lender':'',
'original_tenure': '',
'current_balance_tenure': '',
'elapsed_tenure':''
}
control.push(this.createLoanDetail(arr));
});
if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => {
return e.name.split(',')
}));
}
let description = data != '' ? '( ' + data + ' )' : '';
labelarray[index] = ' : ' + owner + ' - ' + val.mode_name + description;
}
});
// this.currentLoanForm.controls['existing_loan'].setValue(arr);
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
this.labelArr = labelarray;
let arr: any = [];
if (this.labelArr.length > 0) {
this.currentLoanForm.controls['existing_loan'].setValue('Yes');
this.labelArr.forEach((v, index) => {
arr = {
'label': v,
'loan_amount': '',
'frequency': '',
'other_frequency': '',
'emi': '',
'loan_type': '',
'others_loan_type': '',
'loan_taken_by': '',
'others_loan_taken': '',
'lender': '',
'others_lender': '',
'original_tenure': '',
'current_balance_tenure': '',
'elapsed_tenure': ''
}
control.push(this.createLoanDetail(arr));
});
// this.currentLoanForm.controls['existing_loan'].setValue(arr);
}
}
}
else{
else {
control.push(this.createLoanDetail(null));
}
control.push(this.createLoanDetail(null));
}
}
});
}
});
}
})
}
checkTenure(details){
checkTenure(details) {
let originalTenure = details.value.original_tenure;
// alert(originalTenure);
details.controls.current_balance_tenure.setValidators([Validators.required, Validators.max(+originalTenure)]);
@ -386,10 +389,10 @@ export class CurrentLoanComponent implements OnInit {
// let BalanceTenure = details.value.current_balance_tenure;
// if( originalTenure < BalanceTenure){
// alert('Greater');
// details.controls.current_balance_tenure.setValue('');
// alert('validation setted For');
// details.controls.current_balance_tenure.setValidators([Validators.min(+originalTenure)]);
// details.controls.current_balance_tenure.updateValueAndValidity();
// details.controls.current_balance_tenure.setValue('');
// alert('validation setted For');
// details.controls.current_balance_tenure.setValidators([Validators.min(+originalTenure)]);
// details.controls.current_balance_tenure.updateValueAndValidity();
// }
@ -433,14 +436,14 @@ export class CurrentLoanComponent implements OnInit {
// }
// }
selectedfrequency(e,i){
selectedfrequency(e, i) {
switch(+e){
switch (+e) {
case 1: this.placeholderName[i] = 'Instalment Amount'; break;
case 2: this.placeholderName[i] = 'Annual Instalment Amount'; break;
case 2: this.placeholderName[i] = 'Annual Instalment Amount'; break;
case 3: this.placeholderName[i] = 'Halfyearly Instalment Amount'; break;
case 4: this.placeholderName[i] = 'Fortnightly Instalment Amount'; break;
case 5: this.placeholderName[i] = 'Daily Instalment Amount'; break;
case 5: this.placeholderName[i] = 'Daily Instalment Amount'; break;
case 6: this.placeholderName[i] = 'Quarterly Instalment Amount'; break;
case 7: this.placeholderName[i] = 'Monthly Instalment Amount'; break;
default: this.placeholderName[i] = 'Instalment Amount'; break;
@ -451,39 +454,39 @@ export class CurrentLoanComponent implements OnInit {
return this.fb.group({
label: data == null ? [''] : [data.label],
loan_amount: null ? [''] : [data.loan_amount],
frequency:null ? [''] : [data.frequency],
other_frequency:null ? [''] : [data.other_frequency],
frequency: null ? [''] : [data.frequency],
other_frequency: null ? [''] : [data.other_frequency],
emi: null ? [''] : [data.emi],
loan_type: null ? [''] : [data.loan_type],
others_loan_type: null ? [''] : [data.others_loan_type],
loan_taken_by:null ? [''] : [data.loan_taken_by],
others_loan_taken:null ? [''] : [data.others_loan_taken],
loan_taken_by: null ? [''] : [data.loan_taken_by],
others_loan_taken: null ? [''] : [data.others_loan_taken],
lender: null ? [''] : [data.lender],
others_lender:null ? [''] : [data.others_lender],
others_lender: null ? [''] : [data.others_lender],
original_tenure: null ? [''] : [data.original_tenure],
current_balance_tenure: null ? [''] : [data.current_balance_tenure],
elapsed_tenure:null ? [''] : [data.elapsed_tenure]
elapsed_tenure: null ? [''] : [data.elapsed_tenure]
});
}
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
compareObjects(o1: any, o2: any) {
if (o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
// check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
}
else {
return false;
}
checkOthers(values) {
if (values != null) {
return values.id == 0 ? true : false;
}
else {
return false;
}
}
}
addLoanDetails() {
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
@ -494,17 +497,16 @@ export class CurrentLoanComponent implements OnInit {
control.removeAt(index);
}
calculateTenure(details)
{
let ElapsedValues;
calculateTenure(details) {
let ElapsedValues;
if (details.value.original_tenure != null && details.value.original_tenure != '' && details.value.current_balance_tenure != null && details.value.current_balance_tenure != '') {
ElapsedValues = details.value.original_tenure - details.value.current_balance_tenure;
details.controls['elapsed_tenure'].setValue(ElapsedValues);
}
if(details.value.original_tenure != null && details.value.original_tenure != '' && details.value.current_balance_tenure != null && details.value.current_balance_tenure != ''){
ElapsedValues = details.value.original_tenure - details.value.current_balance_tenure ;
details.controls['elapsed_tenure'].setValue(ElapsedValues);
}
}
submitCurrentloan() {
if (!this.currentLoanForm.valid) {
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
@ -520,14 +522,14 @@ export class CurrentLoanComponent implements OnInit {
records.loan_details = this.currentLoanForm.controls['loan_details'].value;
}
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
if (data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
setTimeout(() => {
this.dialogRef.close();
},3000);
}, 3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -543,69 +545,69 @@ export class CurrentLoanComponent implements OnInit {
}
});
}
getMasterDetails(table:string,type:number){
getMasterDetails(table: string, type: number) {
this._pd.getAllMasterDatas(table).subscribe(data => {
data.records.forEach(val => {
if(type==1 && val.isactive == 1) {
if (type == 1 && val.isactive == 1) {
this.lenderData.push(val);
}
else if(type==2 && val.isactive == 1){
else if (type == 2 && val.isactive == 1) {
this.frequencyData.push(val);
}
else if(type==3 && val.isactive == 1){
else if (type == 3 && val.isactive == 1) {
this.loanTypeData.push(val);
}
else if(type==4 && val.isactive == 1){
else if (type == 4 && val.isactive == 1) {
this.investmentTypeData.push(val);
}
else if(type==5 && val.isactive == 1){
else if (type == 5 && val.isactive == 1) {
this.propertyTypeData.push(val);
}
else if(type==6 && val.isactive == 1){
else if (type == 6 && val.isactive == 1) {
this.addressTypeData.push(val);
}
})
});
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
/** Amount InWords */
inWords(e, i, flag) {
switch (flag) {
case 1:
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2:
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}
setRequiredValidation(value,item,flag) {
setRequiredValidation(value, item, flag) {
if(flag == 1){
value==1
? item.controls.others_loan_type.setValidators([Validators.required])
: item.controls.others_loan_type.clearValidators();
item.controls.others_loan_type.updateValueAndValidity();
}
if(flag == 2){
// value==1
// ? item.controls.others_lender.setValidators([Validators.required])
// : item.controls.others_lender.clearValidators();
// item.controls.others_lender.updateValueAndValidity();
}
if(flag == 3){
value==0
? item.controls.others_loan_taken.setValidators([Validators.required])
: item.controls.others_loan_taken.clearValidators();
item.controls.others_loan_taken.updateValueAndValidity();
}
if(flag == 4){
value==1
? item.controls.other_frequency.setValidators([Validators.required])
: item.controls.other_frequency.clearValidators();
item.controls.other_frequency.updateValueAndValidity();
}
if (flag == 1) {
value == 1
? item.controls.others_loan_type.setValidators([Validators.required])
: item.controls.others_loan_type.clearValidators();
item.controls.others_loan_type.updateValueAndValidity();
}
if (flag == 2) {
// value==1
// ? item.controls.others_lender.setValidators([Validators.required])
// : item.controls.others_lender.clearValidators();
// item.controls.others_lender.updateValueAndValidity();
}
if (flag == 3) {
value == 0
? item.controls.others_loan_taken.setValidators([Validators.required])
: item.controls.others_loan_taken.clearValidators();
item.controls.others_loan_taken.updateValueAndValidity();
}
if (flag == 4) {
value == 1
? item.controls.other_frequency.setValidators([Validators.required])
: item.controls.other_frequency.clearValidators();
item.controls.other_frequency.updateValueAndValidity();
}
}

View File

@ -1,310 +1,370 @@
<form [formGroup]="employmentForm" class="address">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card>
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card>
<mat-form-field style="width:17%">
<!-- <input matInput> -->
<mat-select placeholder="Name of Employer" formControlName="employer_name" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let cl of company_list" [value]="cl.company_order_id+'-'+cl.company_name">{{ cl.company_name }}</mat-option>
</mat-select>
</mat-form-field>
<div>
<label>Since how long working with this employer?</label>
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput OnlyNumber type="text" autocomplete="off" placeholder="Year" formControlName="how_long_year" required min='0'>
</mat-form-field>
<mat-form-field>
<input matInput OnlyNumber type="text" autocomplete="off" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
</mat-form-field>
</div>
</div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Was the employer met?"
formControlName="was_met" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="employmentForm.controls['was_met'].value == 'yes'">
<mat-form-field fxFlex="50">
<!-- <input matInput placeholder="Name of Person Met" formControlName="name_person_met" required> -->
<mat-select placeholder="Name of Person Met" formControlName="name_person_met" required (selectionChange)="filtercompanyrelationship(employmentForm.controls['employer_name'].value,$event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let person of person_met_list" [value]="person.pd_co_applicant_id">
{{person.applicant_name | titlecase}}
</mat-option>
<mat-form-field style="width:17%">
<!-- <input matInput> -->
<mat-select placeholder="Name of Employer" formControlName="employer_name" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let cl of company_list" [value]="cl.company_order_id+'-'+cl.company_name">{{
cl.company_name }}</mat-option>
</mat-select>
</mat-form-field>
<div>
<label>Since how long working with this employer?</label>
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput OnlyNumber type="text" autocomplete="off" placeholder="Year"
formControlName="how_long_year" required min='0'>
</mat-form-field>
<mat-form-field fxFlex="50">
<input matInput placeholder="Designation of Person Met" formControlName="designation_person_met" required>
<!-- <mat-select placeholder="Designation of Person Met" formControlName="designation_person_met" required>
<mat-form-field>
<input matInput OnlyNumber type="text" autocomplete="off" placeholder="Month"
formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
</mat-form-field>
</div>
</div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Was the employer met?" formControlName="was_met" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="employmentForm.controls['was_met'].value == 'yes'">
<mat-form-field fxFlex="50">
<!-- <input matInput placeholder="Name of Person Met" formControlName="name_person_met" required> -->
<mat-select placeholder="Name of Person Met" formControlName="name_person_met"
required (selectionChange)="filtercompanyrelationship(employmentForm.controls['employer_name'].value,$event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let person of person_met_list" [value]="person.pd_co_applicant_id">
{{person.applicant_name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="50">
<input matInput placeholder="Designation of Person Met" formControlName="designation_person_met"
required>
<!-- <mat-select placeholder="Designation of Person Met" formControlName="designation_person_met" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name | titlecase}}
</mat-option>
<mat-option value="0"> Not Applicable </mat-option>
</mat-select> -->
</mat-form-field>
</div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Salary amount confirmed ?"
formControlName="confirm_salary" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="employmentForm.controls['confirm_salary'].value == 'yes'">
<mat-form-field fxFlex="50">
<input matInput placeholder="What is the salary amount confirmed?" formControlName="confirm_salary_amount" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['confirm_salary_amount'].value != ''">{{"&#8377;"}} {{employmentForm.controls['confirm_salary_amount'].value | numberToWords}} Only</mat-hint>
</mat-form-field>
</div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Salary amount confirmed ?" formControlName="confirm_salary"
required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="employmentForm.controls['confirm_salary'].value == 'yes'">
<mat-form-field fxFlex="50">
<input matInput placeholder="What is the salary amount confirmed?"
formControlName="confirm_salary_amount" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['confirm_salary_amount'].value != ''">{{"&#8377;"}}
{{employmentForm.controls['confirm_salary_amount'].value | numberToWords}}
Only</mat-hint>
</mat-form-field>
<mat-form-field fxFlex="25">
<input matInput placeholder="Total Work Experience"
formControlName="total_business_experience" OnlyNumber autocomplete="off">
<mat-error *ngIf="employmentForm.controls['total_business_experience'].value > employmentForm.controls['how_long_year'].value">Higher</mat-error>
</mat-form-field>
<!-- *ngIf="employmentForm.controls['how_long_year'].value > employmentForm.controls['total_business_experience'].value" -->
<mat-form-field fxFlex="25" *ngIf="employmentForm.controls['total_business_experience'].value > employmentForm.controls['how_long_year'].value">
<input matInput placeholder="Previous Work Experience Details"
formControlName="total_business_previous_experience">
</mat-form-field>
<mat-form-field fxFlex="25">
<input matInput placeholder="Total Work Experience" formControlName="total_business_experience"
OnlyNumber autocomplete="off">
<mat-error *ngIf="employmentForm.controls['total_business_experience'].value > employmentForm.controls['how_long_year'].value">Higher</mat-error>
</mat-form-field>
<!-- *ngIf="employmentForm.controls['how_long_year'].value > employmentForm.controls['total_business_experience'].value" -->
<mat-form-field fxFlex="25" *ngIf="employmentForm.controls['total_business_experience'].value > employmentForm.controls['how_long_year'].value">
<input matInput placeholder="Previous Work Experience Details" formControlName="total_business_previous_experience">
</mat-form-field>
</div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Attendance register seen ?"
formControlName="attendance_seen" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Salary register seen ?"
formControlName="sal_reg_seen" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-card>
<mat-card-header>
<p>Salary Details<p>
</mat-card-header>
<mat-card-content>
<div fxLayout="row wrap">
<div fxFlex="100">
</div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Attendance register seen ?" formControlName="attendance_seen"
required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Salary register seen ?" formControlName="sal_reg_seen"
required>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-card>
<mat-card-header>
<p>Salary Details<p>
</mat-card-header>
<mat-card-content>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-form-field style="width: 33%">
<input matInput placeholder="From Date of Salary" formControlName="from_date_the_salary_is_rcv" OnlyNumber type="number" min='1' max='31'>
<input matInput placeholder="From Date of Salary" formControlName="from_date_the_salary_is_rcv"
OnlyNumber type="number" min='1' max='31'>
</mat-form-field>
<mat-form-field style="width: 33%">
<input matInput placeholder="To Date of Salary" formControlName="to_date_the_salary_is_rcv" OnlyNumber type="number" min='1' max='31'>
<input matInput placeholder="To Date of Salary" formControlName="to_date_the_salary_is_rcv"
OnlyNumber type="number" min='1' max='31'>
</mat-form-field>
<mat-form-field style="width: 33%">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary"
(keypress)="keyPress($event)" required>
</mat-form-field>
<mat-form-field style="width: 33%">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" (keypress)="keyPress($event)" required>
</mat-form-field>
<mat-form-field style="width:33%">
<input matInput placeholder="Net Monthly Salary"
formControlName="net_monthly_salary" (keypress)="keyPress($event)" required>
<!-- <input matInput placeholder="Net Take Home"
<mat-form-field style="width:33%">
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary"
(keypress)="keyPress($event)" required>
<!-- <input matInput placeholder="Net Take Home"
formControlName="net_take_home"> -->
</mat-form-field>
<mat-form-field style="width: 33%">
<input matInput placeholder="Bonus or Incentive"
formControlName="bonus_incentive" (keypress)="keyPress($event)" required>
</mat-form-field>
</mat-form-field>
<mat-form-field style="width: 33%">
<input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive"
(keypress)="keyPress($event)" required>
</mat-form-field>
<mat-form-field style="width: 33%">
<mat-select placeholder="Amount paid in Cash ?"
formControlName="amount_paid_in_cash">
<mat-option>Select</mat-option>
<mat-option value="validated">Validated</mat-option>
<mat-option value="not validated">Not Validated</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 33%;" *ngIf="employmentForm.controls['amount_paid_in_cash'].value == 'validated'">
<input matInput placeholder="How was it Validated"
formControlName="how_was_it_validated">
</mat-form-field>
<mat-form-field style="width: 33%;" *ngIf="employmentForm.controls['amount_paid_in_cash'].value == 'not validated'">
<input matInput placeholder="Why was it not Validated"
formControlName="why_was_it_not_validated">
</mat-form-field>
<mat-form-field style="width: 33%">
<input matInput placeholder="Amount paid through Bank"
formControlName="amount_paid_through_bank">
</mat-form-field>
<mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
<mat-select placeholder="Bonus Frequency" formControlName="bonus_frequency">
<mat-option>Select</mat-option>
<mat-option *ngFor="let fd of frequency_data" [value]="fd.frequency_id">{{ fd.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 33%">
<mat-select placeholder="Amount paid in Cash ?" formControlName="amount_paid_in_cash">
<mat-option>Select</mat-option>
<mat-option value="validated">Validated</mat-option>
<mat-option value="not validated">Not Validated</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 33%;" *ngIf="employmentForm.controls['amount_paid_in_cash'].value == 'validated'">
<input matInput placeholder="How was it Validated" formControlName="how_was_it_validated">
</mat-form-field>
<mat-form-field style="width: 33%;" *ngIf="employmentForm.controls['amount_paid_in_cash'].value == 'not validated'">
<input matInput placeholder="Why was it not Validated"
formControlName="why_was_it_not_validated">
</mat-form-field>
<mat-form-field style="width: 33%">
<input matInput placeholder="Amount paid through Bank"
formControlName="amount_paid_through_bank">
</mat-form-field>
<mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
<mat-select placeholder="Bonus Frequency" formControlName="bonus_frequency">
<mat-option>Select</mat-option>
<mat-option *ngFor="let fd of frequency_data" [value]="fd.frequency_id">{{
fd.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
<mat-select placeholder="Type of Bonus"
formControlName="bonus_type">
<mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
<mat-select placeholder="Type of Bonus" formControlName="bonus_type">
<mat-option>Select</mat-option>
<mat-option value="fixed">Fixed</mat-option>
<mat-option value="variable depending on performance">Variable depending on performance</mat-option>
<mat-option value="variable depending on performance">Variable
depending on performance</mat-option>
<mat-option value="others">Others</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_type'].value == 'others'">
</mat-form-field>
<mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_type'].value == 'others'">
<input matInput placeholder="Bonus Type Others" formControlName="bonus_type_other">
</mat-form-field>
<mat-form-field style="width: 33%">
<mat-select placeholder="Any Delays"
formControlName="any_delays">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
<!-- <input matInput placeholder="Any Delays"
</mat-form-field>
<mat-form-field style="width: 33%">
<mat-select placeholder="Any Delays" formControlName="any_delays">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
<!-- <input matInput placeholder="Any Delays"
formControlName="any_delays"> -->
</mat-form-field>
</mat-form-field>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
</mat-card-content>
</mat-card>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</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="employment_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</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="employment_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<!-- <button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="submitFamily()"><mat-icon>save</mat-icon></button> -->
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit" matTooltipPosition="above" (click)="submitDetails()"><mat-icon>save</mat-icon>
</button>
<!-- <button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="submitFamily()"><mat-icon>save</mat-icon></button> -->
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit"
matTooltipPosition="above" (click)="submitDetails()">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
</div>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>

View File

@ -21,7 +21,7 @@ import {
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
@Component({
selector: 'app-employment-info',
@ -34,71 +34,71 @@ export class EmploymentInfoComponent implements OnInit {
lender_applicant_id: any;
main_applicant: any;
pageTitle: string ="Employement Information";
pdid: number;
form_id: number;
//pd_all_details:any;
pageTitle: string = "Employement Information";
pdid: number;
form_id: number;
//pd_all_details:any;
public employmentForm: FormGroup;
private notifier: NotifierService;
public pd_cus_segment:string;
public frequency_data:any[];
public company_list:any[];
public person_met_list:any[];
public company_related_applicants_list:any[];
public company_relationship_list:any[];
public filtered_company_relationship_list:any[];
public pd_cus_segment: string;
public frequency_data: any[];
public company_list: any[];
public person_met_list: any[];
public company_related_applicants_list: any[];
public company_relationship_list: any[];
public filtered_company_relationship_list: any[];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<EmploymentInfoComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 12;
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<EmploymentInfoComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 12;
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
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,
}
};
}
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,
}
};
ngOnInit() {
console.log('clear');
console.clear();
this.pd_cus_segment=this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.initemploymentForm();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
console.log('abcd');
let param: any = {};
param.pd_id = this.pdid;
param.pd_form_id = '18';
this._pd.retriveForm(param).subscribe(data => {
if(data.dataStatus) {
console.log(data.records);
this.company_list = data.records.companies.filter(com=>com.is_active == true );
this.person_met_list = data.records.individuals.filter(app=>app.is_person_met == true && app.is_active == true);
if (data.dataStatus) {
this.company_list = data.records.companies.filter(com => com.is_active == true);
this.person_met_list = data.records.individuals.filter(app => app.is_person_met == true && app.is_active == true);
this.company_related_applicants_list = data.records.company_with_relationships;
}
});
@ -144,19 +144,19 @@ export class EmploymentInfoComponent implements OnInit {
/** For Bonus Frequency Dropdown */
this._pd.getAllMasterDatas('FREQUENCY').subscribe(
data => {
if (data.status == 200) {
this.frequency_data = data.records;
this.frequency_data = this.frequency_data.filter(freq=>freq.isactive == 1 );
}
});
if (data.status == 200) {
this.frequency_data = data.records;
this.frequency_data = this.frequency_data.filter(freq => freq.isactive == 1);
}
});
this._pd.getAllMasterDatas('COMPANYRELATIONSHIPS').subscribe(
data => {
if (data.status == 200) {
this.company_relationship_list = data.records.filter(item => item.isactive == 1);
this.company_relationship_list = data.records.filter(item => item.name != 'Others');
this.company_relationship_list.push({'company_relationship_id':0,'name':'Not Applicable'});
}
if (data.status == 200) {
this.company_relationship_list = data.records.filter(item => item.isactive == 1);
this.company_relationship_list = data.records.filter(item => item.name != 'Others');
this.company_relationship_list.push({ 'company_relationship_id': 0, 'name': 'Not Applicable' });
}
});
}
@ -165,17 +165,17 @@ export class EmploymentInfoComponent implements OnInit {
employer_name: ['', Validators.compose([Validators.required])],
how_long_year: ['', Validators.compose([Validators.required])],
how_long_month: [''],
was_met: [this.pd_cus_segment=='SAL-CHQ' ? 'No' : '', Validators.compose([Validators.required])],
was_met: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : '', Validators.compose([Validators.required])],
name_person_met: [''],
designation_person_met: [''],
confirm_salary: [this.pd_cus_segment=='SAL-CHQ' ? 'No' : '', Validators.compose([Validators.required])],
confirm_salary: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : '', Validators.compose([Validators.required])],
confirm_salary_amount: [''],
total_business_experience:[''],
total_business_previous_experience:[''],
attendance_seen: [this.pd_cus_segment=='SAL-CHQ' ? 'No' : '', Validators.compose([Validators.required])],
sal_reg_seen: [this.pd_cus_segment=='SAL-CHQ' ? 'No' : '', Validators.compose([Validators.required])],
from_date_the_salary_is_rcv:[''],
to_date_the_salary_is_rcv:[''],
total_business_experience: [''],
total_business_previous_experience: [''],
attendance_seen: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : '', Validators.compose([Validators.required])],
sal_reg_seen: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : '', Validators.compose([Validators.required])],
from_date_the_salary_is_rcv: [''],
to_date_the_salary_is_rcv: [''],
gross_monthly_salary: ['', Validators.compose([Validators.required])],
net_monthly_salary: ['', Validators.compose([Validators.required])],
bonus_incentive: ['', Validators.compose([Validators.required])],
@ -192,24 +192,24 @@ export class EmploymentInfoComponent implements OnInit {
});
}
filtercompanyrelationship(companyid,applicantid){
filtercompanyrelationship(companyid, applicantid) {
var array = companyid.split("-");
let data = this.company_related_applicants_list.filter(cmpy=>cmpy.relation_to_company == array[0] && cmpy.applicant_name == applicantid);
if(data.length>0){
this.filtered_company_relationship_list = this.company_relationship_list.filter(freq=>freq.company_relationship_id == data[0].company_relationship );
this.employmentForm.controls['designation_person_met'].setValue(this.filtered_company_relationship_list[0]['name'] +' '+array[1]);
let data = this.company_related_applicants_list.filter(cmpy => cmpy.relation_to_company == array[0] && cmpy.applicant_name == applicantid);
if (data.length > 0) {
this.filtered_company_relationship_list = this.company_relationship_list.filter(freq => freq.company_relationship_id == data[0].company_relationship);
this.employmentForm.controls['designation_person_met'].setValue(this.filtered_company_relationship_list[0]['name'] + ' ' + array[1]);
}
else{
else {
this.employmentForm.controls['designation_person_met'].setValue('');
}
}
ConvertMonthintoYear(e){
ConvertMonthintoYear(e) {
let how_long_year = this.employmentForm.controls.how_long_year.value;
let converted_month : number = e%12;
let converted_year : number = e/12;
let converted_month: number = e % 12;
let converted_year: number = e / 12;
this.employmentForm.controls.how_long_year.setValue(+how_long_year + +Math.floor(converted_year));
this.employmentForm.controls.how_long_month.setValue(Math.floor(converted_month));
@ -259,14 +259,14 @@ export class EmploymentInfoComponent implements OnInit {
this._pd.saveForm(records).subscribe(data => {
// this.notifier.notify('success', 'Saved Successfully.');
if(data.status == 200) {
if (data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
// this.dialogRef.close();
setTimeout(() =>{
setTimeout(() => {
this.dialogRef.close();
},3000);
}, 3000);
}
else{
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
@ -279,8 +279,8 @@ export class EmploymentInfoComponent implements OnInit {
let inputChar = String.fromCharCode(event.charCode);
if (event.keyCode != 8 && !pattern.test(inputChar)) {
event.preventDefault();
event.preventDefault();
}
}
}
}

View File

@ -1,27 +1,31 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{pageTitle}}
{{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>
<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>
<form *ngIf="noRecordsFound" class="address" [formGroup]="familyForm">
<mat-dialog-content>
<mat-tab-group>
<mat-tab-group>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<div formArrayName="family_details">
<mat-card *ngFor="let sup of familyForm.controls.family_details['controls']; let ix=index" [formGroupName]="ix">
<mat-card-content>
<mat-card *ngFor="let sup of familyForm.controls.family_details['controls']; let ix=index"
[formGroupName]="ix">
<mat-card-content>
<div>
<mat-form-field style="width:45%;">
<mat-select placeholder="Select a person" formControlName="selected_person" (selectionChange)="selectedPerson($event.value,ix)" required>
<mat-select placeholder="Select a person" formControlName="selected_person"
(selectionChange)="selectedPerson($event.value,ix)" required>
<mat-option>Select</mat-option>
<mat-option value="{{person.pd_co_applicant_id}}" *ngFor="let person of selectPerson">
{{person.applicant_name}}
@ -30,10 +34,11 @@
<!-- <input matInput placeholder="person" formControlName="selected_person" required> -->
</mat-form-field>
</div>
<div>
<div>
<h5>Residence Details of {{FamilyMemberAsLabel[ix]}}</h5>
<mat-form-field style="width:45%;">
<mat-select matInput placeholder="State" formControlName="residence_state" required (selectionChange)="getCity($event.value,ix)" >
<mat-select matInput placeholder="State" formControlName="residence_state"
required (selectionChange)="getCity($event.value,ix)">
<mat-option>Select</mat-option>
<mat-option value="{{s.state_id}}" *ngFor="let s of stateData">
{{s.name}}
@ -41,23 +46,26 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<mat-select matInput placeholder="City" formControlName="residence_city" required>
<mat-select matInput placeholder="City" formControlName="residence_city"
required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let c of cityData[ix]" [value]="c.city_id" >
<mat-option *ngFor="let c of cityData[ix]" [value]="c.city_id">
{{c.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Place" formControlName="residence_place" required>
<input matInput placeholder="Place" formControlName="residence_place"
required>
</mat-form-field>
<mat-form-field style="width:45%;">
<mat-select matInput placeholder="Pin" formControlName="residence_pin" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let p of pincodeData[ix]" [value]="p.pincode_id">
{{p.pincode}}
</mat-option>
</mat-select>
<mat-select matInput placeholder="Pin" formControlName="residence_pin"
required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let p of pincodeData[ix]" [value]="p.pincode_id">
{{p.pincode}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="sup.get('residence_pin').value == 1" style="width:45%;">
<input matInput placeholder="Specify PinCode" formControlName="residence_other_pincode">
@ -74,11 +82,13 @@
</mat-form-field> -->
<mat-form-field>
<input matInput placeholder="Number of yrs" formControlName="residence_No_of_years" OnlyNumber type="text" required>
<input matInput placeholder="Number of yrs" formControlName="residence_No_of_years"
OnlyNumber type="text" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Ownership" formControlName="residence_ownership" required>
<mat-form-field>
<mat-select placeholder="Ownership" formControlName="residence_ownership"
required>
<mat-option>Select</mat-option>
<mat-option value="{{ownerShip.id}}" *ngFor="let ownerShip of ownerShipData">
{{ownerShip.name}}
@ -86,13 +96,15 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="sup.get('residence_ownership').value == 1">
<mat-form-field *ngIf="sup.get('residence_ownership').value == 1">
<input matInput placeholder="Specify Ownership" formControlName="ownershipOther">
</mat-form-field>
<mat-form-field *ngIf="sup.get('residence_ownership').value == 3" style="width:43%;">
<input matInput placeholder="Rent Amount" formControlName="rent" OnlyNumber type="text" (keyup)="inWords($event,1,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('rent').value != ''">{{"&#8377;"}} {{RentAmount[i]}} Only</mat-hint>
<input matInput placeholder="Rent Amount" formControlName="rent"
OnlyNumber type="text" (keyup)="inWords($event,1,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('rent').value != ''">{{"&#8377;"}}
{{RentAmount[i]}} Only</mat-hint>
</mat-form-field>
</div>
<!-- <div>
@ -104,17 +116,21 @@
<div>
<div formArrayName="family_members_details">
<div *ngFor="let item of sup.controls.family_members_details['controls']; let i=index; let last=last " [formGroupName]="i">
<div *ngFor="let item of sup.controls.family_members_details['controls']; let i=index; let last=last "
[formGroupName]="i">
<mat-card>
<h5>Family Details of {{FamilyMemberAsLabel[ix]}}</h5>
<div>
<mat-form-field>
<input matInput placeholder="Name" formControlName="family_member_name" required>
<input matInput placeholder="Name" formControlName="family_member_name"
required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Relationship" formControlName="family_member_relationship" required>
<mat-form-field>
<mat-select placeholder="Relationship" formControlName="family_member_relationship"
required>
<mat-option>Select</mat-option>
<mat-option value="{{relation.relationship_id}}" *ngFor="let relation of relationData">
<mat-option value="{{relation.relationship_id}}"
*ngFor="let relation of relationData">
{{relation.name}}
</mat-option>
</mat-select>
@ -125,62 +141,81 @@
</div>
<div>
<mat-form-field>
<mat-select placeholder="Earning Status" formControlName="family_member_earning_status" required>
<mat-select placeholder="Earning Status"
formControlName="family_member_earning_status"
required>
<mat-option>Select</mat-option>
<mat-option value="{{earnings.id}}" *ngFor="let earnings of earningStatus">
{{earnings.type}}
{{earnings.type}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div *ngIf="item.get('family_member_earning_status').value == 1">
<mat-form-field style="width:45%;">
<mat-select placeholder="Segment" formControlName="earning_segment" required>
<mat-select placeholder="Segment" formControlName="earning_segment"
required>
<mat-option>Select</mat-option>
<mat-option value="{{earn.earning_member_status_id}}" *ngFor="let earn of earningData">
<mat-option value="{{earn.earning_member_status_id}}"
*ngFor="let earn of earningData">
{{earn.earning_member_status}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;" *ngIf="item.get('earning_segment').value==1">
<input matInput placeholder="Specify Others" formControlName="earning_if_others_segment">
<input matInput placeholder="Specify Others"
formControlName="earning_if_others_segment">
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Income Per Month" formControlName="earning_gross_income_per_month" OnlyNumber type="text" (keyup)="inWords($event,2,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('earning_gross_income_per_month').value != ''">{{"&#8377;"}} {{IncomePerMonth[i]}} Only</mat-hint>
<input matInput placeholder="Income Per Month"
formControlName="earning_gross_income_per_month"
OnlyNumber type="text" (keyup)="inWords($event,2,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('earning_gross_income_per_month').value != ''">{{"&#8377;"}}
{{IncomePerMonth[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput [placeholder]="item.get('earning_segment').value != 5 ? 'Name of the Employer/Business' : 'Pension Received From'" formControlName="earning_name_of_the_employer_or_business" required>
<input matInput [placeholder]="item.get('earning_segment').value != 5 ? 'Name of the Employer/Business' : 'Pension Received From'"
formControlName="earning_name_of_the_employer_or_business"
required>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="No. of years in Employment/Business" formControlName="earning_number_of_years_in_employment_or_business"
<input matInput placeholder="No. of years in Employment/Business"
formControlName="earning_number_of_years_in_employment_or_business"
required>
</mat-form-field>
</div>
<div *ngIf="item.get('family_member_earning_status').value == 2">
<mat-form-field>
<mat-select placeholder="Occupation" formControlName="non_earning_occupation" required>
<mat-select placeholder="Occupation" formControlName="non_earning_occupation"
required>
<mat-option>Select</mat-option>
<mat-option value="{{occupation.occupation_non_earning_member_id}}" *ngFor="let occupation of occupationData">
<mat-option value="{{occupation.occupation_non_earning_member_id}}"
*ngFor="let occupation of occupationData">
{{occupation.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="item.get('non_earning_occupation').value==1">
<input matInput placeholder="Specify Others" formControlName="non_earning_if_others">
<input matInput placeholder="Specify Others"
formControlName="non_earning_if_others">
</mat-form-field>
<mat-form-field *ngIf="item.get('non_earning_occupation').value==2" style="width:30%">
<input matInput placeholder="Specify School/College Name" formControlName="non_earning_if_schoolorcollege">
<mat-form-field *ngIf="item.get('non_earning_occupation').value==2"
style="width:30%">
<input matInput placeholder="Specify School/College Name"
formControlName="non_earning_if_schoolorcollege">
</mat-form-field>
<mat-form-field *ngIf="item.get('non_earning_occupation').value==3">
<!-- <input matInput placeholder="Retired From" formControlName="non_earning_if_retired_from" type="date" required> -->
<input matInput placeholder="Retired From" formControlName="non_earning_if_retired_from">
<input matInput placeholder="Retired From"
formControlName="non_earning_if_retired_from">
</mat-form-field>
</div>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="removeFamilyMembers(ix,i)"
matTooltip="Delete Family Members" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="sup.controls.family_members_details.controls.length>0">
<button type="button" mat-raised-button mat-icon-button
(click)="removeFamilyMembers(ix,i)" matTooltip="Delete Family Members"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon"
*ngIf="sup.controls.family_members_details.controls.length>0">
<mat-icon>delete</mat-icon>
</button>
</div>
@ -197,12 +232,13 @@
<mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addFamilyMembers(ix)"
matTooltip="Add More" matTooltipPosition="left" color="primary">
<span *ngIf="sup.controls.family_members_details['controls'].length == 0;else another;">
<strong>Add Family Members Of {{FamilyMemberAsLabel[ix]}}</strong>
</span>
<ng-template #another><strong>Add More Family Members Of {{FamilyMemberAsLabel[ix]}}</strong></ng-template>
<!-- <strong> </strong> -->
matTooltip="Add More" matTooltipPosition="left" color="primary">
<span *ngIf="sup.controls.family_members_details['controls'].length == 0;else another;">
<strong>Add Family Members Of {{FamilyMemberAsLabel[ix]}}</strong>
</span>
<ng-template #another><strong>Add More Family Members Of
{{FamilyMemberAsLabel[ix]}}</strong></ng-template>
<!-- <strong> </strong> -->
</button>
</div>
</mat-card-actions>
@ -210,12 +246,13 @@
</mat-card-content>
<mat-card-actions>
<span align="right">
<button type="button" mat-raised-button mat-icon-button (click)="removeOtherFamilyMembers(ix)"
matTooltip="Delete Family Details of Other Applicant" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="familyForm.controls.family_details.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</span>
<span align="right">
<button type="button" mat-raised-button mat-icon-button (click)="removeOtherFamilyMembers(ix)"
matTooltip="Delete Family Details of Other Applicant"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="familyForm.controls.family_details.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</span>
</mat-card-actions>
</mat-card>
</div>
@ -275,55 +312,91 @@
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
@ -348,11 +421,14 @@
</div>
<div fxFlex="40" align="end">
<button type="button" mat-flat-button (click)="addMoreApplicantFamilyDetails($event); false"
matTooltip="Add More" matTooltipPosition="left" color="primary">
<button type="button" mat-flat-button (click)="addMoreApplicantFamilyDetails($event); false" matTooltip="Add More"
matTooltipPosition="left" color="primary">
<strong>Add Family Details of Other Applicant </strong>
</button> &nbsp;&nbsp;
<button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="submitFamily()"><mat-icon>save</mat-icon></button>
</button> &nbsp;&nbsp;
<button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit"
matTooltipPosition="above" (click)="submitFamily()">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>

View File

@ -1,6 +1,6 @@
import { Component,OnInit,Inject,Input, Output } from '@angular/core';
import { Component, OnInit, Inject, Input, Output } from '@angular/core';
import { FormBuilder,FormGroup,Validators,FormArray, FormControl, AbstractControl } from '@angular/forms';
import { FormBuilder, FormGroup, Validators, FormArray, FormControl, AbstractControl } from '@angular/forms';
import { NotifierService } from 'angular-notifier';
@ -32,7 +32,7 @@ export class FamilyDetailsComponent implements OnInit {
private notifier: NotifierService;
public familyForm: FormGroup;
public selectPerson;
public apiFamilyMembers : any = [];
public apiFamilyMembers: any = [];
pdid: string;
form_id: number;
count: number;
@ -47,12 +47,12 @@ export class FamilyDetailsComponent implements OnInit {
relationData: any = [];
occupationData: any = [];
ownerShipData: any = [];
earningData:any =[];
earningData: any = [];
stateData: any = [];
cityData: any =[];
pincodeData:any=[];
earningStatus = [{ id: 1,type: 'Earning' },
{ id: 2,type: 'Non Earning' }]
cityData: any = [];
pincodeData: any = [];
earningStatus = [{ id: 1, type: 'Earning' },
{ id: 2, type: 'Non Earning' }]
/** constructor Of the class */
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
@ -61,14 +61,14 @@ export class FamilyDetailsComponent implements OnInit {
private dialogRef: MatDialogRef<FamilyDetailsComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.form_id = 6;
this.notifier = notifier;
this.selectPerson = this.pd_all_details.pdapplicants_detials;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.form_id = 6;
this.notifier = notifier;
this.selectPerson = this.pd_all_details.pdapplicants_detials;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
}
@ -80,47 +80,51 @@ export class FamilyDetailsComponent implements OnInit {
this.getMasterDetails('EARNINGMEMBERSSTATUS', 5);
this.getMasterDetails('STATE', 6);
this._pd.getFamilyDetails(this.pdid).subscribe(data=>{
this._pd.getFamilyDetails(this.pdid).subscribe(data => {
console.clear();
if(data.dataStatus == true){
if (data.dataStatus == true) {
let Temparr : any = [];
let Temparr: any = [];
if(data.record.from_general_form.length > 0){
if (data.record.from_general_form.length > 0) {
let familyMembersGeneralForm = Object.keys(data.record.from_general_form).map(function (key) {
return data.record.from_general_form[key];
return data.record.from_general_form[key];
});
let datas = familyMembersGeneralForm.map(element => {
return {id:element.pd_co_applicant_id.toString(),
name:element.applicant_name,
relationship:element.relationship,
relation_to:element.relation_to,
age:element.age,
data_gets_from:'GeneralForm'};
return {
id: element.pd_co_applicant_id.toString(),
name: element.applicant_name,
relationship: element.relationship,
relation_to: element.relation_to,
age: element.age,
data_gets_from: 'GeneralForm'
};
});
Temparr.push(datas);
}
}
if(data.record.from_business_form.length > 0){
if (data.record.from_business_form.length > 0) {
let familyMembersBusinessForm = Object.keys(data.record.from_business_form).map(function (key) {
return data.record.from_business_form[key];
return data.record.from_business_form[key];
});
let datas = familyMembersBusinessForm.map(element => {
return {id:element.other_family_relationship_id.toString(),
name:element.family_member_name,
relationship:element.other_family_relationship_id,
relation_to:element.relation_to_id,
age:'',
data_gets_from:'BusinessForm'};
return {
id: element.other_family_relationship_id.toString(),
name: element.family_member_name,
relationship: element.other_family_relationship_id,
relation_to: element.relation_to_id,
age: '',
data_gets_from: 'BusinessForm'
};
});
Temparr.push(datas);
}
this.apiFamilyMembers = [].concat.apply([],Temparr);
}
this.apiFamilyMembers = [].concat.apply([], Temparr);
}
})
@ -164,7 +168,7 @@ export class FamilyDetailsComponent implements OnInit {
earning_gross_income_per_month: [val.earning_gross_income_per_month, Validators.compose([])],
earning_name_of_the_employer_or_business: [val.earning_name_of_the_employer_or_business, Validators.compose([])],
earning_number_of_years_in_employment_or_business: [val.earning_number_of_years_in_employment_or_business, Validators.compose([])],
earning_if_others_segment:[val.earning_if_others_segment],
earning_if_others_segment: [val.earning_if_others_segment],
non_earning_occupation: [val.non_earning_occupation, Validators.compose([])],
non_earning_if_others: [val.non_earning_if_others, Validators.compose([])],
non_earning_if_retired_from: [val.non_earning_if_retired_from, Validators.compose([])],
@ -275,7 +279,7 @@ export class FamilyDetailsComponent implements OnInit {
residence_city: ['', Validators.compose([])],
residence_state: ['', Validators.compose([])],
residence_pin: ['', Validators.compose([])],
residence_other_pincode:[''],
residence_other_pincode: [''],
residence_No_of_years: ['', Validators.compose([])],
residence_ownership: ['', Validators.compose([])],
ownershipOther: [''],
@ -286,22 +290,22 @@ export class FamilyDetailsComponent implements OnInit {
const control = <FormArray>this.familyForm.controls['family_details'];
control.push(formData);
} else {
records.forEach((val,index) => {
records.forEach((val, index) => {
if(val.rent != null){
if (val.rent != null) {
this.RentAmount[index] = this._pd.convertNumberToWords(val.rent);
}
this.FamilyMemberAsLabel[index] = this.selectPerson.filter(item => item.pd_co_applicant_id == val.selected_person)[0].applicant_name;
//for (let val of records)
this.getCity(val.residence_state,index);
//for (let val of records)
this.getCity(val.residence_state, index);
let formData: FormGroup = this.fb.group({
selected_person: [val.selected_person, Validators.compose([Validators.required])],
residence_place: [val.residence_place, Validators.compose([])],
residence_city: [val.residence_city, Validators.compose([])],
residence_state: [val.residence_state, Validators.compose([])],
residence_pin: [val.residence_pin, Validators.compose([])],
residence_other_pincode:[val.residence_other_pincode],
residence_other_pincode: [val.residence_other_pincode],
residence_No_of_years: [val.residence_No_of_years, Validators.compose([])],
residence_ownership: [val.residence_ownership, Validators.compose([])],
ownershipOther: [val.ownershipOther || null],
@ -314,7 +318,7 @@ export class FamilyDetailsComponent implements OnInit {
let inx = control.length - 1;
this.addFamilyMemberDetailsWithData(inx, val.family_members_details);
});
});
}
this.noRecordsFound = true;
@ -322,9 +326,9 @@ export class FamilyDetailsComponent implements OnInit {
addFamilyMemberDetailsWithData(inx, val): void {
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
val.forEach((vals,index) => {
// for (let vals of val) {
if(vals.earning_gross_income_per_month != null){
val.forEach((vals, index) => {
// for (let vals of val) {
if (vals.earning_gross_income_per_month != null) {
this.IncomePerMonth[index] = this._pd.convertNumberToWords(vals.earning_gross_income_per_month);
}
let datas = this.fb.group({
@ -336,7 +340,7 @@ export class FamilyDetailsComponent implements OnInit {
earning_gross_income_per_month: [vals.earning_gross_income_per_month || null, Validators.compose([])],
earning_name_of_the_employer_or_business: [vals.earning_name_of_the_employer_or_business || null, Validators.compose([])],
earning_number_of_years_in_employment_or_business: [vals.earning_number_of_years_in_employment_or_business || null, Validators.compose([])],
earning_if_others_segment:[vals.earning_if_others_segment || null],
earning_if_others_segment: [vals.earning_if_others_segment || null],
non_earning_occupation: [vals.non_earning_occupation || null, Validators.compose([])],
non_earning_if_others: [vals.non_earning_if_others || null, Validators.compose([])],
non_earning_if_retired_from: [vals.non_earning_if_retired_from || null, Validators.compose([])],
@ -363,34 +367,30 @@ export class FamilyDetailsComponent implements OnInit {
prevFamilyMembersCtrlLength: number = 0;
currFamilyMembersCtrlLength: number = 0;
selectedPerson(e,inx){
console.log('familyMembersControlLength',this. prevFamilyMembersCtrlLength,this.currFamilyMembersCtrlLength);
selectedPerson(e, inx) {
this.FamilyMemberAsLabel[inx] = this.selectPerson.filter(item => item.pd_co_applicant_id == e)[0].applicant_name;
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
// console.log('current control length',control.length);
this.currFamilyMembersCtrlLength = control.length;
let i : number = 0 ;
for(i ;i < this.prevFamilyMembersCtrlLength;i++){
console.log(i,this.prevFamilyMembersCtrlLength);
let i: number = 0;
for (i; i < this.prevFamilyMembersCtrlLength; i++) {
control.removeAt(i);
}
// while(index < this.prevFamilyMembersCtrlLength)
// {
// }
// while(index < this.prevFamilyMembersCtrlLength){}
this.prevFamilyMembersCtrlLength = this.currFamilyMembersCtrlLength;
console.log('familyMembersControlLength',this. prevFamilyMembersCtrlLength,this.currFamilyMembersCtrlLength);
if(this.apiFamilyMembers.length>0){
let arraydata : any;
if (this.apiFamilyMembers.length > 0) {
let arraydata: any;
let data = this.apiFamilyMembers.filter(item => item.relation_to == e);
if(data.length > 0){
if (data.length > 0) {
this.prevFamilyMembersCtrlLength = data.length;
console.log('familyMembersControlLength',this. prevFamilyMembersCtrlLength,this.currFamilyMembersCtrlLength);
data.forEach((val,inx) => {
data.forEach((val, inx) => {
// if(val.age){
// // this.isReadOnly[inx] = true;
@ -398,47 +398,45 @@ export class FamilyDetailsComponent implements OnInit {
// // this.isReadOnly[inx] = false;
// }
arraydata = {
'family_member_name' : val.name,
'family_member_relationship' : val.relationship,
'family_member_age' : val.age,
'family_member_earning_status': val.data_gets_from == 'BusinessForm' ? '1' :'',
'earning_segment': '',
'earning_gross_income_per_month': '',
'earning_name_of_the_employer_or_business':'',
'earning_number_of_years_in_employment_or_business': '',
'earning_if_others_segment':'',
'non_earning_occupation': '',
'non_earning_if_others': '',
'non_earning_if_retired_from': '',
'non_earning_if_schoolorcollege': ''
}
control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
'family_member_name': val.name,
'family_member_relationship': val.relationship,
'family_member_age': val.age,
'family_member_earning_status': val.data_gets_from == 'BusinessForm' ? '1' : '',
'earning_segment': '',
'earning_gross_income_per_month': '',
'earning_name_of_the_employer_or_business': '',
'earning_number_of_years_in_employment_or_business': '',
'earning_if_others_segment': '',
'non_earning_occupation': '',
'non_earning_if_others': '',
'non_earning_if_retired_from': '',
'non_earning_if_schoolorcollege': ''
}
control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
});
}
else{
else {
this.prevFamilyMembersCtrlLength = 1;
console.log('familyMembersControlLength',this. prevFamilyMembersCtrlLength,this.currFamilyMembersCtrlLength);
control.push(this.generateFamilyMembersDetailsGet());
}
}
else{
else {
this.prevFamilyMembersCtrlLength = 1;
console.log('familyMembersControlLength',this. prevFamilyMembersCtrlLength,this.currFamilyMembersCtrlLength);
control.push(this.generateFamilyMembersDetailsGet());
}
}
}
addFamilyMembers(inx) {
let mainControl = this.familyForm.get('family_details') as FormArray;
let control = mainControl.controls[inx].get('family_members_details') as FormArray;
addFamilyMembers(inx) {
let mainControl = this.familyForm.get('family_details') as FormArray;
let control = mainControl.controls[inx].get('family_members_details') as FormArray;
control.push(this.generateFamilyMembersDetailsGet());
}
}
removeFamilyMembers(inx,i) {
let mainControl = this.familyForm.get('family_details') as FormArray;
let control = mainControl.controls[inx].get('family_members_details') as FormArray;
control.removeAt(i);
}
removeFamilyMembers(inx, i) {
let mainControl = this.familyForm.get('family_details') as FormArray;
let control = mainControl.controls[inx].get('family_members_details') as FormArray;
control.removeAt(i);
}
// getNumberOfFamilyMemberDetails(inx) {
@ -476,7 +474,7 @@ removeFamilyMembers(inx,i) {
earning_gross_income_per_month: ['', Validators.compose([])],
earning_name_of_the_employer_or_business: ['', Validators.compose([])],
earning_number_of_years_in_employment_or_business: ['', Validators.compose([])],
earning_if_others_segment:[''],
earning_if_others_segment: [''],
non_earning_occupation: ['', Validators.compose([])],
non_earning_if_others: ['', Validators.compose([])],
non_earning_if_retired_from: ['', Validators.compose([])],
@ -508,15 +506,15 @@ removeFamilyMembers(inx,i) {
});
}
getCity(e,i){
this._pd.getStateWiseCities(e).subscribe(data=>{
if (data.status == 200) {
getCity(e, i) {
this._pd.getStateWiseCities(e).subscribe(data => {
if (data.status == 200) {
this.cityData[i] = data.records.cities;
this.pincodeData[i] = data.records.pincode;
this.cityData[i] = data.records.cities;
this.pincodeData[i] = data.records.pincode;
}
});
}
});
}
submitFamily() {
@ -533,14 +531,14 @@ removeFamilyMembers(inx,i) {
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
if (data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
setTimeout(() => {
this.dialogRef.close();
},3000);
}, 3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -558,19 +556,19 @@ removeFamilyMembers(inx,i) {
// });
// }
/** To Convert Amount into Words */
inWords(e,flag:number,i){
switch(flag){
case 1 :
/** To Convert Amount into Words */
inWords(e, flag: number, i) {
switch (flag) {
case 1:
this.RentAmount[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
case 2:
this.IncomePerMonth[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}
}

View File

@ -1,11 +1,13 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{pageTitle}}
</div>
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<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;">
@ -13,118 +15,105 @@
<mat-dialog-content>
<mat-card>
<mat-form-field style="width:50%;">
<mat-select placeholder="Customer Behaviour" formControlName="final_custormer_remark_type">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_remarkTypeCustomerBehaviour" [value]="pm.customer_behaviour_id">{{ pm.description }}</mat-option>
</mat-select>
<mat-select placeholder="Customer Behaviour" formControlName="final_custormer_remark_type">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_remarkTypeCustomerBehaviour" [value]="pm.customer_behaviour_id">{{
pm.description }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['final_custormer_remark_type'].value == 1">
<input matInput autocomplete="off" placeholder="Specify Customer Behaviour" formControlName="final_other_customer_behaviour">
<input matInput autocomplete="off" placeholder="Specify Customer Behaviour" formControlName="final_other_customer_behaviour">
</mat-form-field>
<mat-card>
<mat-card-content>
<mat-card-subtitle>Location</mat-card-subtitle>
<mat-form-field style="width:94%;">
<mat-select placeholder="Is the location of the business / profession suited to the nature of business / service provided? "
formControlName="is_service_provided" required>
<mat-option>Select</mat-option>
<mat-option value="well_suited.">Well Suited.</mat-option>
<mat-option value="fairly_suited">Fairly Suited</mat-option>
<mat-option value="not_suited">Not Suited</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:94%;">
<mat-select placeholder="Is the location of the business / profession suited to the nature of business / service provided? "
formControlName="is_service_provided" required>
<mat-option>Select</mat-option>
<mat-option value="well_suited.">Well Suited.</mat-option>
<mat-option value="fairly_suited">Fairly Suited</mat-option>
<mat-option value="not_suited">Not Suited</mat-option>
</mat-select>
</mat-form-field>
</mat-card-content>
</mat-card>
<br>
<mat-form-field style="width:50%;">
<mat-select placeholder="PD Officers Recommendation" formControlName="pd_officers_recommendation" required><!--(selectionChange)="RecommendationChange($event.value)"-->
<mat-option>Select</mat-option>
<mat-option *ngFor="let list of m_recommendationList" [value]="list.pdofficer_recommendation_id">{{ list.pdofficer_recommendation }}</mat-option>
</mat-select>
<mat-select placeholder="PD Officers Recommendation" formControlName="pd_officers_recommendation"
required (selectionChange)="RecommendationChange($event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let list of m_recommendationList" [value]="list.pdofficer_recommendation_id">{{
list.pdofficer_recommendation }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 1">
<input matInput autocomplete="off" placeholder="Specify PD Officers Recommendation" formControlName="others_pd_officers_recommendation">
</mat-form-field>
<input matInput autocomplete="off" placeholder="Specify PD Officers Recommendation" formControlName="others_pd_officers_recommendation">
</mat-form-field>
<span *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 2">
<div formArrayName="recommendation_positive">
<div *ngFor="let details of _finalRemarkForm.get('recommendation_positive').controls; let i=index; let last=last"
[formGroupName]="i">
<mat-form-field style="width:40%;">
<input matInput autocomplete="off" placeholder="Reasons for marking PD status as Positive" formControlName="reason_for_positive">
<span *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 2">
<div formArrayName="recommendation_positive">
<div *ngFor="let details of _finalRemarkForm.get('recommendation_positive').controls; let i=index; let last=last"
[formGroupName]="i">
<mat-form-field style="width:85%;">
<input matInput autocomplete="off" placeholder="Reasons for marking PD status as Positive"
formControlName="reason_for_positive">
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteRecommendationPositive(i)"
*ngIf="last">
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button
matTooltip="Delete" matTooltipPosition="above" (click)="deleteRecommendationPositive(i)"
*ngIf="_finalRemarkForm.get('recommendation_positive').controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Postive Reasons" matTooltipPosition="above" color="primary" (click)="addRecommendationPositive()"
*ngIf="last">
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button
matTooltip="Add More Postive Reasons" matTooltipPosition="above" color="primary"
(click)="addRecommendationPositive()" *ngIf="last">
<mat-icon>add</mat-icon>
</button>
</div>
</div>
</div>
</span>
<span *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 3">
<div formArrayName="recommendation_negative">
<div *ngFor="let details of _finalRemarkForm.get('recommendation_negative').controls; let i=index; let last=last"
[formGroupName]="i">
<mat-form-field style="width:40%;">
<input matInput autocomplete="off" placeholder="Reasons for marking PD status as Negative" formControlName="reason_for_negative">
</mat-form-field>
<mat-card-actions>
<!-- <div align="right">
<button *ngIf="currentLoanForm.controls.loan_details.controls.length > 1" type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteLoanDetails(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addLoanDetails()"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Loan Details </strong>
</button>
</div> -->
</mat-card-actions>
</span>
<span *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 3">
<div formArrayName="recommendation_negative">
<div *ngFor="let details of _finalRemarkForm.get('recommendation_negative').controls; let i=index; let last=last"
[formGroupName]="i">
<mat-form-field style="width:85%;">
<input matInput autocomplete="off" placeholder="Reasons for marking PD status as Negative"
formControlName="reason_for_negative">
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button
matTooltip="Delete" matTooltipPosition="above" (click)="deleteRecommendationNegative(i)"
*ngIf="_finalRemarkForm.get('recommendation_negative').controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button
matTooltip="Add More Negative Reasons" matTooltipPosition="above" color="primary"
(click)="addRecommendationNegative()" *ngIf="last">
<mat-icon>add</mat-icon>
</button>
</div>
</div>
</div>
</span>
<span *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 4">
</span>
<span *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 4">
<div formArrayName="recommendation_refer_to_credit">
<div *ngFor="let details of _finalRemarkForm.get('recommendation_refer_to_credit').controls; let i=index; let last=last"
[formGroupName]="i">
<mat-card-content>
<mat-form-field style="width:45%;">
<input matInput autocomplete="off" placeholder="Reasons for marking PD status as Refer to Credit" formControlName="reason_for_refer_to_credit">
</mat-form-field>
<!-- <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteLoanDetails(i)"
*ngIf="i>0">
<mat-icon>delete</mat-icon>
</button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Loan Details" matTooltipPosition="above" color="primary" (click)="addLoanDetails()"
*ngIf="last">
s <mat-icon>add</mat-icon>
</button> -->
</mat-card-content>
<mat-card-actions>
<!-- <div align="right">
<button *ngIf="currentLoanForm.controls.loan_details.controls.length > 1" type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteLoanDetails(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addLoanDetails()"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Loan Details </strong>
</button>
</div> -->
</mat-card-actions>
<mat-form-field style="width:85%;">
<input matInput autocomplete="off" placeholder="Reasons for marking PD status as Refer to Credit"
formControlName="reason_for_refer_to_credit">
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button
matTooltip="Delete" matTooltipPosition="above" (click)="deleteaddRecommendationReferToCredit(i)"
*ngIf="_finalRemarkForm.get('recommendation_refer_to_credit').controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button
matTooltip="Add More Refer To Credit Reasons" matTooltipPosition="above" color="primary"
(click)="addRecommendationReferToCredit()" *ngIf="last">
<mat-icon>add</mat-icon>
</button>
</div>
</div>
</span>
</span>
<!-- <mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 1">
<input matInput autocomplete="off" placeholder="Specify PD Officers Recommendation" formControlName="others_pd_officers_recommendation">
</mat-form-field>
@ -147,7 +136,10 @@
</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>
<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>

View File

@ -1,27 +1,27 @@
import {
Component,
OnInit,
Inject,
Input
Component,
OnInit,
Inject,
Input
} from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl,
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { analyzeAndValidateNgModules } from '@angular/compiler';
@Component({
@ -57,29 +57,29 @@ export class FinalRemarksComponent implements OnInit {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 20;
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this._finalRemarkForm = this._formBuilder.group({
pdid: [this.pdid],
formid: ['20'],
final_custormer_remark_type : [],
final_other_customer_behaviour:[],
final_custormer_remark_type: [],
final_other_customer_behaviour: [],
is_service_provided: ['', Validators.required],
pd_officers_recommendation:['', Validators.required],
others_pd_officers_recommendation:[''],
pd_officers_recommendation: ['', Validators.required],
others_pd_officers_recommendation: [''],
// reason_for_positive:[''],
// reason_for_negative:[''],
// reason_for_refer_to_credit:[''],
recommendation_positive:this._formBuilder.array([
this.CreateRecommendationPositive(null),
recommendation_positive: this._formBuilder.array([
// this.CreateRecommendationPositive(null),
]),
recommendation_negative:this._formBuilder.array([
this.CreateRecommendationNegative(null),
recommendation_negative: this._formBuilder.array([
// this.CreateRecommendationNegative(null),
]),
recommendation_refer_to_credit:this._formBuilder.array([
this.CreateRecommendationReferToCredit(null),
recommendation_refer_to_credit: this._formBuilder.array([
// this.CreateRecommendationReferToCredit(null),
]),
final_form_remarks: ['']
});
@ -96,11 +96,11 @@ export class FinalRemarksComponent implements OnInit {
addRecommendationPositive() {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_positive'];
control.push(this.CreateRecommendationPositive(null));
}
deleteRecommendationPositive(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_positive'];
}
deleteRecommendationPositive(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_positive'];
control.removeAt(index);
}
}
CreateRecommendationNegative(data) {
return this._formBuilder.group({
@ -110,11 +110,11 @@ deleteRecommendationPositive(index) {
addRecommendationNegative() {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_negative'];
control.push(this.CreateRecommendationNegative(null));
}
deleteRecommendationNegative(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_negative'];
}
deleteRecommendationNegative(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_negative'];
control.removeAt(index);
}
}
CreateRecommendationReferToCredit(data) {
return this._formBuilder.group({
reason_for_refer_to_credit: data == null ? [''] : [data.reason_for_refer_to_credit],
@ -123,11 +123,11 @@ deleteRecommendationNegative(index) {
addRecommendationReferToCredit() {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_refer_to_credit'];
control.push(this.CreateRecommendationReferToCredit(null));
}
deleteRecommendationReferToCredit(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_refer_to_credit'];
}
deleteRecommendationReferToCredit(index) {
const control = <FormArray>this._finalRemarkForm.controls['recommendation_refer_to_credit'];
control.removeAt(index);
}
}
public viewerOptions: any = {
navbar: false,
toolbar: {
@ -150,24 +150,56 @@ deleteRecommendationReferToCredit(index) {
noRecordsFound: Boolean = false;
ngOnInit() {
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '20').subscribe(data=>{
if(data.dataStatus){
// this.RecommendationChange(data.records.pd_officers_recommendation);
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '20').subscribe(data => {
if (data.dataStatus) {
// console.log('data',data);
// console.log('data',data.records);
this.RecommendationChange(data.records.pd_officers_recommendation);
this._finalRemarkForm.controls.final_custormer_remark_type.setValue(data.records.final_custormer_remark_type);
this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour);
this._finalRemarkForm.controls.pd_officers_recommendation.setValue(data.records.pd_officers_recommendation);
this._finalRemarkForm.controls.others_pd_officers_recommendation.setValue(data.records.others_pd_officers_recommendation);
// this._finalRemarkForm.controls.reason_for_positive.setValue(data.records.reason_for_positive);
// this._finalRemarkForm.controls.reason_for_negative.setValue(data.records.reason_for_negative);
// this._finalRemarkForm.controls.reason_for_refer_to_credit.setValue(data.records.reason_for_refer_to_credit);
this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided);
this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks);
this._finalRemarkForm.controls.final_custormer_remark_type.setValue(data.records.final_custormer_remark_type);
this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour);
this._finalRemarkForm.controls.pd_officers_recommendation.setValue(data.records.pd_officers_recommendation);
this._finalRemarkForm.controls.others_pd_officers_recommendation.setValue(data.records.others_pd_officers_recommendation);
// this._finalRemarkForm.controls.reason_for_positive.setValue(data.records.reason_for_positive);
// this._finalRemarkForm.controls.reason_for_negative.setValue(data.records.reason_for_negative);
// this._finalRemarkForm.controls.reason_for_refer_to_credit.setValue(data.records.reason_for_refer_to_credit);
this.noRecordsFound = true;
} else {
this.noRecordsFound = true;
}
if (data.records.recommendation_positive.length > 0) {
let recommendationPositiveCtrl: any = this._finalRemarkForm.get('recommendation_positive') as FormArray;
data.records.recommendation_positive.forEach((val, index) => {
let objs = { 'reason_for_positive': val.reason_for_positive }
recommendationPositiveCtrl.push(this.CreateRecommendationPositive(objs));
});
}
if (data.records.recommendation_refer_to_credit.length > 0) {
let recommendationReferToCredit: any = this._finalRemarkForm.get('recommendation_refer_to_credit') as FormArray;
data.records.recommendation_refer_to_credit.forEach((val, index) => {
let objs = { 'reason_for_refer_to_credit': val.reason_for_refer_to_credit }
recommendationReferToCredit.push(this.CreateRecommendationReferToCredit(objs));
});
}
if (data.records.recommendation_negative.length > 0) {
let recommendationNegativeCtrl: any = this._finalRemarkForm.get('recommendation_negative') as FormArray;
data.records.recommendation_negative.forEach((val, index) => {
let objs = { 'reason_for_negative': val.reason_for_negative }
recommendationNegativeCtrl.push(this.CreateRecommendationNegative(objs));
});
}
this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided);
this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks);
this.noRecordsFound = true;
} else {
let recommendationPositiveCtrl: any = this._finalRemarkForm.get('recommendation_positive') as FormArray;
recommendationPositiveCtrl.push(this.CreateRecommendationPositive(null));
let recommendationNegativeCtrl: any = this._finalRemarkForm.get('recommendation_negative') as FormArray;
recommendationNegativeCtrl.push(this.CreateRecommendationNegative(null));
let recommendationReferToCredit: any = this._finalRemarkForm.get('recommendation_refer_to_credit') as FormArray;
recommendationReferToCredit.push(this.CreateRecommendationReferToCredit(null));
this.noRecordsFound = true;
}
}, err => {
})
@ -204,9 +236,9 @@ deleteRecommendationReferToCredit(index) {
/** To Save/Edited Popup Data */
onSubmit() {
this.submitted = true;
if (this._finalRemarkForm.controls.final_custormer_remark_type.value == 1) {
this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]);
this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity();
if (this._finalRemarkForm.controls.final_custormer_remark_type.value == 1) {
this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]);
this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity();
}
// stop here if form is invalid
if (this._finalRemarkForm.invalid) {
@ -223,11 +255,11 @@ deleteRecommendationReferToCredit(index) {
dataresult => {
if (dataresult.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
this.dialogRef.close();
},3000);
setTimeout(() => {
this.dialogRef.close();
}, 3000);
}
else{
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
@ -255,78 +287,264 @@ deleteRecommendationReferToCredit(index) {
}
}
// RecommendationChange(e){
// // if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){
RecommendationChange(e) {
// console.log('Event',e);
let recommendationPositiveCtrl: any = this._finalRemarkForm.get('recommendation_positive') as FormArray;
let recommendationNegativeCtrl: any = this._finalRemarkForm.get('recommendation_negative') as FormArray;
let recommendationReferToCredit: any = this._finalRemarkForm.get('recommendation_refer_to_credit') as FormArray;
// // }
// // if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){
if (e == 1) {
// // }
// // if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]);
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
// // }
if (recommendationNegativeCtrl.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationNegativeCtrl.controls.length; i++) {
// if(e==1){
recommendationNegativeCtrl.removeAt(i + 1);
// this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]);
recommendationNegativeCtrl = recommendationNegativeCtrl.controls[0];
// this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
// this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
// this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
// this._finalRemarkForm.controls['reason_for_positive'].setValue('');
// this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
// this._finalRemarkForm.controls['reason_for_negative'].setValue('');
// }
// if(e==2){
// this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
// this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
// this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
// this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
// this._finalRemarkForm.controls['reason_for_positive'].setValidators([Validators.required]);
// this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
// this._finalRemarkForm.controls['reason_for_negative'].setValue('');
recommendationNegativeCtrl.controls['reason_for_negative'].setValue('');
recommendationNegativeCtrl.controls['reason_for_negative'].clearValidators();
recommendationNegativeCtrl.controls['reason_for_negative'].updateValueAndValidity();
// }
// if(e==3){
}
}
// this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
// this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
if (recommendationPositiveCtrl.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationPositiveCtrl.controls.length; i++) {
recommendationPositiveCtrl.removeAt(i + 1);
recommendationPositiveCtrl = recommendationPositiveCtrl.controls[0];
recommendationPositiveCtrl.controls['reason_for_positive'].clearValidators();
recommendationPositiveCtrl.controls['reason_for_positive'].setValue('');
recommendationPositiveCtrl.controls['reason_for_positive'].updateValueAndValidity();
}
}
// this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
// this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
if (recommendationReferToCredit.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationReferToCredit.controls.length; i++) {
recommendationReferToCredit.removeAt(i + 1);
// this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
// this._finalRemarkForm.controls['reason_for_positive'].setValue('');
recommendationReferToCredit = recommendationReferToCredit.controls[0];
// this._finalRemarkForm.controls['reason_for_negative'].setValidators([Validators.required]);
recommendationReferToCredit.controls['reason_for_refer_to_credit'].setValue('');
recommendationReferToCredit.controls['reason_for_refer_to_credit'].clearValidators();
recommendationReferToCredit.controls['reason_for_refer_to_credit'].updateValueAndValidity();
}
}
// }
// if(e==4){
}
if (e == 2) {
// this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
// this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
// this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValidators([Validators.required]);
if (recommendationReferToCredit.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationReferToCredit.controls.length; i++) {
recommendationReferToCredit.removeAt(i + 1);
// this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
// this._finalRemarkForm.controls['reason_for_positive'].setValue('');
recommendationReferToCredit = recommendationReferToCredit.controls[0];
// this._finalRemarkForm.controls['reason_for_negative'].setValue('');
// this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
recommendationReferToCredit.controls['reason_for_refer_to_credit'].setValue('');
recommendationReferToCredit.controls['reason_for_refer_to_credit'].clearValidators();
recommendationReferToCredit.controls['reason_for_refer_to_credit'].updateValueAndValidity();
// }
// this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
// this._finalRemarkForm.controls['reason_for_refer_to_credit'].updateValueAndValidity();
// this._finalRemarkForm.controls['reason_for_positive'].updateValueAndValidity();
// this._finalRemarkForm.controls['reason_for_negative'].updateValueAndValidity();
// }
}
}
// this._finalRemarkForm.controls['reason_for_positive'].setValidators([Validators.required]);
if (recommendationPositiveCtrl.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationPositiveCtrl.controls.length; i++) {
recommendationPositiveCtrl = recommendationPositiveCtrl.controls[i];
recommendationPositiveCtrl.controls['reason_for_positive'].setValidators([Validators.required]);
recommendationPositiveCtrl.controls['reason_for_positive'].updateValueAndValidity();
}
}
if (recommendationNegativeCtrl.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationNegativeCtrl.controls.length; i++) {
recommendationNegativeCtrl.removeAt(i + 1);
recommendationNegativeCtrl = recommendationNegativeCtrl.controls[0];
recommendationNegativeCtrl.controls['reason_for_negative'].setValue('');
recommendationNegativeCtrl.controls['reason_for_negative'].clearValidators();
recommendationNegativeCtrl.controls['reason_for_negative'].updateValueAndValidity();
}
}
}
if (e == 3) {
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
if (recommendationReferToCredit.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationReferToCredit.controls.length; i++) {
recommendationReferToCredit.removeAt(i + 1);
recommendationReferToCredit = recommendationReferToCredit.controls[0];
recommendationReferToCredit.controls['reason_for_refer_to_credit'].setValue('');
recommendationReferToCredit.controls['reason_for_refer_to_credit'].clearValidators();
recommendationReferToCredit.controls['reason_for_refer_to_credit'].updateValueAndValidity();
}
}
if (recommendationPositiveCtrl.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationPositiveCtrl.controls.length; i++) {
recommendationPositiveCtrl.removeAt(i + 1);
recommendationPositiveCtrl = recommendationPositiveCtrl.controls[0];
recommendationPositiveCtrl.controls['reason_for_positive'].clearValidators();
recommendationPositiveCtrl.controls['reason_for_positive'].setValue('');
recommendationPositiveCtrl.controls['reason_for_positive'].updateValueAndValidity();
}
}
if (recommendationNegativeCtrl.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationNegativeCtrl.controls.length; i++) {
recommendationNegativeCtrl = recommendationNegativeCtrl.controls[i];
recommendationNegativeCtrl.controls['reason_for_negative'].setValidators([Validators.required]);
recommendationNegativeCtrl.controls['reason_for_negative'].updateValueAndValidity();
}
}
// this._finalRemarkForm.controls['reason_for_negative'].setValidators([Validators.required]);
}
if (e == 4) {
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
if (recommendationReferToCredit.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationReferToCredit.controls.length; i++) {
recommendationReferToCredit = recommendationReferToCredit.controls[i];
recommendationReferToCredit.controls['reason_for_refer_to_credit'].setValidators([Validators.required]);
recommendationReferToCredit.controls['reason_for_refer_to_credit'].updateValueAndValidity();
}
}
if (recommendationNegativeCtrl.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationNegativeCtrl.controls.length; i++) {
recommendationNegativeCtrl.removeAt(i + 1);
recommendationNegativeCtrl = recommendationNegativeCtrl.controls[0];
recommendationNegativeCtrl.controls['reason_for_negative'].setValue('');
recommendationNegativeCtrl.controls['reason_for_negative'].clearValidators();
recommendationNegativeCtrl.controls['reason_for_negative'].updateValueAndValidity();
}
}
if (recommendationPositiveCtrl.controls.length > 0) {
let i: number = 0;
for (i; i < recommendationPositiveCtrl.controls.length; i++) {
recommendationPositiveCtrl.removeAt(i + 1);
recommendationPositiveCtrl = recommendationPositiveCtrl.controls[0];
recommendationPositiveCtrl.controls['reason_for_positive'].clearValidators();
recommendationPositiveCtrl.controls['reason_for_positive'].setValue('');
recommendationPositiveCtrl.controls['reason_for_positive'].updateValueAndValidity();
}
}
}
}
RecommendationChange2(e) {
// if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){
// }
// if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){
// }
// if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){
// }
if (e == 1) {
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]);
this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
this._finalRemarkForm.controls['reason_for_positive'].setValue('');
this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
this._finalRemarkForm.controls['reason_for_negative'].setValue('');
}
if (e == 2) {
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
this._finalRemarkForm.controls['reason_for_positive'].setValidators([Validators.required]);
this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
this._finalRemarkForm.controls['reason_for_negative'].setValue('');
}
if (e == 3) {
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
this._finalRemarkForm.controls['reason_for_positive'].setValue('');
this._finalRemarkForm.controls['reason_for_negative'].setValidators([Validators.required]);
}
if (e == 4) {
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValidators([Validators.required]);
this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
this._finalRemarkForm.controls['reason_for_positive'].setValue('');
this._finalRemarkForm.controls['reason_for_negative'].setValue('');
this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
}
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['reason_for_positive'].updateValueAndValidity();
this._finalRemarkForm.controls['reason_for_negative'].updateValueAndValidity();
}
}

View File

@ -2,7 +2,8 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr"> - {{subproduct_abbr}} </span> </span><br>
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">
- {{subproduct_abbr}} </span> </span><br>
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
@ -98,16 +99,16 @@
<!-- RI month and year start-->
<mat-card *ngIf="customer_segment_abbr == 'SE-RI'">
<mat-card-title>Number of Years for which rental income is being received</mat-card-title>
<mat-form-field style="width: 20%;">
<input matInput placeholder="Year" formControlName="rental_income_rcv_in_years"
autocomplete="off" OnlyNumber type="text" required>
<mat-error>Please Enter Correct Year</mat-error>
</mat-form-field>
<mat-form-field style="width: 20%;">
<input matInput type="text" placeholder="Month" formControlName="rental_income_rcv_in_month"
autocomplete="off" OnlyNumber type="text" (change)="ConvertMonthintoYearforBusiness($event.target.value,'',2)">
</mat-form-field>
<mat-card-title>Number of Years for which rental income is being received</mat-card-title>
<mat-form-field style="width: 20%;">
<input matInput placeholder="Year" formControlName="rental_income_rcv_in_years" autocomplete="off"
OnlyNumber type="text" required>
<mat-error>Please Enter Correct Year</mat-error>
</mat-form-field>
<mat-form-field style="width: 20%;">
<input matInput type="text" placeholder="Month" formControlName="rental_income_rcv_in_month"
autocomplete="off" OnlyNumber type="text" (change)="ConvertMonthintoYearforBusiness($event.target.value,'',2)">
</mat-form-field>
</mat-card>
<!-- RI month and year ends-->
@ -133,14 +134,15 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="com.controls.business_entity_type_other">
<input matInput placeholder="Please Specify Others" formControlName="business_entity_type_other" required>
<input matInput placeholder="Please Specify Others" formControlName="business_entity_type_other"
required>
</mat-form-field>
<p>Number of Years For Which The Business Has Been Running</p>
<mat-form-field style="width: 20%;">
<input matInput placeholder="Year" formControlName="business_years"
autocomplete="off" OnlyNumber type="text" required>
<input matInput placeholder="Year" formControlName="business_years" autocomplete="off"
OnlyNumber type="text" required>
<mat-error>Please Enter Correct Year</mat-error>
</mat-form-field>
<mat-form-field style="width: 20%;">
@ -183,8 +185,7 @@
<mat-card-title> Relationship Between Individuals </mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-table [dataSource]="relationSource"
formArrayName="persons_with_relationships">
<mat-table [dataSource]="relationSource" formArrayName="persons_with_relationships">
<ng-container matColumnDef="applicant_name">
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">

View File

@ -35,7 +35,7 @@ export class GeneralInfoComponent implements OnInit {
errorMessage: any;
maxDate: any;
disableAfterSubmit : boolean;
disableAfterSubmit: boolean;
public pd_applicants_details: any;
public _generalForm: FormGroup;
@ -215,47 +215,47 @@ export class GeneralInfoComponent implements OnInit {
return data.records.company_with_relationships[key];
});
if(this.customer_segment_abbr != 'SE-RI'){
if (this.customer_segment_abbr != 'SE-RI') {
if (exist_companyWithRelationships.length > 0) {
exist_companyWithRelationships.forEach(element => {
//individualsControl.push(this.createIndividulas(element))
companyWithRelationshipsControl.push(this.createCompaniesRelationshipWithData(element));
});
}
else if(exist_companyWithRelationships.length == 0) {
companyWithRelationshipsControl.push(this.createCompaniesRelationship());
if (exist_companyWithRelationships.length > 0) {
exist_companyWithRelationships.forEach(element => {
//individualsControl.push(this.createIndividulas(element))
companyWithRelationshipsControl.push(this.createCompaniesRelationshipWithData(element));
});
}
else if (exist_companyWithRelationships.length == 0) {
companyWithRelationshipsControl.push(this.createCompaniesRelationship());
}
// create companies
exist_companies = Object.keys(data.records.companies).map(function (key) {
return data.records.companies[key];
});
if (exist_companies.length > 0) {
exist_companies.forEach((element, cindex) => {
companyControl.push(this.createCompanies(element));
let otherControl: any = this._generalForm.get('companies') as FormArray;
otherControl = otherControl.controls[cindex];
element.business_entity_type == '1' ? otherControl.addControl('business_entity_type_other', new FormControl(element.business_entity_type_other, Validators.required)) : otherControl.removeControl('business_entity_type_other');
if (element.is_active == false) {
let control: any = this._generalForm.get('companies') as FormArray;
control.controls[cindex].controls.company_name.clearValidators();
control.controls[cindex].controls.company_name.updateValueAndValidity();
control.controls[cindex].controls.business_years.clearValidators();
control.controls[cindex].controls.business_years.updateValueAndValidity();
control.controls[cindex].controls.business_entity_type.clearValidators();
control.controls[cindex].controls.business_entity_type.updateValueAndValidity();
element.business_entity_type == '1' ? control.controls[cindex].controls.business_entity_type_other.clearValidators() : '';
element.business_entity_type == '1' ? control.controls[cindex].controls.business_entity_type_other.updateValueAndValidity() : '';
}
// create companies
exist_companies = Object.keys(data.records.companies).map(function (key) {
return data.records.companies[key];
});
if (exist_companies.length > 0) {
exist_companies.forEach((element, cindex) => {
companyControl.push(this.createCompanies(element));
let otherControl: any = this._generalForm.get('companies') as FormArray;
otherControl = otherControl.controls[cindex];
element.business_entity_type == '1' ? otherControl.addControl('business_entity_type_other', new FormControl(element.business_entity_type_other, Validators.required)) : otherControl.removeControl('business_entity_type_other');
if (element.is_active == false) {
let control: any = this._generalForm.get('companies') as FormArray;
control.controls[cindex].controls.company_name.clearValidators();
control.controls[cindex].controls.company_name.updateValueAndValidity();
control.controls[cindex].controls.business_years.clearValidators();
control.controls[cindex].controls.business_years.updateValueAndValidity();
control.controls[cindex].controls.business_entity_type.clearValidators();
control.controls[cindex].controls.business_entity_type.updateValueAndValidity();
element.business_entity_type == '1' ? control.controls[cindex].controls.business_entity_type_other.clearValidators() : '';
element.business_entity_type == '1' ? control.controls[cindex].controls.business_entity_type_other.updateValueAndValidity() : '';
}
});
}
});
}
this._generalForm.controls['rental_income_rcv_in_years'].setValue(null);
this._generalForm.controls['rental_income_rcv_in_month'].setValue(null);
}
else if(this.customer_segment_abbr == 'SE-RI'){
else if (this.customer_segment_abbr == 'SE-RI') {
// companyWithRelationshipsControl.push(this.createCompaniesRelationship());
// companyControl.push(this.createCompanies(''));
@ -292,10 +292,10 @@ export class GeneralInfoComponent implements OnInit {
element.is_active = true;
element.individuals_order_id = key + 1;
element.age = '',
element.qualification = '',
element.course_name = '',
element.qualification = '',
element.course_name = '',
individualsControl.push(this.createIndividulas(element));
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element));
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element));
//let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
// let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1};
@ -350,7 +350,7 @@ export class GeneralInfoComponent implements OnInit {
relationship: [elementValue.relationship],
relation_to: [elementValue.relation_to],
individuals_order_id: [elementValue.individuals_order_id],
is_active:[elementValue.is_active]
is_active: [elementValue.is_active]
});
}
@ -520,7 +520,7 @@ export class GeneralInfoComponent implements OnInit {
element.is_main_applicant = false;
individualsControl.push(this.createIndividulas(element));
let relationControl = <FormArray>this._generalForm.controls['persons_with_relationships'];
let applicant_details: any = { 'pd_co_applicant_id': element.pd_co_applicant_id, 'applicant_name': element.applicant_name, 'relationship': '', 'relation_to': '', 'individuals_order_id': element.individuals_order_id,'is_active': element.is_active };
let applicant_details: any = { 'pd_co_applicant_id': element.pd_co_applicant_id, 'applicant_name': element.applicant_name, 'relationship': '', 'relation_to': '', 'individuals_order_id': element.individuals_order_id, 'is_active': element.is_active };
relationControl.push(this.createPersonsWithRelationships(applicant_details));
});
@ -530,7 +530,7 @@ export class GeneralInfoComponent implements OnInit {
}
ApplicantName(event,coApplicantId){
ApplicantName(event, coApplicantId) {
let relationControl = <FormArray>this._generalForm.controls['persons_with_relationships'];
@ -601,36 +601,30 @@ export class GeneralInfoComponent implements OnInit {
}
// submit form details
temp : number = 0;
temp: number = 0;
submitGeneralForm(formData: any) {
if(this.customer_segment_abbr != 'SE-RI'){
if (this.customer_segment_abbr != 'SE-RI') {
this._generalForm.controls['rental_income_rcv_in_years'].clearValidators();
this._generalForm.controls['rental_income_rcv_in_years'].updateValueAndValidity();
}
// 0th index of companies formArray only - required removed
// greater than zero means not applicable here
if(this.customer_segment_abbr == 'SE-RI'){
let otherControl: any = this._generalForm.get('companies') as FormArray;
if(otherControl.controls.length > 0){
otherControl = otherControl.controls[0];
// otherControl.controls.business_entity_type_other.clearValidators();
// otherControl.controls.business_entity_type_other.updateValueAndValidity();
otherControl.controls.business_years.clearValidators();
otherControl.controls.business_years.updateValueAndValidity();
otherControl.controls.business_entity_type.clearValidators();
otherControl.controls.business_entity_type.updateValueAndValidity();
}
}
// console.log(formData.individuals.length);
// console.log(formData.individuals);
// 0th index of companies formArray only - required removed
// greater than zero means not applicable here
if (this.customer_segment_abbr == 'SE-RI') {
let otherControl: any = this._generalForm.get('companies') as FormArray;
if (otherControl.controls.length > 0) {
otherControl = otherControl.controls[0];
// otherControl.controls.business_entity_type_other.clearValidators();
// otherControl.controls.business_entity_type_other.updateValueAndValidity();
otherControl.controls.business_years.clearValidators();
otherControl.controls.business_years.updateValueAndValidity();
otherControl.controls.business_entity_type.clearValidators();
otherControl.controls.business_entity_type.updateValueAndValidity();
}
}
if (this._generalForm.invalid) {
this.disableAfterSubmit = false;
this.validateAllFormFields(this._generalForm);
@ -638,23 +632,23 @@ export class GeneralInfoComponent implements OnInit {
return;
}
else {
if(formData.individuals.length > 0){
if (formData.individuals.length > 0) {
formData.individuals.forEach((val,index) => {
formData.individuals.forEach((val, index) => {
if(val.is_person_met == false){
if (val.is_person_met == false) {
this.temp++;
}
});
if(this.temp == formData.individuals.length){
this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
if (this.temp == formData.individuals.length) {
this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
this.temp = 0;
this.temp = 0;
return;
return;
}
}
this.disableAfterSubmit = true;
@ -663,14 +657,14 @@ export class GeneralInfoComponent implements OnInit {
saveRecords.formid = formData.formid;
saveRecords.individuals = formData.individuals;
saveRecords.persons_with_relationships = formData.persons_with_relationships;
if(this.customer_segment_abbr != 'SE-RI'){
if (this.customer_segment_abbr != 'SE-RI') {
saveRecords.companies = formData.companies;
saveRecords.company_with_relationships = formData.company_with_relationships;
saveRecords.rental_income_rcv_in_years = null;
saveRecords.rental_income_rcv_in_month = null;
//saveRecords.applicant_relation=formData.applicant_relation;
}
else if(this.customer_segment_abbr == 'SE-RI'){
else if (this.customer_segment_abbr == 'SE-RI') {
saveRecords.companies = [];
saveRecords.company_with_relationships = [];
saveRecords.rental_income_rcv_in_years = formData.rental_income_rcv_in_years;
@ -680,8 +674,6 @@ export class GeneralInfoComponent implements OnInit {
saveRecords.general_remark = formData.general_remark;
// console.log('saveRecords',saveRecords);
// return;
this._pd.savePDFormDetailsWithID(saveRecords).subscribe(
dataresult => {
if (dataresult.status == 200) {
@ -706,12 +698,12 @@ export class GeneralInfoComponent implements OnInit {
/**************************** submit form details Ends Here ***********************/
// convert month to year business has been running
ConvertMonthintoYearforBusiness(e, controlIndex,flag) {
ConvertMonthintoYearforBusiness(e, controlIndex, flag) {
let converted_month: number = e % 12;
let converted_year: number = e / 12;
let converted_month: number = e % 12;
let converted_year: number = e / 12;
if(flag == 1){
if (flag == 1) {
let control: any = this._generalForm.get('companies') as FormArray;
control = control.controls[controlIndex];
let business_year = control.controls.business_years.value;
@ -719,10 +711,10 @@ export class GeneralInfoComponent implements OnInit {
control.controls.business_month.setValue(Math.floor(converted_month));
}
if(flag == 2){
let ri_year = this._generalForm.controls.rental_income_rcv_in_years.value;
this._generalForm.controls['rental_income_rcv_in_years'].setValue(+ri_year + +Math.floor(converted_year));
this._generalForm.controls['rental_income_rcv_in_month'].setValue(Math.floor(converted_month));
if (flag == 2) {
let ri_year = this._generalForm.controls.rental_income_rcv_in_years.value;
this._generalForm.controls['rental_income_rcv_in_years'].setValue(+ri_year + +Math.floor(converted_year));
this._generalForm.controls['rental_income_rcv_in_month'].setValue(Math.floor(converted_month));
}
}

View File

@ -1,170 +1,227 @@
<form [formGroup]="representativeForm" class="address">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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" matTooltip="Show Snack Bar" matTooltipPosition="right" (click)="open()"><mat-icon>person</mat-icon></button> -->
<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>
<!--<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Show Snack Bar" matTooltipPosition="right" (click)="open()"><mat-icon>person</mat-icon></button> -->
<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>
</h2>
<mat-dialog-content>
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card>
<mat-card-content>
<mat-form-field>
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Did the lender representative accompany the PD officer for PD?"
formControlName="lender_representative_accompany">
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<div *ngIf="representativeForm.controls.lender_representative_accompany.value == 'Yes'">
<div formArrayName="lender_representative_details">
<div *ngFor="let details of representativeForm.get('lender_representative_details').controls; let i=index"
[formGroupName]="i">
<mat-form-field>
<input matInput placeholder="What is the name of lender representative who accompanies the PD officer, If any?" formControlName="lender_representative_who_accompanies" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Did the lender representative carry the loan file during PD?" formControlName="lender_representative_carry_loan_files" required>
</mat-form-field>
</div>
</div>
</div>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card>
<mat-card-content>
<mat-form-field>
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Did the lender representative accompany the PD officer for PD?"
formControlName="lender_representative_accompany">
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<div *ngIf="representativeForm.controls.lender_representative_accompany.value == 'Yes'">
<div formArrayName="lender_representative_details">
<div *ngFor="let details of representativeForm.get('lender_representative_details').controls; let i=index"
[formGroupName]="i">
<mat-form-field>
<input matInput placeholder="What is the name of lender representative who accompanies the PD officer, If any?"
formControlName="lender_representative_who_accompanies"
required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Did the lender representative carry the loan file during PD?"
formControlName="lender_representative_carry_loan_files"
required>
</mat-form-field>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-dialog-content>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="representative_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="60" class="pb-0 text-sm-left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="representative_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit" matTooltipPosition="above" type="button" [disabled]="disableAfterSubmit===true" (click)="submitLRForm()"><mat-icon>save</mat-icon>
</button>
<div fxFlex="40" align="end">
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit"
matTooltipPosition="above" type="button" [disabled]="disableAfterSubmit===true" (click)="submitLRForm()">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>

View File

@ -1,5 +1,5 @@
import {Component,OnInit,Inject,Input } from '@angular/core';
import {FormBuilder,FormGroup,Validators,FormArray, FormControl,} from '@angular/forms';
import { Component, OnInit, Inject, Input } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormArray, FormControl, } from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
@ -13,9 +13,9 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import { ActivatedRoute, Router } from "@angular/router";
@Component({
selector: 'app-lender-representative',
templateUrl: './lender-representative.component.html',
styleUrls: ['./lender-representative.component.scss']
selector: 'app-lender-representative',
templateUrl: './lender-representative.component.html',
styleUrls: ['./lender-representative.component.scss']
})
export class LenderRepresentativeComponent implements OnInit {
customer_segment_abbr: any;
@ -26,161 +26,161 @@ export class LenderRepresentativeComponent implements OnInit {
// applicant_name: any;
// snackBar: any;
public representativeForm: FormGroup;
private notifier: NotifierService;
pageTitle: string ="Lender Representative Details";
pdid: number;
form_id: number;
disableAfterSubmit : boolean = false;
//snack bar
private notifier: NotifierService;
pageTitle: string = "Lender Representative Details";
pdid: number;
form_id: number;
disableAfterSubmit: boolean = false;
//snack bar
constructor(notifier: NotifierService,
private fb: FormBuilder,
private route: ActivatedRoute,
private router: Router,
// private snackBar: MatSnackBar,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<LenderRepresentativeComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
constructor(notifier: NotifierService,
private fb: FormBuilder,
private route: ActivatedRoute,
private router: Router,
// private snackBar: MatSnackBar,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<LenderRepresentativeComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.form_id = 15;
this.notifier = notifier;
}
this.form_id = 15;
this.notifier = notifier;
}
// message ='Snack Bar Opened.';
// actionButtonLabel = 'Close';
// action = true;
// setAutohide = true;
// autoHide = 1000000;
// addExtraClass = false;
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,
}
};
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,
}
};
// open() {
// const config = new MatSnackBarConfig();
// config.duration = this.autoHide;
// config.panelClass = this.addExtraClass ? ['party'] : null;
// this.snackBar.open(this.message, this.action && this.actionButtonLabel, config);
// }
ngOnInit() {
// this.message.main_applicant = this.main_applicant;
// this.message.lender_applicant_id = this.lender_applicant_id;
this.initRepresentative();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
this._pd.retriveForm(params).subscribe(value => {
const control = <FormArray>this.representativeForm.controls['lender_representative_details'];
if (value.status == 200) {
// open() {
// const config = new MatSnackBarConfig();
// config.duration = this.autoHide;
// config.panelClass = this.addExtraClass ? ['party'] : null;
// this.snackBar.open(this.message, this.action && this.actionButtonLabel, config);
// }
ngOnInit() {
// this.message.main_applicant = this.main_applicant;
// this.message.lender_applicant_id = this.lender_applicant_id;
this.initRepresentative();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
this._pd.retriveForm(params).subscribe(value => {
const control = <FormArray>this.representativeForm.controls['lender_representative_details'];
if (value.status == 200) {
this.representativeForm.controls['lender_representative_accompany'].setValue(value.records.lender_representative_accompany);
this.representativeForm.controls['representative_remarks'].setValue(value.records.representative_remarks);
this.representativeForm.controls['lender_representative_accompany'].setValue(value.records.lender_representative_accompany);
this.representativeForm.controls['representative_remarks'].setValue(value.records.representative_remarks);
if (value.records.lender_representative_accompany == 'Yes') {
var result = Object.keys(value.records.lender_representative_details).map(function (key) {
return value.records.lender_representative_details[key];
});
if (result.length > 0) {
result.forEach(val => {
control.push(this.createLRDetail());
});
this.representativeForm.controls['lender_representative_details'].setValue(result);
}
}
}
// else {
// control.push(this.createLRDetail());
// }
})
}
public initRepresentative(): void {
this.representativeForm = this.fb.group({
lender_representative_accompany: [''],
representative_remarks: [''],
lender_representative_details: this.fb.array([]),
});
}
if (value.records.lender_representative_accompany == 'Yes') {
var result = Object.keys(value.records.lender_representative_details).map(function (key) {
return value.records.lender_representative_details[key];
});
if (result.length > 0) {
result.forEach(val => {
control.push(this.createLRDetail());
});
this.representativeForm.controls['lender_representative_details'].setValue(result);
}
}
}
// else {
// control.push(this.createLRDetail());
// }
})
}
public initRepresentative(): void {
this.representativeForm = this.fb.group({
lender_representative_accompany: [''],
representative_remarks: [''],
lender_representative_details: this.fb.array([]),
});
}
selectedLoanChanges(e): void {
if (e.value == 'Yes') {
const control = <FormArray>this.representativeForm.controls['lender_representative_details'];
control.push(this.createLRDetail());
} else if (e.value == 'No') {
const arr = <FormArray>this.representativeForm.controls.lender_representative_details;
arr.removeAt(0);
}
}
createLRDetail() {
return this.fb.group({
lender_representative_who_accompanies : [''],
lender_representative_carry_loan_files: [''],
});
}
selectedLoanChanges(e): void {
if (e.value == 'Yes') {
const control = <FormArray>this.representativeForm.controls['lender_representative_details'];
control.push(this.createLRDetail());
} else if (e.value == 'No') {
const arr = <FormArray>this.representativeForm.controls.lender_representative_details;
arr.removeAt(0);
}
}
createLRDetail() {
return this.fb.group({
lender_representative_who_accompanies: [''],
lender_representative_carry_loan_files: [''],
});
}
submitLRForm() {
if (!this.representativeForm.valid) {
this.validateAllFormFields(this.representativeForm);
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
this.disableAfterSubmit = true;
let records: any = {};
records.pdid = this.pdid;
records.formid = this.form_id;
records.fk_createdby = this.pdid;
records.lender_representative_accompany = this.representativeForm.controls['lender_representative_accompany'].value;
records.representative_remarks = this.representativeForm.controls['representative_remarks'].value;
if (records.lender_representative_accompany == 'Yes') {
records.lender_representative_details = this.representativeForm.controls['lender_representative_details'].value;
}
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
this.dialogRef.close();
submitLRForm() {
if (!this.representativeForm.valid) {
this.validateAllFormFields(this.representativeForm);
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
this.disableAfterSubmit = true;
let records: any = {};
records.pdid = this.pdid;
records.formid = this.form_id;
records.fk_createdby = this.pdid;
records.lender_representative_accompany = this.representativeForm.controls['lender_representative_accompany'].value;
records.representative_remarks = this.representativeForm.controls['representative_remarks'].value;
if (records.lender_representative_accompany == 'Yes') {
records.lender_representative_details = this.representativeForm.controls['lender_representative_details'].value;
}
this._pd.saveForm(records).subscribe(data => {
if (data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() => {
this.dialogRef.close();
this.disableAfterSubmit = false;
}, 3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.disableAfterSubmit = false;
},3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.disableAfterSubmit = false;
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.disableAfterSubmit = false;
})
}
validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
}
});
}
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.disableAfterSubmit = false;
})
}
validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
}
});
}
}

View File

@ -30,15 +30,16 @@
{{loanAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-label>Loan Tenure applied for?</mat-label>
<input matInput placeholder="No of months" formControlName="loan_tenure" OnlyNumber type="text"
autocomplete="off">
<mat-label>Loan Tenure applied for?</mat-label>
<input matInput placeholder="No of months" formControlName="loan_tenure"
OnlyNumber type="text" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:64%">
<mat-select placeholder="Sub Product"
formControlName="sub_product" (selectionChange)="onChangeSubProduct($event.value)">
<mat-select placeholder="Sub Product" formControlName="sub_product"
(selectionChange)="onChangeSubProduct($event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let list of m_endUseofLoad" [value]="list.subproduct_id"> {{list.name }} ( {{list.abbr}} ) </mat-option>
<mat-option *ngFor="let list of m_endUseofLoad" [value]="list.subproduct_id">
{{list.name }} ( {{list.abbr}} ) </mat-option>
</mat-select>
</mat-form-field>
@ -105,16 +106,16 @@
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['end_use_topup'].value == 1"
style="width: 28%">
<input matInput placeholder="Specify End Use of Top Up *" formControlName="other_end_use_topup"
autocomplete="off">
<input matInput placeholder="Specify End Use of Top Up *"
formControlName="other_end_use_topup" autocomplete="off">
</mat-form-field>
</span>
<span *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' && !isContribution">
<mat-form-field style="width: 64%">
<input matInput placeholder="Amount of Own Contribution"
formControlName="own_contribution" OnlyNumber type="text"
(keyup)="inWords($event,4)" autocomplete="off">
formControlName="own_contribution" OnlyNumber type="text" (keyup)="inWords($event,4)"
autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}}
{{ownContributionInWords}} Only</mat-hint>
</mat-form-field>
@ -211,8 +212,8 @@
<mat-form-field style="width:46%">
<input matInput placeholder="Estimate Market Value as Per Customer"
formControlName="emv_per_customer" OnlyNumber type="text"
(keyup)="inWords($event,7)" autocomplete="off">
formControlName="emv_per_customer" OnlyNumber type="text" (keyup)="inWords($event,7)"
autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}}
{{emvAmtInWords}} Only</mat-hint>
</mat-form-field>

View File

@ -31,7 +31,7 @@ export class LoanDetailsComponent implements OnInit {
lender_applicant_id: any;
main_applicant: any;
pageTitle: string = "Loan Details";
disableAfterSubmit : boolean = false;
disableAfterSubmit: boolean = false;
/**Declaration of formfields Variables */
private notifier: NotifierService;
@ -101,7 +101,6 @@ export class LoanDetailsComponent implements OnInit {
this.productAbbr = this.pd_all_details.pdmaster_details.product_abbr;
this.productID = this.pd_all_details.pdmaster_details.fk_product_id;
this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name;
console.log('this.pd_all_details.pdmaster_details',this.pd_all_details.pdmaster_details);
this.exist_loan_amt = this.pd_all_details.pdmaster_details.loan_amount != '' ? this.pd_all_details.pdmaster_details.loan_amount : '';
this.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt);
this.form_id = 10;
@ -122,7 +121,7 @@ export class LoanDetailsComponent implements OnInit {
this.initloanDetailsForm();
this.getM_EndUseofLoad();
this.getM_EndUseForLoan(this.pdid,this.pd_all_details.pdmaster_details.fk_subproduct_id);
this.getM_EndUseForLoan(this.pdid, this.pd_all_details.pdmaster_details.fk_subproduct_id);
this.getM_sourceofamount();
this.getM_MortageTypeProperty();
this.getM_StatusofCunstruction();
@ -283,8 +282,8 @@ export class LoanDetailsComponent implements OnInit {
this.loanDetailsForm.controls['loandetails_remarks'].setValue(value.records.loandetails_remarks);
}
else{
if(this.pd_all_details.pdmaster_details.fk_subproduct_id){
else {
if (this.pd_all_details.pdmaster_details.fk_subproduct_id) {
this.loanDetailsForm.controls['sub_product'].setValue(this.pd_all_details.pdmaster_details.fk_subproduct_id);
}
}
@ -311,8 +310,8 @@ export class LoanDetailsComponent implements OnInit {
});
}
getM_EndUseForLoan(pdid,subproductid) {
this._pd.getEndUseForLoan(pdid,subproductid).subscribe(
getM_EndUseForLoan(pdid, subproductid) {
this._pd.getEndUseForLoan(pdid, subproductid).subscribe(
data => {
this.m_endUseForLoan = data.records.filter(data => data.isactive == 1);
});
@ -393,8 +392,8 @@ export class LoanDetailsComponent implements OnInit {
this.loanDetailsForm = this.fb.group({
loan_amount: [this.exist_loan_amt],
loan_tenure:[''],
sub_product:[''],
loan_tenure: [''],
sub_product: [''],
end_use: [''],
end_use_other: [''],
is_transfer: [''],
@ -436,11 +435,11 @@ export class LoanDetailsComponent implements OnInit {
}
onChangeSubProduct(e){
this._pd.getEndUseForLoan(this.pdid,e).subscribe(
onChangeSubProduct(e) {
this._pd.getEndUseForLoan(this.pdid, e).subscribe(
data => {
this.m_endUseForLoan = data.records.filter(data => data.isactive == 1);
});
});
}
/** Enduse Changes And its Validation */
@ -621,39 +620,39 @@ export class LoanDetailsComponent implements OnInit {
/** To save Loan FOrm Details */
submitLoanDetails() {
if ((this.isContribution == true)){
if(this.loanDetailsForm.controls['is_transfer'].value != 'yes') {
this.loanDetailsForm.controls['own_contribution'].setValue('');
this.loanDetailsForm.controls['own_contribution'].clearValidators();
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
this.loanDetailsForm.controls['other_source'].setValue('');
this.loanDetailsForm.controls['other_source'].clearValidators();
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
this.loanDetailsForm.controls['source'].setValue('');
this.loanDetailsForm.controls['source'].clearValidators();
this.loanDetailsForm.controls['source'].updateValueAndValidity();
if ((this.isContribution == true)) {
if (this.loanDetailsForm.controls['is_transfer'].value != 'yes') {
this.loanDetailsForm.controls['own_contribution'].setValue('');
this.loanDetailsForm.controls['own_contribution'].clearValidators();
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
this.loanDetailsForm.controls['other_source'].setValue('');
this.loanDetailsForm.controls['other_source'].clearValidators();
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
this.loanDetailsForm.controls['source'].setValue('');
this.loanDetailsForm.controls['source'].clearValidators();
this.loanDetailsForm.controls['source'].updateValueAndValidity();
}
else if(this.loanDetailsForm.controls['is_transfer'].value == 'yes'){
else if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
if (this.loanDetailsForm.controls['end_use_topup'].value == 1) {
this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]);
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
}
else {
this.loanDetailsForm.controls['other_end_use_topup'].setValue('');
this.loanDetailsForm.controls['other_end_use_topup'].clearValidators();
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
}
if (this.loanDetailsForm.controls['end_use_topup'].value == 1) {
this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]);
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
}
else {
this.loanDetailsForm.controls['other_end_use_topup'].setValue('');
this.loanDetailsForm.controls['other_end_use_topup'].clearValidators();
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
}
if (this.loanDetailsForm.controls['lender'].value == 1) {
this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]);
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
}
else {
this.loanDetailsForm.controls['other_bt_lender'].setValue('');
this.loanDetailsForm.controls['other_bt_lender'].clearValidators();
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
}
if (this.loanDetailsForm.controls['lender'].value == 1) {
this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]);
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
}
else {
this.loanDetailsForm.controls['other_bt_lender'].setValue('');
this.loanDetailsForm.controls['other_bt_lender'].clearValidators();
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
}
}
}

View File

@ -1,13 +1,17 @@
<form [formGroup]="otherIncomeForm" class="address">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
{{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>
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">-
{{subproduct_abbr}} </span></span><br>
{{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>
<mat-dialog-content>
@ -19,11 +23,11 @@
<div fxFlex="100">
<mat-card>
<!-- <mat-card-title></mat-card-title> -->
<!-- <mat-card-title></mat-card-title> -->
<mat-card-content>
<mat-form-field style="width:45% !important;">
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Other Income"
formControlName="other_income">
formControlName="other_income">
<mat-option>Select</mat-option>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
@ -33,14 +37,17 @@
</mat-card>
<mat-card *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'">
<mat-card-header><mat-card-title><p>Income Details</p></mat-card-title></mat-card-header>
<mat-card-header>
<mat-card-title>
<p>Income Details</p>
</mat-card-title>
</mat-card-header>
<div formArrayName="income_details">
<div *ngFor="let details of otherIncomeForm.get('income_details').controls; let i=index; let last=last;"
[formGroupName]="i">
[formGroupName]="i">
<mat-card-content class="matcard">
<mat-form-field style="width:45%">
<mat-select placeholder="Source"
formControlName="source">
<mat-select placeholder="Source" formControlName="source">
<mat-option>Select</mat-option>
<mat-option value="{{src.id}}" *ngFor="let src of sourceData">{{src.name}}</mat-option>
<!-- <mat-option value="rental_income">Rental Income</mat-option>
@ -53,17 +60,17 @@
<mat-form-field style="width:45%" *ngIf="details.get('source').value == 1">
<input matInput autocomplete="off" placeholder="Specify Source"
formControlName="others_source">
formControlName="others_source">
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="details.get('source').value == 5">
<input matInput autocomplete="off" placeholder="Address"
<input matInput autocomplete="off" placeholder="Address"
formControlName="address">
<mat-hint align="end"><i (click)="Toview()">Rental Info Details</i></mat-hint>
<mat-hint align="end"><i (click)="Toview()">Rental Info Details</i></mat-hint>
</mat-form-field>
<mat-form-field style="width:45%">
<!-- <mat-select placeholder="Income earned by"
<!-- <mat-select placeholder="Income earned by"
formControlName="income_earned_by">
<mat-option>Select</mat-option>
<mat-option value="{{person.applicant_id}}" *ngFor="let person of incomeEarnedBy">
@ -71,37 +78,39 @@
</mat-option>
<mat-option value="others">Others</mat-option>
</mat-select> -->
<mat-select multiple placeholder="Income earned by" formControlName="income_earned_by"
[compareWith]="compareObjects" (selectionChange)="getOtherIncomeEarnedBy($event.value,i)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
<mat-select multiple placeholder="Income earned by" formControlName="income_earned_by"
[compareWith]="compareObjects" (selectionChange)="getOtherIncomeEarnedBy($event.value,i)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="isIncomeEarnedBy[i]">
<input matInput autocomplete="off" placeholder="Specify Income earned by"
formControlName="others_income_earned_by">
formControlName="others_income_earned_by">
</mat-form-field>
<mat-form-field style="width:45%">
<input matInput autocomplete="off" placeholder="Amount" formControlName="amount" OnlyNumber type="text" (keyup)="inWords($event,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('amount').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
<input matInput autocomplete="off" placeholder="Amount" formControlName="amount"
OnlyNumber type="text" (keyup)="inWords($event,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('amount').value != ''">{{"&#8377;"}}
{{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select placeholder="Frequency" formControlName="frequency">
<mat-option>Select</mat-option>
<mat-option value="{{frq.frequency_id}}" *ngFor="let frq of frequencyData">{{frq.name}}</mat-option>
</mat-select>
<mat-select placeholder="Frequency" formControlName="frequency">
<mat-option>Select</mat-option>
<mat-option value="{{frq.frequency_id}}" *ngFor="let frq of frequencyData">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<!-- {{otherIncomeForm.controls.frequency.value}} -->
<mat-form-field style="width:45%" *ngIf="details.get('frequency').value == 1">
<input matInput autocomplete="off" placeholder="Specify Frequency"
formControlName="others_frequency">
<input matInput autocomplete="off" placeholder="Specify Frequency"
formControlName="others_frequency">
</mat-form-field>
<!-- <button type="button" matTooltip="Delete" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button (click)="deleteIncomeDetails(i)"
*ngIf="i>0">
@ -113,19 +122,21 @@
</button> -->
</mat-card-content>
<mat-card-actions>
<div align="center">
<div align="center">
<button type="button" mat-flat-button (click)="addIncomeDetails()"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Income Details </strong>
matTooltip="Add More" matTooltipPosition="left" color="primary"
*ngIf="last">
<strong>Add More Income Details </strong>
</button>
</div>
<div align="right">
<button type="button" matTooltip="Delete" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button (click)="deleteIncomeDetails(i)"
*ngIf="!last">
<mat-icon>delete</mat-icon>
</div>
<div align="right">
<button type="button" matTooltip="Delete" class="mr-1 mb-1 hover-icon"
matTooltipPosition="above" mat-raised-button mat-icon-button
(click)="deleteIncomeDetails(i)" *ngIf="!last">
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-card-actions>
</div>
</mat-card-actions>
</div>
</div>
</mat-card>
@ -141,96 +152,144 @@
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
@ -240,16 +299,19 @@
</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 autocomplete="off" placeholder="Remarks" formControlName="otherincome_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" type="submit" matTooltip="Save" matTooltipPosition="above" (click)="submitCurrentDetails()"><mat-icon>save</mat-icon></button>
<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 autocomplete="off" placeholder="Remarks" formControlName="otherincome_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" type="submit" matTooltip="Save"
matTooltipPosition="above" (click)="submitCurrentDetails()">
<mat-icon>save</mat-icon>
</button>
</div>
</div>
</mat-dialog-actions>
</form>
@ -259,21 +321,21 @@
<!--<mat-card style="padding: 12px;">-->
<!--<form [formGroup]="otherIncomeForm" class="address">-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Other Income"-->
<!--formControlName="other_income">-->
<!--<mat-option value="Yes">Yes</mat-option>-->
<!--<mat-option value="No">No</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<mat-card *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'">-->
<!--<mat-card-header>-->
<!--<p>Loan Details<p>-->
<!--</mat-card-header>-->
<!--<div formArrayName="income_details">-->
<!--<div *ngFor="let details of otherIncomeForm.get('income_details').controls; let i=index"-->
<!--[formGroupName]="i">-->
<!--<mat-card-content class="matcard">-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Other Income"-->
<!--formControlName="other_income">-->
<!--<mat-option value="Yes">Yes</mat-option>-->
<!--<mat-option value="No">No</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<mat-card *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'">-->
<!--<mat-card-header>-->
<!--<p>Loan Details<p>-->
<!--</mat-card-header>-->
<!--<div formArrayName="income_details">-->
<!--<div *ngFor="let details of otherIncomeForm.get('income_details').controls; let i=index"-->
<!--[formGroupName]="i">-->
<!--<mat-card-content class="matcard">-->
<!--<mat-card style="min-height: 550px;">
<mat-card-content>
@ -287,34 +349,34 @@
</mat-select>
</mat-form-field>-->
<!--<mat-form-field>-->
<!--<input matInput autocomplete="off" placeholder="Amount" formControlName="amount">-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Frequency" formControlName="frequency">-->
<!--<mat-option value="{{frq.frequency_id}}" *ngFor="let frq of frequencyData">{{frq.name}}</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<button type="button" mat-raised-button mat-icon-button (click)="addIncomeDetails()"-->
<!--*ngIf="i==0">-->
<!--<mat-icon>add</mat-icon>-->
<!--</button>-->
<!--<button type="button" mat-raised-button mat-icon-button (click)="deleteIncomeDetails(i)"-->
<!--*ngIf="i>0">-->
<!--<mat-icon>close</mat-icon>-->
<!--</button>-->
<!--</mat-card-content>-->
<!--</div>-->
<!--</div>-->
<!--</mat-card>-->
<!--<mat-form-field>-->
<!--<input matInput autocomplete="off" placeholder="Remarks" formControlName="otherincome_remarks">-->
<!--</mat-form-field>-->
<!--<button mat-raised-button type="submit" class="button" (click)="submitCurrentDetails()">Submit</button>-->
<!--<mat-form-field>-->
<!--<input matInput autocomplete="off" placeholder="Amount" formControlName="amount">-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Frequency" formControlName="frequency">-->
<!--<mat-option value="{{frq.frequency_id}}" *ngFor="let frq of frequencyData">{{frq.name}}</mat-option>-->
<!--</mat-select>-->
<!--</mat-form-field>-->
<!--<button type="button" mat-raised-button mat-icon-button (click)="addIncomeDetails()"-->
<!--*ngIf="i==0">-->
<!--<mat-icon>add</mat-icon>-->
<!--</button>-->
<!--<button type="button" mat-raised-button mat-icon-button (click)="deleteIncomeDetails(i)"-->
<!--*ngIf="i>0">-->
<!--<mat-icon>close</mat-icon>-->
<!--</button>-->
<!--</mat-card-content>-->
<!--</div>-->
<!--</div>-->
<!--</mat-card>-->
<!--<mat-form-field>-->
<!--<input matInput autocomplete="off" placeholder="Remarks" formControlName="otherincome_remarks">-->
<!--</mat-form-field>-->
<!--<button mat-raised-button type="submit" class="button" (click)="submitCurrentDetails()">Submit</button>-->
<!--</form>-->
<!--</mat-card>-->
<!--<mat-card *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'">
<!--<mat-card *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'">
<mat-card-header>
<p>Income Details<p>
</mat-card-header>
@ -333,7 +395,7 @@
<mat-option value="agricultural_income">Agricultural Income</mat-option>
<mat-option value="dividend_income">Dividend Income</mat-option>
<mat-option value="others">Others</mat-option> -->
<!-- </mat-select>
<!-- </mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('source').value == 5 ">
<input matInput autocomplete="off" placeholder="Specify Others Source"
@ -349,9 +411,9 @@
</mat-select> --
</mat-form-field>-->
<!-- {{otherIncomeForm.controls.frequency.value}} -->
<!-- {{otherIncomeForm.controls.frequency.value}} -->
<!-- <mat-form-field *ngIf="details.get('frequency').value == 8">
<!-- <mat-form-field *ngIf="details.get('frequency').value == 8">
<input matInput autocomplete="off" placeholder="Specify Others Frequency"
formControlName="others_frequency">
</mat-form-field>

View File

@ -22,7 +22,7 @@ import {
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { RentalVerificationComponent } from './../rental-verification/rental-verification.component';
@ -38,99 +38,98 @@ export class OtherIncomeComponent implements OnInit {
lender_applicant_id: any;
main_applicant: any;
pageTitle: string = "Other Income Details";
loadDataStatus: boolean=true;
loadDataStatus: boolean = true;
// @Input() pdid: number;
// @Input() form_id: number;
pdid : string;
form_id:number;
pdid: string;
form_id: number;
public otherIncomeForm: FormGroup;
private notifier: NotifierService;
frequencyData: any = [];
sourceData : any = [];
amtInwords : any = [];
applicants : any = [];
incomeEarnedBy : any = [];
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
isIncomeEarnedBy: any=[];
sourceData: any = [];
amtInwords: any = [];
applicants: any = [];
incomeEarnedBy: any = [];
existCompanyList: any = [];
mergeCompanyApplicant: any = [];
isIncomeEarnedBy: any = [];
// stringArr = [];
constructor(notifier: NotifierService,
private fb: FormBuilder,
private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialog: MatDialog,
private dialogRef: MatDialogRef<OtherIncomeComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any)
{
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 9;
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(val=>val.applicant_type==0 || val.applicant_type==1);
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
}
private fb: FormBuilder,
private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialog: MatDialog,
private dialogRef: MatDialogRef<OtherIncomeComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 9;
this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(val => val.applicant_type == 0 || val.applicant_type == 1);
this.applicants.push({ 'pd_co_applicant_id': '0', 'applicant_name': 'Others' });
}
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,
}
};
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,
}
};
ngOnInit() {
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data => {
if (data.dataStatus) {
this.existCompanyList = data.records.filter(val => val.is_active === true);
this.existCompanyList = data.records.filter(val => val.is_active === true);
}
// get company list
let modifyCompanyList: any = [];
if (this.existCompanyList.length > 0) {
let modifyCompanyList: any = [];
if (this.existCompanyList.length > 0) {
modifyCompanyList = this.existCompanyList.map(element => {
return { id: element.company_order_id.toString(), name: element.company_name, group_id: 1 };
return { id: element.company_order_id.toString(), name: element.company_name, group_id: 1 };
});
this.mergeCompanyApplicant.push({ groupName: 'COMPANIES', groupValues: modifyCompanyList })
}
}
// get applicant list
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
let modifyApplicantList: any = [];
if (this.applicants.length > 0) {
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
return { id: element.pd_co_applicant_id, name: element.applicant_name, group_id: 2 };
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
this.mergeCompanyApplicant.push({ groupName: 'APPLICANTS', groupValues: modifyApplicantList })
}
}
})
})
this.getFrequency();
this.getSourceOtherIncome();
this.initOtherincomeForm();
this._pd.getAllPersonsName(this.pdid).subscribe(data => {
if(data.dataStatus == true){
this.incomeEarnedBy = data.record;
if (data.dataStatus == true) {
this.incomeEarnedBy = data.record;
}
});
@ -146,20 +145,20 @@ public viewerOptions: any = {
this.otherIncomeForm.controls['otherincome_remarks'].setValue(value.records.otherincome_remarks);
if (value.records.other_income == 'Yes') {
var result = Object.keys(value.records.income_details).map(function(key) {
return value.records.income_details[key];
});
if (result.length > 0) {
result.forEach((val,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(val.amount);
// this.getOtherIncomeEarnedBy(val.income_earned_by,index);
control.push(this.createDetail());
this.getOtherIncomeEarnedBy(val.income_earned_by,index);
var result = Object.keys(value.records.income_details).map(function (key) {
return value.records.income_details[key];
});
this.otherIncomeForm.controls['income_details'].setValue(result);
} else {
// control.push(this.createDetail());
}
if (result.length > 0) {
result.forEach((val, index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(val.amount);
// this.getOtherIncomeEarnedBy(val.income_earned_by,index);
control.push(this.createDetail());
this.getOtherIncomeEarnedBy(val.income_earned_by, index);
});
this.otherIncomeForm.controls['income_details'].setValue(result);
} else {
// control.push(this.createDetail());
}
}
} else {
//control.push(this.createDetail());
@ -186,13 +185,13 @@ public viewerOptions: any = {
createDetail() {
return this.fb.group({
source: [''],
others_source : [''],
address : [''],
income_earned_by:[''],
others_income_earned_by:[''],
others_source: [''],
address: [''],
income_earned_by: [''],
others_income_earned_by: [''],
amount: [''],
frequency: [''],
others_frequency : ['']
others_frequency: ['']
});
}
@ -216,13 +215,13 @@ public viewerOptions: any = {
this.sourceData.push(val);
}
})
if(this.customer_segment_abbr == 'SE-RI'){
if (this.customer_segment_abbr == 'SE-RI') {
let inx = this.sourceData.map(data => data.name).indexOf("Rental Income")
/** -X- Please NOTE THIS :
* inx is '-1' -> this will remove the last item from array
* so that If Condition is given. */
if (inx !== -1) {
this.sourceData.splice(this.sourceData.map(data => data.name).indexOf("Rental Income"), 1);
this.sourceData.splice(this.sourceData.map(data => data.name).indexOf("Rental Income"), 1);
}
}
});
@ -238,7 +237,7 @@ public viewerOptions: any = {
submitCurrentDetails() {
if (!this.otherIncomeForm.valid) {
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
return;
}
let records: any = {};
records.pdid = this.pdid;
@ -252,14 +251,14 @@ public viewerOptions: any = {
}
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
if (data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
setTimeout(() => {
this.dialogRef.close();
},3000);
}, 3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -269,19 +268,19 @@ public viewerOptions: any = {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({onlySelf: true});
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
}
});
}
/** Amount InWords */
inWords(e,i){
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
}
/** Amount InWords */
inWords(e, i) {
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
}
Toview(){
Toview() {
// alert('Rental Info ');
// const dialogRef = this.dialog.open(RentalInfoComponent, {
// data: {}
@ -291,55 +290,54 @@ public viewerOptions: any = {
// });
const dialogRef = this.dialog.open(RentalVerificationComponent, {
data: this.pd_all_details,
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.getCompanyListForBusiness();
});
}
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
getOtherIncomeEarnedBy(value,i) {
// console.log('value',value,'I',i);
let Ctrls = <FormArray>this.otherIncomeForm.controls['income_details'];
// console.log('ParCtrls',Ctrls);
let ChdCtrls:any = <FormArray>Ctrls.controls[i];
// console.log('ChdCtrls',ChdCtrls);
let Avaliablity = 1;
console.log('val',value);
if(value.length>0){
value.forEach(option => {
if(option.id == 0 && option.group_id == 2){
Avaliablity = option.id;
}
});
}
if(Avaliablity == 0){
// console.log('if Avaliablity',Avaliablity);
ChdCtrls.controls.others_income_earned_by.setValidators([Validators.required]);
this.isIncomeEarnedBy[i] = true;
}else if(Avaliablity == 1){
// console.log('else Avaliablity',Avaliablity);
// console.log('esle this.isIncomeEarnedBy[ParInx]',this.isIncomeEarnedBy[i]);
ChdCtrls.controls.others_income_earned_by.setValue('');
ChdCtrls.controls.others_income_earned_by.clearValidators();
this.isIncomeEarnedBy[i] = false;
// console.log('else this.isIncomeEarnedBy[ParInx]',this.isIncomeEarnedBy[i]);
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.getCompanyListForBusiness();
});
}
ChdCtrls.controls.others_income_earned_by.updateValueAndValidity();
}
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if (o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
getOtherIncomeEarnedBy(value, i) {
let Ctrls = <FormArray>this.otherIncomeForm.controls['income_details'];
let ChdCtrls: any = <FormArray>Ctrls.controls[i];
let Avaliablity = 1;
if (value.length > 0) {
value.forEach(option => {
if (option.id == 0 && option.group_id == 2) {
Avaliablity = option.id;
}
});
}
if (Avaliablity == 0) {
ChdCtrls.controls.others_income_earned_by.setValidators([Validators.required]);
this.isIncomeEarnedBy[i] = true;
} else if (Avaliablity == 1) {
ChdCtrls.controls.others_income_earned_by.setValue('');
ChdCtrls.controls.others_income_earned_by.clearValidators();
this.isIncomeEarnedBy[i] = false;
}
ChdCtrls.controls.others_income_earned_by.updateValueAndValidity();
}
}

View File

@ -60,7 +60,7 @@ export class RentalVerificationComponent implements OnInit {
}
};
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<RentalVerificationComponent>) {
console.log('data',data);
this.pdid = this.data.pdmaster_details.pd_id;
this.notifier = notifier;
this.form_id = 17;

View File

@ -1,417 +1,544 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{pageTitle}}
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<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]="stockForms" (submit)="submitDetails($event); false;">
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card *ngIf="manufacturingForm">
<h5 class="highlight" style="margin: 12px;">Manufacturing Stock Details</h5>
<div formArrayName="manufacturing_details">
<div *ngFor="let md of stockForms.controls.manufacturing_details['controls']; let i=index" [formGroupName]="i">
<span formArrayName="manufacturing_raw_materials">
<div *ngFor="let mrm of md.controls.manufacturing_raw_materials['controls']; let a=index; let last=last" [formGroupName]="a">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Raw Material #{{a+1}} </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="raw_name" >
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="stock_observed" (selectionChange)="checkComments($event.value,1,a)">
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="mrm.get('stock_observed').value == 'yes'" >
<form [formGroup]="stockForms" (submit)="submitDetails($event); false;">
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card *ngIf="manufacturingForm">
<h5 class="highlight" style="margin: 12px;">Manufacturing Stock Details</h5>
<div formArrayName="manufacturing_details">
<div *ngFor="let md of stockForms.controls.manufacturing_details['controls']; let i=index"
[formGroupName]="i">
<span formArrayName="manufacturing_raw_materials">
<div *ngFor="let mrm of md.controls.manufacturing_raw_materials['controls']; let a=index; let last=last"
[formGroupName]="a">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Raw Material #{{a+1}} </i>
</mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="raw_quantity" OnlyNumber type="text">
<input matInput autocomplete="off" placeholder="Name"
formControlName="raw_name">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Measurement"
formControlName="raw_uom">
<mat-option>Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
<mat-select placeholder="Stock" formControlName="stock_observed"
(selectionChange)="checkComments($event.value,1,a)">
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mrm.get('raw_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="raw_value" OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{mrm.get('raw_value').value | numberToWords}} Only</mat-hint>
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteRawMaterials(a,1)"
matTooltip="Delete Raw Materials" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="md.controls.manufacturing_raw_materials.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addRawMaterials(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Raw Materials </strong>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</span>
<span *ngIf="RMCommentCard">
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw">
<mat-option>Select</mat-option>
<mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" style="width: 90%" *ngIf="md.get('is_sufficiant_raw').value == 'no'">
<mat-label> <i>Please comment on the stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea>
</mat-form-field>
</span>
<div formArrayName="manufacturing_finished_goods">
<div *ngFor="let mfg of md.controls.manufacturing_finished_goods['controls']; let b=index;let last=last" [formGroupName]="b">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{b+1}} </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="goods_observed" (selectionChange)="checkComments($event.value,2,b)">
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="mfg.get('goods_observed').value == 'yes'" >
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" OnlyNumber type="text">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Measurement"
formControlName="goods_uom" >
<mat-option>Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mfg.get('goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{mfg.get('goods_value').value | numberToWords}} Only</mat-hint>
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(b,1)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="md.controls.manufacturing_finished_goods.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addGoods(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</div>
</mat-card>
<mat-card *ngIf="retailForm">
<h5 class="highlight" style="margin: 12px;">Retail Trading Details</h5>
<div formArrayName="retail_details">
<div *ngFor="let rd of stockForms.controls.retail_details['controls']; let j=index" [formGroupName]="j">
<div formArrayName="retail_traded_goods">
<div *ngFor="let item of rd.controls.retail_traded_goods['controls']; let e=index;let last =last" [formGroupName]="e">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{e+1}} </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="traded_goods_observed" (selectionChange)="checkComments($event.value,3,e)">
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="item.get('traded_goods_observed').value == 'yes'" >
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" OnlyNumber type="text">
</mat-form-field>
<mat-form-field style="width:30%">
<span *ngIf="mrm.get('stock_observed').value == 'yes'">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity"
formControlName="raw_quantity" OnlyNumber type="text">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Measurement"
formControlName="traded_goods_uom" >
<mat-option>Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
formControlName="raw_uom">
<mat-option>Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="item.get('traded_goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" >
<mat-form-field *ngIf="mrm.get('raw_uom').value == 1"
style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM"
formControlName="other_uom">
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed"
formControlName="raw_value" OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}}
{{mrm.get('raw_value').value | numberToWords}}
Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{item.get('estimated_traded_goods_value').value | numberToWords}} Only</mat-hint>
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(e,1)"
matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="rd.controls.retail_traded_goods.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</div>
</mat-card>
<mat-card *ngIf="tradingForm">
<h5 class="highlight" style="margin: 12px;">Wholesale Trading Details</h5>
<div formArrayName="trade_details">
<div *ngFor="let td of stockForms.controls.trade_details['controls']; let k=index" [formGroupName]="k">
<div formArrayName="trading_traded_goods">
<div *ngFor="let tradetg of td.controls.trading_traded_goods['controls']; let g=index;let last = last" [formGroupName]="g">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{g+1}} </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="traded_goods_observed" (selectionChange)="checkComments($event.value,4,g)">
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No stock observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="tradetg.get('traded_goods_observed').value == 'yes'" >
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" OnlyNumber type="text">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Measurement"
formControlName="traded_goods_uom" >
<mat-option>Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradetg.get('traded_goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{tradetg.get('estimated_traded_goods_value').value | numberToWords}} Only</mat-hint>
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions>
<div align="center">
<div align="right">
<button type="button" mat-raised-button mat-icon-button
(click)="deleteRawMaterials(a,1)" matTooltip="Delete Raw Materials"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon"
*ngIf="md.controls.manufacturing_raw_materials.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addRawMaterials(1)"
matTooltip="Add More" matTooltipPosition="left"
color="primary" *ngIf="last">
<strong>Add More Raw Materials </strong>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</span>
<span *ngIf="RMCommentCard">
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations"
formControlName="is_sufficiant_raw">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" style="width: 90%" *ngIf="md.get('is_sufficiant_raw').value == 'no'">
<mat-label> <i>Please comment on the stock level observed?</i>
</mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed"
formControlName="rawmaterial_remarks"></textarea>
</mat-form-field>
</span>
<div formArrayName="manufacturing_finished_goods">
<div *ngFor="let mfg of md.controls.manufacturing_finished_goods['controls']; let b=index;let last=last"
[formGroupName]="b">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{b+1}} </i>
</mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name"
formControlName="goods_name">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="goods_observed"
(selectionChange)="checkComments($event.value,2,b)">
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="mfg.get('goods_observed').value == 'yes'">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity"
formControlName="goods_quantity" OnlyNumber
type="text">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Measurement"
formControlName="goods_uom">
<mat-option>Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mfg.get('goods_uom').value == 1"
style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM"
formControlName="goods_other_uom">
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed"
formControlName="goods_value" OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}}
{{mfg.get('goods_value').value |
numberToWords}} Only</mat-hint>
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button
(click)="deleteGoods(b,1)" matTooltip="Delete"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon"
*ngIf="md.controls.manufacturing_finished_goods.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addGoods(1)"
matTooltip="Add More" matTooltipPosition="left"
color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</div>
</mat-card>
<mat-card *ngIf="retailForm">
<h5 class="highlight" style="margin: 12px;">Retail Trading Details</h5>
<div formArrayName="retail_details">
<div *ngFor="let rd of stockForms.controls.retail_details['controls']; let j=index"
[formGroupName]="j">
<div formArrayName="retail_traded_goods">
<div *ngFor="let item of rd.controls.retail_traded_goods['controls']; let e=index;let last =last"
[formGroupName]="e">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{e+1}} </i>
</mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name"
formControlName="traded_goods_name">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="traded_goods_observed"
(selectionChange)="checkComments($event.value,3,e)">
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="item.get('traded_goods_observed').value == 'yes'">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity"
formControlName="traded_goods_quantity"
OnlyNumber type="text">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Measurement"
formControlName="traded_goods_uom">
<mat-option>Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="item.get('traded_goods_uom').value == 1"
style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM"
formControlName="traded_goods_other_uom">
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed"
formControlName="estimated_traded_goods_value"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}}
{{item.get('estimated_traded_goods_value').value
| numberToWords}} Only</mat-hint>
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button
(click)="deleteTradedGoods(e,1)" matTooltip="Delete Traded Goods"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon"
*ngIf="rd.controls.retail_traded_goods.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</div>
<div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(1)"
matTooltip="Add More" matTooltipPosition="left"
color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</div>
</mat-card>
<mat-card *ngIf="tradingForm">
<h5 class="highlight" style="margin: 12px;">Wholesale Trading Details</h5>
<div formArrayName="trade_details">
<div *ngFor="let td of stockForms.controls.trade_details['controls']; let k=index"
[formGroupName]="k">
<div formArrayName="trading_traded_goods">
<div *ngFor="let tradetg of td.controls.trading_traded_goods['controls']; let g=index;let last = last"
[formGroupName]="g">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{g+1}} </i>
</mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name"
formControlName="traded_goods_name">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="traded_goods_observed"
(selectionChange)="checkComments($event.value,4,g)">
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No stock observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="tradetg.get('traded_goods_observed').value == 'yes'">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity"
formControlName="traded_goods_quantity"
OnlyNumber type="text">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Measurement"
formControlName="traded_goods_uom">
<mat-option>Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradetg.get('traded_goods_uom').value == 1"
style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM"
formControlName="traded_goods_other_uom">
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed"
formControlName="estimated_traded_goods_value"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}}
{{tradetg.get('estimated_traded_goods_value').value
| numberToWords}} Only</mat-hint>
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(2)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong>
matTooltip="Add More" matTooltipPosition="left"
color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong>
</button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,2)"
matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="td.controls.trading_traded_goods.controls.length>1">
<mat-icon>delete</mat-icon>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button
(click)="deleteTradedGoods(g,2)" matTooltip="Delete Traded Goods"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon"
*ngIf="td.controls.trading_traded_goods.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</div>
</mat-card>
<div *ngIf="TGCommentCard">
<br>
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of finished / traded goods observed, sufficient considering the size of operations"
formControlName="is_sufficiant_finished_and_traded_goods">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" style="width: 90%" *ngIf="this.stockForms.controls.is_sufficiant_finished_and_traded_goods.value == 'no'">
<mat-label> <i>Please comment on the stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed"
formControlName="finished_and_traded_goods_remarks"></textarea>
</mat-form-field>
</div>
<mat-card *ngIf="serviceProviderForm">
<!-- <mat-card-header>
<p>Service Provider</p>
</mat-card-header> -->
<h5 class="highlight" style="margin: 12px;">Service Provider</h5>
<div style="text-align: center; margin: 12px;">Service Provider Details Not
applicable here !!</div>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1"
alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2"
alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3"
alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2"
alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3"
alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1"
alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50"
fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
<span class="d-block">version_111</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-card>
</mat-tab-group>
</mat-dialog-content>
<div *ngIf="TGCommentCard">
<br>
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of finished / traded goods observed, sufficient considering the size of operations" formControlName="is_sufficiant_finished_and_traded_goods">
<mat-option>Select</mat-option>
<mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" style="width: 90%" *ngIf="this.stockForms.controls.is_sufficiant_finished_and_traded_goods.value == 'no'">
<mat-label> <i>Please comment on the stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="finished_and_traded_goods_remarks"></textarea>
</mat-form-field>
</div>
<mat-card *ngIf="serviceProviderForm">
<!-- <mat-card-header>
<p>Service Provider</p>
</mat-card-header> -->
<h5 class="highlight" style="margin: 12px;">Service Provider</h5>
<div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</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-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label class="highlight"> <i>Remarks</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="stock_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>
</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>
</form>
</div>
{{ errorMessage }}
<!-- <div *ngIf="!noRecordsFound"> <i> {{ errorMessage }} </i> </div> -->
<div *ngIf="!noRecordsFound" align="center"> <i> Fill Business Form First! / No Company Found at this ID {{company_id}}! .... </i> </div>
<notifier-container></notifier-container>
<div *ngIf="!noRecordsFound" align="center"> <i> Fill Business Form First! / No Company Found at this ID
{{company_id}}! .... </i> </div>
<notifier-container></notifier-container>

View File

@ -1,11 +1,13 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{pageTitle}}
</div>
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{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>
<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;">
@ -14,9 +16,11 @@
<mat-card *ngIf="manufacturingForm">
<h5 style="margin: 12px;padding:10px !important;">Manufacturing Product Details</h5>
<div formArrayName="manufacturing_details">
<div *ngFor="let item of _supplierQuesFrom.controls.manufacturing_details['controls']; let i=index" [formGroupName]="i">
<div *ngFor="let item of _supplierQuesFrom.controls.manufacturing_details['controls']; let i=index"
[formGroupName]="i">
<div formArrayName="main_raw_materials">
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index" [formGroupName]="l">
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index"
[formGroupName]="l">
<mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Raw Material #{{l+1}}</h6>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -29,95 +33,110 @@
</div>
<div fxLayout="row nowrap">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,1)">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"
(selectionChange)="selectedPersonDesignation(items,$event.value,1)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
{{comrelShip.name}}
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Mobile Number" autocomplete="off" formControlName="manufacturing_contact_person_mobile_number" OnlyNumber type="text" maxlength="10">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field>
<mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Contact Person Landline Number" formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<!-- //(selectionChange)="selectedPM($event)" -->
<!-- <mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type">
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Mobile Number" autocomplete="off"
formControlName="manufacturing_contact_person_mobile_number" OnlyNumber
type="text" maxlength="10">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field>
<mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode"
type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Contact Person Landline Number"
formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<!-- //(selectionChange)="selectedPM($event)" -->
<!-- <mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field> -->
<mat-select placeholder="Payment Terms" formControlName="manufacturing_payment_type" (selectionChange)="selectedPaymentTerms(items,$event.value,1);checkCard($event.value,1,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
<mat-select placeholder="Payment Terms" formControlName="manufacturing_payment_type"
(selectionChange)="selectedPaymentTerms(items,$event.value,1);checkCard($event.value,1,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="manufacturing_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment made in Cash.">Payment made in Cash.</mat-option>
<mat-option value="Payment made through Banking channels.">Payment made through Banking channels.</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="manufacturing_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment made in Cash.">Payment made in Cash.</mat-option>
<mat-option value="Payment made through Banking channels.">Payment made
through Banking channels.</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-form-field>
</div>
<div fxLayout="row nowrap" style="padding-left: 2%;" *ngIf="items.get('manufacturing_payment_type').value == 3">
<mat-label>No.of days of Credit Provided by Supplier </mat-label>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days From" formControlName="manufacturing_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days To" formControlName="manufacturing_credit_days_to" type="number">
</mat-form-field>
</div>
<div fxLayout="row nowrap" style="padding-left: 2%;" *ngIf="items.get('manufacturing_payment_type').value == 3">
<mat-label>No.of days of Credit Provided by Supplier </mat-label>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days From" formControlName="manufacturing_credit_days_from"
type="number">
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days To" formControlName="manufacturing_credit_days_to"
type="number">
</mat-form-field>
</div>
<div align="end">
<span *ngIf="item.controls.main_raw_materials.controls.length > 1" (click)="removeRawMaterials(l)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon"
color="primary" matTooltip="Delete" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</span>
</div>
</mat-card>
</div>
</div>
<div fxLayout="row">
<div fxFlex="100" align="center">
<button color="primary" mat-flat-button matTooltip="Add More" matTooltipPosition="above" type="button"
class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><strong>Add More Supplier</strong></button>
</div>
<div fxLayout="row">
<div fxFlex="100" align="center">
<button color="primary" mat-flat-button matTooltip="Add More" matTooltipPosition="above"
type="button" class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><strong>Add
More Supplier</strong></button>
</div>
<div fxLayout="row" *ngIf="mfgCreditCardFlag">
</div>
<div fxLayout="row" *ngIf="mfgCreditCardFlag">
<mat-form-field style="width: 100%">
<input matInput placeholder="What % of Total Purchase is Done on Credit?" formControlName="main_raw_materials_total_payments_percent_on_credit"
type="number" autocomplete="off" OnlyNumber type="text" maxlength="3">
<input matInput placeholder="What % of Total Purchase is Done on Credit?"
formControlName="main_raw_materials_total_payments_percent_on_credit" type="number"
autocomplete="off" OnlyNumber type="text" maxlength="3">
</mat-form-field>
</div>
@ -127,9 +146,11 @@
<mat-card *ngIf="tradingForm">
<h5 style="margin: 12px;padding:10px !important;">Trading Product Details</h5>
<div formArrayName="trade_details">
<div *ngFor="let item of _supplierQuesFrom.controls.trade_details['controls']; let i=index" [formGroupName]="i">
<div *ngFor="let item of _supplierQuesFrom.controls.trade_details['controls']; let i=index"
[formGroupName]="i">
<div formArrayName="trading_products">
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index" [formGroupName]="l">
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index"
[formGroupName]="l">
<mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Trading Product #{{l+1}}</h6>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -138,103 +159,120 @@
</mat-form-field> -->
<mat-form-field style="width: 45%">
<mat-select placeholder="Trading Product Name" formControlName="trade_product_name">
<mat-option *ngFor="let pm of m_tradingProducts" [value]="pm.name">{{ pm.name }}</mat-option>
<mat-option *ngFor="let pm of m_tradingProducts" [value]="pm.name">{{
pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<input matInput placeholder="Supplier Name" formControlName="trade_supplier_name">
</mat-form-field>
</div>
<div fxLayout="row nowrap">
<div fxLayout="row nowrap">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name" maxlength="10">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name"
maxlength="10">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"
(selectionChange)="selectedPersonDesignation(items,$event.value,2)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Mobile Number" autocomplete="off" formControlName="trade_product_contact_person_mobile_number" OnlyNumber type="text" maxlength="10">
<input matInput placeholder="Contact Person Mobile Number" autocomplete="off"
formControlName="trade_product_contact_person_mobile_number" OnlyNumber
type="text" maxlength="10">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field>
<mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode"
type="text" OnlyNumber type="text">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Contact Person Landline Number" formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
<input matInput autocomplete="off" placeholder="Contact Person Landline Number"
formControlName="person_landline" type="text" OnlyNumber type="text">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<!-- <mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="trade_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> -->
<mat-select placeholder="Payment Terms" formControlName="trade_product_payment_type" (selectionChange)="selectedPaymentTerms(items,$event.value,2);checkCard($event.value,2,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
<mat-select placeholder="Payment Terms" formControlName="trade_product_payment_type"
(selectionChange)="selectedPaymentTerms(items,$event.value,2);checkCard($event.value,2,l);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="trade_product_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment made in Cash.">Payment made in Cash.</mat-option>
<mat-option value="Payment made through Banking channels.">Payment made through Banking channels.</mat-option>
</mat-select>
<mat-select placeholder="Payment Mode" formControlName="trade_product_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment made in Cash.">Payment made in Cash.</mat-option>
<mat-option value="Payment made through Banking channels.">Payment made
through Banking channels.</mat-option>
</mat-select>
</mat-form-field>
</div>
<!-- <mat-form-field style="width: 45%" *ngIf="items.get('trade_product_payment_type').value == 3">
</div>
<!-- <mat-form-field style="width: 45%" *ngIf="items.get('trade_product_payment_type').value == 3">
<input matInput placeholder="No.of Days of Credit Provided by Supplier" autocomplete="off" formControlName="trade_product_credit_days" OnlyNumber type="text">
</mat-form-field> -->
<div fxLayout="row nowrap" style="padding-left: 2%;display: none !important;" *ngIf="items.get('trade_product_payment_type').value == 3">
<mat-label>No.of days of Credit Provided by Supplier </mat-label>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days From" formControlName="trade_product_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 25%" >
<input matInput placeholder="Days To" formControlName="trade_product_credit_days_to" type="number">
</mat-form-field>
</div>
<div fxLayout="row nowrap" style="padding-left: 2%;display: none !important;" *ngIf="items.get('trade_product_payment_type').value == 3">
<mat-label>No.of days of Credit Provided by Supplier </mat-label>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days From" formControlName="trade_product_credit_days_from"
type="number">
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Days To" formControlName="trade_product_credit_days_to"
type="number">
</mat-form-field>
</div>
<div align="end">
<span *ngIf="item.controls.trading_products.controls.length > 1" (click)="removeTradingProduct(l)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
</span>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon"
color="primary" matTooltip="Delete" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</span>
</div>
</mat-card>
</div>
</div>
<div fxlayout="row">
<div fxFlex="100" align="center">
<button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above" type="button"
class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><strong>Add More Supplier</strong></button>
</div>
<div fxlayout="row">
<div fxFlex="100" align="center">
<button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above"
type="button" class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><strong>Add
More Supplier</strong></button>
</div>
<div fxlayout="row" *ngIf="trdCreditCardFlag">
</div>
<div fxlayout="row" *ngIf="trdCreditCardFlag">
<mat-form-field style="width: 90%">
<input matInput placeholder="What % of Total Purchase is done on Credit?" formControlName="trading_products_total_payments_percent_on_credit"
type="number" autocomplete="off">
<input matInput placeholder="What % of Total Purchase is done on Credit?"
formControlName="trading_products_total_payments_percent_on_credit" type="number"
autocomplete="off">
</mat-form-field>
</div>
@ -254,13 +292,16 @@
</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>
<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>
<div *ngIf="!noRecordsFound">
<div style="margin: 12px; font-size: 18px;"> {{ errorMessage }} </div>
<div style="margin: 12px; font-size: 18px;"> {{ errorMessage }} </div>
</div>
<notifier-container></notifier-container>

View File

@ -1,25 +1,11 @@
/** Common Imports */
import {
Component,
OnInit,
Inject,
Output, Input
} from '@angular/core';
import { Component,OnInit,Inject,Output, Input } from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray,
} from '@angular/forms';
import { FormBuilder,FormGroup,Validators,FormArray } from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
import { MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
@ -51,8 +37,8 @@ export class SupplierInfoComponent implements OnInit {
public m_paymentType = [];
private notifier: NotifierService;
titleList: any=[];
companyRelationShipList: any=[];
titleList: any = [];
companyRelationShipList: any = [];
constructor(
notifier: NotifierService,
@ -63,7 +49,7 @@ export class SupplierInfoComponent implements OnInit {
this.form_id = 1;
this.company_id = this.pd_all_details.company_id
this.notifier = notifier;
this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ;
this.pageTitle = this.pd_all_details.company_name + ' - ' + this.pageTitle;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
@ -95,50 +81,50 @@ export class SupplierInfoComponent implements OnInit {
ngOnInit() {
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => {
if(data.dataStatus){
// let datas = {
// "profession_name": "Others",
// "type_of_activity": [
// {
// "type_of_activity_id": 1,
// "name": "Manufacturing Details"
// },
// {
// "type_of_activity_id": 2,
// "name": "Retail trading"
// },
// {
// "type_of_activity_id": 4,
// "name": "Service Provider"
// }
// ]
// };
let datas = data.records;
this.initFormLoadDetails(datas.type_of_activity);
this.m_manufacturingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 2 ){return data}}).map(data=> [...data.prodcuts]);
// this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]);
if (data.dataStatus) {
// let datas = {
// "profession_name": "Others",
// "type_of_activity": [
// {
// "type_of_activity_id": 1,
// "name": "Manufacturing Details"
// },
// {
// "type_of_activity_id": 2,
// "name": "Retail trading"
// },
// {
// "type_of_activity_id": 4,
// "name": "Service Provider"
// }
// ]
// };
let datas = data.records;
this.initFormLoadDetails(datas.type_of_activity);
this.m_manufacturingProducts = datas.type_of_activity.filter(data => { if (data.type_of_activity_id == 2) { return data } }).map(data => [...data.prodcuts]);
// this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]);
let api = Object.keys(datas.type_of_activity).map(function (key) {
return datas.type_of_activity[key];
});
if(api.length > 0){
api.forEach(val => {
if (val.type_of_activity_id == 3) {
if(val.prodcuts){
this.m_tradingProducts.push(val.prodcuts);
}
}
if (val.type_of_activity_id == 4) {
if(val.prodcuts){
this.m_tradingProducts.push(val.prodcuts);
}
}
let api = Object.keys(datas.type_of_activity).map(function (key) {
return datas.type_of_activity[key];
});
}
this.m_tradingProducts = [].concat.apply([], this.m_tradingProducts);
if (api.length > 0) {
api.forEach(val => {
if (val.type_of_activity_id == 3) {
if (val.prodcuts) {
this.m_tradingProducts.push(val.prodcuts);
}
}
}else {
if (val.type_of_activity_id == 4) {
if (val.prodcuts) {
this.m_tradingProducts.push(val.prodcuts);
}
}
});
}
this.m_tradingProducts = [].concat.apply([], this.m_tradingProducts);
} else {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
this.errorMessage = data.msg;
@ -152,123 +138,123 @@ export class SupplierInfoComponent implements OnInit {
// this.getM_FreqOfPurchase();
this.getM_PaymentModeType();
// this.getPdSupplierFormDetails();
this.getMasterDetails('COMPANYRELATIONSHIPS',1);
this.getMasterDetails('TITLES',2);
this.getMasterDetails('COMPANYRELATIONSHIPS', 1);
this.getMasterDetails('TITLES', 2);
}
serviceProviderForm: Boolean = false;
initFormLoadDetails(record) {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
params.company_id = this.company_id;
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
params.company_id = this.company_id;
// alert(JSON.stringify(record));
this.pdTrigerService.retriveForm(params).subscribe(
this.pdTrigerService.retriveForm(params).subscribe(
data => {
if(data.dataStatus){
let dataForm = data.records;
if(dataForm !== undefined) {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id == 2);
if(arr.length > 0) {
// let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
// return dataForm.main_raw_materials[key];
// });
if(dataForm.manufacturing_details[0] !== null){
let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials;
this.initManufacturingProductsDetails(api_main_raw_materials);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null);
}
else{
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
}
let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id ==4);
if(arr1.length > 0) {
if(dataForm.trade_details[0] !== null){
// let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
// return dataForm.trading_products[key];
// });
let api_trading_products = dataForm.trade_details[0].trading_products;
this.initTradingProductsDetails(api_trading_products);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null);
}
else{
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
}
this.noRecordsFound = true;
} else {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id == 2);
if(arr.length > 0) {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
let arr1 = record.filter(data => data.type_of_activity_id == 3 || 4);
if(arr1.length > 0) {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);
}
this.noRecordsFound = true;
}
let arr2 = record.filter(data => data.type_of_activity_id == 5);
if(arr2.length > 0) {
this.serviceProviderForm = true;
}
} else {
if (data.dataStatus) {
let dataForm = data.records;
if (dataForm !== undefined) {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: []
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id == 2);
if(arr.length > 0) {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id== 4);
if(arr1.length > 0) {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
let arr2 = record.filter(data => data.type_of_activity_id == 5);
if(arr2.length > 0) {
this.serviceProviderForm = true;
}
pdid: [this.pdid],
formid: ['1'],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) {
// let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
// return dataForm.main_raw_materials[key];
// });
if (dataForm.manufacturing_details[0] !== null) {
let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials;
this.initManufacturingProductsDetails(api_main_raw_materials);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null);
}
else {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
}
let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4);
if (arr1.length > 0) {
if (dataForm.trade_details[0] !== null) {
// let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
// return dataForm.trading_products[key];
// });
let api_trading_products = dataForm.trade_details[0].trading_products;
this.initTradingProductsDetails(api_trading_products);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null);
}
else {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
}
this.noRecordsFound = true;
} else {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
let arr1 = record.filter(data => data.type_of_activity_id == 3 || 4);
if (arr1.length > 0) {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);
}
this.noRecordsFound = true;
}
let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) {
this.serviceProviderForm = true;
}
} else {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: []
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4);
if (arr1.length > 0) {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) {
this.serviceProviderForm = true;
}
this.noRecordsFound = true;
}
}, err => {
}
);
}
);
}
manufacturingForm: Boolean = false;
@ -276,10 +262,10 @@ export class SupplierInfoComponent implements OnInit {
let arr = val.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) {
this.manufacturingForm = true;
return this._formBuilder.group({
main_raw_materials: this._formBuilder.array([]),
main_raw_materials_total_payments_percent_on_credit: []
})
return this._formBuilder.group({
main_raw_materials: this._formBuilder.array([]),
main_raw_materials_total_payments_percent_on_credit: []
})
// }
} else {
return;
@ -301,52 +287,52 @@ export class SupplierInfoComponent implements OnInit {
}
initManufacturingProductsDetails(datas) {
const control = <FormArray>this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if(datas === null){
control.push(this.initManufacturingProducts(null));
} else {
datas.forEach((val,inx) => {
this.checkCard(val.manufacturing_payment_type,1,inx);
control.push(this.initManufacturingProducts(val));
});
}
const control = <FormArray>this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if (datas === null) {
control.push(this.initManufacturingProducts(null));
} else {
datas.forEach((val, inx) => {
this.checkCard(val.manufacturing_payment_type, 1, inx);
control.push(this.initManufacturingProducts(val));
});
}
}
initManufacturingProducts(records) {
if(records === null) {
if (records === null) {
return this._formBuilder.group({
manufacturing_raw_material_name: [''],
manufacturing_supplier_name: [''],
person_title_name:[''],
person_designation:[''],
other_person_designation:[''],
person_title_name: [''],
person_designation: [''],
other_person_designation: [''],
manufacturing_contact_person_name: [''],
manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_contact_person_mobile_number: ['', Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
manufacturing_payment_type: [''],
manufacturing_payment_mode:[''],
manufacturing_payment_mode: [''],
manufacturing_credit_days_from: [''],
manufacturing_credit_days_to:[''],
manufacturing_credit_days_to: [''],
manufacturing_frequency_of_purchase: [''],
person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
person_stdcode: ['', Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
})
} else {
return this._formBuilder.group({
return this._formBuilder.group({
manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null],
manufacturing_supplier_name: [records.manufacturing_supplier_name || null],
person_title_name:[records.person_title_name || null],
person_designation:[records.person_title_name || null],
other_person_designation:[records.other_person_designation || null],
person_title_name: [records.person_title_name || null],
person_designation: [records.person_title_name || null],
other_person_designation: [records.other_person_designation || null],
manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null],
manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null, Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
manufacturing_payment_type: [records.manufacturing_payment_type || null],
manufacturing_payment_mode:[records.manufacturing_payment_mode],
manufacturing_payment_mode: [records.manufacturing_payment_mode],
manufacturing_credit_days_from: [records.manufacturing_credit_days_from || null],
manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null],
manufacturing_credit_days_to: [records.manufacturing_credit_days_to || null],
manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null],
person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
person_stdcode: [records.person_stdcode || null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: [records.person_landline || null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
})
}
}
@ -354,53 +340,53 @@ export class SupplierInfoComponent implements OnInit {
initTradingProductsDetails(datas) {
const control = <FormArray>this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products'];
if(datas === null){
control.push(this.initTradingProducts(null));
} else {
datas.forEach((val,inx) => {
this.checkCard(val.trade_product_payment_type,2,inx);
control.push(this.initTradingProducts(val));
});
}
if (datas === null) {
control.push(this.initTradingProducts(null));
} else {
datas.forEach((val, inx) => {
this.checkCard(val.trade_product_payment_type, 2, inx);
control.push(this.initTradingProducts(val));
});
}
}
initTradingProducts(records) {
if(records === null) {
return this._formBuilder.group({
trade_product_name: [''],
trade_supplier_name: [''],
person_title_name:[''],
person_designation:[''],
other_person_designation:[''],
trade_product_contact_person_name: [''],
trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
person_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
trade_product_payment_type: [''],
trade_product_payment_mode: [''],
trade_product_frequency_of_purchase: [''],
trade_product_credit_days_from: [''],
trade_product_credit_days_to: [''],
})
} else {
return this._formBuilder.group({
trade_product_name: [records.trade_product_name],
person_title_name:[records.person_title_name],
person_designation:[records.person_designation],
other_person_designation:[records.other_person_designation],
trade_supplier_name: [records.trade_supplier_name],
trade_product_contact_person_name: [records.trade_product_contact_person_name],
trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number, Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
person_stdcode:[records.person_stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
trade_product_payment_type: [records.trade_product_payment_type],
trade_product_payment_mode: [records.trade_product_payment_mode],
trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase],
trade_product_credit_days_from: [records.trade_product_credit_days_from],
trade_product_credit_days_to: [records.trade_product_credit_days_to],
})
}
initTradingProducts(records) {
if (records === null) {
return this._formBuilder.group({
trade_product_name: [''],
trade_supplier_name: [''],
person_title_name: [''],
person_designation: [''],
other_person_designation: [''],
trade_product_contact_person_name: [''],
trade_product_contact_person_mobile_number: ['', Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
person_stdcode: [null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
trade_product_payment_type: [''],
trade_product_payment_mode: [''],
trade_product_frequency_of_purchase: [''],
trade_product_credit_days_from: [''],
trade_product_credit_days_to: [''],
})
} else {
return this._formBuilder.group({
trade_product_name: [records.trade_product_name],
person_title_name: [records.person_title_name],
person_designation: [records.person_designation],
other_person_designation: [records.other_person_designation],
trade_supplier_name: [records.trade_supplier_name],
trade_product_contact_person_name: [records.trade_product_contact_person_name],
trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number, Validators.compose([Validators.minLength(10), Validators.maxLength(10)])],
person_stdcode: [records.person_stdcode, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
person_landline: [records.person_landline, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
trade_product_payment_type: [records.trade_product_payment_type],
trade_product_payment_mode: [records.trade_product_payment_mode],
trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase],
trade_product_credit_days_from: [records.trade_product_credit_days_from],
trade_product_credit_days_to: [records.trade_product_credit_days_to],
})
}
}
addMoreRawMaterials(e): void {
// e.stropPropagation();
@ -426,24 +412,24 @@ export class SupplierInfoComponent implements OnInit {
control.removeAt(inx);
}
// get all master details
getMasterDetails(table:string,type:number){
// get all master details
getMasterDetails(table: string, type: number) {
this.pdTrigerService.getAllMasterDatas(table).subscribe(
data => {
if (data.dataStatus) {
if(type==1){
this.companyRelationShipList=data.records;
if (type == 1) {
this.companyRelationShipList = data.records;
// .filter(item => item.name != 'Others');
}
if(type==2){
this.titleList=data.records.filter(val=>val.isactive==1);
if (type == 2) {
this.titleList = data.records.filter(val => val.isactive == 1);
}
}
}, error => this.errorMessage = <any> error);
}, error => this.errorMessage = <any>error);
}
// ==================
@ -495,9 +481,9 @@ export class SupplierInfoComponent implements OnInit {
this.notifier.notify('success', 'Saved Successfully.!');
// this.dialogRef.close();
// alert("sample alert for Saving");
setTimeout(() =>{
setTimeout(() => {
this.dialogRef.close();
},3000);
}, 3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -518,70 +504,71 @@ export class SupplierInfoComponent implements OnInit {
// this._addQuesFrom.reset();
}
selectedPersonDesignation(items,e,flag){
if(flag == 1){
e==1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
selectedPersonDesignation(items, e, flag) {
if (flag == 1) {
e == 1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(), items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
else if(flag == 2){
e==1 ?items.controls['other_person_designation'].setValidators([Validators.required])
:items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
else if (flag == 2) {
e == 1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(), items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
}
mfgCreditCardFlag : boolean = false;
trdCreditCardFlag : boolean = false;
mfgCreditCardFlag: boolean = false;
trdCreditCardFlag: boolean = false;
mfgCounter: any = [];
trdCounter: any = [];
checkCard(e,flag,index){
if(flag == 2 && e==3){
checkCard(e, flag, index) {
if (flag == 2 && e == 3) {
this.trdCounter[index] = 1;
}
else if(flag == 2 && e!=3){
else if (flag == 2 && e != 3) {
this.trdCounter[index] = 0;
}
let TRD = this.trdCounter.reduce((sum, val) => sum + +val, 0);
this.trdCreditCardFlag = TRD > 0 ? true : false ;
this.trdCreditCardFlag = TRD > 0 ? true : false;
if(flag == 1 && e==3){
if (flag == 1 && e == 3) {
this.mfgCounter[index] = 1;
}
else if(flag == 1 && e!=3){
else if (flag == 1 && e != 3) {
this.mfgCounter[index] = 0;
}
let MFG = this.mfgCounter.reduce((sum, val) => sum + +val, 0);
this.mfgCreditCardFlag = MFG > 0 ? true : false ;
this.mfgCreditCardFlag = MFG > 0 ? true : false;
}
selectedPaymentTerms(items,e,flag){
if(flag == 2){
if(e==3){
items.controls['trade_product_credit_days_from'].setValidators([Validators.required]);
items.controls['trade_product_credit_days_to'].setValidators([Validators.required]);
selectedPaymentTerms(items, e, flag) {
if (flag == 2) {
if (e == 3) {
items.controls['trade_product_credit_days_from'].setValidators([Validators.required]);
items.controls['trade_product_credit_days_to'].setValidators([Validators.required]);
}
else{
else {
items.controls['trade_product_credit_days_from'].clearValidators();
items.controls['trade_product_credit_days_from'].setValue('');
items.controls['trade_product_credit_days_to'].clearValidators();
items.controls['trade_product_credit_days_to'].setValue('');
}
items.controls['trade_product_credit_days_from'].updateValueAndValidity();
items.controls['trade_product_credit_days_to'].updateValueAndValidity();
items.controls['trade_product_credit_days_from'].updateValueAndValidity();
items.controls['trade_product_credit_days_to'].updateValueAndValidity();
}
else if(flag == 1){
if(e==3){ items.controls['manufacturing_credit_days_from'].setValidators([Validators.required]);
items.controls['manufacturing_credit_days_to'].setValidators([Validators.required]);
}
else{
else if (flag == 1) {
if (e == 3) {
items.controls['manufacturing_credit_days_from'].setValidators([Validators.required]);
items.controls['manufacturing_credit_days_to'].setValidators([Validators.required]);
}
else {
items.controls['manufacturing_credit_days_from'].clearValidators();
items.controls['manufacturing_credit_days_from'].setValue('');
items.controls['manufacturing_credit_days_to'].clearValidators();
items.controls['manufacturing_credit_days_to'].setValue('');
}
items.controls['manufacturing_credit_days_from'].updateValueAndValidity();
items.controls['manufacturing_credit_days_to'].updateValueAndValidity();
items.controls['manufacturing_credit_days_from'].updateValueAndValidity();
items.controls['manufacturing_credit_days_to'].updateValueAndValidity();
}
}