sheet changes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-03-02 20:56:53 +05:30
parent 7fcc111147
commit c94c53777c
20 changed files with 214 additions and 183 deletions

View File

@ -131,7 +131,7 @@
<div formArrayName="addresses" *ngFor="let addresses of pdAddresses.controls; let i = index;"> <div formArrayName="addresses" *ngFor="let addresses of pdAddresses.controls; let i = index;">
<mat-card-content [formGroupName]="i"> <mat-card-content [formGroupName]="i">
<mat-form-field style="width: 96%"> <mat-form-field style="width: 96%">
<textarea matInput autocomplete="off" placeholder="Address at which PD is to be done" formControlName="addressline" style="text-transform: uppercase"></textarea> <textarea matInput autocomplete="off" placeholder="Address at which PD is to be done" formControlName="addressline1" style="text-transform: uppercase"></textarea>
<!-- oninput="this.value = this.value.toUpperCase()" --> <!-- oninput="this.value = this.value.toUpperCase()" -->
<!-- <mat-error *ngIf="pdAddresses.addressline1.hasError('required')">Address1 required.</mat-error> --> <!-- <mat-error *ngIf="pdAddresses.addressline1.hasError('required')">Address1 required.</mat-error> -->
</mat-form-field> </mat-form-field>

View File

