add n editpd billing to added

This commit is contained in:
sriram-at-840620226347 2020-02-20 18:58:50 +05:30
parent 2d511d33a1
commit 71e1026fed
4 changed files with 44 additions and 10 deletions

View File

@ -28,6 +28,15 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-select placeholder="Billing To" formControlName="sub_entity_id">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option> Select </mat-option>
<mat-option *ngFor="let LL of billingtolist" [value]="LL.entity_id" >
{{LL.short_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->

View File

@ -68,6 +68,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
cityData: any=[];
stateData: any=[];
pincodeData: any=[];
billingtolist: any;
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
private titleCase : TitleCasePipe,private userService:UserService) {
@ -131,7 +132,9 @@ export class AddPdComponent implements OnInit, OnDestroy {
// load form data
loadFormData() {
this._PDtriggerForm = this._fb.group({
fk_lender_id: [{value:this.userDetails.fk_entity_id,disabled: this.userDetails.short_name != 'CHFPL' && this.userDetails.short_name != 'CLIX' ? true : false} || ''],
fk_lender_id: [{value:this.userDetails.fk_entity_id,disabled: true} || ''],
// fk_lender_id: [{value:this.userDetails.fk_entity_id,disabled: this.userDetails.short_name != 'CHFPL' && this.userDetails.short_name != 'CLIX' ? true : false} || ''],
sub_entity_id: [{value:this.userDetails.fk_entity_id,disabled: this.userDetails.short_name != 'CHFPL' ? true : false} || ''],
pd_branch_id: [null],
lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_sales_person:[null],
@ -168,9 +171,10 @@ export class AddPdComponent implements OnInit, OnDestroy {
data => {
if (data.status == 200) {
this.lenderList = data.records
if(this.userDetails.short_name == 'CHFPL' || this.userDetails.short_name == 'CLIX'){
this.lenderList = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
console.log('filter lender',this.lenderList);
this.billingtolist = this.lenderList
if(this.userDetails.short_name == 'CHFPL'){
this.billingtolist = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
console.log('filter lender',this.billingtolist);
}
}
this.loadControl=true
@ -706,6 +710,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
let pd_details: any = {
"fk_lender_id": this._PDtriggerForm.controls['fk_lender_id'].value,
"sub_entity_id": formValue.sub_entity_id,
"lender_applicant_id": formValue.lender_applicant_id,
"pd_branch_id": formValue.pd_branch_id,
"lender_sales_person":formValue.lender_sales_person,

View File

@ -33,6 +33,20 @@
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 29%">
<mat-select placeholder="Billing To" formControlName="sub_entity_id">
<mat-option>
Select
</mat-option>
<!-- <mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" > -->
<mat-option *ngFor="let LL of billingtolist"
[value]="LL.entity_id">
{{LL.short_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">

View File

@ -72,6 +72,7 @@ export class EditPdMasterComponent implements OnInit {
stateData: any=[];
cityData: any=[];
pincodeData: any=[];
billingtolist: any;
constructor(private _fb: FormBuilder,
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe,private userService:UserService) {
@ -153,10 +154,13 @@ export class EditPdMasterComponent implements OnInit {
let x = this.lenderList.filter(item => item.entity_id == this.data.records.fk_lender_id)
this.lenderBranchList = x[0]['branches'];
this.lenderShortName = x[0]['short_name'] ;
if(this.userDetails.short_name == 'CHFPL' || this.userDetails.short_name == 'CLIX'){
this.lenderList = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
console.log('filter lender',this.lenderList);
}
this.billingtolist = this.lenderList
if(this.userDetails.short_name == 'CHFPL'){
this.billingtolist = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
console.log('filter lender',this.billingtolist);
}
this.filterProductAbbr(x[0]['short_name'],1);
}
}
@ -331,11 +335,12 @@ export class EditPdMasterComponent implements OnInit {
// : this.data.records.pincode
// : this.data.records.pincode;
// console.log("this.userd",this.userDetails);
console.log(this.userDetails.short_name)
this._EditPDtriggerForm = this._fb.group({
pd_id: [this.data.records.pd_id],
fk_lender_id: [{value:this.data.records.fk_lender_id,disabled: this.userDetails.short_name != 'CHFPL' && this.userDetails.short_name != 'CLIX' ? true : false}],
fk_lender_id: [{value:this.data.records.fk_lender_id,disabled: true}],
sub_entity_id: [{value:this.data.records.sub_entity_id,disabled: this.userDetails.short_name != 'CHFPL' ? true : false}],
lender_applicant_id: [this.data.records.lender_applicant_id, Validators.compose([Validators.required])],
pd_branch_id:[this.data.records.pd_branch_id, Validators.compose([Validators.required])],
// pd_contact_person:[this.data.records.pd_contact_person],
@ -714,6 +719,7 @@ export class EditPdMasterComponent implements OnInit {
let lenderMasterArray = {
"pd_id": my_array.pd_id,
"fk_lender_id": my_array.fk_lender_id,
"sub_entity_id": my_array.sub_entity_id,
"lender_applicant_id": my_array.lender_applicant_id,
"pd_branch_id":my_array.pd_branch_id,
// "pd_contact_person": my_array.pd_contact_person,