Fairoj : Sales PD issues fixed
This commit is contained in:
parent
3b7404f9b0
commit
f400bd4213
12
package-lock.json
generated
12
package-lock.json
generated
@ -4975,17 +4975,17 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ngx-mat-select-search": {
|
"ngx-mat-select-search": {
|
||||||
"version": "1.7.1",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/ngx-mat-select-search/-/ngx-mat-select-search-1.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/ngx-mat-select-search/-/ngx-mat-select-search-1.8.0.tgz",
|
||||||
"integrity": "sha512-oys3g/dbehXD0BG/zH9E1JwncROBXWUo6243YrVScvY9I/zFZT4sA2ClY1WALxc807Qvbq3Hs4TTLW/9BnLVSw==",
|
"integrity": "sha512-oCuGWn0GYxqpOZ4mdJvHJ0l/vctVQ9kxMKEUy6HZ5bGx4dCBUsolwnQeUDM+vwGtlXoBzYQ27cxYgbfNSyuabg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^1.9.0"
|
"tslib": "^1.9.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "1.9.3",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
"ionic-angular": "3.9.2",
|
"ionic-angular": "3.9.2",
|
||||||
"ionic-img-viewer": "^2.9.0",
|
"ionic-img-viewer": "^2.9.0",
|
||||||
"ionicons": "3.0.0",
|
"ionicons": "3.0.0",
|
||||||
"ngx-mat-select-search": "^1.7.1",
|
"ngx-mat-select-search": "^1.8.0",
|
||||||
"rxjs": "^6.3.1",
|
"rxjs": "^6.3.1",
|
||||||
"rxjs-compat": "^6.3.1",
|
"rxjs-compat": "^6.3.1",
|
||||||
"sw-toolbox": "3.6.0",
|
"sw-toolbox": "3.6.0",
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import { Component, ViewChild } from '@angular/core';
|
import { Component, ViewChild } from '@angular/core';
|
||||||
import { Nav, Platform,AlertController } from 'ionic-angular';
|
import { Nav, Platform,AlertController, Events } from 'ionic-angular';
|
||||||
import { StatusBar } from '@ionic-native/status-bar';
|
import { StatusBar } from '@ionic-native/status-bar';
|
||||||
import { SplashScreen } from '@ionic-native/splash-screen';
|
import { SplashScreen } from '@ionic-native/splash-screen';
|
||||||
import { LoginPage } from '../pages/login/login';
|
import { LoginPage } from '../pages/login/login';
|
||||||
import { PdListPage } from '../pages/pd-list/pd-list';
|
import { PdListPage } from '../pages/pd-list/pd-list';
|
||||||
import { MethodCall } from '@angular/compiler';
|
|
||||||
import { AwsServiceProvider } from '../providers/aws-service/aws-service';
|
import { AwsServiceProvider } from '../providers/aws-service/aws-service';
|
||||||
import { CognitoServiceProvider } from '../providers/aws-service/cognito.service';
|
import { CognitoServiceProvider } from '../providers/aws-service/cognito.service';
|
||||||
import { PasswordPage } from '../pages/password/password';
|
|
||||||
import { AuthPage } from '../pages/auth/auth';
|
import { AuthPage } from '../pages/auth/auth';
|
||||||
import {AppVersion} from '@ionic-native/app-version'
|
import {AppVersion} from '@ionic-native/app-version'
|
||||||
import { HomePageModule } from '../pages/sales_pd/pages/home/home.module';
|
|
||||||
import { HomePage } from '../pages/sales_pd/pages/home/home';
|
|
||||||
import { SalesPDlistPage } from '../pages/sales_pd/pages/sales-p-dlist/sales-p-dlist';
|
import { SalesPDlistPage } from '../pages/sales_pd/pages/sales-p-dlist/sales-p-dlist';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -28,8 +28,9 @@ export class MyApp {
|
|||||||
pages: Array<{title: string,icon:any, method: any}>;
|
pages: Array<{title: string,icon:any, method: any}>;
|
||||||
protected app_version: string;
|
protected app_version: string;
|
||||||
|
|
||||||
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen,public aws:AwsServiceProvider,public shared:CognitoServiceProvider,public AWS:AwsServiceProvider,public alertCtrl:AlertController,private appVersionProvide:AppVersion) {
|
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen,public aws:AwsServiceProvider,public shared:CognitoServiceProvider,public AWS:AwsServiceProvider,public alertCtrl:AlertController,private appVersionProvide:AppVersion,private events:Events) {
|
||||||
this.initializeApp();
|
this.initializeApp();
|
||||||
|
this.changeDecision();
|
||||||
|
|
||||||
// used for an example of ngFor and navigation
|
// used for an example of ngFor and navigation
|
||||||
this.pages = [
|
this.pages = [
|
||||||
@ -113,15 +114,29 @@ export class MyApp {
|
|||||||
this.userAccess = true;
|
this.userAccess = true;
|
||||||
this.userDetails = this.userDetails.records[0];
|
this.userDetails = this.userDetails.records[0];
|
||||||
localStorage.setItem("user_details",JSON.stringify( this.userDetails));
|
localStorage.setItem("user_details",JSON.stringify( this.userDetails));
|
||||||
if(this.userDetails.short_name == 'SMC'){
|
// if(this.userDetails.short_name == 'SMC'){
|
||||||
this.pages.splice(-1,1)
|
// this.pages.splice(-1,1)
|
||||||
this.pages.push( { title :'Sales PD',icon:'list',method:()=>this.menulist(3)},
|
// this.pages.push( { title :'Sales PD',icon:'list',method:()=>this.menulist(3)},
|
||||||
{ title: 'Logout', icon: 'md-exit',method:()=>this.menulist(2)})
|
// { title: 'Logout', icon: 'md-exit',method:()=>this.menulist(2)})
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
changeDecision(){
|
||||||
|
this.events.subscribe('len_short_name',(data)=>{
|
||||||
|
console.log("event data",data)
|
||||||
|
if(data == 'SMC'){
|
||||||
|
this.pages.splice(-1,1)
|
||||||
|
this.pages=this.pages.filter(ele=>ele.title != 'Sales PD')
|
||||||
|
this.pages.push( { title :'Sales PD',icon:'list',method:()=>this.menulist(3)},
|
||||||
|
{ title: 'Logout', icon: 'md-exit',method:()=>this.menulist(2)})
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.pages=this.pages.filter(ele=>ele.title != 'Sales PD')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
menulist(id){
|
menulist(id){
|
||||||
//alert();
|
//alert();
|
||||||
switch(id)
|
switch(id)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
import { IonicPage, NavController, NavParams, Events } from 'ionic-angular';
|
||||||
import { InputPage } from '../input/input';
|
import { InputPage } from '../input/input';
|
||||||
import { AwsServiceProvider } from '../../providers/aws-service/aws-service';
|
import { AwsServiceProvider } from '../../providers/aws-service/aws-service';
|
||||||
import { PdtriggerProvider } from '../../providers/pdtrigger/pdtrigger';
|
import { PdtriggerProvider } from '../../providers/pdtrigger/pdtrigger';
|
||||||
@ -36,7 +36,7 @@ export class PdListPage {
|
|||||||
|
|
||||||
// public category:string="inpro"
|
// public category:string="inpro"
|
||||||
// public categories:Array<string>=['inpro','past']
|
// public categories:Array<string>=['inpro','past']
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public pdofficer:PdtriggerProvider,public shared:CognitoServiceProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public pdofficer:PdtriggerProvider,public shared:CognitoServiceProvider,private events:Events) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
@ -69,6 +69,8 @@ export class PdListPage {
|
|||||||
if(this.userDetails.dataStatus == true){
|
if(this.userDetails.dataStatus == true){
|
||||||
this.userDetails = this.userDetails.records[0];
|
this.userDetails = this.userDetails.records[0];
|
||||||
localStorage.setItem("user_details",JSON.stringify( this.userDetails));
|
localStorage.setItem("user_details",JSON.stringify( this.userDetails));
|
||||||
|
this.events.publish('len_short_name',this.userDetails.short_name);
|
||||||
|
|
||||||
// console.log('this.userDetails.records[0]',this.userDetails.records[0]);
|
// console.log('this.userDetails.records[0]',this.userDetails.records[0]);
|
||||||
this.pdofficer.getpddetails(this.userDetails.fk_entity_id,this.userDetails.userid).subscribe(res=>
|
this.pdofficer.getpddetails(this.userDetails.fk_entity_id,this.userDetails.userid).subscribe(res=>
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { QuesTemplateComponent } from './ques-template/ques-template';
|
import { QuesTemplateComponent } from './ques-template/ques-template';
|
||||||
import { MatButtonModule, MatButtonToggleModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatDialogModule, MatListModule, MatExpansionModule, MatGridListModule, MatIconModule, MatInputModule, MatMenuModule, MatNativeDateModule, MatPaginatorModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatRippleModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSlideToggleModule, MatSnackBarModule, MatSortModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatStepperModule, MatFormFieldModule, MatAutocompleteModule } from '@angular/material';
|
import { MatButtonToggleModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatDialogModule, MatListModule, MatExpansionModule, MatGridListModule, MatIconModule, MatInputModule, MatMenuModule, MatNativeDateModule, MatPaginatorModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatRippleModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSlideToggleModule, MatSnackBarModule, MatSortModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatStepperModule, MatFormFieldModule, MatAutocompleteModule } from '@angular/material';
|
||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
import { IonicImageViewerModule } from 'ionic-img-viewer';
|
import { IonicImageViewerModule } from 'ionic-img-viewer';
|
||||||
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
|
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
|
||||||
import { QuesServiceProvider } from '../providers/ques-service/ques-service';
|
import { QuesServiceProvider } from '../providers/ques-service/ques-service';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { ReactiveFormsModule } from '@angular/forms';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { IonicModule } from 'ionic-angular';
|
import { IonicModule } from 'ionic-angular';
|
||||||
import { MyApp } from '../../../app/app.component';
|
import { MyApp } from '../../../app/app.component';
|
||||||
@ -15,7 +15,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [QuesTemplateComponent],
|
declarations: [QuesTemplateComponent],
|
||||||
imports: [MatButtonToggleModule,
|
imports: [MatButtonToggleModule,
|
||||||
BrowserModule,ReactiveFormsModule,FormsModule,
|
BrowserModule,
|
||||||
IonicModule.forRoot(MyApp),
|
IonicModule.forRoot(MyApp),
|
||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
MatAutocompleteModule,
|
MatAutocompleteModule,
|
||||||
@ -49,7 +49,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|||||||
MatStepperModule,HttpClientModule,IonicImageViewerModule,
|
MatStepperModule,HttpClientModule,IonicImageViewerModule,
|
||||||
MatFormFieldModule,
|
MatFormFieldModule,
|
||||||
NgxMatSelectSearchModule,
|
NgxMatSelectSearchModule,
|
||||||
FormsModule,
|
|
||||||
ReactiveFormsModule],
|
ReactiveFormsModule],
|
||||||
exports: [QuesTemplateComponent],
|
exports: [QuesTemplateComponent],
|
||||||
providers:[ QuesServiceProvider
|
providers:[ QuesServiceProvider
|
||||||
|
|||||||
@ -7,12 +7,13 @@
|
|||||||
<div [formGroupName]="p_i">
|
<div [formGroupName]="p_i">
|
||||||
|
|
||||||
<div *ngIf="parent_ques.get('is_repeatable').value != '1'">
|
<div *ngIf="parent_ques.get('is_repeatable').value != '1'">
|
||||||
|
|
||||||
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '1'">
|
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '1'">
|
||||||
|
|
||||||
<mat-label>{{parent_ques.get('question').value}}</mat-label>
|
<mat-label>{{parent_ques.get('question').value}}</mat-label>
|
||||||
<input matInput [type]="parent_ques.get('field_type').value == 'num' ? 'number' : 'text'" formControlName="answer_value" placeholder="Enter the Text"
|
<input matInput [type]="parent_ques.get('field_type').value == 'num' ? 'number' : 'text'" formControlName="answer_value" placeholder="Enter the Text"
|
||||||
autocomplete="off">
|
autocomplete="off">
|
||||||
|
<!-- <mat-hint align="end" style="font-size: 11.5px;color: gray;" *ngIf="parent_ques.get('is_amt_in_words').value == true">One Lack</mat-hint> -->
|
||||||
<mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error>
|
<mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<!-- <mat-form-field> -->
|
<!-- <mat-form-field> -->
|
||||||
@ -235,13 +236,17 @@
|
|||||||
|
|
||||||
<!-- <div *ngIf="single_ques.get('type').value == '10'"> -->
|
<!-- <div *ngIf="single_ques.get('type').value == '10'"> -->
|
||||||
|
|
||||||
<ion-col col-6 no-padding *ngFor="let single_ques of group_ques.controls.questions['controls'];let s_i=index;let s_l=last"
|
<ion-col align-self: center col-8 no-padding text-center *ngFor="let single_ques of group_ques.controls.questions['controls'];let s_i=index;let s_l=last"
|
||||||
[formGroupName]="s_i">
|
[formGroupName]="s_i">
|
||||||
<div style="justify-content: center;text-align: center" *ngIf="single_ques.get('answer_value').value != ''">
|
<div style="width: 100%;justify-content: center;text-align: center;align-content: center;" *ngIf="single_ques.get('answer_value').value != ''">
|
||||||
<img [src]="single_ques.get('answer_value').value" imageViewer class="doc-image-bucket" width="130px"><br/>
|
<ion-row style="width: 100%">
|
||||||
<label style="font-size: 10px">{{single_ques.get('question').value}} {{g_i+1}}</label>
|
<img [src]="single_ques.get('answer_value').value" imageViewer class="doc-image-bucket" ><br/>
|
||||||
|
</ion-row>
|
||||||
|
<ion-row style="width: 100%;margin-top: 5px;" >
|
||||||
|
<span style="font-size: 10px;white-space: pre-line">{{single_ques.get('question').value}} {{g_i+1}}</span>
|
||||||
<!-- <input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)"> -->
|
<!-- <input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)"> -->
|
||||||
<button ion-button clear color="optblue" (click)="removeData(g_i,parent_ques)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
|
<button ion-button clear color="optblue" (click)="removeData(g_i,parent_ques)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
|
||||||
|
</ion-row>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="justify-content: center">
|
<!-- <div style="justify-content: center">
|
||||||
<button ion-button clear color="optblue" (click)="captureImg()"><ion-icon style="font-size: 30px" name="md-camera"></ion-icon></button>
|
<button ion-button clear color="optblue" (click)="captureImg()"><ion-icon style="font-size: 30px" name="md-camera"></ion-icon></button>
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { ConstantsProvider } from '../../../../providers/constants/constants';
|
|||||||
import { ToastProvider } from '../../../../providers/common-provider/toast';
|
import { ToastProvider } from '../../../../providers/common-provider/toast';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
|
import { LoadingProvider } from '../../../../providers/common-provider/loading';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,24 +35,32 @@ export class QuesTemplateComponent {
|
|||||||
fileredSearchValue: any=[];
|
fileredSearchValue: any=[];
|
||||||
protected _onDestroy=new Subject<void>();
|
protected _onDestroy=new Subject<void>();
|
||||||
submit_btn: boolean=false;
|
submit_btn: boolean=false;
|
||||||
constructor(private _fb:FormBuilder,private questionService:QuesServiceProvider,private salesPDProvider:SalesPdProvider,private camera:Camera,private cameraProvider:CameraProvider,private constantProvider:ConstantsProvider,private toastProvider:ToastProvider) {
|
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) {
|
||||||
console.log('Hello QuesTemplateComponent Component');
|
console.log('Hello QuesTemplateComponent Component');
|
||||||
this.text = 'Hello World';
|
this.text = 'Hello World';
|
||||||
|
this.cameraProvider.enableAccuracy();
|
||||||
}
|
}
|
||||||
ngOnChanges(){
|
ngOnChanges(){
|
||||||
// this.quesAnsForm=this._fb.group({questions:this._fb.array([])})
|
// this.quesAnsForm=this._fb.group({questions:this._fb.array([])})
|
||||||
|
this.quesAnsForm=new FormGroup({questions:this._fb.array([])})
|
||||||
let raw_data_ques:any=localStorage.getItem('question_temp_salespd')
|
let raw_data_ques:any=localStorage.getItem('question_temp_salespd')
|
||||||
|
|
||||||
raw_data_ques=JSON.parse(raw_data_ques)
|
raw_data_ques=JSON.parse(raw_data_ques)
|
||||||
|
console.log("raa",raw_data_ques)
|
||||||
|
if(raw_data_ques != null){
|
||||||
|
if(raw_data_ques.hasOwnProperty('sections') ){
|
||||||
console.log("FROM COMPONENT",this.questions_JSON);
|
console.log("FROM COMPONENT",this.questions_JSON);
|
||||||
this.local_ques_JSON=this.questions_JSON
|
this.local_ques_JSON=this.questions_JSON
|
||||||
if(this.local_ques_JSON.section_id == raw_data_ques.sections[raw_data_ques.sections.length -1].section_id){
|
if(this.local_ques_JSON.section_id == raw_data_ques.sections[raw_data_ques.sections.length -1].section_id){
|
||||||
this.submit_btn=true
|
this.submit_btn=true
|
||||||
|
this.sendDatatoApi()
|
||||||
}
|
}
|
||||||
this.quesAnsForm=new FormGroup({questions:this._fb.array([])})
|
|
||||||
this.quesAnsForm=this.questionService.assignFormControl_array(this.quesAnsForm,this.local_ques_JSON.questions)
|
this.quesAnsForm=this.questionService.assignFormControl_array(this.quesAnsForm,this.local_ques_JSON.questions)
|
||||||
console.log(this.quesAnsForm);
|
console.log(this.quesAnsForm);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
setStep(index: number) {
|
setStep(index: number) {
|
||||||
this.step = index;
|
this.step = index;
|
||||||
}
|
}
|
||||||
@ -63,54 +72,59 @@ export class QuesTemplateComponent {
|
|||||||
prevStep() {
|
prevStep() {
|
||||||
this.step--;
|
this.step--;
|
||||||
}
|
}
|
||||||
addData(group_index,parent_index,data,event,options?:any,single_ques?){
|
addData(group_index, parent_index, data, event, options?: any, single_ques?) {
|
||||||
console.log(data,parent_index,group_index,single_ques)
|
console.log(data, parent_index, group_index, single_ques)
|
||||||
if(options == 'camera'){
|
if (options == 'camera') {
|
||||||
|
|
||||||
this.cameraProvider.getpicture().then(res => {
|
this.cameraProvider.getpicture().then(res => {
|
||||||
|
|
||||||
if (res != 'error') {
|
if (res != 'error') {
|
||||||
|
|
||||||
this.geoCoordinates=localStorage.getItem('current_coordinates')
|
this.geoCoordinates = localStorage.getItem('current_coordinates')
|
||||||
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
this.cameraProvider.addWatermarks(res).then(watermarkedImage => {
|
||||||
single_ques.controls.answer_value.setValue(watermarkedImage)
|
single_ques.controls.answer_value.setValue(watermarkedImage)
|
||||||
|
|
||||||
|
//SENDING SINGLE IMAGE TO API WITH PRIMARY KEY
|
||||||
|
let params={"fk_sales_pd_id":"","img":watermarkedImage,"img_name":single_ques.value.question_key}
|
||||||
|
this.salesPDProvider.saveSalesPDImage(params).subscribe(apiresult=>{
|
||||||
|
if(apiresult['dataStatus']){
|
||||||
|
console.log("image saved successfully")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toastProvider.lenderappmessage("Something went wrong");
|
||||||
|
}
|
||||||
|
},err=>{
|
||||||
|
console.log("error",err);
|
||||||
|
this.toastProvider.lenderappmessage('Network Error')
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
console.log("Camera Error ", JSON.stringify(error));
|
console.log("Camera Error ", JSON.stringify(error));
|
||||||
})
|
})
|
||||||
|
|
||||||
//camera capture
|
//camera capture
|
||||||
let control:any=parent_index['controls'].questions_group as FormArray
|
let control: any = parent_index['controls'].questions_group as FormArray
|
||||||
control.push(this._fb.group({'questions':this._fb.array([])}))
|
control.push(this._fb.group({ 'questions': this._fb.array([]) }))
|
||||||
let sub_childControl:any=control.controls[group_index+1].get('questions') as FormArray
|
let sub_childControl: any = control.controls[group_index + 1].get('questions') as FormArray
|
||||||
data.forEach(group_indi=>{
|
data.forEach(group_indi => {
|
||||||
delete group_indi.answer_value
|
delete group_indi.answer_value
|
||||||
sub_childControl.push(this.questionService.createValue(group_indi))
|
sub_childControl.push(this.questionService.createValue(group_indi))
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let control: any = parent_index['controls'].questions_group as FormArray
|
||||||
|
event.stopPropagation()
|
||||||
|
this.step = control.length
|
||||||
|
control.push(this._fb.group({ 'questions': this._fb.array([]) }))
|
||||||
|
let sub_childControl: any = control.controls[group_index + 1].get('questions') as FormArray
|
||||||
|
data.forEach((group_indi, arr_index) => {
|
||||||
|
sub_childControl.push(this.questionService.createValue(group_indi))
|
||||||
|
this.questionService.addAdditionalControl(group_indi, sub_childControl, arr_index)
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log("dd112", this.quesAnsForm, sub_childControl, this.step)
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
|
|
||||||
let control:any=parent_index['controls'].questions_group as FormArray
|
|
||||||
event.stopPropagation()
|
|
||||||
this.step=control.length
|
|
||||||
control.push(this._fb.group({'questions':this._fb.array([])}))
|
|
||||||
let sub_childControl:any=control.controls[group_index+1].get('questions') as FormArray
|
|
||||||
data.forEach((group_indi,arr_index)=>{
|
|
||||||
sub_childControl.push(this.questionService.createValue(group_indi))
|
|
||||||
if(group_indi.type == '5'){
|
|
||||||
sub_childControl.controls[arr_index].removeControl('answer_value');
|
|
||||||
console.log("loop",arr_index,sub_childControl);
|
|
||||||
sub_childControl.controls[arr_index].addControl('answer_value',this._fb.array([]))
|
|
||||||
}
|
|
||||||
if(group_indi.type == '1'){
|
|
||||||
sub_childControl.controls[arr_index].addControl('field_type',new FormControl(group_indi.field_type))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log("dd112",this.quesAnsForm,sub_childControl,this.step)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
captureImg(parent_index,parent_control){
|
captureImg(parent_index,parent_control){
|
||||||
|
|
||||||
@ -121,6 +135,20 @@ export class QuesTemplateComponent {
|
|||||||
this.geoCoordinates=localStorage.getItem('current_coordinates')
|
this.geoCoordinates=localStorage.getItem('current_coordinates')
|
||||||
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
||||||
parent_control.controls.answer_value.setValue(watermarkedImage)
|
parent_control.controls.answer_value.setValue(watermarkedImage)
|
||||||
|
|
||||||
|
//SENDING SINGLE IMAGE TO API WITH PRIMARY KEY
|
||||||
|
let params={"fk_sales_pd_id":"","img":watermarkedImage,"img_name":parent_control.value.question_key}
|
||||||
|
this.salesPDProvider.saveSalesPDImage(params).subscribe(apiresult=>{
|
||||||
|
if(apiresult['dataStatus']){
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toastProvider.lenderappmessage("Something went wrong");
|
||||||
|
}
|
||||||
|
},err=>{
|
||||||
|
console.log("error",err);
|
||||||
|
this.toastProvider.lenderappmessage('Network Error')
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -209,7 +237,7 @@ export class QuesTemplateComponent {
|
|||||||
this.quesAnsForm.controls.questions['controls'].forEach((val,index)=>{
|
this.quesAnsForm.controls.questions['controls'].forEach((val,index)=>{
|
||||||
|
|
||||||
if(val.value.api_properties == 'local_city'){
|
if(val.value.api_properties == 'local_city'){
|
||||||
console.log("v",val)
|
// console.log("v",val)
|
||||||
console.log(this.local_city,this.local_pincode)
|
console.log(this.local_city,this.local_pincode)
|
||||||
this.local_city=this.questionService.convertArrayNames(['city_id','city_name'],this.local_city)
|
this.local_city=this.questionService.convertArrayNames(['city_id','city_name'],this.local_city)
|
||||||
val.controls.answers.setValue(this.local_city)
|
val.controls.answers.setValue(this.local_city)
|
||||||
@ -280,5 +308,41 @@ export class QuesTemplateComponent {
|
|||||||
this.emitter.emit(storage_param)
|
this.emitter.emit(storage_param)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
sendDatatoApi(){
|
||||||
|
let raw_data_ques:any=localStorage.getItem('question_temp_salespd')
|
||||||
|
raw_data_ques=JSON.parse(raw_data_ques)
|
||||||
|
let all_sections=raw_data_ques.sections.map(val=>val.section_id)
|
||||||
|
this.loadingProvider.pdloader('Please Wait...')
|
||||||
|
this.salesPDProvider.sendData(all_sections).then((res:any)=>{
|
||||||
|
console.log(res)
|
||||||
|
let params={pd_json:JSON.stringify(res)}
|
||||||
|
this.salesPDProvider.saveQuestions(params).subscribe(apiresult=>{
|
||||||
|
if(apiresult['dataStatus']){
|
||||||
|
if(apiresult['records'] != true){
|
||||||
|
this.salesPDProvider.insertData_Replace('sales_pd_id_PRIMARYKEY',apiresult['records'])
|
||||||
|
}
|
||||||
|
// this.SalesPDService.clearLocalData()
|
||||||
|
// if(res.length > 1){
|
||||||
|
// this.toastProvider.lenderappmessage("Saved Successfully..!");
|
||||||
|
// }
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// this.navCtrl.setRoot(SalesPDlistPage)
|
||||||
|
// },2000)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toastProvider.lenderappmessage("Something went wrong");
|
||||||
|
setTimeout(()=>{
|
||||||
|
// this.navCtrl.pop();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.loadingProvider.dismissLoader();
|
||||||
|
},err=>{
|
||||||
|
this.loadingProvider.dismissLoader();
|
||||||
|
console.log("error",err);
|
||||||
|
this.toastProvider.lenderappmessage('Network Error')
|
||||||
|
this.sendDatatoApi();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { ToastProvider } from '../../../../providers/common-provider/toast';
|
|||||||
import { PdtriggerProvider } from '../../../../providers/pdtrigger/pdtrigger';
|
import { PdtriggerProvider } from '../../../../providers/pdtrigger/pdtrigger';
|
||||||
import { SalesPDlistPage } from '../sales-p-dlist/sales-p-dlist';
|
import { SalesPDlistPage } from '../sales-p-dlist/sales-p-dlist';
|
||||||
import { CameraProvider } from '../../providers/camera/camera';
|
import { CameraProvider } from '../../providers/camera/camera';
|
||||||
|
import { LoadingProvider } from '../../../../providers/common-provider/loading';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,7 +85,7 @@ export class Section1 {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
console.log('ionViewDidLoad HomePage');
|
console.log('ionViewDidLoad HomePage');
|
||||||
this.cameraProvider.enableAccuracy()
|
// this.cameraProvider.enableAccuracy()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -385,21 +386,15 @@ export class Section7 {
|
|||||||
else{
|
else{
|
||||||
// this.sendData()
|
// this.sendData()
|
||||||
console.log("else part")
|
console.log("else part")
|
||||||
this.SalesPDService.sendData(this.all_sections).then(res=>{
|
// this.sendDatatoApi()
|
||||||
console.log(res)
|
this.SalesPDService.clearLocalData()
|
||||||
let params={pd_json:JSON.stringify(res)}
|
|
||||||
this.SalesPDService.saveQuestions(params).subscribe(apiresult=>{
|
|
||||||
if(apiresult['dataStatus']){
|
|
||||||
this.SalesPDService.clearLocalData()
|
|
||||||
this.toastProvider.lenderappmessage("Saved Successfully..!");
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.navCtrl.setRoot(SalesPDlistPage)
|
|
||||||
},2000)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
this.toastProvider.lenderappmessage("Saved Successfully..!");
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.navCtrl.setRoot(SalesPDlistPage)
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,21 +445,15 @@ export class Section8 {
|
|||||||
else{
|
else{
|
||||||
// this.sendData()
|
// this.sendData()
|
||||||
console.log("else part")
|
console.log("else part")
|
||||||
this.SalesPDService.sendData(this.all_sections).then(res=>{
|
// this.sendDatatoApi()
|
||||||
console.log(res)
|
this.SalesPDService.clearLocalData()
|
||||||
let params={pd_json:JSON.stringify(res)}
|
|
||||||
this.SalesPDService.saveQuestions(params).subscribe(apiresult=>{
|
|
||||||
if(apiresult['dataStatus']){
|
|
||||||
this.SalesPDService.clearLocalData()
|
|
||||||
this.toastProvider.lenderappmessage("Saved Successfully..!");
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.navCtrl.setRoot(SalesPDlistPage)
|
|
||||||
},2000)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
|
this.toastProvider.lenderappmessage("Saved Successfully..!");
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.navCtrl.setRoot(SalesPDlistPage)
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,7 +469,7 @@ export class Section9 {
|
|||||||
section_local:number=9
|
section_local:number=9
|
||||||
all_sections:any;
|
all_sections:any;
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,private SalesPDService:SalesPdProvider,private toastProvider:ToastProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,private SalesPDService:SalesPdProvider,private loadingProvider:LoadingProvider,private toastProvider:ToastProvider) {
|
||||||
// if(this.navParams.get('sec_no')){
|
// if(this.navParams.get('sec_no')){
|
||||||
// this.section_local=this.navParams.get('sec_no')
|
// this.section_local=this.navParams.get('sec_no')
|
||||||
// }
|
// }
|
||||||
@ -490,12 +479,18 @@ export class Section9 {
|
|||||||
// this.question_data=this.raw_data.sections.filter(val => val.section_id == this.section_local)[0]
|
// this.question_data=this.raw_data.sections.filter(val => val.section_id == this.section_local)[0]
|
||||||
// console.log(this.question_data)
|
// console.log(this.question_data)
|
||||||
// })
|
// })
|
||||||
|
|
||||||
this.raw_data=localStorage.getItem('question_temp_salespd')
|
this.raw_data=localStorage.getItem('question_temp_salespd')
|
||||||
this.raw_data=JSON.parse(this.raw_data)
|
this.raw_data=JSON.parse(this.raw_data)
|
||||||
|
|
||||||
this.all_sections=this.raw_data.sections.map(val=>val.section_id)
|
this.all_sections=this.raw_data.sections.map(val=>val.section_id)
|
||||||
console.log(this.all_sections)
|
console.log(this.all_sections)
|
||||||
this.question_data=this.raw_data.sections.filter(val => val.order_id == this.section_local)[0]
|
this.question_data=this.raw_data.sections.filter(val => val.order_id == this.section_local)[0]
|
||||||
console.log(this.question_data)
|
console.log(this.question_data)
|
||||||
|
|
||||||
|
// if(this.question_data.section_id == 9){
|
||||||
|
// this.sendDatatoApi()
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
@ -515,22 +510,44 @@ export class Section9 {
|
|||||||
else{
|
else{
|
||||||
// this.sendData()
|
// this.sendData()
|
||||||
console.log("else part")
|
console.log("else part")
|
||||||
this.SalesPDService.sendData(this.all_sections).then(res=>{
|
// this.sendDatatoApi()
|
||||||
console.log(res)
|
this.SalesPDService.clearLocalData()
|
||||||
let params={pd_json:JSON.stringify(res)}
|
|
||||||
this.SalesPDService.saveQuestions(params).subscribe(apiresult=>{
|
this.toastProvider.lenderappmessage("Saved Successfully..!");
|
||||||
if(apiresult['dataStatus']){
|
setTimeout(()=>{
|
||||||
this.SalesPDService.clearLocalData()
|
this.navCtrl.setRoot(SalesPDlistPage)
|
||||||
this.toastProvider.lenderappmessage("Saved Successfully..!");
|
})
|
||||||
setTimeout(()=>{
|
|
||||||
this.navCtrl.setRoot(SalesPDlistPage)
|
|
||||||
},2000)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// sendDatatoApi(){
|
||||||
|
// this.loadingProvider.pdloader('Please Wait...')
|
||||||
|
// this.SalesPDService.sendData(this.all_sections).then((res:any)=>{
|
||||||
|
// console.log(res)
|
||||||
|
// let params={pd_json:JSON.stringify(res)}
|
||||||
|
// this.SalesPDService.saveQuestions(params).subscribe(apiresult=>{
|
||||||
|
// if(apiresult['dataStatus']){
|
||||||
|
// this.SalesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',apiresult['records'])
|
||||||
|
// // this.SalesPDService.clearLocalData()
|
||||||
|
// // if(res.length > 1){
|
||||||
|
// // this.toastProvider.lenderappmessage("Saved Successfully..!");
|
||||||
|
// // }
|
||||||
|
// // setTimeout(()=>{
|
||||||
|
// // this.navCtrl.setRoot(SalesPDlistPage)
|
||||||
|
// // },2000)
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// this.toastProvider.lenderappmessage("Something went wrong");
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// this.navCtrl.pop();
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// this.loadingProvider.dismissLoader();
|
||||||
|
// },err=>{
|
||||||
|
// this.loadingProvider.dismissLoader();
|
||||||
|
// console.log("error",err);
|
||||||
|
// this.toastProvider.lenderappmessage('Network Error')
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
margin: 5px;
|
margin: 5px;
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
border-radius: 10px;" *ngFor="let val of productList" [value]="val.product_id" ><span>{{val.product_abbr}}</span></mat-radio-button>
|
border-radius: 10px;" *ngFor="let val of productList" [value]="val.product_id" ><span>{{val.product_abbr}}</span></mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group><br/>
|
||||||
<!-- </mat-form-field> -->
|
<!-- </mat-form-field> -->
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<button ion-button color="optblue" (click)="sendProduct()">Submit</button>
|
<button ion-button color="optblue" (click)="sendProduct()">Submit</button>
|
||||||
|
|||||||
@ -24,6 +24,7 @@ export class SalesPDlistPage {
|
|||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
console.log('ionViewDidLoad SalesPDlistPage');
|
console.log('ionViewDidLoad SalesPDlistPage');
|
||||||
this.getListofPD()
|
this.getListofPD()
|
||||||
|
this.salesPDService.clearLocalData();
|
||||||
}
|
}
|
||||||
getListofPD(){
|
getListofPD(){
|
||||||
this.salesPDService.getSalesPDList().subscribe(res=>{
|
this.salesPDService.getSalesPDList().subscribe(res=>{
|
||||||
|
|||||||
@ -44,17 +44,18 @@ export class QuesServiceProvider {
|
|||||||
// val.api_properties.forEach(val=>param=val)
|
// val.api_properties.forEach(val=>param=val)
|
||||||
// console.log(param)
|
// console.log(param)
|
||||||
sub_childControl.push(this.createValue(group_indi))
|
sub_childControl.push(this.createValue(group_indi))
|
||||||
if(group_indi.type == '5'){
|
this.addAdditionalControl(group_indi,sub_childControl,arr_index)
|
||||||
sub_childControl.controls[arr_index].removeControl('answer_value');
|
// if(group_indi.type == '5'){
|
||||||
console.log("loop",arr_index,sub_childControl);
|
// sub_childControl.controls[arr_index].removeControl('answer_value');
|
||||||
sub_childControl.controls[arr_index].addControl('answer_value',this._fb.array([]))
|
// console.log("loop",arr_index,sub_childControl);
|
||||||
}
|
// sub_childControl.controls[arr_index].addControl('answer_value',this._fb.array([]))
|
||||||
if(group_indi.type == '1'){
|
// }
|
||||||
sub_childControl.controls[arr_index].addControl('field_type',new FormControl(group_indi.field_type))
|
// if(group_indi.type == '1'){
|
||||||
}
|
// sub_childControl.controls[arr_index].addControl('field_type',new FormControl(group_indi.field_type))
|
||||||
if(val.type == '8'){
|
// }
|
||||||
control.controls[index].addControl('select_search',new FormControl(val.field_type))
|
// if(val.type == '8'){
|
||||||
}
|
// sub_childControl.controls[index].addControl('select_search',new FormControl(val.field_type))
|
||||||
|
// }
|
||||||
|
|
||||||
if(group_indi.api_properties != null){
|
if(group_indi.api_properties != null){
|
||||||
this.apiPropertiesCall(group_indi).then(res=>{
|
this.apiPropertiesCall(group_indi).then(res=>{
|
||||||
@ -89,25 +90,26 @@ export class QuesServiceProvider {
|
|||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log("con",control)
|
// console.log("con",control)
|
||||||
let key_list=Object.keys(val)
|
// let key_list=Object.keys(val)
|
||||||
console.log(Object.keys(val))
|
// console.log(Object.keys(val))
|
||||||
let curr_object
|
// let curr_object
|
||||||
console.log("apikd",typeof(val.api_properties))
|
// console.log("apikd",typeof(val.api_properties))
|
||||||
// if(val.api_properties != null && typeof(val.api_properties) == 'object'){
|
// if(val.api_properties != null && typeof(val.api_properties) == 'object'){
|
||||||
control.push(this.createValue(val))
|
control.push(this.createValue(val))
|
||||||
// for checkbox remove the form control and add the formarray for multiple values
|
// for checkbox remove the form control and add the formarray for multiple values
|
||||||
if(val.type == '5'){
|
this.addAdditionalControl(val,control,index)
|
||||||
control.controls[index].removeControl('answer_value');
|
// if(val.type == '5'){
|
||||||
console.log("loop",index,control);
|
// control.controls[index].removeControl('answer_value');
|
||||||
control.controls[index].addControl('answer_value',this._fb.array([]))
|
// console.log("loop",index,control);
|
||||||
}
|
// control.controls[index].addControl('answer_value',this._fb.array([]))
|
||||||
if(val.type == '1'){
|
// }
|
||||||
control.controls[index].addControl('field_type',new FormControl(val.field_type))
|
// if(val.type == '1'){
|
||||||
}
|
// control.controls[index].addControl('field_type',new FormControl(val.field_type))
|
||||||
if(val.type == '8'){
|
// }
|
||||||
control.controls[index].addControl('select_search',new FormControl(val.field_type))
|
// if(val.type == '8'){
|
||||||
}
|
// control.controls[index].addControl('select_search',new FormControl(val.field_type))
|
||||||
|
// }
|
||||||
if(val.api_properties!= null){
|
if(val.api_properties!= null){
|
||||||
this.apiPropertiesCall(val).then(res=>{
|
this.apiPropertiesCall(val).then(res=>{
|
||||||
console.log("chekc",res)
|
console.log("chekc",res)
|
||||||
@ -143,10 +145,16 @@ export class QuesServiceProvider {
|
|||||||
return formgroup
|
return formgroup
|
||||||
}
|
}
|
||||||
createValue(data){
|
createValue(data){
|
||||||
|
let is_amt_in_words=false
|
||||||
let answer_value_loc='';
|
let answer_value_loc='';
|
||||||
if(data.type == '1' && data.hasOwnProperty('answer_value') && data.answer_value != '' || null){
|
if(data.type == '1' && data.hasOwnProperty('answer_value') && data.answer_value != '' || null){
|
||||||
answer_value_loc = this.getAnswerValue(data)
|
answer_value_loc = this.getAnswerValue(data)
|
||||||
}
|
}
|
||||||
|
// if(data.hasOwnProperty('field_type')){
|
||||||
|
// if(data.field_type == 'num'){
|
||||||
|
// is_amt_in_words=true
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return this._fb.group({
|
return this._fb.group({
|
||||||
"answer_value":[{value:answer_value_loc,disabled:answer_value_loc != '' ? true : false},data.type != '6' ? Validators.compose([Validators.required]) : ''],
|
"answer_value":[{value:answer_value_loc,disabled:answer_value_loc != '' ? true : false},data.type != '6' ? Validators.compose([Validators.required]) : ''],
|
||||||
"question":[data.question],
|
"question":[data.question],
|
||||||
@ -182,7 +190,7 @@ export class QuesServiceProvider {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
convertArrayNames(fieldName,data_from_api){
|
convertArrayNames(fieldName,data_from_api){
|
||||||
|
let val1=[]
|
||||||
let modified_json = data_from_api.map(
|
let modified_json = data_from_api.map(
|
||||||
obj => {
|
obj => {
|
||||||
return {
|
return {
|
||||||
@ -192,6 +200,7 @@ export class QuesServiceProvider {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
return modified_json
|
return modified_json
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getAnswerValue(value_obj){
|
getAnswerValue(value_obj){
|
||||||
@ -220,5 +229,17 @@ export class QuesServiceProvider {
|
|||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
addAdditionalControl(data,curr_control,curr_index){
|
||||||
|
if(data.type == '5'){
|
||||||
|
curr_control.controls[curr_index].removeControl('answer_value');
|
||||||
|
curr_control.controls[curr_index].addControl('answer_value',this._fb.array([]))
|
||||||
|
}
|
||||||
|
if(data.type == '1'){
|
||||||
|
curr_control.controls[curr_index].addControl('field_type',new FormControl(data.field_type))
|
||||||
|
}
|
||||||
|
if(data.type == '8'){
|
||||||
|
curr_control.controls[curr_index].addControl('select_search',new FormControl(data.field_type))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { ConstantsProvider } from '../../../../providers/constants/constants';
|
|||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service';
|
import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service';
|
||||||
|
import { Observable, Observer } from 'rxjs';
|
||||||
// import {environment} from '../../../../providers/constants/constants'
|
// import {environment} from '../../../../providers/constants/constants'
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -30,15 +31,23 @@ current_section:any;
|
|||||||
return this.http.post(this.apiUrl+'loadSalesPDTemplate',{records:{lender_id:users.fk_entity_id,product_id:product_id}})
|
return this.http.post(this.apiUrl+'loadSalesPDTemplate',{records:{lender_id:users.fk_entity_id,product_id:product_id}})
|
||||||
|
|
||||||
}
|
}
|
||||||
saveQuestions(params){
|
saveQuestions(params): Observable<Response>{
|
||||||
params.createdby=this.aws.getlocale();
|
params.createdby=this.aws.getlocale();
|
||||||
let product_id=localStorage.getItem('product_id_salesPD')
|
let product_id=localStorage.getItem('product_id_salesPD')
|
||||||
let users:any=localStorage.getItem('user_details')
|
let users:any=localStorage.getItem('user_details')
|
||||||
users=JSON.parse(users)
|
users=JSON.parse(users)
|
||||||
params.sales_pd_id='',
|
// let pd_primary_key;
|
||||||
|
return Observable.create((observer:Observer<any>) => {
|
||||||
|
this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
|
||||||
|
params.sales_pd_id=key_value,
|
||||||
params.lender_id=users.fk_entity_id,
|
params.lender_id=users.fk_entity_id,
|
||||||
params.product_id=product_id
|
params.product_id=product_id
|
||||||
return this.http.post(this.apiUrl+'saveSalesPD',{records:params})
|
return this.http.post(this.apiUrl+'saveSalesPD',{records:params}).pipe().subscribe(result => {
|
||||||
|
observer.next(result);
|
||||||
|
observer.complete();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
api_post_method(api_name:string,params,api_method?){
|
api_post_method(api_name:string,params,api_method?){
|
||||||
@ -110,5 +119,16 @@ current_section:any;
|
|||||||
det=JSON.parse(det)
|
det=JSON.parse(det)
|
||||||
return this.http.get(this.apiUrl+'listSalesPD/'+det.fk_entity_id+'/'+det.userid)
|
return this.http.get(this.apiUrl+'listSalesPD/'+det.fk_entity_id+'/'+det.userid)
|
||||||
}
|
}
|
||||||
|
saveSalesPDImage(params): Observable<Response>{
|
||||||
|
return Observable.create((observer:Observer<any>) => {
|
||||||
|
this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
|
||||||
|
params.fk_sales_pd_id=key_value,
|
||||||
|
this.http.post(this.apiUrl+'saveSalesPDImage',{records:params}).pipe().subscribe(result => {
|
||||||
|
observer.next(result);
|
||||||
|
observer.complete();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,10 +18,15 @@ export class LoadingProvider {
|
|||||||
pdloader(content)
|
pdloader(content)
|
||||||
{
|
{
|
||||||
this.loading = this.loadingCtrl.create({
|
this.loading = this.loadingCtrl.create({
|
||||||
content: content
|
content: content,
|
||||||
|
enableBackdropDismiss:false,
|
||||||
|
duration:10000
|
||||||
});
|
});
|
||||||
|
|
||||||
this.loading.present();
|
this.loading.present();
|
||||||
}
|
}
|
||||||
|
dismissLoader(){
|
||||||
|
this.loading.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user