sheet changes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-03-06 10:19:28 +05:30
parent 440886a9ea
commit e74d827fea
14 changed files with 120 additions and 94 deletions

View File

@ -75,16 +75,13 @@
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field *ngIf="pdMain.fk_product_id.value != '4'" style="width: 28%">
<mat-select placeholder="Sub Product Name" formControlName="fk_subproduct_id"> <mat-select placeholder="Sub Product Name" formControlName="fk_subproduct_id">
<mat-option> <mat-option>Select</mat-option>
Select
</mat-option>
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" > <mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
{{SPL.subproduct_name}} {{SPL.subproduct_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->

View File

@ -32,6 +32,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
subProductList: any; subProductList: any;
lenderList: any; lenderList: any;
lenderBranchList: any; lenderBranchList: any;
customerSegmentAllList: any;
customerSegmentList: any; customerSegmentList: any;
stateList: any = []; stateList: any = [];
cityList: any = []; cityList: any = [];
@ -136,7 +137,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._pd.getCustomersDetails().subscribe( this._pd.getCustomersDetails().subscribe(
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.customerSegmentList = data.records this.customerSegmentAllList = data.records
} }
}, error => this.errorMessage = <any>error); }, error => this.errorMessage = <any>error);
} }
@ -167,6 +168,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
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;
this.subProductList = this.subProductList.filter(item => item.is_others == 0); this.subProductList = this.subProductList.filter(item => item.is_others == 0);
this.customerSegmentList = (productID != '4') ? (this.customerSegmentAllList, this._PDtriggerForm.controls['fk_subproduct_id'].setValue(''))
: (this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')), this._PDtriggerForm.controls['fk_subproduct_id'].setValue(''));
} }
@ -253,7 +256,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
coapplicant_name: [null, Validators.compose([Validators.required])], coapplicant_name: [null, Validators.compose([Validators.required])],
coapplicant_mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], coapplicant_mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
coapplicant_stdcode:[null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])], coapplicant_stdcode:[null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
coapplicant_landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])], coapplicant_landline: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
company_name:[null], company_name:[null],
relationship: [null], relationship: [null],
}); });
@ -341,8 +344,13 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls['fk_product_id'].setValidators([Validators.required]); this._PDtriggerForm.controls['fk_product_id'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity(); this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
if(formValue.fk_product_id != '4'){
this._PDtriggerForm.controls['fk_subproduct_id'].setValidators([Validators.required]); this._PDtriggerForm.controls['fk_subproduct_id'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity(); this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
}
else{
this._PDtriggerForm.controls['fk_subproduct_id'].setValue('');
}
this._PDtriggerForm.controls['fk_pd_type'].setValidators([Validators.required]); this._PDtriggerForm.controls['fk_pd_type'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_pd_type'].updateValueAndValidity(); this._PDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
@ -386,8 +394,13 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls['fk_product_id'].clearValidators(); this._PDtriggerForm.controls['fk_product_id'].clearValidators();
this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity(); this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
if(this._PDtriggerForm.controls.fk_product_id.value != '4'){
this._PDtriggerForm.controls['fk_subproduct_id'].clearValidators(); this._PDtriggerForm.controls['fk_subproduct_id'].clearValidators();
this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity(); this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
}
else{
this._PDtriggerForm.controls['fk_subproduct_id'].setValue('');
}
this._PDtriggerForm.controls['fk_pd_type'].clearValidators(); this._PDtriggerForm.controls['fk_pd_type'].clearValidators();
this._PDtriggerForm.controls['fk_pd_type'].updateValueAndValidity(); this._PDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
@ -473,7 +486,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
"pd_contact_mobileno": formValue.lender_contact_mobile, "pd_contact_mobileno": formValue.lender_contact_mobile,
"pd_contact_landline": lender_landline_no, "pd_contact_landline": lender_landline_no,
"fk_product_id": formValue.fk_product_id, "fk_product_id": formValue.fk_product_id,
"fk_subproduct_id": formValue.fk_subproduct_id, "fk_subproduct_id": formValue.fk_product_id != 4 ? formValue.fk_subproduct_id : '',
"fk_pd_type": formValue.fk_pd_type, "fk_pd_type": formValue.fk_pd_type,
"fk_customer_segment": formValue.fk_customer_segment, "fk_customer_segment": formValue.fk_customer_segment,
"loan_amount": formValue.loan_amount, "loan_amount": formValue.loan_amount,
@ -489,6 +502,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
var pd_applicant_details: any = []; var pd_applicant_details: any = [];
var addresses_details: any = [];
if (formValue.applicant_name) { if (formValue.applicant_name) {
pd_applicant_details.push({ pd_applicant_details.push({
"applicant_name": formValue.applicant_name, "applicant_name": formValue.applicant_name,
@ -529,6 +543,20 @@ export class AddPdComponent implements OnInit, OnDestroy {
pd_applicant_details.push(obj1) pd_applicant_details.push(obj1)
}); });
if (formValue.addresses.length > 0) {
formValue.addresses.forEach((addressElement, itemIndex) => {
let addressobj = {
"addressline1": addressElement.addressline1.toUpperCase(),
"fk_city": addressElement.fk_city,
"fk_state": addressElement.fk_state,
"pincode": addressElement.pincode,
"other_pincode": addressElement.other_pincode,
}
addresses_details.push(addressobj);
});
}
// docs details // docs details
let pd_form: FormData = new FormData(); let pd_form: FormData = new FormData();
@ -544,31 +572,21 @@ export class AddPdComponent implements OnInit, OnDestroy {
AllFilesObj.push(element.doc_name); AllFilesObj.push(element.doc_name);
}); });
pd_form.append("pd_details", JSON.stringify(pd_details)) pd_form.append("pd_details", JSON.stringify(pd_details))
if (pd_applicant_details.length > 0) { if (pd_applicant_details.length > 0) {
pd_form.append("pd_applicant_details", JSON.stringify(pd_applicant_details)) pd_form.append("pd_applicant_details", JSON.stringify(pd_applicant_details))
} }
if(addresses_details.length>0){
pd_form.append("addresses", JSON.stringify(addresses_details));
}
pd_form.append("pd_document_titles", JSON.stringify(AllFilesObj)) pd_form.append("pd_document_titles", JSON.stringify(AllFilesObj))
if (formValue.addtional_requirements.length > 0) { if (formValue.addtional_requirements.length > 0) {
pd_form.append("addtional_requirements", JSON.stringify(formValue.addtional_requirements)) pd_form.append("addtional_requirements", JSON.stringify(formValue.addtional_requirements))
} }
// formValue.addresses.forEach((addressElement, itemIndex) => {
// let addressobj = {
// "addressline": addressElement.addressline.toUpperCase(),
// "fk_city": addressElement.fk_city,
// "fk_state": addressElement.fk_state,
// "pincode": addressElement.pincode,
// "other_pincode": addressElement.other_pincode,
// }
// });
if (formValue.addresses.length > 0) {
pd_form.append("addresses", JSON.stringify(formValue.addresses))
}
this._pd.addPdDetails(pd_form).subscribe(result => { this._pd.addPdDetails(pd_form).subscribe(result => {
if (result.status == 200) { if (result.status == 200) {
this.disableAfterSubmit = false; this.disableAfterSubmit = false;

View File

@ -82,9 +82,9 @@
</ng-container> </ng-container>
<ng-container matColumnDef="Lenderid"> <ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details"> <mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span> <span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span>
<br> <br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span>
<br> <br>
<span *ngIf="details.loan_amount" class="fontsize"> <span *ngIf="details.loan_amount" class="fontsize">
<i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span> <i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>

View File

@ -78,8 +78,8 @@
</ng-container> </ng-container>
<ng-container matColumnDef="Lenderid"> <ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details"> <mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br> <span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br> <span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span> <span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -86,7 +86,8 @@
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 29%"> <!-- <mat-form-field style="width: 29%"> -->
<mat-form-field *ngIf="pdMain.fk_product_id.value != '4'" style="width: 29%">
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id"> <mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>

View File

@ -17,6 +17,7 @@ export class EditPdMasterComponent implements OnInit {
productList:any; productList:any;
subProductList:any; subProductList:any;
lenderList:any; lenderList:any;
customerSegmentAllList:any;
customerSegmentList:any; customerSegmentList:any;
stateList:any; stateList:any;
cityList:any = []; cityList:any = [];
@ -100,7 +101,6 @@ export class EditPdMasterComponent implements OnInit {
if(this.data.records.fk_product_id){ if(this.data.records.fk_product_id){
this.getSubproductList(this.data.records.fk_product_id); this.getSubproductList(this.data.records.fk_product_id);
} }
} }
}, error => this.errorMessage = <any> error); }, error => this.errorMessage = <any> error);
} }
@ -108,7 +108,7 @@ export class EditPdMasterComponent implements OnInit {
this._pd.getCustomersDetails().subscribe( this._pd.getCustomersDetails().subscribe(
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.customerSegmentList=data.records this.customerSegmentAllList=data.records
} }
}, error => this.errorMessage = <any> error); }, error => this.errorMessage = <any> error);
} }
@ -158,7 +158,6 @@ export class EditPdMasterComponent implements OnInit {
} }
} }
// let getpincodeid = this.data.records.pincode != '' ? this.data.records.pincode != null ? (this.pincodeList.filter(data => data.pincode == this.data.records.pincode).pincode_id) // let getpincodeid = this.data.records.pincode != '' ? this.data.records.pincode != null ? (this.pincodeList.filter(data => data.pincode == this.data.records.pincode).pincode_id)
// : this.data.records.pincode // : this.data.records.pincode
// : this.data.records.pincode; // : this.data.records.pincode;
@ -205,14 +204,19 @@ 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;
addressesArray.push(this.createAddresses(obj)); addressesArray.push(this.createAddresses(obj));
}); });
} }
else{ else{
this.addressesDeactivited[0] = true;
addressesArray.push(this.createAddresses(null)); addressesArray.push(this.createAddresses(null));
} }
} }
else{ else{
this.addressesDeactivited[0] = true;
addressesArray.push(this.createAddresses(null)); addressesArray.push(this.createAddresses(null));
} }
}); });
@ -225,6 +229,9 @@ export class EditPdMasterComponent implements OnInit {
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;
this.customerSegmentList=(productID != '4')?this.customerSegmentAllList:this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
// this.customerSegmentList = (productID != '4')?this.customerSegmentAllList:(this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')),this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(''));
} }
// //get city list details based on state id // //get city list details based on state id
@ -272,12 +279,8 @@ export class EditPdMasterComponent implements OnInit {
} }
}; };
addAddresses(index) { addAddresses(index) {
console.log(index);
this.addressesDeactivited[index] = true;
console.log('this.addressesDeactivited[index]',this.addressesDeactivited[index]);
this.addresses = this._EditPDtriggerForm.get('addresses') as FormArray; this.addresses = this._EditPDtriggerForm.get('addresses') as FormArray;
this.addresses.push(this.createAddresses(null)); this.addresses.push(this.createAddresses(null));
} }
removeAddresses(index: number,strflag : any) { removeAddresses(index: number,strflag : any) {

View File

@ -75,8 +75,8 @@
</ng-container> </ng-container>
<ng-container matColumnDef="Lenderid"> <ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details"> <mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br> <span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br> <span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span> <span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -77,8 +77,8 @@
</ng-container> </ng-container>
<ng-container matColumnDef="Lenderid"> <ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details"> <mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br> <span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br> <span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span> <span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -76,8 +76,8 @@
</ng-container> </ng-container>
<ng-container matColumnDef="Lenderid"> <ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details"> <mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br> <span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br> <span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span> <span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -1158,7 +1158,7 @@
</button> </button>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
<mat-card *ngIf="businessForm.controls.others_activity_details['controls'].length>0"> <!--<mat-card *ngIf="businessForm.controls.others_activity_details['controls'].length>0">
<mat-card-header> <mat-card-header>
<mat-card-title>Other Details</mat-card-title> <mat-card-title>Other Details</mat-card-title>
</mat-card-header> </mat-card-header>
@ -1185,7 +1185,7 @@
Add More Products Add More Products
</button> </button>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>-->
<mat-card *ngIf="ExportFlag"> <mat-card *ngIf="ExportFlag">
<mat-card-header> <mat-card-header>
<mat-card-title>Export Sale As a % Total Sales</mat-card-title> <mat-card-title>Export Sale As a % Total Sales</mat-card-title>

View File

@ -166,7 +166,7 @@ export class BusinessInfoComponent implements OnInit {
const retailControl: any = <FormArray>this.businessForm.controls['retail_trading_activity_details']; const retailControl: any = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
const wholesaleControl: any = <FormArray>this.businessForm.controls['wholesale_trading_activity_details']; const wholesaleControl: any = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
const serviceProviderControl: any = <FormArray>this.businessForm.controls['service_provider_activity_details']; const serviceProviderControl: any = <FormArray>this.businessForm.controls['service_provider_activity_details'];
const othersControl: any = <FormArray>this.businessForm.controls['others_activity_details']; // const othersControl: any = <FormArray>this.businessForm.controls['others_activity_details'];
if (data.status == 200) { if (data.status == 200) {
let DocArray: any; let DocArray: any;
@ -553,25 +553,26 @@ export class BusinessInfoComponent implements OnInit {
businessVal.service_provider_activity_details=[]; businessVal.service_provider_activity_details=[];
} }
if(data.records.others_activity_details){ //others type of Activity_details comment
// if(data.records.others_activity_details){
// update others activity details // // update others activity details
let selectedOthers = Object.keys(data.records.others_activity_details).map(function (key) { // let selectedOthers = Object.keys(data.records.others_activity_details).map(function (key) {
return data.records.others_activity_details[key]; // return data.records.others_activity_details[key];
}); // });
if(selectedOthers.length > 0) { // if(selectedOthers.length > 0) {
selectedOthers.forEach((element,index)=>{ // selectedOthers.forEach((element,index)=>{
othersControl.push(this.createOthersActivity()); // othersControl.push(this.createOthersActivity());
}); // });
businessVal.others_activity_details=selectedOthers; // businessVal.others_activity_details=selectedOthers;
} // }
else{ // else{
businessVal.others_activity_details=[]; // businessVal.others_activity_details=[];
} // }
} // }
else { // else {
businessVal.others_activity_details=[]; // businessVal.others_activity_details=[];
} // }
if(businessVal.applicant_use_pos_machines == 'yes'){ if(businessVal.applicant_use_pos_machines == 'yes'){
this.businessForm.controls.no_of_pos_machines.setValue(businessVal.no_of_pos_machines); this.businessForm.controls.no_of_pos_machines.setValue(businessVal.no_of_pos_machines);
const posControl: any = <FormArray>this.businessForm.controls['pos_machines_details']; const posControl: any = <FormArray>this.businessForm.controls['pos_machines_details'];
@ -660,7 +661,7 @@ export class BusinessInfoComponent implements OnInit {
retail_trading_activity_details: this.fb.array([]), retail_trading_activity_details: this.fb.array([]),
wholesale_trading_activity_details: this.fb.array([]), wholesale_trading_activity_details: this.fb.array([]),
service_provider_activity_details: this.fb.array([]), service_provider_activity_details: this.fb.array([]),
others_activity_details: this.fb.array([]), // others_activity_details: this.fb.array([]),
}); });
} }
@ -724,15 +725,15 @@ export class BusinessInfoComponent implements OnInit {
serviceControl.push(this.createServiceActivity()); serviceControl.push(this.createServiceActivity());
} }
if(event.value.exist_status==true && event.value.type_of_activity_id==1){ // if(event.value.exist_status==true && event.value.type_of_activity_id==1){
let othersControl = <FormArray>this.businessForm.controls['others_activity_details']; // let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
othersControl.controls = []; // othersControl.controls = [];
othersControl.setValue([]); // othersControl.setValue([]);
} // }
else if(event.value.exist_status==false && event.value.type_of_activity_id==1){ // else if(event.value.exist_status==false && event.value.type_of_activity_id==1){
let othersControl = <FormArray>this.businessForm.controls['others_activity_details']; // let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
othersControl.push(this.createOthersActivity()); // othersControl.push(this.createOthersActivity());
} // }
// check activity type for make dosument sighted filed dynamically // check activity type for make dosument sighted filed dynamically
this.businessForm.value.manufacturing_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl(this.businessForm.value.export_import_cert, Validators.required)) : this.businessForm.removeControl('export_import_cert'); this.businessForm.value.manufacturing_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl(this.businessForm.value.export_import_cert, Validators.required)) : this.businessForm.removeControl('export_import_cert');
this.businessForm.value.manufacturing_activity_details.length > 0 ? this.businessForm.addControl('factory_cert', new FormControl(this.businessForm.value.factory_cert, Validators.required)) : this.businessForm.removeControl('factory_cert'); this.businessForm.value.manufacturing_activity_details.length > 0 ? this.businessForm.addControl('factory_cert', new FormControl(this.businessForm.value.factory_cert, Validators.required)) : this.businessForm.removeControl('factory_cert');
@ -1208,7 +1209,7 @@ export class BusinessInfoComponent implements OnInit {
this._pd.getAllMasterDatas(master_name).subscribe(data => { this._pd.getAllMasterDatas(master_name).subscribe(data => {
data.records.forEach(val => { data.records.forEach(val => {
let entityTypeControl = <FormArray>this.businessForm.controls['select_business_activity_type']; let entityTypeControl = <FormArray>this.businessForm.controls['select_business_activity_type'];
if (val.isactive == 1) { if (val.isactive == 1 && val.type_of_activity_id != 1) {
this.activityData.push(val); this.activityData.push(val);
} }
}) })
@ -1325,15 +1326,15 @@ export class BusinessInfoComponent implements OnInit {
} }
// add more others details // add more others details
addMoreOthersActivity() { // addMoreOthersActivity() {
let othersControl = <FormArray>this.businessForm.controls['others_activity_details']; // let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
othersControl.push(this.createOthersActivity()); // othersControl.push(this.createOthersActivity());
} // }
deleteOthersActivity(index) { // deleteOthersActivity(index) {
let othersControl = <FormArray>this.businessForm.controls['others_activity_details']; // let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
othersControl.removeAt(index); // othersControl.removeAt(index);
} // }
// update partner group other form control // update partner group other form control
changePartnerGroup(value,key) { changePartnerGroup(value,key) {

View File

@ -34,7 +34,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<!-- <mat-select placeholder="is the Stock is Observed ?" formControlName="stock_observed" > --> <!-- <mat-select placeholder="is the Stock is Observed ?" formControlName="stock_observed" > -->
<mat-select placeholder="Stock" formControlName="stock_observed"> <mat-select placeholder="Stock" formControlName="stock_observed" (selectionChange)="selectedValueofStockObserved($event.value,a,1)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option> <mat-option value="no">No Stock Observed</mat-option>
@ -105,7 +105,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<!-- <mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" > --> <!-- <mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" > -->
<mat-select placeholder="Stock" formControlName="goods_observed"> <mat-select placeholder="Stock" formControlName="goods_observed" (selectionChange)="selectedValueofStockObserved($event.value,b,2)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option> <mat-option value="no">No Stock Observed</mat-option>
@ -183,7 +183,7 @@
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="traded_goods_observed"> <mat-select placeholder="Stock" formControlName="traded_goods_observed" (selectionChange)="selectedValueofStockObserved($event.value,e,3)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option> <mat-option value="no">No Stock Observed</mat-option>
@ -274,7 +274,7 @@
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="traded_goods_observed" > <mat-select placeholder="Stock" formControlName="traded_goods_observed" (selectionChange)="selectedValueofStockObserved($event.value,g,4)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No stock observed</mat-option> <mat-option value="no">No stock observed</mat-option>

View File

@ -484,6 +484,12 @@ tradingFormCreation(val) {
} }
} }
selectedValueofStockObserved(selectedvalue : any,index : number,flag : number){
console.log('selectedvalue',selectedvalue);
console.log('index',index);
console.log('flag',flag);
}
initRetailDetails(datas) { initRetailDetails(datas) {
const tradedGoods = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; const tradedGoods = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods'];
@ -777,7 +783,7 @@ tradingFormCreation(val) {
this._pd.getAllMasterDatas('UOM').subscribe(data => { this._pd.getAllMasterDatas('UOM').subscribe(data => {
data.records.forEach(val => { data.records.forEach(val => {
if (val.isactive == 1) { if (val.isactive == 1 && val.is_land_uom == 0 || val.is_land_uom == 2) {
this.uomData.push(val); this.uomData.push(val);
} }
}) })

View File

@ -233,7 +233,7 @@
</div> </div>
<div fxlayout="row" *ngIf="trdCreditCardFlag"> <div fxlayout="row" *ngIf="trdCreditCardFlag">
<mat-form-field style="width: 90%"> <mat-form-field style="width: 90%">
<input matInput placeholder="What % of Total Trade is done on Credit?" formControlName="trading_products_total_payments_percent_on_credit" <input matInput placeholder="What % of Total Purchase is done on Credit?" formControlName="trading_products_total_payments_percent_on_credit"
type="number" autocomplete="off"> type="number" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>