Changes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-05-09 16:15:25 +05:30
parent dd9358c134
commit 7df6f39b2b
9 changed files with 121 additions and 34 deletions

Binary file not shown.

Binary file not shown.

View File

@ -11,10 +11,13 @@ export class RoleMenuItemsPipe implements PipeTransform {
switch(localStorage.getItem('user_role')){
case '1': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '2': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '3': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '4': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion" && val.state!="reports");
case '5': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion" && val.state!="reports");
case '6': return value.filter(val=>val.state!="setting" && val.state!="personal_discussion" && val.state!="reports");
case '7': return value.filter(val=>val.state!="setting" && val.state!="personal_discussion" && val.state!="reports");
case '8': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '9': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '10': return value;
// default: return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
}
@ -24,10 +27,13 @@ export class RoleMenuItemsPipe implements PipeTransform {
switch(localStorage.getItem('user_role')){
case '1': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '2': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '3': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '4': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion" && val.state!="reports");
case '5': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion" && val.state!="reports");
case '6': return value.filter(val=>val.state!="setting" && val.state!="personal_discussion" && val.state!="reports");
case '7': return value.filter(val=>val.state!="setting" && val.state!="personal_discussion" && val.state!="reports");
case '8': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '9': return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
case '10': return value;
// default: return value.filter(val=>val.state!="setting" && val.state!="quality_check_discussion");
}

View File

@ -1613,8 +1613,9 @@
<mat-card-title>Documents Sighted </mat-card-title>
</mat-card-header>
<mat-card-content class="matcard">
<div fxLayout="row" fxLayoutAlign="space-between none" >
<mat-form-field>
<mat-select placeholder="Shop and Est Act Cert" formControlName="shop_eat_act_cert"
<mat-select placeholder="Shop and Est Act Cert" formControlName="shop_eat_act_cert" (change)="radioChange($event,1)"
required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
@ -1622,8 +1623,17 @@
</mat-select>
<mat-error *ngIf="businessForm.controls['shop_eat_act_cert'].hasError('required')">Shop and Est Act Cert Required</mat-error>
</mat-form-field>
<div right *ngIf="businessForm.controls['shop_eat_act_cert'].value == 'yes'">
<div *ngIf="businessForm.controls['shop_eat_act_cert_pic'].value !== ''" >
<img src="{{businessForm.controls['shop_eat_act_cert_pic'].value}}" style ="width: 100px;height: 100px;" ngxViewer>
<p style="text-align: center">Shop and Est Act Cert Image</p>
<!-- <br> -->
</div>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="space-between none" >
<mat-form-field>
<mat-select placeholder="GST Regn Cert" formControlName="gst_Regn_cert"
<mat-select placeholder="GST Regn Cert" formControlName="gst_Regn_cert" (change)="radioChange($event,2)"
required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
@ -1631,8 +1641,16 @@
</mat-select>
<mat-error *ngIf="businessForm.controls['gst_Regn_cert'].hasError('required')">GST Regn Cert Required</mat-error>
</mat-form-field>
<div fxLayoutAlign="none center" *ngIf="businessForm.controls['gst_Regn_cert'].value == 'yes'">
<div *ngIf="businessForm.controls['gst_Regn_cert_pic'].value !== ''" >
<img src="{{businessForm.controls['gst_Regn_cert_pic'].value}}" style ="width: 100px;height: 100px;" ngxViewer>
<p style="text-align: center">GST Regn Cert Image </p>
</div>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="space-between" >
<mat-form-field *ngIf="businessForm.controls['export_import_cert']">
<mat-select placeholder="Export / Import cert" formControlName="export_import_cert"
<mat-select placeholder="Export / Import cert" formControlName="export_import_cert" (change)="radioChange($event,3)"
required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
@ -1640,16 +1658,33 @@
</mat-select>
<mat-error *ngIf="businessForm.controls['export_import_cert'].hasError('required')">Export / Import cert Required</mat-error>
</mat-form-field>
<div right fxLayoutAlign="none center" *ngIf="businessForm.controls['export_import_cert'] && businessForm.controls['export_import_cert'].value == 'yes'">
<div *ngIf="businessForm.controls['export_import_cert_pic'].value !== ''" >
<img src="{{businessForm.controls['export_import_cert_pic'].value}}" style ="width: 100px;height: 100px;" ngxViewer >
<p style="text-align: center">Export / Import cert Image</p>
</div>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="space-between" >
<mat-form-field *ngIf="businessForm.controls['factory_cert']">
<mat-select placeholder="Factory Cert" formControlName="factory_cert" required>
<mat-select placeholder="Factory Cert" formControlName="factory_cert" required (change)="radioChange($event,4)">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
<mat-error *ngIf="businessForm.controls['factory_cert'].hasError('required')">Factory Cert Required</mat-error>
</mat-form-field>
<div right fxLayoutAlign="none center" *ngIf="businessForm.controls['factory_cert'] && businessForm.controls['factory_cert'].value == 'yes'">
<div *ngIf="businessForm.controls['factory_cert_pic'].value !== ''" >
<img src="{{businessForm.controls['factory_cert_pic'].value}}" style ="width: 100px;height: 100px;" ngxViewer >
<p style="text-align: center">Factory cert Image</p>
</div>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="space-between" >
<mat-form-field *ngIf="businessForm.controls['practice_cert']">
<mat-select placeholder="Cert of Practice" formControlName="practice_cert"
<mat-select placeholder="Cert of Practice" formControlName="practice_cert" (change)="radioChange($event,5)"
required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
@ -1657,23 +1692,47 @@
</mat-select>
<mat-error *ngIf="businessForm.controls['practice_cert'].hasError('required')">Cert of Practice Required</mat-error>
</mat-form-field>
<div right fxLayoutAlign="none center" *ngIf="businessForm.controls['practice_cert'] && businessForm.controls['practice_cert'].value == 'yes'">
<div *ngIf="businessForm.controls['practice_cert_pic'].value !== ''" >
<img src="{{businessForm.controls['practice_cert_pic'].value}}" style ="width: 100px;height: 100px;" ngxViewer >
<p style="text-align: center">Cert of Practice Image</p>
</div>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="space-between" >
<mat-form-field>
<mat-select placeholder="PF Regn" formControlName="pf_regn" required>
<mat-select placeholder="PF Regn" formControlName="pf_regn" required (change)="radioChange($event,6)">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
<mat-error *ngIf="businessForm.controls['pf_regn'].hasError('required')">PF Regn Required</mat-error>
</mat-form-field>
<div right fxLayoutAlign="none center" *ngIf="businessForm.controls['pf_regn'].value == 'yes'">
<div *ngIf="businessForm.controls['pf_regn_pic'].value !== ''" >
<img src="{{businessForm.controls['pf_regn_pic'].value}}" style ="width: 100px;height: 100px;" ngxViewer >
<p style="text-align: center">PF Regn Image</p>
</div>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="space-between" >
<mat-form-field>
<mat-select placeholder="ESIC Regn" formControlName="esic_regn" required>
<mat-select placeholder="ESIC Regn" formControlName="esic_regn" (change)="radioChange($event,7)" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
<mat-error *ngIf="businessForm.controls['esic_regn'].hasError('required')">ESIC Regn Required</mat-error>
</mat-form-field>
<div right fxLayoutAlign="none center" *ngIf="businessForm.controls['esic_regn'].value == 'yes'">
<div *ngIf="businessForm.controls['esic_regn_pic'].value !== ''" >
<img src="{{businessForm.controls['esic_regn_pic'].value}}" style ="width: 100px;height: 100px;" ngxViewer >
<p style="text-align: center">ESIC Regn Image</p>
</div>
</div>
</div>
<mat-form-field>
<mat-select placeholder="Do You Want to Add Other Documents?" formControlName="other_documents"
required>
@ -1724,6 +1783,7 @@
<div class="p-list-main mb-2" style="width: 60%;height: auto;" *ngIf="doc.document_type != 'pdf'">
<div class="p-list">
<div class="top"> <img src="{{doc.document}}" alt="{{doc.document_name}}"></div>
<label *ngIf="doc.document_name != ''"><strong>{{doc.document_name}}</strong></label>
</div>
</div>
</div>

View File

@ -589,7 +589,14 @@ export class BusinessInfoComponent implements OnInit {
}
}
// this.businessForm.setValue(businessVal);
this.businessForm.patchValue(businessVal);
if(data.records.gst_Regn_cert =='yes'){ this.businessForm.addControl('gst_Regn_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('gst_Regn_cert_pic');}
if(data.records.factory_cert =='yes'){ this.businessForm.addControl('factory_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('factory_cert_pic');}
if(data.records.practice_cert_cert =='yes'){ this.businessForm.addControl('practice_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('practice_cert_pic');}
if(data.records.shop_eat_act_cert =='yes'){ alert('if control'); this.businessForm.addControl('shop_eat_act_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('shop_eat_act_cert_pic');}
if(data.records.pf_regn =='yes'){ this.businessForm.addControl('pf_regn_pic', new FormControl('')); }else{ this.businessForm.removeControl('pf_regn_pic');}
if(data.records.esic_regn =='yes'){ this.businessForm.addControl('esic_regn_pic', new FormControl('')); }else{ this.businessForm.removeControl('esic_regn_pic');}
if(data.records.export_import_cert =='yes'){ this.businessForm.addControl('export_import_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('export_import_cert_pic');}
this.businessForm.patchValue(businessVal);
} else {
//Desgn.push(this.createDesignation());
Partnr.push(this.createPartners());
@ -1950,4 +1957,14 @@ export class BusinessInfoComponent implements OnInit {
});
}
}
radioChange(event,Flag){
if(Flag == 1) {event.value =='yes' ? this.businessForm.addControl('shop_eat_act_cert_pic', new FormControl('')) : this.businessForm.removeControl('shop_eat_act_cert_pic');}
if(Flag == 2) {event.value =='yes' ? this.businessForm.addControl('gst_Regn_cert_pic', new FormControl('')) : this.businessForm.removeControl('gst_Regn_cert_pic'); }
if(Flag == 4) {event.value =='yes' ? this.businessForm.addControl('factory_cert_pic', new FormControl('')) : this.businessForm.removeControl('factory_cert_pic');}
if(Flag == 5) {event.value =='yes' ? this.businessForm.addControl('practice_cert_pic', new FormControl('')) : this.businessForm.removeControl('practice_cert_pic');}
if(Flag == 6) {event.value =='yes' ? this.businessForm.addControl('pf_regn_pic', new FormControl('')) : this.businessForm.removeControl('pf_regn_pic');}
if(Flag == 7) {event.value =='yes' ? this.businessForm.addControl('esic_regn_pic', new FormControl('')) : this.businessForm.removeControl('esic_regn_pic');}
if(Flag == 3) {event.value =='yes' ? this.businessForm.addControl('export_import_cert_pic', new FormControl('')) : this.businessForm.removeControl('export_import_cert_pic');}
}
}

View File

@ -512,7 +512,7 @@
*ngFor="let entityType of financialForm.controls.select_working_capital_facilities_availed['controls']; let e = index;"
[formGroupName]="e">
<mat-checkbox class="example-margin" color="primary" formControlName="exist_status"
(click)="changeBusinessActivity(entityType)">{{entityType.controls.name.value}}</mat-checkbox>
(click)="changeWorkingCapitalFacilities(entityType)">{{entityType.controls.name.value}}</mat-checkbox>
</div>
</div>

View File

@ -162,29 +162,29 @@ export class FinancialInfoComponent implements OnInit {
if (check_exist_av.length > 0) {
check_exist_av.forEach(val => {
workingCptlControl.push(this.createEntityType(val));
workingCptlControl.push(this.workingCptl(val));
if (val.exist_status == 1 && val.id == 2) {
this.financialForm.addControl('bank_guarantee', new FormControl('', Validators.required));
this.financialForm.addControl('bank_guarantee', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 3) {
this.financialForm.addControl('cash_credit_limit', new FormControl('', Validators.required));
this.financialForm.addControl('cash_credit_limit', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 4) {
this.financialForm.addControl('factoring', new FormControl('', Validators.required));
this.financialForm.addControl('factoring', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 5) {
this.financialForm.addControl('forfaiting', new FormControl('', Validators.required));
this.financialForm.addControl('forfaiting', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 6) {
this.financialForm.addControl('letter_of_credit', new FormControl('', Validators.required));
this.financialForm.addControl('letter_of_credit', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 7) {
this.financialForm.addControl('od_limit', new FormControl('', Validators.required));
this.financialForm.addControl('od_limit', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 1) {
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl(''));
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl(''));
}
console.log(val);
});
@ -275,7 +275,7 @@ export class FinancialInfoComponent implements OnInit {
if (check_exist_av.length > 0) {
check_exist_av.forEach(val => {
workingCptlControl.push(this.createEntityType(val));
workingCptlControl.push(this.workingCptl(val));
});
}
//financial_date.push(this.createDate());
@ -304,7 +304,7 @@ export class FinancialInfoComponent implements OnInit {
});
}
createEntityType(details: any): FormGroup {
workingCptl(details: any): FormGroup {
return this.fb.group({
id: [details.id, Validators.compose([Validators.required])],
name: [details.name, Validators.compose([Validators.required])],
@ -388,45 +388,45 @@ export class FinancialInfoComponent implements OnInit {
}
else if (event.value.exist_status == false && event.value.id == 2) {
console.log('event.value.exist_status == true && event.value.id == 2',event.value.exist_status,event.value.id)
this.financialForm.addControl('bank_guarantee', new FormControl('', Validators.required));
this.financialForm.addControl('bank_guarantee', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 3) {
this.financialForm.removeControl('cash_credit_limit');
}
else if (event.value.exist_status == false && event.value.id == 3) {
this.financialForm.addControl('cash_credit_limit', new FormControl('', Validators.required));
this.financialForm.addControl('cash_credit_limit', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 4) {
this.financialForm.removeControl('factoring');
}
else if (event.value.exist_status == false && event.value.id == 4) {
this.financialForm.addControl('factoring', new FormControl('', Validators.required));
this.financialForm.addControl('factoring', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 5) {
this.financialForm.removeControl('forfaiting');
}
else if (event.value.exist_status == false && event.value.id == 5) {
this.financialForm.addControl('forfaiting', new FormControl('', Validators.required));
this.financialForm.addControl('forfaiting', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 6) {
this.financialForm.removeControl('letter_of_credit');
}
else if (event.value.exist_status == false && event.value.id == 6) {
this.financialForm.addControl('letter_of_credit', new FormControl('', Validators.required));
this.financialForm.addControl('letter_of_credit', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 7) {
this.financialForm.removeControl('od_limit');
}
else if (event.value.exist_status == false && event.value.id == 7) {
this.financialForm.addControl('od_limit', new FormControl('', Validators.required));
this.financialForm.addControl('od_limit', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 1) {
this.financialForm.removeControl('other_reason_for_working_capital_facilities_availed');
this.financialForm.removeControl('reason_for_working_capital_facilities_availed');
}
else if (event.value.exist_status == false && event.value.id == 1) {
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl(''));
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl(''));
}
// if(event.value.exist_status==true && event.value.id==1){
@ -1901,10 +1901,11 @@ export class FinancialInfoComponent implements OnInit {
this.financialForm.value.date_per_financial['financial_margin_of_loss'].updateValueAndValidity();
}
if (!this.financialForm.valid) {
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
// if (!this.financialForm.valid) {
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
// return;
// }
console.log('this.financialForm.value',this.financialForm.value);
let records = this.financialForm.value;
records.select_working_capital_facilities_availed = records.select_working_capital_facilities_availed.filter(value => value.exist_status == 1);

View File

@ -405,7 +405,8 @@
<div fxFlex="20" class="m-gap p-gap" *ngFor="let doc of documentsAndFilesList">
<div class="p-list-main mb-2" style="width: 60%;height: auto;" *ngIf="doc.document_type != 'pdf'">
<div class="p-list">
<div class="top"> <img src="{{doc.document}}" alt="{{doc.document_name}}"></div>
<div class="top"> <img src="{{doc.document}}" alt="{{doc.document_name}}">
<label *ngIf="doc.document_name != ''"><strong>{{doc.document_name}}</strong></label></div>
</div>
</div>
</div>

View File

@ -353,6 +353,8 @@ export class GeneralInfoComponent implements OnInit {
applicant_name: [elementValue.applicant_name],
is_applicant: [elementValue.is_applicant],
is_person_met: [elementValue.is_person_met],
is_person_met_pic :[elementValue.is_person_met_pic],
is_person_met_id_proof : [elementValue.is_person_met_id_proof],
is_new: [elementValue.is_new],
is_main_applicant: [elementValue.is_main_applicant],
is_active: [elementValue.is_active],