merge : kms

This commit is contained in:
gandhimathi 2019-01-26 12:18:23 +05:30
parent bce50abd92
commit a97df7732a
3 changed files with 86 additions and 90 deletions

View File

@ -116,7 +116,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Name of the Owner" <mat-select multiple placeholder="Name of the Owner"
formControlName="owner_name" [compareWith]="compareObjects" required> formControlName="owner_name" [compareWith]="compareObjects" required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName"> <mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val"> <mat-option *ngFor="let val of group.groupValues" [value]="val">
@ -145,9 +145,9 @@
</mat-select> --> </mat-select> -->
<!-- </mat-form-field> --> <!-- </mat-form-field> -->
<mat-form-field *ngIf="checkOthers(sup.get('owner_name').value)===true"> <!-- <mat-form-field *ngIf="checkOthers(loanDetailsForm.controls['owner_name'].value)===true">
<input matInput placeholder="Specify Other Owner Name" formControlName="other_owners_name" autocomplete="off"> <input matInput placeholder="Specify Other Owner Name" formControlName="other_owners_name" autocomplete="off">
</mat-form-field> </mat-form-field> -->
<mat-form-field> <mat-form-field>
<mat-select placeholder="Status of Construction" formControlName="construction_status" > <mat-select placeholder="Status of Construction" formControlName="construction_status" >

View File

