Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
295d7e0666
@ -218,14 +218,20 @@
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"₹"}} {{appxMarketAmtInwords[i]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5" style="width:30%">
|
||||
<!-- <input matInput placeholder="Name of the Business Owner" formControlName="business_name_of_the_owner" autocomplete="off"> -->
|
||||
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5" style="width:45%">
|
||||
<mat-select placeholder="Asset Owned by"
|
||||
formControlName="business_name_of_the_owner" required>
|
||||
<mat-option [value]="company.company_name" *ngFor="let company of existCompanyList">{{company.company_name | titlecase}}</mat-option>
|
||||
<!-- <mat-option value="Others">Others</mat-option> -->
|
||||
formControlName="business_name_of_the_owner" [compareWith]="compareObjects" required>
|
||||
<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(sup.get('business_name_of_the_owner').value)===true" style="width:45%">
|
||||
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner" autocomplete="off">
|
||||
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ import {
|
||||
} from '@angular/material';
|
||||
/** Service */
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import { element } from '@angular/core/src/render3/instructions';
|
||||
@Component({
|
||||
selector: 'app-assets-info',
|
||||
templateUrl: './assets-info.component.html',
|
||||
@ -184,6 +185,8 @@ public m_investmentType = [];
|
||||
|
||||
private notifier: NotifierService;
|
||||
existCompanyList: any =[];
|
||||
mergeCompanyApplicant: any=[];
|
||||
|
||||
constructor(
|
||||
notifier: NotifierService,
|
||||
private _formBuilder: FormBuilder,
|
||||
@ -224,6 +227,24 @@ public m_investmentType = [];
|
||||
if(data.dataStatus){
|
||||
this.existCompanyList = data.records.filter(val =>val.is_active);
|
||||
}
|
||||
|
||||
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})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
this.getPdSupplierFormDetails();
|
||||
@ -315,8 +336,6 @@ public m_investmentType = [];
|
||||
getPdSupplierFormDetails() {
|
||||
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '4').subscribe(
|
||||
data => {
|
||||
console.log(data);
|
||||
console.log(data.records);
|
||||
if (data) {
|
||||
if (data.dataStatus) {
|
||||
this.formLoadData(data.records);
|
||||
@ -332,7 +351,6 @@ public m_investmentType = [];
|
||||
}
|
||||
|
||||
formLoadData(val) {
|
||||
console.log(val);
|
||||
if (val !== null) {
|
||||
let value = val;
|
||||
this._assetsQuesFrom = this._formBuilder.group({
|
||||
@ -394,6 +412,7 @@ public m_investmentType = [];
|
||||
business_details: this._formBuilder.array([]),
|
||||
business_approximate_market_value: [''],
|
||||
business_name_of_the_owner: [],
|
||||
business_name_of_the_owner_other: [],
|
||||
//other_owner:[''],
|
||||
//relation:[''],
|
||||
business_purchase_year: ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
|
||||
@ -656,7 +675,7 @@ public m_investmentType = [];
|
||||
business_details: this._formBuilder.array([]),
|
||||
business_approximate_market_value: [data.business_approximate_market_value],
|
||||
business_name_of_the_owner: [data.business_name_of_the_owner],
|
||||
// other_owner:[data.other_owner || ''],
|
||||
business_name_of_the_other_owner:[data.business_name_of_the_other_owner || ''],
|
||||
// relation: [data.relation || ''],
|
||||
business_purchase_year: [data. business_purchase_year],
|
||||
// purchase_month: [data.purchase_month],
|
||||
@ -670,7 +689,6 @@ public m_investmentType = [];
|
||||
|
||||
loadDetails: boolean;
|
||||
addAssetsDetailsWithData(supp_data) {
|
||||
//console.log(supp_data);
|
||||
var result = Object.keys(supp_data).map(function (key) {
|
||||
return supp_data[key];
|
||||
});
|
||||
@ -721,7 +739,7 @@ public m_investmentType = [];
|
||||
business_assets_mode: val.business_assets_mode,
|
||||
business_approximate_market_value: val.business_approximate_market_value,
|
||||
business_name_of_the_owner: val.business_name_of_the_owner,
|
||||
// other_owner: val.other_owner,
|
||||
business_name_of_the_other_owner: val.business_name_of_the_other_owner,
|
||||
// relation : val.relation,
|
||||
business_purchase_year: val. business_purchase_year,
|
||||
// purchase_month: val.purchase_month,
|
||||
@ -949,8 +967,6 @@ public m_investmentType = [];
|
||||
|
||||
/** Add More Asset using Flag Both "Other Asset" And "Business Asset" */
|
||||
addAssetDetails(e,flag) {
|
||||
// console.log(flag);
|
||||
// console.log(e);
|
||||
if(flag == 1){
|
||||
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
|
||||
control.push(this.initDetails());
|
||||
@ -994,9 +1010,26 @@ public m_investmentType = [];
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// check others
|
||||
checkOthers(values){
|
||||
if(values!=null) {
|
||||
return values.id==0 ? true : false;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
console.log(this._assetsQuesFrom.value);
|
||||
this.submitted = true;
|
||||
|
||||
// stop here if form is invalid
|
||||
@ -1025,7 +1058,6 @@ public m_investmentType = [];
|
||||
val.business_elapsed_tenure = '';
|
||||
}
|
||||
});
|
||||
console.log(answerFormValues);
|
||||
// Save the data with help of Service
|
||||
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
|
||||
dataresult => {
|
||||
@ -1067,7 +1099,6 @@ console.log(answerFormValues);
|
||||
loanTenureCalc(details ,flag)
|
||||
{
|
||||
if(flag == 1){
|
||||
//console.log(details.value);
|
||||
let ElapsedValues;
|
||||
|
||||
if(details.value.original_loan_tenure != null && details.value.original_loan_tenure != '' && details.value.balance_tenure != null && details.value.balance_tenure != ''){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user