From 9f83c772362fc2fcb65d60558d9a4ca71a1971cc Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sat, 29 Dec 2018 13:24:49 +0530 Subject: [PATCH] merge : kms --- ng6-seed/package.json | 2 + .../edit-pd-master.component.html | 4 +- .../pd-report/pd-report.component.html | 8 +- .../list-pd/pd-report/pd-report.component.ts | 256 +-- .../qc-review/qc-review.component.html | 4 +- .../forms/address/address.component.html | 227 +-- .../forms/address/address.component.ts | 168 +- .../client-info/client-info.component.html | 2 + .../client-info/client-info.component.ts | 35 +- .../loan-details/loan-details.component.html | 43 +- .../loan-details/loan-details.component.ts | 142 +- .../start-pd/forms/stock/stock.component.html | 1030 +++++------ .../start-pd/forms/stock/stock.component.ts | 1561 +++++++++-------- .../supplier-info/supplier-info.component.ts | 19 +- .../list-pd/view-pd/view-pd.component.html | 35 +- .../pd-service/pd-triger.service.ts | 520 +++--- .../app/shared/rating/rating.component.html | 12 +- .../app/shared/rating/rating.component.scss | 8 +- .../src/app/shared/rating/rating.component.ts | 5 + 19 files changed, 2118 insertions(+), 1963 deletions(-) diff --git a/ng6-seed/package.json b/ng6-seed/package.json index 8ebe4b5c7..0950afc99 100755 --- a/ng6-seed/package.json +++ b/ng6-seed/package.json @@ -30,6 +30,7 @@ "@ngx-translate/http-loader": "^3.0.1", "@swimlane/ngx-charts": "^7.0.1", "@swimlane/ngx-datatable": "11.1.5", + "@types/file-saver": "^2.0.0", "amazon-cognito-identity-js": "^2.0.27", "angular-calendar": "0.23.3", "angular-notifier": "^4.1.1", @@ -39,6 +40,7 @@ "core-js": "^2.5.5", "d3": "^4.9.1", "dragula": "3.7.2", + "file-saver": "^2.0.0", "font-awesome": "4.7.0", "hammerjs": "2.0.8", "intl": "^1.2.4", diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index b0d4e742e..259d90574 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -89,7 +89,7 @@ - + {{"₹"}} {{loanAmtInWords}} Only Enter valid amount. @@ -142,7 +142,7 @@
- +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html index 259603465..7e165291b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html @@ -7,12 +7,16 @@
- - + +
+
+ Export + +
{{pdReportRecords?.billing_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts index f9a6d5d2d..70a079cce 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts @@ -1,16 +1,21 @@ import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser'; -import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy, Inject} from '@angular/core'; -import {FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl} from '@angular/forms'; -import {ActivatedRoute, Router} from '@angular/router'; -import {NotifierService} from 'angular-notifier'; -import {ListPdComponent} from './../list-pd.component'; +import { Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { NotifierService } from 'angular-notifier'; +import { ListPdComponent } from './../list-pd.component'; -import {PdTrigerService} from '../../../pd-service/pd-triger.service'; -import { MatDialog, +import { saveAs as importedSaveAs } from "file-saver"; + +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; +import { + MatDialog, MatDialogRef, - MAT_DIALOG_DATA } from "@angular/material"; -import { ModelEditPdReportComponent} from './model-edit-pd-report/model-edit-pd-report.component'; + MAT_DIALOG_DATA +} from "@angular/material"; +import { ModelEditPdReportComponent } from './model-edit-pd-report/model-edit-pd-report.component'; import { QcReviewComponent } from './qc-review/qc-review.component'; +import { HttpResponse } from "@angular/common/http"; /**sweet alert */ // import Swal from 'sweetalert2'; @@ -21,7 +26,7 @@ import { QcReviewComponent } from './qc-review/qc-review.component'; styleUrls: ['./pd-report.component.scss'] }) export class PdReportComponent implements OnInit { - Url : SafeUrl; + Url: SafeUrl; startPD: any; // public src = 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf'; // public src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b'; @@ -31,68 +36,68 @@ export class PdReportComponent implements OnInit { public reGenerateBtn: Boolean = false; public pdReportVersionList = []; // public src; - pdReportRecords:any; + pdReportRecords: any; latestPDDetails: any; - message:any; + message: any; private notifier: NotifierService; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, - private router: Router, public pdTrigerService: PdTrigerService, private listPDComponent: ListPdComponent, - private dialog: MatDialog, private sanitizer: DomSanitizer) { - this.startPD = this.route.snapshot.params['pdid']; - this.notifier = notifier; - // this.src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T073026Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=35aa183cbbfc835f96719a5e9aa552c79b3a1b7d8bca043f7d738d730755dcbb'; - // this.src = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b"); - // alert(JSON.stringify(this.src)); - // this.document = { name: 'Angular 2', - // description: 'An amazing Angular 2 pdf', - // url: { url: 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b', withCredentials: true } }; - // this.Url = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181207%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181207T122031Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=fac718f35d195ecb45d1dc7049fbaf0fa3158f237deeedac3bae60f8ec22e822"); - } + private router: Router, public pdTrigerService: PdTrigerService, private listPDComponent: ListPdComponent, + private dialog: MatDialog, private sanitizer: DomSanitizer) { + this.startPD = this.route.snapshot.params['pdid']; + this.notifier = notifier; + // this.src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T073026Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=35aa183cbbfc835f96719a5e9aa552c79b3a1b7d8bca043f7d738d730755dcbb'; + // this.src = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b"); + // alert(JSON.stringify(this.src)); + // this.document = { name: 'Angular 2', + // description: 'An amazing Angular 2 pdf', + // url: { url: 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b', withCredentials: true } }; + // this.Url = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181207%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181207T122031Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=fac718f35d195ecb45d1dc7049fbaf0fa3158f237deeedac3bae60f8ec22e822"); + } ngOnInit() { this.listPDComponent.showListView(false); this.getPdReportDetails(); this.getPdReportVersionList(); - // start + // start - // end - const elemSidebar = document.querySelector('.app-inner .mail-sidebar'); - const elemContent = document.querySelector('.app-inner .main-content'); + // end + const elemSidebar = document.querySelector('.app-inner .mail-sidebar'); + const elemContent = document.querySelector('.app-inner .main-content'); - if (window.matchMedia(`(min-width: 1560px)`).matches && !this.isMac()) { - // Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true }); - // Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true }); - } + if (window.matchMedia(`(min-width: 1560px)`).matches && !this.isMac()) { + // Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true }); + // Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true }); + } - // this.loadTemplates(this.startPD); - // this.next = 1; - // this.previous = 2; + // this.loadTemplates(this.startPD); + // this.next = 1; + // this.previous = 2; } - isMac(): boolean { - let bool = false; - if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) { - bool = true; - } - return bool; + isMac(): boolean { + let bool = false; + if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) { + bool = true; } + return bool; + } - isOver(): boolean { - return window.matchMedia(`(max-width: 1560px)`).matches; - } + isOver(): boolean { + return window.matchMedia(`(max-width: 1560px)`).matches; + } - reGeneratePFReport(){ - let data = { + reGeneratePFReport() { + let data = { "pd_id": this.startPD, - "regenerate":"1" - }; - this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data=>{ - if(data.dataStatus){ + "regenerate": "1" + }; + this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data => { + if (data.dataStatus) { this.notifier.notify('success', 'Your Changes Updated.!'); this.getPdReportVersionList(); } else { @@ -103,11 +108,11 @@ export class PdReportComponent implements OnInit { }) } generateNewPDReport() { - let data = { - "pd_id": this.startPD + let data = { + "pd_id": this.startPD }; - this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data=>{ - if(data.dataStatus){ + this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data => { + if (data.dataStatus) { this.notifier.notify('success', 'Your Changes Updated.!'); this.getPdReportVersionList(); } else { @@ -119,33 +124,33 @@ export class PdReportComponent implements OnInit { } public qcStatus: string = ''; - getPdReportVersionList(){ + getPdReportVersionList() { this.pdTrigerService.getPdDocVersionList(this.startPD).subscribe(data => { - if(data.status == 200 && data.dataStatus){ - this.pdReportVersionList = [...data.records.reports_urls].reverse(); - let datas = this.pdReportVersionList.filter((a)=>{return a.is_latest == 1;}) - this.latestPDDetails = datas[0]; - this.qcStatus = data.records.pdstatus; - // alert(JSON.stringify(this.latestPDDetails)); - this.reGenerateBtn = true; - } else { - // this.reGenerateBtn = true; - this.generateBtn = true; - this.message= data.msg; - } - }, err=> { + if (data.status == 200 && data.dataStatus) { + this.pdReportVersionList = [...data.records.reports_urls].reverse(); + let datas = this.pdReportVersionList.filter((a) => { return a.is_latest == 1; }) + this.latestPDDetails = datas[0]; + this.qcStatus = data.records.pdstatus; + // alert(JSON.stringify(this.latestPDDetails)); + this.reGenerateBtn = true; + } else { + // this.reGenerateBtn = true; + this.generateBtn = true; + this.message = data.msg; + } + }, err => { }) } getPdReportDetails() { this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => { - if (data.status == 200) { + if (data.status == 200) { // this.pdReportRecords = data.records.question_answers; - this.pdReportRecords = data.records; + this.pdReportRecords = data.records; // this.pdReportRecords = data.records.qu; - } - }, err=> { + } + }, err => { }) } @@ -154,13 +159,13 @@ export class PdReportComponent implements OnInit { // load pd view component loadPdViewCompoent() { - this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route}); + this.router.navigate(['../../viewpd', this.startPD], { relativeTo: this.route }); } - // add questions popup model call + // add questions popup model call addNewQuestion() { const dialogRef = this.dialog.open(ModelEditPdReportComponent, { - data: { startId : this.startPD, version_id: this.latestPDDetails.doc_name}, + data: { startId: this.startPD, version_id: this.latestPDDetails.doc_name }, disableClose: true }); dialogRef.afterClosed() @@ -172,56 +177,56 @@ export class PdReportComponent implements OnInit { }); } - changeVersion(pd : any): void { + changeVersion(pd: any): void { this.latestPDDetails = pd; console.log(this.latestPDDetails); } - - reportReview(status): void { - const dialogRef = this.dialog.open(QcReviewComponent, { - data: { startId : this.startPD, data_status: status }, - disableClose: true - }); - dialogRef.afterClosed() - .subscribe(dataresult => { - // this.getPdReportFinalTemplateDetails(); - // this.getQuestionsMasters(); - // this.getBranch(); - // this.isPopupOpened = false; - }); - } - - changeDocumentEdit() : void{ - - + + reportReview(status): void { + const dialogRef = this.dialog.open(QcReviewComponent, { + data: { startId: this.startPD, data_status: status }, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.getPdReportFinalTemplateDetails(); + // this.getQuestionsMasters(); + // this.getBranch(); + // this.isPopupOpened = false; + }); + } + + changeDocumentEdit(): void { + + const dialogRef = this.dialog.open(DialogChangeCurrentVenrsion, { disableClose: true }); dialogRef.afterClosed() - .subscribe(dataresult => { - if(dataresult) { - let data = { - "pd_id": this.startPD, - "doc_name": this.latestPDDetails.doc_name - }; - this.pdTrigerService.swapOlderPDReportToLatest(data).subscribe(data => { - if (data.status == 200) { - this.notifier.notify('success', 'Your Changes Updated.!'); - this.getPdReportVersionList(); - } else { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - } - }, err=> { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - }) - } else { - } + .subscribe(dataresult => { + if (dataresult) { + let data = { + "pd_id": this.startPD, + "doc_name": this.latestPDDetails.doc_name + }; + this.pdTrigerService.swapOlderPDReportToLatest(data).subscribe(data => { + if (data.status == 200) { + this.notifier.notify('success', 'Your Changes Updated.!'); + this.getPdReportVersionList(); + } else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }) + } else { + } }); - - // Swal('User Created'); + + // Swal('User Created'); // swal({ // title: 'Error!', // text: 'Do you want to continue', @@ -254,6 +259,27 @@ export class PdReportComponent implements OnInit { // }s // }) } + + export() { + this.pdTrigerService.pdReportExportExcel().subscribe((blob: HttpResponse) => { + if (blob) { + console.log(blob); + let datass = blob.headers.get('content-disposition'); + let fileName = datass.split(/"/)[1]; + this.notifier.notify('success', 'Your Changes Updated.!'); + const blobs = new Blob([blob.body], + { type: 'application/vnd.ms-excel' }); + const file = new File([blobs], fileName, + { type: 'application/vnd.ms-excel' }); + console.log(file); + importedSaveAs(file); + } else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }) + } } @@ -289,7 +315,7 @@ export class DialogChangeCurrentVenrsion implements OnInit { ngOnInit(): void { } - getConfirmation(confim : Boolean) { + getConfirmation(confim: Boolean) { this.dialogRef.close(confim); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html index 4c2fe1a30..bda833b4f 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html @@ -4,7 +4,7 @@

- Because you've marked the document as QC Complete, you can't edit this document. + Once QC is Completed further edit will not be possible on this document.

@@ -29,7 +29,7 @@
-

QC Remarks

+

QC Notes

diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index 13cd38df4..494caa4a8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -19,105 +19,118 @@ -
-
+
+ +
- - - - - -
-
- - - {{m_addressType.address_type}} - - - - - - -
-
- - - {{m_locality.locality_name}} - - - + + + + + +
+ +
+ + + {{m_addressType.address_type}} + + + +
+ +
+ + + +
+ +
+ + + {{m_locality.locality_name}} + + + +
- - - -
- - -
-
-
- - - {{data.description}} - - - -
-
- - - {{data.rating}} - - - -
-
- - - - {{ownerShip.name}} - - - - - - - +
+ + + +
- - - +
+ + + {{data.description}} + + + +
-
-
-
-
- - - Yes - No - - -
-
-
-
- - - - - - - -
-
+
+ + + {{data.rating}} + + + +
+ +
+ + + + {{ownerShip.name}} + + + +
+ +
+ + + + +
+ +
+ + + + +
+
+ +
+
+ + + + + + + +
+
+ + + Yes + No + + +
+
+ + + +
+ + + +
+ +
@@ -184,7 +205,7 @@ - + @@ -383,10 +404,4 @@ - - - - - - - + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts index ff2906a74..82368e70c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts @@ -125,61 +125,15 @@ export class AddressComponent implements OnInit { this.addressForm.controls.comment_locality.setValue(data.records.comment_locality); // this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour); this.addressForm.controls.locality.setValue(data.records.locality); + if(data.records.locality == 7 ){ + this.addressForm.controls.locality_others.setValue(data.records.locality_others); + } this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark); this.addressForm.controls.address_ownership.setValue(data.records.address_ownership); this.addressForm.controls.other_ownership.setValue(data.records.other_ownership); this.addressForm.controls.rent_amt.setValue(data.records.rent_amt); this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity); - // if(data.records.bussiness_activity == 'yes') { - - // this.bussiness_address_type = []; - - // this.bussiness_address_type = (Object.keys(data.records.bussiness_address_type).map(function(key) - // { - // return data.records.bussiness_address_type[key].premises_types; - // })) - - // // console.log(bussiness_address_type); - - - // let selectedPremisesDBData = Object.keys(data.records.bussiness_address_type).map(function (key) { - // return data.records.bussiness_address_type[key]; - // }); - - // let enduse: any = []; - // let existPremises: any =[]; - - // selectedPremisesDBData.forEach(val => { - // enduse.push(val.premises_types); - // existPremises.push(val); - // }); - - // this.formPremisesArray = existPremises; - - - // this.addressForm.controls.bussiness_address_type.setValue(enduse); - - // var additionalPremisesResult = Object.keys(data.records.additional_premises).map(function (key) { - // return data.records.additional_premises[key]; - // }); - - // this.additional_premises = additionalPremisesResult; - - // if (additionalPremisesResult.length == 0) { - // additionalPremisesControl.push(this.createPremises()); - // } else { - // additionalPremisesResult.forEach(datas => { - // additionalPremisesControl.push(this.createPremises()); - // }); - // } - - - // if(data.records.bussiness_address_type == 12) { - // this.addressForm.controls.bussiness_address_type_others.setValue(data.records.bussiness_address_type_others); - // } - // } - if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) { this.addressForm.controls.business_years.setValue(data.records.business_years); this.addressForm.controls.business_month.setValue(data.records.business_month); @@ -198,8 +152,6 @@ export class AddressComponent implements OnInit { }) } - // console.log(this.bussiness_address_type); - // console.log(this.additional_premises); this.selectedValue(this.bussiness_address_type,this.additional_premises); if (data.records.locality_others) { @@ -333,8 +285,9 @@ export class AddressComponent implements OnInit { control.removeAt(index); }*/ onSubmit() { - //console.log('form data', this.addressForm.value); + if (!this.addressForm.valid) { + return; } @@ -345,7 +298,7 @@ export class AddressComponent implements OnInit { records.address_type_others = this.addressForm.controls.address_type_others.value; } records.locality = this.locality.value; - if (this.locality.value == 'Others') { + if (this.locality.value == 7) { records.locality_others = this.addressForm.controls.locality_others.value; } records.pd_location = this.pdLocation.value; @@ -369,16 +322,16 @@ export class AddressComponent implements OnInit { records.bussiness_address_type_others = this.addressForm.controls.bussiness_address_type_others.value; } } + console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value); this.addressForm.controls.additional_premises.value.forEach((val,index)=> - { - //console.log(val); - - if(val.premises_city != ''){ + { + + console.log('val.premises_city',val.premises_city); + if(val.premises_city != '' && val.premises_city != null){ this.formPremisesCityArray = []; val.premises_city.forEach(option => { this.formPremisesCityArray.push({additional_premises_city: option}); this.addressForm.controls.additional_premises.value[index].premises_city = this.formPremisesCityArray; - // console.log(val); }); } else{ @@ -390,15 +343,14 @@ export class AddressComponent implements OnInit { }); records.additional_premises = this.addressForm.controls.additional_premises.value; - // console.log(this.formPremisesCityArray); - // console.log(this.addressForm.controls.premises.value); + records.pdid = this.pdid; records.formid = '5'; // records.fk_createdby = '250'; - console.log('params', records); + this._pd.saveForm(records).subscribe(data => { - //console.log('data', data); + this.notifier.notify('success', 'Saved Successfully.'); }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); @@ -414,22 +366,22 @@ export class AddressComponent implements OnInit { SelectedPremises($event){ let premisesData = $event.source.value; - //console.log(premisesData); + if($event.checked === true ){ //this.formPremisesArray.push({member: $event.source.value}); //this.selectedSegmentDatas.push(CustomerSegmentName.name); - //console.log('true',premisesData); + - //console.log(this.formPremisesArray); + this.formPremisesArray.push({premises_types: $event.source.value}); - //console.log(this.formPremisesArray); + const control = this.addressForm.controls['additional_premises']; let array = this.addressData.filter(data => data.address_type_id == premisesData)[0]; - //console.log(array); + if(premisesData == 12){ this.PremisesOtherFlag = true; // this.PremisesLabel[this.z] = this.pdQuestionAddress.get('bussiness_address_type_others').value; @@ -455,7 +407,7 @@ export class AddressComponent implements OnInit { if(premisesData == 12){ this.PremisesOtherFlag = false; } - //console.log(this.formPremisesArray); + let index = this.formPremisesArray.findIndex(form=>form.premises_types== $event.source.value); //console.log(index); const control = this.addressForm.controls['additional_premises']; @@ -481,78 +433,9 @@ export class AddressComponent implements OnInit { let z = this.z; this.PremisesLabel[z-1] = this.addressForm.get('bussiness_address_type_others').value; } -// checkaddress(value) -// { -// // console.log(value); -// if(value=="OTHERS") -// { -// this.addressRemarksAccess = true; -// }else -// { -// this.addressRemarksAccess = false; -// } -// } - - - // SelectedPremises($event){ - // console.log('event',$event); - - // let premisesData = $event.source.value; - - - // if($event.source._selected === true ){ - - // //this.formPremisesArray.push({member: $event.source.value}); - // //this.selectedSegmentDatas.push(CustomerSegmentName.name); - // //console.log('true',premisesData); - - // //console.log(this.formPremisesArray); - - // this.formPremisesArray.push({premises_types: $event.source.value}); - - // //console.log(this.formPremisesArray); - - // let array = this.addressData.filter(data => data.address_type_id == premisesData); - - // if(premisesData == 12){ - // this.PremisesOtherFlag = true; - // this.PremisesLabel[this.z] = this.addressForm.get('bussiness_address_type_others').value; - // } - // else{ - // this.PremisesLabel[this.z] = array[0].address_type; - // } - // this.z++; - - - // const control = this.addressForm.controls['additional_premises']; - // control.push(this.createPremises()); - - - - // } - // else if($event.source._selected === false ){ - - // console.log('false',premisesData); - - - // if(premisesData == 12){ - // this.PremisesOtherFlag = false; - // } - - // const control = this.addressForm.controls['additional_premises']; - // control.removeAt(this.z); - // this.z--; - // //let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name); - // //this.selectedSegmentDatas.splice(index,1); - // } - - // } selectedValue(e,data) { - // console.log('501 function',); - // console.log('inside function in bussiness_address_type,',e); - // console.log('inside function in this.additional_premises,',data); let premisesData = e ; this.tempArr = []; @@ -562,12 +445,12 @@ export class AddressComponent implements OnInit { that.addressData[key].status = 0; return that.addressData[key]; }) - //console.log(this.addressData); + premisesData.forEach((val,index)=> { - //console.log(val); + this.z++; - // console.log(this.addressTypes); + this.formPremisesArray.push({premises_types: val}); this.tempArr.push(this.addressData.filter(add=>add.address_type_id==val)[0]); @@ -579,6 +462,7 @@ export class AddressComponent implements OnInit { { return data[index].premises_city[key].additional_premises_city; }); + //data[index].premises_city = data[index].premises_city.additional_premises_city; } this.addressData.forEach(data=> { @@ -621,7 +505,5 @@ export class AddressComponent implements OnInit { this.addressForm.controls.business_years.setValue(+business_year + +Math.floor(converted_year)); this.addressForm.controls.business_month.setValue(Math.floor(converted_month)); - - } -} +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index 1ba1c7b45..293bf0249 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -17,7 +17,9 @@
Raw Material #{{l+1}}
+ + {{ pm.name }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts index 1da10a7a3..913f9c583 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts @@ -168,31 +168,36 @@ export class ClientInfoComponent implements OnInit { // Load form details for manufacturing let arr = record.filter(data => data.type_of_activity_id == 1); if (arr.length > 0) { - let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) { - return dataForm.main_raw_materials[key]; - }); + // let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) { + // return dataForm.main_raw_materials[key]; + // }); + let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials; + this.initManufacturingProductsDetails(api_main_raw_materials); - this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.main_raw_materials_total_payments_percent_on_credit || null); + this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null); } // Load form details for the wholeshale trading details let arr1 = record.filter(data => data.type_of_activity_id == 3); if (arr1.length > 0) { - let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) { - return dataForm.trading_products[key]; - }); + // let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) { + // return dataForm.trading_products[key]; + // }); + let api_trading_products = dataForm.trade_details[0].trading_products; + this.initTradingProductsDetails(api_trading_products); - this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null); + this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null); } // Load form details for the service provider prduct details let arr2 = record.filter(data => data.type_of_activity_id == 4); if (arr2.length > 0) { - let api_service_provider_products = Object.keys(dataForm.service_products).map(function (key) { - return dataForm.service_products[key]; - }); + // let api_service_provider_products = Object.keys(dataForm.service_products).map(function (key) { + // return dataForm.service_products[key]; + // }); + let api_service_provider_products = dataForm.service_provider_details[0].service_products; this.initServiceProviderProductsDetails(api_service_provider_products); - this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_products_total_payments_percent_on_credit || null); + this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null); } // Load form details for the retail trading details let arr3 = record.filter(data => data.type_of_activity_id == 2); @@ -218,7 +223,7 @@ export class ClientInfoComponent implements OnInit { let arr1 = record.filter(data => data.type_of_activity_id == 3); if (arr1.length > 0) { this.initTradingProductsDetails(null); - this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null); + this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null); } let arr2 = record.filter(data => data.type_of_activity_id == 4); if (arr2.length > 0) { @@ -226,7 +231,7 @@ export class ClientInfoComponent implements OnInit { return dataForm.service_products[key]; }); this.initServiceProviderProductsDetails(api_service_provider_products); - this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_products_total_payments_percent_on_credit || null); + this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(null); } // Load form details for the retail trading details let arr3 = record.filter(data => data.type_of_activity_id == 2); @@ -340,7 +345,7 @@ export class ClientInfoComponent implements OnInit { }) } else { return this._formBuilder.group({ - manufacturing_product_name: [records.manufacturing_raw_material_name || null], + manufacturing_product_name: [records.manufacturing_product_name || null], manufacturing_client_name: [records.manufacturing_client_name || null], manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null], manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null], diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html index fd5cf4390..a2ba31c75 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html @@ -90,6 +90,10 @@ {{"₹"}} {{topUpAmtInWords}} Only + + + +
@@ -97,29 +101,41 @@ {{"₹"}} {{ownContributionInWords}} Only - + - + {{ sour.name }} + - - - - - - + + + + + + -->
- - + + + {{"₹"}} {{emiAmtInWords}} Only @@ -165,7 +181,7 @@ - {{ status.name }} {{status.id}} + {{ status.name }} @@ -183,7 +199,8 @@ + formControlName="emv_per_customer" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" required autocomplete="off"> + {{"₹"}} {{emvAmtInWords}} Only -
- - - - -
-
- - -

Manufacturing Details

-
-
-
-
-
-

{{a+1}} . Raw Material

- - - - - - - Yes - No - - - - - - - - - {{uom.name}} - - - - - - - - {{"₹"}} {{M_rawValueInWords}} Only - - - - - - - Yes - No - - - - Please comment on the stock level observed? - - - - - - -
-
- -
-
-

{{b+1}} Finished Goods

- - - - - - - Yes - No - - - - - - - - - {{"₹"}} {{M_goodsValueInWords}} Only - - - - - - - Yes - No - - - - Please comment on the finished goods stock level observed? - - - - - - - -
-
- -
-
-

{{c+1}} Traded Goods

- - - - - - - Yes - No - - - - - - - - - {{"₹"}} {{M_tradedGoodsValueInWords}} Only - - - - - - - - Yes - No - - - - Please comment on the Traded Goods stock level observed? - - - - - - - -
-
-
+ + + + + + +
+
+ + +

Manufacturing Details

+
+
+
+
+
+

{{a+1}} . Raw Material

+ + + + + + + Yes + No + + + + + + + + + {{uom.name}} + + + + + + + + {{"₹"}} {{M_rawValueInWords}} Only + + + + + + + Yes + No + + + + Please comment on the stock level observed? + + + + + +
- - - - -

Retail Details

-
- -
-
- -
-
-

{{d+1}} Finished Goods

- - - - - - - Yes - No - - - - - - - - - {{"₹"}} {{R_goodsValueInWords}} Only - - - - - - - - Yes - No - - - - Please comment on the finished goods stock level observed? - - - - - - - -
-
+
-
-
-

{{e+1}} Traded Goods

- - - - - - - Yes - No - - - - - - - - - {{"₹"}} {{R_tradedGoodsValueInWords}} Only - - - - - - - - Yes - No - - - - Please comment on the Traded Goods stock level observed? - - - +
+
+

{{b+1}} Finished Goods

+ + + + + + + Yes + No + + + + + + + + + {{"₹"}} {{M_goodsValueInWords}} Only + + + + + + + Yes + No + + + + Please comment on the finished goods stock level observed? + + + - + + +
+
+ +
+
+

{{c+1}} Traded Goods

+ + + + + + + Yes + No + + + + + + + + + {{"₹"}} {{M_tradedGoodsValueInWords}} Only + + + + + + + + Yes + No + + + + Please comment on the Traded Goods stock level observed? + + + + + - + - - -
-
-
+ +
- - - - - -

Trading Details

-
- -
-
-
-
-

{{f+1}} Finished Goods

- - - - - - - Yes - No - - - - - - - - - {{"₹"}} {{T_goodsValueInWords}} Only - - - - - - - - Yes - No - - - - Please comment on the finished goods stock level observed? - - - - - - - - -
-
- -
-
-

{{g+1}} Traded Goods

- - - - - - - Yes - No - - - - - - - - - {{"₹"}} {{T_tradedGoodsValueInWords}} Only - - - - - - - - Yes - No - - - - Please comment on the Traded Goods stock level observed? - - - - - - - - -
-
-
-
- -
- - - -

Service Provider

-
-
Service Provider Details Not applicable here !!
-
- -
-
- - - - - - -
- - - - - +
+
+ + + +

Retail Details

+
+ +
+
+ +
+
+

{{d+1}} Finished Goods

+ + + + + + + Yes + No + + + + + + + + + {{"₹"}} {{R_goodsValueInWords}} Only + + + + + + + + Yes + No + + + + Please comment on the finished goods stock level observed? + + + + + + + +
+
- -
- - Remarks - - +
+
+

{{e+1}} Traded Goods

+ + + + + + + Yes + No + + + + + + + + + {{"₹"}} {{R_tradedGoodsValueInWords}} Only + + + + + + + + Yes + No + + + + Please comment on the Traded Goods stock level observed? + + + + + + + + +
+
+
+
+ + + + + +

Trading Details

+
+ +
+
+
+
+

{{f+1}} Finished Goods

+ + + + + + + Yes + No + + + + + + + + + {{"₹"}} {{T_goodsValueInWords}} Only + + + + + + + + Yes + No + + + + Please comment on the finished goods stock level observed? + + + + + + + + +
+
+ +
+
+

{{g+1}} Traded Goods

+ + + + + + + Yes + No + + + + + + + + + {{"₹"}} {{T_tradedGoodsValueInWords}} Only + + + + + + + + Yes + No + + + + Please comment on the Traded Goods stock level observed? + + + + + + + + +
+
+
+
+ +
+ + + +

Service Provider

+
+
Service Provider Details Not applicable here !!
+
+
-
- -
- - - +
+ + + + + + + + + + + + + +
+ + Remarks + + +
+
+ +
+
+ +
@@ -532,6 +532,6 @@

Stock Details

--> - \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts index d220137bd..e6660afc0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts @@ -1,240 +1,126 @@ -import { - Component, - OnInit, - Inject, - Input -} from '@angular/core'; +import { Component,OnInit,Inject,Input } from '@angular/core'; -import { - FormBuilder, - FormGroup, - Validators, - FormArray, FormControl, -} from '@angular/forms'; +import { FormBuilder,FormGroup,Validators,FormArray, FormControl } from '@angular/forms'; import { NotifierService } from 'angular-notifier'; -import { - MatDialog, - MatDialogRef, - MAT_DIALOG_DATA -} from '@angular/material'; +import { MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material'; + /** Service */ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; -import {ActivatedRoute, Router} from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { analyzeAndValidateNgModules } from '@angular/compiler'; @Component({ - selector: 'app-stock', - templateUrl: './stock.component.html', - styleUrls: ['./stock.component.scss'] + selector: 'app-stock', + templateUrl: './stock.component.html', + styleUrls: ['./stock.component.scss'] }) + export class StockComponent implements OnInit { - // @Input() pdid: number; - // @Input() form_id: number; - pageTitle: string ="Stock Details"; - pdid: number; - form_id: number; - public stockForms: FormGroup; - private notifier: NotifierService; - public uomData : any = []; - - rawmaterial : any; - - M_rawValueInWords : any; - M_goodsValueInWords : any; - R_goodsValueInWords : any; - T_goodsValueInWords : any; - - M_tradedGoodsValueInWords : any; - R_tradedGoodsValueInWords : any; - T_tradedGoodsValueInWords : any; - - rawMaterialAccess: boolean; - finishedGoodsAccess: boolean; - tradeConcernAccess: boolean; - public submitted = false; - noRecordsFound: Boolean = false; - serviceProviderForm: Boolean = false; + pageTitle: string ="Stock Details"; + pdid: number; + form_id: number; + public stockForms: FormGroup; + private notifier: NotifierService; + public uomData : any = []; + + rawmaterial : any; + + M_rawValueInWords : any; - constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, - private router: Router, - private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { - this.pdid = this.pd_all_details.pdmaster_details.pd_id; - this.form_id = 11; - this.notifier = notifier; - } - public viewerOptions: any = { - navbar: false, - toolbar: { - zoomIn: 4, - zoomOut: 4, - oneToOne: 4, - reset: 4, - prev: 4, - play: { - show: 4, - size: 'large', - }, - next: 4, - rotateLeft: 4, - rotateRight: 4, - flipHorizontal: 4, - flipVertical: 4, + M_goodsValueInWords : any; + R_goodsValueInWords : any; + T_goodsValueInWords : any; + + M_tradedGoodsValueInWords : any; + R_tradedGoodsValueInWords : any; + T_tradedGoodsValueInWords : any; + + rawMaterialAccess: boolean; + finishedGoodsAccess: boolean; + tradeConcernAccess: boolean; + public submitted = false; + noRecordsFound: Boolean = false; + serviceProviderForm: Boolean = false; + + constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, + private router: Router, + private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { + this.pdid = this.pd_all_details.pdmaster_details.pd_id; + this.form_id = 11; + this.notifier = notifier; } -}; - ngOnInit() { + public viewerOptions: any = { + navbar: false, + toolbar: { + zoomIn: 4, + zoomOut: 4, + oneToOne: 4, + reset: 4, + prev: 4, + play: { + show: 4, + size: 'large', + }, + next: 4, + rotateLeft: 4, + rotateRight: 4, + flipHorizontal: 4, + flipVertical: 4, + } + }; + ngOnInit() { - // this._pd.stockFormsAccess({pd_id:this.pdid}).subscribe(data => { - // if(data.status == 200){ - // this.initstockForms(data.record.type_of_activity); - // } - // }, err => { - // this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!'); - // }) + // this._pd.stockFormsAccess({pd_id:this.pdid}).subscribe(data => { + // if(data.status == 200){ + // this.initstockForms(data.record.type_of_activity); + // } + // }, err => { + // this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!'); + // }) - //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe( - this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => { + //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe( + this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => { - if(data.dataStatus == true){ - let datas = data.records; - if(datas.type_of_activity != undefined){ - this.initstockForms(datas.type_of_activity) - } - else{ - this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!'); - } - }else if(data.dataStatus == false) - { - this.notifier.notify('warning', data.msg); - return; - } - else{ - return; - } - }, err => { - this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!'); - this.noRecordsFound = false; - }) + if(data.dataStatus == true){ + let datas = data.records; + if(datas.type_of_activity != undefined){ + this.initstockForms(datas.type_of_activity) + } + else{ + this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!'); + } + }else if(data.dataStatus == false) + { + this.notifier.notify('warning', data.msg); + return; + } + else{ + return; + } + }, err => { + this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!'); + this.noRecordsFound = false; + }) - this.getUOM(); - } + this.getUOM(); + } - public initstockForms(record){ -console.log(record); - let params: any = {}; - params.pd_id = this.pdid; - params.pd_form_id = this.form_id; + public initstockForms(record){ + console.log(record); + let params: any = {}; + params.pd_id = this.pdid; + params.pd_form_id = this.form_id; + + this._pd.retriveForm(params).subscribe(value => { + if (value.status == 200) { + let dataForm = value.records; - this._pd.retriveForm(params).subscribe(value => { - if (value.status == 200) { - let dataForm = value.records; - - if(dataForm !== undefined) { - - this.stockForms = this.fb.group({ - pdid: [this.pdid], - formid: [this.form_id], - stock_remarks: [''], - manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), - retail_details : this.fb.array([this.retailFormCreation(record)]), - trade_details: this.fb.array([this.tradingFormCreation(record)]), - }); - - let arr0 = Object.keys(record).map(function (key) { - return record[key]; - }); - let arr = record.filter(data => data.type_of_activity_id == 1); - if(arr.length > 0) { - let retail_finished_goods; - let manufacturing_raw_materials; - let manufacturing_finished_goods; - let manufacturing_traded_goods; - if(dataForm.manufacturing_raw_materials !==undefined){ - manufacturing_raw_materials = Object.keys(dataForm.manufacturing_raw_materials).map(function (key) { - return dataForm.manufacturing_raw_materials[key]; - }); - } - if(dataForm.manufacturing_finished_goods !==undefined){ - manufacturing_finished_goods = Object.keys(dataForm.manufacturing_finished_goods).map(function (key) { - return dataForm.manufacturing_finished_goods[key]; - }); - } - if(dataForm.manufacturing_traded_goods !==undefined){ - manufacturing_traded_goods = Object.keys(dataForm.manufacturing_traded_goods).map(function (key) { - return dataForm.manufacturing_traded_goods[key]; - }); - } - if(dataForm.retail_finished_goods !==undefined) - { - retail_finished_goods = Object.keys(dataForm.retail_finished_goods).map(function(key) - { - return dataForm.retail_finished_goods[key]; - }) - } - //console.log(retail_finished_goods,manufacturing_traded_goods); - let manufacturing_temparr = []; - manufacturing_temparr['manufacturing_traded_goods'] = manufacturing_traded_goods;manufacturing_temparr['manufacturing_finished_goods'] = manufacturing_finished_goods;manufacturing_temparr['manufacturing_raw_materials'] = manufacturing_raw_materials; - this.initManufacturingDetails(manufacturing_temparr); - } - let arr1 = record.filter(data => data.type_of_activity_id == 2); - if(arr1.length > 0) { - let retail_finished_goods; - let retail_traded_goods; - - - if(dataForm.retail_traded_goods !==undefined){ - retail_traded_goods = Object.keys(dataForm.retail_traded_goods).map(function (key) { - return dataForm.retail_traded_goods[key]; - }); - } - if(dataForm.retail_finished_goods !==undefined) - { - retail_finished_goods = Object.keys(dataForm.retail_finished_goods).map(function(key) - { - return dataForm.retail_finished_goods[key]; - }) - } - - let retail_temparr = []; - retail_temparr['retail_traded_goods'] = retail_traded_goods; - retail_temparr['retail_finished_goods'] = retail_finished_goods; - this.initRetailDetails(retail_temparr); - } - let arr2 = record.filter(data => data.type_of_activity_id == 3); - if(arr2.length > 0) { - let trading_finished_goods; - let trading_traded_goods; - - if(dataForm.trading_finished_goods !==undefined){ - - trading_finished_goods = Object.keys(dataForm.trading_finished_goods).map(function (key) { - return dataForm.trading_finished_goods[key]; - }); - } - if(dataForm.trading_traded_goods !==undefined) - { - trading_traded_goods = Object.keys(dataForm.trading_traded_goods).map(function(key) - { - return dataForm.trading_traded_goods[key]; - }) - } - - let trading_temparr = []; - trading_temparr['trading_finished_goods'] = trading_finished_goods; - trading_temparr['trading_traded_goods'] = trading_traded_goods; - this.initTradingDetails(trading_temparr); - } - let arr3 = record.filter(data => data.type_of_activity_id == 4); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; - } - else{ - // console.log('dataForm',dataForm); + if(dataForm !== undefined) { + console.log(dataForm); this.stockForms = this.fb.group({ pdid: [this.pdid], formid: [this.form_id], @@ -243,567 +129,736 @@ console.log(record); retail_details : this.fb.array([this.retailFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]), }); - let arr = record.filter(data => data.type_of_activity_id == 1); - if(arr.length > 0) { - this.initManufacturingDetails(null); - } - let arr1 = record.filter(data => data.type_of_activity_id == 2); - if(arr1.length > 0) { - this.initRetailDetails(null); - } - let arr2 = record.filter(data => data.type_of_activity_id == 3); - if(arr2.length > 0) { - this.initTradingDetails(null); - } - let arr3 = record.filter(data => data.type_of_activity_id == 4); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; - } - } - else { - this.stockForms = this.fb.group({ - pdid: [this.pdid], - formid: [this.form_id], - stock_remarks: [''], - manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), - retail_details : this.fb.array([this.retailFormCreation(record)]), - trade_details: this.fb.array([this.tradingFormCreation(record)]), - }); - let arr = record.filter(data => data.type_of_activity_id == 1); - if(arr.length > 0) { - this.initManufacturingDetails(null); - } - let arr1 = record.filter(data => data.type_of_activity_id == 2); - if(arr1.length > 0) { - this.initRetailDetails(null); - } - let arr2 = record.filter(data => data.type_of_activity_id == 3); - if(arr2.length > 0) { - this.initTradingDetails(null); - } - let arr3 = record.filter(data => data.type_of_activity_id == 4); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; - } - }) - - // this.stockForms = this.fb.group({ - // stock_remarks: ['', Validators.compose([Validators.required])], - // raw_materials: this.fb.array([]), - // finished_goods: this.fb.array([]), - // traded_goods: this.fb.array([]) - // }); - } - - manufacturingForm: Boolean = false; - manufacturingFormCreation(record) { - console.log(record); - let arr = record.filter(data => data.type_of_activity_id == 1); - console.log(arr); - if (arr.length > 0) { - console.log(arr.length); - this.manufacturingForm = true; - return this.fb.group({ - manufacturing_raw_materials: this.fb.array([]), - manufacturing_finished_goods: this.fb.array([]), - manufacturing_traded_goods: this.fb.array([]) - }) - // } - } else { - return; - } - } - - retailForm: Boolean = false; - retailFormCreation(val) { - - let arr = val.filter(data => data.type_of_activity_id == 2); - if (arr.length > 0) { - this.retailForm = true; - return this.fb.group({ - retail_finished_goods: this.fb.array([]), - retail_traded_goods: this.fb.array([]) - }) - // } - } else { - return; - } - } - - tradingForm: Boolean = false; - tradingFormCreation(val) { - let arr = val.filter(data => data.type_of_activity_id == 3); - if (arr.length > 0) { - this.tradingForm = true; - return this.fb.group({ - trading_finished_goods: this.fb.array([]), - trading_traded_goods: this.fb.array([]) - }); - } else { - return; - } - } - - //setSku(sku: string, index: number) { - // const faControl = - // (this.stockForms.controls['raw_materials']).at(index); - // faControl['controls'].raw_name.setValue(sku); - // } - - initManufacturingDetails(datas) { - - const rawMaterial = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; - const finishedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; - const tradedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; - - if(datas === null){ - // console.log(299,'if'); - // rawMaterial.push(this.createRawmaterial(null)); - // finishedGoods.push(this.createGoods(null)); - // tradedGoods.push(this.createTradedGoods(null)); - - } else { - // console.log(305,'else') - for (let val of datas.manufacturing_raw_materials) { - // console.log(val); - if(val.raw_value){ - this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value); - } - rawMaterial.push(this.createRawmaterial(val)); - + let arr = record.filter(data => data.type_of_activity_id == 1); + console.log(133,arr.length); + if(arr.length > 0) { + // console.log(1,dataForm); + // console.log(164,dataForm.manufacturing_details); + // console.log(2,dataForm.retail_details); + // console.log(3,dataForm.retail_details[0]); + // console.log(4,dataForm.retail_details[0].retail_finished_goods); + // console.log(5,dataForm.retail_details[0].retail_traded_goods); + //let retail_finished_goods; + // let manufacturing_raw_materials; + // let manufacturing_finished_goods; + // let manufacturing_traded_goods; + // if(dataForm.manufacturing_raw_materials !==undefined){ + // manufacturing_raw_materials = Object.keys(dataForm.manufacturing_raw_materials).map(function (key) { + // return dataForm.manufacturing_raw_materials[key]; + // }); + // } + // if(dataForm.manufacturing_finished_goods !==undefined){ + // manufacturing_finished_goods = Object.keys(dataForm.manufacturing_finished_goods).map(function (key) { + // return dataForm.manufacturing_finished_goods[key]; + // }); + // } + // else{ + // manufacturing_finished_goods = null; + // } + // if(dataForm.manufacturing_traded_goods !==undefined){ + // manufacturing_traded_goods = Object.keys(dataForm.manufacturing_traded_goods).map(function (key) { + // return dataForm.manufacturing_traded_goods[key]; + // }); + // } + // else{ + // manufacturing_traded_goods = null; + // } + + //console.log(retail_finished_goods,manufacturing_traded_goods); + // console.log(163,dataForm.manufacturing_details.manufacturing_raw_materials); + // console.log(164,dataForm.manufacturing_details[0]); + // console.log(164,dataForm.manufacturing_details[0].manufacturing_raw_materials); + + let manufacturing_temparr = []; + + manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; + manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; + manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods; + + this.initManufacturingDetails(manufacturing_temparr); + //this.initManufacturingDetails(dataForm); + + } + + let arr1 = record.filter(data => data.type_of_activity_id == 2); + if(arr1.length > 0) { + // let retail_finished_goods; + // let retail_traded_goods; + + + // if(dataForm.retail_traded_goods !==undefined){ + // retail_traded_goods = Object.keys(dataForm.retail_traded_goods).map(function (key) { + // return dataForm.retail_traded_goods[key]; + // }); + // } + // else{ + // retail_traded_goods = null; + // } + // if(dataForm.retail_finished_goods !==undefined) + // { + // retail_finished_goods = Object.keys(dataForm.retail_finished_goods).map(function(key) + // { + // return dataForm.retail_finished_goods[key]; + // }) + // } + // else{ + // retail_finished_goods = null; + // } + // console.log(dataForm.retail_finished_goods); + // console.log(dataForm.retail_traded_goods); + + let retail_temparr = []; + retail_temparr['retail_traded_goods'] = dataForm.retail_details[0].retail_traded_goods; + retail_temparr['retail_finished_goods'] = dataForm.retail_details[0].retail_finished_goods; + this.initRetailDetails(retail_temparr); + //this.initRetailDetails(dataForm); + //this.initRetailDetails(null); + } + + let arr2 = record.filter(data => data.type_of_activity_id == 3); + if(arr2.length > 0) { + // let trading_finished_goods; + // let trading_traded_goods; + + // if(dataForm.trading_finished_goods !==undefined){ + + // trading_finished_goods = Object.keys(dataForm.trading_finished_goods).map(function (key) { + // return dataForm.trading_finished_goods[key]; + // }); + // } + // else{ + // trading_finished_goods = null; + // } + + + // if(dataForm.trading_traded_goods !==undefined) + // { + // trading_traded_goods = Object.keys(dataForm.trading_traded_goods).map(function(key) + // { + // return dataForm.trading_traded_goods[key]; + // }) + // } + + let trading_temparr = []; + trading_temparr['trading_finished_goods'] = dataForm.trade_details[0].trading_finished_goods; + trading_temparr['trading_traded_goods'] = dataForm.trade_details[0].trading_traded_goods; + //this.initTradingDetails(trading_temparr); + this.initTradingDetails(trading_temparr); + } + let arr3 = record.filter(data => data.type_of_activity_id == 4); + if(arr3.length > 0) { + this.serviceProviderForm = true; + } + this.noRecordsFound = true; + } + else{ + // console.log('dataForm',dataForm); + this.stockForms = this.fb.group({ + pdid: [this.pdid], + formid: [this.form_id], + stock_remarks: [''], + manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), + retail_details : this.fb.array([this.retailFormCreation(record)]), + trade_details: this.fb.array([this.tradingFormCreation(record)]), + }); + let arr = record.filter(data => data.type_of_activity_id == 1); + if(arr.length > 0) { + this.initManufacturingDetails(null); + } + let arr1 = record.filter(data => data.type_of_activity_id == 2); + if(arr1.length > 0) { + this.initRetailDetails(null); + } + let arr2 = record.filter(data => data.type_of_activity_id == 3); + if(arr2.length > 0) { + this.initTradingDetails(null); + } + let arr3 = record.filter(data => data.type_of_activity_id == 4); + if(arr3.length > 0) { + this.serviceProviderForm = true; + } + this.noRecordsFound = true; + } + } + else { + this.stockForms = this.fb.group({ + pdid: [this.pdid], + formid: [this.form_id], + stock_remarks: [''], + manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), + retail_details : this.fb.array([this.retailFormCreation(record)]), + trade_details: this.fb.array([this.tradingFormCreation(record)]), + }); + let arr = record.filter(data => data.type_of_activity_id == 1); + if(arr.length > 0) { + this.initManufacturingDetails(null); + } + let arr1 = record.filter(data => data.type_of_activity_id == 2); + if(arr1.length > 0) { + this.initRetailDetails(null); + } + let arr2 = record.filter(data => data.type_of_activity_id == 3); + if(arr2.length > 0) { + this.initTradingDetails(null); + } + let arr3 = record.filter(data => data.type_of_activity_id == 4); + if(arr3.length > 0) { + this.serviceProviderForm = true; + } + this.noRecordsFound = true; + } + }) + + // this.stockForms = this.fb.group({ + // stock_remarks: ['', Validators.compose([Validators.required])], + // raw_materials: this.fb.array([]), + // finished_goods: this.fb.array([]), + // traded_goods: this.fb.array([]) + // }); + } + + manufacturingForm: Boolean = false; + manufacturingFormCreation(record) { + console.log(record); + let arr = record.filter(data => data.type_of_activity_id == 1); + console.log(arr); + if (arr.length > 0) { + console.log(arr.length); + this.manufacturingForm = true; + return this.fb.group({ + manufacturing_raw_materials: this.fb.array([]), + manufacturing_finished_goods: this.fb.array([]), + manufacturing_traded_goods: this.fb.array([]) + }) + // } + } else { + return; + } +} + +retailForm: Boolean = false; +retailFormCreation(val) { + + let arr = val.filter(data => data.type_of_activity_id == 2); + if (arr.length > 0) { + this.retailForm = true; + return this.fb.group({ + retail_finished_goods: this.fb.array([]), + retail_traded_goods: this.fb.array([]) + }) + // } + } else { + return; + } +} + +tradingForm: Boolean = false; +tradingFormCreation(val) { + let arr = val.filter(data => data.type_of_activity_id == 3); + if (arr.length > 0) { + this.tradingForm = true; + return this.fb.group({ + trading_finished_goods: this.fb.array([]), + trading_traded_goods: this.fb.array([]) + }); + } else { + return; + } +} + + //setSku(sku: string, index: number) { + // const faControl = + // (this.stockForms.controls['raw_materials']).at(index); + // faControl['controls'].raw_name.setValue(sku); + // } + + initManufacturingDetails(datas) { + + const rawMaterial = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; + const finishedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; + const tradedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; + + if(datas === null){ + // console.log(299,'if'); + rawMaterial.push(this.createRawmaterial(null)); + finishedGoods.push(this.createGoods(null)); + tradedGoods.push(this.createTradedGoods(null)); + + } else { + // console.log(305,'else') + // console.log(377,datas); + // console.log(datas.manufacturing_raw_materials); + if(datas.manufacturing_raw_materials != undefined){ + for (let val of datas.manufacturing_raw_materials) { + // console.log(val); + if(val.raw_value){ + this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value); + } + rawMaterial.push(this.createRawmaterial(val)); + } + } + else{ + rawMaterial.push(this.createRawmaterial(null)); + } + if(datas.manufacturing_finished_goods != undefined){ + for (let val of datas.manufacturing_finished_goods) { + // console.log(val); + if(val.goods_value){ + this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); } - for (let val of datas.manufacturing_finished_goods) { - // console.log(val); - if(val.goods_value){ - this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); - } - finishedGoods.push(this.createGoods(val)); - - } - for (let val of datas.manufacturing_traded_goods) { - // console.log(val); - if(val.estimated_traded_goods_value){ - this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); - } - tradedGoods.push(this.createTradedGoods(val)); - - } - // console.log(310,rawMaterial); - } + finishedGoods.push(this.createGoods(val)); + + } + } + else{ + finishedGoods.push(this.createGoods(null)); + } + if(datas.manufacturing_traded_goods !== undefined){ + for (let val of datas.manufacturing_traded_goods) { + // console.log(val); + if(val.estimated_traded_goods_value){ + this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + } + tradedGoods.push(this.createTradedGoods(val)); + + } + } + else{ + tradedGoods.push(this.createTradedGoods(null)); + } + // console.log(310,rawMaterial); + } + } + + createRawmaterial2() { + return this.fb.group({ + raw_name: ['', Validators.compose([Validators.required])], + stock_observed:['', Validators.compose([Validators.required])], + raw_quantity: [''], + raw_uom: [''], + other_uom : [''], + raw_value: [''], + rawmaterial_value: [''], + is_sufficiant_raw: [''], + rawmaterial_remarks:[''] + }); + } + + + createRawmaterial(records) { + // console.log(330,'function in'); + if(records === null) { + // console.log(331,'fif'); + return this.fb.group({ + raw_name: [''], + stock_observed:[''], + raw_quantity: [''], + raw_uom: [''], + other_uom : [''], + raw_value: [''], + rawmaterial_value: [''], + is_sufficiant_raw: [''], + rawmaterial_remarks:[''] + }) + } else { + // console.log(343,'else'); + return this.fb.group({ + manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null], + raw_name: [records.raw_name], + stock_observed:[records.stock_observed], + raw_quantity: [records.raw_quantity], + raw_uom: [records.raw_uom], + other_uom : [records.other_uom], + raw_value: [records.raw_value], + rawmaterial_value: [records.rawmaterial_value], + is_sufficiant_raw: [records.is_sufficiant_raw], + rawmaterial_remarks:[records.rawmaterial_remarks] + }) + } } - createRawmaterial2() { - return this.fb.group({ - raw_name: ['', Validators.compose([Validators.required])], - stock_observed:['', Validators.compose([Validators.required])], - raw_quantity: [''], - raw_uom: [''], - other_uom : [''], - raw_value: [''], - rawmaterial_value: [''], - is_sufficiant_raw: [''], - rawmaterial_remarks:[''] - }); - } + initRetailDetails(datas) { + + const finishedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; + const tradedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; + + if(datas === null){ + finishedGoods.push(this.createGoods(null)); + tradedGoods.push(this.createTradedGoods(null)); - createRawmaterial(records) { - // console.log(330,'function in'); - if(records === null) { - // console.log(331,'fif'); + } else { + //console.log(479,datas.retail_finished_goods); + if(datas.retail_finished_goods != undefined){ + for (let val of datas.retail_finished_goods) { + // console.log(val); + + if(val.goods_value){ + this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + } + finishedGoods.push(this.createGoods(val)); + + } + } + else{ + finishedGoods.push(this.createGoods(null)); + } + + //console.log(495,datas.retail_traded_goods); + if(datas.retail_traded_goods !== undefined){ + for (let val of datas.retail_traded_goods) { + // console.log(val); + if(val.estimated_traded_goods_value){ + this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + } + tradedGoods.push(this.createTradedGoods(val)); + + } + } + else{ + tradedGoods.push(this.createTradedGoods(null)); + } + } + } + + createGoods2() { + return this.fb.group({ + goods_name: ['', Validators.compose([Validators.required])], + goods_observed: ['', Validators.compose([Validators.required])], + goods_quantity: [''], + goods_value: [''], + finished_goods_value: [''], + is_sufficiant_goods: [''], + finishedgoods_remarks:[''] + }); + } + + createGoods(records) { + if(records === null) { return this.fb.group({ - raw_name: [''], - stock_observed:[''], - raw_quantity: [''], - raw_uom: [''], - other_uom : [''], - raw_value: [''], - rawmaterial_value: [''], - is_sufficiant_raw: [''], - rawmaterial_remarks:[''] - }) - } else { - // console.log(343,'else'); - return this.fb.group({ - manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null], - raw_name: [records.raw_name], - stock_observed:[records.stock_observed], - raw_quantity: [records.raw_quantity], - raw_uom: [records.raw_uom], - other_uom : [records.other_uom], - raw_value: [records.raw_value], - rawmaterial_value: [records.rawmaterial_value], - is_sufficiant_raw: [records.is_sufficiant_raw], - rawmaterial_remarks:[records.rawmaterial_remarks] - }) + goods_name: [''], + goods_observed: [''], + goods_quantity: [''], + goods_value: [''], + finished_goods_value: [''], + is_sufficiant_goods: [''], + finishedgoods_remarks:[''] + }); + } + else { + return this.fb.group({ + goods_name: [records.goods_name], + goods_observed: [records.goods_observed], + goods_quantity: [records.goods_quantity], + goods_value: [records.goods_value], + finished_goods_value: [records.finished_goods_value], + is_sufficiant_goods: [records.is_sufficiant_goods], + finishedgoods_remarks:[records.finishedgoods_remarks] + }) + } + } + + + createTradedGoods2() { + return this.fb.group({ + traded_goods_name: ['', Validators.compose([Validators.required])], + traded_goods_observed: ['', Validators.compose([Validators.required])], + traded_goods_quantity: [''], + estimated_traded_goods_value: [''], + traded_goods_value: [''], + is_sufficiant_traded_goods: [''], + traded_goods_remarks:[''] + }); + } + + initTradingDetails(datas) { + + const finishedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; + const tradedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; + + if(datas === null){ + + finishedGoods.push(this.createGoods(null)); + tradedGoods.push(this.createTradedGoods(null)); + + } else { + // for (let val of datas) { + + // finishedGoods.push(this.createGoods(val.trading_finished_goods)); + // tradedGoods.push(this.createTradedGoods(val.trading_traded_goods)); + + // } + if(datas.trading_finished_goods !==undefined) + { + for (let val of datas.trading_finished_goods) { + // console.log(val); + if(val.goods_value){ + this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + } + finishedGoods.push(this.createGoods(val)); + + } + } + else{ + finishedGoods.push(this.createGoods(null)); + } + if(datas.trading_traded_goods !==undefined) + { + for (let val of datas.trading_traded_goods) { + // console.log(val); + if(val.estimated_traded_goods_value){ + this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + } + tradedGoods.push(this.createTradedGoods(val)); + } + } + else{ + tradedGoods.push(this.createTradedGoods(null)); + } + + } + } + + + createTradedGoods(records) { + if(records === null) { + return this.fb.group({ + traded_goods_name: [''], + traded_goods_observed: [''], + traded_goods_quantity: [''], + estimated_traded_goods_value: [''], + traded_goods_value: [''], + is_sufficiant_traded_goods: [''], + traded_goods_remarks:[''] + }); + } + else { + return this.fb.group({ + traded_goods_name: [records.traded_goods_name], + traded_goods_observed: [records.traded_goods_observed], + traded_goods_quantity: [records.traded_goods_quantity], + estimated_traded_goods_value: [records.estimated_traded_goods_value], + traded_goods_value: [records.traded_goods_value], + is_sufficiant_traded_goods: [records.is_sufficiant_traded_goods], + traded_goods_remarks:[records.traded_goods_remarks] + }) + } + } + + addRawMaterials(flag) { + + if(flag==1){ + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; + control.push(this.createRawmaterial(null)); + } + } + + + deleteRawMaterials(index,flag) { + if(flag==1){ + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; + // const control = this.stockForms.controls['raw_materials']; + control.removeAt(index); + } + } + + addGoods(flag) { + //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; + //const control = this.stockForms.controls['finished_goods']; + //control.push(this.createGoods(null)); + switch(flag){ + case 1: { + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; + control.push(this.createGoods(null)); + break; + } + case 2: { + const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; + control.push(this.createGoods(null)); + break; + } + case 3: { + const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; + control.push(this.createGoods(null)); + break; + } + default: { + break; } } - - initRetailDetails(datas) { - - const finishedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; - const tradedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; - - if(datas === null){ - - finishedGoods.push(this.createGoods(null)); - tradedGoods.push(this.createTradedGoods(null)); - - } else { - - for (let val of datas.retail_finished_goods) { - // console.log(val); - - if(val.goods_value){ - this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); - } - finishedGoods.push(this.createGoods(val)); - - } - for (let val of datas.retail_traded_goods) { - // console.log(val); - if(val.estimated_traded_goods_value){ - this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); - } - tradedGoods.push(this.createTradedGoods(val)); - - } - } - } - - createGoods2() { - return this.fb.group({ - goods_name: ['', Validators.compose([Validators.required])], - goods_observed: ['', Validators.compose([Validators.required])], - goods_quantity: [''], - goods_value: [''], - finished_goods_value: [''], - is_sufficiant_goods: [''], - finishedgoods_remarks:[''] - }); - } - - createGoods(records) { - if(records === null) { - return this.fb.group({ - goods_name: [''], - goods_observed: [''], - goods_quantity: [''], - goods_value: [''], - finished_goods_value: [''], - is_sufficiant_goods: [''], - finishedgoods_remarks:[''] - }); - } - else { - return this.fb.group({ - goods_name: [records.goods_name], - goods_observed: [records.goods_observed], - goods_quantity: [records.goods_quantity], - goods_value: [records.goods_value], - finished_goods_value: [records.finished_goods_value], - is_sufficiant_goods: [records.is_sufficiant_goods], - finishedgoods_remarks:[records.finishedgoods_remarks] - }) - } - } - - - createTradedGoods2() { - return this.fb.group({ - traded_goods_name: ['', Validators.compose([Validators.required])], - traded_goods_observed: ['', Validators.compose([Validators.required])], - traded_goods_quantity: [''], - estimated_traded_goods_value: [''], - traded_goods_value: [''], - is_sufficiant_traded_goods: [''], - traded_goods_remarks:[''] - }); - } - - initTradingDetails(datas) { - - const finishedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - const tradedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; - - if(datas === null){ - - finishedGoods.push(this.createGoods(null)); - tradedGoods.push(this.createTradedGoods(null)); - - } else { - // for (let val of datas) { - - // finishedGoods.push(this.createGoods(val.trading_finished_goods)); - // tradedGoods.push(this.createTradedGoods(val.trading_traded_goods)); - - // } - - for (let val of datas.trading_finished_goods) { - // console.log(val); - if(val.goods_value){ - this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); - } - finishedGoods.push(this.createGoods(val)); - - } - for (let val of datas.trading_traded_goods) { - // console.log(val); - if(val.estimated_traded_goods_value){ - this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); - } - tradedGoods.push(this.createTradedGoods(val)); - - } - - } - } - - - createTradedGoods(records) { - if(records === null) { - return this.fb.group({ - traded_goods_name: [''], - traded_goods_observed: [''], - traded_goods_quantity: [''], - estimated_traded_goods_value: [''], - traded_goods_value: [''], - is_sufficiant_traded_goods: [''], - traded_goods_remarks:[''] - }); - } - else { - return this.fb.group({ - traded_goods_name: [records.traded_goods_name], - traded_goods_observed: [records.traded_goods_observed], - traded_goods_quantity: [records.traded_goods_quantity], - estimated_traded_goods_value: [records.estimated_traded_goods_value], - traded_goods_value: [records.traded_goods_value], - is_sufficiant_traded_goods: [records.is_sufficiant_traded_goods], - traded_goods_remarks:[records.traded_goods_remarks] - }) - } - } - - addRawMaterials(flag) { - - if(flag==1){ - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; - control.push(this.createRawmaterial(null)); - } - } - - - - deleteRawMaterials(index,flag) { - if(flag==1){ - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; - // const control = this.stockForms.controls['raw_materials']; + } + deleteGoods(index,flag) { + switch(flag){ + case 1: { + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; control.removeAt(index); + break; + } + case 2: { + const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; + control.removeAt(index); + break; } + case 3: { + const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; + control.removeAt(index); + break; + } + default: { + break; + } + } + //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; + //const control = this.stockForms.controls['finished_goods']; + } - addGoods(flag) { - //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; - //const control = this.stockForms.controls['finished_goods']; - //control.push(this.createGoods(null)); - switch(flag){ + addTradedGoods(flag) { + // const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; + // //const control = this.stockForms.controls['traded_goods']; + + // control.push(this.createTradedGoods(null)); + switch(flag){ case 1: { - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; - control.push(this.createGoods(null)); - break; + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; + control.push(this.createTradedGoods(null)); + break; } case 2: { - const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; - control.push(this.createGoods(null)); + const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; + control.push(this.createTradedGoods(null)); break; } case 3: { - const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - control.push(this.createGoods(null)); - break; + const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; + control.push(this.createTradedGoods(null)); + break; } default: { break; } } - } - deleteGoods(index,flag) { - switch(flag){ - case 1: { - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; - control.removeAt(index); - break; - } - case 2: { - const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; - control.removeAt(index); - break; - } - case 3: { - const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - control.removeAt(index); - break; - } - default: { - break; - } - - } - //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; - //const control = this.stockForms.controls['finished_goods']; - } - - addTradedGoods(flag) { - // const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - // //const control = this.stockForms.controls['traded_goods']; - - // control.push(this.createTradedGoods(null)); - switch(flag){ - case 1: { - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - control.push(this.createTradedGoods(null)); - break; - } - case 2: { - const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; - control.push(this.createTradedGoods(null)); - break; - } - case 3: { - const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; - control.push(this.createTradedGoods(null)); - break; - } - default: { - break; - } - } - } - deleteTradedGoods(index,flag) { - switch(flag){ - case 1: { - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - control.removeAt(index); - break; - } - case 2: { - const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; - control.removeAt(index); - break; - } - case 3: { - const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; - control.removeAt(index); - break; - } - default: { - break; - } - } - - //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - //const control = this.stockForms.controls['traded_goods']; - - } - - - /** To Save/Edited Popup Data */ - submitDetails(e) { - this.submitted = true; - // stop here if form is invalid - // if (this.stockForms.invalid) { - // return; - // } else { - var answerFormValues = this.stockForms.value; - - //To Remove The "Null" With Key also - Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); - - this._pd.savePDFormDetailsWithID(answerFormValues).subscribe( - dataresult => { - if (dataresult.status == 200) { - - this.notifier.notify('success', 'Record Saved Successfully.!'); - - } - else { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - - } - }, error => { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - - }); - - //} - } - - // validateAllFormFields(formGroup: FormGroup) { - // Object.keys(formGroup.controls).forEach(field => { - // const control = formGroup.get(field); - // if (control instanceof FormControl) { - // control.markAsTouched({onlySelf: true}); - // } else if (control instanceof FormGroup) { - // this.validateAllFormFields(control); - // } - // }); - // } - - getUOM() { - this._pd.getAllMasterDatas('UOM').subscribe(data => { - - data.records.forEach(val => { - if (val.isactive == 1) { - this.uomData.push(val); - } - }) - }); - } - - /** On Key Press Event For Numbers */ - keyPress(event: any) { - const pattern = /[0-9]/; - - let inputChar = String.fromCharCode(event.charCode); - if (event.keyCode != 8 && !pattern.test(inputChar)) { - event.preventDefault(); - } - } - - /** To Convert Amount into Words */ - inWords(e,flag:number){ - - switch(flag){ - case 1 : - this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value); - break; - case 2 : - this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); - break; - case 3 : - this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); - break; - case 4 : - this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); - break; - case 5 : - this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); - break; - case 6 : - this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); - break; - case 7 : - this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); - break; - default: - break; + } + deleteTradedGoods(index,flag) { + switch(flag){ + case 1: { + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; + control.removeAt(index); + break; } + case 2: { + const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; + control.removeAt(index); + break; + } + case 3: { + const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; + control.removeAt(index); + break; + } + default: { + break; + } } + + //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; + //const control = this.stockForms.controls['traded_goods']; + + } + + + /** To Save/Edited Popup Data */ + submitDetails(e) { + this.submitted = true; + // stop here if form is invalid + // if (this.stockForms.invalid) { + // return; + // } else { + var answerFormValues = this.stockForms.value; + + //To Remove The "Null" With Key also + Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); + + this._pd.savePDFormDetailsWithID(answerFormValues).subscribe( + dataresult => { + if (dataresult.status == 200) { + + this.notifier.notify('success', 'Record Saved Successfully.!'); + + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + }); + + //} + } + + // validateAllFormFields(formGroup: FormGroup) { + // Object.keys(formGroup.controls).forEach(field => { + // const control = formGroup.get(field); + // if (control instanceof FormControl) { + // control.markAsTouched({onlySelf: true}); + // } else if (control instanceof FormGroup) { + // this.validateAllFormFields(control); + // } + // }); + // } + + getUOM() { + this._pd.getAllMasterDatas('UOM').subscribe(data => { + + data.records.forEach(val => { + if (val.isactive == 1) { + this.uomData.push(val); + } + }) + }); + } + + /** On Key Press Event For Numbers */ + keyPress(event: any) { + const pattern = /[0-9]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } + + /** To Convert Amount into Words */ + inWords(e,flag:number){ + + switch(flag){ + case 1 : + this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 2 : + this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 3 : + this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 4 : + this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 5 : + this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 6 : + this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 7 : + this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + default: + break; + } + } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index 9dad4a868..4b328836f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -132,19 +132,22 @@ export class SupplierInfoComponent implements OnInit { }); let arr = record.filter(data => data.type_of_activity_id == 1); if(arr.length > 0) { - let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) { - return dataForm.main_raw_materials[key]; - }); + // let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) { + // return dataForm.main_raw_materials[key]; + // }); + let api_main_raw_materials = dataForm.manufacturing_details[0].main_raw_materials; + this.initManufacturingProductsDetails(api_main_raw_materials); - this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.main_raw_materials_total_payments_percent_on_credit || null); + this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null); } let arr1 = record.filter(data => data.type_of_activity_id == 2 || 3); if(arr1.length > 0) { - let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) { - return dataForm.trading_products[key]; - }); + // let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) { + // return dataForm.trading_products[key]; + // }); + let api_trading_products = dataForm.trade_details[0].trading_products; this.initTradingProductsDetails(api_trading_products); - this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null); + this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trade_details[0].trading_products_total_payments_percent_on_credit || null); } this.noRecordsFound = true; } else { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index 3df205ec8..2319f8db0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -19,7 +19,7 @@ mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)">question_answer - @@ -191,24 +191,35 @@
-
-
QC Remarks
+
QC Notes

- {{ pdMasterData[0].qc_remarks}}

-

- {{ pdMasterData[0]?.qc_feedback}}

-
-

- -

-
- + {{ pdMasterData[0]?.qc_remarks}}

+
+
+
+
QC Remarks
+
+
+
+ {{ pdMasterData[0]?.qc_rating}} +
+ +
+
+
+
+
+ {{ pdMasterData[0]?.qc_feedback}} +
+
diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 89b00f4b7..538825a01 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -1,15 +1,20 @@ /** Common Import Section */ -import {Injectable} from '@angular/core'; -import {Observable} from 'rxjs';//for Datatables -import {HttpClient, HttpParams} from '@angular/common/http'; -import {catchError, map} from 'rxjs/operators'; -import {of} from 'rxjs'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs';//for Datatables +import { HttpClient, HttpParams } from '@angular/common/http'; +import { catchError, map } from 'rxjs/operators'; +import { of } from 'rxjs'; /** Imported Service Files Are., */ -import {AwsService} from '../../AwsService/aws.service'; +import { AwsService } from '../../AwsService/aws.service'; /** Environment */ -import {environment} from 'environments/environment' +import { environment } from 'environments/environment' +import { RequestOptions } from "@angular/http"; +import { ResponseContentType } from "@angular/http"; +import { ResponseOptions } from "@angular/http"; +import { HttpResponse } from "@angular/common/http"; +import { tap } from "rxjs/internal/operators/tap"; const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' '); @@ -33,30 +38,30 @@ export class PdTrigerService { private apiUrl = environment.apiEndpoint; constructor(private _http: HttpClient, - private _aws: AwsService) { + private _aws: AwsService) { this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk' this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`; } // get add pd master details getAllMasterDatas(TableName: string): Observable { - return this._http.post(this.apiUrl + 'getListOfMaster', {"master_name": TableName}) + return this._http.post(this.apiUrl + 'getListOfMaster', { "master_name": TableName }) .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } saveForm(records: any): Observable { records.fk_createdby = this._aws.getlocale(); - let params = {records} + let params = { records } return this._http.post(this.apiUrl + 'savePDFormDetails', params) .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } retriveForm(params): Observable { return this._http.post(this.apiUrl + 'getPDFormDetails', params) .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } @@ -64,7 +69,7 @@ export class PdTrigerService { getProductsDetails(): Observable { return this._http.get(this.apiUrl + 'getListOfProducts') .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } @@ -72,7 +77,7 @@ export class PdTrigerService { getLenderDetails(): Observable { return this._http.get(this.apiUrl + 'getListOfLenders') .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } @@ -80,7 +85,7 @@ export class PdTrigerService { getCustomersDetails(): Observable { return this._http.get(this.apiUrl + 'getListOfCustomerSegments') .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } @@ -88,7 +93,7 @@ export class PdTrigerService { getPDAllocationDetails(): Observable { return this._http.get(this.apiUrl + 'getListOfPDAllocationTypes') .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } @@ -96,7 +101,7 @@ export class PdTrigerService { getStateCityDetails(): Observable { return this._http.get(this.apiUrl + 'getListOfStatesAndCities') .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } @@ -104,7 +109,7 @@ export class PdTrigerService { getPDTypeDetails(): Observable { return this._http.get(this.apiUrl + 'getListOfPDAllocationTypes') .pipe( - catchError(this.handleError('role', [])) + catchError(this.handleError('role', [])) ) } @@ -112,7 +117,7 @@ export class PdTrigerService { addPdDetails(pdForm: any): Observable { return this._http.post(this.apiUrl + "triggerNewPD", pdForm) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } @@ -120,17 +125,17 @@ export class PdTrigerService { getPdDetails(): Observable { return this._http.get(this.apiUrl + "listLessPDDetails/get") .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } // get status based pd list getTabStatusPdDetails(status: string): Observable { const tabStatus = status ? - {params: new HttpParams().set('status', status)} : {}; + { params: new HttpParams().set('status', status) } : {}; return this._http.get(this.apiUrl + "listLessPDDetails/get", tabStatus) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } @@ -139,7 +144,7 @@ export class PdTrigerService { let httpParams = new HttpParams().set('pdid', editId); return this._http.post(this.apiUrl + "getFullPDDetails", httpParams) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } @@ -147,11 +152,11 @@ export class PdTrigerService { editPdMasterDetails(editData: any, status: string): Observable { editData.pd_status = status; editData.fk_updatedby = this._aws.getlocale(); - // editData.updatedon = currentdate; - return this._http.post(this.apiUrl + "updatePDMaster", {records: editData}) + // editData.updatedon = currentdate; + return this._http.post(this.apiUrl + "updatePDMaster", { records: editData }) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } @@ -159,48 +164,48 @@ export class PdTrigerService { updatePdApplicant(editData: any): Observable { // editData.fk_updatedby = this._aws.getlocale(); // editData.updatedon = currentdate; - return this._http.post(this.apiUrl + "updatePDApplicants", {"pd_applicant_details": editData}) + return this._http.post(this.apiUrl + "updatePDApplicants", { "pd_applicant_details": editData }) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } // get pd allocation to details getPdOfficerList(pdID: string): Observable { - return this._http.post(this.apiUrl + "getListPDOfficers", {"pdid": pdID}) + return this._http.post(this.apiUrl + "getListPDOfficers", { "pdid": pdID }) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } // update pd officer updatePdOfficer(updateData: any): Observable { updateData.fk_updatedby = this._aws.getlocale(); - // updateData.updatedon = currentdate; - return this._http.post(this.apiUrl + "allocatePD", {"records": updateData}) + // updateData.updatedon = currentdate; + return this._http.post(this.apiUrl + "allocatePD", { "records": updateData }) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } // update pd schedule updateSchedule(updateData: any): Observable { updateData.fk_scheduled_by = this._aws.getlocale(); - // updateData.createdon = currentdate; - return this._http.post(this.apiUrl + "schdulePD", {"records": updateData}) + // updateData.createdon = currentdate; + return this._http.post(this.apiUrl + "schdulePD", { "records": updateData }) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } //load pd template details loadPDTemplates(pdId: string): Observable { const options = pdId ? - {params: new HttpParams().set('pd_id', pdId)} : {}; + { params: new HttpParams().set('pd_id', pdId) } : {}; return this._http.get(this.apiUrl + "loadFullTemplate", options) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } @@ -214,7 +219,7 @@ export class PdTrigerService { return this._http.post(this.apiUrl + "getAnswersForPD", httpParams) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } @@ -231,235 +236,254 @@ export class PdTrigerService { // ) // } // get assessed income form details - getAssessedIncomeFormDetails(formDetails):Observable { - return this._http.post(this.apiUrl+"getAssessedIncome",formDetails) - .pipe( - catchError(this.handleError('operation', [])) - ) - } + getAssessedIncomeFormDetails(formDetails): Observable { + return this._http.post(this.apiUrl + "getAssessedIncome", formDetails) + .pipe( + catchError(this.handleError('operation', [])) + ) + } private handleError(operation = 'operation', result?: T) { return (error: any): Observable => { return of(result as T); }; } -// common Pd form details get for the Pd Process -getPDFormDetailsWithID(pdID, formID ):Observable { - return this._http.post(this.apiUrl+"getPDFormDetails",{"pd_id":pdID,"pd_form_id" : formID}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - // save Pd form details - savePDFormDetailsWithID(saveData: any): Observable { - saveData.fk_createdby = this._aws.getlocale(); - // saveData[0].fk_updatedby = this._aws.getlocale(); - // saveData[0].updatedon = currentdate; - - return this._http.post(this.apiUrl+"savePDFormDetails",{"records":saveData}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - // save pd answers - savePDQuestions(saveData: any): Observable { - saveData.createdby = this._aws.getlocale(); - //saveData.fk_createdon = currentdate; - // saveData[0].fk_updatedby = this._aws.getlocale(); - // saveData[0].updatedon = currentdate; - - return this._http.post(this.apiUrl+"savePDQuestions",{"records":saveData}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - - // get Pd Final report Question Answer - - getPdFinalReportDetails(pdId: number): Observable { - return this._http.post(this.apiUrl+"getFinalPDReportQuestions",{"pd_id":pdId}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - getPDReportFinalDocument(pdId: any): Observable{ - pdId.fk_createdby = this._aws.getlocale(); - return this._http.post(this.apiUrl+"generatePDReport",{"records": pdId}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - getActualPDReportModelTemplate(pdId: any) : Observable{ - return this._http.post(this.apiUrl+"getLatestPDReportBlob ",{"records":{"pd_id":pdId}}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - updatePDReportDetails(records: any): Observable{ - return this._http.post(this.apiUrl+"saveNewVersionOfPDReport ",{"records": records}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - getPdDocVersionList(pdId: number): Observable{ - return this._http.post(this.apiUrl+"getListOfPDReportVersions",{"records":{"pd_id":pdId}}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - swapOlderPDReportToLatest(pdId: any): Observable{ - pdId.fk_createdby = this._aws.getlocale(); - alert(JSON.stringify(pdId)); - return this._http.post(this.apiUrl+"swapOlderPDReportToLatest",{"records": pdId}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - -getTypeofActivityForSuppliedInfoForm(pd_id: any): Observable{ - return this._http.post(this.apiUrl+"getTypeOfActivetyFromBusinessForm", {"records": { "pd_id" : pd_id }}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - getQCReportFinalReviewDetails(pd_id: any, flag : string ): Observable{ - return this._http.post(this.apiUrl+"getQCLenderRemarks", {"records": { "pd_id" : pd_id, "flag" :flag }}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - // pd review status update details - pdReviewStatusUpdate(editData: any): Observable { - editData.fk_updatedby = this._aws.getlocale(); - // editData.updatedon = currentdate; - return this._http.post(this.apiUrl + "updatePDMaster", {records: editData}) - + // common Pd form details get for the Pd Process + getPDFormDetailsWithID(pdID, formID): Observable { + return this._http.post(this.apiUrl + "getPDFormDetails", { "pd_id": pdID, "pd_form_id": formID }) .pipe( - catchError(this.handleError('operation', [])) + catchError(this.handleError('operation', [])) ) } - -// inWords(num) { -// let a : any = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen ']; -// let b : any = ['', '', 'twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety']; -// if ((num = num.toString()).length > 9) return 'overflow'; -// let n : any = ('000000000' + num).substr(-9).match(/^(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/); -// if (!n) return; var str = ''; -// str += (n[1] != 0) ? (a[Number(n[1])] || b[n[1][0]] + ' ' + a[n[1][1]]) + 'crore ' : ''; -// str += (n[2] != 0) ? (a[Number(n[2])] || b[n[2][0]] + ' ' + a[n[2][1]]) + 'lakh ' : ''; -// str += (n[3] != 0) ? (a[Number(n[3])] || b[n[3][0]] + ' ' + a[n[3][1]]) + 'thousand ' : ''; -// str += (n[4] != 0) ? (a[Number(n[4])] || b[n[4][0]] + ' ' + a[n[4][1]]) + 'hundred ' : ''; -// str += (n[5] != 0) ? ((str != '') ? 'and ' : '') + (a[Number(n[5])] || b[n[5][0]] + ' ' + a[n[5][1]]) + 'only ' : ''; -// return str; -// } + // save Pd form details + savePDFormDetailsWithID(saveData: any): Observable { + saveData.fk_createdby = this._aws.getlocale(); + // saveData[0].fk_updatedby = this._aws.getlocale(); + // saveData[0].updatedon = currentdate; -convertNumberToWords(amount) { - //let words : any = new Array(); - let words :any = ['','One','Two','Three','Four','Five','Six','Seven','Eight','Nine','Ten','Eleven','Twelve','Thirteen','Fourteen','Fifteen','Sixteen','Seventeen','Eighteen','Nineteen','Twenty']; - words[30] = 'Thirty'; - words[40] = 'Forty'; - words[50] = 'Fifty'; - words[60] = 'Sixty'; - words[70] = 'Seventy'; - words[80] = 'Eighty'; - words[90] = 'Ninety'; - amount = amount.toString(); - let atemp = amount.split("."); - let number = atemp[0].split(",").join(""); - let n_length = number.length; - let words_string = ""; - let value : any; - if (n_length <= 9) { - var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); - var received_n_array = new Array(); - for (var i = 0; i < n_length; i++) { - received_n_array[i] = number.substr(i, 1); - } - for (var i = 9 - n_length, j = 0; i < 9; i++, j++) { - n_array[i] = received_n_array[j]; - } - for (var i = 0, j = 1; i < 9; i++, j++) { - if (i == 0 || i == 2 || i == 4 || i == 7) { - if (n_array[i] == 1) { - n_array[j] = 10 + (+n_array[j]); - n_array[i] = 0; + return this._http.post(this.apiUrl + "savePDFormDetails", { "records": saveData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // save pd answers + savePDQuestions(saveData: any): Observable { + saveData.createdby = this._aws.getlocale(); + //saveData.fk_createdon = currentdate; + // saveData[0].fk_updatedby = this._aws.getlocale(); + // saveData[0].updatedon = currentdate; + + return this._http.post(this.apiUrl + "savePDQuestions", { "records": saveData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + + // get Pd Final report Question Answer + + getPdFinalReportDetails(pdId: number): Observable { + return this._http.post(this.apiUrl + "getFinalPDReportQuestions", { "pd_id": pdId }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getPDReportFinalDocument(pdId: any): Observable { + pdId.fk_createdby = this._aws.getlocale(); + return this._http.post(this.apiUrl + "generatePDReport", { "records": pdId }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getActualPDReportModelTemplate(pdId: any): Observable { + return this._http.post(this.apiUrl + "getLatestPDReportBlob ", { "records": { "pd_id": pdId } }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + updatePDReportDetails(records: any): Observable { + return this._http.post(this.apiUrl + "saveNewVersionOfPDReport ", { "records": records }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getPdDocVersionList(pdId: number): Observable { + return this._http.post(this.apiUrl + "getListOfPDReportVersions", { "records": { "pd_id": pdId } }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + swapOlderPDReportToLatest(pdId: any): Observable { + pdId.fk_createdby = this._aws.getlocale(); + alert(JSON.stringify(pdId)); + return this._http.post(this.apiUrl + "swapOlderPDReportToLatest", { "records": pdId }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getTypeofActivityForSuppliedInfoForm(pd_id: any): Observable { + return this._http.post(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id } }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getQCReportFinalReviewDetails(pd_id: any, flag: string): Observable { + return this._http.post(this.apiUrl + "getQCLenderRemarks", { "records": { "pd_id": pd_id, "flag": flag } }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // pd review status update details + pdReviewStatusUpdate(editData: any): Observable { + editData.fk_updatedby = this._aws.getlocale(); + // editData.updatedon = currentdate; + return this._http.post(this.apiUrl + "updatePDMaster", { records: editData }) + + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + //pd report export excel + pdReportExportExcel(): Observable> { + // const options: any = { + // observe: 'response', + // responseType: 'blob' as 'json' + // }; + return this._http.get>(this.apiUrl + "downloadExcel", { + observe: 'response', + responseType: 'blob' as 'json' + }) + .pipe( + tap>( + res => res, + err => { + catchError(this.handleError('operation', [])) + } + ) + // catchError(this.handleError('operation', [])) + ) + } + + // inWords(num) { + // let a : any = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen ']; + // let b : any = ['', '', 'twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety']; + // if ((num = num.toString()).length > 9) return 'overflow'; + // let n : any = ('000000000' + num).substr(-9).match(/^(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/); + // if (!n) return; var str = ''; + // str += (n[1] != 0) ? (a[Number(n[1])] || b[n[1][0]] + ' ' + a[n[1][1]]) + 'crore ' : ''; + // str += (n[2] != 0) ? (a[Number(n[2])] || b[n[2][0]] + ' ' + a[n[2][1]]) + 'lakh ' : ''; + // str += (n[3] != 0) ? (a[Number(n[3])] || b[n[3][0]] + ' ' + a[n[3][1]]) + 'thousand ' : ''; + // str += (n[4] != 0) ? (a[Number(n[4])] || b[n[4][0]] + ' ' + a[n[4][1]]) + 'hundred ' : ''; + // str += (n[5] != 0) ? ((str != '') ? 'and ' : '') + (a[Number(n[5])] || b[n[5][0]] + ' ' + a[n[5][1]]) + 'only ' : ''; + // return str; + // } + + convertNumberToWords(amount) { + //let words : any = new Array(); + let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; + words[30] = 'Thirty'; + words[40] = 'Forty'; + words[50] = 'Fifty'; + words[60] = 'Sixty'; + words[70] = 'Seventy'; + words[80] = 'Eighty'; + words[90] = 'Ninety'; + amount = amount.toString(); + let atemp = amount.split("."); + let number = atemp[0].split(",").join(""); + let n_length = number.length; + let words_string = ""; + let value: any; + if (n_length <= 9) { + var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); + var received_n_array = new Array(); + for (var i = 0; i < n_length; i++) { + received_n_array[i] = number.substr(i, 1); + } + for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { + n_array[i] = received_n_array[j]; + } + for (var i = 0, j = 1; i < 9; i++ , j++) { + if (i == 0 || i == 2 || i == 4 || i == 7) { + if (n_array[i] == 1) { + n_array[j] = 10 + (+n_array[j]); + n_array[i] = 0; + } } } + value = ""; + for (var i = 0; i < 9; i++) { + if (i == 0 || i == 2 || i == 4 || i == 7) { + value = n_array[i] * 10; + } else { + value = n_array[i]; + } + if (value != 0) { + words_string += words[value] + " "; + } + if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { + words_string += "Crores "; + } + if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { + words_string += "Lakhs "; + } + if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { + words_string += "Thousand "; + } + if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { + words_string += "Hundred and "; + } else if (i == 6 && value != 0) { + words_string += "Hundred "; + } + } + words_string = words_string.split(" ").join(" "); } - value = ""; - for (var i = 0; i < 9; i++) { - if (i == 0 || i == 2 || i == 4 || i == 7) { - value = n_array[i] * 10; - } else { - value = n_array[i]; - } - if (value != 0) { - words_string += words[value] + " "; - } - if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Crores "; - } - if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Lakhs "; - } - if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Thousand "; - } - if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { - words_string += "Hundred and "; - } else if (i == 6 && value != 0) { - words_string += "Hundred "; - } - } - words_string = words_string.split(" ").join(" "); + return words_string; } - return words_string; -} // save additional requirements saveAdditionalRequirements(saveData: any): Observable { saveData.createdby = this._aws.getlocale(); - - return this._http.post(this.apiUrl+"savePDAdditionalRequiremets",{"records":saveData}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } + + return this._http.post(this.apiUrl + "savePDAdditionalRequiremets", { "records": saveData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } stockFormAccess(pdid: any): Observable { - - return this._http.post(this.apiUrl+"getTypeOfActivetyFromBusinessForm",{"records":pdid}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - // private handleError(operation = 'operation', result?: T) { - // return (error: any): Observable => { - // return of(result as T); - // }; - // } - /**Search Filter - * Sriram - */ - - overAllSearchFormDetails(searchItem) - { - let records = {'records':searchItem}; - return this._http.post(this.apiUrl+'filterPDList',records).pipe( + return this._http.post(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": pdid }) + .pipe( catchError(this.handleError('operation', [])) - ); - } - + ) + } + // private handleError(operation = 'operation', result?: T) { + // return (error: any): Observable => { + // return of(result as T); + // }; + // } + + /**Search Filter + * Sriram + */ + + overAllSearchFormDetails(searchItem) { + let records = { 'records': searchItem }; + return this._http.post(this.apiUrl + 'filterPDList', records).pipe( + catchError(this.handleError('operation', [])) + ); + } + } diff --git a/ng6-seed/src/app/shared/rating/rating.component.html b/ng6-seed/src/app/shared/rating/rating.component.html index 06bae631d..5991ec774 100644 --- a/ng6-seed/src/app/shared/rating/rating.component.html +++ b/ng6-seed/src/app/shared/rating/rating.component.html @@ -1,16 +1,16 @@
- - + + - + - + - + - +
\ No newline at end of file diff --git a/ng6-seed/src/app/shared/rating/rating.component.scss b/ng6-seed/src/app/shared/rating/rating.component.scss index 64db81cb4..820092410 100644 --- a/ng6-seed/src/app/shared/rating/rating.component.scss +++ b/ng6-seed/src/app/shared/rating/rating.component.scss @@ -1,6 +1,7 @@ .rating { float:left; + display: block; } .rating:not(:checked) > input { @@ -39,4 +40,9 @@ .rating > input:checked ~ label:hover ~ label, .rating > label:hover ~ input:checked ~ label { color: #ea0; -} \ No newline at end of file +} +// .rating::after { +// content: ""; +// clear: both; +// display: table; +// } diff --git a/ng6-seed/src/app/shared/rating/rating.component.ts b/ng6-seed/src/app/shared/rating/rating.component.ts index 5c6eed26a..c261d3de7 100644 --- a/ng6-seed/src/app/shared/rating/rating.component.ts +++ b/ng6-seed/src/app/shared/rating/rating.component.ts @@ -21,5 +21,10 @@ export class RatingComponent implements OnInit { rating: rating }); } + + lableVal: string = ''; + over(val): void { + this.lableVal = val; + } }