@ -86,32 +86,9 @@ export class LoanDetailsComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { @Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.applicants = this.pd_all_details.pdapplicants_detials; this.applicants = this.pd_all_details.pdapplicants_detials;
// this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2) this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2)
this.companies = this.pd_all_details.pdapplicants_detials.filter(appt=>appt.applicant_type == 2 ) // this.companies = this.pd_all_details.pdapplicants_detials.filter(appt=>appt.applicant_type == 2 )
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._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})
}
});
this.productAbbr = this.pd_all_details.pdmaster_details.product_abbr; this.productAbbr = this.pd_all_details.pdmaster_details.product_abbr;
this.productID = this.pd_all_details.pdmaster_details.fk_product_id; this.productID = this.pd_all_details.pdmaster_details.fk_product_id;
this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name; this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name;
@ -151,29 +128,26 @@ export class LoanDetailsComponent implements OnInit {
this.getM_StatusofCunstruction(); this.getM_StatusofCunstruction();
this.getM_BTLenderList(); this.getM_BTLenderList();
// this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
// if(data.dataStatus){ if(data.dataStatus){
// this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true); this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true);
// } }
let modifyCompanyList : any=[];
// let modifyCompanyList : any=[]; if(this.existCompanyList.length>0){
// if(this.existCompanyList.length>0){ modifyCompanyList = this.existCompanyList.map(element => {
// 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})
// this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) }
// } let modifyApplicantList: any=[];
// let modifyApplicantList: any=[]; if(this.applicants.length > 0){
// if(this.applicants.length > 0){ modifyApplicantList = this.applicants.map(element => {
// 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.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1);
// this.mergeCompanyApplicant.splice(this.mergeCompanyApplicant.indexOf(languague), 1); }
// // this.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1); })
// }
// })
let params: any = {}; let params: any = {};
@ -358,42 +332,35 @@ getM_sourceofamount() {
} }
getM_MortageTypeProperty() { getM_MortageTypeProperty() {
// this._pd.getAllMasterDatas('MORTAGEPROPERTYTYPE').subscribe(
this._pd.getAllMasterDatas('MORTAGEPROPERTIES').subscribe( this._pd.getAllMasterDatas('MORTAGEPROPERTIES').subscribe(
data => { data => {
// this.m_mortageTypeProperty = data.records.filter(data => data.isactive == 1);
// this.m_mortageTypeProperty = data.records.filter(data => data.group_name == this.productAbbr);
if(data.dataStatus==true){ if(data.dataStatus==true){
let that = this; let that = this;
this.m_mortageTypeProperty = data.records.filter( this.m_mortageTypeProperty = data.records.filter(
function(data){ function(data){
console.log(data);
if(that.productAbbr != "LAP"){ if(that.productAbbr != "LAP"){
console.log(that.productAbbr);
if(data.group_name == that.productAbbr && data.isactive==1){ if(data.group_name == that.productAbbr && data.isactive==1){
return data; return data;
} }
} }
else if(that.productAbbr == "LAP"){ else if(that.productAbbr == "LAP"){
if(data.sub_group_name == that.subProductName && data.isactive==1){ console.log(that.productAbbr);
console.log(that.subProductName);
console.log(data.sub_group_name);
if(data.group_name == that.productAbbr && data.sub_group_name == that.subProductName && data.isactive==1){
console.log('lap with subproduct',data);
return data; return data;
} }
else if(data.group_name == that.productAbbr && data.sub_group_name != null && data.isactive==1) {
console.log('lap with subproduct null',data);
return data;
}
} }
// if(data.isactive==1 && data.group_name != "LAP"){
// if(data.group_name == that.productAbbr){
// return data;}
// }else if(data.group_name == "LAP" && data.sub_group_name == that.subProductName){
// return data;
// }else{
// return ;
// }
}); });
// console.log(this.m_mortageTypeProperty); console.log(this.m_mortageTypeProperty);
// console.log(this.propertyType);
// this.mortage_type(this.propertyType);
// if(this.propertyType != ''){
// this.mortage_type(this.propertyType);
// }
} }
}, },
error => { error => {
@ -560,10 +527,11 @@ getM_sourceofamount() {
records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value; records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value;
// get end user final group data // get end user final group data
let dataEnd_user_data = []; let dataEnd_user_data = [];
this.loanDetailsForm.controls['end_use'].value.forEach(element => {
this.loanDetailsForm.controls['end_use'].value.forEach(element => {
dataEnd_user_data.push({end_use: element}) dataEnd_user_data.push({end_use: element})
}); });
records.end_use_group = dataEnd_user_data; records.end_use_group = dataEnd_user_data;
if (this.isOtherPurpose) { if (this.isOtherPurpose) {
@ -618,9 +586,9 @@ getM_sourceofamount() {
dataOwner_name.push({owner_name: element}) dataOwner_name.push({owner_name: element})
}); });
records.owner_name_group = dataOwner_name; records.owner_name_group = dataOwner_name;
// if(this.OtherOwnerFlag){ // if(this.loanDetailsForm.controls['other_owners_name'].value != null){
// records.other_owners_name = this.loanDetailsForm.controls['other_owners_name'].value; // records.other_owners_name = this.loanDetailsForm.controls['other_owners_name'].value;
// }else{ records.other_owners_name = ''; } // }else{ records.other_owners_name = null; }
records.construction_status = this.loanDetailsForm.controls['construction_status'].value; records.construction_status = this.loanDetailsForm.controls['construction_status'].value;
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
}else{ }else{

View File

@ -72,14 +72,18 @@
</span> </span>
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addRawMaterials(1)" <button type="button" mat-flat-button (click)="addRawMaterials(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last" align="center"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Raw Materials </strong> <strong>Add More Raw Materials </strong>
</button> </button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteRawMaterials(a,1)" <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="!last" align="right"> matTooltip="Delete Raw Materials" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</div> </div>
@ -144,18 +148,22 @@
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addGoods(1)" <button type="button" mat-flat-button (click)="addGoods(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last" align="center"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong> <strong>Add More Finished Goods </strong>
</button> </button>
</div>
<!-- <button type="button" mat-flat-button (click)="deleteGoods(b,1)" <!-- <button type="button" mat-flat-button (click)="deleteGoods(b,1)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last" align="center"> matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last" align="center">
<strong>Delete Finished Goods </strong> <strong>Delete Finished Goods </strong>
</button> --> </button> -->
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(b,1)" <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="!last" align="right"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</div> </div>
@ -220,14 +228,18 @@
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(1)" <button type="button" mat-flat-button (click)="addTradedGoods(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last" align="center"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong> <strong>Add More Traded Goods </strong>
</button> </button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(c,1)" <button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(c,1)"
matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last" align="right"> matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</div> </div>
@ -304,14 +316,18 @@
</button> --> </button> -->
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addGoods(2)" <button type="button" mat-flat-button (click)="addGoods(2)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last" align="center"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong> <strong>Add More Finished Goods </strong>
</button> </button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(d,2)" <button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(d,2)"
matTooltip="Delete Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last" align="right"> matTooltip="Delete Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</div> </div>
@ -376,14 +392,18 @@
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(2)" <button type="button" mat-flat-button (click)="addTradedGoods(2)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last" align="center"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong> <strong>Add More Traded Goods </strong>
</button> </button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(e,2)" <button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(e,2)"
matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last" align="right"> matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
@ -462,14 +482,18 @@
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addGoods(3)" <button type="button" mat-flat-button (click)="addGoods(3)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last" align="center"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong> <strong>Add More Finished Goods </strong>
</button> </button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(f,3)" <button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(f,3)"
matTooltip="Delete Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last" align="right"> matTooltip="Delete Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</div> </div>
@ -534,14 +558,18 @@
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(3)" <button type="button" mat-flat-button (click)="addTradedGoods(3)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last" align="center"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong> <strong>Add More Traded Goods </strong>
</button> </button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,3)" <button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,3)"
matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last" align="right"> matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</div> </div>