Fairoj : Sales PD Dynamic product listing

This commit is contained in:
venbatechnologies@gmail.com 2020-12-26 20:01:59 +05:30
parent eacd43281f
commit 3481447e6e
5 changed files with 144 additions and 128 deletions

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.sineedge.pdglender" version="0.0.22" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.sineedge.pdglender" version="0.0.23" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>PD Genie</name>
<description>info@pdgenie.com</description>
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>

View File

@ -77,18 +77,79 @@
"question":"Constitution",
"question_key":"constitution",
"type":"8",
"answers":null,
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"BUSINESSENTITYTYPE"
"answers":[
{
"answer_id":"6",
"answer":"Cooperative",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
"fields":[
"business_entity_type_id",
"business_entity_type_name"
]
},
{
"answer_id":"4",
"answer":"HUF (Hindu Undivided Family)",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"7",
"answer":"Limited Liability Partnership(LLP)",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"5",
"answer":"Partnership",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"11",
"answer":"Private Limited Company",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"2",
"answer":"Public Ltd Company",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"12",
"answer":"Self Employed-Individual",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"9",
"answer":"Society",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"3",
"answer":"Sole proprietorship",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"10",
"answer":"Trust",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
}
],
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
@ -367,12 +428,26 @@
"type":"4",
"answers":[
{
"answer_id":"Puchase of Medical Equipment",
"answer":"Puchase of Medical Equipment",
"answer_id":"Purchase of Medical Equipment (New)",
"answer":"Purchase of Medical Equipment (New)",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"Purchase of Medical Equipment (Refurbished)",
"answer":"Purchase of Medical Equipment (Refurbished)",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"Purchase of Medical Equipment (New and Refurbished)",
"answer":"Purchase of Medical Equipment (New and Refurbished)",
"subfield_key":"",
"subfield_caption":"",
"subfield_type":""
},
{
"answer_id":"Refinance",
"answer":"Refinance",
@ -510,41 +585,6 @@
"value_keys":null
}
]
},
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"total_work_exp",
"expression":"(total_work_exp > vintage_in_current_biz)",
"value_keys":[
"total_work_exp",
"vintage_in_current_biz"
],
"questions":[
{
"question_key":"previous_experience_details",
"question":"Previous Experience Details",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Previous Experience Required",
"value":null
}
]
}
]
}
]
}
]
},
@ -587,41 +627,6 @@
"value_keys":null
}
]
},
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"total_work_exp",
"expression":"(total_work_exp > vintage_in_current_biz)",
"value_keys":[
"total_work_exp",
"vintage_in_current_biz"
],
"questions":[
{
"question":"Previous Experience Details",
"question_key":"previous_experience_details",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Previous Experience Required",
"value":null
}
]
}
]
}
]
}
]
},
@ -685,12 +690,52 @@
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"occupancy_ratio",
"insert_index":"floor",
"expression":"(String('institution_type') == String('Hospital')) || (String('institution_type') == String('Nursing Home'))",
"value_keys":[
"institution_type"
],
"questions":[
{
"question":"How many Bedded",
"question_key":"how_many_beds",
"type":"1",
"field_type":"num",
"place_holder": "Enter the number",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Occupancy Ratio",
"question_key":"occupancy_ratio",
"type":"1",
"field_type":"num",
"place_holder": "Enter the number",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question_key":"tot_doctors",
"question":"How many doctors",
@ -1025,46 +1070,6 @@
}
]
},
{
"question":"How many Bedded",
"question_key":"how_many_beds",
"type":"1",
"field_type":"num",
"place_holder": "Enter the number",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Occupancy Ratio",
"question_key":"occupancy_ratio",
"type":"1",
"field_type":"num",
"place_holder": "Enter the number",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Number of staff observed",
"question_key":"staff_observer_number",

View File

@ -23,7 +23,7 @@ import { NetworkDetectionProvider, ConnectionStatus } from '../../../../provider
templateUrl: 'product-list.html',
})
export class HomePage{
productList: any;
productList: any = [];
product:string='';
sales_pd_type:string=''
pd_type_list:any=[{
@ -42,6 +42,16 @@ export class HomePage{
this.pdTriggerProvider.getEntityPreferences(users.fk_entity_id).subscribe(result=>{
if(result['dataStatus']){
this.productList=result['records'].salespd_products;
let user_info = JSON.parse(localStorage.getItem('user_details'))
if(user_info && user_info.user_config && user_info.user_config.salespd_products) {
let product_config = user_info.user_config.salespd_products
console.log(product_config)
this.productList = this.productList.filter(vv=>product_config.includes(vv.product_id))
console.log(this.productList)
}
else {
this.productList = []
}
let old_product_id=localStorage.getItem('product_id_salesPD')
this.product=old_product_id
}

View File

@ -35,6 +35,7 @@
border-radius: 10px;" *ngFor="let val of pd_type_list" [value]="val.id" (change)="getProductForAlert($event)"><span>{{val.dis_name}}</span></mat-radio-button>
</mat-radio-group>
<mat-label><br/><h6>Choose the Product</h6></mat-label>
<p *ngIf="productList.length == 0">No Products available</p>
<mat-radio-group placeholder="Product" [(ngModel)]="product" class="radio-group">
<mat-radio-button color="primary" style="background-color: lightgrey;
padding: 10px;

View File

@ -93,13 +93,13 @@ initiateMasterApis(type) {
// HARD CODED API PARAMS
this.salesPDProvider.getAllMasterDatas('STATE').subscribe(res=>{
// FOR MEQ PRODUCTS MASTER API
this.salesPDProvider.getAllMasterDatas('BUSINESSENTITYTYPE').subscribe(res=>{
// this.salesPDProvider.getAllMasterDatas('BUSINESSENTITYTYPE').subscribe(res=>{
this.salesPDProvider.getAllMasterDatas('COMPANYRELATIONSHIPS').subscribe(res=>{
this.salesPDProvider.getAllMasterDatas('SALESEQUIPMENTLIST').subscribe(res=>{
this.salesPDProvider.getAllMasterDatas('SALESVENDORLIST').subscribe(res=>{})
})
})
})
// })
})
// SALES PD TEMPLATE FOR WCTL AND LFMP
// this.salesPDProvider.getData('8','1').subscribe(res=>{