RENTAL FORM ADDED
This commit is contained in:
parent
98590c363f
commit
c8a2b1840a
28
ng6-seed/package-lock.json
generated
28
ng6-seed/package-lock.json
generated
@ -4294,12 +4294,14 @@
|
|||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@ -4314,17 +4316,20 @@
|
|||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@ -4441,7 +4446,8 @@
|
|||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
@ -4453,6 +4459,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"number-is-nan": "^1.0.0"
|
"number-is-nan": "^1.0.0"
|
||||||
}
|
}
|
||||||
@ -4467,6 +4474,7 @@
|
|||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@ -4474,12 +4482,14 @@
|
|||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "2.2.4",
|
"version": "2.2.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "^5.1.1",
|
"safe-buffer": "^5.1.1",
|
||||||
"yallist": "^3.0.0"
|
"yallist": "^3.0.0"
|
||||||
@ -4498,6 +4508,7 @@
|
|||||||
"version": "0.5.1",
|
"version": "0.5.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "0.0.8"
|
"minimist": "0.0.8"
|
||||||
}
|
}
|
||||||
@ -4578,7 +4589,8 @@
|
|||||||
"number-is-nan": {
|
"number-is-nan": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
@ -4590,6 +4602,7 @@
|
|||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
@ -4711,6 +4724,7 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"code-point-at": "^1.0.0",
|
"code-point-at": "^1.0.0",
|
||||||
"is-fullwidth-code-point": "^1.0.0",
|
"is-fullwidth-code-point": "^1.0.0",
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
<p>Neighbourhood</p>
|
<p>Neighbourhood</p>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<div formArrayName="neighbourhood">
|
<div formArrayName="neighbourhood">
|
||||||
<div *ngFor="let item of addressForm.controls.neighbourhood['controls']; let i=index">
|
<div *ngFor="let item of addressForm.controls.neighbourhood['controls']; let i=index" >
|
||||||
<mat-card-content class="matcard" [formGroup]="item">
|
<mat-card-content class="matcard" [formGroup]="item">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput placeholder="Neighbour Name"
|
<input matInput placeholder="Neighbour Name"
|
||||||
@ -65,7 +65,7 @@
|
|||||||
formControlName="do_you_know">
|
formControlName="do_you_know">
|
||||||
<mat-option value="{{m_neighbourStatus}}"
|
<mat-option value="{{m_neighbourStatus}}"
|
||||||
*ngFor="let m_neighbourStatus of neighbourStatusData">{{m_neighbourStatus}}
|
*ngFor="let m_neighbourStatus of neighbourStatusData">{{m_neighbourStatus}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
|
|||||||
@ -0,0 +1,190 @@
|
|||||||
|
<mat-card style="min-height: 550px;">
|
||||||
|
<mat-card-content>
|
||||||
|
<p>Rental Information Form</p>
|
||||||
|
<form class="address" [formGroup]="rentalForm">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Person met / Shown the Property(if he is not applicant or co-applicant)" formControlName="person_met">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Property Owner" formControlName="property_own">
|
||||||
|
<mat-option value="applicant">Applicant</mat-option>
|
||||||
|
<mat-option value="co_applicant">co-applicant</mat-option>
|
||||||
|
<mat-option value="parental">Parental</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Nature of the let out property" formControlName="nature_property">
|
||||||
|
<mat-option value="residentail/commercial">Residential/commercial</mat-option>
|
||||||
|
<mat-option value="other">other</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
<div formArrayName="rental_home">
|
||||||
|
<mat-accordion
|
||||||
|
*ngFor="let item of rentalForm.controls.rental_home['controls']; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-expansion-panel class="fields" [expanded]="step == i">
|
||||||
|
<mat-expansion-panel-header>
|
||||||
|
<mat-panel-title>
|
||||||
|
<h5>{{i+1}} Rental Home Details</h5>
|
||||||
|
</mat-panel-title>
|
||||||
|
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button *ngIf="i==0"
|
||||||
|
color="primary" style="float: right;" (click)="addProperty($event)">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button *ngIf="i>0"
|
||||||
|
style="float: right;" (click)="deleteProperty(i)">
|
||||||
|
<mat-icon>delete</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-expansion-panel-header>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline" style="width: 100%">
|
||||||
|
<mat-label>Complete address of the property</mat-label>
|
||||||
|
<textarea matInput placeholder="Address" formControlName="complete_add"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Area of the Property(in sq yd or Sq ft)"
|
||||||
|
formControlName="area_of_property">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Structure of the let out property (eg. No of floors in total,G,FF,SF etc, let out floors from them)"
|
||||||
|
formControlName="structure_property">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input type="number" matInput placeholder="Total rooms let out (eg single room,2 BHK, let out rooms on each floor)"
|
||||||
|
formControlName="total_room">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Is Rent agreement available"
|
||||||
|
formControlName="is_rent">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<div *ngIf="item.controls['is_rent'].value == 'yes'">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput [matDatepicker]="picker" formControlName="date_agreement"
|
||||||
|
placeholder="Date of Agreement">
|
||||||
|
<mat-datepicker-toggle matSuffix
|
||||||
|
[for]="picker"></mat-datepicker-toggle>
|
||||||
|
<mat-datepicker #picker></mat-datepicker>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Validity"
|
||||||
|
formControlName="date_validity">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input type="number" matInput placeholder="Rent as per Agreement"
|
||||||
|
formControlName="rent_agreement">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input type="number" matInput placeholder="Actual Rent"
|
||||||
|
formControlName="actual_rent">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Photo of agreement taken ?"
|
||||||
|
formControlName="photo_areegment">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>How is rent received? (Is it in bank or cash, how much in which mode)</p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content>
|
||||||
|
<mat-form-field>
|
||||||
|
<input type="number" matInput placeholder="bank"
|
||||||
|
formControlName="bank">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input type="number" matInput placeholder="Cash"
|
||||||
|
formControlName="cash">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Rent received from each floor and or Rooms (eg FF has 4 rooms, rent per room are Rs 2500, Rs 4000 and Rs 3200 respectively)"
|
||||||
|
formControlName="rent_each_floor">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Total rent received (Total montly rental from property/ies, with break up)"
|
||||||
|
formControlName="total_rent">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Property Paper or other related document to prove ownership (eg. Property registry etc)"
|
||||||
|
formControlName="related_doc_owner">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Details of the tenants (eg Name and Mobile No and other details)</p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="details_tenants">
|
||||||
|
<div *ngFor="let deatil of item.controls.details_tenants['controls']; let idx=index" [formGroupName]="idx">
|
||||||
|
<mat-card-content>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Name"
|
||||||
|
formControlName="name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Mobile No"
|
||||||
|
formControlName="mobile_no">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Tenant Seen"
|
||||||
|
formControlName="tenants_seen">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Tenant confirmed owner"
|
||||||
|
formControlName="tenants_con_owner">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Rent Paid"
|
||||||
|
formControlName="rent_paid">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Staying since"
|
||||||
|
formControlName="staying_since">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button *ngIf="idx==0"
|
||||||
|
color="primary" style="float: right;" (click)="addTenant(i)">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" (click)="deleteTenant(idx, i)" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button *ngIf="idx>0"
|
||||||
|
|
||||||
|
style="float: right;">
|
||||||
|
<mat-icon>delete</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Photogaraphs of the property"
|
||||||
|
formControlName="property_photographs">
|
||||||
|
<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="Third party check of prevailing rent in the neighbour hood (TPC with whom, how much rent quoted)"
|
||||||
|
formControlName="third_party_check">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-expansion-panel>
|
||||||
|
|
||||||
|
</mat-accordion>
|
||||||
|
</div>
|
||||||
|
<div style="text-align: right;" class="pt-1">
|
||||||
|
<button class="mr-1 mb-1 hover-icon" type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="rentalSubmit()"><mat-icon>save</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
width:40%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
mat-form-field {
|
||||||
|
width: 27%;
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.fields mat-form-field {
|
||||||
|
width: 45%;
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
@ -0,0 +1,167 @@
|
|||||||
|
import {Component, OnInit, Input, Output} from '@angular/core';
|
||||||
|
import {FormBuilder, FormGroup, Validators, FormControl, FormArray} from '@angular/forms';
|
||||||
|
import {NotifierService} from 'angular-notifier';
|
||||||
|
import {PdTrigerService} from './../../../../../pd-service/pd-triger.service';
|
||||||
|
import {Key} from 'protractor';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-rental-info',
|
||||||
|
templateUrl: './rental-info.component.html',
|
||||||
|
styleUrls: ['./rental-info.component.scss']
|
||||||
|
})
|
||||||
|
export class RentalInfoComponent implements OnInit {
|
||||||
|
|
||||||
|
// @Input() pdid: string;
|
||||||
|
// @Input() pd_all_details: any;
|
||||||
|
// form_id: number;
|
||||||
|
@Input() pdid: number;
|
||||||
|
@Input() form_id: number;
|
||||||
|
step: number;
|
||||||
|
|
||||||
|
public rentalForm: FormGroup;
|
||||||
|
tenantsList: FormArray;
|
||||||
|
propertyList: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private _fb: FormBuilder, private _pd: PdTrigerService) {
|
||||||
|
this.notifier = notifier;
|
||||||
|
// this.form_id = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.step = 0;
|
||||||
|
this.inintRentalForm();
|
||||||
|
this.createpropertyArray();
|
||||||
|
let params: any = {};
|
||||||
|
params.pd_id = this.pdid;
|
||||||
|
params.pd_form_id = this.form_id;
|
||||||
|
this._pd.retriveForm(params).subscribe(value => {
|
||||||
|
let subArray: any;
|
||||||
|
const control = <FormArray>this.rentalForm.controls['rental_home'];
|
||||||
|
if (value.status == 200) {
|
||||||
|
let rentalinfo = value.records;
|
||||||
|
var result = Object.keys(value.records.rental_home).map(function (key) {
|
||||||
|
return value.records.rental_home[key];
|
||||||
|
});
|
||||||
|
if (result.length == 0) {
|
||||||
|
const control = <FormArray>this.rentalForm.controls['rental_home'];
|
||||||
|
control.push(this.createpropertyArray());
|
||||||
|
} else {
|
||||||
|
result.forEach((datas, index) => {
|
||||||
|
control.push(this.createpropertyArray());
|
||||||
|
const parentControl = <FormGroup>this.rentalForm.controls['rental_home']['controls'][index];
|
||||||
|
const sub = <FormArray>parentControl.controls['details_tenants'];
|
||||||
|
console.log('control', parentControl);
|
||||||
|
subArray = Object.keys(datas.details_tenants).map(function (key) {
|
||||||
|
return datas.details_tenants[key];
|
||||||
|
});
|
||||||
|
if (subArray.length > 0) {
|
||||||
|
subArray.forEach((val) => {
|
||||||
|
console.log('val', val);
|
||||||
|
sub.push(this.createTenatsArray());
|
||||||
|
})
|
||||||
|
sub.removeAt(0);
|
||||||
|
}
|
||||||
|
datas.details_tenants = subArray;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
rentalinfo.rental_home = result;
|
||||||
|
rentalinfo.pdid = this.pdid;
|
||||||
|
rentalinfo.formid = this.form_id;
|
||||||
|
rentalinfo.fk_createdby = this.pdid;
|
||||||
|
this.rentalForm.setValue(rentalinfo);
|
||||||
|
} else {
|
||||||
|
control.push(this.createpropertyArray());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
inintRentalForm() {
|
||||||
|
this.rentalForm = this._fb.group({
|
||||||
|
pdid: this.pdid,
|
||||||
|
formid: this.form_id,
|
||||||
|
fk_createdby: this.pdid,
|
||||||
|
person_met: ['', Validators.compose([Validators.required])],
|
||||||
|
property_own: ['', Validators.compose([Validators.required])],
|
||||||
|
nature_property: ['', Validators.compose([Validators.required])],
|
||||||
|
rental_home: this._fb.array([])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
createpropertyArray() {
|
||||||
|
this.propertyList = this._fb.group({
|
||||||
|
complete_add: ['', Validators.compose([Validators.required])],
|
||||||
|
area_of_property: ['', Validators.compose([Validators.required])],
|
||||||
|
structure_property: ['', Validators.compose([Validators.required])],
|
||||||
|
total_room: ['', Validators.compose([Validators.required])],
|
||||||
|
is_rent: ['', Validators.compose([Validators.required])],
|
||||||
|
date_agreement: [''],
|
||||||
|
date_validity: [''],
|
||||||
|
rent_agreement: [''],
|
||||||
|
actual_rent: [''],
|
||||||
|
photo_areegment: [''],
|
||||||
|
bank: ['', Validators.compose([Validators.required])],
|
||||||
|
cash: ['', Validators.compose([Validators.required])],
|
||||||
|
rent_each_floor: ['', Validators.compose([Validators.required])],
|
||||||
|
total_rent: ['', Validators.compose([Validators.required])],
|
||||||
|
related_doc_owner: ['', Validators.compose([Validators.required])],
|
||||||
|
property_photographs: ['', Validators.compose([Validators.required])],
|
||||||
|
third_party_check: ['', Validators.compose([Validators.required])],
|
||||||
|
details_tenants: this._fb.array([this.createTenatsArray()]),
|
||||||
|
});
|
||||||
|
return this.propertyList;
|
||||||
|
}
|
||||||
|
|
||||||
|
createTenatsArray() {
|
||||||
|
return this._fb.group({
|
||||||
|
name: ['', Validators.compose([Validators.required])],
|
||||||
|
mobile_no: ['', Validators.compose([Validators.required])],
|
||||||
|
tenants_seen: ['', Validators.compose([Validators.required])],
|
||||||
|
tenants_con_owner: ['', Validators.compose([Validators.required])],
|
||||||
|
staying_since: ['', Validators.compose([Validators.required])],
|
||||||
|
rent_paid: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
addProperty(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
const control = <FormArray>this.rentalForm.controls['rental_home'];
|
||||||
|
control.push(this.createpropertyArray());
|
||||||
|
let length = control.length;
|
||||||
|
this.step = length - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteProperty(index) {
|
||||||
|
const control = <FormArray>this.rentalForm.controls['rental_home'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
addTenant(parentIndex:number) {
|
||||||
|
const parentControl = <FormGroup>this.rentalForm.controls['rental_home']['controls'][parentIndex];
|
||||||
|
const control = <FormArray>parentControl.controls['details_tenants'];
|
||||||
|
console.log(parentControl);
|
||||||
|
console.log(control);
|
||||||
|
control.push(this.createTenatsArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteTenant(idx, parentIndex) {
|
||||||
|
const parentControl = <FormGroup>this.rentalForm.controls['rental_home']['controls'][parentIndex];
|
||||||
|
const control = <FormArray>parentControl.controls['details_tenants'];
|
||||||
|
control.removeAt(idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
rentalSubmit() {
|
||||||
|
if (!this.rentalForm.valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log('form', this.rentalForm.value);
|
||||||
|
let records = this.rentalForm.value;
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
}, error => {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -31,9 +31,12 @@
|
|||||||
<mat-list-item class="custm-list-item" (click)="OnSelectDirectForms(formButton)" style="background-color:#e0e0e0">
|
<mat-list-item class="custm-list-item" (click)="OnSelectDirectForms(formButton)" style="background-color:#e0e0e0">
|
||||||
<span class="mt-0">{{ (formButton.form_name.length>17)? (formButton.form_name | slice:0:17)+'..':(formButton.form_name) }}</span>
|
<span class="mt-0">{{ (formButton.form_name.length>17)? (formButton.form_name | slice:0:17)+'..':(formButton.form_name) }}</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
|
|
||||||
</mat-list>
|
</mat-list>
|
||||||
|
<!--<mat-list>-->
|
||||||
|
<!--<mat-list-item (click)="OnSelectDirectForms(rentalDetail)" style="background-color:#e0e0e0">-->
|
||||||
|
<!--<span class="mt-0">{{rentalDetail.form_name}}</span>-->
|
||||||
|
<!--</mat-list-item>-->
|
||||||
|
<!--</mat-list>-->
|
||||||
|
|
||||||
</mat-sidenav>
|
</mat-sidenav>
|
||||||
<mat-toolbar color="primary" fxHide="false" fxHide.gt-sm>
|
<mat-toolbar color="primary" fxHide="false" fxHide.gt-sm>
|
||||||
@ -433,9 +436,12 @@
|
|||||||
<ng-container *ngSwitchCase="15">
|
<ng-container *ngSwitchCase="15">
|
||||||
<app-lender-representative [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-lender-representative>
|
<app-lender-representative [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-lender-representative>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="17">
|
||||||
|
<app-rental-info [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-rental-info>
|
||||||
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- end form based questions -->
|
<!-- end form based questions -->
|
||||||
|
|
||||||
</figure>
|
</figure>
|
||||||
|
|||||||
@ -29,6 +29,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
|||||||
answerList: any = [];
|
answerList: any = [];
|
||||||
ansPDList: any = [];
|
ansPDList: any = [];
|
||||||
relationDetails: any = [1];
|
relationDetails: any = [1];
|
||||||
|
rentalDetail: any = { form_id: "16", form_name: "Rental Information", isAnswered: true}
|
||||||
// errorMessage:any;
|
// errorMessage:any;
|
||||||
// selectedCategory:any=[];
|
// selectedCategory:any=[];
|
||||||
// categoryList: any=[];
|
// categoryList: any=[];
|
||||||
@ -294,6 +295,7 @@ pdFullDetails:any=[];
|
|||||||
this.pdMasterList=data.records.pdmaster_details;
|
this.pdMasterList=data.records.pdmaster_details;
|
||||||
this.categoryList=data.records.question_answers;
|
this.categoryList=data.records.question_answers;
|
||||||
this.categoryFormButtons = data.records.template_forms;
|
this.categoryFormButtons = data.records.template_forms;
|
||||||
|
console.log('formButtons', this.categoryFormButtons);
|
||||||
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
|
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
|
||||||
this.mainApplicantName = filterApplicantName[0].applicant_name;
|
this.mainApplicantName = filterApplicantName[0].applicant_name;
|
||||||
this.currentPDStatus = data.records.pdmaster_details.pd_status;
|
this.currentPDStatus = data.records.pdmaster_details.pd_status;
|
||||||
@ -625,6 +627,7 @@ pdFullDetails:any=[];
|
|||||||
OnSelectDirectForms(details: any) {
|
OnSelectDirectForms(details: any) {
|
||||||
this.formsCategoryEnable = true;
|
this.formsCategoryEnable = true;
|
||||||
this.selectedFormsCategory = details;
|
this.selectedFormsCategory = details;
|
||||||
|
console.log('select..', this.selectedFormsCategory);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
MatProgressBarModule, MatDialogModule, MatSortModule,
|
MatProgressBarModule, MatDialogModule, MatSortModule,
|
||||||
MatToolbarModule, MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule,
|
MatToolbarModule, MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule,
|
||||||
MatBadgeModule, MatExpansionModule, MatStepperModule, MatSidenavModule, MatMenuModule, MatButtonToggleModule,
|
MatBadgeModule, MatExpansionModule, MatStepperModule, MatSidenavModule, MatMenuModule, MatButtonToggleModule,
|
||||||
MatAutocompleteModule
|
MatAutocompleteModule, MatDatepickerModule
|
||||||
} from '@angular/material';
|
} from '@angular/material';
|
||||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
@ -62,6 +62,7 @@ import {FinancialInfoComponent} from "./list-pd/start-pd/forms/financial-info/fi
|
|||||||
import { LenderRepresentativeComponent } from './list-pd/start-pd/forms/lender-representative/lender-representative.component';
|
import { LenderRepresentativeComponent } from './list-pd/start-pd/forms/lender-representative/lender-representative.component';
|
||||||
|
|
||||||
import { TelePdAllocationComponent } from './list-pd/tele-pd-allocation/tele-pd-allocation.component';
|
import { TelePdAllocationComponent } from './list-pd/tele-pd-allocation/tele-pd-allocation.component';
|
||||||
|
import {RentalInfoComponent} from "./list-pd/start-pd/forms/rental-info/rental-info.component";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom angular notifier options
|
* Custom angular notifier options
|
||||||
@ -135,7 +136,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
||||||
// OwlNativeDateTimeModule,
|
// OwlNativeDateTimeModule,
|
||||||
// ],
|
// ],
|
||||||
declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent],
|
declarations: [RentalInfoComponent,TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent],
|
||||||
|
|
||||||
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
||||||
// providers: [PdTrigerService, GetGeometricLocationService],
|
// providers: [PdTrigerService, GetGeometricLocationService],
|
||||||
@ -160,7 +161,8 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
FileUploadModule,
|
FileUploadModule,
|
||||||
TreeModule,
|
TreeModule,
|
||||||
MatDialogModule,MatSortModule,
|
MatDatepickerModule,
|
||||||
|
MatDialogModule,MatSortModule,
|
||||||
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
|
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
|
||||||
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
|
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
|
||||||
OwlNativeDateTimeModule,
|
OwlNativeDateTimeModule,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user