Compare commits
10 Commits
d3f1b28d77
...
bba5356f6a
| Author | SHA1 | Date | |
|---|---|---|---|
| bba5356f6a | |||
| fabfde8335 | |||
| f957547924 | |||
| 71f48b4593 | |||
| 4e9138e61f | |||
| c1dc6b59c6 | |||
| c9ce4038e7 | |||
| 84c7521b13 | |||
| 9e7a8819ae | |||
| 1635c48336 |
Binary file not shown.
@ -42,6 +42,7 @@ import { AwsService } from './AwsService/aws.service';
|
|||||||
import { TokenInterceptor } from './_guard/token.interceptor';
|
import { TokenInterceptor } from './_guard/token.interceptor';
|
||||||
import { NewPasswordDialog, ForgotPass } from './session/login/login.component';
|
import { NewPasswordDialog, ForgotPass } from './session/login/login.component';
|
||||||
import { NewPasswordDialog2,ForgotPass2 } from './session/otp/otp.component';
|
import { NewPasswordDialog2,ForgotPass2 } from './session/otp/otp.component';
|
||||||
|
import { AutoLoginComponent } from './session/auto-login/auto-login.component';
|
||||||
import { AuthGuard } from './_guard/auth.guard';
|
import { AuthGuard } from './_guard/auth.guard';
|
||||||
import { RoleMenuItemsPipe } from './layouts/role-menu-items.pipe';
|
import { RoleMenuItemsPipe } from './layouts/role-menu-items.pipe';
|
||||||
import { ResizableModule } from 'angular-resizable-element';
|
import { ResizableModule } from 'angular-resizable-element';
|
||||||
@ -76,8 +77,8 @@ export function createTranslateLoader(http: HttpClient) {
|
|||||||
AuthLayoutComponent,
|
AuthLayoutComponent,
|
||||||
NewPasswordDialog,ForgotPass,NewPasswordDialog2,ForgotPass2,ChangePasswordDialog, RoleMenuItemsPipe,
|
NewPasswordDialog,ForgotPass,NewPasswordDialog2,ForgotPass2,ChangePasswordDialog, RoleMenuItemsPipe,
|
||||||
HttpLoaderComponent,
|
HttpLoaderComponent,
|
||||||
DialogOverviewExampleDialog,OtpComponent
|
DialogOverviewExampleDialog,OtpComponent,
|
||||||
|
AutoLoginComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
|
|||||||
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
|
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
|
||||||
import { CognitoService} from './AwsService/cognito.service';
|
import { CognitoService} from './AwsService/cognito.service';
|
||||||
import { AuthGuard } from './_guard/auth.guard';
|
import { AuthGuard } from './_guard/auth.guard';
|
||||||
|
import { AutoLoginComponent } from './session/auto-login/auto-login.component';
|
||||||
// import { SalesPdComponent } from './sales-pd/sales-pd.component';
|
// import { SalesPdComponent } from './sales-pd/sales-pd.component';
|
||||||
// let role = localStorage.g('user_role');
|
// let role = localStorage.g('user_role');
|
||||||
// console.log(role)
|
// console.log(role)
|
||||||
@ -76,4 +77,4 @@ export const AppRoutes: Routes = [{
|
|||||||
}, {
|
}, {
|
||||||
path: '**',
|
path: '**',
|
||||||
redirectTo: 'session/404'
|
redirectTo: 'session/404'
|
||||||
}];
|
}, { path: 'auto', component: AutoLoginComponent }];
|
||||||
|
|||||||
@ -210,10 +210,12 @@
|
|||||||
<mat-icon>settings</mat-icon>
|
<mat-icon>settings</mat-icon>
|
||||||
Setting
|
Setting
|
||||||
</button>
|
</button>
|
||||||
|
<span *ngIf="login_type_id == 0">
|
||||||
<button mat-menu-item (click)="userprofile()">
|
<button mat-menu-item (click)="userprofile()">
|
||||||
<mat-icon>account_box</mat-icon>
|
<mat-icon>account_box</mat-icon>
|
||||||
Profile
|
Profile
|
||||||
</button>
|
</button>
|
||||||
|
</span>
|
||||||
<!-- <button mat-menu-item>
|
<!-- <button mat-menu-item>
|
||||||
<mat-icon>notifications_off</mat-icon>
|
<mat-icon>notifications_off</mat-icon>
|
||||||
Disable notifications
|
Disable notifications
|
||||||
|
|||||||
@ -56,9 +56,11 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
|||||||
userRoleType: any;
|
userRoleType: any;
|
||||||
userDetails: any;
|
userDetails: any;
|
||||||
role_id: any;
|
role_id: any;
|
||||||
|
login_type_id: number;
|
||||||
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService) {
|
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService) {
|
||||||
const browserLang: string = translate.getBrowserLang();
|
const browserLang: string = translate.getBrowserLang();
|
||||||
this.role_id = localStorage.getItem('user_role_nav')
|
this.role_id = localStorage.getItem('user_role_nav')
|
||||||
|
this.login_type_id = parseInt(localStorage.getItem('login_type_id'));
|
||||||
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
|
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
|
||||||
this.users.getroles().subscribe(res=>{
|
this.users.getroles().subscribe(res=>{
|
||||||
console.log(res)
|
console.log(res)
|
||||||
@ -293,6 +295,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
logout(){
|
logout(){
|
||||||
//alert();
|
//alert();
|
||||||
|
this.login_type_id == 1 ? localStorage.removeItem('sales_pd_id_PRIMARYKEY') : localStorage.removeItem('sales_pd_id_PRIMARYKEY');
|
||||||
this.aws.logout().subscribe(res=>{
|
this.aws.logout().subscribe(res=>{
|
||||||
//alert("res");
|
//alert("res");
|
||||||
this.router.navigate(['/authentication/login']);
|
this.router.navigate(['/authentication/login']);
|
||||||
|
|||||||
@ -727,6 +727,10 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
submitPdDetails(formValue: any, status: string) {
|
submitPdDetails(formValue: any, status: string) {
|
||||||
// console.log('inside the submitPdDetails data');
|
// console.log('inside the submitPdDetails data');
|
||||||
|
|
||||||
|
|
||||||
|
let login_type_id = parseInt(localStorage.getItem('login_type_id')); // 1 na auto-login , 0 na manual-login
|
||||||
|
let user_id = (login_type_id == 1) ? localStorage.getItem('officer_id') : this._aws.getlocale() ;
|
||||||
|
|
||||||
if (this._PDtriggerForm.invalid) {
|
if (this._PDtriggerForm.invalid) {
|
||||||
// let validate = this.findInvalidControls();
|
// let validate = this.findInvalidControls();
|
||||||
// console.log('validate checking',validate);
|
// console.log('validate checking',validate);
|
||||||
@ -801,7 +805,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
"other_pincode": formValue.addresses[0].other_pincode,
|
"other_pincode": formValue.addresses[0].other_pincode,
|
||||||
"remarks": formValue.remarks,
|
"remarks": formValue.remarks,
|
||||||
"pd_status": status,
|
"pd_status": status,
|
||||||
"fk_createdby": this._aws.getlocale(),
|
"fk_createdby": user_id,
|
||||||
"excel_file_id":this.excel_file_id
|
"excel_file_id":this.excel_file_id
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
margin-top: -5px;
|
margin-top: -5px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
:host /deep/ {
|
::ng-deep {
|
||||||
mat-sidenav {
|
mat-sidenav {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
|
|||||||
@ -555,8 +555,16 @@ export class PdTrigerService {
|
|||||||
}
|
}
|
||||||
getSalesPd(): Observable<any> {
|
getSalesPd(): Observable<any> {
|
||||||
var lender_id= localStorage.getItem('LocalSetEntity')
|
var lender_id= localStorage.getItem('LocalSetEntity')
|
||||||
let user_role_id = localStorage.getItem('LenderRoleID')
|
let user_role_id :any;
|
||||||
let user_id = this._aws.getlocale()
|
let user_id:any;
|
||||||
|
let login_type_id = parseInt(localStorage.getItem('login_type_id')); // 1 na auto-login , 0 na manual-login
|
||||||
|
if(login_type_id == 1){
|
||||||
|
user_role_id = localStorage.getItem('user_role');
|
||||||
|
user_id = localStorage.getItem('officer_id');
|
||||||
|
}else{
|
||||||
|
user_role_id = localStorage.getItem('LenderRoleID');
|
||||||
|
user_id = this._aws.getlocale();
|
||||||
|
}
|
||||||
// console.log('555',value);
|
// console.log('555',value);
|
||||||
return this._http.get<any[]>(this.apiUrl + `listSalesPD/${lender_id}/${user_id}/${user_role_id}`)
|
return this._http.get<any[]>(this.apiUrl + `listSalesPD/${lender_id}/${user_id}/${user_role_id}`)
|
||||||
.pipe(
|
.pipe(
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
margin-top: -5px;
|
margin-top: -5px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
:host /deep/ {
|
:ng-deep{
|
||||||
mat-sidenav {
|
mat-sidenav {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import { SectionListComponent } from 'app/sales-pd/section-list/section-list.com
|
|||||||
import { CameraService } from 'app/sales-pd/providers/camera/camera.service';
|
import { CameraService } from 'app/sales-pd/providers/camera/camera.service';
|
||||||
import { ApiServiceService } from 'app/lender-credit-pd/services/apiService/api-service.service';
|
import { ApiServiceService } from 'app/lender-credit-pd/services/apiService/api-service.service';
|
||||||
import { ImageEditComponent } from './image-edit/image-edit.component';
|
import { ImageEditComponent } from './image-edit/image-edit.component';
|
||||||
|
import { environment } from 'environments/environment';
|
||||||
// const originFormControlNameNgOnChanges = FormControlName.prototype.ngOnChanges;
|
// const originFormControlNameNgOnChanges = FormControlName.prototype.ngOnChanges;
|
||||||
// FormControlName.prototype.ngOnChanges = function () {
|
// FormControlName.prototype.ngOnChanges = function () {
|
||||||
// const result = originFormControlNameNgOnChanges.apply(this, arguments);
|
// const result = originFormControlNameNgOnChanges.apply(this, arguments);
|
||||||
@ -1950,6 +1951,19 @@ this.proceedonChangeProperty(modified)
|
|||||||
console.log('1752')
|
console.log('1752')
|
||||||
section_data.questions=this.questions_JSON.questions
|
section_data.questions=this.questions_JSON.questions
|
||||||
section_data.is_completed=true
|
section_data.is_completed=true
|
||||||
|
|
||||||
|
let login_type_id = parseInt(localStorage.getItem('login_type_id')); // 1 na auto-login , 0 na manual-login
|
||||||
|
if(params.status=="COMPLETED" && login_type_id == 1){
|
||||||
|
let completedPD = localStorage.getItem('completedPD');
|
||||||
|
completedPD = JSON.parse(completedPD)
|
||||||
|
let applicant_id = completedPD['applicant_id']
|
||||||
|
console.log(completedPD['applicant_id']);
|
||||||
|
console.log('completedPD[sales_pd_sno]',completedPD['sales_pd_sno']);
|
||||||
|
this.redirectSMC(applicant_id);
|
||||||
|
// return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.emitter.emit(section_data)
|
this.emitter.emit(section_data)
|
||||||
})
|
})
|
||||||
@ -2275,4 +2289,25 @@ this.proceedonChangeProperty(modified)
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
redirectSMC(applicant_id){
|
||||||
|
|
||||||
|
console.log("calling SMC redirect",environment.authorization);
|
||||||
|
// window.location.href=data.records;
|
||||||
|
let email = localStorage.getItem('officer_mail_id');
|
||||||
|
console.log("calling SMC redirect email = ",email);
|
||||||
|
// http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=4231&email=aniltiwari@smcfinance.com
|
||||||
|
if(environment.authorization == 'TnAwuc64pVpcB9xf'){
|
||||||
|
|
||||||
|
let salesapp_link ="http://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email="+email;
|
||||||
|
console.log('2p salesapp_link = ',salesapp_link);
|
||||||
|
window.open(salesapp_link, '_blank');
|
||||||
|
}else if(environment.authorization == 'sparqvenba2018'){
|
||||||
|
let salesapp_link ="http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email="+email;
|
||||||
|
// window.open('https://www.w3schools.com/html/tryit.asp?filename=tryhtml_basic', '_blank');
|
||||||
|
console.log('2t salesapp_link = ',salesapp_link);
|
||||||
|
window.open(salesapp_link, '_blank');
|
||||||
|
// this.router.navigate([salesapp_link]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,7 +101,7 @@ export class HomePage{
|
|||||||
localStorage.removeItem('sales_pd_type');
|
localStorage.removeItem('sales_pd_type');
|
||||||
// this.salesPDService.clearLocalData()
|
// this.salesPDService.clearLocalData()
|
||||||
// this.salesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
// this.salesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
||||||
localStorage.removeItem('sales_pd_id_PRIMARYKEY');
|
parseInt(localStorage.getItem('login_type_id')) == 0 ? localStorage.removeItem('sales_pd_id_PRIMARYKEY') : '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -858,13 +858,13 @@ checkTheUploadingProgress(sec_value){
|
|||||||
console.log("else part")
|
console.log("else part")
|
||||||
// this.sendDatatoApi()
|
// this.sendDatatoApi()
|
||||||
// this.SalesPDService.clearLocalData()
|
// this.SalesPDService.clearLocalData()
|
||||||
localStorage.removeItem('sales_pd_id_PRIMARYKEY')
|
parseInt(localStorage.getItem('login_type_id')) == 0 ? localStorage.removeItem('sales_pd_id_PRIMARYKEY') : '';
|
||||||
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
||||||
let msg=event.hasOwnProperty('is_completed') && event.is_completed == true ? "Completed Successfully" : 'Saved Successfully..!'
|
let msg=event.hasOwnProperty('is_completed') && event.is_completed == true ? "Completed Successfully" : 'Saved Successfully..!'
|
||||||
this.notifier.notify('success', msg);
|
this.notifier.notify('success', msg);
|
||||||
// this.toastProvider.lenderappmessage(msg);
|
// this.toastProvider.lenderappmessage(msg);
|
||||||
// this.SalesPDService.clearLocalData()
|
// this.SalesPDService.clearLocalData()
|
||||||
localStorage.removeItem('sales_pd_id_PRIMARYKEY')
|
|
||||||
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
||||||
localStorage.removeItem('product_id_salesPD')
|
localStorage.removeItem('product_id_salesPD')
|
||||||
this.dialogRef.close(event);
|
this.dialogRef.close(event);
|
||||||
|
|||||||
@ -175,7 +175,13 @@ current_section:any;
|
|||||||
apiName = 'getFlyhiPDSectionData'
|
apiName = 'getFlyhiPDSectionData'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(localStorage.getItem('login_type_id') == '1'){ //autologin
|
||||||
|
params.fk_createdby = localStorage.getItem('officer_id');
|
||||||
|
}else{
|
||||||
params.fk_createdby=users.userid
|
params.fk_createdby=users.userid
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return Observable.create((observer:Observer<any>)=>{
|
return Observable.create((observer:Observer<any>)=>{
|
||||||
this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
|
this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
|
||||||
params.sales_pd_id=key_value
|
params.sales_pd_id=key_value
|
||||||
@ -329,12 +335,14 @@ current_section:any;
|
|||||||
|
|
||||||
// console.log("Api Stauts ",this.networkProvider.getCurrentNetworkStatus())
|
// console.log("Api Stauts ",this.networkProvider.getCurrentNetworkStatus())
|
||||||
let det:any=localStorage.getItem('user_details')
|
let det:any=localStorage.getItem('user_details')
|
||||||
|
let login_type_id = parseInt(localStorage.getItem('login_type_id')); // 1 na auto-login , 0 na manual-login
|
||||||
|
let user_id = (login_type_id == 0) ? localStorage.getItem('officer_id') : det.userid ;
|
||||||
det=JSON.parse(det)
|
det=JSON.parse(det)
|
||||||
let params = {'fk_entity_id':det.fk_entity_id,userid:det.userid}
|
let params = {'fk_entity_id':det.fk_entity_id,userid:det.userid}
|
||||||
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
||||||
let complete_url = this.apiUrl+'listSalesPD/'+det.fk_entity_id
|
let complete_url = this.apiUrl+'listSalesPD/'+det.fk_entity_id
|
||||||
if(is_sales_login) {
|
if(is_sales_login) {
|
||||||
complete_url = complete_url+'/'+det.userid+'/'+det.user_role
|
complete_url = complete_url+'/'+user_id+'/'+det.user_role
|
||||||
}
|
}
|
||||||
return this.http.get(complete_url).map(res=>{
|
return this.http.get(complete_url).map(res=>{
|
||||||
// this.ionicStorageProvider.checkAndInsertApiDataLocally(res,params,'listSalesPD');
|
// this.ionicStorageProvider.checkAndInsertApiDataLocally(res,params,'listSalesPD');
|
||||||
|
|||||||
@ -44,7 +44,8 @@ export class AdvanceFilterComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
let local:any = JSON.parse(localStorage.getItem('user_details'));
|
let local:any = JSON.parse(localStorage.getItem('user_details'));
|
||||||
let entity_id=localStorage.getItem('LocalSetEntity');
|
let entity_id=localStorage.getItem('LocalSetEntity');
|
||||||
let user_id = this._aws.getlocale();
|
let login_type_id=parseInt(localStorage.getItem('login_type_id')); // 0 means normal 1 means auto
|
||||||
|
let user_id = ((login_type_id == 0) ? this._aws.getlocale() : localStorage.getItem('officer_id'));
|
||||||
// 'drop_down_datas':this.filter_drop_down_data,is_sales_login:this.is_sales_login
|
// 'drop_down_datas':this.filter_drop_down_data,is_sales_login:this.is_sales_login
|
||||||
this.searchForm=this._fb.group({
|
this.searchForm=this._fb.group({
|
||||||
pd_status:[''],
|
pd_status:[''],
|
||||||
@ -140,8 +141,10 @@ export class AdvanceFilterComponent implements OnInit {
|
|||||||
onReset(){
|
onReset(){
|
||||||
this.searchForm.reset();
|
this.searchForm.reset();
|
||||||
let local:any = JSON.parse(localStorage.getItem('user_details'));
|
let local:any = JSON.parse(localStorage.getItem('user_details'));
|
||||||
|
let login_type_id=parseInt(localStorage.getItem('login_type_id')); // 0 means normal 1 means auto
|
||||||
|
let user_id = ((login_type_id == 0) ? local.userid : localStorage.getItem('officer_id'));
|
||||||
this.searchForm.controls['pd_lender'].setValue(local.fk_entity_id);
|
this.searchForm.controls['pd_lender'].setValue(local.fk_entity_id);
|
||||||
this.searchForm.controls['sales_pd_officer_id'].setValue(local.userid);
|
this.searchForm.controls['sales_pd_officer_id'].setValue(user_id);
|
||||||
this.xpandStatus=false
|
this.xpandStatus=false
|
||||||
this.resetFilter.emit(true);
|
this.resetFilter.emit(true);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<mat-card class="p-2" style="box-shadow: 0 0 1px rgba(0,0,0,.18), 0 0 1px rgba(0,0,0,.15) !important">
|
<mat-card class="p-2" style="box-shadow: 0 0 1px rgba(0,0,0,.18), 0 0 1px rgba(0,0,0,.15) !important">
|
||||||
|
<span *ngIf="loginTypeId == 0">
|
||||||
<div fxLayout="row">
|
<div fxLayout="row">
|
||||||
<div fxFlex="50" class="pb-0 text-sm-left">
|
<div fxFlex="50" class="pb-0 text-sm-left">
|
||||||
<mat-form-field dividerColor="primary" style="width: 50%;">
|
<mat-form-field dividerColor="primary" style="width: 50%;">
|
||||||
@ -14,13 +15,17 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</span>
|
||||||
<mat-tab-group class="mt-1">
|
<mat-tab-group class="mt-1">
|
||||||
<mat-tab>
|
<mat-tab>
|
||||||
<ng-template mat-tab-label>Sales PD</ng-template>
|
<ng-template mat-tab-label>Sales PD</ng-template>
|
||||||
<mat-card-content style="padding: 0px !important;">
|
<mat-card-content style="padding: 0px !important;">
|
||||||
|
<span *ngIf="loginTypeId == 0">
|
||||||
<app-advance-filter [drop_down_datas]="filter_drop_down_data" (filteredlistData)="filteredDataSource($event)"
|
<app-advance-filter [drop_down_datas]="filter_drop_down_data" (filteredlistData)="filteredDataSource($event)"
|
||||||
></app-advance-filter>
|
></app-advance-filter>
|
||||||
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
|
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
|
||||||
|
</span>
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
<div class="example-container">
|
<div class="example-container">
|
||||||
<!--Start Mobile View Code-->
|
<!--Start Mobile View Code-->
|
||||||
@ -51,7 +56,7 @@
|
|||||||
<div fxFlex.xs="10" fxFlex.sm="10" class="webhide" style="text-align: right;">
|
<div fxFlex.xs="10" fxFlex.sm="10" class="webhide" style="text-align: right;">
|
||||||
<button style="width: 43px !important;height: 23px !important;line-height: 0px !important;" mat-button mat-icon-button type="button" [disabled]="details.status != 'COMPLETED'"
|
<button style="width: 43px !important;height: 23px !important;line-height: 0px !important;" mat-button mat-icon-button type="button" [disabled]="details.status != 'COMPLETED'"
|
||||||
color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button><br>
|
color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button><br>
|
||||||
<button mat-button mat-icon-button (click)="newPortal()" type="button" matTooltip="link" matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
<button mat-button mat-icon-button (click)="callAPIForPortals(details)" type="button" matTooltip="link." matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
</div>
|
</div>
|
||||||
@ -118,7 +123,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
||||||
<button mat-button mat-icon-button (click)="newPortal()" type="button" matTooltip="link" matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
<button mat-button mat-icon-button (click)="newPortals(details)" type="button" matTooltip="link" matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
||||||
<button [disabled]="details.status !== 'COMPLETED'" mat-button mat-icon-button class=" hover-icon" type="button" color="primary" (click)="uploadDatatoCET(details.sales_pd_id)"
|
<button [disabled]="details.status !== 'COMPLETED'" mat-button mat-icon-button class=" hover-icon" type="button" color="primary" (click)="uploadDatatoCET(details.sales_pd_id)"
|
||||||
@ -248,12 +253,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
||||||
<button mat-button mat-icon-button (click)="newPortal()" type="button" matTooltip="link" matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
<button mat-button mat-icon-button (click)="callAPIForPortals(details)" type="button" matTooltip="Link." matTooltipPosition="above" color="primary"><mat-icon>link</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
||||||
<button [disabled]="details.status !== 'COMPLETED'" mat-button mat-icon-button class=" hover-icon" type="button" color="primary" (click)="uploadDatatoCET(details.sales_pd_id)"
|
<button [disabled]="details.status !== 'COMPLETED'" mat-button mat-icon-button class=" hover-icon" type="button" color="primary" (click)="uploadDatatoCET(details.sales_pd_id)"
|
||||||
matTooltip="Upload Data To CET" matTooltipPosition="above" ><mat-icon>file_upload</mat-icon></button>
|
matTooltip="Upload Data To CET" matTooltipPosition="above" ><mat-icon>file_upload</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="20.66" fxFlex.lg="20.66" fxFlex.xl="20.66" class="cell center">
|
||||||
<button *ngIf="roleID == 30" mat-button mat-icon-button class="hover-icon" type="button" matTooltip="ReGenerate"
|
<button *ngIf="roleID == 30" mat-button mat-icon-button class="hover-icon" type="button" matTooltip="ReGenerate"
|
||||||
matTooltipPosition="above" color="primary" [matMenuTriggerFor]="menu1"><mat-icon>more_vert</mat-icon></button>
|
matTooltipPosition="above" color="primary" [matMenuTriggerFor]="menu1"><mat-icon>more_vert</mat-icon></button>
|
||||||
|
|||||||
@ -13,20 +13,27 @@ import { environment } from 'environments/environment';
|
|||||||
templateUrl: './sales-pd.component.html',
|
templateUrl: './sales-pd.component.html',
|
||||||
styleUrls: ['./sales-pd.component.scss']
|
styleUrls: ['./sales-pd.component.scss']
|
||||||
})
|
})
|
||||||
|
export class SalesPdComponent implements OnInit {
|
||||||
export class SalesPdComponent implements OnInit {
|
export class SalesPdComponent implements OnInit {
|
||||||
public dataLengthTab4: number;
|
public dataLengthTab4: number;
|
||||||
public dataSourceTab4 = new MatTableDataSource();
|
public dataSourceTab4 = new MatTableDataSource();
|
||||||
|
|
||||||
displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Officer Name','status','Create On','Action'];
|
displayedColumns = ['SalesPdId', 'SalesPdSno', 'Applicant Name', 'Short Name', 'Officer Name', 'status', 'Create On', 'Action'];
|
||||||
|
|
||||||
|
displayedColumns = ['SalesPdId', 'SalesPdSno', 'Applicant Name', 'Short Name', 'Officer Name', 'status', 'Create On', 'Action'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
|
|
||||||
// data source variable details
|
// data source variable details
|
||||||
salesPdData:any[] = [];
|
salesPdData: any[] = [];
|
||||||
salesPdpdf:any[] = [];
|
salesPdpdf: any[] = [];
|
||||||
|
// data source variable details
|
||||||
|
salesPdData: any[] = [];
|
||||||
|
salesPdpdf: any[] = [];
|
||||||
|
|
||||||
errorMessage:any[]=[];
|
errorMessage: any[] = [];
|
||||||
|
errorMessage: any[] = [];
|
||||||
recordStatus: boolean;
|
recordStatus: boolean;
|
||||||
|
|
||||||
xpandStatus: boolean = false;
|
xpandStatus: boolean = false;
|
||||||
@ -36,28 +43,35 @@ export class SalesPdComponent implements OnInit {
|
|||||||
pageIndex = 0;
|
pageIndex = 0;
|
||||||
pageSize = 10;
|
pageSize = 10;
|
||||||
pageEvent: PageEvent;
|
pageEvent: PageEvent;
|
||||||
todaydate:Date = new Date();
|
todaydate: Date = new Date();
|
||||||
|
todaydate: Date = new Date();
|
||||||
filter_drop_down_data: { product_ids: any[]; lender_ids: any[]; pd_status: any[]; };
|
filter_drop_down_data: { product_ids: any[]; lender_ids: any[]; pd_status: any[]; };
|
||||||
limitMsg: boolean = false;
|
limitMsg: boolean = false;
|
||||||
common: any;
|
common: any;
|
||||||
user_type: string ='';
|
user_type: string = '';
|
||||||
is_sales_login:boolean = false
|
is_sales_login: boolean = false
|
||||||
|
user_type: string = '';
|
||||||
|
is_sales_login: boolean = false
|
||||||
public finallink: any;
|
public finallink: any;
|
||||||
roleID: any;
|
roleID: any;
|
||||||
|
loginTypeId: any;
|
||||||
|
local_spdid: string;
|
||||||
|
login_type_id: number;
|
||||||
|
|
||||||
constructor(private loaderService:LoaderService,private constantProvider:ConstantsProvider,private dialog:MatDialog,private route: ActivatedRoute, private router: Router,private _creditPdService:ApiServiceService,private SalesPDService:SalesPdService) {
|
constructor(private loaderService: LoaderService, private constantProvider: ConstantsProvider, private dialog: MatDialog, private route: ActivatedRoute, private router: Router, private _creditPdService: ApiServiceService, private SalesPDService: SalesPdService) {
|
||||||
|
constructor(private loaderService: LoaderService, private constantProvider: ConstantsProvider, private dialog: MatDialog, private route: ActivatedRoute, private router: Router, private _creditPdService: ApiServiceService, private SalesPDService: SalesPdService) {
|
||||||
|
|
||||||
// this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
// this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
||||||
// this.common = this.common.count+' '+this.common.factor
|
// this.common = this.common.count+' '+this.common.factor
|
||||||
// this.user_type = localStorage.getItem('len_user_role')
|
// this.user_type = localStorage.getItem('len_user_role')
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
let userDetails = localStorage.getItem('user_details');
|
let userDetails = localStorage.getItem('user_details');
|
||||||
console.log('userdetails');
|
console.log('userdetails');
|
||||||
console.log(userDetails);
|
console.log(userDetails);
|
||||||
|
|
||||||
let role= this.constantProvider.takeDecisionRouting(JSON.parse(userDetails))
|
let role = this.constantProvider.takeDecisionRouting(JSON.parse(userDetails))
|
||||||
console.log(role)
|
console.log(role)
|
||||||
if(role == 'sales'){
|
if (role == 'sales') {
|
||||||
this.is_sales_login = true
|
this.is_sales_login = true
|
||||||
this.getListofPD()
|
this.getListofPD()
|
||||||
}
|
}
|
||||||
@ -65,15 +79,19 @@ export class SalesPdComponent implements OnInit {
|
|||||||
this.is_sales_login = false
|
this.is_sales_login = false
|
||||||
this.getListofPD()
|
this.getListofPD()
|
||||||
}
|
}
|
||||||
},4000)
|
}, 4000)
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
|
setTimeout(() => {
|
||||||
this.common = JSON.parse(localStorage.getItem('commonSettings'))
|
this.common = JSON.parse(localStorage.getItem('commonSettings'))
|
||||||
if(this.common){
|
if (this.common) {
|
||||||
|
if (this.common) {
|
||||||
this.common = this.common.default_pd_list_count;
|
this.common = this.common.default_pd_list_count;
|
||||||
this.common = this.common.count+' '+this.common.factor
|
this.common = this.common.count + ' ' + this.common.factor
|
||||||
|
this.common = this.common.count + ' ' + this.common.factor
|
||||||
}
|
}
|
||||||
},300)
|
}, 300)
|
||||||
|
}, 300)
|
||||||
// this.cameraProvider.checkGPSPermission();
|
// this.cameraProvider.checkGPSPermission();
|
||||||
// this.salesPDService.clearLocalData();
|
// this.salesPDService.clearLocalData();
|
||||||
// setTimeout(()=>{
|
// setTimeout(()=>{
|
||||||
@ -81,24 +99,44 @@ export class SalesPdComponent implements OnInit {
|
|||||||
// },100)
|
// },100)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// this.salesPDService.clearLocalData();
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// this.getListofPD()
|
||||||
|
// },100)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
// this.getListofPD();
|
// this.getListofPD();
|
||||||
// this.salesPDpdf();
|
// this.salesPDpdf();
|
||||||
|
this.local_spdid = localStorage.getItem("sales_pd_id_PRIMARYKEY");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uploadDatatoCET(salespdid) {
|
uploadDatatoCET(salespdid) {
|
||||||
this.SalesPDService.uploadSalesDatatoCET(salespdid).subscribe(res=>{
|
this.SalesPDService.uploadSalesDatatoCET(salespdid).subscribe(res => {
|
||||||
if(res['dataStatus']){
|
if (res['dataStatus']) {
|
||||||
let user1 = localStorage.getItem('user_details');
|
let user1 = localStorage.getItem('user_details');
|
||||||
let user=(JSON.parse(user1))
|
let user = (JSON.parse(user1))
|
||||||
this.roleID = localStorage.getItem('user_role')
|
this.roleID = localStorage.getItem('user_role')
|
||||||
alert(res['msg']);
|
alert(res['msg']);
|
||||||
}else{ alert(res['msg']); }
|
} else { alert(res['msg']); }
|
||||||
},error => {
|
}, error => {
|
||||||
|
this.errorMessage.push(error);
|
||||||
|
alert(error.html_format);
|
||||||
|
});
|
||||||
|
this.SalesPDService.uploadSalesDatatoCET(salespdid).subscribe(res => {
|
||||||
|
if (res['dataStatus']) {
|
||||||
|
let user1 = localStorage.getItem('user_details');
|
||||||
|
let user = (JSON.parse(user1))
|
||||||
|
this.roleID = localStorage.getItem('user_role')
|
||||||
|
alert(res['msg']);
|
||||||
|
} else { alert(res['msg']); }
|
||||||
|
}, error => {
|
||||||
this.errorMessage.push(error);
|
this.errorMessage.push(error);
|
||||||
alert(error.html_format);
|
alert(error.html_format);
|
||||||
});
|
});
|
||||||
@ -108,40 +146,45 @@ export class SalesPdComponent implements OnInit {
|
|||||||
// .subscribe(
|
// .subscribe(
|
||||||
// data => {
|
// data => {
|
||||||
// if (data.status == 200) {
|
// if (data.status == 200) {
|
||||||
this.SalesPDService.getSalesPDList(this.is_sales_login).subscribe(res=>{
|
this.SalesPDService.getSalesPDList(this.is_sales_login).subscribe(res => {
|
||||||
if(res['dataStatus']){
|
if (res['dataStatus']) {
|
||||||
|
this.SalesPDService.getSalesPDList(this.is_sales_login).subscribe(res => {
|
||||||
|
if (res['dataStatus']) {
|
||||||
|
|
||||||
let user1 = localStorage.getItem('user_details');
|
let user1 = localStorage.getItem('user_details');
|
||||||
let user=(JSON.parse(user1))
|
let user = (JSON.parse(user1))
|
||||||
|
this.roleID = localStorage.getItem('user_role')
|
||||||
|
let user1 = localStorage.getItem('user_details');
|
||||||
|
let user = (JSON.parse(user1))
|
||||||
this.roleID = localStorage.getItem('user_role')
|
this.roleID = localStorage.getItem('user_role')
|
||||||
|
|
||||||
this.salesPdData = res['records'];
|
this.salesPdData = res['records'];
|
||||||
this.dataLengthTab4 = res['records'].length;
|
this.dataLengthTab4 = res['records'].length;
|
||||||
this.dataSourceTab4.data = this.salesPdData;
|
this.dataSourceTab4.data = this.salesPdData;
|
||||||
this.recordStatus=false
|
this.recordStatus = false
|
||||||
this.limitMsg = true
|
this.limitMsg = true
|
||||||
if(this.salesPdData.length > 0){
|
if (this.salesPdData.length > 0) {
|
||||||
let products=[]
|
let products = []
|
||||||
let lenders=[]
|
let lenders = []
|
||||||
let pd_status=[]
|
let pd_status = []
|
||||||
this.salesPdData.map(val=>{
|
this.salesPdData.map(val => {
|
||||||
|
|
||||||
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
||||||
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
console.log(environment)
|
console.log(environment)
|
||||||
let link
|
let link
|
||||||
if(environment.authorization == 'TnAwuc64pVpcB9xf'){
|
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||||
console.log('293')
|
console.log('293')
|
||||||
link ="https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
link = "https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
}else if(environment.authorization == 'sparqvenba2018'){
|
} else if (environment.authorization == 'sparqvenba2018') {
|
||||||
console.log('296')
|
console.log('296')
|
||||||
link ="http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
link = "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
}
|
}
|
||||||
|
|
||||||
var string:any = {
|
var string: any = {
|
||||||
EmpName:user.user_first_name,
|
EmpName: user.user_first_name,
|
||||||
EmpCode:"",
|
EmpCode: "",
|
||||||
PDID:val.sales_pd_sno,
|
PDID: val.sales_pd_sno,
|
||||||
//PD_NO:val.sales_pd_sno,
|
//PD_NO:val.sales_pd_sno,
|
||||||
}
|
}
|
||||||
//console.log(string);
|
//console.log(string);
|
||||||
@ -150,170 +193,282 @@ export class SalesPdComponent implements OnInit {
|
|||||||
//var decodedString = atob(encodedString);
|
//var decodedString = atob(encodedString);
|
||||||
//console.log("decode",JSON.parse(decodedString));
|
//console.log("decode",JSON.parse(decodedString));
|
||||||
//let email="mwisesales1@sine.com";
|
//let email="mwisesales1@sine.com";
|
||||||
let PDID=val.sales_pd_sno;
|
let PDID = val.sales_pd_sno;
|
||||||
// let mail="&Email=manojsahrawat@smcfinance.com"
|
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||||
this.finallink=link+"&PDID="+PDID+"&Email="+user.email;
|
this.finallink = link + "&PDID=" + PDID + "&Email=" + user.email;
|
||||||
|
|
||||||
console.log('this.finallink')
|
console.log('this.finallink')
|
||||||
console.log(this.finallink);
|
console.log(this.finallink);
|
||||||
val.link = this.finallink;
|
val.link = this.finallink;
|
||||||
|
|
||||||
if(products.length > 0 ){
|
if (products.length > 0) {
|
||||||
if(products.filter(pro=>pro == val.product_id).length == 0 ){
|
if (products.filter(pro => pro == val.product_id).length == 0) {
|
||||||
products.push(val.product_id)
|
products.push(val.product_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
products.push(val.product_id)
|
products.push(val.product_id)
|
||||||
}
|
}
|
||||||
if(lenders.length > 0 ){
|
if (lenders.length > 0) {
|
||||||
if(lenders.filter(pro=>pro == val.lender_id).length == 0 ){
|
if (lenders.filter(pro => pro == val.lender_id).length == 0) {
|
||||||
lenders.push(val.lender_id)
|
lenders.push(val.lender_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
lenders.push(val.lender_id)
|
lenders.push(val.lender_id)
|
||||||
}
|
}
|
||||||
if(pd_status.length > 0 ){
|
if (pd_status.length > 0) {
|
||||||
if(pd_status.filter(pro=>pro == val.status).length == 0 ){
|
if (pd_status.filter(pro => pro == val.status).length == 0) {
|
||||||
pd_status.push(val.status)
|
pd_status.push(val.status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
pd_status.push(val.status)
|
pd_status.push(val.status)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.filter_drop_down_data={product_ids:products,lender_ids:lenders,pd_status:pd_status}
|
this.filter_drop_down_data = { product_ids: products, lender_ids: lenders, pd_status: pd_status }
|
||||||
// console.log(this.filter_drop_down_data);
|
// console.log(this.filter_drop_down_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.salesPdData=[];
|
this.salesPdData = [];
|
||||||
this.dataLengthTab4= null;
|
this.dataLengthTab4 = null;
|
||||||
this.recordStatus=true;
|
this.recordStatus = true;
|
||||||
|
this.limitMsg = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
||||||
|
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
|
console.log(environment)
|
||||||
|
let link
|
||||||
|
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||||
|
console.log('293')
|
||||||
|
link = "https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
|
} else if (environment.authorization == 'sparqvenba2018') {
|
||||||
|
console.log('296')
|
||||||
|
link = "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
|
}
|
||||||
|
|
||||||
|
var string: any = {
|
||||||
|
EmpName: user.user_first_name,
|
||||||
|
EmpCode: "",
|
||||||
|
PDID: val.sales_pd_sno,
|
||||||
|
//PD_NO:val.sales_pd_sno,
|
||||||
|
}
|
||||||
|
//console.log(string);
|
||||||
|
//var encodedString = btoa(JSON.stringify(string));
|
||||||
|
//console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||||
|
//var decodedString = atob(encodedString);
|
||||||
|
//console.log("decode",JSON.parse(decodedString));
|
||||||
|
//let email="mwisesales1@sine.com";
|
||||||
|
let PDID = val.sales_pd_sno;
|
||||||
|
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||||
|
this.finallink = link + "&PDID=" + PDID + "&Email=" + user.email;
|
||||||
|
|
||||||
|
console.log('this.finallink')
|
||||||
|
console.log(this.finallink);
|
||||||
|
val.link = this.finallink;
|
||||||
|
|
||||||
|
if (products.length > 0) {
|
||||||
|
if (products.filter(pro => pro == val.product_id).length == 0) {
|
||||||
|
products.push(val.product_id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
products.push(val.product_id)
|
||||||
|
}
|
||||||
|
if (lenders.length > 0) {
|
||||||
|
if (lenders.filter(pro => pro == val.lender_id).length == 0) {
|
||||||
|
lenders.push(val.lender_id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lenders.push(val.lender_id)
|
||||||
|
}
|
||||||
|
if (pd_status.length > 0) {
|
||||||
|
if (pd_status.filter(pro => pro == val.status).length == 0) {
|
||||||
|
pd_status.push(val.status)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pd_status.push(val.status)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.filter_drop_down_data = { product_ids: products, lender_ids: lenders, pd_status: pd_status }
|
||||||
|
// console.log(this.filter_drop_down_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.salesPdData = [];
|
||||||
|
this.dataLengthTab4 = null;
|
||||||
|
this.recordStatus = true;
|
||||||
this.limitMsg = false
|
this.limitMsg = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// , error => this.errorMessage = <any> error);
|
// , error => this.errorMessage = <any> error);
|
||||||
,error => {
|
, error => {
|
||||||
|
, error => {
|
||||||
this.errorMessage.push(error);
|
this.errorMessage.push(error);
|
||||||
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||||
alert(error.html_format);
|
alert(error.html_format);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// editForm(value_obj){
|
// editForm(value_obj){
|
||||||
// alert('abc');
|
// alert('abc');
|
||||||
// console.log('value');
|
// console.log('value');
|
||||||
// console.log(value_obj);
|
// console.log(value_obj);
|
||||||
// // let product= localStorage.getItem('product_id_salesPD')
|
// // let product= localStorage.getItem('product_id_salesPD')
|
||||||
// // storing the sales_pd_id and product id in local storagey
|
// // storing the sales_pd_id and product id in local storagey
|
||||||
// let primary_key= 'sales_pd_id'
|
// let primary_key= 'sales_pd_id'
|
||||||
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||||
// primary_key = 'local_pd_id'
|
// primary_key = 'local_pd_id'
|
||||||
// }
|
// }
|
||||||
// // this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
// // this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||||
// //this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
// //this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||||
// // localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
// // localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||||
// if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
// if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
||||||
// value_obj.sales_pd_type = '1'
|
// value_obj.sales_pd_type = '1'
|
||||||
// }
|
// }
|
||||||
// console.log('value');
|
// console.log('value');
|
||||||
// console.log(value_obj);
|
// console.log(value_obj);
|
||||||
// this.router.navigate(['../sectionlist'])
|
// this.router.navigate(['../sectionlist'])
|
||||||
// // localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
// // localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
||||||
// //this.navigate.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
|
// //this.navigate.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
|
||||||
// // })
|
// // })
|
||||||
// //})
|
// //})
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// editForm2(value_obj){
|
// editForm2(value_obj){
|
||||||
// // let product= localStorage.getItem('product_id_salesPD')
|
// // let product= localStorage.getItem('product_id_salesPD')
|
||||||
// // storing the sales_pd_id and product id in local storagey
|
// // storing the sales_pd_id and product id in local storagey
|
||||||
// let primary_key= 'sales_pd_id'
|
// let primary_key= 'sales_pd_id'
|
||||||
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||||
// primary_key = 'local_pd_id'
|
// primary_key = 'local_pd_id'
|
||||||
// }
|
// }
|
||||||
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||||
// this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
// this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||||
// localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
// localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||||
// if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
// if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
||||||
// value_obj.sales_pd_type = '1'
|
// value_obj.sales_pd_type = '1'
|
||||||
// }
|
// }
|
||||||
// console.log(value_obj);
|
// console.log(value_obj);
|
||||||
// localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
// 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})
|
// this.navCtrl.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
|
||||||
// })
|
// })
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
// editForm2(value_obj){
|
||||||
|
// // let product= localStorage.getItem('product_id_salesPD')
|
||||||
|
// // storing the sales_pd_id and product id in local storagey
|
||||||
|
// let primary_key= 'sales_pd_id'
|
||||||
|
// if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||||
|
// primary_key = 'local_pd_id'
|
||||||
|
// }
|
||||||
|
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||||
|
// this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||||
|
// localStorage.setItem('product_id_salesPD',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})
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
editForm(value_obj){
|
editForm(value_obj) {
|
||||||
console.log(value_obj.sales_pd_id,value_obj.rand_string)
|
console.log(value_obj.sales_pd_id, value_obj.rand_string)
|
||||||
// alert('abc');
|
// alert('abc');
|
||||||
console.log('value');
|
console.log('value');
|
||||||
console.log(value_obj);
|
console.log(value_obj);
|
||||||
let campletedCase = JSON.stringify(value_obj)
|
let campletedCase = JSON.stringify(value_obj)
|
||||||
localStorage.setItem('completedPD',campletedCase)
|
localStorage.setItem('completedPD', campletedCase)
|
||||||
// let product= localStorage.getItem('product_id_salesPD')
|
// let product= localStorage.getItem('product_id_salesPD')
|
||||||
// storing the sales_pd_id and product id in local storagey
|
// storing the sales_pd_id and product id in local storagey
|
||||||
let primary_key= 'sales_pd_id'
|
let primary_key = 'sales_pd_id'
|
||||||
if(value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
if (value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||||
primary_key = 'local_pd_id'
|
primary_key = 'local_pd_id'
|
||||||
}
|
}
|
||||||
console.log(value_obj[primary_key])
|
console.log(value_obj[primary_key])
|
||||||
localStorage.setItem('sales_pd_id_PRIMARYKEY',value_obj[primary_key]);
|
localStorage.setItem('sales_pd_id_PRIMARYKEY', value_obj[primary_key]);
|
||||||
localStorage.setItem('sales_rand_string',value_obj.rand_string);
|
localStorage.setItem('sales_rand_string', value_obj.rand_string);
|
||||||
|
editForm(value_obj) {
|
||||||
|
console.log(value_obj.sales_pd_id, value_obj.rand_string)
|
||||||
|
// alert('abc');
|
||||||
|
console.log('value');
|
||||||
|
console.log(value_obj);
|
||||||
|
let campletedCase = JSON.stringify(value_obj)
|
||||||
|
localStorage.setItem('completedPD', campletedCase)
|
||||||
|
// let product= localStorage.getItem('product_id_salesPD')
|
||||||
|
// storing the sales_pd_id and product id in local storagey
|
||||||
|
let primary_key = 'sales_pd_id'
|
||||||
|
if (value_obj.hasOwnProperty('local_pd_id') && value_obj.local_pd_id != null && value_obj.sales_pd_id == null && value_obj.hasOwnProperty('is_pd_synced') && value_obj.is_pd_synced == false) {
|
||||||
|
primary_key = 'local_pd_id'
|
||||||
|
}
|
||||||
|
console.log(value_obj[primary_key])
|
||||||
|
localStorage.setItem('sales_pd_id_PRIMARYKEY', value_obj[primary_key]);
|
||||||
|
localStorage.setItem('sales_rand_string', value_obj.rand_string);
|
||||||
|
|
||||||
|
|
||||||
|
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||||
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
// this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
|
||||||
//this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
//this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
|
||||||
localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
localStorage.setItem('product_id_salesPD', value_obj.product_id)
|
||||||
if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
|
if (!value_obj.hasOwnProperty('sales_pd_type') && !value_obj.sales_pd_type) {
|
||||||
value_obj.sales_pd_type = '1'
|
value_obj.sales_pd_type = '1'
|
||||||
}
|
}
|
||||||
console.log('value');
|
console.log('value');
|
||||||
console.log(value_obj);
|
console.log(value_obj);
|
||||||
localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
|
localStorage.setItem('sales_pd_type', value_obj.sales_pd_type)
|
||||||
// this.router.navigate(['../sectionlist',value_obj.product_id,value_obj.sales_pd_type,value_obj.link],{ relativeTo: this.route })
|
// this.router.navigate(['../sectionlist',value_obj.product_id,value_obj.sales_pd_type,value_obj.link],{ relativeTo: this.route })
|
||||||
this.router.navigate(['../sectionlist',value_obj.product_id,value_obj.sales_pd_type],{ relativeTo: this.route })
|
this.router.navigate(['../sectionlist', value_obj.product_id, value_obj.sales_pd_type], { relativeTo: this.route })
|
||||||
// })
|
// })
|
||||||
//})
|
//})
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredDataSource(res){
|
filteredDataSource(res) {
|
||||||
console.log("From Parent",res);
|
console.log("From Parent", res);
|
||||||
if(res['dataStatus']){
|
if (res['dataStatus']) {
|
||||||
|
|
||||||
let user1 = localStorage.getItem('user_details');
|
let user1 = localStorage.getItem('user_details');
|
||||||
let user=(JSON.parse(user1))
|
let user = (JSON.parse(user1))
|
||||||
this.roleID = localStorage.getItem('user_role')
|
this.roleID = localStorage.getItem('user_role')
|
||||||
|
|
||||||
this.salesPdData=res['records']
|
this.salesPdData = res['records']
|
||||||
this.dataLengthTab4 = res['records'].length;
|
this.dataLengthTab4 = res['records'].length;
|
||||||
this.dataSourceTab4.data = this.salesPdData;
|
this.dataSourceTab4.data = this.salesPdData;
|
||||||
this.recordStatus=false
|
this.recordStatus = false
|
||||||
this.limitMsg = false
|
this.limitMsg = false
|
||||||
if(this.salesPdData.length > 0){
|
if (this.salesPdData.length > 0) {
|
||||||
let products=[]
|
let products = []
|
||||||
let lenders=[]
|
let lenders = []
|
||||||
let pd_status=[]
|
let pd_status = []
|
||||||
this.salesPdData.map(val=>{
|
this.salesPdData.map(val => {
|
||||||
|
this.recordStatus = false
|
||||||
|
this.limitMsg = false
|
||||||
|
if (this.salesPdData.length > 0) {
|
||||||
|
let products = []
|
||||||
|
let lenders = []
|
||||||
|
let pd_status = []
|
||||||
|
this.salesPdData.map(val => {
|
||||||
|
|
||||||
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
||||||
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
console.log(environment)
|
console.log(environment)
|
||||||
let link
|
let link
|
||||||
if(environment.authorization == 'TnAwuc64pVpcB9xf'){
|
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||||
console.log('293')
|
console.log('293')
|
||||||
link ="https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
link = "https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
}else if(environment.authorization == 'sparqvenba2018'){
|
} else if (environment.authorization == 'sparqvenba2018') {
|
||||||
console.log('296')
|
console.log('296')
|
||||||
link ="http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
link = "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
}
|
}
|
||||||
|
|
||||||
var string:any = {
|
var string: any = {
|
||||||
EmpName:user.user_first_name,
|
EmpName: user.user_first_name,
|
||||||
EmpCode:"",
|
EmpCode: "",
|
||||||
PDID:val.sales_pd_sno,
|
PDID: val.sales_pd_sno,
|
||||||
//PD_NO:val.sales_pd_sno,
|
//PD_NO:val.sales_pd_sno,
|
||||||
}
|
}
|
||||||
//console.log(string);
|
//console.log(string);
|
||||||
@ -322,52 +477,102 @@ editForm(value_obj){
|
|||||||
//var decodedString = atob(encodedString);
|
//var decodedString = atob(encodedString);
|
||||||
//console.log("decode",JSON.parse(decodedString));
|
//console.log("decode",JSON.parse(decodedString));
|
||||||
//let email="mwisesales1@sine.com";
|
//let email="mwisesales1@sine.com";
|
||||||
let PDID=val.sales_pd_sno;
|
let PDID = val.sales_pd_sno;
|
||||||
// let mail="&Email=manojsahrawat@smcfinance.com"
|
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||||
this.finallink=link+"&PDID="+PDID+"&Email="+user.email;
|
this.finallink = link + "&PDID=" + PDID + "&Email=" + user.email;
|
||||||
|
|
||||||
console.log('this.finallink')
|
console.log('this.finallink')
|
||||||
console.log(this.finallink);
|
console.log(this.finallink);
|
||||||
val.link = this.finallink;
|
val.link = this.finallink;
|
||||||
|
|
||||||
if(products.length > 0 ){
|
if (products.length > 0) {
|
||||||
if(products.filter(pro=>pro == val.product_id).length == 0 ){
|
if (products.filter(pro => pro == val.product_id).length == 0) {
|
||||||
|
products.push(val.product_id)
|
||||||
|
// https://gstapp.smcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&PDID=123&Email=manojsahrawat@smcfinance.com
|
||||||
|
//let link = "http://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
|
console.log(environment)
|
||||||
|
let link
|
||||||
|
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
|
||||||
|
console.log('293')
|
||||||
|
link = "https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
|
} else if (environment.authorization == 'sparqvenba2018') {
|
||||||
|
console.log('296')
|
||||||
|
link = "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U"
|
||||||
|
}
|
||||||
|
|
||||||
|
var string: any = {
|
||||||
|
EmpName: user.user_first_name,
|
||||||
|
EmpCode: "",
|
||||||
|
PDID: val.sales_pd_sno,
|
||||||
|
//PD_NO:val.sales_pd_sno,
|
||||||
|
}
|
||||||
|
//console.log(string);
|
||||||
|
//var encodedString = btoa(JSON.stringify(string));
|
||||||
|
//console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||||
|
//var decodedString = atob(encodedString);
|
||||||
|
//console.log("decode",JSON.parse(decodedString));
|
||||||
|
//let email="mwisesales1@sine.com";
|
||||||
|
let PDID = val.sales_pd_sno;
|
||||||
|
// let mail="&Email=manojsahrawat@smcfinance.com"
|
||||||
|
this.finallink = link + "&PDID=" + PDID + "&Email=" + user.email;
|
||||||
|
|
||||||
|
console.log('this.finallink')
|
||||||
|
console.log(this.finallink);
|
||||||
|
val.link = this.finallink;
|
||||||
|
|
||||||
|
if (products.length > 0) {
|
||||||
|
if (products.filter(pro => pro == val.product_id).length == 0) {
|
||||||
products.push(val.product_id)
|
products.push(val.product_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
|
else {
|
||||||
products.push(val.product_id)
|
products.push(val.product_id)
|
||||||
}
|
}
|
||||||
if(lenders.length > 0 ){
|
if (lenders.length > 0) {
|
||||||
if(lenders.filter(pro=>pro == val.lender_id).length == 0 ){
|
if (lenders.filter(pro => pro == val.lender_id).length == 0) {
|
||||||
|
if (lenders.length > 0) {
|
||||||
|
if (lenders.filter(pro => pro == val.lender_id).length == 0) {
|
||||||
lenders.push(val.lender_id)
|
lenders.push(val.lender_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
|
else {
|
||||||
lenders.push(val.lender_id)
|
lenders.push(val.lender_id)
|
||||||
}
|
}
|
||||||
if(pd_status.length > 0 ){
|
if (pd_status.length > 0) {
|
||||||
if(pd_status.filter(pro=>pro == val.status).length == 0 ){
|
if (pd_status.filter(pro => pro == val.status).length == 0) {
|
||||||
|
if (pd_status.length > 0) {
|
||||||
|
if (pd_status.filter(pro => pro == val.status).length == 0) {
|
||||||
pd_status.push(val.status)
|
pd_status.push(val.status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
|
else {
|
||||||
pd_status.push(val.status)
|
pd_status.push(val.status)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.filter_drop_down_data={product_ids:products,lender_ids:lenders,pd_status:pd_status}
|
this.filter_drop_down_data = { product_ids: products, lender_ids: lenders, pd_status: pd_status }
|
||||||
|
this.filter_drop_down_data = { product_ids: products, lender_ids: lenders, pd_status: pd_status }
|
||||||
// console.log(this.filter_drop_down_data);
|
// console.log(this.filter_drop_down_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.salesPdData=[];
|
this.salesPdData = [];
|
||||||
this.dataLengthTab4= null;
|
this.dataLengthTab4 = null;
|
||||||
this.recordStatus=true;
|
this.recordStatus = true;
|
||||||
|
this.limitMsg = false
|
||||||
|
else {
|
||||||
|
this.salesPdData = [];
|
||||||
|
this.dataLengthTab4 = null;
|
||||||
|
this.recordStatus = true;
|
||||||
this.limitMsg = false
|
this.limitMsg = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
salesPDpdf(pdfdetail){
|
salesPDpdf(pdfdetail) {
|
||||||
|
salesPDpdf(pdfdetail) {
|
||||||
this.loaderService.showMatSpinnerDialog('Processing...')
|
this.loaderService.showMatSpinnerDialog('Processing...')
|
||||||
this.SalesPDService.getSalesPdpdf(pdfdetail)
|
this.SalesPDService.getSalesPdpdf(pdfdetail)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
@ -380,7 +585,23 @@ editForm(value_obj){
|
|||||||
|
|
||||||
}
|
}
|
||||||
// , error => this.errorMessage = <any> error);
|
// , error => this.errorMessage = <any> error);
|
||||||
,error => {
|
, error => {
|
||||||
|
this.loaderService.closeMatSpinnerDialog()
|
||||||
|
this.errorMessage.push(error);
|
||||||
|
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||||
|
alert(error.html_format);
|
||||||
|
});
|
||||||
|
.subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
// window.location.href=res['records'];
|
||||||
|
window.open(data.records, '_blank');
|
||||||
|
}
|
||||||
|
this.loaderService.closeMatSpinnerDialog()
|
||||||
|
|
||||||
|
}
|
||||||
|
// , error => this.errorMessage = <any> error);
|
||||||
|
, error => {
|
||||||
this.loaderService.closeMatSpinnerDialog()
|
this.loaderService.closeMatSpinnerDialog()
|
||||||
this.errorMessage.push(error);
|
this.errorMessage.push(error);
|
||||||
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||||
@ -402,14 +623,17 @@ editForm(value_obj){
|
|||||||
newcreditTrigger(curr_list_obj) {
|
newcreditTrigger(curr_list_obj) {
|
||||||
console.log(curr_list_obj);
|
console.log(curr_list_obj);
|
||||||
|
|
||||||
|
|
||||||
const dialogRef = this.dialog.open(DialogOverviewExampleDialog, {
|
const dialogRef = this.dialog.open(DialogOverviewExampleDialog, {
|
||||||
width: '500px',
|
width: '500px',
|
||||||
data: curr_list_obj
|
data: curr_list_obj
|
||||||
});
|
});
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
console.log('The dialog was closed',result);
|
console.log('The dialog was closed', result);
|
||||||
if(result) {
|
if (result) {
|
||||||
|
console.log('The dialog was closed', result);
|
||||||
|
if (result) {
|
||||||
let new_credit_pd_info = curr_list_obj
|
let new_credit_pd_info = curr_list_obj
|
||||||
// {fk_sales_pd_id:curr_list_obj.sales_pd_id,sales_pd_sno:curr_list_obj.sales_pd_sno,product_id:curr_list_obj.product_id,smc_credit_pd_type:result,smc_credit_pd:null,lender_id:curr_list_obj.lender_id,applicant_name:curr_list_obj.applicant_name,}
|
// {fk_sales_pd_id:curr_list_obj.sales_pd_id,sales_pd_sno:curr_list_obj.sales_pd_sno,product_id:curr_list_obj.product_id,smc_credit_pd_type:result,smc_credit_pd:null,lender_id:curr_list_obj.lender_id,applicant_name:curr_list_obj.applicant_name,}
|
||||||
new_credit_pd_info.fk_sales_pd_id = curr_list_obj.sales_pd_id
|
new_credit_pd_info.fk_sales_pd_id = curr_list_obj.sales_pd_id
|
||||||
@ -417,10 +641,12 @@ editForm(value_obj){
|
|||||||
new_credit_pd_info.smc_credit_pd = null
|
new_credit_pd_info.smc_credit_pd = null
|
||||||
this._creditPdService.curr_credit_pd_data = new_credit_pd_info
|
this._creditPdService.curr_credit_pd_data = new_credit_pd_info
|
||||||
this.router.navigate(['../credit_pd/pdQuestions'])
|
this.router.navigate(['../credit_pd/pdQuestions'])
|
||||||
|
this.router.navigate(['../credit_pd/pdQuestions'])
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
newForm(){
|
newForm() {
|
||||||
|
newForm() {
|
||||||
// this.salesPDService.getData_fromLocal('sec1').then(result=>{
|
// this.salesPDService.getData_fromLocal('sec1').then(result=>{
|
||||||
// console.log("image",result);
|
// console.log("image",result);
|
||||||
// if(result){
|
// if(result){
|
||||||
@ -432,30 +658,46 @@ editForm(value_obj){
|
|||||||
// });
|
// });
|
||||||
// this.SalesPDService.clearLocalData()
|
// this.SalesPDService.clearLocalData()
|
||||||
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
||||||
localStorage.removeItem('sales_pd_id_PRIMARYKEY')
|
parseInt(localStorage.getItem('login_type_id')) == 0 ? localStorage.removeItem('sales_pd_id_PRIMARYKEY') : '';
|
||||||
localStorage.removeItem('product_id_salesPD')
|
localStorage.removeItem('product_id_salesPD')
|
||||||
localStorage.removeItem('sales_pd_type')
|
localStorage.removeItem('sales_pd_type')
|
||||||
// this.navCtrl.push(HomePage)
|
// this.navCtrl.push(HomePage)
|
||||||
this.router.navigate([ '../../sales-pd-list/add-pd'], { relativeTo: this.route });
|
this.router.navigate(['../../sales-pd-list/add-pd'], { relativeTo: this.route });
|
||||||
|
}
|
||||||
|
|
||||||
|
callAPIForPortals(value_obj) {
|
||||||
|
let user1 = localStorage.getItem('user_details');
|
||||||
|
let user = (JSON.parse(user1))
|
||||||
|
let temp_PDID = value_obj.sales_pd_sno;
|
||||||
|
let link_url = (environment.authorization == 'TnAwuc64pVpcB9xf') ? "https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U" :
|
||||||
|
(environment.authorization == 'sparqvenba2018') ? "http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U" : "";
|
||||||
|
if (temp_PDID && user.email) {
|
||||||
|
link_url += "&PDID=" + temp_PDID + "&Email=" + user.email;
|
||||||
|
console.log("link = " + link_url);
|
||||||
|
this.SalesPDService.callAPIForPortals(value_obj, user, link_url).subscribe(res => {
|
||||||
|
if (res['dataStatus']) {
|
||||||
|
window.open(link_url);
|
||||||
|
} else { alert(res['message']); }
|
||||||
|
}, error => {
|
||||||
|
this.errorMessage.push(error);
|
||||||
|
alert(error.html_format);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Email And PDID not Found");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newPortal() {
|
|
||||||
console.log(this.finallink)
|
|
||||||
window.open(this.finallink);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
regeneratereport(data, option) {
|
||||||
|
|
||||||
regeneratereport(data,option)
|
const dialogRef = this.dialog.open(ReGenerateReportComponent, {
|
||||||
{
|
data: { pdid: data, option: option },
|
||||||
|
|
||||||
const dialogRef = this.dialog.open(ReGenerateReportComponent,{
|
|
||||||
data: {pdid: data,option: option},
|
|
||||||
disableClose: true,
|
disableClose: true,
|
||||||
minWidth: '30%',
|
minWidth: '30%',
|
||||||
maxWidth: '40%',
|
maxWidth: '40%',
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
dialogRef.afterClosed()
|
dialogRef.afterClosed()
|
||||||
.subscribe(dataresult => {
|
.subscribe(dataresult => {
|
||||||
@ -463,6 +705,7 @@ editForm(value_obj){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -470,55 +713,69 @@ editForm(value_obj){
|
|||||||
templateUrl: 'trigger-confirm-dialog.html',
|
templateUrl: 'trigger-confirm-dialog.html',
|
||||||
})
|
})
|
||||||
export class DialogOverviewExampleDialog {
|
export class DialogOverviewExampleDialog {
|
||||||
pd_type_list:any=[{
|
pd_type_list: any = [{
|
||||||
id:"1",
|
id: "1",
|
||||||
dis_name:"Physical PD"
|
dis_name: "Physical PD"
|
||||||
},{
|
}, {
|
||||||
id:"2",
|
id: "2",
|
||||||
dis_name:"Telephonic PD"
|
dis_name: "Telephonic PD"
|
||||||
|
pd_type_list: any = [{
|
||||||
|
id: "1",
|
||||||
|
dis_name: "Physical PD"
|
||||||
|
}, {
|
||||||
|
id: "2",
|
||||||
|
dis_name: "Telephonic PD"
|
||||||
}]
|
}]
|
||||||
choosedPD:any=null
|
choosedPD: any = null
|
||||||
|
choosedPD: any = null
|
||||||
// notifier:NotifierService
|
// notifier:NotifierService
|
||||||
constructor(
|
constructor(
|
||||||
public dialogRef: MatDialogRef<DialogOverviewExampleDialog>,
|
public dialogRef: MatDialogRef<DialogOverviewExampleDialog>,
|
||||||
@Inject(MAT_DIALOG_DATA) public data) {
|
@Inject(MAT_DIALOG_DATA) public data) {
|
||||||
// this.notifier=notifier
|
// this.notifier=notifier
|
||||||
}
|
}
|
||||||
|
// this.notifier=notifier
|
||||||
|
}
|
||||||
|
|
||||||
onNoClick(): void {
|
onNoClick(): void {
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
}
|
}
|
||||||
onSubmit(){
|
onSubmit() {
|
||||||
|
onSubmit() {
|
||||||
console.log(this.choosedPD);
|
console.log(this.choosedPD);
|
||||||
if(this.choosedPD != '' && !this.choosedPD) {
|
if (this.choosedPD != '' && !this.choosedPD) {
|
||||||
alert("Please choose the PD Type");
|
alert("Please choose the PD Type");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.dialogRef.close(this.choosedPD)
|
this.dialogRef.close(this.choosedPD)
|
||||||
}
|
}
|
||||||
|
|
||||||
getgst(pd_id)
|
getgst(pd_id) {
|
||||||
{
|
|
||||||
|
|
||||||
let link = "https://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&data="
|
let link = "https://gstapp.devopsmcfinance.com/home?saltkey=VQDa79tyBlpu7ZuKt6U&data="
|
||||||
|
|
||||||
var string:any = {
|
var string: any = {
|
||||||
|
|
||||||
EmpName:"John Doe",
|
EmpName: "John Doe",
|
||||||
|
|
||||||
EmpCode:"",
|
EmpCode: "",
|
||||||
PD_ID:"",
|
PD_ID: "",
|
||||||
PD_NO:"",
|
PD_NO: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
var encodedString = btoa(JSON.stringify(string));
|
var encodedString = btoa(JSON.stringify(string));
|
||||||
|
|
||||||
console.log("encode",encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
console.log("encode", encodedString); // Outputs: "SGVsbG8gV29ybGQh"
|
||||||
|
|
||||||
var decodedString = atob("eyJFbXBOYW1lIjoiTXdpc2UgU2FsZXMtMSIsIkVtcENvZGUiOiIiLCJQRF9JRCI6IjQzOCIsIlBEX05PIjoiTVdJU0UtV0NUTC0yMTAifQ==");
|
var decodedString = atob("eyJFbXBOYW1lIjoiTXdpc2UgU2FsZXMtMSIsIkVtcENvZGUiOiIiLCJQRF9JRCI6IjQzOCIsIlBEX05PIjoiTVdJU0UtV0NUTC0yMTAifQ==");
|
||||||
console.log('jumbo');
|
console.log('jumbo');
|
||||||
console.log("decode",JSON.parse(decodedString));
|
console.log("decode", JSON.parse(decodedString));
|
||||||
let finallink=link+encodedString;
|
let finallink = link + encodedString;
|
||||||
|
console.log('finallink');
|
||||||
|
console.log(finallink);
|
||||||
|
window.open(finallink, '_system', 'location=yes');
|
||||||
|
console.log("decode", JSON.parse(decodedString));
|
||||||
|
let finallink = link + encodedString;
|
||||||
console.log('finallink');
|
console.log('finallink');
|
||||||
console.log(finallink);
|
console.log(finallink);
|
||||||
window.open(finallink, '_system', 'location=yes');
|
window.open(finallink, '_system', 'location=yes');
|
||||||
|
|||||||
@ -37,6 +37,8 @@ export class SectionListComponent implements OnInit {
|
|||||||
flyHiUserId: any;
|
flyHiUserId: any;
|
||||||
sales_pd_id_PRIMARYKEY: string;
|
sales_pd_id_PRIMARYKEY: string;
|
||||||
rand_string: string;
|
rand_string: string;
|
||||||
|
login_type_id: number;
|
||||||
|
|
||||||
constructor(public dialogRef: MatDialogRef<SectionListComponent>,private constantProvider:ConstantsProvider,notifier: NotifierService,private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,private SalesPDService:SalesPdService,
|
constructor(public dialogRef: MatDialogRef<SectionListComponent>,private constantProvider:ConstantsProvider,notifier: NotifierService,private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,private SalesPDService:SalesPdService,
|
||||||
private router: Router,private loaderService:LoaderService ) {
|
private router: Router,private loaderService:LoaderService ) {
|
||||||
|
|
||||||
@ -48,6 +50,7 @@ export class SectionListComponent implements OnInit {
|
|||||||
this.sales_pd_type = localStorage.getItem('sales_pd_type')
|
this.sales_pd_type = localStorage.getItem('sales_pd_type')
|
||||||
console.log( this.sales_pd_type)
|
console.log( this.sales_pd_type)
|
||||||
this.sales_pd_id_PRIMARYKEY = localStorage.getItem('sales_pd_id_PRIMARYKEY')
|
this.sales_pd_id_PRIMARYKEY = localStorage.getItem('sales_pd_id_PRIMARYKEY')
|
||||||
|
this.login_type_id = parseInt(localStorage.getItem('login_type_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.route.snapshot.params['product_id']){
|
if(this.route.snapshot.params['product_id']){
|
||||||
@ -297,8 +300,9 @@ export class SectionListComponent implements OnInit {
|
|||||||
|
|
||||||
merge_saved_status(res){
|
merge_saved_status(res){
|
||||||
let saved_sections=res['records'].map(val=>{return {'section_id':val.section_id , 'status':val.status,'is_synced':val.is_synced}});
|
let saved_sections=res['records'].map(val=>{return {'section_id':val.section_id , 'status':val.status,'is_synced':val.is_synced}});
|
||||||
|
console.log("B4 saved",saved_sections);
|
||||||
console.log("saved",saved_sections);
|
saved_sections = saved_sections.filter(val=>parseInt(val.status) == 1);
|
||||||
|
console.log("After saved",saved_sections);
|
||||||
const mergeById = (a1, a2) =>
|
const mergeById = (a1, a2) =>
|
||||||
a1.map(itm => ({
|
a1.map(itm => ({
|
||||||
...a2.find((item) => (item.section_id === itm.section_id) && item),
|
...a2.find((item) => (item.section_id === itm.section_id) && item),
|
||||||
|
|||||||
@ -159,7 +159,13 @@ saveQuestions(params): Observable<Response>{
|
|||||||
let result_from_api:any;
|
let result_from_api:any;
|
||||||
let userid:any=localStorage.getItem("user_details")
|
let userid:any=localStorage.getItem("user_details")
|
||||||
userid=JSON.parse(userid).userid;
|
userid=JSON.parse(userid).userid;
|
||||||
|
|
||||||
|
if(localStorage.getItem('login_type_id') == '1'){ //aout-login means
|
||||||
|
params.createdby = localStorage.getItem('officer_id');
|
||||||
|
}else{
|
||||||
params.createdby=userid
|
params.createdby=userid
|
||||||
|
}
|
||||||
|
|
||||||
let product_id=localStorage.getItem('product_id_salesPD')
|
let product_id=localStorage.getItem('product_id_salesPD')
|
||||||
let sales_pd_type = localStorage.getItem('sales_pd_type');
|
let sales_pd_type = localStorage.getItem('sales_pd_type');
|
||||||
let users:any=localStorage.getItem('user_details')
|
let users:any=localStorage.getItem('user_details')
|
||||||
@ -569,14 +575,19 @@ getCityPincode(value){
|
|||||||
|
|
||||||
// console.log("Api Stauts ",this.networkProvider.getCurrentNetworkStatus())
|
// console.log("Api Stauts ",this.networkProvider.getCurrentNetworkStatus())
|
||||||
let det:any=localStorage.getItem('user_details')
|
let det:any=localStorage.getItem('user_details')
|
||||||
console.log('494',det,localStorage.getItem('user_details'))
|
|
||||||
det=JSON.parse(det)
|
let login_type_id = parseInt(localStorage.getItem('login_type_id')); // 1 na auto-login , 0 na manual-login
|
||||||
console.log('494',det)
|
console.log('service call b4...',typeof det,det,localStorage.getItem('user_details'))
|
||||||
|
det=JSON.parse(det);
|
||||||
|
let user_id = (login_type_id == 1) ? localStorage.getItem('officer_id') : det.userid ;
|
||||||
|
let user_role_id = det.user_role;
|
||||||
|
console.log('service call after...',typeof det,det);
|
||||||
let params = {'fk_entity_id':det.fk_entity_id,userid:det.userid}
|
let params = {'fk_entity_id':det.fk_entity_id,userid:det.userid}
|
||||||
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
||||||
let complete_url = api_url+'listSalesPD/'+det.fk_entity_id
|
let complete_url = api_url+'listSalesPD/'+det.fk_entity_id
|
||||||
if(is_sales_login) {
|
if(is_sales_login) {
|
||||||
complete_url = complete_url+'/'+det.userid+'/'+det.user_role
|
if(user_role_id != "") { complete_url = complete_url+'/'+user_id+'/'+det.user_role }
|
||||||
|
else if(user_role_id == "") { complete_url = complete_url+'/'+user_id}
|
||||||
}
|
}
|
||||||
return this._http.get(complete_url).map(res=>{
|
return this._http.get(complete_url).map(res=>{
|
||||||
// this.ionicStorageProvider.checkAndInsertApiDataLocally(res,params,'listSalesPD');
|
// this.ionicStorageProvider.checkAndInsertApiDataLocally(res,params,'listSalesPD');
|
||||||
@ -724,6 +735,10 @@ generatesateliteimage(param:any): Observable<any>{
|
|||||||
return this._http.get<any[]>(api_url +"uploadSalesPDDataToCETApp/"+id);
|
return this._http.get<any[]>(api_url +"uploadSalesPDDataToCETApp/"+id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
callAPIForPortals(row_obj,user_obj,link_url) {
|
||||||
|
return this._http.post<any[]>(api_url + "callAPIForPortals", {'sales_object': row_obj,'user_object':user_obj,'link_url':link_url});
|
||||||
|
}
|
||||||
|
|
||||||
loadTemplatelocal(){
|
loadTemplatelocal(){
|
||||||
|
|
||||||
return this._http.get('assets/data/flyhi.json').map(rr=>{
|
return this._http.get('assets/data/flyhi.json').map(rr=>{
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
<!-- <p>
|
||||||
|
auto-login works!
|
||||||
|
</p> -->
|
||||||
185
ng6-seed/src/app/session/auto-login/auto-login.component.ts
Normal file
185
ng6-seed/src/app/session/auto-login/auto-login.component.ts
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { Router } from "@angular/router";
|
||||||
|
import { AwsService } from '../../AwsService/aws.service';
|
||||||
|
import { DashboardService } from 'app/dashboard/dashboard.service';
|
||||||
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { SalesPdService } from '../../sales-pd/services/sales-pd.service';
|
||||||
|
import { UserService } from '../../settings/service/user.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-auto-login',
|
||||||
|
templateUrl: './auto-login.component.html',
|
||||||
|
styleUrls: ['./auto-login.component.scss'],
|
||||||
|
providers: [DatePipe]
|
||||||
|
})
|
||||||
|
export class AutoLoginComponent implements OnInit {
|
||||||
|
|
||||||
|
errorMessage: any;
|
||||||
|
salesPdData:any = [];
|
||||||
|
// currentUser: Object;
|
||||||
|
currentUser: any={short_name : ''};
|
||||||
|
userDetails: any;
|
||||||
|
userDep: string;
|
||||||
|
fullName: string;
|
||||||
|
roleName: any;
|
||||||
|
profileurl: any;
|
||||||
|
|
||||||
|
constructor(private router: Router,private route: ActivatedRoute,public aws: AwsService,private dashBoardService:DashboardService,public users:UserService,private salespdservice:SalesPdService) { }
|
||||||
|
|
||||||
|
token: string;
|
||||||
|
password: string;
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
|
||||||
|
this.route.queryParams.subscribe(params => {
|
||||||
|
console.log(params);
|
||||||
|
this.token = params.token;
|
||||||
|
console.log('encrypted token :',this.token);
|
||||||
|
});
|
||||||
|
// old http://localhost:4200/#/auto?token=bXdpc2VzYWxlczFAc2luZS5jb20jdGVzdDEyMzQ=
|
||||||
|
// new http://localhost:4200/#/auto?token=TXdpc2VTYWxlc0B5YWhvby5jb20jc2luZTEyMzQjMjkzIzE5
|
||||||
|
|
||||||
|
// error flag redirect pannanum
|
||||||
|
const decoded= this.decodeBase64String(this.token);
|
||||||
|
if (decoded !== null) {
|
||||||
|
console.log('decrypted token :', decoded);
|
||||||
|
const splitparts = decoded.split('#');
|
||||||
|
const mailid = splitparts[0].split(/\s/).join('');
|
||||||
|
const password = splitparts[1].split(/\s/).join('');
|
||||||
|
const officer_id = splitparts[2].split(/\s/).join('');
|
||||||
|
const role_id = splitparts[3].split(/\s/).join('');
|
||||||
|
const date_timing = splitparts[4]; // for vaildation
|
||||||
|
const officer_mail_id = splitparts[5].split(/\s/).join('');
|
||||||
|
const sales_pd_id = splitparts[6].split(/\s/).join('');
|
||||||
|
|
||||||
|
|
||||||
|
console.log("splited Values are \n 1) UN :",mailid," \n 2) PWD :",password, " \n 3) OFFS ID : ",officer_id,"\n 4) ROLE ID : ",role_id,"\n 5) BE DATED :",date_timing,"\n 6) OFFS MAIL :",officer_mail_id," \n 7) SALES PD : ",sales_pd_id);
|
||||||
|
let today : Date = new Date();
|
||||||
|
console.log(today);
|
||||||
|
|
||||||
|
if(this.dateRangeValidator(date_timing,today)){
|
||||||
|
console.log('Token vaild because within 24 Hrs ! So, permitted to log in');
|
||||||
|
// http://localhost:4200/#/auto?token=TXdpc2VTYWxlc0B5YWhvby5jb20jc2luZTEyMzQjMjkzIzE5IzA0LzA3LzIwMjMgMTk6MzE6MTYjbXdpc2VzYWxlczFAc2luZS5jb20%3D
|
||||||
|
let auth = { 'Username': mailid, 'Password': password };
|
||||||
|
this.aws.dologin(auth).subscribe(res => {
|
||||||
|
console.log("Auto login",res);
|
||||||
|
if (res !== undefined) {
|
||||||
|
localStorage.setItem('user_role',role_id);
|
||||||
|
localStorage.setItem('user_role_nav',role_id);
|
||||||
|
localStorage.setItem('login_type','auto-login');
|
||||||
|
localStorage.setItem('login_type_id','1');
|
||||||
|
localStorage.setItem('officer_id',officer_id);
|
||||||
|
localStorage.setItem('officer_mail_id',officer_mail_id);
|
||||||
|
// this.salesPdData = this.callingSalesPDListApi(sales_pd_id);
|
||||||
|
localStorage.setItem('sales_pd_id_PRIMARYKEY',sales_pd_id);
|
||||||
|
|
||||||
|
|
||||||
|
this.router.navigate(['/sales-pd-list']);
|
||||||
|
// localStorage.setItem('sales_pd_id_PRIMARYKEY',sales_pd_id);
|
||||||
|
}
|
||||||
|
}, err => {
|
||||||
|
this.router.navigate(['/auto?token='+this.token]);
|
||||||
|
console.log(err.message);
|
||||||
|
})
|
||||||
|
console.log("AWS getlocale = ",this.aws.getlocale());
|
||||||
|
} else {
|
||||||
|
alert('Token Expried');
|
||||||
|
console.log('Token Not-vaild because 24 Hrs Expried');
|
||||||
|
// Handle the decoding error
|
||||||
|
// this.router.navigate(['/']);
|
||||||
|
console.log('Due To Time Out.');
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}else {
|
||||||
|
// Handle the decoding error
|
||||||
|
// this.router.navigate(['/auto?token='+this.token]);
|
||||||
|
console.log('Error occurred while decoding the string.');
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
dateRangeValidator(fromDate,toDate){
|
||||||
|
const inputDate = fromDate;
|
||||||
|
const [day, month, year, hour, minute, second] = inputDate.split(/[/: ]/);
|
||||||
|
|
||||||
|
// Months in JavaScript are zero-indexed, so we need to subtract 1 from the month value
|
||||||
|
const jsMonth = parseInt(month, 10) - 1;
|
||||||
|
const date = new Date(parseInt(year, 10), jsMonth, parseInt(day, 10), parseInt(hour, 10), parseInt(minute, 10), parseInt(second, 10));
|
||||||
|
const angularDate = date.toString();
|
||||||
|
|
||||||
|
const from_Date = new Date(angularDate);
|
||||||
|
const to_Date = new Date(toDate);
|
||||||
|
console.log("Aftr Date ",from_Date," to ",to_Date);
|
||||||
|
|
||||||
|
if (from_Date && to_Date) {
|
||||||
|
const timeDifference = to_Date.getTime() - from_Date.getTime();
|
||||||
|
console.log('time Difference',timeDifference);
|
||||||
|
const hoursDifference = timeDifference / (1000 * 60 * 60);
|
||||||
|
console.log('hours Difference',hoursDifference);
|
||||||
|
if (hoursDifference <= 24) {
|
||||||
|
// The time duration is within 24 hours
|
||||||
|
console.log('Valid: Time duration is within 24 hours');
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
// The time duration is more than 24 hours
|
||||||
|
console.log('Invalid: Time duration exceeds 24 hours');
|
||||||
|
return false;
|
||||||
|
// http://localhost:4200/#/auto?token=TXdpc2VTYWxlc0B5YWhvby5jb20jc2luZTEyMzQjMjkzIzE5IzA3LzA3LzIwMjMgMTA6MDQ6NDkjbXdpc2VzYWxlczFAc2luZS5jb20jOTA2
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
console.log('Invalid: Date Not Founded');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// dateRangeValidator(fromDate,toDate){
|
||||||
|
// // Perform validation logic
|
||||||
|
// if (fromDate && toDate) {
|
||||||
|
// const fromDateTime = new Date(fromDate).getTime();
|
||||||
|
// const toDateTime = new Date(toDate).getTime();
|
||||||
|
// const twentyFourHours = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
|
||||||
|
// // console.log('toDateTime - fromDateTime > twentyFourHours');
|
||||||
|
// // console.log(toDateTime,'-',fromDateTime,'>',twentyFourHours);
|
||||||
|
// // console.log(toDateTime - fromDateTime > twentyFourHours);
|
||||||
|
// if (toDateTime - fromDateTime >= twentyFourHours) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// // Calculate the time difference in milliseconds
|
||||||
|
// // const diffInMilliseconds = Math.abs(toDateTime - fromDateTime);
|
||||||
|
// // const diffInHours = diffInMilliseconds / (1000 * 60 * 60);
|
||||||
|
// // Check if the difference is at least 24 hours if (diffInHours < 24)
|
||||||
|
// }else{
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
decodeBase64String(encodedString) {
|
||||||
|
try {
|
||||||
|
const decodedString = atob(encodedString);
|
||||||
|
return decodedString;
|
||||||
|
} catch (error) {
|
||||||
|
// Handle the error
|
||||||
|
console.error('Failed to decode the base64 string:', error);
|
||||||
|
|
||||||
|
// Return a default or error value, or perform any other error handling logic
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommonSettings(){
|
||||||
|
this.dashBoardService.getCommonSettingsConfig().subscribe(res=>{
|
||||||
|
if(res['dataStatus'] == true){
|
||||||
|
localStorage.setItem("commonSettings",JSON.stringify(res['records']));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -16,7 +16,7 @@ import { CognitoService } from '../../AwsService/cognito.service';
|
|||||||
import { DashboardService } from 'app/dashboard/dashboard.service';
|
import { DashboardService } from 'app/dashboard/dashboard.service';
|
||||||
import { LoaderService } from 'app/shared/loaderService/loader.service';
|
import { LoaderService } from 'app/shared/loaderService/loader.service';
|
||||||
import { OtpComponent } from '../otp/otp.component';
|
import { OtpComponent } from '../otp/otp.component';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ms-login-session',
|
selector: 'ms-login-session',
|
||||||
@ -47,9 +47,8 @@ export class LoginComponent implements OnInit{
|
|||||||
dialogRef: MatDialogRef<OtpComponent, any>;
|
dialogRef: MatDialogRef<OtpComponent, any>;
|
||||||
hide: boolean;
|
hide: boolean;
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router, public aws: AwsService, public dialog: MatDialog,
|
private router: Router, public aws: AwsService, public dialog: MatDialog,private route: ActivatedRoute,
|
||||||
public shared:CognitoService,private dashBoardService:DashboardService , private loaderService:LoaderService) {
|
public shared:CognitoService,private dashBoardService:DashboardService , private loaderService:LoaderService) {
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnInit(){
|
ngOnInit(){
|
||||||
this.hide = true;
|
this.hide = true;
|
||||||
@ -82,6 +81,8 @@ export class LoginComponent implements OnInit{
|
|||||||
// local storage for validate user access
|
// local storage for validate user access
|
||||||
localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]);
|
localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]);
|
||||||
localStorage.setItem('user_role_nav',res.idToken.payload["custom:role_id"]);
|
localStorage.setItem('user_role_nav',res.idToken.payload["custom:role_id"]);
|
||||||
|
localStorage.setItem('login_type','manual-login');
|
||||||
|
localStorage.setItem('login_type_id','0');
|
||||||
let role = localStorage.getItem('user_role');
|
let role = localStorage.getItem('user_role');
|
||||||
console.log(res.idToken.payload ["custom:role_id"],role);
|
console.log(res.idToken.payload ["custom:role_id"],role);
|
||||||
// alert(localStorage.getItem('user_role'))
|
// alert(localStorage.getItem('user_role'))
|
||||||
@ -115,6 +116,7 @@ export class LoginComponent implements OnInit{
|
|||||||
this.loaderService.closeMatSpinnerDialog();
|
this.loaderService.closeMatSpinnerDialog();
|
||||||
//alert(err.message);
|
//alert(err.message);
|
||||||
})
|
})
|
||||||
|
// console.log("AWS getlocale = ",this.aws.getlocale());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* New password set
|
* New password set
|
||||||
|
|||||||
@ -108,6 +108,9 @@ export class HorizontalMenuItems {
|
|||||||
salesgetAll(): Menu[] {
|
salesgetAll(): Menu[] {
|
||||||
let filtered_sales_menu = salesmenu
|
let filtered_sales_menu = salesmenu
|
||||||
let user_type= localStorage.getItem('len_user_role')
|
let user_type= localStorage.getItem('len_user_role')
|
||||||
|
if(parseInt(localStorage.getItem('login_type_id')) == 1){
|
||||||
|
filtered_sales_menu = salesmenu.filter(vv=>vv.icon != 'work')
|
||||||
|
}
|
||||||
// if(user_type != 'credit'){
|
// if(user_type != 'credit'){
|
||||||
// filtered_sales_menu = salesmenu.filter(vv=>vv.state != 'credit_pd')
|
// filtered_sales_menu = salesmenu.filter(vv=>vv.state != 'credit_pd')
|
||||||
// }
|
// }
|
||||||
|
|||||||
@ -193,6 +193,9 @@ export class MenuItems {
|
|||||||
// if(user_type != 'credit'){
|
// if(user_type != 'credit'){
|
||||||
// filtered_sales_menu = salesMenus.filter(vv=>vv.state != 'credit_pd')
|
// filtered_sales_menu = salesMenus.filter(vv=>vv.state != 'credit_pd')
|
||||||
// }
|
// }
|
||||||
|
if(parseInt(localStorage.getItem('login_type_id')) == 1){
|
||||||
|
filtered_sales_menu = salesMenus.filter(vv=>vv.icon != 'work')
|
||||||
|
}
|
||||||
return filtered_sales_menu;
|
return filtered_sales_menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,8 @@ export const environment = {
|
|||||||
environmentName: 'Development Environment',//Localhost Environment.
|
environmentName: 'Development Environment',//Localhost Environment.
|
||||||
|
|
||||||
// apiEndpoint: 'https://demo.pdgenie.com/sparqtest/api/',
|
// apiEndpoint: 'https://demo.pdgenie.com/sparqtest/api/',
|
||||||
apiEndpoint: ' https://apitest.pdgenie.com/sparqtest/api/',
|
// apiEndpoint: ' https://apitest.pdgenie.com/sparqtest/api/',
|
||||||
|
apiEndpoint: 'http://localhost/AWSEC2/sparqapi/api/',
|
||||||
|
|
||||||
authorization: 'sparqvenba2018',
|
authorization: 'sparqvenba2018',
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ export const environment = {
|
|||||||
|
|
||||||
// apiEndpoint: 'https://apitest.pdgenie.com/sparqtest/api/',
|
// apiEndpoint: 'https://apitest.pdgenie.com/sparqtest/api/',
|
||||||
apiEndpoint: ' https://apitest.pdgenie.com/sparqtest/api/',
|
apiEndpoint: ' https://apitest.pdgenie.com/sparqtest/api/',
|
||||||
|
// apiEndpoint: 'http://localhost/AWSEC2/sparqapi/api/',
|
||||||
|
|
||||||
authorization: 'sparqvenba2018',
|
authorization: 'sparqvenba2018',
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user