@ -268,7 +268,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
get pdAddresses() { return this._PDtriggerForm.get('addresses') as FormArray; } get pdAddresses() { return this._PDtriggerForm.get('addresses') as FormArray; }
createAddresses(): FormGroup { createAddresses(): FormGroup {
return this._fb.group({ return this._fb.group({
addressline: [null], addressline1: [null],
fk_city: [null], fk_city: [null],
fk_state: [null], fk_state: [null],
pincode: [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ pincode: [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
@ -477,7 +477,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
"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,
"addressline1": formValue.addresses[0].addressline.toUpperCase(), "addressline1": formValue.addresses[0].addressline1.toUpperCase(),
"fk_city": formValue.addresses[0].fk_city, "fk_city": formValue.addresses[0].fk_city,
"fk_state": formValue.addresses[0].fk_state, "fk_state": formValue.addresses[0].fk_state,
"pincode": formValue.addresses[0].pincode, "pincode": formValue.addresses[0].pincode,

View File

@ -15,7 +15,7 @@
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>
<mat-card-title>Main Applicant</mat-card-title> <mat-card-title>Applicant 1</mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<mat-form-field style="width: 15%"> <mat-form-field style="width: 15%">
@ -51,9 +51,9 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
<mat-card formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;"> <mat-card formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
<!-- <mat-card-header> <mat-card-header>
<mat-card-title>Co Applicant</mat-card-title> <mat-card-title>Applicant {{i+2}}</mat-card-title>
</mat-card-header> --> </mat-card-header>
<mat-card-content [formGroupName]="i"> <mat-card-content [formGroupName]="i">
<mat-form-field style="width: 15%"> <mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="applicant_title_name"> <mat-select placeholder="Title" formControlName="applicant_title_name">

View File

@ -144,7 +144,7 @@
<mat-form-field style="width: 96%"> <mat-form-field style="width: 96%">
<textarea matInput autocomplete="off" placeholder="Address at which PD is to be done" <textarea matInput autocomplete="off" placeholder="Address at which PD is to be done"
formControlName="addressline" style="text-transform: uppercase"></textarea> formControlName="addressline1" style="text-transform: uppercase"></textarea>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 32%"> <mat-form-field style="width: 32%">
@ -187,10 +187,15 @@
<mat-card-actions align="end"> <mat-card-actions align="end">
<button mat-raised-button mat-icon-button matTooltip="Delete" <button mat-raised-button mat-icon-button matTooltip="Delete"
matTooltipPosition="above" (click)="removeAddresses(i)" matTooltipPosition="above" (click)="removeAddresses(i,'Deactivited')"
type="button" *ngIf="pdAddresses.controls.length > 1 && addressesDeactivited[i]"> type="button" *ngIf="pdAddresses.controls.length > 1 && addressesDeactivited[i]">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
<button type="button" mat-flat-button (click)="removeAddresses(i,'Activited')"
matTooltipPosition="above" color="primary" *ngIf="!addressesDeactivited[i]">
<strong>Deleted</strong>
</button>
&nbsp;&nbsp;
<button type="button" mat-raised-button mat-icon-button (click)="addAddresses()" *ngIf="last" <button type="button" mat-raised-button mat-icon-button (click)="addAddresses()" *ngIf="last"
matTooltip="Add More Additional Addresses" matTooltipPosition="above" matTooltip="Add More Additional Addresses" matTooltipPosition="above"

View File

@ -196,15 +196,15 @@ export class EditPdMasterComponent implements OnInit {
this.addressesDeactivited[index] = true; this.addressesDeactivited[index] = true;
let obj = { let obj = {
pd_address_id:val.pd_address_id, pd_address_id:val.pd_address_id,
addressline: val.addressline.toUpperCase(), addressline1: val.addressline1.toUpperCase(),
fk_city: val.fk_city, fk_city: val.fk_city,
fk_state: val.fk_state, fk_state: val.fk_state,
  pincode: val.pincode,   pincode: val.pincode_id,
other_pincode:val.other_pincode, other_pincode:val.other_pincode,
isactive:1, isactive:1,
} }
this.getCityList(val.fk_state,index); this.getCityList(val.fk_state,index);
this.getPincode(val.pincode,index); this.getPincode(val.pincode_id,index);
addressesArray.push(this.createAddresses(obj)); addressesArray.push(this.createAddresses(obj));
}); });
} }
@ -250,7 +250,7 @@ export class EditPdMasterComponent implements OnInit {
return this._fb.group({ return this._fb.group({
fk_pd_id:[this.pdid], fk_pd_id:[this.pdid],
pd_address_id:[null], pd_address_id:[null],
addressline: [null], addressline1: [null],
fk_city: [null], fk_city: [null],
fk_state: [null], fk_state: [null],
pincode: [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ pincode: [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
@ -262,7 +262,7 @@ export class EditPdMasterComponent implements OnInit {
return this._fb.group({ return this._fb.group({
fk_pd_id:[this.pdid], fk_pd_id:[this.pdid],
pd_address_id:[data.pd_address_id], pd_address_id:[data.pd_address_id],
  addressline: [data.addressline.toUpperCase()],   addressline1: [data.addressline1.toUpperCase()],
fk_city: [data.fk_city], fk_city: [data.fk_city],
fk_state: [data.fk_state], fk_state: [data.fk_state],
  pincode : [data.pincode],   pincode : [data.pincode],
@ -276,10 +276,17 @@ export class EditPdMasterComponent implements OnInit {
this.addresses.push(this.createAddresses(null)); this.addresses.push(this.createAddresses(null));
} }
removeAddresses(index: number) { removeAddresses(index: number,strflag : any) {
const address_control = <FormArray>this._EditPDtriggerForm.controls['addresses']; const address_control = <FormArray>this._EditPDtriggerForm.controls['addresses'];
if(strflag == 'Deactivited'){
address_control.controls[index]['controls'].isactive.setValue(0); address_control.controls[index]['controls'].isactive.setValue(0);
this.addressesDeactivited[index] = false; this.addressesDeactivited[index] = false;
}
else if(strflag == 'Activited'){
address_control.controls[index]['controls'].isactive.setValue(1);
this.addressesDeactivited[index] = true;
}
// console.log('address_control',address_control); // console.log('address_control',address_control);
// console.log('address_control.controls[index]',address_control.controls[index]); // console.log('address_control.controls[index]',address_control.controls[index]);
// console.log('address_control.controls[index][controls]',address_control.controls[index]['controls']); // console.log('address_control.controls[index][controls]',address_control.controls[index]['controls']);
@ -432,7 +439,7 @@ export class EditPdMasterComponent implements OnInit {
"fk_pd_type": my_array.fk_pd_type, "fk_pd_type": my_array.fk_pd_type,
"fk_customer_segment": my_array.fk_customer_segment, "fk_customer_segment": my_array.fk_customer_segment,
"loan_amount": my_array.loan_amount, "loan_amount": my_array.loan_amount,
  "addressline1": filteredAddressesdata[0].addressline.toUpperCase(),   "addressline1": filteredAddressesdata[0].addressline1.toUpperCase(),
"fk_city": filteredAddressesdata[0].fk_city, "fk_city": filteredAddressesdata[0].fk_city,
"fk_state": filteredAddressesdata[0].fk_state, "fk_state": filteredAddressesdata[0].fk_state,
  "pincode": filteredAddressesdata[0].pincode,   "pincode": filteredAddressesdata[0].pincode,

View File

@ -79,7 +79,7 @@ export class AddressComponent implements OnInit {
private _pd: PdTrigerService, private _pd: PdTrigerService,
private dialogRef: MatDialogRef<AddressComponent>, private dialogRef: MatDialogRef<AddressComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { @Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
// console.log('pd_all_details',pd_all_details);
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 5; this.form_id = 5;
@ -216,16 +216,17 @@ export class AddressComponent implements OnInit {
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.addressesList = data.records.filter(item => item.isactive == 1); this.addressesList = data.records.filter(item => item.isactive == 1);
console.log('this.addressesList',this.addressesList);
if (this.addressesList.length > 0) { if (this.addressesList.length > 0) {
this.addressesList.forEach((val,index)=>{ this.addressesList.forEach((val,index)=>{
let obj = { let obj = {
'address': val.addressline, 'address': val.addressline1,
'address_type': '', 'address_type': '',
'address_type_others': '', 'address_type_others': '',
'state': val.fk_state, 'state': val.fk_state,
'city': val.fk_city, 'city': val.fk_city,
'pincode': val.pincode, 'pincode': val.pincode_id,
'pincode_others': val.other_pincode, 'pincode_others': val.other_pincode,
'locality': '', 'locality': '',
'locality_others': '', 'locality_others': '',
@ -237,7 +238,7 @@ export class AddressComponent implements OnInit {
'uom_others': '' 'uom_others': ''
} }
this.getCityAndPincodeDetails(val.fk_state,index); this.getCityAndPincodeDetails(val.fk_state,index);
this.getOtherPincode(val.pincode,index); this.getOtherPincode(val.pincode_id,index);
control.push(this.createAddresses(obj)); control.push(this.createAddresses(obj));
}); });
} }

View File

@ -51,6 +51,31 @@
<input matInput placeholder="Specify Other Property Type" formControlName="other_property_type" autocomplete="off"> <input matInput placeholder="Specify Other Property Type" formControlName="other_property_type" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != ''">
<input matInput placeholder="Address of the Property" formControlName="address_of_the_property"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != ''">
<input matInput placeholder="Description of the Property" formControlName="describe_of_the_property_asset"
autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<input matInput placeholder="Area Covered" formControlName="area_covered_by_this_property"
autocomplete="off">
</mat-form-field>
<mat-form-field style="width:45%">
<mat-select placeholder="Unit of Measurement" formControlName="uom_of_the_property" (selectionChange)="setRequiredValidation($event.value,detail,6)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let uom of m_uom_type" [value]="uom.uom_id">{{ uom.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="detail.get('uom_of_the_property').value == 1" style="width:45%">
<input matInput placeholder="Specify Unit of Measurement" formControlName="other_uom" autocomplete="off">
</mat-form-field>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -71,6 +71,8 @@ export class AssetsInfoComponent implements OnInit {
public m_vehicle_type = []; public m_vehicle_type = [];
public m_uom_type = [];
private notifier: NotifierService; private notifier: NotifierService;
existCompanyList: any =[]; existCompanyList: any =[];
mergeCompanyApplicant: any=[]; mergeCompanyApplicant: any=[];
@ -149,6 +151,7 @@ export class AssetsInfoComponent implements OnInit {
//this.getM_Relation(); //this.getM_Relation();
//this.getM_InsuranceType(); //this.getM_InsuranceType();
this.getM_Vehicle_Type(); this.getM_Vehicle_Type();
this.getM_UOM_Type();
} }
// ====================== // ======================
@ -221,6 +224,15 @@ export class AssetsInfoComponent implements OnInit {
}) })
} }
getM_UOM_Type() {
this.pdTrigerService.getAllMasterDatas('UOM').subscribe(
data => {
this.m_uom_type = data.records.filter(data => data.isactive == 1 && data. is_land_uom == 1 || data. is_land_uom == 2);
// console.log('this.m_uom_type',data.records,this.m_uom_type);
//
})
}
// getM_InsuranceType() { // getM_InsuranceType() {
// this.pdTrigerService.getAllMasterDatas('INSURANCETYPE').subscribe( // this.pdTrigerService.getAllMasterDatas('INSURANCETYPE').subscribe(
// data => { // data => {
@ -372,7 +384,12 @@ export class AssetsInfoComponent implements OnInit {
loadProperty() { loadProperty() {
return this._formBuilder.group({ return this._formBuilder.group({
property_type: [''], property_type: [''],
other_property_type: [''] other_property_type: [''],
address_of_the_property :[''],
describe_of_the_property_asset :[''],
area_covered_by_this_property :[''],
uom_of_the_property:[''],
other_uom:['']
}); });
} }
@ -452,7 +469,12 @@ export class AssetsInfoComponent implements OnInit {
loadPropertyWithData(data) { loadPropertyWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
property_type: [data.property_type], property_type: [data.property_type],
other_property_type: [data.other_property_type] other_property_type: [data.other_property_type],
address_of_the_property :[data.address_of_the_property],
describe_of_the_property_asset :[data.describe_of_the_property_asset],
area_covered_by_this_property :[data.area_covered_by_this_property],
uom_of_the_property:[data.uom_of_the_property],
other_uom : [data.other_uom]
//property_type:[''] //property_type:['']
}); });
} }
@ -626,7 +648,10 @@ export class AssetsInfoComponent implements OnInit {
case '2': { case '2': {
let array_data : any; let array_data : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type,
'address_of_the_property' :datas.address_of_the_property,'describe_of_the_property_asset' :datas.describe_of_the_property_asset,
'uom_of_the_property':datas.uom_of_the_property,
'area_covered_by_this_property' :datas.area_covered_by_this_property,'other_uom':datas.other_uom };
}); });
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadPropertyWithData(array_data)); control.push(this.loadPropertyWithData(array_data));
@ -861,6 +886,12 @@ export class AssetsInfoComponent implements OnInit {
: item.controls.other_vehicle_type.clearValidators(); : item.controls.other_vehicle_type.clearValidators();
item.controls.other_vehicle_type.updateValueAndValidity(); item.controls.other_vehicle_type.updateValueAndValidity();
} }
if(flag == 6){
value==1
? item.controls.other_uom.setValidators([Validators.required])
: item.controls.other_uom.clearValidators();
item.controls.other_uom.updateValueAndValidity();
}
} }

View File

@ -23,7 +23,7 @@
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>
<mat-card-title> <mat-card-title>
<p>Address Details {{itemrow.get('address_label').value | titlecase}}</p> <p>Address Details {{ " : " + itemrow.get('address_label').value | titlecase}}</p>
</mat-card-title> </mat-card-title>
</mat-card-header> </mat-card-header>

View File

@ -211,7 +211,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
let addressType = data.address_type != 1 ? selectedAddressType.address_type : data.address_type_others; let addressType = data.address_type != 1 ? selectedAddressType.address_type : data.address_type_others;
this.placeholderName[inx] = 'Was any business activity seen at the ' + addressType + ' during PD visit?'; this.placeholderName[inx] = 'Was any business activity seen at the ' + addressType + ' during PD visit?';
let addressLabel = " : " + address + ' / ' + addressType; let addressLabel = address + ' / ' + addressType;
let vals = { let vals = {
address_label:addressLabel, address_label:addressLabel,

View File

@ -207,25 +207,14 @@ export class ClientInfoComponent implements OnInit {
// let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) { // let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
// return dataForm.main_raw_materials[key]; // return dataForm.main_raw_materials[key];
// }); // });
// let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials; if(dataForm.manufacturing_details){
let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials;
// this.initManufacturingProductsDetails(api_main_raw_materials); this.initManufacturingProductsDetails(api_main_raw_materials);
// this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null);
if(dataForm.manufacturing_details[0] !== null){
alert('not null manu');
let api_main_raw_materials = Object.keys(dataForm.manufacturing_details).map(function (key) {
return dataForm.manufacturing_details[key];
});
this.initManufacturingProductsDetails(api_main_raw_materials[0]['main_raw_materials']);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(api_main_raw_materials[0]['main_raw_materials_total_payments_percent_on_credit'] || null);
} }
else{ else{
alert('null manu');
this.initManufacturingProductsDetails(null); this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
} }
} }
@ -235,26 +224,16 @@ export class ClientInfoComponent implements OnInit {
// let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) { // let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
// return dataForm.trading_products[key]; // return dataForm.trading_products[key];
// }); // });
// let api_trading_products = dataForm.trade_details[0].trading_products; if(dataForm.trade_details){
let api_trading_products = dataForm.trade_details[0].trading_products;
// this.initTradingProductsDetails(api_trading_products); this.initTradingProductsDetails(api_trading_products);
// this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null);
if(dataForm.trade_details[0] !== null){
// alert('not null manu');
let api_trading_products = Object.keys(dataForm.trade_details).map(function (key) {
return dataForm.trade_details[key];
});
this.initTradingProductsDetails(api_trading_products[0]['trading_products']);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0]['trading_products_total_payments_percent_on_credit'] || null);
} }
else{ else{
// alert('null manu');
this.initTradingProductsDetails(null);- this.initTradingProductsDetails(null);-
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
} }
} }
// Load form details for the service provider prduct details // Load form details for the service provider prduct details
@ -266,24 +245,14 @@ export class ClientInfoComponent implements OnInit {
// let api_service_provider_products = dataForm.service_provider_details[0].service_products; // let api_service_provider_products = dataForm.service_provider_details[0].service_products;
// this.initServiceProviderProductsDetails(api_service_provider_products); // this.initServiceProviderProductsDetails(api_service_provider_products);
// this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null); // this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null);
if(dataForm.service_provider_details[0] !== null){ if(dataForm.service_provider_details){
// alert('not null manu'); let api_service_provider_products = dataForm.service_provider_details[0].service_products;
let api_service_provider_products = Object.keys(dataForm.manufacturing_details).map(function (key) { this.initServiceProviderProductsDetails(api_service_provider_products);
return dataForm.manufacturing_details[key]; this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null);
});
this.initServiceProviderProductsDetails(api_service_provider_products[0]['service_products']);
// this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null);
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(api_service_provider_products[0]['service_products_total_payments_percent_on_credit'] || null);
} }
else{ else{
// alert('null manu');
this.initServiceProviderProductsDetails(null); this.initServiceProviderProductsDetails(null);
// this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null); this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
} }
} }
// Load form details for the retail trading details // Load form details for the retail trading details

View File

@ -157,7 +157,7 @@ export class CurrentLoanComponent implements OnInit {
//this.selectedLoanTakenBy(val.loan_taken_by,index); //this.selectedLoanTakenBy(val.loan_taken_by,index);
let objs = { let objs = {
'label': val.loan_amount, 'label': val.label,
'loan_amount': val.loan_amount, 'loan_amount': val.loan_amount,
'frequency':val.frequency, 'frequency':val.frequency,
'other_frequency':val.other_frequency, 'other_frequency':val.other_frequency,
@ -234,12 +234,12 @@ export class CurrentLoanComponent implements OnInit {
let labelarray : any = []; let labelarray : any = [];
this.dataFromAssets.forEach((val,index) => { this.dataFromAssets.forEach((val,index) => {
if(val.mode == 0){ if(val.mode == 0){
let owner = val.owner_name.map((e => { let owner = val.owner_name.map((e => {
return e.name.split(',') return e.name.split(',')
})); }));
labelarray[index] = val.mode_name +' - '+owner ; // labelarray[index] = ' : '+owner +' - '+ val.mode_name.split("/")[0] + ' ( ' + val.mode_name.split("/")[1] + ' )';
labelarray[index] = ' : '+owner +' - '+ val.mode_name;
} }
if(val.mode == 1){ if(val.mode == 1){

View File

@ -42,14 +42,17 @@
<mat-option *ngFor="let list of m_recommendationList" [value]="list.pdofficer_recommendation_id">{{ list.pdofficer_recommendation }}</mat-option> <mat-option *ngFor="let list of m_recommendationList" [value]="list.pdofficer_recommendation_id">{{ list.pdofficer_recommendation }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 3">
<input matInput autocomplete="off" placeholder="Specify Reason for Negative" formControlName="enter_reason_for_negative">
</mat-form-field>
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 1"> <mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 1">
<input matInput autocomplete="off" placeholder="Specify PD Officers Recommendation" formControlName="others_pd_officers_recommendation"> <input matInput autocomplete="off" placeholder="Specify PD Officers Recommendation" formControlName="others_pd_officers_recommendation">
</mat-form-field>
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 2">
<input matInput autocomplete="off" placeholder="Reasons for marking PD status as Positive" formControlName="reason_for_positive">
</mat-form-field>
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 3">
<input matInput autocomplete="off" placeholder="Reasons for marking PD status as Negative" formControlName="reason_for_negative">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 4"> <mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 4">
<input matInput autocomplete="off" placeholder="Specify Reason for Refer to Credit" formControlName="enter_reason_for_refer_to_credit"> <input matInput autocomplete="off" placeholder="Reasons for marking PD status as 'Refer to Credit" formControlName="reason_for_refer_to_credit">
</mat-form-field> </mat-form-field>
</mat-card> </mat-card>
</mat-dialog-content> </mat-dialog-content>
@ -57,7 +60,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left"> <div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%"> <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label> <mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="final_form_remarks" required></textarea> <textarea matInput placeholder="Remarks" formControlName="final_form_remarks"></textarea>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="40" align="end"> <div fxFlex="40" align="end">

View File

@ -69,9 +69,10 @@ export class FinalRemarksComponent implements OnInit {
is_service_provided: ['', Validators.required], is_service_provided: ['', Validators.required],
pd_officers_recommendation:['', Validators.required], pd_officers_recommendation:['', Validators.required],
others_pd_officers_recommendation:[''], others_pd_officers_recommendation:[''],
enter_reason_for_negative:[''], reason_for_positive:[''],
enter_reason_for_refer_to_credit:[''], reason_for_negative:[''],
final_form_remarks: ['',Validators.required] reason_for_refer_to_credit:[''],
final_form_remarks: ['']
}); });
this.getM_Type(); this.getM_Type();
this.getM_Recommendation(); this.getM_Recommendation();
@ -106,8 +107,9 @@ export class FinalRemarksComponent implements OnInit {
this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour); this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour);
this._finalRemarkForm.controls.pd_officers_recommendation.setValue(data.records.pd_officers_recommendation); this._finalRemarkForm.controls.pd_officers_recommendation.setValue(data.records.pd_officers_recommendation);
this._finalRemarkForm.controls.others_pd_officers_recommendation.setValue(data.records.others_pd_officers_recommendation); this._finalRemarkForm.controls.others_pd_officers_recommendation.setValue(data.records.others_pd_officers_recommendation);
this._finalRemarkForm.controls.enter_reason_for_negative.setValue(data.records.enter_reason_for_negative); this._finalRemarkForm.controls.reason_for_positive.setValue(data.records.reason_for_positive);
this._finalRemarkForm.controls.enter_reason_for_refer_to_credit.setValue(data.records.enter_reason_for_refer_to_credit); this._finalRemarkForm.controls.reason_for_negative.setValue(data.records.reason_for_negative);
this._finalRemarkForm.controls.reason_for_refer_to_credit.setValue(data.records.reason_for_refer_to_credit);
this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided); this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided);
this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks); this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks);
@ -216,60 +218,64 @@ export class FinalRemarksComponent implements OnInit {
if(e==1){ if(e==1){
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]); this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]);
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators(); this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_negative'].setValue('');
this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
this._finalRemarkForm.controls['reason_for_positive'].setValue('');
this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
this._finalRemarkForm.controls['reason_for_negative'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue('');
} }
if(e==2){ if(e==2){
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators(); this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue(''); this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators(); this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_negative'].setValue('');
this._finalRemarkForm.controls['reason_for_positive'].setValidators([Validators.required]);
this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
this._finalRemarkForm.controls['reason_for_negative'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue('');
} }
if(e==3){ if(e==3){
this._finalRemarkForm.controls['enter_reason_for_negative'].setValidators([Validators.required]);
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue(''); this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue(''); this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators(); this._finalRemarkForm.controls['reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
this._finalRemarkForm.controls['reason_for_positive'].setValue('');
this._finalRemarkForm.controls['reason_for_negative'].setValidators([Validators.required]);
} }
if(e==4){ if(e==4){
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValidators([Validators.required]);
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue(''); this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators(); this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['reason_for_refer_to_credit'].setValidators([Validators.required]);
this._finalRemarkForm.controls['reason_for_positive'].clearValidators();
this._finalRemarkForm.controls['reason_for_positive'].setValue('');
this._finalRemarkForm.controls['reason_for_negative'].setValue('');
this._finalRemarkForm.controls['reason_for_negative'].clearValidators();
}
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_negative'].setValue(''); this._finalRemarkForm.controls['reason_for_positive'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators(); this._finalRemarkForm.controls['reason_for_negative'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
}
} }
} }

View File

@ -64,7 +64,7 @@
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:60%"> <mat-form-field style="width:60%">
<input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" <input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %"
formControlName="financial_annualsales_variation" formControlName="financial_annualsales_variation" [ngClass]="details.get('financial_annualsales_variation').value > 0 ? 'greenhighlight' : 'highlight'"
(keypress)="keyPress($event)" readonly> (keypress)="keyPress($event)" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annualsales_variation').value != '' "> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annualsales_variation').value != '' ">
<span *ngIf="details.get('financial_annualsales_variation').value == 0"> <span *ngIf="details.get('financial_annualsales_variation').value == 0">
@ -137,12 +137,11 @@
</div> </div>
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" <input matInput autocomplete="off" [ngClass]="details.controls['financial_variation'].value > 0 ? 'greenhighlight' : 'highlight'"
placeholder="Profit Variation from Previous Year in %" placeholder="Profit Variation from Previous Year in %"
formControlName="financial_variation" (keypress)="keyPress($event)" formControlName="financial_variation" (keypress)="keyPress($event)"
readonly> readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_variation').value != '' " <mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_variation').value != '' ">
[ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}">
<span *ngIf="details.get('financial_variation').value == 0"> <span *ngIf="details.get('financial_variation').value == 0">
No difference in Profit in FY <i> No difference in Profit in FY <i>
{{details.get('financial_year').value}} </i> over {{details.get('financial_year').value}} </i> over
@ -170,13 +169,13 @@
</span> </span>
</mat-hint> </mat-hint>
<!-- “Increase in Sales in FY 2017-2018 over sales in FY 2016-2017 is 11.11%” --> <!-- “Increase in Sales in FY 2017-2018 over sales in FY 2016-2017 is 11.11%” -->
<!-- [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" <input matInput autocomplete="off" [ngClass]="details.get('financial_profit_to_sale_variation').value > 0 ? 'greenhighlight' : 'highlight'"
placeholder="Variation of Profit % over sales" formControlName="financial_profit_to_sale_variation" placeholder="Variation of Profit % over sales" formControlName="financial_profit_to_sale_variation"
(keypress)="keyPress($event)" readonly> (keypress)="keyPress($event)" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_profit_to_sale_variation').value != '' " <mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_profit_to_sale_variation').value != '' ">
[ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}">
<span *ngIf="details.get('financial_profit_to_sale_variation').value == 0"> <span *ngIf="details.get('financial_profit_to_sale_variation').value == 0">
No difference in Profit sales % in FY <i> No difference in Profit sales % in FY <i>
{{details.get('financial_year').value}} </i> over {{details.get('financial_year').value}} </i> over

