diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html
index 65cb39c83..3e43f0da0 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html
@@ -1,7 +1,11 @@
-
@@ -182,7 +212,7 @@
Co-Applicant
-
+
@@ -197,7 +227,7 @@
-
+
@@ -213,7 +243,12 @@
-
+
+
+
+
+
+
@@ -228,10 +263,15 @@
-->
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts
index 3cf94ed47..0ed9a60ae 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts
@@ -15,6 +15,9 @@ import { AwsService } from '../../../../AwsService/aws.service';
export class AddPdComponent implements OnInit, OnDestroy {
//@Output() loadParent = new EventEmitter();
cancelStatus: boolean;
+ enablePDButton: boolean;
+ draftStatus: boolean;
+ PDTriggerStatus: boolean;
private notifier: NotifierService;
public _PDtriggerForm: FormGroup;
items: FormArray;
@@ -25,15 +28,17 @@ export class AddPdComponent implements OnInit, OnDestroy {
stateList:any;
cityList:any;
pdTypeList:any;
+ billingList: any;
+ relationShipList: any;
errorMessage: any;
// Dynamic co applicant
createWithLongContent = false;
dynamicCoApplicant = [];
- allocationTypeModel: number;
- allocationTypeCheck: boolean;
- subAllocationTypeCheck: boolean;
- allocationLabel: string;
- subAllocationLabel: string;
+ //allocationTypeModel: number;
+ //allocationTypeCheck: boolean;
+ //subAllocationTypeCheck: boolean;
+ //allocationLabel: string;
+ //subAllocationLabel: string;
constructor(notifier: NotifierService,private _fb: FormBuilder,private route: ActivatedRoute,
private router: Router,private _pd: PdTrigerService, private _aws:AwsService, private ListPdComponent: ListPdComponent) {
this.notifier = notifier;
@@ -42,6 +47,9 @@ export class AddPdComponent implements OnInit, OnDestroy {
public totalFileName = [];
public lengthCheckToaddMore =0;
ngOnInit() {
+ this.draftStatus=false;
+ this.PDTriggerStatus=true;
+ this.enablePDButton=false;
this.cancelStatus = false;
this.ListPdComponent.pdListLoad(false);
this.getLenderList();
@@ -49,31 +57,46 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.getCustomerSegmentList();
this.getStateCityList();
this.getPDTypeList();
+ this.getRelationMaster();
this._PDtriggerForm = this._fb.group({
- fk_lender_id: [null, Validators.compose([Validators.required])],
+ fk_lender_id: [null],
lender_applicant_id: [null, Validators.compose([Validators.required])],
- fk_product_id: [null, Validators.compose([Validators.required])],
- fk_subproduct_id: [null, Validators.compose([Validators.required])],
- fk_pd_type: [null, Validators.compose([Validators.required])],
- fk_customer_segment: [null, Validators.compose([Validators.required])],
- loan_amount: [null, Validators.compose([Validators.required])],
- applicant_name: [null, Validators.compose([Validators.required])],
- mobile_no: [null, Validators.compose([Validators.required])],
- email: [null, Validators.compose([Validators.required, CustomValidators.email])],
- addressline1: [null, Validators.compose([Validators.required])],
+ lender_contact_person: [null, Validators.compose([Validators.required])],
+ lender_contact_mobile: [null, Validators.compose([Validators.required])],
+ lender_billing: [null],
+ fk_product_id: [null],
+ fk_subproduct_id: [null],
+ fk_pd_type: [null],
+ fk_customer_segment: [null],
+ loan_amount: [null],
+ applicant_name: [null],
+ mobile_no: [null],
+ email: [null],
+ addressline1: [null],
addressline2: [null],
addressline3: [null],
- fk_city: [null, Validators.compose([Validators.required])],
- fk_state: [null, Validators.compose([Validators.required])],
- pincode : [null, Validators.compose([Validators.required])],
- allocation_type: [null],
- sub_allocation_type: [null],
+ fk_city: [null],
+ fk_state: [null],
+ pincode : [null],
+ // allocation_type: [null],
+ // sub_allocation_type: [null],
items: this._fb.array([]),
documents: this._fb.array([])
});
-
+ this.OnChanges();
}
+ // enable pd trigger submit function
+ OnChanges(): void{
+ this._PDtriggerForm.valueChanges.subscribe(val => {
+ if(val.fk_lender_id && val.fk_product_id && val.fk_subproduct_id && val.fk_pd_type && val.fk_customer_segment && val.loan_amount && val.applicant_name && val.mobile_no && val.addressline1 && val.fk_city && val.fk_state && val.pincode){
+ this.enablePDButton=true;
+ }
+ else{
+ this.enablePDButton=false;
+ }
+ });
+ }
getLenderList(){
this._pd.getLenderDetails().subscribe(
data => {
@@ -112,29 +135,34 @@ export class AddPdComponent implements OnInit, OnDestroy {
data => {
if (data.status == 200) {
this.pdTypeList=data.records.pd_type;
- if(data.records.pd_allocation_type){
- let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1);
- if(getDefaultAllocation[0].pd_allocation_type_id==1){
- this.allocationTypeModel=1;
- this.allocationTypeCheck=false;
- this.subAllocationTypeCheck=false;
- this.allocationLabel="Auto";
- this.subAllocationLabel="Load Balance";
- }
- else if(this.allocationTypeModel[0].pd_allocation_type_id==2){
- this.allocationTypeModel=2;
- this.allocationTypeCheck=false;
- this.subAllocationTypeCheck=true;
- this.allocationLabel="Auto";
- this.subAllocationLabel="Nearest";
- }
- else if(this.allocationTypeModel[0].pd_allocation_type_id==3){
- this.allocationTypeModel=3;
- this.allocationTypeCheck=true;
- this.allocationLabel="Manual";
- }
+
+ //start hide pd allocation type functinality
+
+ // if(data.records.pd_allocation_type){
+ // let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1);
+ // if(getDefaultAllocation[0].pd_allocation_type_id==1){
+ // this.allocationTypeModel=1;
+ // this.allocationTypeCheck=false;
+ // this.subAllocationTypeCheck=false;
+ // this.allocationLabel="Auto";
+ // this.subAllocationLabel="Load Balance";
+ // }
+ // else if(this.allocationTypeModel[0].pd_allocation_type_id==2){
+ // this.allocationTypeModel=2;
+ // this.allocationTypeCheck=false;
+ // this.subAllocationTypeCheck=true;
+ // this.allocationLabel="Auto";
+ // this.subAllocationLabel="Nearest";
+ // }
+ // else if(this.allocationTypeModel[0].pd_allocation_type_id==3){
+ // this.allocationTypeModel=3;
+ // this.allocationTypeCheck=true;
+ // this.allocationLabel="Manual";
+ // }
- }
+ // }
+
+ // end
}
}, error => this.errorMessage = error);
@@ -151,6 +179,23 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.cityList= this.stateList.filter(item => item.state_id == stateID);
this.cityList=this.cityList[0].cities;
}
+
+ // lendor billing address
+ getBillingDetails(lendorID:string){
+ this.billingList= this.lenderList.filter(item => item.entity_id == lendorID);
+ this.billingList=this.billingList[0].billing_address;
+ }
+ // get relation master details
+ getRelationMaster(){
+ let relation ="RELATIONSHIPS";
+ this._pd.getAllMasterDatas(relation).subscribe(
+ data => {
+ if (data.status == 200) {
+ this.relationShipList=data.records;
+
+ }
+ }, error => this.errorMessage = error);
+ }
createItem(): FormGroup {
return this._fb.group({
label: ['Co Applicant'],
@@ -191,10 +236,14 @@ export class AddPdComponent implements OnInit, OnDestroy {
get documents(): FormArray {
return this._PDtriggerForm.get('documents') as FormArray;
};
- get pdMain() { return this._PDtriggerForm.controls; }
+ get pdMain() {
+ return this._PDtriggerForm.controls; }
get pdCoApplicant() { return this._PDtriggerForm.get('items') as FormArray; }
-
+ removeCoApplicant(i: number) {
+ const control = this._PDtriggerForm.controls['items'];
+ control.removeAt(i);
+ }
removeItem(index: number) {
this.totalfiles.splice(index,1);
this.totalFileName.splice(index,1);
@@ -229,13 +278,16 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.lengthCheckToaddMore=1;
}
}
- submitPdDetails(formValue: any) {
+ submitPdDetails(formValue: any, status:boolean) {
if(this._PDtriggerForm.valid){
// let my_array = this.PDtriggerForm.value;
// Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
let pd_details:any={
"fk_lender_id":formValue.fk_lender_id,
"lender_applicant_id":formValue.lender_applicant_id,
+ "lender_billing_id":formValue.lender_billing,
+ "lender_contact_person":formValue.lender_contact_person,
+ "lender_contact_mobile":formValue.lender_contact_mobile,
"fk_product_id":formValue.fk_product_id,
"fk_subproduct_id":formValue.fk_subproduct_id,
"fk_pd_type":formValue.fk_pd_type,
@@ -247,7 +299,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
"fk_city":formValue.fk_city,
"fk_state":formValue.fk_state,
"pincode":formValue.pincode ,
- "fk_pd_allocation_type":this.allocationTypeModel ,
+ "pd_status": status,
+ //"fk_pd_allocation_type":this.allocationTypeModel ,
"fk_createdby" : this._aws.getlocale(),
"createdon": new Date().toJSON().slice(0,19).replace('T',' ')
};
@@ -306,29 +359,32 @@ export class AddPdComponent implements OnInit, OnDestroy {
});
}
}
- changeAllocationType(status: boolean) {
- if(status){
- this.allocationTypeModel=3;
- this.allocationLabel="Manual";
- }
- else{
- this.allocationTypeModel=1;
- this.allocationLabel="Auto";
- this.subAllocationLabel="Load Balance";
- }
- }
- changeSubAllocationType(status: boolean){
- if(status){
- this.allocationTypeModel=2;
- this.allocationLabel="Auto";
- this.subAllocationLabel="Nearest";
- }
- else{
- this.allocationTypeModel=1;
- this.allocationLabel="Auto";
- this.subAllocationLabel="Load Balance";
- }
- }
+ // start hide allocation type functionality
+
+ // changeAllocationType(status: boolean) {
+ // if(status){
+ // this.allocationTypeModel=3;
+ // this.allocationLabel="Manual";
+ // }
+ // else{
+ // this.allocationTypeModel=1;
+ // this.allocationLabel="Auto";
+ // this.subAllocationLabel="Load Balance";
+ // }
+ // }
+ // changeSubAllocationType(status: boolean){
+ // if(status){
+ // this.allocationTypeModel=2;
+ // this.allocationLabel="Auto";
+ // this.subAllocationLabel="Nearest";
+ // }
+ // else{
+ // this.allocationTypeModel=1;
+ // this.allocationLabel="Auto";
+ // this.subAllocationLabel="Load Balance";
+ // }
+ // }
+ // end
loadPdListCompoent(from:boolean) {
if(from){
this.router.navigate([ '../../' ], { relativeTo: this.route });
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html
index 6a958309b..b3922d059 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html
@@ -1,6 +1,6 @@
-
-
+
+
@@ -25,7 +25,7 @@
+ {{officer.first_name}}
+
++ Allocated +
++ Scheduled +
++ Inprogress +
+ +PD officer not available..
+{{master.product_name}} / {{master.subproduct_name}}
+{{master.pd_type_name}} {{master.pd_allocation_type_name}} {{master.pd_allocated_to}}
+{{master.addressline1}}
+{{master.addressline2}}
+{{master.addressline3}}
+ +{{master.loan_amount}} {{master.pd_status_name}} {{master.pd_date_of_initiation}}
+ ++ + {{applicant.applicant_name}} + + {{applicant.mobile_no}} Main Applicant + {{applicant.relation}}
+
+ + ++ {{documents.pd_document_title}} + + {{documents.pd_document_name}} +
+{{pageTitle}}
-