template forms list, add details : kdk
This commit is contained in:
parent
dde0d9081f
commit
fee4b344ff
@ -89,7 +89,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 24%">
|
<mat-form-field style="width: 24%">
|
||||||
<!-- <input matInput placeholder="Loan Amount" formControlName="loan_amount"> -->
|
<!-- <input matInput placeholder="Loan Amount" formControlName="loan_amount"> -->
|
||||||
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required autocomplete="off">
|
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required autocomplete="off">
|
||||||
<mat-hint align="end" *ngIf="pdMain.loan_amount.value != ''">{{"₹"}} {{loanAmtInWords}} Only</mat-hint>
|
<mat-hint align="end" *ngIf="pdMain.loan_amount.value != ''">{{"₹"}} {{loanAmtInWords}} Only</mat-hint>
|
||||||
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
|
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
|
||||||
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
|
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
|
||||||
|
|||||||
@ -13,9 +13,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<mat-tab-group>
|
<mat-tab-group>
|
||||||
<mat-tab label="PD Data">
|
<mat-tab label="PD Data">
|
||||||
<div>
|
<div align="end" style="padding: 12px;">
|
||||||
Export
|
<button matTooltip="Export Excel" matTooltipPosition="above" color="primary" mat-icon-button mat-raised-button (click)="export()">
|
||||||
<button (click)="export()">Export Excel</button>
|
<mat-icon style="color: white;">cloud_download</mat-icon>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@ -266,7 +266,7 @@ export class PdReportComponent implements OnInit {
|
|||||||
console.log(blob);
|
console.log(blob);
|
||||||
let datass = blob.headers.get('content-disposition');
|
let datass = blob.headers.get('content-disposition');
|
||||||
let fileName = datass.split(/"/)[1];
|
let fileName = datass.split(/"/)[1];
|
||||||
this.notifier.notify('success', 'Your Changes Updated.!');
|
// this.notifier.notify('success', 'Your Changes Updated.!');
|
||||||
const blobs = new Blob([blob.body],
|
const blobs = new Blob([blob.body],
|
||||||
{ type: 'application/vnd.ms-excel' });
|
{ type: 'application/vnd.ms-excel' });
|
||||||
const file = new File([blobs], fileName,
|
const file = new File([blobs], fileName,
|
||||||
|
|||||||
@ -19,8 +19,8 @@
|
|||||||
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above"
|
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above"
|
||||||
(click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
|
(click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
|
||||||
|
|
||||||
<button *ngIf="master.pd_type_name && (currentPDStatus===pdStatusCheck.QC_COMPLETED || currentPDStatus===pdStatusCheck.COMPLETED)" mat-raised-button
|
<button *ngIf="master.pd_type_name && (currentPDStatus===pdStatusCheck.QC_COMPLETED || currentPDStatus===pdStatusCheck.COMPLETED)"
|
||||||
mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above"
|
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above"
|
||||||
(click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
|
(click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
|
||||||
|
|
||||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
|
||||||
@ -191,8 +191,7 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50"
|
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
|
||||||
fxFlex.lg="50" fxFlex.xl="50">
|
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<div style="color:red !important;">
|
<div style="color:red !important;">
|
||||||
<h6>QC Notes</h6>
|
<h6>QC Notes</h6>
|
||||||
@ -204,13 +203,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div *ngIf="pdMasterData[0]?.pd_status === 'QC_COMPLETED'" class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50"
|
<div *ngIf="pdMasterData[0]?.pd_status === 'QC_COMPLETED'" class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50"
|
||||||
fxFlex.lg="50" fxFlex.xl="50">
|
fxFlex.lg="50" fxFlex.xl="50">
|
||||||
|
<mat-card>
|
||||||
<div style="color:red !important;">
|
<div style="color:red !important;">
|
||||||
<h6>QC Remarks</h6>
|
<h6>QC Remarks</h6>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div style="display: inline-flex">
|
||||||
|
<div style="margin: 12px; font-size: 21px;">
|
||||||
{{ pdMasterData[0]?.qc_rating}}
|
{{ pdMasterData[0]?.qc_rating}}
|
||||||
<div>
|
</div>
|
||||||
|
<div style="display: inline-block">
|
||||||
<app-rating [rating]="pd_QC_Rating"></app-rating>
|
<app-rating [rating]="pd_QC_Rating"></app-rating>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -219,6 +221,7 @@
|
|||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
{{ pdMasterData[0]?.qc_feedback}}
|
{{ pdMasterData[0]?.qc_feedback}}
|
||||||
</div>
|
</div>
|
||||||
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|||||||
@ -146,5 +146,17 @@ export class TemplatesService {
|
|||||||
return this._http.post<any[]>(this.apiUrl + "getPDReportTemplate", { "records": {"fk_template_id": template_id }});
|
return this._http.post<any[]>(this.apiUrl + "getPDReportTemplate", { "records": {"fk_template_id": template_id }});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// selected Template forms details
|
||||||
|
getTemplateSelectedForms(template_id: any): Observable<any> {
|
||||||
|
const options = {
|
||||||
|
params: new HttpParams().set('template_id', template_id)
|
||||||
|
};
|
||||||
|
return this._http.get<any[]>(this.apiUrl + "getTemplateForms", options);
|
||||||
|
}
|
||||||
|
|
||||||
|
saveTemplateFormsList(Records: any): Observable<any> {
|
||||||
|
// Records.fk_createdby = this._aws.getlocale();//to get user id for who is created the Record
|
||||||
|
// Records.createdon = currentdate;//to get Current date and Time for when the Record is created
|
||||||
|
return this._http.post<any[]>(this.apiUrl + "saveTemplateForms", {'records': Records });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
<mat-selection-list #list [(ngModel)]="selectedOptions" (ngModelChange)="onNgModelChange($event)" class="flexlist">
|
||||||
|
<mat-list-option *ngFor="let tta of masterFormsList" [value]="tta.form_id">
|
||||||
|
{{tta.pd_form_name}}
|
||||||
|
</mat-list-option>
|
||||||
|
</mat-selection-list>
|
||||||
|
<div align="end">
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" (click)="restore()"><mat-icon>settings_backup_restore</mat-icon></button>
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" (click)="myClick()"><mat-icon>save</mat-icon></button>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
.flexlist{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.flexlist > * {
|
||||||
|
flex: 0 50%;
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { TemplateFormsComponent } from './template-forms.component';
|
||||||
|
|
||||||
|
describe('TemplateFormsComponent', () => {
|
||||||
|
let component: TemplateFormsComponent;
|
||||||
|
let fixture: ComponentFixture<TemplateFormsComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ TemplateFormsComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(TemplateFormsComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
import { Component, OnInit, ViewChild , Input} from '@angular/core';
|
||||||
|
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||||
|
import { TemplatesService } from './../../../../service/templates/templates.service';
|
||||||
|
import { MastersService } from './../../../../service/masters/masters.service';
|
||||||
|
import { NotifierService } from "angular-notifier";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-template-forms',
|
||||||
|
templateUrl: './template-forms.component.html',
|
||||||
|
styleUrls: ['./template-forms.component.scss']
|
||||||
|
})
|
||||||
|
export class TemplateFormsComponent implements OnInit {
|
||||||
|
|
||||||
|
masterFormsList = [] ;
|
||||||
|
selectedOptions = [];
|
||||||
|
@Input() questionId: number;
|
||||||
|
/**
|
||||||
|
* Notifier service
|
||||||
|
*/
|
||||||
|
private notifier: NotifierService;
|
||||||
|
|
||||||
|
constructor(private mastersService : MastersService,
|
||||||
|
private templatesService: TemplatesService,
|
||||||
|
notifier: NotifierService) {
|
||||||
|
this.notifier = notifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.mastersService.getAllMasterData("PDFORMS").subscribe(data => {
|
||||||
|
this.masterFormsList = data.records.sort((a ,b)=>{ return a.pd_form_order - b.pd_form_order;});
|
||||||
|
// this.selectedOptions = ["1"];
|
||||||
|
this.getSelectedFormDetails();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
restore(): void {
|
||||||
|
this.getSelectedFormDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
getSelectedFormDetails() {
|
||||||
|
this.templatesService.getTemplateSelectedForms(this.questionId).subscribe(data=>{
|
||||||
|
if(data.dataStatus){
|
||||||
|
this.selectedOptions = data.records;
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
myClick(){
|
||||||
|
if(this.selectedOptions.length > 0){
|
||||||
|
let records = {
|
||||||
|
"template_id":this.questionId,
|
||||||
|
"forms": this.selectedOptions
|
||||||
|
}
|
||||||
|
this.templatesService.saveTemplateFormsList(records).subscribe(data => {
|
||||||
|
if(data.dataStatus){
|
||||||
|
this.notifier.notify('success', 'Your Changes Updated.!');
|
||||||
|
}else{
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
}
|
||||||
|
}, err => {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
alert("should select the forms in list !!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onNgModelChange(e){
|
||||||
|
console.log("event " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -51,6 +51,12 @@
|
|||||||
</app-report-template>
|
</app-report-template>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
|
<mat-tab label="Forms">
|
||||||
|
<ng-template matTabContent>
|
||||||
|
<app-template-forms [questionId]="question_id">
|
||||||
|
</app-template-forms>
|
||||||
|
</ng-template>
|
||||||
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|||||||
@ -37,6 +37,7 @@ import { CategoryQuestionAnswerComponent } from './templates-list/edit/edit-ques
|
|||||||
import { DialogOverviewExampleDialog } from './templates-list/edit/edit-question-answer/category-question-answer/category-question-answer.component';
|
import { DialogOverviewExampleDialog } from './templates-list/edit/edit-question-answer/category-question-answer/category-question-answer.component';
|
||||||
import { TemplatesAddComponent } from './templates-list/templates-add/templates-add.component';
|
import { TemplatesAddComponent } from './templates-list/templates-add/templates-add.component';
|
||||||
import { ReportTemplateComponent } from './templates-list/edit/report-template/report-template.component';
|
import { ReportTemplateComponent } from './templates-list/edit/report-template/report-template.component';
|
||||||
|
import { TemplateFormsComponent } from './templates-list/edit/template-forms/template-forms.component';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Question Master Module details
|
* Question Master Module details
|
||||||
@ -119,7 +120,8 @@ const customNotifierOptions: NotifierOptions = {
|
|||||||
CategoryQuestionAnswerComponent,
|
CategoryQuestionAnswerComponent,
|
||||||
DialogOverviewExampleDialog,
|
DialogOverviewExampleDialog,
|
||||||
TemplatesAddComponent,
|
TemplatesAddComponent,
|
||||||
ReportTemplateComponent
|
ReportTemplateComponent,
|
||||||
|
TemplateFormsComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
DialogOverviewExampleDialog,
|
DialogOverviewExampleDialog,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user