Fairoj : image download as pdf and emp form desgination api change

This commit is contained in:
venbatechnologies@gmail.com 2019-12-31 20:11:54 +05:30
parent 05ac5ae6a8
commit 4c75468288
6 changed files with 99 additions and 14 deletions

View File

@ -74,7 +74,7 @@
</mat-select>
<mat-error *ngIf="employmentForm.controls['was_met'].hasError('required')">Was the employer met Required</mat-error>
</mat-form-field>
<div fxLayout="row" fxLayoutAlign="start none" *ngIf="employmentForm.controls['was_met'].value == 'yes'">
<div fxLayout="row wrap" fxLayoutAlign="start none" *ngIf="employmentForm.controls['was_met'].value == 'yes'">
<mat-form-field style="width: 45%">
<input matInput placeholder="Name of Person Met" formControlName="name_person_met"
autocomplete="off" required>
@ -93,20 +93,19 @@
required> -->
<mat-select placeholder="Designation of Person Met" formControlName="designation_person_met" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let deslist of designationdatalist" [value]="deslist.designation_id">
{{deslist.designation}}
<mat-option *ngFor="let deslist of company_relationship_list" [value]="deslist.company_relationship_id">
{{deslist.name}}
</mat-option>
</mat-select>
<mat-error *ngIf="employmentForm.controls['designation_person_met'].hasError('required')">Designation of Person Met Required</mat-error>
</mat-form-field>
<span *ngIf="employmentForm.value.designation_person_met == '1'">
<mat-form-field style="width: 45%">
<mat-form-field style="width: 45%" *ngIf="employmentForm.value.designation_person_met == '1'">
<input matInput placeholder="Specify Person Met" formControlName="others_person_met"
autocomplete="off" required>
<mat-error *ngIf="employmentForm.controls['designation_person_met'].hasError('required')">
Specify Person Met Required</mat-error>
</mat-form-field>
</span>
</div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%">
<mat-select placeholder="Salary amount confirmed ?" formControlName="confirm_salary"

View File

@ -217,8 +217,14 @@ export class EmploymentInfoComponent implements OnInit {
data => {
if (data.status == 200) {
this.company_relationship_list = data.records.filter(item => item.isactive == 1);
this.company_relationship_list = data.records.filter(item => item.name != 'Others');
this.company_relationship_list.push({ 'company_relationship_id': 0, 'name': 'Not Applicable' });
this.company_relationship_list.forEach(val=>{
console.log(val.name)
if((val.name).includes('of')){
val.name=(val.name).slice(0,-2);
}
})
this.company_relationship_list = data['records'].filter(item => item.name != 'Others' && item.name != 'Not Applicable');
this.company_relationship_list.push({ 'company_relationship_id': 1, 'name': 'Others' });
}
});
// this.retriveFile();

View File

@ -52,10 +52,10 @@
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Re-generate Report" matTooltipPosition="above" (click)="reGeneratePFReport()"><mat-icon>autorenew</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Report" matTooltipPosition="above" (click)="downloadPDReport()"><mat-icon>get_app</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures" matTooltipPosition="above" (click)="archivePDImages()"><mat-icon>save_alt</mat-icon></button>
<button *ngIf="!spinner_access" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures (PDF)" matTooltipPosition="above" (click)="downloadPDImagesPDF()"><mat-icon>picture_as_pdf</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdViewCompoent()" style="margin-right: 2px;"><mat-icon>close</mat-icon></button>
</mat-toolbar>
<mat-progress-bar *ngIf="spinner_access" mode="indeterminate" color="primary"></mat-progress-bar>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<!--{{qcStatus}}-->
@ -99,12 +99,12 @@
</figure>
</div>
<div class="footer">
<!-- <div class="footer"> -->
<!-- <button mat-raised-button color="blue" type="button" (click)="getFrameContent(IFrameContent)" style="margin-right: 2px;">Save</button>
<button mat-raised-button color="blue" type="button" (click)="reportReview('REMARKS')" style="margin-right: 2px;">Notes</button>
<button mat-raised-button color="primary" type="button" (click)="reportReview('COMPLETE')" style="margin-right: 2px;">QC Complete</button>
<button mat-raised-button color="primary" type="button" (click)="loadPdViewCompoent()" style="margin-right: 2px;">Close</button> -->
</div>
<!-- </div> -->
</mat-sidenav-container>
</div>
@ -136,9 +136,11 @@
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Change PD Status to 'COMPLETED'" matTooltipPosition="above" (click)="reportReview('change_status_completed')"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Report" matTooltipPosition="above" (click)="downloadPDReport()"><mat-icon>get_app</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures" matTooltipPosition="above" (click)="archivePDImages()"><mat-icon>save_alt</mat-icon></button>
<button *ngIf="!spinner_access" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures(PDF)" matTooltipPosition="above" (click)="downloadPDImagesPDF()"><mat-icon>save_alt</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdViewCompoent()" style="margin-right: 2px;"><mat-icon>close</mat-icon></button>
</mat-toolbar>
<mat-progress-bar *ngIf="spinner_access" mode="indeterminate" color="primary"></mat-progress-bar>
<div *ngIf="reGenerateBtn" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<figure style="min-height: 240px;">
@ -178,9 +180,9 @@
</figure>
</div>
<div class="footer">
<!-- <div class="footer"> -->
<!-- <button mat-raised-button color="primary" type="button" (click)="loadPdViewCompoent()" style="margin-right: 2px;">Close</button> -->
</div>
<!-- </div> -->
</mat-sidenav-container>
</ng-container>

View File

@ -69,6 +69,7 @@ export class QcPdReportComponent implements OnInit {
pdf_viewer_split_size:String='70'
html_viewer_split_size:String='30'
model_edit=''
spinner_access:boolean=false;
private notifier: NotifierService;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
@ -239,6 +240,27 @@ export class QcPdReportComponent implements OnInit {
// alert(err.html_format);
});
}
downloadPDImagesPDF(){
this.spinner_access=true
let data = {
"pd_id": this.startPD,
"random_string":atob(this.route.snapshot.params['string'])
};
this.notifier.notify("info","Processing please wait..")
this.pdTrigerService.photoPDFDownload(data).subscribe(data => {
if (data.dataStatus) {
window.open(data.records);
this.notifier.notify('success', 'Done Successfully..!');
} else {
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
}
this.spinner_access=false
}, err => {
this.spinner_access=false
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!');
// alert(err.html_format);
});
}
archivePDImages(){
let data = {
@ -592,5 +614,6 @@ export class DialogChangeCurrentVenrsion implements OnInit {
getConfirmation(confim: Boolean) {
this.dialogRef.close(confim);
}
}

View File

@ -613,6 +613,9 @@ export class QcService {
archivePDImages(Dtl : any): Observable<any> {
return this._http.post<any>(this.apiUrl + "archivePDImages", { "records": Dtl });
}
photoPDFDownload(params:any): Observable<any>{
return this._http.post<any>(this.apiUrl + "photoPDFDownload", { "records": params });
}
getHTMLContent(id:any): Observable<any> {
return this._http.post<any>(this.apiUrl+"getHTMLContent", {"pd_id":id});

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgb(255, 255, 255); display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
<g transform="rotate(0 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#fe718d">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(30 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#f47e60">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(60 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#f8b26a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(90 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#abbd81">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(120 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#849b87">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(150 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6492ac">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(180 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#637cb5">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(210 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a63b6">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(240 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#fe718d">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(270 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#f47e60">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(300 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#f8b26a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(330 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#abbd81">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animate>
</rect>
</g>
<!-- [ldio] generated by https://loading.io/ --></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB