chnages :ps
This commit is contained in:
parent
e3a05bbaa2
commit
893fc1c37b
BIN
ng6-seed/sineedge_prod_080319_3.zip
Normal file
BIN
ng6-seed/sineedge_prod_080319_3.zip
Normal file
Binary file not shown.
@ -59,12 +59,12 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
// this.draftStatus="DRAFT";
|
// this.draftStatus="DRAFT";
|
||||||
// this.PDTriggerStatus="TRIGGERED";
|
// this.PDTriggerStatus="TRIGGERED";
|
||||||
|
this.getCustomerSegmentList();
|
||||||
this.getLenderList();
|
this.getLenderList();
|
||||||
this.getProductsList();
|
this.getProductsList();
|
||||||
this.getCustomerSegmentList();
|
|
||||||
this.getStateCityList();
|
this.getStateCityList();
|
||||||
this.getPDTypeList();
|
this.getPDTypeList();
|
||||||
this.getAddresses();
|
// this.getAddresses();
|
||||||
this.loadFormData();
|
this.loadFormData();
|
||||||
this.applicantLength=this.data.applicantLength;
|
this.applicantLength=this.data.applicantLength;
|
||||||
}
|
}
|
||||||
@ -87,10 +87,15 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
this._EditPDtriggerForm.controls.pd_branch_id.setValue(null);
|
this._EditPDtriggerForm.controls.pd_branch_id.setValue(null);
|
||||||
|
|
||||||
}
|
}
|
||||||
getAddresses(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
getCustomerSegmentList(){
|
||||||
|
this._pd.getCustomersDetails().subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.customerSegmentAllList=data.records
|
||||||
|
}
|
||||||
|
}, error => this.errorMessage = <any> error);
|
||||||
|
}
|
||||||
|
|
||||||
getProductsList(){
|
getProductsList(){
|
||||||
this._pd.getProductsDetails().subscribe(
|
this._pd.getProductsDetails().subscribe(
|
||||||
@ -103,14 +108,7 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}, error => this.errorMessage = <any> error);
|
}, error => this.errorMessage = <any> error);
|
||||||
}
|
}
|
||||||
getCustomerSegmentList(){
|
|
||||||
this._pd.getCustomersDetails().subscribe(
|
|
||||||
data => {
|
|
||||||
if (data.status == 200) {
|
|
||||||
this.customerSegmentAllList=data.records
|
|
||||||
}
|
|
||||||
}, error => this.errorMessage = <any> error);
|
|
||||||
}
|
|
||||||
// getStateCityList(){
|
// getStateCityList(){
|
||||||
// this._pd.getStateCityDetails().subscribe(
|
// this._pd.getStateCityDetails().subscribe(
|
||||||
// data => {
|
// data => {
|
||||||
@ -203,8 +201,6 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
this.getCityList(val.fk_state,index);
|
this.getCityList(val.fk_state,index);
|
||||||
this.getPincode(val.pincode_id,index);
|
this.getPincode(val.pincode_id,index);
|
||||||
|
|
||||||
console.log('this.addressesList.length',this.addressesList.length);
|
|
||||||
this.addressesDeactivited[this.addressesList.length] = true;
|
this.addressesDeactivited[this.addressesList.length] = true;
|
||||||
addressesArray.push(this.createAddresses(obj));
|
addressesArray.push(this.createAddresses(obj));
|
||||||
});
|
});
|
||||||
@ -226,16 +222,13 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
//get sub product list based on prokduct id
|
//get sub product list based on prokduct id
|
||||||
getSubproductList(productID:string){
|
getSubproductList(productID:string){
|
||||||
this.customerSegmentList=this.customerSegmentAllList;
|
this.customerSegmentList=this.customerSegmentAllList;
|
||||||
console.log('this.customerSegmentAllList',this.customerSegmentAllList);
|
|
||||||
if(productID != '4'){
|
if(productID != '4'){
|
||||||
console.log('if',this.customerSegmentList);
|
|
||||||
this.subProductList= this.productList.filter(item => item.product_id == productID);
|
this.subProductList= this.productList.filter(item => item.product_id == productID);
|
||||||
this.subProductList=this.subProductList[0].subproducts;
|
this.subProductList=this.subProductList[0].subproducts;
|
||||||
}
|
}
|
||||||
if(productID == '4'){
|
if(productID == '4'){
|
||||||
let filtered = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
|
let filtered = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
|
||||||
this.customerSegmentList = filtered;
|
this.customerSegmentList = filtered;
|
||||||
console.log('else',this.customerSegmentList);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,7 +429,6 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// console.log('my_array.addresses',my_array.addresses);
|
|
||||||
let filteredAddressesdata = my_array.addresses.filter(item => item.isactive == 1);
|
let filteredAddressesdata = my_array.addresses.filter(item => item.isactive == 1);
|
||||||
let lenderMasterArray = {
|
let lenderMasterArray = {
|
||||||
"pd_id": my_array.pd_id,
|
"pd_id": my_array.pd_id,
|
||||||
|
|||||||
@ -38,19 +38,19 @@
|
|||||||
<!-- Position1 Column -->
|
<!-- Position1 Column -->
|
||||||
<ng-container matColumnDef="position_2">
|
<ng-container matColumnDef="position_2">
|
||||||
<th mat-header-cell *matHeaderCellDef> Declared_by_customer</th>
|
<th mat-header-cell *matHeaderCellDef> Declared_by_customer</th>
|
||||||
<td mat-cell *matCellDef="let element"> {{element.declared_by_customer}} </td>
|
<td mat-cell *matCellDef="let element"> {{element.declared_by_customer.toFixed(2)}} </td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Position2 Column -->
|
<!-- Position2 Column -->
|
||||||
<ng-container matColumnDef="position_3">
|
<ng-container matColumnDef="position_3">
|
||||||
<th mat-header-cell *matHeaderCellDef> As Derived from Item Wise Sales </th>
|
<th mat-header-cell *matHeaderCellDef> As Derived from Item Wise Sales </th>
|
||||||
<td mat-cell *matCellDef="let element"> {{element.derived_item_wise}} </td>
|
<td mat-cell *matCellDef="let element"> {{element.derived_item_wise.toFixed(2)}} </td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Position3 Column -->
|
<!-- Position3 Column -->
|
||||||
<ng-container matColumnDef="position_4">
|
<ng-container matColumnDef="position_4">
|
||||||
<th mat-header-cell *matHeaderCellDef> As Derived from Kuchha Sales Book/Bills </th>
|
<th mat-header-cell *matHeaderCellDef> As Derived from Kuchha Sales Book/Bills </th>
|
||||||
<td mat-cell *matCellDef="let element"> {{element.derived_sales_book}} </td>
|
<td mat-cell *matCellDef="let element"> {{element.derived_sales_book.toFixed(2)}} </td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- action Column -->
|
<!-- action Column -->
|
||||||
|
|||||||
@ -1770,10 +1770,10 @@ CheckExport(value,stringFlag,index){
|
|||||||
const childControl = <FormArray>parentControl.controls[0];
|
const childControl = <FormArray>parentControl.controls[0];
|
||||||
|
|
||||||
if(!this.ManufacturingUnChecked){
|
if(!this.ManufacturingUnChecked){
|
||||||
if(stringFlag == 'MActivity' && value != "Within India"){
|
if(stringFlag == 'MActivity' && value == "Both"){
|
||||||
this.ManufacturingCounterArray[index] = 1;
|
this.ManufacturingCounterArray[index] = 1;
|
||||||
}
|
}
|
||||||
else if(stringFlag == 'MActivity' && value == "Within India"){
|
else if(stringFlag == 'MActivity' && value != "Both"){
|
||||||
this.ManufacturingCounterArray[index] = 0;
|
this.ManufacturingCounterArray[index] = 0;
|
||||||
}
|
}
|
||||||
}else if (this.ManufacturingUnChecked && stringFlag == 'MActivity'){
|
}else if (this.ManufacturingUnChecked && stringFlag == 'MActivity'){
|
||||||
@ -1781,10 +1781,10 @@ CheckExport(value,stringFlag,index){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!this.RetailedUnChecked){
|
if(!this.RetailedUnChecked){
|
||||||
if(stringFlag == 'RActivity' && value != "Within India"){
|
if(stringFlag == 'RActivity' && value == "Both"){
|
||||||
this.RetailCounterArray[index] = 1;
|
this.RetailCounterArray[index] = 1;
|
||||||
}
|
}
|
||||||
else if(stringFlag == 'RActivity' && value == "Within India"){
|
else if(stringFlag == 'RActivity' && value != "Both"){
|
||||||
this.RetailCounterArray[index] = 0;
|
this.RetailCounterArray[index] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1793,10 +1793,10 @@ CheckExport(value,stringFlag,index){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!this.WholeSalesUnChecked){
|
if(!this.WholeSalesUnChecked){
|
||||||
if(stringFlag == 'WActivity' && value != "Within India"){
|
if(stringFlag == 'WActivity' && value == "Both"){
|
||||||
this.WholeSaleCounterArray[index] = 1;
|
this.WholeSaleCounterArray[index] = 1;
|
||||||
}
|
}
|
||||||
else if(stringFlag == 'WActivity' && value == "Within India"){
|
else if(stringFlag == 'WActivity' && value != "Both"){
|
||||||
this.WholeSaleCounterArray[index] = 0;
|
this.WholeSaleCounterArray[index] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1806,11 +1806,11 @@ CheckExport(value,stringFlag,index){
|
|||||||
|
|
||||||
if(!this.ServiceUnChecked){
|
if(!this.ServiceUnChecked){
|
||||||
|
|
||||||
if(stringFlag == 'SPActivity' && value != "Within India")
|
if(stringFlag == 'SPActivity' && value == "Both")
|
||||||
{
|
{
|
||||||
this.ServiceCounterArray[index] = 1;
|
this.ServiceCounterArray[index] = 1;
|
||||||
}
|
}
|
||||||
else if(stringFlag == 'SPActivity' && value == "Within India"){
|
else if(stringFlag == 'SPActivity' && value != "Both"){
|
||||||
this.ServiceCounterArray[index] = 0;
|
this.ServiceCounterArray[index] = 0;
|
||||||
}
|
}
|
||||||
}else if(stringFlag == 'SPActivity' && this.ServiceUnChecked){
|
}else if(stringFlag == 'SPActivity' && this.ServiceUnChecked){
|
||||||
|
|||||||
@ -362,45 +362,37 @@ export class FamilyDetailsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
selectedPerson(e,inx){
|
selectedPerson(e,inx){
|
||||||
console.log('1)','e',e,'index',inx);
|
|
||||||
this.FamilyMemberAsLabel[inx] = this.selectPerson.filter(item => item.pd_co_applicant_id == e)[0].applicant_name;
|
this.FamilyMemberAsLabel[inx] = this.selectPerson.filter(item => item.pd_co_applicant_id == e)[0].applicant_name;
|
||||||
console.log('2)','this.FamilyMemberAsLabel[inx]',this.FamilyMemberAsLabel[inx]);
|
|
||||||
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
|
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
|
||||||
|
|
||||||
let newControlLength: number;
|
let newControlLength: number;
|
||||||
let oldControlLength: number = control.length;
|
let oldControlLength: number = control.length;
|
||||||
|
let index: number = 0;
|
||||||
|
|
||||||
if(this.apiFamilyMembers.length>0){
|
if(this.apiFamilyMembers.length>0){
|
||||||
|
|
||||||
let arraydata : any;
|
let arraydata : any;
|
||||||
let data = this.apiFamilyMembers.filter(item => item.relation_to == e);
|
let data = this.apiFamilyMembers.filter(item => item.relation_to == e);
|
||||||
|
|
||||||
console.log('3)','data',data);
|
|
||||||
// data_gets_from:'GeneralForm'
|
|
||||||
// data_gets_from:'BusinessForm'
|
|
||||||
|
|
||||||
if(data.length > 0){
|
if(data.length > 0){
|
||||||
|
|
||||||
|
|
||||||
newControlLength = data.length;
|
newControlLength = data.length;
|
||||||
let index: number = 0;
|
|
||||||
while(index < oldControlLength)
|
while(index < oldControlLength)
|
||||||
{
|
{
|
||||||
control.removeAt(index);
|
control.removeAt(index);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
oldControlLength = newControlLength
|
oldControlLength = newControlLength
|
||||||
|
|
||||||
|
|
||||||
data.forEach((val,inx) => {
|
data.forEach((val,inx) => {
|
||||||
console.log('b4 this.isReadOnly[inx]',this.isReadOnly[inx],val.age);
|
|
||||||
// family_member_earning_status
|
|
||||||
if(val.age){
|
if(val.age){
|
||||||
this.isReadOnly[inx] = true;
|
// this.isReadOnly[inx] = true;
|
||||||
}else{
|
}else{
|
||||||
this.isReadOnly[inx] = false;
|
// this.isReadOnly[inx] = false;
|
||||||
}
|
}
|
||||||
console.log('aftr this.isReadOnly[inx]',this.isReadOnly[inx],val.age);
|
|
||||||
arraydata = {
|
arraydata = {
|
||||||
'family_member_name' : val.name,
|
'family_member_name' : val.name,
|
||||||
'family_member_relationship' : val.relationship,
|
'family_member_relationship' : val.relationship,
|
||||||
@ -417,24 +409,22 @@ export class FamilyDetailsComponent implements OnInit {
|
|||||||
'non_earning_if_schoolorcollege': ''
|
'non_earning_if_schoolorcollege': ''
|
||||||
}
|
}
|
||||||
control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
|
control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
||||||
let index: number = 0;
|
newControlLength = 1;
|
||||||
while(index < oldControlLength)
|
while(index < oldControlLength)
|
||||||
{
|
{
|
||||||
control.removeAt(index);
|
control.removeAt(index);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
oldControlLength = 1;
|
oldControlLength = newControlLength;
|
||||||
|
|
||||||
control.push(this.generateFamilyMembersDetailsGet());
|
control.push(this.generateFamilyMembersDetailsGet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
||||||
control.push(this.generateFamilyMembersDetailsGet());
|
control.push(this.generateFamilyMembersDetailsGet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -286,12 +286,12 @@ export class FinancialInfoComponent implements OnInit {
|
|||||||
estimate_net_loss_percent:[''],
|
estimate_net_loss_percent:[''],
|
||||||
estimate_net_loss:[''],
|
estimate_net_loss:[''],
|
||||||
estimate_reason_for_loss:[''],
|
estimate_reason_for_loss:[''],
|
||||||
estimate_receive_the_money_in_days:[''],
|
// estimate_receive_the_money_in_days:[''],
|
||||||
estimate_pay_the_money_in_days:[''],
|
// estimate_pay_the_money_in_days:[''],
|
||||||
estimate_unsold_stock_lies_in_days:[''],
|
// estimate_unsold_stock_lies_in_days:[''],
|
||||||
estimate_working_capital_facilities_availed:[''],
|
// estimate_working_capital_facilities_availed:[''],
|
||||||
reason_for_working_capital_facilities_availed:[''],
|
// reason_for_working_capital_facilities_availed:[''],
|
||||||
is_there_working_capital_available:['']
|
// is_there_working_capital_available:['']
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -601,27 +601,33 @@ export class GeneralInfoComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// submit form details
|
// submit form details
|
||||||
|
temp : number = 0;
|
||||||
submitGeneralForm(formData: any) {
|
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'].clearValidators();
|
||||||
this._generalForm.controls['rental_income_rcv_in_years'].updateValueAndValidity();
|
this._generalForm.controls['rental_income_rcv_in_years'].updateValueAndValidity();
|
||||||
}
|
}
|
||||||
// 0th index of companies formArray only - required removed
|
// 0th index of companies formArray only - required removed
|
||||||
// greater than zero means not applicable here
|
// greater than zero means not applicable here
|
||||||
if(this.customer_segment_abbr == 'SE-RI'){
|
if(this.customer_segment_abbr == 'SE-RI'){
|
||||||
let otherControl: any = this._generalForm.get('companies') as FormArray;
|
let otherControl: any = this._generalForm.get('companies') as FormArray;
|
||||||
otherControl = otherControl.controls[0];
|
otherControl = otherControl.controls[0];
|
||||||
// otherControl.controls.business_entity_type_other.clearValidators();
|
// otherControl.controls.business_entity_type_other.clearValidators();
|
||||||
// otherControl.controls.business_entity_type_other.updateValueAndValidity();
|
// 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);
|
||||||
|
|
||||||
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) {
|
if (this._generalForm.invalid) {
|
||||||
this.disableAfterSubmit = false;
|
this.disableAfterSubmit = false;
|
||||||
@ -629,11 +635,21 @@ export class GeneralInfoComponent implements OnInit {
|
|||||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// else if(formData.applicant_relation.length==0){
|
|
||||||
|
|
||||||
// this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
|
|
||||||
// }
|
|
||||||
else {
|
else {
|
||||||
|
if(formData.individuals.length > 0){
|
||||||
|
// console.log(this.temp,formData.individuals.length);
|
||||||
|
formData.individuals.forEach((val,index) => {
|
||||||
|
if(val.is_person_met == false){
|
||||||
|
this.temp++;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if(this.temp == formData.individuals.length){
|
||||||
|
this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.disableAfterSubmit = true;
|
this.disableAfterSubmit = true;
|
||||||
let saveRecords: any = {}
|
let saveRecords: any = {}
|
||||||
saveRecords.pdid = formData.pdid;
|
saveRecords.pdid = formData.pdid;
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:64%">
|
<mat-form-field style="width:64%">
|
||||||
<mat-select placeholder="Sub Product"
|
<mat-select placeholder="Sub Product"
|
||||||
formControlName="sub_product">
|
formControlName="sub_product" (selectionChange)="onChangeSubProduct($event.value)">
|
||||||
<mat-option>Select</mat-option>
|
<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-select>
|
||||||
|
|||||||
@ -122,7 +122,7 @@ export class LoanDetailsComponent implements OnInit {
|
|||||||
|
|
||||||
this.initloanDetailsForm();
|
this.initloanDetailsForm();
|
||||||
this.getM_EndUseofLoad();
|
this.getM_EndUseofLoad();
|
||||||
this.getM_EndUseForLoan(this.pdid);
|
this.getM_EndUseForLoan(this.pdid,this.pd_all_details.pdmaster_details.fk_subproduct_id);
|
||||||
this.getM_sourceofamount();
|
this.getM_sourceofamount();
|
||||||
this.getM_MortageTypeProperty();
|
this.getM_MortageTypeProperty();
|
||||||
this.getM_StatusofCunstruction();
|
this.getM_StatusofCunstruction();
|
||||||
@ -311,8 +311,8 @@ export class LoanDetailsComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getM_EndUseForLoan(pdid) {
|
getM_EndUseForLoan(pdid,subproductid) {
|
||||||
this._pd.getEndUseForLoan(pdid).subscribe(
|
this._pd.getEndUseForLoan(pdid,subproductid).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.m_endUseForLoan = data.records.filter(data => data.isactive == 1);
|
this.m_endUseForLoan = data.records.filter(data => data.isactive == 1);
|
||||||
});
|
});
|
||||||
@ -436,6 +436,12 @@ export class LoanDetailsComponent implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 */
|
/** Enduse Changes And its Validation */
|
||||||
endUserChange(event) {
|
endUserChange(event) {
|
||||||
|
|||||||
@ -84,9 +84,16 @@
|
|||||||
|
|
||||||
<div fxFlex="60">
|
<div fxFlex="60">
|
||||||
<mat-form-field style="width: 95%" *ngIf="neighbourhood.controls.do_know.value!='' && !isDisplay2[n] ; else OtherCondition;">
|
<mat-form-field style="width: 95%" *ngIf="neighbourhood.controls.do_know.value!='' && !isDisplay2[n] ; else OtherCondition;">
|
||||||
<mat-select placeholder="Who is the owner of the organisation?" formControlName="organisation_owner">
|
<!-- <mat-select placeholder="Who is the owner of the organisation?" formControlName="organisation_owner">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let list of applicants" [value]="list.pd_co_applicant_id">{{list.applicant_name}}</mat-option>
|
<mat-option *ngFor="let list of applicants" [value]="list.pd_co_applicant_id">{{list.applicant_name}}</mat-option>
|
||||||
|
</mat-select> -->
|
||||||
|
<mat-select multiple placeholder="Who is the owner of the organisation?" formControlName="organisation_owner" [compareWith]="compareObjects" (selectionChange)="getOtherOrganisationOwner($event.value,n)">
|
||||||
|
<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>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<ng-template #OtherCondition>
|
<ng-template #OtherCondition>
|
||||||
@ -94,7 +101,7 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div fxFlex="20">
|
<div fxFlex="20">
|
||||||
<mat-form-field style="width: 95%" *ngIf="checkOthers(neighbourhood.controls.organisation_owner.value)===true">
|
<mat-form-field style="width: 95%" *ngIf="isOrganisationOwner[n]">
|
||||||
<input matInput autocomplete="off" placeholder="Specify Owner name" formControlName="other_organisation_owner" type="text">
|
<input matInput autocomplete="off" placeholder="Specify Owner name" formControlName="other_organisation_owner" type="text">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -33,7 +33,11 @@ export class NeighbourHoodComponent implements OnInit {
|
|||||||
finalRemarksList : any = [{'id': 1,'name': "Positive"},
|
finalRemarksList : any = [{'id': 1,'name': "Positive"},
|
||||||
{'id': 2,'name': "Negative"},
|
{'id': 2,'name': "Negative"},
|
||||||
{'id': 3,'name': "Insufficient information provided"}];
|
{'id': 3,'name': "Insufficient information provided"}];
|
||||||
amtInwords : any = [];
|
existCompanyList: any =[];
|
||||||
|
mergeCompanyApplicant: any=[];
|
||||||
|
isOrganisationOwner: any=[];
|
||||||
|
amtInwords : any = [];
|
||||||
|
|
||||||
// isOtherApplicant: any = [];
|
// isOtherApplicant: any = [];
|
||||||
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<NeighbourHoodComponent>) {
|
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<NeighbourHoodComponent>) {
|
||||||
this.pdid = this.data.pdmaster_details.pd_id;
|
this.pdid = this.data.pdmaster_details.pd_id;
|
||||||
@ -47,10 +51,33 @@ export class NeighbourHoodComponent implements OnInit {
|
|||||||
this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2);
|
this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2);
|
||||||
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
|
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this._pd.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})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
this.initFormDetails();
|
this.initFormDetails();
|
||||||
|
|
||||||
// call neghbourhhod / reference check changes
|
// call neghbourhhod / reference check changes
|
||||||
@ -113,6 +140,7 @@ export class NeighbourHoodComponent implements OnInit {
|
|||||||
this.toggleVisibility(element.did_not_know_the_owner,index,2);
|
this.toggleVisibility(element.did_not_know_the_owner,index,2);
|
||||||
// this.selectedApplicants(referencecheckControl,element.organisation_owner,index);
|
// this.selectedApplicants(referencecheckControl,element.organisation_owner,index);
|
||||||
neighbourhoodControl.push(this.createNeighbourhood(element));
|
neighbourhoodControl.push(this.createNeighbourhood(element));
|
||||||
|
this.getOtherOrganisationOwner(element.organisation_owner,index);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(exist_ref_details.length>0 && data.records.check_type==1){
|
else if(exist_ref_details.length>0 && data.records.check_type==1){
|
||||||
@ -417,5 +445,45 @@ checkOthers(values){
|
|||||||
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
|
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compareObjects(o1: any, o2: any) {
|
||||||
|
if(o1.id == o2.id && o1.group_id == o2.group_id)
|
||||||
|
return true;
|
||||||
|
else return false
|
||||||
|
}
|
||||||
|
|
||||||
|
getOtherOrganisationOwner(value,i) {
|
||||||
|
console.log('value',value,'I',i);
|
||||||
|
let Ctrls = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
|
||||||
|
console.log('ParCtrls',Ctrls);
|
||||||
|
let ChdCtrls:any = <FormArray>Ctrls.controls[i];
|
||||||
|
console.log('ChdCtrls',ChdCtrls);
|
||||||
|
// return;
|
||||||
|
|
||||||
|
|
||||||
|
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.other_organisation_owner.setValidators([Validators.required]);
|
||||||
|
this.isOrganisationOwner[i] = true;
|
||||||
|
}else if(Avaliablity == 1){
|
||||||
|
// console.log('else Avaliablity',Avaliablity);
|
||||||
|
// console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
|
||||||
|
ChdCtrls.controls.other_organisation_owner.setValue('');
|
||||||
|
ChdCtrls.controls.other_organisation_owner.clearValidators();
|
||||||
|
this.isOrganisationOwner[i] = false;
|
||||||
|
// console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -154,19 +154,7 @@ public viewerOptions: any = {
|
|||||||
this.amtInwords[index] = this._pd.convertNumberToWords(val.amount);
|
this.amtInwords[index] = this._pd.convertNumberToWords(val.amount);
|
||||||
// this.getOtherIncomeEarnedBy(val.income_earned_by,index);
|
// this.getOtherIncomeEarnedBy(val.income_earned_by,index);
|
||||||
control.push(this.createDetail());
|
control.push(this.createDetail());
|
||||||
let Avaliablity = 1;
|
this.getOtherIncomeEarnedBy(val.income_earned_by,index);
|
||||||
if(val.income_earned_by.length>0){
|
|
||||||
val.income_earned_by.forEach(option => {
|
|
||||||
if(option.id == 0 && option.group_id == 2){
|
|
||||||
Avaliablity = option.id;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if(Avaliablity == 0){
|
|
||||||
this.isIncomeEarnedBy[index] = true;
|
|
||||||
}else if(Avaliablity == 1){
|
|
||||||
this.isIncomeEarnedBy[index] = false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
this.otherIncomeForm.controls['income_details'].setValue(result);
|
this.otherIncomeForm.controls['income_details'].setValue(result);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -545,8 +545,11 @@ export class PdTrigerService {
|
|||||||
.pipe(catchError(this.handleError('operation', [])))
|
.pipe(catchError(this.handleError('operation', [])))
|
||||||
}
|
}
|
||||||
|
|
||||||
getEndUseForLoan(pdid: any): Observable<any> {
|
/** To get Enduse For Dropdown
|
||||||
return this._http.post<any>(this.apiUrl + "getEndUseOfLoan",{ "records":{ "pd_id" : pdid}})
|
* 1) loan details
|
||||||
|
*/
|
||||||
|
getEndUseForLoan(pdid: any,subproductid: any): Observable<any> {
|
||||||
|
return this._http.post<any>(this.apiUrl + "getEndUseOfLoan",{ "records":{"pd_id" : pdid,"sub_product_id":subproductid}})
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user