regenerate process
This commit is contained in:
parent
baae0d0aba
commit
c54ada3aec
@ -1039,4 +1039,35 @@ export class PdTrigerService {
|
|||||||
console.log(params);
|
console.log(params);
|
||||||
return this._http.post(this.apiUrl+'updateMISReportRemarks',params);
|
return this._http.post(this.apiUrl+'updateMISReportRemarks',params);
|
||||||
}
|
}
|
||||||
|
generatesalereport(params :any): Observable<any> {
|
||||||
|
// let httpParams = new HttpParams().set('pdid', countpdid);
|
||||||
|
// httpParams = httpParams.append('random_string',randomString);
|
||||||
|
return this._http.get(this.apiUrl + 'regenerateSaleReport?sales_pd_id=' +params)
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('role', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
generatemail(params :any): Observable<any> {
|
||||||
|
// let httpParams = new HttpParams().set('pdid', countpdid);
|
||||||
|
// httpParams = httpParams.append('random_string',randomString);
|
||||||
|
return this._http.get(this.apiUrl + 'resendSaleReportMail?sales_pd_id=' +params)
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('role', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
//generatesateliteimage(params :any): Observable<any> {
|
||||||
|
// console.log('params');
|
||||||
|
// console.log(params);
|
||||||
|
// // let httpParams = new HttpParams().set('pdid', countpdid);
|
||||||
|
// // httpParams = httpParams.append('random_string',randomString);
|
||||||
|
// return this._http.post(this.apiUrl + 'regenerateSatelliteImg',{ "records": params })
|
||||||
|
// .pipe(
|
||||||
|
// catchError(this.handleError('role', []))
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
generatesateliteimage(param:any): Observable<any>{
|
||||||
|
return this._http.post<any>(this.apiUrl + 'regenerateSatelliteImg',param )
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
<h2 mat-dialog-title> {{title}}</h2>
|
||||||
|
<mat-dialog-content>
|
||||||
|
<div fxFlex="100">
|
||||||
|
<p align="center">
|
||||||
|
{{question}}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<div align="center" *ngIf="option == 'location'">
|
||||||
|
<mat-form-field appearance="outline" style="width: 100%;">
|
||||||
|
<mat-label>Location</mat-label>
|
||||||
|
<textarea matInput autocomplete="off" placeholder="Geolocation" type="text" [formControl] = "geolocation"></textarea>
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</mat-dialog-content>
|
||||||
|
<mat-dialog-actions align="end" *ngIf="option == 'location'">
|
||||||
|
<button mat-raised-button color="primary" (click)="submit(this.data.pdid,this.data.option)"><strong>Save</strong></button>
|
||||||
|
<button mat-raised-button mat-dialog-close><strong> Cancel </strong></button>
|
||||||
|
</mat-dialog-actions>
|
||||||
|
<mat-dialog-actions align="end" *ngIf="option != 'location'">
|
||||||
|
<button mat-raised-button color="primary" (click)="submit(this.data.pdid,this.data.option)"><strong>Yes</strong></button>
|
||||||
|
<button mat-raised-button mat-dialog-close><strong> No </strong></button>
|
||||||
|
</mat-dialog-actions>
|
||||||
|
<!--<mat-dialog-actions align="end" >
|
||||||
|
<button mat-raised-button color="primary" (click)="overwritten_pd()"
|
||||||
|
> <strong>Complete anyway </strong></button>
|
||||||
|
<button mat-raised-button mat-dialog-close><strong> Ok </strong></button>
|
||||||
|
</mat-dialog-actions>-->
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ReGenerateReportComponent } from './re-generate-report.component';
|
||||||
|
|
||||||
|
describe('ReGenerateReportComponent', () => {
|
||||||
|
let component: ReGenerateReportComponent;
|
||||||
|
let fixture: ComponentFixture<ReGenerateReportComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ReGenerateReportComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(ReGenerateReportComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core';
|
||||||
|
import { NotifierService } from "angular-notifier";
|
||||||
|
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material';
|
||||||
|
import { FormControl, Validators } from '@angular/forms';
|
||||||
|
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-re-generate-report',
|
||||||
|
templateUrl: './re-generate-report.component.html',
|
||||||
|
styleUrls: ['./re-generate-report.component.scss']
|
||||||
|
})
|
||||||
|
export class ReGenerateReportComponent implements OnInit {
|
||||||
|
private notifier: NotifierService;
|
||||||
|
errorMessage:any[]=[];
|
||||||
|
option: any;
|
||||||
|
title:any;
|
||||||
|
question:any;
|
||||||
|
geolocation:FormControl = new FormControl('',Validators.compose([Validators.required]))
|
||||||
|
constructor(notifier: NotifierService,private _pdSales: PdTrigerService,private dialogRef: MatDialogRef<ReGenerateReportComponent>,@Inject(MAT_DIALOG_DATA) public data: any) { this.notifier = notifier; }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.option=this.data.option;
|
||||||
|
if(this.option=='report')
|
||||||
|
{
|
||||||
|
this.title='Re-Generate the Report';
|
||||||
|
this.question='Do you want to Re-Generate the Report';
|
||||||
|
}
|
||||||
|
else if(this.option=='mail')
|
||||||
|
{
|
||||||
|
this.title='Re-Sent the Email'
|
||||||
|
this.question='Do you want to Re-Sent the Email';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.title='Geolocation'
|
||||||
|
this.question='Enter the Geolocation';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
submit(pdid,option)
|
||||||
|
{
|
||||||
|
if(option=='report')
|
||||||
|
{
|
||||||
|
this._pdSales.generatesalereport(pdid)
|
||||||
|
.subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
|
||||||
|
this.dialogRef.close();
|
||||||
|
|
||||||
|
alert('generate report succussfully');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// , error => this.errorMessage = <any> error);
|
||||||
|
,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.!');
|
||||||
|
alert(error.html_format);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if(option=='mail')
|
||||||
|
{
|
||||||
|
this._pdSales.generatemail(pdid)
|
||||||
|
.subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.dialogRef.close();
|
||||||
|
alert('mail sent succussfully');
|
||||||
|
this.notifier.notify('error','error');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// , error => this.errorMessage = <any> error);
|
||||||
|
,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.!');
|
||||||
|
alert(error.html_format);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let geolocation:any = {
|
||||||
|
"sales_pd_id":pdid,
|
||||||
|
"geo_location":this.geolocation.value
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
this._pdSales.generatesateliteimage(geolocation)
|
||||||
|
.subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.dialogRef.close();
|
||||||
|
alert('Saved succussfully');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// , error => this.errorMessage = <any> error);
|
||||||
|
,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.!');
|
||||||
|
alert(error.html_format);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<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)"
|
||||||
(resetFilter)= "loadSalesPDDetails()"></app-advance-filter>
|
(resetFilter)= "loadSalesPDDetails()"></app-advance-filter>
|
||||||
</div>
|
</div>
|
||||||
<!-- <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> -->
|
||||||
|
|
||||||
@ -91,6 +91,30 @@
|
|||||||
matTooltipPosition="above" color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button>
|
matTooltipPosition="above" color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
<ng-container matColumnDef="Re-Generate">
|
||||||
|
<mat-cell class="cell" *matCellDef="let details;" style="justify-content: flex-start">
|
||||||
|
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="ReGenerate"
|
||||||
|
matTooltipPosition="above" color="primary" [matMenuTriggerFor]="menu1"><mat-icon>more_vert</mat-icon></button>
|
||||||
|
<mat-menu #menu1="matMenu">
|
||||||
|
<button mat-menu-item (click)="regeneratereport(details.sales_pd_id,'report')">
|
||||||
|
|
||||||
|
<mat-icon>autorenew</mat-icon>
|
||||||
|
<span>Re-Generate Report</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button mat-menu-item (click)="regeneratereport(details.sales_pd_id,'location')">
|
||||||
|
|
||||||
|
<mat-icon>location_on</mat-icon>
|
||||||
|
<span>Re-Generate Location</span>
|
||||||
|
</button>
|
||||||
|
<button mat-menu-item (click)="regeneratereport(details.sales_pd_id,'mail')">
|
||||||
|
|
||||||
|
<mat-icon>email</mat-icon>
|
||||||
|
<span>Resent Mail</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
|
</mat-cell>
|
||||||
|
</ng-container>
|
||||||
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
|
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
|
||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { MatTableDataSource, MatPaginator, MatSort, PageEvent } from '@angular/material';
|
import { MatTableDataSource, MatPaginator, MatSort, PageEvent, MatDialog } from '@angular/material';
|
||||||
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
|
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
|
||||||
import { UserService } from 'app/settings/service/user.service';
|
import { UserService } from 'app/settings/service/user.service';
|
||||||
|
import {ReGenerateReportComponent} from './../re-generate-report/re-generate-report.component'
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-sales-pd',
|
selector: 'app-sales-pd',
|
||||||
@ -13,7 +15,7 @@ export class SalesPdComponent implements OnInit {
|
|||||||
public dataSourceTab4 = new MatTableDataSource();
|
public dataSourceTab4 = new MatTableDataSource();
|
||||||
filter_input:string='';
|
filter_input:string='';
|
||||||
|
|
||||||
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','Re-Generate'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -32,11 +34,11 @@ 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();
|
||||||
filter_drop_down_data: any;
|
filter_drop_down_data: any;
|
||||||
common: any;
|
common: any;
|
||||||
|
|
||||||
constructor(private _pdSales: PdTrigerService,private userService:UserService) {
|
constructor(private _pdSales: PdTrigerService,private userService:UserService,private dialog: MatDialog) {
|
||||||
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
|
||||||
}
|
}
|
||||||
@ -104,6 +106,21 @@ export class SalesPdComponent implements OnInit {
|
|||||||
alert(error.html_format);
|
alert(error.html_format);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
regeneratereport(data,option)
|
||||||
|
{
|
||||||
|
|
||||||
|
const dialogRefqw = this.dialog.open(ReGenerateReportComponent, {
|
||||||
|
data: { pdid: data, option: option},
|
||||||
|
disableClose: true,
|
||||||
|
minWidth: '30%',
|
||||||
|
maxWidth: '40%',
|
||||||
|
|
||||||
|
});
|
||||||
|
dialogRefqw.afterClosed()
|
||||||
|
.subscribe(dataresult => {
|
||||||
|
// this.viewPdDetails(this.viewID,this.masterRandomString)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
filteredDataSource(data){
|
filteredDataSource(data){
|
||||||
console.log("From Parent",data);
|
console.log("From Parent",data);
|
||||||
|
|||||||
@ -8,14 +8,39 @@ import { MisReportsComponent } from './mis-reports/mis-reports.component';
|
|||||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material';
|
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material';
|
||||||
import { AdvanceFilterComponent } from './sales-pd-list/advance-filter/advance-filter.component';
|
import { AdvanceFilterComponent } from './sales-pd-list/advance-filter/advance-filter.component';
|
||||||
import { MAT_MOMENT_DATE_FORMATS, MomentDateAdapter } from '@angular/material-moment-adapter';
|
import { MAT_MOMENT_DATE_FORMATS, MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||||
|
//import { MatMenuModule} from '@angular/material/menu';
|
||||||
|
import {
|
||||||
|
MatCardModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatInputModule,
|
||||||
|
MatRadioModule,
|
||||||
|
MatButtonModule, MatTableModule, MatPaginatorModule,
|
||||||
|
MatProgressBarModule, MatDialogModule, MatSortModule,
|
||||||
|
MatToolbarModule, MatSelectModule, MatListModule, MatGridListModule,
|
||||||
|
MatTabsModule, MatCheckboxModule,
|
||||||
|
MatBadgeModule, MatExpansionModule, MatStepperModule, MatSidenavModule,
|
||||||
|
MatMenuModule, MatButtonToggleModule,MatChipsModule,MatProgressSpinnerModule,
|
||||||
|
MatAutocompleteModule, MatDatepickerModule } from '@angular/material';
|
||||||
|
import { ReGenerateReportComponent } from './re-generate-report/re-generate-report.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
SalesPdRoutingModule,
|
SalesPdRoutingModule,
|
||||||
MaterialModule
|
MaterialModule,MatMenuModule,MatCardModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatInputModule,
|
||||||
|
MatRadioModule,
|
||||||
|
MatButtonModule, MatTableModule, MatPaginatorModule,
|
||||||
|
MatProgressBarModule, MatDialogModule, MatSortModule,
|
||||||
|
MatToolbarModule, MatSelectModule, MatListModule, MatGridListModule,
|
||||||
|
MatTabsModule, MatCheckboxModule,
|
||||||
|
MatBadgeModule, MatExpansionModule, MatStepperModule, MatSidenavModule,
|
||||||
|
MatButtonToggleModule,MatChipsModule,MatProgressSpinnerModule,
|
||||||
|
MatAutocompleteModule, MatDatepickerModule
|
||||||
],
|
],
|
||||||
declarations: [SalesPdComponent, MisReportsComponent, AdvanceFilterComponent],
|
declarations: [SalesPdComponent, MisReportsComponent, AdvanceFilterComponent, ReGenerateReportComponent],
|
||||||
|
entryComponents:[ReGenerateReportComponent],
|
||||||
providers:[{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
|
providers:[{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
|
||||||
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}]
|
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}]
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user