View File

@ -164,12 +164,12 @@
<!-- companies end --> <!-- companies end -->
<!-- Person Relationship Starts Here --> <!-- Person Relationship Starts Here -->
<mat-card> <mat-card *ngIf="_generalForm.controls.persons_with_relationships['controls'].length>1">
<mat-card-header> <mat-card-header>
<mat-card-title> Relationship Between Individuals </mat-card-title> <mat-card-title> Relationship Between Individuals </mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<mat-table [dataSource]="relationSource" *ngIf="_generalForm.controls.persons_with_relationships['controls'].length>0" <mat-table [dataSource]="relationSource"
formArrayName="persons_with_relationships"> formArrayName="persons_with_relationships">
<ng-container matColumnDef="applicant_name"> <ng-container matColumnDef="applicant_name">
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell> <mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
@ -377,7 +377,7 @@
</div> </div>
<div fxFlex="40" align="end"> <div fxFlex="40" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save"
matTooltipPosition="above" (click)="submitGeneralForm(_generalForm.value)"> matTooltipPosition="above" [disabled]="disableAfterSubmit===true" (click)="submitGeneralForm(_generalForm.value)">
<mat-icon>save</mat-icon> <mat-icon>save</mat-icon>
</button> </button>
</div> </div>

View File

@ -35,6 +35,8 @@ export class GeneralInfoComponent implements OnInit {
errorMessage: any; errorMessage: any;
maxDate: any; maxDate: any;
disableAfterSubmit : boolean;
public pd_applicants_details: any; public pd_applicants_details: any;
public _generalForm: FormGroup; public _generalForm: FormGroup;
private notifier: NotifierService; private notifier: NotifierService;
@ -70,6 +72,7 @@ export class GeneralInfoComponent implements OnInit {
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.disableAfterSubmit = false;
} }
/********************** Constructor Section Ends Here ****************/ /********************** Constructor Section Ends Here ****************/
@ -587,7 +590,7 @@ export class GeneralInfoComponent implements OnInit {
// submit form details // submit form details
submitGeneralForm(formData: any) { submitGeneralForm(formData: any) {
if (this._generalForm.invalid) { if (this._generalForm.invalid) {
this.disableAfterSubmit = false;
this.validateAllFormFields(this._generalForm); this.validateAllFormFields(this._generalForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return; return;
@ -597,6 +600,7 @@ export class GeneralInfoComponent implements OnInit {
// this.notifier.notify('warning', 'Please Choose Name of Person Met.!'); // this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
// } // }
else { else {
this.disableAfterSubmit = true;
let saveRecords: any = {} let saveRecords: any = {}
saveRecords.pdid = formData.pdid; saveRecords.pdid = formData.pdid;
saveRecords.formid = formData.formid; saveRecords.formid = formData.formid;
@ -613,8 +617,8 @@ export class GeneralInfoComponent implements OnInit {
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() => { setTimeout(() => {
this.dialogRef.close(); this.dialogRef.close();
this.disableAfterSubmit = false;
}, 3000); }, 3000);
} }
else { else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');

View File

@ -183,52 +183,32 @@ export class SupplierInfoComponent implements OnInit {
// let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) { // let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
// return dataForm.main_raw_materials[key]; // return dataForm.main_raw_materials[key];
// }); // });
// let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials;
// this.initManufacturingProductsDetails(api_main_raw_materials);
// this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null);
if(dataForm.manufacturing_details[0] !== null){ if(dataForm.manufacturing_details[0] !== null){
// alert('not null manu'); let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials;
let api_main_raw_materials = Object.keys(dataForm.manufacturing_details).map(function (key) {
return dataForm.manufacturing_details[key];
});
this.initManufacturingProductsDetails(api_main_raw_materials[0]['main_raw_materials']);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(api_main_raw_materials[0]['main_raw_materials_total_payments_percent_on_credit'] || null);
this.initManufacturingProductsDetails(api_main_raw_materials);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null);
} }
else{ else{
// alert('null manu');
this.initManufacturingProductsDetails(null); this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
} }
let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id ==4); let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id ==4);
if(arr1.length > 0) { if(arr1.length > 0) {
console.log('saas'); if(dataForm.trade_details[0] !== null){
// let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) { // let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
// return dataForm.trading_products[key]; // return dataForm.trading_products[key];
// }); // });
// let api_trading_products = dataForm.trade_details[0].trading_products; let api_trading_products = dataForm.trade_details[0].trading_products;
// this.initTradingProductsDetails(api_trading_products); this.initTradingProductsDetails(api_trading_products);
// this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null);
if(dataForm.trade_details[0] !== null){
alert('not null trade');
let api_trading_products = Object.keys(dataForm.trade_details).map(function (key) {
return dataForm.trade_details[key];
});
console.log(api_trading_products[0]['trading_products']);
this.initTradingProductsDetails(api_trading_products[0]['trading_products']);
// this.initTradingProductsDetails(api_trading_products['trading_products']);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(api_trading_products[0]['trading_products_total_payments_percent_on_credit'] || null);
} }
else{ else{
alert('null trade');
this.initTradingProductsDetails(null); this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
} }
} }
this.noRecordsFound = true; this.noRecordsFound = true;
@ -247,7 +227,7 @@ export class SupplierInfoComponent implements OnInit {
this.initManufacturingProductsDetails(null); this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
} }
let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4); let arr1 = record.filter(data => data.type_of_activity_id == 3 || 4);
if(arr1.length > 0) { if(arr1.length > 0) {
this.initTradingProductsDetails(null); this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);

View File

@ -112,7 +112,8 @@
<span><i class="fa-1x fa fa-map-marker" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i></span> <span><i class="fa-1x fa fa-map-marker" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i></span>
</div> </div>
<div fxFlex="90"> <div fxFlex="90">
<span *ngIf="addresses.state_name" class="hover-icon"> {{addresses.addressline}},<br> {{addresses.city_name}},<br>{{addresses.state_name}}-{{addresses.pincode == 1 ? addresses.other_pincode : addresses.pincode_display }} </span> <!-- <span *ngIf="addresses.state_name" class="hover-icon"> {{addresses.addressline}},<br> {{addresses.city_name}},<br>{{addresses.state_name}}-{{addresses.pincode == 1 ? addresses.other_pincode : addresses.pincode_display }} </span> -->
<span *ngIf="addresses.state_name" class="hover-icon"> {{addresses.addressline1}},<br> {{addresses.city_name}},<br>{{addresses.state_name}}-{{addresses.pincode_id == 1 ? addresses.other_pincode : addresses.pincode }} </span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -182,11 +182,11 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// }) // })
// } // }
Maponclick(master: any) { // Maponclick(master: any) {
let url = "https://www.google.com/maps/place/" // let url = "https://www.google.com/maps/place/"
let concat_url = url + master.addressline1 + '/' + master.city_name + ',' + master.pincode + ',' + master.state_name; // let concat_url = url + master.addressline1 + '/' + master.city_name + ',' + master.pincode + ',' + master.state_name;
window.open(concat_url, '_blank'); // window.open(concat_url, '_blank');
} // }
editPdMaster(masterData: any, flag) { editPdMaster(masterData: any, flag) {
let record = { let record = {