clix changes : ps
This commit is contained in:
parent
d5770c616f
commit
96a1bbc177
@ -67,8 +67,8 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- {{productabbr}}{{isSubproductShown}} -->
|
||||||
<mat-form-field style="width: 100%" *ngIf="pdforms.controls['proName'].value != 4">
|
<mat-form-field style="width: 100%" *ngIf="isSubproductShown">
|
||||||
<mat-select matInput placeholder="Sub Product Name" formControlName="subProName">
|
<mat-select matInput placeholder="Sub Product Name" formControlName="subProName">
|
||||||
<mat-option>--</mat-option>
|
<mat-option>--</mat-option>
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,7 @@ export class InputPage {
|
|||||||
users: any;
|
users: any;
|
||||||
pdforms:FormGroup;
|
pdforms:FormGroup;
|
||||||
items: FormArray;
|
items: FormArray;
|
||||||
|
productAllList : any = [];
|
||||||
proname:any = [];
|
proname:any = [];
|
||||||
subproname:any=[];
|
subproname:any=[];
|
||||||
customeSeg:any=[];
|
customeSeg:any=[];
|
||||||
@ -59,16 +60,19 @@ btnaccess:boolean = false;
|
|||||||
stateVal: any=[];
|
stateVal: any=[];
|
||||||
cityListVal: any=[];
|
cityListVal: any=[];
|
||||||
pincodeListVal: any=[];
|
pincodeListVal: any=[];
|
||||||
|
lenderID:any;
|
||||||
|
productabbr:any;
|
||||||
|
isSubproductShown: boolean = true;
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public pddetails:PdtriggerProvider,public shared:CognitoServiceProvider,public aws:AwsServiceProvider,public camera:Camera,public toast:ToastProvider, public qustCat:QuestionCategoryProvider,public constant:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public pddetails:PdtriggerProvider,public shared:CognitoServiceProvider,public aws:AwsServiceProvider,public camera:Camera,public toast:ToastProvider, public qustCat:QuestionCategoryProvider,public constant:ConstantsProvider) {
|
||||||
|
|
||||||
this.shared.refresh();
|
this.shared.refresh();
|
||||||
this.pddrops();
|
this.pddrops();
|
||||||
|
|
||||||
this.pdforms = this.fb.group({
|
this.pdforms = this.fb.group({
|
||||||
pd_branch_id:['',Validators.compose([Validators.required])],
|
pd_branch_id:['',Validators.compose([Validators.required])],
|
||||||
lenAppID:['',Validators.compose([Validators.required])],
|
lenAppID:['',Validators.compose([Validators.required])],
|
||||||
proName:[''],
|
proName:[this.lenderID != 12 ? '' : Validators.compose([Validators.required])],
|
||||||
subProName:[''],
|
subProName:[''],
|
||||||
customeSeg:[''],
|
customeSeg:[''],
|
||||||
pdType:[''],
|
pdType:[''],
|
||||||
@ -112,7 +116,7 @@ btnaccess:boolean = false;
|
|||||||
}
|
}
|
||||||
initAddress(){
|
initAddress(){
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
add1:[''],
|
add1:[this.lenderID != 12 ? '' : Validators.compose([Validators.required])],
|
||||||
state:[''],
|
state:[''],
|
||||||
city:[''],
|
city:[''],
|
||||||
pincode:[''],
|
pincode:[''],
|
||||||
@ -141,8 +145,8 @@ btnaccess:boolean = false;
|
|||||||
initPersonCoApplicant(){
|
initPersonCoApplicant(){
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
applicant_title_name:[''],
|
applicant_title_name:[''],
|
||||||
mainappname:[''],
|
mainappname:[this.lenderID != 12 ? '' : Validators.compose([Validators.required])],
|
||||||
mainappcompany:[''],
|
mainappcompany:[this.lenderID != 12 ? '' : Validators.compose([Validators.required])],
|
||||||
mainappphone:[''],
|
mainappphone:[''],
|
||||||
mainapplandline:[''],
|
mainapplandline:[''],
|
||||||
applicant_stdcode:[''],
|
applicant_stdcode:[''],
|
||||||
@ -182,17 +186,18 @@ inWords(event){
|
|||||||
let userid = this.aws.getlocale();
|
let userid = this.aws.getlocale();
|
||||||
this.aws.getuserprofile(userid).subscribe(res=>
|
this.aws.getuserprofile(userid).subscribe(res=>
|
||||||
{
|
{
|
||||||
|
console.log('this.users',res);
|
||||||
this.users = res;
|
this.users = res;
|
||||||
if(this.users.dataStatus == true)
|
if(this.users.dataStatus == true)
|
||||||
{
|
{
|
||||||
this.users = this.users.records[0];
|
this.users = this.users.records[0];
|
||||||
}
|
}
|
||||||
// console.log("Entity Id",this.users.fk_entity_id);
|
this.lenderID = this.users.fk_entity_id;
|
||||||
//console.log("Entity branch",this.users.fk_entity_id[])
|
//console.log("Entity branch",this.users.fk_entity_id[])
|
||||||
this.qustCat.getLenderDetailsById(this.users.fk_entity_id).subscribe(res=>{
|
this.qustCat.getLenderDetailsById(this.users.fk_entity_id).subscribe(res=>{
|
||||||
|
|
||||||
this.branchList=res['records'].branch_details.filter(val=>val.isactive==1)
|
this.branchList=res['records'].branch_details.filter(val=>val.isactive==1)
|
||||||
// console.log("entity by Id",this.branchList);
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -214,16 +219,40 @@ inWords(event){
|
|||||||
this.proname = res;
|
this.proname = res;
|
||||||
if(this.proname.dataStatus == true)
|
if(this.proname.dataStatus == true)
|
||||||
{
|
{
|
||||||
|
if(this.lenderID == 12){
|
||||||
|
let getProductAbbr = this.proname.records.map(dval => dval.product_abbr);
|
||||||
|
let ClixProductAbbr = ['BL','LAEP'];
|
||||||
|
let FilteredAbbr: any = [];
|
||||||
|
FilteredAbbr = ClixProductAbbr.map(x => {
|
||||||
|
let findIndex = getProductAbbr.indexOf(x);
|
||||||
|
return this.proname.records[findIndex];
|
||||||
|
});
|
||||||
|
this.proname = FilteredAbbr.length > 0 ? FilteredAbbr : this.proname.records;
|
||||||
|
}
|
||||||
|
else{
|
||||||
this.proname = this.proname.records;
|
this.proname = this.proname.records;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/**customer segment */
|
/**customer segment */
|
||||||
this.pddetails.getcustomerseg().subscribe(res=>
|
this.pddetails.getcustomerseg().subscribe(res=>
|
||||||
{
|
{
|
||||||
|
console.log(res);
|
||||||
this.customeSeg = res;
|
this.customeSeg = res;
|
||||||
if(this.customeSeg.dataStatus == true)
|
if(this.customeSeg.dataStatus == true)
|
||||||
{
|
{
|
||||||
|
if(this.lenderID == 12){
|
||||||
|
// let filtered = this.customeSeg.filter(s => (s.customer_segment).includes('Self'));
|
||||||
|
// this.customeSeg = filtered;
|
||||||
this.customeSeg = this.customeSeg.records;
|
this.customeSeg = this.customeSeg.records;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.customeSeg = this.customeSeg.records;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -259,16 +288,50 @@ inWords(event){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getsubproduct(subprodcutdata)
|
getsubproduct(selectedProductID)
|
||||||
{
|
{
|
||||||
this.subproname = this.proname.filter(product=>product.product_id == subprodcutdata)[0];
|
if(selectedProductID !== undefined && selectedProductID !== null && selectedProductID !== '') {
|
||||||
|
this.subproname = this.proname.filter(product=>product.product_id == selectedProductID)[0];
|
||||||
|
this.productabbr = this.subproname.product_abbr;
|
||||||
this.subproname = this.subproname.subproducts;
|
this.subproname = this.subproname.subproducts;
|
||||||
this.subproname = this.subproname.filter(item => item.is_others == 0);
|
this.subproname = this.subproname.filter(item => item.is_others == 0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.productabbr = ''
|
||||||
|
this.subproname = [];
|
||||||
|
|
||||||
|
this.pdforms.controls['subProName'].setValue('');
|
||||||
|
this.pdforms.controls['pdType'].setValue('');
|
||||||
|
this.pdforms.controls['customeSeg'].setValue('');
|
||||||
|
this.pdforms.controls['loanAmt'].setValue('');
|
||||||
|
}
|
||||||
|
|
||||||
/**customer segment */
|
/**customer segment */
|
||||||
this.customerSegmentList = (subprodcutdata != '4')?this.customeSeg:this.customeSeg.filter(s => (s.customer_segment).includes('Self'));
|
switch(this.productabbr){
|
||||||
if(subprodcutdata != '4'){this.pdforms.controls['subProName'].setValue(null)}
|
case 'BL' :
|
||||||
|
console.log(1);
|
||||||
|
this.customerSegmentList = this.customeSeg.filter(s => (s.customer_segment).includes('Self'));
|
||||||
|
this.pdforms.controls['subProName'].setValue(null);
|
||||||
|
this.isSubproductShown = false;
|
||||||
|
break;
|
||||||
|
case 'LAEP':
|
||||||
|
console.log(2);
|
||||||
|
this.customerSegmentList = this.customeSeg.filter(s => (s.customer_segment).includes('Self'));
|
||||||
|
this.pdforms.controls['subProName'].setValue(null)
|
||||||
|
this.isSubproductShown = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(3);
|
||||||
|
this.customerSegmentList = this.customeSeg;
|
||||||
|
this.isSubproductShown = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.lenderID == 12 && this.productabbr != ''){
|
||||||
|
this.pdforms.controls['pdType'].setValue('1');
|
||||||
|
this.pdforms.controls['customeSeg'].setValue('5');
|
||||||
|
this.pdforms.controls['loanAmt'].setValue(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
createItem(): FormGroup {
|
createItem(): FormGroup {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
@ -354,18 +417,16 @@ inWords(event){
|
|||||||
{
|
{
|
||||||
console.log(pddata);
|
console.log(pddata);
|
||||||
this.btnaccess = true;
|
this.btnaccess = true;
|
||||||
|
if(this.pdforms.invalid) {
|
||||||
|
this.toast.lenderappmessage("Please Fill all the Fields marked with '*' ")
|
||||||
|
}
|
||||||
this.pddocdata.forEach((items,index) => {
|
this.pddocdata.forEach((items,index) => {
|
||||||
|
if(items.Name !='' && items.Name != null && items.Name !== undefined){}
|
||||||
// console.log(217,(items));
|
else{
|
||||||
if(items.Name !='' && items.Name != null && items.Name !== undefined)
|
|
||||||
{
|
|
||||||
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
this.pddocdata[index] = {'image':items.image,'Name':'DocNames-'+index+1};
|
this.pddocdata[index] = {'image':items.image,'Name':'DocNames-'+index+1};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let lender_landline_no;
|
let lender_landline_no;
|
||||||
let applicant_landline_no;
|
let applicant_landline_no;
|
||||||
|
|
||||||
@ -381,7 +442,7 @@ inWords(event){
|
|||||||
lender_landline_no = '';
|
lender_landline_no = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('226',this.pddocdata);
|
|
||||||
let pdstatus:any;
|
let pdstatus:any;
|
||||||
if(pddata.address_field[0].add1 !='' && pddata.address_field[0].city !='' && pddata.customeSeg !='' && pddata.lenAppID !='' && pddata.loanAmt !='' && pddata.mainappcompany !='' && pddata.mainappname !='' && pddata.mainappphone !='' && pddata.pdType !='' && pddata.pdcontactperson !='' && pddata.pdcontectno !='' && pddata.address_field[0].pincode !='' && pddata.proName !='' && pddata.address_field[0].state !='' && pddata.subProName !='')
|
if(pddata.address_field[0].add1 !='' && pddata.address_field[0].city !='' && pddata.customeSeg !='' && pddata.lenAppID !='' && pddata.loanAmt !='' && pddata.mainappcompany !='' && pddata.mainappname !='' && pddata.mainappphone !='' && pddata.pdType !='' && pddata.pdcontactperson !='' && pddata.pdcontectno !='' && pddata.address_field[0].pincode !='' && pddata.proName !='' && pddata.address_field[0].state !='' && pddata.subProName !='')
|
||||||
{
|
{
|
||||||
@ -389,17 +450,20 @@ inWords(event){
|
|||||||
}else{
|
}else{
|
||||||
pdstatus = "DRAFT";
|
pdstatus = "DRAFT";
|
||||||
}
|
}
|
||||||
|
|
||||||
let proname = pddata.proName;
|
let proname = pddata.proName;
|
||||||
let subprodcut = pddata.subProName;
|
let subprodcut = pddata.subProName;
|
||||||
let pdtype = pddata.pdType;
|
let pdtype = pddata.pdType;
|
||||||
let customeSeg = pddata.customeSeg;
|
let customeSeg = pddata.customeSeg;
|
||||||
var addres:any;
|
var addres:any;
|
||||||
|
|
||||||
if(pddata.address_field[0].add1!=''){
|
if(pddata.address_field[0].add1!=''){
|
||||||
addres=pddata.address_field[0].add1.toUpperCase();
|
addres=pddata.address_field[0].add1.toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
let state = pddata.address_field[0].state;
|
let state = pddata.address_field[0].state;
|
||||||
let city = pddata.address_field[0].city;
|
let city = pddata.address_field[0].city;
|
||||||
|
|
||||||
let pdDetailsData = {
|
let pdDetailsData = {
|
||||||
'fk_lender_id':this.users.fk_entity_id,
|
'fk_lender_id':this.users.fk_entity_id,
|
||||||
'pd_branch_id':pddata.pd_branch_id,
|
'pd_branch_id':pddata.pd_branch_id,
|
||||||
@ -521,8 +585,6 @@ inWords(event){
|
|||||||
this.toast.lenderappmessage('something went wrong Try Again');
|
this.toast.lenderappmessage('something went wrong Try Again');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
searchFun(control,index,option){
|
searchFun(control,index,option){
|
||||||
console.log(control,option);
|
console.log(control,option);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user