Tele PD Sales Introduced
This commit is contained in:
parent
c3bce8dfd3
commit
8ffe857115
@ -186,6 +186,7 @@ export class MyApp {
|
||||
this.AWS.logout().subscribe(()=>{
|
||||
this.salesPDService.clearLocalData()
|
||||
localStorage.removeItem('product_id_salesPD');
|
||||
localStorage.removeItem('sales_pd_type');
|
||||
this.nav.setRoot(LoginPage);
|
||||
});
|
||||
break;
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
export const photoJSONStructure ={"answer_value": "",
|
||||
"question": "Approach to PD Location",
|
||||
"question_key": "approach_to_pd_location",
|
||||
"type": "6",
|
||||
"raw_validations": [],
|
||||
"validations": [],
|
||||
"api_properties": null,
|
||||
"onchange_properties": null,
|
||||
"answers": null,
|
||||
"is_repeatable": null,
|
||||
"group_title": null,
|
||||
"is_loader": "",
|
||||
"is_saved": "",
|
||||
"is_image_status": false}
|
||||
@ -14,7 +14,7 @@ import { Section1,Section2,Section3,Section4,Section5,Section6,Section7,Section8
|
||||
import { MatAccordion, MatExpansionPanel } from '@angular/material';
|
||||
import { HttpEventType, HttpResponse } from '@angular/common/http';
|
||||
import { NetworkDetectionProvider, ConnectionStatus } from '../../../../providers/network-detection/network-detection';
|
||||
|
||||
import { photoJSONStructure } from './PhotographJSONStructure';
|
||||
|
||||
// const originFormControlNameNgOnChanges = FormControlName.prototype.ngOnChanges;
|
||||
// FormControlName.prototype.ngOnChanges = function () {
|
||||
@ -34,7 +34,7 @@ import { NetworkDetectionProvider, ConnectionStatus } from '../../../../provider
|
||||
templateUrl: 'ques-template.html'
|
||||
})
|
||||
export class QuesTemplateComponent {
|
||||
|
||||
photoStructure = photoJSONStructure
|
||||
text: string;
|
||||
@Input() questions_JSON:any;
|
||||
quesAnsForm: FormGroup;
|
||||
@ -55,6 +55,7 @@ export class QuesTemplateComponent {
|
||||
@ViewChild('mapanel') matExpansionPanel:MatExpansionPanel
|
||||
emittedFormGroup: any = null;
|
||||
sales_pd_id: any;
|
||||
sales_pd_type: string;
|
||||
constructor(private _fb:FormBuilder,private questionService:QuesServiceProvider,private salesPDProvider:SalesPdProvider,private camera:Camera,private cameraProvider:CameraProvider,private constantProvider:ConstantsProvider,private toastProvider:ToastProvider,private loadingProvider:LoadingProvider,private navCtrl:NavController,private networkDetection:NetworkDetectionProvider) {
|
||||
console.log('Hello QuesTemplateComponent Component');
|
||||
this.text = 'Hello World';
|
||||
@ -101,6 +102,7 @@ export class QuesTemplateComponent {
|
||||
|
||||
}
|
||||
}
|
||||
this.sales_pd_type = localStorage.getItem('sales_pd_type')
|
||||
}
|
||||
getSalesPDSectionFromApi(sales_pd_id){
|
||||
// this.loadingProvider.pdloader("Fetching Data...")
|
||||
@ -114,20 +116,143 @@ export class QuesTemplateComponent {
|
||||
|
||||
// this.original_result_data.questions=this.original_result_data.questions.filter(val=>val.question_key == 'selfie_with_person_met')
|
||||
this.checkGroupandPatchValues()
|
||||
this.loadingProvider.dismissLoader()
|
||||
}
|
||||
else{
|
||||
this.sendAutomaticallyToApi()
|
||||
// FOR DISPLAYING THE CUSTOMER CAPTURED IMAGE (STRUCTURED DYNAMICALLY CREATED IN FRONTEND) (***TELE PD ONLY***)
|
||||
|
||||
if(sales_pd_id && this.sales_pd_type && this.sales_pd_type == '2' && this.local_ques_JSON.section_id == '9' && this.networkDetection.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
||||
let params = {"sales_pd_id":sales_pd_id}
|
||||
this.salesPDProvider.getSalesPDImgDataCusLink(params).subscribe(result=>{
|
||||
if(result['dataStatus']){
|
||||
this.updateCustomerImages(result['records'])
|
||||
this.checkGroupandPatchValues()
|
||||
}
|
||||
this.loadingProvider.dismissLoader()
|
||||
},err=>{
|
||||
this.loadingProvider.dismissLoader()
|
||||
})
|
||||
}
|
||||
else{
|
||||
this.loadingProvider.dismissLoader()
|
||||
}
|
||||
}
|
||||
|
||||
},err=>{
|
||||
this.loadingProvider.dismissLoader()
|
||||
})
|
||||
}
|
||||
// For Officer Details Form
|
||||
sendAutomaticallyToApi(){
|
||||
if(this.local_ques_JSON.section_id == '8'){
|
||||
this.onSubmit(1);
|
||||
}
|
||||
}
|
||||
// for Image section creating a image stucture with images for patching values.
|
||||
updateCustomerImages(img_values) {
|
||||
if(this.local_ques_JSON.section_id == '9'){
|
||||
// let img_values:any=`{"img_data": [
|
||||
// {
|
||||
// "img_key": "selfie_with_person_met",
|
||||
// "img_name": "Person met",
|
||||
// "img_url": "https://mllj2j8xvfl0.i.optimole.com/Lsv2lkg-oXPY0cKC/w:auto/h:auto/q:98/https://s15165.pcdn.co/wp-content/uploads/2018/06/what-is-a-website-url.jpg",
|
||||
// "is_multiple": 0
|
||||
// },
|
||||
// {
|
||||
// "heading":"Name Board Seen",
|
||||
// "img_key": "name_board_seen",
|
||||
// "img_name": "Name Board Seen",
|
||||
// "img_data":[ {
|
||||
// "img_url":"https://www.howtogeek.com/wp-content/uploads/2018/06/shutterstock_1006988770.png"
|
||||
// },
|
||||
// {
|
||||
// "img_url":"https://mllj2j8xvfl0.i.optimole.com/Lsv2lkg-oXPY0cKC/w:auto/h:auto/q:98/https://s15165.pcdn.co/wp-content/uploads/2018/06/what-is-a-website-url.jpg"
|
||||
// }],
|
||||
// "is_multiple": 1
|
||||
// },
|
||||
// {
|
||||
// "heading":"Stock Photograph",
|
||||
// "img_key": "stock_image",
|
||||
// "img_name": "stock photo",
|
||||
// "img_data":[{
|
||||
// "img_url":"https://www.howtogeek.com/wp-content/uploads/2018/06/shutterstock_1006988770.png"
|
||||
// }],
|
||||
// "is_multiple": 1
|
||||
// },
|
||||
// {
|
||||
// "heading":"Workplace Interior Photograph",
|
||||
// "img_key": "workplace_interior_image",
|
||||
// "img_name": "Workplace Interior Photograph",
|
||||
// "img_data":[ {
|
||||
// "img_url":"https://www.howtogeek.com/wp-content/uploads/2018/06/shutterstock_1006988770.png"
|
||||
// },
|
||||
// {
|
||||
// "img_url":"https://mllj2j8xvfl0.i.optimole.com/Lsv2lkg-oXPY0cKC/w:auto/h:auto/q:98/https://s15165.pcdn.co/wp-content/uploads/2018/06/what-is-a-website-url.jpg"
|
||||
// }],
|
||||
// "is_multiple": 1
|
||||
// }
|
||||
// ]}`
|
||||
// img_values = JSON.parse(img_values)
|
||||
let createPhotoStructure:any=this.quesAnsForm.value.questions
|
||||
console.log("update Image fun",this.quesAnsForm.value,img_values,this.quesAnsForm.get('questions')['controls'][0],this.photoStructure)
|
||||
if(img_values.img_data.length > 0) {
|
||||
// img_values.img_data.forEach(img_obj=>{
|
||||
for(let img_obj of img_values.img_data) {
|
||||
if(img_obj) {
|
||||
let findRootIndex = createPhotoStructure.findIndex(val=>val.question_key == img_obj.img_key)
|
||||
let current_control_obj:any =[]
|
||||
current_control_obj = createPhotoStructure[findRootIndex]
|
||||
console.log(createPhotoStructure[findRootIndex],createPhotoStructure[findRootIndex].is_repeatable)
|
||||
if(img_obj.is_multiple != '1'){
|
||||
current_control_obj.answer_value = img_obj.img_url
|
||||
}
|
||||
else {
|
||||
if(img_obj.hasOwnProperty('img_data') && img_obj.img_data.length > 0) {
|
||||
// img_obj.img_data.forEach(multi_obj=>{
|
||||
for(let multi_obj of img_obj.img_data) {
|
||||
if(multi_obj) {
|
||||
// console.log(multi_obj)
|
||||
let temp_obj:any = []
|
||||
temp_obj.length = 0;
|
||||
|
||||
temp_obj = {}
|
||||
temp_obj = {"answer_value": "",
|
||||
"question": "Approach to PD Location",
|
||||
"question_key": "approach_to_pd_location",
|
||||
"type": "6",
|
||||
"raw_validations": [],
|
||||
"validations": [],
|
||||
"api_properties": null,
|
||||
"onchange_properties": null,
|
||||
"answers": null,
|
||||
"is_repeatable": null,
|
||||
"group_title": null,
|
||||
"is_loader": "",
|
||||
"is_saved": "",
|
||||
"is_image_status": false}
|
||||
temp_obj.question = img_obj.img_name
|
||||
temp_obj.question_key = img_obj.img_key
|
||||
temp_obj.answer_value = multi_obj.img_url
|
||||
// console.log(temp_obj);
|
||||
// debugger;
|
||||
// current_control_obj.questions_group.unshift({questions:[temp_obj]})
|
||||
createPhotoStructure[findRootIndex].questions_group.unshift({questions:[temp_obj]})
|
||||
}
|
||||
}
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(createPhotoStructure);
|
||||
// debugger;
|
||||
this.original_result_data.questions= createPhotoStructure;
|
||||
// this.quesAnsForm.get('questions').patchValue(createPhotoStructure);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
proceedonChangeProperty(local_value_obj?){
|
||||
console.log("On Change Property",this.quesAnsForm.value.questions);
|
||||
|
||||
|
||||
@ -25,6 +25,14 @@ import { NetworkDetectionProvider, ConnectionStatus } from '../../../../provider
|
||||
export class HomePage{
|
||||
productList: any;
|
||||
product:string='';
|
||||
sales_pd_type:string=''
|
||||
pd_type_list:any=[{
|
||||
id:"1",
|
||||
dis_name:"Physical PD"
|
||||
},{
|
||||
id:"2",
|
||||
dis_name:"Telephonic PD"
|
||||
}]
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams,private toastProvider:ToastProvider,private pdTriggerProvider:PdtriggerProvider,private salesPDService:SalesPdProvider){
|
||||
this.getProducts()
|
||||
}
|
||||
@ -45,7 +53,7 @@ export class HomePage{
|
||||
if(old_product_id && old_product_id != event.value){
|
||||
|
||||
let btns={button1:'Cancel',button2:'Ok'}
|
||||
let alert = this.toastProvider.setAlertWithButtons("<small>Data will be Lost<small>", "Your existing data will be lost if you change the Product",btns)
|
||||
let alert = this.toastProvider.setAlertWithButtons("<small>Data will be Lost<small>", "Your existing data will be lost if you change the something",btns)
|
||||
alert.present();
|
||||
alert.onDidDismiss((data) => {
|
||||
if (data == false) {
|
||||
@ -55,6 +63,7 @@ export class HomePage{
|
||||
// let product= localStorage.getItem('product_id_salesPD')
|
||||
// this.navCtrl.push(Section1,{product_id:product})
|
||||
localStorage.removeItem('product_id_salesPD');
|
||||
localStorage.removeItem('sales_pd_type');
|
||||
// this.salesPDService.clearLocalData()
|
||||
this.salesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
||||
}
|
||||
@ -62,12 +71,13 @@ export class HomePage{
|
||||
}
|
||||
}
|
||||
sendProduct(){
|
||||
if(this.product != '' && this.product != null){
|
||||
if(this.product != '' && this.product != null && this.sales_pd_type != '' && this.sales_pd_type != null){
|
||||
localStorage.setItem('product_id_salesPD',this.product)
|
||||
this.navCtrl.push(SectionListPage,{product_id:this.product})
|
||||
localStorage.setItem('sales_pd_type',this.sales_pd_type)
|
||||
this.navCtrl.push(SectionListPage,{product_id:this.product,sales_pd_type:this.sales_pd_type})
|
||||
}
|
||||
else{
|
||||
this.toastProvider.lenderappmessage("Please Choose the Product")
|
||||
this.toastProvider.lenderappmessage("Please Choose the PD Type and Product")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,13 +18,23 @@
|
||||
<mat-card style="
|
||||
width: 100%;
|
||||
min-height: 50%;
|
||||
margin-top: 25%;
|
||||
margin-top: 10%;
|
||||
margin-bottom: 10%;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 16px 38px -12px rgba(0,0,0,.56), 0 4px 25px 0 rgba(0,0,0,.12), 0 8px 10px -5px rgba(0,0,0,.2) !important;
|
||||
">
|
||||
<mat-card-content style="margin-top:7%">
|
||||
<!-- <mat-form-field style="width: 100%;" appearence="outline"> -->
|
||||
<mat-label><h6>Choose the Product</h6></mat-label>
|
||||
<mat-label><h6>Choose the PD Type</h6></mat-label>
|
||||
<mat-radio-group placeholder="PD Type" [(ngModel)]="sales_pd_type" class="radio-group">
|
||||
<mat-radio-button color="primary" style="background-color: lightgrey;
|
||||
padding: 10px;
|
||||
margin: 5px;
|
||||
margin-top: 5px;
|
||||
white-space: pre-line;
|
||||
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>
|
||||
<mat-radio-group placeholder="Product" [(ngModel)]="product" class="radio-group">
|
||||
<mat-radio-button color="primary" style="background-color: lightgrey;
|
||||
padding: 10px;
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col col-6>
|
||||
<h6 class="app_id">{{val.applicant_id}}</h6>
|
||||
<h6 class="app_id">{{val.sales_pd_type == '1' ? 'Physical PD' : 'Telephonic PD'}}</h6>
|
||||
</ion-col>
|
||||
<ion-col text-right>
|
||||
<div style="font-size: 13px;">
|
||||
|
||||
@ -72,7 +72,9 @@ page-sales-p-dlist {
|
||||
.app_id{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
// font-size: 16px;
|
||||
font-size: 12px;
|
||||
// text-indent: 2%;
|
||||
// letter-spacing: 1px;
|
||||
// font-weight: bold;
|
||||
}
|
||||
.label-md{
|
||||
|
||||
@ -155,6 +155,7 @@ export class SalesPDlistPage {
|
||||
// this.salesPDService.clearLocalData()
|
||||
this.salesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
||||
localStorage.removeItem('product_id_salesPD')
|
||||
localStorage.removeItem('sales_pd_type')
|
||||
this.navCtrl.push(HomePage)
|
||||
|
||||
}
|
||||
@ -168,7 +169,12 @@ export class SalesPDlistPage {
|
||||
}
|
||||
this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||
localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||
this.navCtrl.push(SectionListPage,{product_id:value_obj.product_id})
|
||||
if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
||||
value_obj.sales_pd_type = '1'
|
||||
}
|
||||
console.log(value_obj);
|
||||
localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
||||
this.navCtrl.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
|
||||
})
|
||||
}
|
||||
salesPDpdf(pdfdetail){
|
||||
@ -203,12 +209,14 @@ export class SalesPDlistPage {
|
||||
if (data == false) {
|
||||
this.salesPDService.clearLocalData()
|
||||
localStorage.removeItem('product_id_salesPD')
|
||||
localStorage.removeItem('sales_pd_type')
|
||||
this.navCtrl.push(HomePage)
|
||||
console.log(data)
|
||||
}
|
||||
else {
|
||||
let product= localStorage.getItem('product_id_salesPD')
|
||||
this.navCtrl.push(Section1,{product_id:product})
|
||||
let sales_pd_type = localStorage.getItem('sales_pd_type')
|
||||
this.navCtrl.push(Section1,{product_id:product,sales_pd_type:sales_pd_type})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
<ion-icon name="menu"></ion-icon>
|
||||
</button>
|
||||
<ion-title>Section List</ion-title>
|
||||
|
||||
<ion-buttons end *ngIf="is_sync_btn">
|
||||
<button ion-button outline round (click)="syncPDWithSections()"><ion-icon name="sync"></ion-icon> Sync</button>
|
||||
</ion-buttons>
|
||||
@ -51,4 +52,17 @@ pd_completed.pd_complete_request_items != null">
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</mat-card>
|
||||
|
||||
<ion-fab bottom right #fab color="optblue" *ngIf="customer_link != '' && sales_pd_type == '2'">
|
||||
<button clear ion-fab mini color="mickyColor"><ion-icon name="link"></ion-icon></button>
|
||||
<ion-fab-list side="top">
|
||||
<button color="mickyColor" ion-fab (click)="copyToClipBoard(customer_link, 'Customer Link is copied');fab.close();"><ion-icon name="copy"></ion-icon>
|
||||
<ion-label>Copy Link</ion-label>
|
||||
</button>
|
||||
|
||||
<button color="disabledColor" ion-fab (click)="sendSmsViaLink();fab.close();" ><ion-icon name="mail"></ion-icon>
|
||||
<ion-label style="color: #dddd">Send Link via SMS</ion-label>
|
||||
</button>
|
||||
</ion-fab-list>
|
||||
</ion-fab>
|
||||
</ion-content>
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
page-section-list {
|
||||
ion-content {
|
||||
contain: size style;
|
||||
}
|
||||
.card-class{
|
||||
h6{
|
||||
margin: 0px !important;
|
||||
@ -66,5 +69,32 @@ page-section-list {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
button[ion-fab] {
|
||||
overflow: visible;
|
||||
position: relative;
|
||||
|
||||
ion-label {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: 40px;
|
||||
|
||||
color: white;
|
||||
background-color: rgba(0,0,0,0.7);
|
||||
line-height: 24px;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.fab{
|
||||
contain: layout;
|
||||
// top:-40px;
|
||||
}
|
||||
// .fab[mini] {
|
||||
// margin: 8px;
|
||||
// width: 40px;
|
||||
// height: 40px;
|
||||
// line-height: 40px;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import { SalesPdProvider } from '../../providers/sales-pd/sales-pd';
|
||||
import { Section9 } from '../home/home';
|
||||
import { ToastProvider } from '../../../../providers/common-provider/toast';
|
||||
import { OfflineManagerProvider } from '../../providers/offline-manager/offline-manager';
|
||||
import { ConstantsProvider } from '../../../../providers/constants/constants';
|
||||
|
||||
/**
|
||||
* Generated class for the SectionListPage page.
|
||||
@ -25,12 +26,15 @@ export class SectionListPage {
|
||||
sales_pd_id: any;
|
||||
is_sync_btn: boolean = false;
|
||||
pd_completed: any = {};
|
||||
customer_link:string=''
|
||||
sales_pd_type: string;
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams,private SalesPDService:SalesPdProvider,private toastProvider:ToastProvider,
|
||||
private offlineManager:OfflineManagerProvider) {
|
||||
private offlineManager:OfflineManagerProvider,private constantProvider:ConstantsProvider) {
|
||||
|
||||
if(this.navParams.get('product_id')){
|
||||
this.product_id=this.navParams.get('product_id')
|
||||
}
|
||||
this.sales_pd_type = localStorage.getItem('sales_pd_type')
|
||||
this.getTemplate()
|
||||
}
|
||||
|
||||
@ -47,6 +51,7 @@ export class SectionListPage {
|
||||
getSectionStats() {
|
||||
this.SalesPDService.getData_fromLocal('sales_pd_id_PRIMARYKEY').then((key_value)=>{
|
||||
if(key_value && key_value != null && key_value != '' && key_value != undefined){
|
||||
this.customer_link = this.constantProvider.environment().app_origin+'/customer/#/salespd-images/'+key_value;
|
||||
this.sales_pd_id=key_value
|
||||
let params={sales_pd_id:this.sales_pd_id,section_id:'all'}
|
||||
this.SalesPDService.getSalesPDSectionData(params).subscribe(res=>{
|
||||
@ -113,10 +118,10 @@ export class SectionListPage {
|
||||
}
|
||||
}
|
||||
getTemplate(){
|
||||
|
||||
this.SalesPDService.getData(this.product_id).subscribe(result=>{
|
||||
|
||||
this.SalesPDService.getData(this.product_id,this.sales_pd_type).subscribe(result=>{
|
||||
console.log("result",result)
|
||||
if(result.hasOwnProperty('records')){
|
||||
if(result['dataStatus'] && result.hasOwnProperty('records')){
|
||||
|
||||
this.raw_data=JSON.parse(result['records'].template)
|
||||
this.raw_data.sections.forEach((val,index)=>{
|
||||
@ -146,7 +151,10 @@ export class SectionListPage {
|
||||
this.SalesPDService.current_section='1';
|
||||
}
|
||||
else{
|
||||
|
||||
let message = result['msg'] ? result['msg'] : 'Something went wrong'
|
||||
let alert = this.toastProvider.setAlertWithOkButton("Alert",message);
|
||||
alert.present();
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
})
|
||||
|
||||
@ -179,4 +187,35 @@ export class SectionListPage {
|
||||
}
|
||||
})
|
||||
}
|
||||
copyToClipBoard(message,user_msg?) {
|
||||
const selBox = document.createElement('textarea');
|
||||
selBox.style.position = 'fixed';
|
||||
selBox.style.left = '0';
|
||||
selBox.style.top = '0';
|
||||
selBox.style.opacity = '0';
|
||||
selBox.value = message;
|
||||
document.body.appendChild(selBox);
|
||||
selBox.focus();
|
||||
selBox.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(selBox);
|
||||
if(message == '') {
|
||||
user_msg = "Something went wrong"
|
||||
}
|
||||
this.toastProvider.lenderappmessage(user_msg)
|
||||
}
|
||||
sendSmsViaLink(){
|
||||
this.toastProvider.lenderappmessage('Send link via SMS is disabled')
|
||||
let param={
|
||||
// pd_id: this.pdMaster.pd_id,
|
||||
// mobile_no: this.mainApplicant.mobile_no,
|
||||
// random_string: this.pdMaster.random_string,
|
||||
}
|
||||
// this.pdDetails.smsLink(param).subscribe(res=>{
|
||||
// if(res['dataStatus']){
|
||||
// this.toast.pdTriggerappmessage('SMS Sent Successfully','primary');
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@ export class QuesServiceProvider {
|
||||
control.push(this._fb.group({
|
||||
"is_repeatable": [val.is_repeatable || null],
|
||||
"group_title": [val.group_title || null], "group_type": [val.group_type || null]
|
||||
,"question_key":[val.question[0].question_key]
|
||||
}))
|
||||
// let temp=val
|
||||
|
||||
|
||||
@ -31,17 +31,23 @@ current_section:any;
|
||||
console.log('Hello SalesPdProvider Provider');
|
||||
this.apiUrl=this.constantProvider.environment().url
|
||||
}
|
||||
getData(product_id){
|
||||
getData(product_id,sales_pd_type?){
|
||||
let users:any=localStorage.getItem('user_details')
|
||||
users=JSON.parse(users)
|
||||
let params = {records:{lender_id:users.fk_entity_id,product_id:product_id}}
|
||||
let params = {records:{lender_id:users.fk_entity_id,product_id:product_id,sales_pd_type:sales_pd_type}}
|
||||
return Observable.create((observer:any)=>{
|
||||
if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
||||
return this.http.post(this.apiUrl+'loadSalesPDTemplate',{records:{lender_id:users.fk_entity_id,product_id:product_id}}).subscribe(result=>{
|
||||
return this.http.post(this.apiUrl+'loadSalesPDTemplate',{records:{lender_id:users.fk_entity_id,product_id:product_id,sales_pd_type:sales_pd_type}}).subscribe(result=>{
|
||||
if(result['dataStatus']) {
|
||||
return this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,'loadSalesPDTemplate',true).then(res=>{
|
||||
observer.next(result)
|
||||
observer.complete();
|
||||
})
|
||||
}
|
||||
else{
|
||||
observer.next(result)
|
||||
observer.complete();
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
@ -58,6 +64,7 @@ current_section:any;
|
||||
userid=JSON.parse(userid).userid;
|
||||
params.createdby=userid
|
||||
let product_id=localStorage.getItem('product_id_salesPD')
|
||||
let sales_pd_type = localStorage.getItem('sales_pd_type');
|
||||
let users:any=localStorage.getItem('user_details')
|
||||
users=JSON.parse(users)
|
||||
// let pd_primary_key;
|
||||
@ -66,6 +73,7 @@ current_section:any;
|
||||
params.sales_pd_id=key_value,
|
||||
params.lender_id=users.fk_entity_id,
|
||||
params.product_id=product_id
|
||||
params.sales_pd_type = sales_pd_type
|
||||
let modified_values =params;
|
||||
if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online && (key_value != null ? (typeof(key_value) == 'string' ? !key_value.includes('local') : true) : true)) {
|
||||
return this.http.post(this.apiUrl+'saveSalesPD',{records:params}).pipe().subscribe(result => {
|
||||
@ -702,4 +710,11 @@ current_section:any;
|
||||
})
|
||||
})
|
||||
}
|
||||
sendSmsViaLink(params): Observable<any> {
|
||||
return this.http.post(this.apiUrl + 'sendCusLinkViaSMS', params)
|
||||
}
|
||||
// FOR GETTING THE CUSTOMER CAPTURED IMAGES
|
||||
getSalesPDImgDataCusLink(params) {
|
||||
return this.http.post(this.apiUrl+'getSalesPDImgDataCusLink',params)
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ export class ConstantsProvider {
|
||||
// let production='https://pdgenie.com/sparqprod/api/'
|
||||
|
||||
let production={
|
||||
app_origin:'https://pdgenie.com',
|
||||
url:'https://api.pdgenie.com/sparqprod/api/',
|
||||
authorization:'TnAwuc64pVpcB9xf',
|
||||
|
||||
@ -35,6 +36,7 @@ export class ConstantsProvider {
|
||||
}
|
||||
|
||||
let development={
|
||||
app_origin:'https://demo.pdgenie.com',
|
||||
url:'http://localhost/sineEdge/sparqapi/api/',
|
||||
authorization:'sparqvenba2018',
|
||||
|
||||
@ -44,6 +46,7 @@ export class ConstantsProvider {
|
||||
}
|
||||
|
||||
let testing={
|
||||
app_origin:'https://demo.pdgenie.com',
|
||||
url:'https://apitest.pdgenie.com/sparqtest/api/',
|
||||
authorization:'sparqvenba2018',
|
||||
|
||||
|
||||
@ -89,8 +89,12 @@ initiateMasterApis(type) {
|
||||
// HARD CODED API PARAMS
|
||||
this.salesPDProvider.getAllMasterDatas('STATE').subscribe(res=>{})
|
||||
// SALES PD TEMPLATE FOR WCTL AND LFMP
|
||||
this.salesPDProvider.getData('8').subscribe(res=>{
|
||||
this.salesPDProvider.getData('9').subscribe(res=>{})
|
||||
this.salesPDProvider.getData('8','1').subscribe(res=>{
|
||||
this.salesPDProvider.getData('9','1').subscribe(res=>{
|
||||
this.salesPDProvider.getData('8','2').subscribe(res=>{
|
||||
this.salesPDProvider.getData('9','2').subscribe(res=>{})
|
||||
})
|
||||
})
|
||||
})
|
||||
//SALES PD PRODUCTS LIST FOR LENDER MWISE
|
||||
this.getEntityPreferences('35').subscribe(res=>{})
|
||||
|
||||
@ -43,6 +43,8 @@ $colors: (
|
||||
light: #f4f4f4,
|
||||
dark: #222,
|
||||
optblue: #E00201,
|
||||
mickyColor: #8e9a16,
|
||||
disabledColor:#dddddd
|
||||
);
|
||||
$header_color:#8835C3;
|
||||
$sidemenu_color:#19152C;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user