diff --git a/ng6-seed/angular.json b/ng6-seed/angular.json index 6a93d7c..88be59a 100755 --- a/ng6-seed/angular.json +++ b/ng6-seed/angular.json @@ -45,7 +45,9 @@ "node_modules/hammerjs/hammer.min.js", "node_modules/sortablejs/Sortable.js", "node_modules/chart.js/dist/Chart.bundle.min.js", - "src/assets/cropper/cropper.js" + "src/assets/cropper/cropper.js", + "node_modules/blueimp-canvas-to-blob/js/canvas-to-blob.min.js" + ] }, "configurations": { diff --git a/ng6-seed/package-lock.json b/ng6-seed/package-lock.json index 1258626..312d75c 100755 --- a/ng6-seed/package-lock.json +++ b/ng6-seed/package-lock.json @@ -2223,6 +2223,11 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==" }, + "blueimp-canvas-to-blob": { + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/blueimp-canvas-to-blob/-/blueimp-canvas-to-blob-3.28.0.tgz", + "integrity": "sha512-5q+YHzgGsuHQ01iouGgJaPJXod2AzTxJXmVv90PpGrRxU7G7IqgPqWXz+PBmt3520jKKi6irWbNV87DicEa7wg==" + }, "bn.js": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", @@ -2439,7 +2444,7 @@ }, "buffer": { "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "requires": { "base64-js": "^1.0.2", @@ -2570,7 +2575,7 @@ }, "calendar-utils": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/calendar-utils/-/calendar-utils-0.1.2.tgz", + "resolved": "http://registry.npmjs.org/calendar-utils/-/calendar-utils-0.1.2.tgz", "integrity": "sha512-9j4Zd1itopNYTSWzFU4MqD2IDHMqznfxsGr8UWGh7hWv+lKzjRJz0LS29iAg5rHtP6+6x3ikQnhoMGqFUzoD2Q==" }, "caller-callsite": { @@ -7303,7 +7308,7 @@ }, "lodash": { "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", "dev": true }, @@ -7478,7 +7483,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "requires": { "graceful-fs": "^4.1.2", @@ -7620,7 +7625,7 @@ }, "log4js": { "version": "0.6.38", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", + "resolved": "http://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", "integrity": "sha1-LElBFmldb7JUgJQ9P8hy5mKlIv0=", "dev": true, "requires": { @@ -7941,7 +7946,7 @@ }, "meow": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "requires": { "camelcase-keys": "^2.0.0", @@ -8456,7 +8461,7 @@ "dependencies": { "semver": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" }, "tar": { @@ -8897,7 +8902,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, @@ -12786,7 +12791,7 @@ }, "sax": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz", + "resolved": "http://registry.npmjs.org/sax/-/sax-0.6.1.tgz", "integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk=", "dev": true }, diff --git a/ng6-seed/package.json b/ng6-seed/package.json index b3d4164..5f0ade4 100755 --- a/ng6-seed/package.json +++ b/ng6-seed/package.json @@ -43,6 +43,7 @@ "angular-sortablejs": "^2.7.0", "angular-split": "^3.0.2", "angular-tree-component": "6.1.0", + "blueimp-canvas-to-blob": "^3.28.0", "chart.js": "2.6.0", "core-js": "^2.6.5", "d3": "^4.9.1", diff --git a/ng6-seed/src/app/_guard/req-token.interceptor.ts b/ng6-seed/src/app/_guard/req-token.interceptor.ts index efc34e0..1273122 100755 --- a/ng6-seed/src/app/_guard/req-token.interceptor.ts +++ b/ng6-seed/src/app/_guard/req-token.interceptor.ts @@ -218,7 +218,7 @@ private handleError (operation = 'operation', error?: T) { } else if(error.status == 0){ console.log("NO Internet") - this.router.navigate(['/error/404']); + // this.router.navigate(['/error/404']); } else{ // alert("Please Check your Internet connection"); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 2908943..522f6d0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -188,6 +188,12 @@ Address Details + + + {{ val.display }} + + Required. +
@@ -250,7 +256,7 @@
- + - +
Applicant Details @@ -450,8 +456,8 @@
- - + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss index ac8192c..a5c612d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss @@ -37,4 +37,24 @@ mat-radio-button,mat-checkbox{ ::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb { background-color:rgb(212, 15, 15); +} +// .large-select { + // ::ng-deep .mat-select-panel .mat-optgroup-label, .mat-select-panel .mat-option { + // height: unset; + // } + + // ::ng-deep .mat-option-text { + // white-space: normal; + // } + + +// } +.large-select-option { + height: unset !important; + line-height: 1.2em !important; + padding-top: 0.9em !important; + padding-bottom: 0.9em !important; + span { + white-space: normal; + } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index a6aaf8d..05c63c1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewEncapsulation, Output, EventEmitter, OnDestroy, Input, ViewChild } from '@angular/core'; +import { Component, OnInit, ViewEncapsulation, Output, EventEmitter, OnDestroy, Input, ViewChild, ElementRef } from '@angular/core'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { CustomValidators } from 'ng2-validation'; @@ -73,6 +73,10 @@ export class AddPdComponent implements OnInit, OnDestroy { billingtolist: any; removedControl: any = []; excel_file_id: any = null; + choosed_address:FormControl = new FormControl('') + addressList:any = [] + + @ViewChild('applicant_details') applicant_details_element :ElementRef constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent, private titleCase : TitleCasePipe,private userService:UserService,private matDialog:MatDialog) { @@ -614,9 +618,11 @@ export class AddPdComponent implements OnInit, OnDestroy { this._PDtriggerForm.controls['applicant_name'].updateValueAndValidity(); this._PDtriggerForm.controls['applicant_title_name'].setValidators([Validators.required]); this._PDtriggerForm.controls['applicant_title_name'].updateValueAndValidity(); - + // console.log("seleccccc", this.lenderShortName) + if(this.lenderShortName != 'MWISE') { this._PDtriggerForm.controls['mobile_no'].setValidators([Validators.required]); this._PDtriggerForm.controls['mobile_no'].updateValueAndValidity(); + } // this._PDtriggerForm.controls['addressline1'].setValidators([Validators.required]); // this._PDtriggerForm.controls['addressline1'].updateValueAndValidity(); @@ -718,7 +724,7 @@ export class AddPdComponent implements OnInit, OnDestroy { // return; // } - if (formValue.mobile_no != null && formValue.mobile_no.length != 10){ + if (formValue.mobile_no != null && formValue.mobile_no.length != 10 && this.lenderShortName != 'MWISE'){ this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!'); return; } @@ -838,6 +844,18 @@ export class AddPdComponent implements OnInit, OnDestroy { pd_applicant_details.push(obj1) }); + // FOR MOBILE NUMBER CHECK FOR MWISE LENDER -- ATLEAST ONE NUMBER TO BE PROVIDED FOR MWISE + if(this.lenderShortName == 'MWISE') { + let mobile_number_check = pd_applicant_details.filter(vv=>vv.mobile_no != '' && vv.mobile_no != null) + console.log(mobile_number_check) + if(mobile_number_check == 0 || mobile_number_check == -1) { + this.applicant_details_element.nativeElement.scrollIntoView({'behaviour':'smooth'}) + this.disableAfterSubmit = false; + this.notifier.notify("info", "Please provide atleast 1 Mobile Number") + return; + } + } + if (formValue.addresses.length > 0) { formValue.addresses.forEach((addressElement, itemIndex) => { let addressobj = { @@ -1144,6 +1162,7 @@ searchFun(control:any,i:number,option){ maxWidth:'75vw' }) dialogRef.afterClosed().subscribe(result=>{ + if(result) { this.excel_file_id = result.excel_file_id console.log(result,JSON.stringify(result)); // let formValues = {} @@ -1167,13 +1186,35 @@ searchFun(control:any,i:number,option){ this.addCoApplicant() } } + if(key_name == 'address_details') { + this.addressList = records['address_details'] + let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray + control_address.get('addressline1').disable() + control_address.get('fk_state').disable() + control_address.get('fk_city').disable() + control_address.get('pincode').disable() + this.choosed_address.setValidators(Validators.required) + } // formValues[val.key_name] = val.value } }) this._PDtriggerForm.patchValue(records) } + } }) } + onChangeSelectedAddress(value) { + console.log(value) + if(value) { + let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray + console.log(control_address); + control_address.get('addressline1').setValue(value.addressline) + control_address.get('fk_state').setValue(value.state) + this.getCityList(value.state,0); + control_address.get('fk_city').setValue(value.city) + control_address.get('pincode').setValue(value.pincode) + } + } changePDTypeSlideValue(event) { if(event.checked) { this._PDtriggerForm.controls['fk_pd_type'].setValue('3') diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.ts index e4e0f0e..0212e55 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit } from '@angular/core'; -import { MatDialogRef, MatSnackBar } from '@angular/material'; +import { Component, Inject, OnInit } from '@angular/core'; +import { MatDialogRef, MatSnackBar, MAT_DIALOG_DATA } from '@angular/material'; import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; import { LoaderService } from 'app/shared/loaderService/loader.service'; @@ -13,7 +13,7 @@ export class ExcelUploadDialogComponent implements OnInit { sheetBufferRender: File; constructor(private snackBar:MatSnackBar,private loaderService:LoaderService,private _pdService:PdTrigerService, - private dialogRef:MatDialogRef) { } + private dialogRef:MatDialogRef, @Inject(MAT_DIALOG_DATA)public data:any) { } ngOnInit() { } @@ -68,7 +68,8 @@ export class ExcelUploadDialogComponent implements OnInit { return; } this.loaderService.showMatSpinnerDialog("Upload is in progress.. Please wait..") - this._pdService.uploadSMCDataFile(this.sheetBufferRender).subscribe(res=>{ + let pd_id = this.data && this.data.hasOwnProperty('pd_id') ? this.data.pd_id : null + this._pdService.uploadSMCDataFile(this.sheetBufferRender,pd_id).subscribe(res=>{ if(res['dataStatus']) { this.dialogRef.close(res) } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html index c105d70..f1c2a95 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html @@ -74,7 +74,7 @@

Showing data for last {{common}}. To see older records, please use advanced filter


-
+
@@ -165,7 +165,8 @@
{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}
-
+ +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss index acb2f11..aa6bed6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss @@ -26,3 +26,10 @@ background-color: #fff !important; float: right; } + .close_btn_filter{ + color: gainsboro +} +.close_btn_filter:hover{ + color: black; + cursor: pointer; +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts index 89c30bc..18a52f7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts @@ -59,12 +59,13 @@ export class ListPdComponent implements OnInit, OnDestroy { this.user_role_name=role_name }) if(localStorage.getItem('LocalSetEntity')) { + console.log("Sudden") this.getUserFromLocal() } else{ // for Listening the local storage LocalSetEntity this.userService.messageSubject.subscribe(rr=>{ - console.log(rr) + console.log("late",rr) this.getUserFromLocal() // let entity_id = localStorage.getItem('LocalSetEntity') // if(entity_id) { @@ -119,7 +120,7 @@ export class ListPdComponent implements OnInit, OnDestroy { } pdListLoad(status: boolean){ this.viewPdList = status; - this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.scheduledTabC.loadPDDetails() : this.getTabIndex==2 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==3 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails(); + this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==3 ? this.scheduledTabC.loadPDDetails() : this.getTabIndex==1 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==2 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails(); } viewPDDetails(event){ @@ -134,6 +135,7 @@ export class ListPdComponent implements OnInit, OnDestroy { //get tab changes onTabClick(event: MatTabChangeEvent) { this.getTabIndex=event.index; + this.filterValue = '' // this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.scheduledTabC.loadPDDetails() : this.getTabIndex==2 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==3 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails(); this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==2 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails(); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html new file mode 100755 index 0000000..c8030f3 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html @@ -0,0 +1,64 @@ +

+
+ {{pageTitle}} +
+
+ + + +
+ +

+ + + + + + +
+
+
+ + {{officer.first_name}} {{officer.last_name}} + +
+ +
+ +
+ +
+ +
+ + +

No Regional Credit Managers available.

+
+
+ + + +
+ + +
+

Regional Credit Manager: {{selectedItem.first_name}}

+
+
+ + +
+ +
+ + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss new file mode 100755 index 0000000..044bbd9 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss @@ -0,0 +1,23 @@ +.example-full-width{ + width: 100%; +} +.view_more { + cursor: pointer; + color: #e00201 !important; + // text-decoration-line: underline; + // text-decoration-style: dotted; + // font-weight: bold; + +} +.text_change { + color: #e00201 !important; +} + .cdk-global-overlay-wrapper{ + justify-content: center !important; +} +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + // padding: 10px !important; +} + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts new file mode 100755 index 0000000..aff7c5a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts @@ -0,0 +1,126 @@ +import { Component, OnInit, Inject, ViewEncapsulation } from '@angular/core'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; +// import { AllocationViewMoreComponent } from './../allocation-view-more/allocation-view-more.component'; +// import { VendorPdAllocationComponent } from '../vendor-pd-allocation/VendorPdAllocationComponent'; + +@Component({ + selector: 'app-pd-allocation', + templateUrl: './pd-allocation.component.html', + styleUrls: ['./pd-allocation.component.scss'], + encapsulation: ViewEncapsulation.None + +}) +export class PdAllocationComponent implements OnInit { + public pageTitle: string = "Allocation To Credit Manager"; + public _pdAllocationForm: FormGroup; + public pdOfficerList: any = []; + errorMessage: any; + notifier : NotifierService; + selectedItem:any; + isDisabled: boolean; + + constructor( notifier: NotifierService, + private _fb: FormBuilder, + private dialogRef: MatDialogRef, + private _pd: PdTrigerService, private dialog: MatDialog, + @Inject(MAT_DIALOG_DATA) public data: any) { + console.log(data) + this.notifier=notifier; + if(this.data.lender_role_id == '25') { + this.pageTitle = "Allocation To Regional Credit Manager" + } + } + + ngOnInit() { + this.isDisabled=true; + console.log(this.data) + this.getPDOfficerList(this.data.pd_id); + + // this._pdAllocationForm = this._fb.group({ + // pd_primary_id: [null], + // allocation_id: [null], + // }); + } + +// convenience getter for easy access to form fields +// get readForm() { return this._pdAllocationForm.controls; } + +// pd officer list + getPDOfficerList(pdID:string){ + let user_type + if(this.data.lender_role_id == '25') { + user_type = "RCM" + } + else if(this.data.lender_role_id == '27') { + user_type = "CM" + } + this._pd.getCMUsers(this.data.state_id,user_type).subscribe( + data => { + if (data.status == 200) { + this.pdOfficerList= data.records + + } + }, error => this.errorMessage = error); + + } + /** To update pd officer*/ + updatePdOfficer(allocateDetails:any) { + if(!allocateDetails){ + this.notifier.notify('warning', 'Please Choose PD Officer.!'); + } + else { + let updateData = { + "pd_id":this.data.pd_id, + // "fk_pd_allocated_to":allocateDetails.fk_user_id, + "fk_pd_allocated_to":allocateDetails.userid, + } + this._pd.updatePdOfficer(updateData).subscribe( + result => { + if (result.status == 200) { + this.notifier.notify('success', 'PD Allocated.!'); + this.dialogRef.close(true); + } + else { + this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); + this.errorMessage = "Something Went Wrong Try Again.!"; + } + }, error => { + this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); + this.errorMessage = "Some Thing Wents Wrong Try Again.!"; + // this.dialogRef.close(); + }); + } + } +/** For Popup Close Button */ + closeAllocationComponent(): void { + this.dialogRef.close(); + } + // pd officer view more +// viewMoreDetails(details:any){ +// if(Number(details.count) > 0) { +// const dialogSchedule = this.dialog.open(AllocationViewMoreComponent, { +// data: details, +// disableClose: true, +// position: { right: '0'}, +// width:'100%', +// // hasBackdrop:false +// }); +// // dialogSchedule.afterClosed() +// // .subscribe(dataresult => { +// // }); +// } +// else { +// this.notifier.notify('warning', 'No PD In Hand'); + +// } +// } + // pd Vendor officer + viewVendorOfficer(){ + this.dialogRef.close('openvendorallocation'); + + +} +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts index bdf38fa..1f41a3d 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts @@ -25,8 +25,8 @@ export class PdStatusChangeDialogueComponent implements OnInit { constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) { this.notifier = notifier; - this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Allocate to Self' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : 'Change Discussion'; - this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion and forwarding for Quality Check ?' : this.data.pd_status=='ALLOCATED' ? 'Do you want to allocate the PD to yourself ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : 'Change Discussion'; + this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Send Back to CPA' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : this.data.pd_status == 'CM_ALLOCATED' ? 'Self Allocate' : 'Change Discussion'; + this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion' : this.data.pd_status=='ALLOCATED' ? 'Do you want to Send back the PD to CPA ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : this.data.pd_status == 'CM_ALLOCATED' ? 'Do you want to Allocate the PD to yourself' : 'Change Discussion'; this.enableAddonPD = false; this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true; this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false; @@ -74,7 +74,7 @@ export class PdStatusChangeDialogueComponent implements OnInit { this.pd.editPdMasterDetails(update_status, status).subscribe(result => { if (result.status == 200) { this.dialogRef.close({update_status:true}); - this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Discussions Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :'Discussions Updated Successfully'); + this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :'Discussions Updated Successfully'); } else { this.dialogRef.close({update_status:false}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.html new file mode 100644 index 0000000..2f2479e --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.html @@ -0,0 +1,75 @@ +

+
+ Add New Address +
+
+ + + +
+ +

+ + +
+
+ + Address + + Required + + + State + + + + + + {{SL.name}} + + + Required + + + City + + + + + + + {{CL.city_name}} + + + Required + + + Pincode + + + + + {{PL.pincode}} + + Required + +
+
+
+ + +
+

{{errormsg}}

+
+
+ + +
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.scss new file mode 100644 index 0000000..4b48706 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.scss @@ -0,0 +1,76 @@ +.example-full-width{ + width: 100%; +} +::ng-deep { .min-padding > mat-dialog-container { + // background: black; + padding: 3%; + // overflow-y: scroll !important; + } +} +.view_more { + cursor: pointer; + color: #e00201 !important; + // text-decoration-line: underline; + // text-decoration-style: dotted; + // font-weight: bold; + +} +.text_change { + color: #e00201 !important; +} + .cdk-global-overlay-wrapper{ + justify-content: center !important; +} +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + // padding: 10px !important; +} +.mat-form-field { + width: 100%; +} +.mat-error { + color: #e00201; + float: right; +} + + +@-webkit-keyframes highlight-fade { + 0% { + background: orange; + } + 100% { + background: white; + } + } + @-moz-keyframes highlight-fade { + 0% { + background: orange; + } + 100% { + background: white; + } + } + @-ms-keyframes highlight-fade { + 0% { + background: orange; + } + 100% { + background: white; + } + } + @keyframes highlight-fade { + 0% { + background: orange; + } + 100% { + background: white; + } + } + .field_highlight { + -webkit-animation: highlight-fade 4s ease-out; + -moz-animation: highlight-fade 4s ease-out; + -o-animation: highlight-fade 4s ease-out; + animation: highlight-fade 4s ease-out; + // background: blue; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.spec.ts new file mode 100644 index 0000000..ee8ead3 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AnswerOptionCreateDialogComponent } from './answer-option-create-dialog.component'; + +describe('AnswerOptionCreateDialogComponent', () => { + let component: AnswerOptionCreateDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AnswerOptionCreateDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AnswerOptionCreateDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.ts new file mode 100644 index 0000000..7caafe6 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/answer-option-create-dialog/answer-option-create-dialog.component.ts @@ -0,0 +1,183 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; +import { ReplaySubject } from 'rxjs'; +import { QuesFormService } from '../dynamic-form/ques-form/ques-form.service'; + +@Component({ + selector: 'app-answer-option-create-dialog', + templateUrl: './answer-option-create-dialog.component.html', + styleUrls: ['./answer-option-create-dialog.component.scss'] +}) +export class AnswerOptionCreateDialogComponent implements OnInit { + stateList:any = [] + cityList:any = [] + pincodeList:any = [] + + filteredstateList:ReplaySubject= new ReplaySubject(1) + filteredcityList:ReplaySubject = new ReplaySubject(1) + filteredpincodeList:ReplaySubject = new ReplaySubject(1) + + stateSearch:FormControl = new FormControl('') + citySearch:FormControl = new FormControl('') + pinSearch:FormControl = new FormControl('') + newAddressForm:FormGroup; + + field_appearance="outline" + errormsg: string = null; + + constructor(@Inject(MAT_DIALOG_DATA) public data:any, private _pdService:PdTrigerService, private _fb:FormBuilder, + private dialogRef:MatDialogRef, private quesService:QuesFormService) { + this.newAddressForm = this._fb.group({ + address:['',Validators.required], + state:['',Validators.required], + city:['',Validators.required], + pincode:['',Validators.required] + }) + console.log(this.data) + } + + ngOnInit() { + this._pdService.getAllMasterDatas('STATE').subscribe( + data => { + if (data.status == 200) { + this.stateList = data.records.filter(item => item.isactive == 1); + this.filteredstateList.next(this.stateList); + } + }); + this.filterList() + } + filterList() { + this.stateSearch.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.stateSearch.value,this.filteredstateList,this.stateList,'name') + }) + this.citySearch.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.citySearch.value,this.filteredcityList,this.cityList,'city_name') + }) + this.pinSearch.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.pinSearch.value,this.filteredpincodeList,this.pincodeList,'pincode') + }) + + + } + applyFilter(filtered_text,filter_list,raw_list,obj_name) { + if (!raw_list) { + return; + } + // get the search keyword + let search = filtered_text; + if (!search) { + filter_list.next(raw_list.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + filter_list.next( + raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + ); + } + + //get city list details based on state id + getCityList(stateID: string) { + this._pdService.getStateWiseCities(stateID).subscribe(data => { + if (data.status == 200) { + this.cityList = data.records.cities; + this.pincodeList = data.records.pincode; + this.filteredcityList.next(this.cityList) + this.filteredpincodeList.next(this.pincodeList) + } + }); + } + addNewAddress() { + console.log(this.newAddressForm.getRawValue()) + if(this.newAddressForm.invalid) { + this.showMsg("Please Fill all the fields") + // this.findInvalidControls() + return; + } + let formValue=this.newAddressForm.getRawValue() + let params = {pd_id:this.data.pd_all_details.pdmaster_details.pd_id,file_id:null, addressline:formValue.address, state:formValue.state.state_id, city:formValue.city.city_id, pincode:formValue.pincode.pincode_id} + let display_address= formValue.address+ ', '+formValue.state.name+', '+formValue.city.city_name+', '+formValue.pincode.pincode + console.log(this.newAddressForm.getRawValue(),display_address) + this._pdService.saveNewSMCTempAddresses(params).subscribe(res=>{ + if(res['dataStatus']) { + this._pdService.getSMCTempAddresses(this.data.pd_all_details.pdmaster_details.pd_id).subscribe(rr=>{ + if(rr && rr['dataStatus'] && rr['records']) { + let address_data = this.quesService.convertArrayNames(["display","display"],rr['records']) + this.dialogRef.close({update:true, address_for_display:address_data}) + } + else { + this.dialogRef.close({update:false, error_msg:"Unable to get the address"}) + } + },err=> { + this.dialogRef.close({update:false, error_msg:"Network error. Unable to get the address"}) + }) + // this.dialogRef.close({update:true, address_for_display:display_address}) + } + else { + this.showMsg("Something went wrong") + } + },err=>{ + this.showMsg("Network Error") + }) + + } + showMsg(msg) { + this.errormsg = msg + setTimeout(()=>{ + this.errormsg = null + }, 3000) + } + public findInvalidControls() { + const invalid = []; + + for (const name in (this.newAddressForm.controls)) { + console.log(this.newAddressForm.controls[name],name) + if (this.newAddressForm.controls[name].invalid) { + invalid.push(name); + let invalidFields = [].slice.call(document.getElementsByClassName('ng-invalid')); + let firstInvalidField; + for(let val in invalidFields){ + if( invalidFields[val].nodeName == 'MAT-FORM-FIELD' || invalidFields[val].nodeName == 'MAT-SELECT' || invalidFields[val].nodeName == 'TEXTAREA' || invalidFields[val].nodeName == 'MAT-RADIO-GROUP' ){ //INPUT FOR INPUT FIELD + firstInvalidField=invalidFields[val] + + break; + } + } + + if(firstInvalidField != undefined){ + // firstInvalidField.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"}) + + setTimeout(()=>{ + firstInvalidField.scrollIntoView({block: "start", inline: "nearest"}) + setTimeout(()=>{ + firstInvalidField.focus() + },0) + // firstInvalidField.style.background = 'red' + firstInvalidField.classList.remove('field_highlight') + setTimeout(()=>{ + firstInvalidField.classList.add('field_highlight') + },300) + },300) + + } + break + } + } + + // } + // } + // let business_group_ctrl = formArray.at(2).get('business_group') as FormArray + // const controls = this.getQuestionControl().at(1)['controls'] + // for (const name in controls) { + // if (controls[name].invalid) { + // invalid.push(name); + // } + // } + return invalid; + } + + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html index d6fb50f..edff34d 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html @@ -42,8 +42,81 @@ [ngStyle.xs]="{'margin-bottom' : (singleQues.field_type == 'numtoword' || singleQues.field_type == 'str&numtoword') ? '5%' : '0' }"> +
+
+ + +
+ + +
+ + + + +
+ + + + + {{singleQues.group_title}} {{g_c_i+1}} + + + + +
+ + + + +
+
+
+
+ + +
+
+ + +
+
+
+
+
+ +
+ +
+ + + + + + + +

diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.ts index a9ed905..17cc53f 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.ts @@ -16,6 +16,7 @@ export class DynamicFormComponent implements OnInit { @Input() questions_JSON:any; @Input() json_answers:any; step: number=0; + step_child:number = 0 @ViewChild('mapanel') matExpansionPanel:MatExpansionPanel @ViewChild('accordion') Accordion: MatAccordion constructor(private _fb:FormBuilder,private questionService:QuesFormService) { } @@ -38,9 +39,11 @@ export class DynamicFormComponent implements OnInit { if(parent_ques.is_repeatable == '1'){ if(this.json_answers[parent_ques.group_key] && this.json_answers[parent_ques.group_key].length > this.form_group_name.value[parent_ques.group_key].length) { console.log(this.json_answers[parent_ques.group_key]); - + // this.json_answers[parent_ques.group_key].mobile_numbers= [{mobile_no:93299},{mobile_no:948392}] this.json_answers[parent_ques.group_key].forEach((group_ques,g_i)=>{ - console.log(parent_ques,g_i) + + console.log(parent_ques,g_i,group_ques) + // debugger; if(g_i != 0){ // let parent_control=this.form_group_name @@ -49,6 +52,28 @@ export class DynamicFormComponent implements OnInit { this.addData(g_i,parent_ques) // } } + // FOR CHILD REPEATABLE + let keys= Object.keys(group_ques) + keys.forEach((vv,key_index)=>{ + if(typeof(group_ques[vv]) != 'string') { + console.log("Entered",group_ques[vv]); + if(group_ques[vv] && group_ques[vv].length > 0) { + // + group_ques[vv].forEach((child_val,child_index)=>{ + if(child_index != 0) { + console.log(parent_ques,this.form_group_name.get(parent_ques.group_key)['controls'][g_i],parent_ques,vv,g_i) + let find_json = parent_ques.group_questions[g_i].filter(val=>val.hasOwnProperty('group_key') && val.group_key == vv) + if(find_json.length > 0) { + find_json = find_json[0] + console.log(find_json,child_index,g_i) + this.addSecondLevelChild(g_i,find_json,this.form_group_name.get(parent_ques.group_key)['controls'][g_i]) + } + + } + }) + } + } + }) }) } } @@ -93,13 +118,61 @@ export class DynamicFormComponent implements OnInit { let control_names:any= {} let control = this.form_group_name.get(json_obj.group_key) as FormArray json_obj.question.map(val=>{ + // FOR CHILD REPEATABLE + if(val.is_repeatable == '2') { + val.question.map(rr=>{ + control_names[val.group_key]=this._fb.array([this._fb.group({[rr.question_key]:''})]) + // control_names[val.group_key].push({[rr.question_key]:''}) + }) + } + else { control_names[val.question_key] = '' + } }) - console.log(control,json_obj.group_key,control_names); + console.log(control,json_obj.group_key,control_names,json_obj.question); + // debugger; json_obj.group_questions.push(json_obj.question); control.push(this._fb.group(control_names)) + json_obj.question.forEach((group_indi,arr_index)=>{ + + + if(group_indi.is_repeatable == '2' && group_indi.hasOwnProperty('questions_level_two') && group_indi.questions_level_two.length > 0) { + group_indi.questions_level_two[0].forEach((child_val,child_index)=> { + // console.log("sd",group_indi,arr_index,control.at(control.length-1),control) + // debugger; + let child_control = control.at(control.length-1).get(group_indi.group_key) as FormArray + + this.questionService.addAdditionalControl(child_val, child_control.controls[child_control.length-1], child_index) + }) + } + else{ + this.questionService.addAdditionalControl(group_indi, control.controls[control.length-1], arr_index) + } + }) + json_obj.question = JSON.parse(JSON.stringify(json_obj.question)) + control.updateValueAndValidity(); + control.controls[control.length-1].updateValueAndValidity(); + this.form_group_name.updateValueAndValidity(); + this.step = control.length-1 + console.log(this.form_group_name.value); + // debugger; + } + // ADDING A CHILD REPEATABLE OBJ IN A EXISTING FORM ARRYA + addSecondLevelChild(index,json_obj,parent_group) { + console.log(json_obj,parent_group) + let control_names:any= {} + let control = parent_group.get(json_obj.group_key) as FormArray + json_obj.question.map(val=>{ + control_names[val.question_key] = '' + }) + console.log(control,json_obj.group_key,control_names,json_obj.question); + // debugger; + + json_obj.questions_level_two.push(json_obj.question); + control.push(this._fb.group(control_names)) + json_obj.question.forEach((group_indi,arr_index)=>{ // console.log("sd",childControl) this.questionService.addAdditionalControl(group_indi, control.controls[control.length-1], arr_index) @@ -107,9 +180,20 @@ export class DynamicFormComponent implements OnInit { json_obj.question = JSON.parse(JSON.stringify(json_obj.question)) control.updateValueAndValidity(); control.controls[control.length-1].updateValueAndValidity(); - this.form_group_name.updateValueAndValidity(); - this.step = control.length-1 - console.log(this.form_group_name.value); + parent_group.updateValueAndValidity(); + this.step_child = control.length-1 + console.log(this.form_group_name.value,this.questions_JSON); + // debugger; + } + // REMOVE OF CHILD REPEATABLE OBJ + removeSecondLevelChild(index,json_obj,parent_group) { + console.log(json_obj) + // debugger; + let control = parent_group.get(json_obj.group_key) + control.removeAt(index) + json_obj.questions_level_two.splice(index,1) + this.step_child = control.length-1 + console.log(json_obj) } removeData(index,json_obj) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.html index 86ac14b..144b51d 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.html @@ -20,6 +20,7 @@ align="end" style="font-size: 12px;">{{"₹"}} {{formGroupN.value[parent_ques.question_key] | numberToWords}} + {{validation.message}} @@ -69,7 +70,8 @@ Select {{val.answer}} + [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer" + (click)="newAnswerCreateDialog(val,parent_ques)" class="large-select-option">add_circle_outline {{val.answer}} @@ -175,7 +177,8 @@ {{val.answer}} + [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer" + (click)="newAnswerCreateDialog(val,parent_ques)" class="large-select-option">add_circle_outline {{val.answer}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.scss index fcb4546..3abfc47 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.scss @@ -78,4 +78,13 @@ mat-form-field { ::ng-deep .mat-form-field-label{ white-space: pre-wrap; + } + .large-select-option { + height: unset !important; + line-height: 1.2em !important; + padding-top: 0.9em !important; + padding-bottom: 0.9em !important; + span { + white-space: normal; + } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts index 68c7c06..f3ef598 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts @@ -3,6 +3,8 @@ import { FormGroup, FormArray, FormControl, FormBuilder } from '@angular/forms'; import { QuesFormService } from '../ques-form/ques-form.service'; import { startWith, map } from 'rxjs/operators'; import { Observable, ReplaySubject } from 'rxjs'; +import { MatDialog } from '@angular/material'; +import { AnswerOptionCreateDialogComponent } from '../../answer-option-create-dialog/answer-option-create-dialog.component'; @Component({ selector: 'app-dynamic-question-template', @@ -25,7 +27,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { autoCompleteAns:Observable public commonFilterCtrl:FormControl = new FormControl(); public ngxFilteredValue:ReplaySubject = new ReplaySubject(1); - constructor(private quesService:QuesFormService,private _fb:FormBuilder) { } + constructor(private quesService:QuesFormService,private _fb:FormBuilder, private matDialog:MatDialog) { } ngOnInit() { this.parent_ques = this.currFormArrayObj @@ -60,19 +62,28 @@ export class DynamicQuestionTemplateComponent implements OnInit { this.generateGroupControls.emit() } this.json_answers.forEach((value,index)=>{ + + let keys= Object.keys(value) keys.forEach(vv=>{ + console.log("ype of ",value[vv],typeof(value[vv]),this.whole_json) + // debugger; + if(typeof(value[vv])== 'string') { + // console.log("ype of ",typeof(value[vv])) + // console.log("ansssssssssssssssssssssssssssss",this.json_answers[vv],vv,this.whole_json.filter(vl=>vl.question_key == vv)) - if(this.whole_form.get(this.group_key)) { + if(this.whole_form.get(this.group_key) && this.whole_json.length > 0) { let curr_obj=this.whole_json.filter(vl=>vl.question_key == vv)[0] this.onChangeProperty({value:value[vv]},curr_obj,'') } console.log("Repeatable ques",value,this.parent_ques.question_key) + } }) + }) // debugger; - + } // this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || '')) // setTimeout(()=>{ @@ -399,8 +410,8 @@ export class DynamicQuestionTemplateComponent implements OnInit { // }) console.log(expression_value) let calc_exp=eval(expression_value) - console.log(calc_exp) - if(calc_exp){ + console.log(calc_exp, (typeof(calc_exp) == 'string' || typeof(calc_exp) == 'number' )) + if( (typeof(calc_exp) == 'string' || typeof(calc_exp) == 'number' ) ){ // if(typeof(calc_exp) == 'number'){ // calc_exp = calc_exp.toFixed(2) // } @@ -490,7 +501,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { let inserted_control_obj=form_control_obj // inserted_control_obj.questions.sort() // inserted_control_obj.questions.reverse() - console.log("check ddddddddddd",inserted_control_obj.questions.reverse(),inserted_control_obj.questions) + console.log("check ddddddddddd",inserted_control_obj.questions) inserted_control_obj.questions.forEach((val,index)=>{ if(val.hasOwnProperty('is_repeatable') && val.is_repeatable == '1') { if(options == 1) { @@ -506,7 +517,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { this.whole_json.splice(question_index_after+1,0,val); val.question.forEach(group_val=>{ control_names[group_val.question_key] = '' - console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val) + // console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val) this.addOrRemoveControl(group_val,ques_control,question_index_after,options,val) }) const question_temp:any = JSON.parse(JSON.stringify(val.question)); @@ -522,7 +533,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { // let childControl: any = this.formGroupN.get(val.group_key) as FormArray val.question.forEach(group_val=>{ // control_names[group_val.question_key] = '' - console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val) + // console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val) this.addOrRemoveControl(group_val,ques_control,question_index_after,options,val) }) } @@ -678,6 +689,9 @@ export class DynamicQuestionTemplateComponent implements OnInit { ques_control=this.whole_json[this.json_index] console.log(ques_control,this.whole_json,this.json_index) let other_control = ques_control + if(ques_control.hasOwnProperty('is_repeatable') && ques_control.is_repeatable == '2') { + return; + } // =ques_control.filter(val=>{ // if(val.question_key == validation_obj.validation_to){ // return val @@ -703,6 +717,32 @@ export class DynamicQuestionTemplateComponent implements OnInit { this.quesService.settingArrayofValidators({validations:new_validations_obj,question_key:validation_obj.validation_to},this.formGroupN,'') } } + newAnswerCreateDialog(choosed_answer_obj,curr_ques_obj) { + console.log(curr_ques_obj,choosed_answer_obj) + if(choosed_answer_obj.is_others == '-1') { + this.formGroupN.get(curr_ques_obj.question_key).setValue('') + let dialog = this.matDialog.open(AnswerOptionCreateDialogComponent,{ + data:{pd_all_details:this.quesService.pd_all_details}, + disableClose: true, + width: '80vw', + maxHeight: '100vh', + panelClass:'min-padding' + }) + dialog.afterClosed().subscribe(rr=>{ + if(rr.update && rr.address_for_display && rr.address_for_display.length > 0) { + console.log(curr_ques_obj.answers,curr_ques_obj.answers.length -2,rr.address_for_display) + // curr_ques_obj.answers.splice(curr_ques_obj.answers.length -1,0,{answer:rr.address_for_display,answer_id:rr.address_for_display}) + curr_ques_obj.answers = rr.address_for_display + console.log(curr_ques_obj.answers,curr_ques_obj.answers[curr_ques_obj.answers.length-2].answer_id) + let lastAddress = curr_ques_obj.answers[curr_ques_obj.answers.length-1].answer_id && curr_ques_obj.answers[curr_ques_obj.answers.length-1].answer_id != null && curr_ques_obj.answers[curr_ques_obj.answers.length-1].is_others != -1 ? curr_ques_obj.answers[curr_ques_obj.answers.length-1].answer_id : curr_ques_obj.answers[curr_ques_obj.answers.length-2].answer_id + this.formGroupN.get(curr_ques_obj.question_key).patchValue(lastAddress) + } + else if(rr.hasOwnProperty('update') && rr.update == false){ + alert(rr.error_msg ? rr.error_msg : "Something went wrong while getting address") + } + }) + } + } updateValidationMsg(ques_control,validation_obj){ console.log("updae msg",ques_control,validation_obj); if(!ques_control) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts index 71cda50..82ba84e 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { FormGroup, FormArray, FormBuilder, FormControl, Validators } from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; +import { HttpClient, HttpParams } from '@angular/common/http'; import { environment } from 'environments/environment'; import { DatePipe } from '@angular/common'; @@ -42,32 +42,15 @@ export class QuesFormService { ques_data[index].group_questions = [] ques_data[index].group_questions.push(val.question) val.group_questions[0].forEach((group_indi, arr_index) => { - // if(group_indi.api_properties != null && typeof(group_indi.api_properties) == 'object'){ - console.log("api pro", val.api_properties) - // let param - // val.api_properties.forEach(val=>param=val) - // console.log(param) + // CREATING A FORMARRAY AND CONTROL FOR CHILD REPEATABLE + if(group_indi.is_repeatable == '2') { + this.addLevelTwoControls(group_indi,childControl,val.group_questions[0],val.question,arr_index) + } + else { group_indi.raw_validations = group_indi.validations - // sub_childControl.push(this.createValue(group_indi)) - // childControl.addControl(group_indi.question_key,new FormControl('')) + control_names[group_indi.question_key] = '' - // childControl.push(this._fb.group({ - // [group_indi.question_key] :[''] - // })) - // setTimeout(()=>{ - // this.addAdditionalControl(group_indi, childControl.at(arr_index), arr_index) - // },2000) - // if(group_indi.type == '5'){ - // sub_childControl.controls[arr_index].removeControl('answer_value'); - // console.log("loop",arr_index,sub_childControl); - // sub_childControl.controls[arr_index].addControl('answer_value',this._fb.array([])) - // } - // if(group_indi.type == '1'){ - // sub_childControl.controls[arr_index].addControl('field_type',new FormControl(group_indi.field_type)) - // } - // if(val.type == '8'){ - // sub_childControl.controls[index].addControl('select_search',new FormControl(val.field_type)) - // } + if (group_indi.api_properties != null) { if(group_indi.api_properties.hasOwnProperty('purpose') && group_indi.api_properties.purpose == 'answer_options_local') { @@ -91,6 +74,7 @@ export class QuesFormService { const question_temp:any = JSON.parse(JSON.stringify(val.question)); ques_data[index].question = question_temp + } // else{ // setTimeout(()=>{ // sub_childControl.push(this.createValue(group_indi)) @@ -98,15 +82,34 @@ export class QuesFormService { // } // sub_childControl.push(this.createValue(group_indi)) }) - console.log(control_names); + console.log(control_names, childControl.at(0)); + // debugger // val.questions[0]=val.question; - + if(childControl.value.length == 0) { + childControl.push(this._fb.group(control_names)) + } + else{ + // MERGINE THE 0 INDEX ARRAY WITH CHILD REPEATABLE + // control_names[childControl.at(0)] ='' + let previous_added_controls = childControl.at(0).controls + control_names = Object.assign(previous_added_controls,control_names) + console.log(control_names); + // debugger; + childControl.setControl(0,this._fb.group(control_names)) + } console.log(formgroup.value); // debugger; val.group_questions[0].forEach((group_indi,arr_index)=>{ console.log("sd",childControl,group_indi) + if(group_indi.is_repeatable == '2' && group_indi.hasOwnProperty('questions_level_two') && group_indi.questions_level_two.length > 0) { + group_indi.questions_level_two[0].forEach((child_val,child_index)=> { + this.addAdditionalControl(child_val, childControl.at(0).get(group_indi.group_key).controls[0], child_index) + }) + } + else{ this.addAdditionalControl(group_indi, childControl.controls[0], arr_index) + } }) // } @@ -175,7 +178,8 @@ export class QuesFormService { // else{ // control.push(this.createValue(val)) // } - console.log(formgroup) + console.log(formgroup,ques_data) + // debugger; } }, err => console.log(err)) @@ -183,6 +187,60 @@ export class QuesFormService { } // END OF FORM CREATION + // FUNCTIONAL TO HANDLE THE CREATION OF CHILD REPEABLE 2 + addLevelTwoControls(curr_obj:any,child_control,group_ques,valQues,group_index) { + console.log(child_control) + // CURR VALUE(MULTI ARRAY) + const question_temp:any = JSON.parse(JSON.stringify(curr_obj.questions_level_two)); + group_ques[group_index].questions_level_two = [] + group_ques[group_index].questions_level_two.push(question_temp) + group_ques[group_index].question = question_temp + + // RAW VALUES(SINGLE ARRAY) + valQues[group_index].question = question_temp + valQues[group_index].questions_level_two = [] + valQues[group_index].questions_level_two.push(question_temp) + console.log(group_ques[group_index],question_temp); + // debugger; + let group_key:any = {} + group_key[curr_obj.group_key] = this._fb.array([]) + child_control.push(this._fb.group(group_key)) + console.log(child_control) + console.log(child_control.at(0),child_control.controls[0].controls[curr_obj.group_key]) + // debugger; + let levelTwoChildCtrl: any = child_control.at(0).get(curr_obj.group_key) as FormArray + let control_names:any={} + curr_obj.questions_level_two[0].forEach((val,arr_index)=>{ + console.log("Level 2",val) + val.raw_validations = val.validations + control_names[val.question_key] = '' + + if (val.api_properties != null) { + if(val.api_properties.hasOwnProperty('purpose') && val.api_properties.purpose == 'answer_options_local') { + if(val.api_properties.master_name == 'pd_applicants') { + val.answers = (this.convertArrayNames( val.api_properties.fields,this.pd_all_details.pdapplicants_detials)) + // val.question[arr_index].answers = val.answers + } + } + else{ + this.apiPropertiesCall(val).then(res => { + if (res != false) { + val.answers = [] + // group_indi.answers=this.convertArrayNames(val.api_properties.fields,res) + val.answers = (this.convertArrayNames(val.api_properties.fields, res)) + // val.question[arr_index].answers = val.answers + + } + }) + } + } + + }) + console.log(group_ques[group_index]) + + levelTwoChildCtrl.push(this._fb.group(control_names)) + // console.log(formgroup.value); + } // FOR CREATING THE FORM CONTROL FOR SPECIFIC FORM ARRAY createValue(data){ @@ -227,6 +285,7 @@ export class QuesFormService { if(res['dataStatus']){ if(res.hasOwnProperty('records')){ res=res['records'] + // res.push({display:"Add New", id:"00",is_others:"-1"}) } if(val.api_properties.hasOwnProperty('filter_properties') && val.api_properties.filter_properties && res.length > 0) { let filter_properties = val.api_properties.filter_properties @@ -251,7 +310,19 @@ export class QuesFormService { return this.http.post(apiUrl+api_name,params) } else{ - return this.http.get(apiUrl+api_name) + let httpParams = new HttpParams() + if(params) { + let keysList = Object.keys(params) + if(keysList.length > 0) { + keysList.forEach(val=>{ + if(params[val] == 'VAR_PD_ID') { + params[val] = this.pd_all_details.pdmaster_details.pd_id + } + httpParams = httpParams.set(val,params[val]) + }) + } + } + return this.http.get(apiUrl+api_name,{params:httpParams}) } } @@ -265,7 +336,7 @@ export class QuesFormService { return { "answer_id" : obj[fieldName[0]], "answer":obj[fieldName[1]], - + "is_others":obj.is_others ? obj.is_others : '0' } }); return modified_json diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts index e0f186c..bc39124 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts @@ -42,6 +42,7 @@ export class FormComponent implements OnInit { private pdTriggerService:PdTrigerService, private awsService:AwsService,private loaderService:LoaderService) { // console.log(this.pd_all_details) + // debugger; this.form_id = 24; this.pd_all_details.pdmaster_details=this.pd_all_details.pdmaster_details[0] this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id; @@ -135,10 +136,17 @@ export class FormComponent implements OnInit { // this.commonFormGroup.patchValue(formValues) } } - + if(this.pd_all_details.pdmaster_details.re_uploaded == '1' && this.pd_all_details.is_reupload_data_fetched != '1') { + console.log("Reuploaded excel") + // let data = {"permanant_employees_person_met":"1","temporary_employees_person_met":"2","permanant_employees_cm":"3","temporary_employees_cm":"45","permanant_employees_salary":"55","temporary_employees_salary":"55","common_remarks":"dummy datas"} + // setTimeout(()=>{ + // this.commonFormGroup.patchValue(data) + // },1000) + this.getExcelData(1) + } }) } - getExcelData() { + getExcelData(re_uploaded?) { let params = {"pd_id":this.pd_all_details.pdmaster_details.pd_id,"random_string":this.pd_all_details.pdmaster_details.random_string,"form_id":this.pd_all_details.form_id} this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{ if(result['dataStatus']) { @@ -153,10 +161,15 @@ export class FormComponent implements OnInit { // }) console.log(formValues) // debugger; + if(re_uploaded && re_uploaded == '1') { + this.commonFormGroup.patchValue(formValues) + } + else { this.form_answers= formValues setTimeout(()=>{ this.form_answers = null },2500) + } // this.commonFormGroup.patchValue(formValues) } } @@ -278,7 +291,10 @@ export class FormComponent implements OnInit { return; } this.loaderService.showMatSpinnerDialog('') - let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id,"json":this.commonFormGroup.getRawValue(),createdby:''} + let params :any = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id,"json":this.commonFormGroup.getRawValue(),createdby:''} + if(this.pd_all_details.pdmaster_details.re_uploaded == '1') { + params.is_reupload_data_fetched = '1' + } this.pdTriggerService.saveSMCCreditPDsection(params).subscribe(result=>{ if(result['dataStatus']) { this.notifier.notify("success","Saved successfully..") diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.ts index a2530ee..c4d6fdc 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, Output, EventEmitter, Input, ElementRef, ViewChild } from '@angular/core'; import { CameraService } from 'app/personal-discussion/pd-service/camera.service'; +import { LoaderService } from 'app/shared/loaderService/loader.service'; import { Ng2ImgMaxService } from 'ng2-img-max'; @Component({ @@ -11,7 +12,7 @@ export class CaptureBtnComponent implements OnInit { @ViewChild('input_file') fileBtn :ElementRef @Input() addMoreBtn; @Output() imageDataEmitter = new EventEmitter - constructor(private ng2ImgMax:Ng2ImgMaxService,private cameraService:CameraService) { } + constructor(private ng2ImgMax:Ng2ImgMaxService,private loaderService:LoaderService) { } ngOnInit(): void { console.log(this.addMoreBtn) @@ -20,12 +21,16 @@ export class CaptureBtnComponent implements OnInit { // event.stopPropagation() console.log(event); let imageData= event.target.files[0] - this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe( + this.loaderService.showMatSpinnerDialog("Optimizing image..") + this.ng2ImgMax.resizeImage(imageData, 450, 650,true).subscribe( result => { + this.loaderService.closeMatSpinnerDialog(); this.imageDataEmitter.emit(result) }, error => { + this.loaderService.closeMatSpinnerDialog(); console.log('😢 Oh no!', error); + alert(JSON.stringify(error)) } ); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.ts index 61596cc..97000d0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.ts @@ -97,7 +97,7 @@ export class ImageCaptureComponent implements OnInit { // this.router.navigateByUrl('error'); // } addImage(event,index){ - this.loaderService.showMatSpinnerDialog(''); + this.loaderService.showMatSpinnerDialog('Processing watermark..'); console.log(event,index); var reader = new FileReader(); // let imagePath = event; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index 594b2d4..9a96289 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -22,7 +22,7 @@ {{quesIndex+1}}
- {{ formButton.form_name }} + {{ formButton.form_name }} *
- - - + + + + + +
@@ -234,7 +241,7 @@
- +
@@ -317,7 +324,7 @@
Applicants
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index 601524b..3ac999b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -5,9 +5,8 @@ import { MatDialog } from '@angular/material'; import { DatePipe } from '@angular/common'; import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from '../../../pd-service/pd-triger.service'; -// import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; -import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component'; -import { TelePdAllocationComponent } from './../tele-pd-allocation/tele-pd-allocation.component'; +import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; + import { ListPdComponent } from '../list-pd.component'; // import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component'; import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component'; @@ -20,6 +19,7 @@ import { InitiateAdditionalPdComponent } from './../initiate-additional-pd/initi import Swal from 'sweetalert2'; import { VideoPlayerComponent } from 'app/video-player/video-player.component'; import { AwsService } from 'app/AwsService/aws.service'; +import { ExcelUploadDialogComponent } from '../add-pd/excel-upload-dialog/excel-upload-dialog.component'; @Component({ selector: 'app-view-pd', @@ -123,6 +123,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { // } ] }; + userId: any; constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder, private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent, @@ -133,6 +134,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { } ngOnInit() { + this.userId = this._aws.getlocale() this.ListPdComponent.showListView(false); this.route.params.subscribe(params => { this.viewID = params['pdid']; @@ -284,6 +286,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { "pdID": this.viewID, "records": applicantData, "SegmentAbbr":CSAbbr, + lender_short_name:this.pdMasterData[0].lender_short_name } const dialogApplicant = this.dialog.open(EditPdApplicantComponent, { data: setPdDetails, @@ -433,10 +436,31 @@ export class ViewPdComponent implements OnInit, OnDestroy { } }); } + downloadPDReport() { + let data = { + "pd_id": this.viewID, + "random_string":this.pdMasterData[0].random_string + }; + this._pd.generatePDReportPDF(data).subscribe(data => { + if (data.dataStatus) { + window.open(data.records); + this.notifier.notify('success', 'Done Successfully..!'); + } else { + this.notifier.notify('warning', data.msg ? data.msg :'Something Went Wrong Try Again.!'); + } + }, err => { + this.notifier.notify('error', err.msg ? err.msg :'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!'); + // alert(err.html_format); + }); + } smcCreditPDReport(pd_id) { // this.destroyType = 3; // this.router.navigate(['../../../pd_report', pd_id,this.masterRandomString], { relativeTo: this.route }); + if(this.pdMasterData[0].lender_short_name != 'MWISE') { + this.downloadPDReport() + return + } let params = { "pd_id":pd_id,"fk_createdby":"","regenerate":"0"} this._pd.smcCreditPDReport(params).subscribe(result=>{ if(result.dataStatus) { @@ -504,9 +528,24 @@ else { } /** To update pd officer*/ - selfAllocation() { + selfAllocation(state_id) { + if(this.LenderRoleID == '27' || this.LenderRoleID == '25') { + const dialogRef1 = this.dialog.open(PdAllocationComponent, { + data: { pd_id:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly',state_id:state_id, lender_role_id:this.LenderRoleID }, + disableClose: true, + minWidth: '30%', + }) + dialogRef1.afterClosed().subscribe(rr=>{ + if(rr) { + this.viewPdDetails(this.viewID) + } + // this.notifier.notify("success","Allocated Successfully") + }) + } + else{ + // return; const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { - data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' }, + data: { pdid:this.viewID, pd_status: "CM_ALLOCATED",random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' }, disableClose: true, minWidth: '30%', // maxWidth: '40%', @@ -541,9 +580,23 @@ else { }); } }); + } } + openExcelUpload() { + const dialogRef = this.dialog.open(ExcelUploadDialogComponent,{ + data:{pd_id:this.viewID}, + minWidth:'50vw', + maxWidth:'75vw' + }) + dialogRef.afterClosed().subscribe(rr=>{ + if(rr.dataStatus) { + this.notifier.notify("success","Uploaded Successuflly") + } + }) + } + rejectPD() { const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { data: { pdid: this.viewID, pd_status: this.pdStatusCheck.BOUNCED,random_string:this.pdMasterData[0].random_string }, @@ -559,6 +612,32 @@ else { } }); } + allocateToCpa() { + const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { + data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' }, + disableClose: true, + minWidth: '30%', + // maxWidth: '40%', + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if (dataresult.update_status == true) { + // return; + let lenderMasterArray = { "pd_id": this.viewID,random_string:this.masterRandomString } + this._pd.editPdMasterDetails(lenderMasterArray, this.pdStatusCheck.TRIGGERED).subscribe(result => { + if (result.status == 200) { + this.notifier.notify('success', 'Updated successfully.'); + this.viewPdDetails(this.viewID); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); + } + }); + } // updateViewComponent(editBack:string) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index 2576df4..c653977 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -127,6 +127,7 @@ import { ExcelUploadDialogComponent } from './list-pd/add-pd/excel-upload-dialog import { SpeedDialFabComponent } from './list-pd/view-pd/speed-dial-fab/speed-dial-fab.component'; import { VideoPlayerComponent } from 'app/video-player/video-player.component'; import { MatVideoModule } from 'mat-video'; +import { PdAllocationComponent } from './list-pd/pd-allocation/pd-allocation.component'; /** * Custom angular notifier options @@ -174,7 +175,7 @@ const pdCustomNotifierOptions: NotifierOptions = { @NgModule({ declarations: [TelePdAllocationComponent, ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, PdReportComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, DeleteRecordsCountPipe, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent, ExcelUploadDialogComponent, - SpeedDialFabComponent,VideoPlayerComponent], + SpeedDialFabComponent,VideoPlayerComponent,PdAllocationComponent], imports: [ CommonModule, ManagePdRoutingModule, @@ -216,7 +217,8 @@ const pdCustomNotifierOptions: NotifierOptions = { {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective], - entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent,VideoPlayerComponent], + entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent,VideoPlayerComponent, + PdAllocationComponent], }) export class ManagePdModule { } \ No newline at end of file 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 433523d..ff8c53d 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 @@ -175,9 +175,9 @@ export class PdTrigerService { const Lender:any = entity_id ? { params: new HttpParams().set('lenderid', entity_id) } : { }; - if(LenderRoleID == '25') { - Lender.params = Lender.params.set('createdby',userid) - } + // if(LenderRoleID == '25') { + Lender.params = Lender && Lender.params ? Lender.params.set('createdby',userid) : {} + // } return this._http.get(this.apiUrl + "listLessPDDetails/get",Lender) .pipe( catchError(this.handleError('operation', [])) @@ -198,9 +198,9 @@ export class PdTrigerService { // { params: new HttpParams().set('createdby', userid) }; let paramHttp:any= entity_id && status ? {params : new HttpParams().set('lenderid', entity_id).set('status',status)} : {}; - if(LenderRoleID == '25') { + // if(LenderRoleID == '25') { paramHttp.params = paramHttp.params.set('createdby',userid) - } + // } return this._http.get(this.apiUrl + "listLessPDDetails/get", paramHttp) .pipe( catchError(this.handleError('operation', [])) @@ -656,9 +656,9 @@ export class PdTrigerService { overAllSearchFormDetails(searchItem) { let LenderRoleID : any = localStorage.getItem('LenderRoleID'); let userid=this._aws.getlocale() - if(LenderRoleID == '25') { + // if(LenderRoleID == '25') { searchItem.createdby = userid - } + // } let records = { 'records': searchItem }; return this._http.post(this.apiUrl + 'filterPDList', records).pipe( catchError(this.handleError('operation', [])) @@ -813,8 +813,12 @@ checkExistPDDetails(datas,entity_id){ return this._http.post(this.apiUrl+'checkExistPDDetails',{records:datas,client:entity_id}) .pipe(catchError(this.handleError("checkExistPDDetails",[]))) } -uploadSMCDataFile(file) { - let records = {"rand_key":"qwerty1234"} +uploadSMCDataFile(file,pd_id ?) { + // let records = {"rand_key":"qwerty1234"} + let records :any= {} + if(pd_id) { + records.fk_pd_id = pd_id + } let formData= new FormData() formData.append("pd_excel_data",file) formData.append("records",JSON.stringify(records)) @@ -882,6 +886,17 @@ loadTemplate(form_id) { return this._http.post(this.apiUrl+'updateTwlioVideoStatus',params) .pipe(catchError(this.handleError("updateTwlioVideoStatus",[]))) } - + getCMUsers(state_id,user_type):Observable { + let param = new HttpParams().set('state_id',state_id).set('usertype',user_type) + return this._http.get(this.apiUrl+"getCMUsers",{params:param}) + } + saveNewSMCTempAddresses(params) { + params = {records:params} + return this._http.post(this.apiUrl+'saveNewSMCTempAddresses',params) + } + getSMCTempAddresses(pd_id) { + let params = new HttpParams().set("pdid",pd_id) + return this._http.get(this.apiUrl+'getSMCTempAddresses',{params}) + } } diff --git a/ng6-seed/src/app/shared/loaderService/loader.service.ts b/ng6-seed/src/app/shared/loaderService/loader.service.ts index cd47194..1eb301c 100644 --- a/ng6-seed/src/app/shared/loaderService/loader.service.ts +++ b/ng6-seed/src/app/shared/loaderService/loader.service.ts @@ -20,6 +20,7 @@ export class LoaderService { this.loaderSubject.next({ show: false }); } showMatSpinnerDialog(message ?:String) { + this.closeMatSpinnerDialog(); this.spinnerdialogRef = this.dialog.open(ProgressSpineerDialogComponent, { data:message, panelClass: 'transparent', diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json index d721d63..a2857c1 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json @@ -90,6 +90,33 @@ } ] }, + { + "questions_level_two":[ + { + "question":"Mobile Number", + "question_key":"mobile_no", + "type":"1", + "field_type":"num", + "field_width":"100", + "onchange_properties":null, + "api_properties":null, + "answers":null, + "is_repeatable":null, + "validations":[ + { + "name":"pattern", + "isactive":"1", + "validator":"[0-9]{10}", + "message":"Mobile number should be 10 digit", + "value":null + } + ] + } + ], + "is_repeatable":"2", + "group_key":"mobile_numbers", + "group_title":"Mobile Number" + }, { "question":"Entity Type", "question_key":"entity_type", diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json index 8eba7e4..ab829b2 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json @@ -1,808 +1,693 @@ -{ - "section_id":"10", - "section_name":"Financial Information", - "onsubmit":[ - { - "expression":"(function (){let sum_val=null;let ques_key=[];control.forEach(ques_obj=>{ques_key.push(ques_obj[submitProperty.key_name])});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())", - "group_key":"financial_info", - "key_name":"fy", - "msg":"Financial Year already entered earlier" +{ + "section_id": "10", + "section_name": "Financial Information", + "onsubmit": [ + { + "expression": "(function (){let sum_val=null;let ques_key=[];if(!control || control == undefined || control == null){return true};control.forEach(ques_obj=>{ques_key.push(ques_obj[submitProperty.key_name])});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())", + "group_key": "financial_info", + "key_name": "fy", + "msg": "Financial Year already entered earlier" } ], - "questions":[ - { - "question":"Number of financial years for which we have financials", - "question_key":"no_of_financial_years", - "place_holder":"Enter the number", - "type":"1", - "field_width":"45", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - }, - { - "name":"pattern", - "isactive":"1", - "validator":"[0-9]*", - "message":"alphabets only ", - "value":null - } - ] - }, + "questions": [ + { + "question":"Is the Financial information available?", + "question_key":"financial_info_available", + "type":"2", + "field_width":"45", + "api_properties":null, + "onchange_properties":[ { - "question":[ - { - "question":"Enter FY", - "question_key":"fy", - "type":"3", - "field_width":"45", - "answers":[ - - ], - "answer_value":"GET_FY_YEARS", - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Fin Yr Required", - "value":null - } - ] - }, - { - "question":"Sales / Revenue (Rs)", - "question_key":"sales_revenue", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", - "value_keys":[ - "sales_revenue","net_profit" - ], - "insert_control":"net_profit_sales_percent" - }, - { - "purpose":"answer_value_arr", - "arr_include":["py","now"], - "expression":"((Number(sales_revenue[now])-Number(sales_revenue[py]))/Number(sales_revenue[py]))*100", - "value_keys":[ - "sales_revenue" - ], - "insert_control":"sales_py" - }, - { - "purpose":"answer_value_arr", - "arr_include":["py","now"], - "expression":"(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", - "value_keys":[ - "net_profit_sales_percent" - ], - "insert_control":"netprofit_py_percent" - } - ], - "is_repeatable":null, - "field_type":"numtoword", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - { - "question":"Net Profit / (Net Loss) (Rs) ", - "question_key":"net_profit", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", - "value_keys":[ - "sales_revenue","net_profit" - ], - "insert_control":"net_profit_sales_percent" - }, - { - "purpose":"answer_value_arr", - "arr_include":["py","now"], - "expression":"((Number(net_profit[now])-Number(net_profit[py]))/Number(net_profit[py]))*100", - "value_keys":[ - "net_profit" - ], - "insert_control":"netprofit_py" - }, - { - "purpose":"answer_value_arr", - "arr_include":["py","now"], - "expression":"(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", - "value_keys":[ - "net_profit_sales_percent" - ], - "insert_control":"netprofit_py_percent" - } - ], - "is_repeatable":null, - "field_type":"numtoword", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - { - "question":"Net Profit or (Net Loss) to Sales % ", - "question_key":"net_profit_sales_percent", - "type":"1", - "is_disabled":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":[ - { - "purpose":"answer_value_arr", - "arr_include":["py","now"], - "expression":"(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", - "value_keys":[ - "net_profit_sales_percent" - ], - "insert_control":"netprofit_py_percent" - } - ], - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"% (↑ /↓) in Sales over PY", - "question_key":"sales_py", - "type":"1", - "is_disabled":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"% (↑ /↓) in Net Profit over PY", - "question_key":"netprofit_py", - "type":"1", - "is_disabled":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - { - "question":"% (↑ /↓) in Net Profit % over PY", - "question_key":"netprofit_py_percent", - "type":"1", - "is_disabled":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - - { - "question":"Debtor Days as per CET", - "sub_title":"In Case of credit sales, what is the average no. of days taken to receive the money?", - "question_key":"debtor_days_cet", - "type":"1", - "field_width":"100", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"Creditor Days as per CET", - "sub_title":"In Case of credit purchases, what is the average no. of days taken to pay the money?", - "question_key":"creditor_days_cet", - "type":"1", - "field_width":"100", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - { - "question":"Inventory Days as per CET", - "sub_title":"What is the average no. of days for which stock lies unsold during the year?", - "question_key":"inventory_days_cet", - "type":"1", - "field_width":"100", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - } - - - - ], - "is_repeatable":"1", - "group_key":"financial_info", - "group_title":"Financial Information" - }, - { - "question":"Debtor Days as per CM Discussion", - "question_key":"debtor_days_cm", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"Creditor Days as per CM Discussion", - "question_key":"creditor_days_cm", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"Inventory Days as per CM Discussion", - "question_key":"inventory_days_cm", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - { - "question":"Broken Period starting from (Date)", - "question_key":"broken_period_from_month", - "type":"1", - "field_width":"45", - "place_holder":"DD-MM-YYYY (Eg 05-02-2020)", - "answers":null, - "api_properties":null, - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())", - "value_keys":[ - "broken_period_to_month", "broken_period_from_month" - ], - "insert_control":"broken_period_no_of_months" - } - ], - "is_repeatable":null, - "field_type":"string", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - { - "question":"Broken Period starting to (Date)", - "question_key":"broken_period_to_month", - "type":"1", - "place_holder":"DD-MM-YYYY (Eg 03-12-2020)", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())", - "value_keys":[ - "broken_period_to_month", "broken_period_from_month" - ], - "insert_control":"broken_period_no_of_months" - } - ], - "is_repeatable":null, - "field_type":"string", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - { - "question":"No of Months", - "question_key":"broken_period_no_of_months", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"Turnover for Broken Period in CY (Rs)", - "question_key":"broken_period_turnover_cy", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)", - "value_keys":[ - "broken_period_turnover_py","broken_period_turnover_cy" - ], - "insert_control":"broken_period_turnover_percent" - } - ], - "is_repeatable":null, - "field_type":"numtoword", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"Turnover for Broken Period in PY (Rs)", - "question_key":"broken_period_turnover_py", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)", - "value_keys":[ - "broken_period_turnover_py","broken_period_turnover_cy" - ], - "insert_control":"broken_period_turnover_percent" - } - ], - "is_repeatable":null, - "field_type":"numtoword", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"Increase / Decrease in Turnover for Broken Period %", - "question_key":"broken_period_turnover_percent", - "type":"1", - "field_width":"45", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - { - "question":"Does the business have any working capital facility from any lender other than Moneywise?", - "question_key":"is_any_other_working_captial_facility", - "type":"2", - "field_width":"45", - "answers":[ - { - "answer":"Yes", - "answer_id":"Yes" - }, - { - "answer":"No", - "answer_id":"No" - } - ], - "api_properties":null, - "onchange_properties":[ - { - "purpose":"FORM_CTRL", - "form_controls":[ + "purpose":"FORM_CTRL", + "form_controls":[ + { + "insert_index":"financial_info_available", + "expression":"(String('financial_info_available') == String('Yes'))", + "value_keys":[ + "financial_info_available" + ], + "questions":[ { - "insert_index":"is_any_other_working_captial_facility", - "expression":"(String('is_any_other_working_captial_facility') === String('Yes'))", - "value_keys":[ - "is_any_other_working_captial_facility" - ], - "questions":[ - { - "question":"Details of above facilities need to be entered", - "question_key":"facility_details_specify", - "type":"7", - "placeholder":"Enter the text", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "is_subfield":"1", - "parent_question_key":"is_any_other_working_captial_facility", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null + "question": "Net Profit / (Net Loss) (Rs)", + "question_key": "net_profit_rs", + "place_holder": "Enter the text", + "type": "1", + "field_width": "45", + "api_properties": null, + "answers": null, + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ], + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "((Number(net_profit_rs)/Number(sales_amount))*100).toFixed(2)", + "value_keys": [ + "sales_amount", + "net_profit_rs" + ], + "insert_control": "net_profit_to_sales_percent" + } + ] + }, + { + "question": "Net Profit or (Net Loss) to Sales % ", + "question_key": "net_profit_to_sales_percent", + "place_holder": "Enter number", + "type": "1", + "field_width": "45", + "api_properties": null, + "answers": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(Number(sales_amount)*Number(net_profit_to_sales_percent))/100", + "value_keys": [ + "sales_amount", + "net_profit_to_sales_percent" + ], + "insert_control": "net_profit_rs" + } + ], + "is_repeatable": null, + "field_type": "num", + "validations": [ + + { + "name": "max", + "validator": "100", + "isactive": "1", + "message": "Number must be less than 100", + "value": null + } + ] + }, + { + "question": "Sales / Revenue (Rs)", + "sub_title": "Particulars of Financials for Latest Year as per person met during PD visit", + "question_key": "sales_amount", + "place_holder": "Enter text", + "type": "1", + "field_width": "100", + "field_type": "numtoword", + "api_properties": null, + "answers": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(function (){let final_value; Number(net_profit_to_sales_percent) ? final_value = (Number(sales_amount)*Number(net_profit_to_sales_percent))/100 : '';return final_value}())", + "value_keys": [ + "sales_amount", + "net_profit_to_sales_percent" + ], + "insert_control": "net_profit_rs" + }, + { + "purpose": "answer_value", + "expression": "(function (){let final_value; Number(net_profit_rs) ? final_value = (Number(net_profit_rs)/Number(sales_amount))*100 : '';return final_value.toFixed(2)}())", + "value_keys": [ + "sales_amount", + "net_profit_rs" + ], + "insert_control": "net_profit_to_sales_percent" + } + ], + "is_repeatable": null, + "validations": [ + + ] + }, + { + "question": "Does the business have any working capital facility from any lender other than Moneywise?", + "question_key": "is_any_other_working_captial_facility", + "type": "2", + "field_width": "45", + "answers": [ + { + "answer": "Yes", + "answer_id": "Yes" + }, + { + "answer": "No", + "answer_id": "No" + } + ], + "api_properties": null, + "onchange_properties": [ + { + "purpose": "FORM_CTRL", + "form_controls": [ + { + "insert_index": "is_any_other_working_captial_facility", + "expression": "(String('is_any_other_working_captial_facility') === String('Yes'))", + "value_keys": [ + "is_any_other_working_captial_facility" + ], + "questions": [ + { + "question": "Details of above facilities need to be entered", + "question_key": "facility_details_specify", + "type": "7", + "placeholder": "Enter the text", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "is_subfield": "1", + "parent_question_key": "is_any_other_working_captial_facility", + "validations": [ + + ] + }, + { + "question": "Facility details i.e. Letter of Credit/ Bank guarantee, CC limit etc.", + "question_key": "facility_details_other_lender", + "type": "3", + "field_width": "45", + "answers": [ + { + "answer": "Letter of Credit", + "answer_id": "Letter of Credit" + }, + { + "answer": "Bank guarantee", + "answer_id": "Bank guarantee" + }, + { + "answer": "CC limit", + "answer_id": "CC limit" + }, + { + "answer": "Others", + "answer_id": "Others" + } + ], + "api_properties": null, + "onchange_properties": [ + { + "purpose": "FORM_CTRL", + "form_controls": [ + { + "insert_index": "facility_details_other_lender", + "expression": "(String('facility_details_other_lender').toLowerCase() == String('others'))", + "value_keys": [ + "facility_details_other_lender" + ], + "questions": [ + { + "question": "Specify Facility details", + "question_key": "facility_details_other", + "type": "1", + "field_width": "45", + "field_type": "string", + "api_properties": null, + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "is_subfield": "1", + "parent_question_key": "facility_details_other_lender", + "validations": [] + } + ] + } + ] + } + ], + "is_repeatable": null, + "is_subfield": "1", + "parent_question_key": "is_any_other_working_captial_facility", + "validations": [ + + ] + } + ] } - + ] + } + ], + "is_repeatable": null, + "validations": [ + + ] + }, + { + "question": "Increase / Decrease in Turnover for Broken Period %", + "question_key": "broken_period_turnover_percent", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Turnover for Broken Period in PY (Rs)", + "question_key": "broken_period_turnover_py", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)", + "value_keys": [ + "broken_period_turnover_py", + "broken_period_turnover_cy" + ], + "insert_control": "broken_period_turnover_percent" + } + ], + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ] + }, + { + "question": "Turnover for Broken Period in CY (Rs)", + "question_key": "broken_period_turnover_cy", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)", + "value_keys": [ + "broken_period_turnover_py", + "broken_period_turnover_cy" + ], + "insert_control": "broken_period_turnover_percent" + } + ], + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ] + }, + { + "question": "No of Months", + "question_key": "broken_period_no_of_months", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Broken Period starting to (Date)", + "question_key": "broken_period_to_month", + "type": "1", + "place_holder": "DD-MM-YYYY (Eg 03-12-2020)", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())", + "value_keys": [ + "broken_period_to_month", + "broken_period_from_month" + ], + "insert_control": "broken_period_no_of_months" + } + ], + "is_repeatable": null, + "field_type": "string", + "validations": [ + + ] + }, + { + "question": "Broken Period starting from (Date)", + "question_key": "broken_period_from_month", + "type": "1", + "field_width": "45", + "place_holder": "DD-MM-YYYY (Eg 05-02-2020)", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())", + "value_keys": [ + "broken_period_to_month", + "broken_period_from_month" + ], + "insert_control": "broken_period_no_of_months" + } + ], + "is_repeatable": null, + "field_type": "string", + "validations": [ + + ] + }, + { + "question": "Inventory Days as per CM Discussion", + "question_key": "inventory_days_cm", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Creditor Days as per CM Discussion", + "question_key": "creditor_days_cm", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Debtor Days as per CM Discussion", + "question_key": "debtor_days_cm", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": [ + { + "question": "Enter FY", + "question_key": "fy", + "type": "3", + "field_width": "45", + "answers": [], + "answer_value": "GET_FY_YEARS", + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ ] }, - { - "question":"Facility details i.e. Letter of Credit/ Bank guarantee, CC limit etc.", - "question_key":"facility_details_other_lender", - "type":"3", - "field_width":"45", - "answers":[ - { - "answer":"Letter of Credit", - "answer_id":"Letter of Credit" - }, - { - "answer":"Bank guarantee", - "answer_id":"Bank guarantee" - }, - { - "answer":"CC limit", - "answer_id":"CC limit" - }, - { - "answer":"Others", - "answer_id":"Others" - } - ], - "api_properties":null, - "onchange_properties": [ - { - "purpose":"FORM_CTRL", - "form_controls":[{ - "insert_index":"facility_details_other_lender", - "expression":"(String('facility_details_other_lender').toLowerCase() == String('others'))", - "value_keys":[ - "facility_details_other_lender" - ], - "questions":[ - { - "question": "Specify Facility details", - "question_key": "facility_details_other", - "type": "1", - "field_width": "45", - "field_type": "string", - "api_properties": null, - "answers": null, - "onchange_properties": null, - "is_repeatable": null, - "validations": [ - ] - } - ] - }] - } - ], - "is_repeatable":null, - "is_subfield":"1", - "parent_question_key":"is_any_other_working_captial_facility", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - } - - ] + { + "question": "Sales / Revenue (Rs)", + "question_key": "sales_revenue", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", + "value_keys": [ + "sales_revenue", + "net_profit" + ], + "insert_control": "net_profit_sales_percent" + }, + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "((Number(sales_revenue[now])-Number(sales_revenue[py]))/Number(sales_revenue[py]))*100", + "value_keys": [ + "sales_revenue" + ], + "insert_control": "sales_py" + }, + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", + "value_keys": [ + "net_profit_sales_percent" + ], + "insert_control": "netprofit_py_percent" + } + ], + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ] + }, + { + "question": "Net Profit / (Net Loss) (Rs) ", + "question_key": "net_profit", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", + "value_keys": [ + "sales_revenue", + "net_profit" + ], + "insert_control": "net_profit_sales_percent" + }, + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "((Number(net_profit[now])-Number(net_profit[py]))/Number(net_profit[py]))*100", + "value_keys": [ + "net_profit" + ], + "insert_control": "netprofit_py" + }, + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", + "value_keys": [ + "net_profit_sales_percent" + ], + "insert_control": "netprofit_py_percent" + } + ], + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ] + }, + { + "question": "Net Profit or (Net Loss) to Sales % ", + "question_key": "net_profit_sales_percent", + "type": "1", + "is_disabled": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", + "value_keys": [ + "net_profit_sales_percent" + ], + "insert_control": "netprofit_py_percent" + } + ], + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "% Variation in Sales over PY", + "question_key": "sales_py", + "type": "1", + "is_disabled": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "% Variation in Net Profit over PY", + "question_key": "netprofit_py", + "type": "1", + "is_disabled": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Variation in Net Profit % over PY", + "question_key": "netprofit_py_percent", + "type": "1", + "is_disabled": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Debtor Days as per CET", + "sub_title": "In Case of credit sales, what is the average no. of days taken to receive the money?", + "question_key": "debtor_days_cet", + "type": "1", + "field_width": "100", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Creditor Days as per CET", + "sub_title": "In Case of credit purchases, what is the average no. of days taken to pay the money?", + "question_key": "creditor_days_cet", + "type": "1", + "field_width": "100", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Inventory Days as per CET", + "sub_title": "What is the average no. of days for which stock lies unsold during the year?", + "question_key": "inventory_days_cet", + "type": "1", + "field_width": "100", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + } + ], + "is_repeatable": "1", + "group_key": "financial_info", + "group_title": "Financial Information" + }, + { + "question": "Number of financial years for which we have financials", + "question_key": "no_of_financial_years", + "place_holder": "Enter the number", + "type": "1", + "field_width": "45", + "api_properties": null, + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + { + "name": "pattern", + "isactive": "1", + "validator": "[0-9]*", + "message": "Numeric only ", + "value": null + } + ] } - ] - } - ], - "is_repeatable":null, - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - - ] - }, - - { - "question":"Sales / Revenue (Rs)", - "sub_title":"Particulars of Financials for Latest Year as per person met during PD visit", - "question_key":"sales_amount", - "place_holder":"Enter text", - "type":"1", - "field_width":"100", - "field_type":"numtoword", - "api_properties":null, - "answers":null, - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"(function (){let final_value; Number(net_profit_to_sales_percent) ? final_value = (Number(sales_amount)*Number(net_profit_to_sales_percent))/100 : '';return final_value}())", - "value_keys":[ - "sales_amount", "net_profit_to_sales_percent" - ], - "insert_control":"net_profit_rs" - }, - { - "purpose":"answer_value", - "expression":"(function (){let final_value; Number(net_profit_rs) ? final_value = (Number(net_profit_rs)/Number(sales_amount))*100 : '';return final_value.toFixed(2)}())", - "value_keys":[ - "sales_amount", "net_profit_rs" - ], - "insert_control":"net_profit_to_sales_percent" - } - ], - "is_repeatable":null, - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - }, - { - "question":"Net Profit or (Net Loss) to Sales % ", - "question_key":"net_profit_to_sales_percent", - "place_holder":"Enter number", - "type":"1", - "field_width":"45", - "api_properties":null, - "answers":null, - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"(Number(sales_amount)*Number(net_profit_to_sales_percent))/100", - "value_keys":[ - "sales_amount", "net_profit_to_sales_percent" - ], - "insert_control":"net_profit_rs" - } - ], - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - }, - { - "name":"max", - "validator":"100", - "isactive":"1", - "message":"Number must be less than 100", - "value":null - } - ] - }, - { - "question":"Net Profit / (Net Loss) (Rs)", - "question_key":"net_profit_rs", - "place_holder":"Enter the text", - "type":"1", - "field_width":"45", - "api_properties":null, - "answers":null, - "is_repeatable":null, - "field_type":"numtoword", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ], - "onchange_properties":[ - { - "purpose":"answer_value", - "expression":"((Number(net_profit_rs)/Number(sales_amount))*100).toFixed(2)", - "value_keys":[ - "sales_amount", "net_profit_rs" - ], - "insert_control":"net_profit_to_sales_percent" - } - ] - }, - { - "question_key":"common_remarks", - "question":"Remarks", - "place_holder":"Enter the text", - "type":"7", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "field_width":"45", - "validations":[ - ] - } + ] + }] + }], + "is_repeatable":null, + "answers":[{ + "answer":"Yes", + "answer_id":"Yes" + }, + { + "answer":"No", + "answer_id":"No" + }], + "validations":[ - ] - } \ No newline at end of file + ] + }, + + + + + { + "question_key": "common_remarks", + "question": "Remarks", + "place_holder": "Enter the text", + "type": "7", + "api_properties": null, + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "string", + "field_width": "45", + "validations": [] + } + ] +} \ No newline at end of file diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json index 90266e9..e23f725 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json @@ -31,13 +31,7 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] } ] }, { @@ -63,13 +57,7 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -84,13 +72,7 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -105,13 +87,7 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -151,13 +127,13 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"pattern", - "isactive":"1", - "validator":"[0-9]{10,12}", - "message":"Mobile number should be 10-12 digit", - "value":null - } + { + "name":"pattern", + "isactive":"1", + "validator":"[0-9]{10,12}", + "message":"Mobile number should be 10-12 digit", + "value":null + } ] }, { @@ -174,13 +150,13 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"pattern", - "isactive":"1", - "validator":"[0-9]{3,5}", - "message":"Maximum 5 digit allowed", - "value":null - } + { + "name":"pattern", + "isactive":"1", + "validator":"[0-9]{3,5}", + "message":"Maximum 5 digit allowed", + "value":null + } ] }, { @@ -196,13 +172,13 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"pattern", - "isactive":"1", - "validator":"[0-9]{6,8}", - "message":"Maximum 8 digit allowed", - "value":null - } + { + "name":"pattern", + "isactive":"1", + "validator":"[0-9]{6,8}", + "message":"Maximum 8 digit allowed", + "value":null + } ] }, { @@ -244,13 +220,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -266,13 +236,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - }, + { "name":"max", "isactive":"1", @@ -289,13 +253,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -323,13 +281,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ], @@ -352,13 +304,7 @@ "answer_id":"No" }], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json index cffc0d9..8522211 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json @@ -31,13 +31,7 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] } ] }, { @@ -63,13 +57,7 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -84,13 +72,7 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -105,13 +87,7 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -244,13 +220,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -266,13 +236,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - }, + { "name":"max", "isactive":"1", @@ -289,13 +253,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -323,13 +281,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ], @@ -352,13 +304,7 @@ "answer_id":"No" }], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json index 46ceb5b..3b10ab1 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json @@ -32,13 +32,7 @@ "parent_question_key": "stock_info_available", "answers": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field required", - "value": null - } + ] } ] @@ -80,13 +74,7 @@ } ], "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field required", - "value": null - } + ] } ] @@ -125,13 +113,7 @@ } ], "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field required", - "value": null - } + ] }, { @@ -145,13 +127,7 @@ "is_repeatable": null, "field_type": "string", "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Required", - "value": null - } + ] }, { @@ -171,13 +147,7 @@ ], "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Required", - "value": null - } + ], "onchange_properties": [ { @@ -222,13 +192,7 @@ "parent_question_key": "provider_observed", "answers": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Either Estimated Stock value or Estimated Quantity is required", - "value": null - } + ] }, { @@ -314,13 +278,7 @@ } ], "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field required", - "value": null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/2.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/2.json index 75642aa..40302fa 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/2.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/2.json @@ -37,14 +37,24 @@ "is_pd_done_on_initiated_address" ], "questions":[ - { - "question":"Enter actual PD address", + { + "question":"Choose the actual PD address", "question_key":"alternative_address", "place_holder":"", "field_type":"string", - "type":"7", + "type":"3", "field_width":"100", - "api_properties":null, + "api_properties":{ + "api":"getSMCTempAddresses", + "api_method":"GET", + "params":{ + "pdid":"VAR_PD_ID" + }, + "fields":[ + "display", + "display" + ] + }, "onchange_properties":null, "is_repeatable":null, "is_subfield":"1", @@ -90,7 +100,7 @@ "question":"Type of PD address", "question_key":"address_type", "type":"3", - "field_width":"45", + "field_width":"90", "api_properties":{ "api":"getListOfMaster", "api_method":"POST", diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json index 57cd83a..7032ca8 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json @@ -36,13 +36,7 @@ "parent_question_key":"total_fund_requirement", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -51,13 +45,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -71,13 +59,7 @@ "answers":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -100,13 +82,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -119,13 +95,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -161,13 +131,7 @@ "parent_question_key":"total_fund_requirement", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -175,13 +139,7 @@ }], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -224,13 +182,7 @@ "parent_question_key":"is_transfer", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -253,13 +205,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -273,13 +219,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] } ] @@ -288,13 +228,7 @@ }], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -307,13 +241,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -331,13 +259,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -371,13 +293,7 @@ "parent_question_key":"construction_status", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -386,13 +302,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -407,13 +317,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -428,114 +332,33 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { - "question":"Address of the proposed property", - "question_key":"address", - "place_holder":"Enter door no,street", - "type":"7", - "answers":null, - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Address Required", - "value":null - } - ] - }, - { - "question":"State", - "question_key":"state", - "type":"8", - "field_width":"45", - "answers":null, - "api_properties":{ - "api":"getListOfMaster", - "api_method":"POST", - "params":{ - "master_name":"STATE" - }, - "fields":[ - "state_id", - "name" - ] - }, - "onchange_properties":[ - { - "purpose":"api", - "api":"getListOfStatesAndCities", - "api_method":"POST", - "params":"{records:{state_id:'value_of_answer'}}", - "fields":[ - "state_id", - "name" - ], - "local_variable":"local_city" - } - ], - "is_repeatable":null, - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"State Required", - "value":null - } - ] - }, - { - "question":"City", - "question_key":"city", - "type":"8", - "field_width":"45", - "answers":null, - "api_properties":"local_city", - "onchange_properties":null, - "is_repeatable":null, - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"CIty Required", - "value":null - } - ] - }, - { - "question":"Pincode", - "question_key":"pincode", - "type":"8", - "field_width":"45", - "answers":null, - "api_properties":"local_pincode", - "onchange_properties":null, - "is_repeatable":null, - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Pincode Required", - "value":null - } - ] - }, + "question":"Address of the proposed property", + "question_key":"address", + "place_holder":"", + "field_type":"string", + "type":"3", + "field_width":"100", + "api_properties":{ + "api":"getSMCTempAddresses", + "api_method":"GET", + "params":{ + "pdid":"VAR_PD_ID" + }, + "fields":[ + "display", + "display" + ] + }, + "onchange_properties":null, + "is_repeatable":null, + "answers":null, + "validations":[ + ] + }, { "question":"Property Usage", "question_key":"property_usage", @@ -548,13 +371,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -569,13 +386,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/4.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/4.json index 83dc374..e9a8470 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/4.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/4.json @@ -96,6 +96,29 @@ "seasonality" ], "questions":[ + { + "question_key":"low_sale_month_reason", + "question":"Reason for Months in which sales/services is low?", + "place_holder":"Enter the text", + "type":"1", + "api_properties":null, + "answers":null, + "onchange_properties":null, + "is_repeatable":null, + "field_type":"string", + "is_subfield":"1", + "field_width":"45", + "parent_question_key":"seasonality", + "validations":[ + { + "name":"required", + "isactive":"1", + "validator":"Validators.required", + "message":"Required", + "value":null + } + ] + }, { "question_key":"low_sale_month", "question":"Months in which sales/services is low?", @@ -167,30 +190,8 @@ "value":null } ] - }, - { - "question_key":"low_sale_month_reason", - "question":"Reason for Months in which sales/services is low?", - "place_holder":"Enter the text", - "type":"1", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "is_subfield":"1", - "field_width":"45", - "parent_question_key":"seasonality", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - } + } + ] } ] diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json index 66ce862..d2c09c7 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json @@ -13,13 +13,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -47,6 +41,22 @@ "is_business_address" ], "questions":[ + { + "question":"No of Months", + "question_key":"business_months", + "place_holder":"", + "field_type":"num", + "type":"1", + "field_width":"45", + "api_properties":null, + "onchange_properties":null, + "is_repeatable":null, + "is_subfield":"1", + "parent_question_key":"is_business_address", + "answers":null, + "validations":[ + ] + }, { "question":"No of Years", "sub_title":"How Long has business been operated from visited premises? (Eg. If operating for 5 years and 4 months enter 5 in Years field and 4 in months field)", @@ -62,31 +72,9 @@ "parent_question_key":"is_business_address", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, - { - "question":"No of Months", - "question_key":"business_months", - "place_holder":"", - "field_type":"num", - "type":"1", - "field_width":"45", - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "is_subfield":"1", - "parent_question_key":"is_business_address", - "answers":null, - "validations":[ - ] - }, { "question":"Was any business activities seen during visit?", "question_key":"business_is_pd_visited", @@ -120,13 +108,7 @@ "parent_question_key":"business_is_pd_visited", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -144,13 +126,7 @@ "answer_id":"No" }], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -186,13 +162,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -212,13 +182,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -293,13 +257,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -331,13 +289,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -359,13 +311,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -375,13 +321,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -466,22 +406,25 @@ "question_key":"property_address", "place_holder":"", "field_type":"string", - "type":"7", - "field_width":"45", - "api_properties":null, + "type":"3", + "field_width":"100", + "api_properties":{ + "api":"getSMCTempAddresses", + "api_method":"GET", + "params":{ + "pdid":"VAR_PD_ID" + }, + "fields":[ + "display", + "display" + ] + }, "onchange_properties":null, "is_repeatable":null, "is_subfield":"1", "parent_question_key":"property_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } ] } ] @@ -508,13 +451,7 @@ "parent_question_key":"property_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -526,13 +463,7 @@ "parent_question_key":"business_assets_mode", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -588,13 +519,7 @@ "parent_question_key":"vehicle_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -606,13 +531,7 @@ "parent_question_key":"business_assets_mode", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -623,13 +542,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -676,13 +589,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -702,13 +609,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -785,13 +686,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -822,13 +717,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -850,13 +739,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }], "is_repeatable":"1", @@ -878,13 +761,7 @@ "answer_id":"No" }], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json index 2bc77da..95c2d22 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json @@ -1,143 +1,117 @@ { - "section_id": "9", - "section_name": "Business and Personal Banking Details", - "onsubmit": [], - "questions": [ - { - "question": [ - { - "question": "Account holder name", - "question_key": "applicant_name", - "type": "1", - "api_properties": { - "purpose": "answer_options_local", - "master_name": "pd_applicants", - "fields": [ - "pd_co_applicant_id", - "applicant_name" - ] - }, - "answers": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "string", - "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Required", - "value": null - } - ] - }, - { - "question": "Bank Name", - "question_key": "bank_name", - "type": "1", - "field_width": "45", - "api_properties": null, - "answers": null, - "onchange_properties": null, - "is_repeatable": null, - "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } - ] - }, - { - "question": "Account type", - "question_key": "account_type", - "type": "3", - "field_width": "45", - "api_properties":null, - "answers": [ - { - "answer":"Savings", - "answer_id":"Savings" - }, - { - "answer":"OD", - "answer_id":"OD" + "section_id": "9", + "section_name": "Business and Personal Banking Details", + "onsubmit": [], + "questions": [ + { + "question": [ + { + "question": "Account holder name", + "question_key": "applicant_name", + "type": "1", + "api_properties": { + "purpose": "answer_options_local", + "master_name": "pd_applicants", + "fields": [ + "pd_co_applicant_id", + "applicant_name" + ] }, - { - "answer":"Current", - "answer_id":"Current" - }, - { - "answer":"CC", - "answer_id":"CC" - } - ], - "onchange_properties": [ - { - "purpose":"FORM_CTRL", - "form_controls":[{ - "insert_index":"account_type", - "expression":"(String('account_type').toLowerCase() != String('savings') && String('account_type').toLowerCase() != String('current'))", - "value_keys":[ - "account_type" - ], - "questions":[ + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "string", + "validations": [ + ] + }, + { + "question": "Bank Name", + "question_key": "bank_name", + "type": "1", + "field_width": "45", + "api_properties": null, + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "validations": [ + ] + }, + { + "question": "Account type", + "question_key": "account_type", + "type": "3", + "field_width": "45", + "api_properties": null, + "answers": [ + { + "answer": "Savings", + "answer_id": "Savings" + }, + { + "answer": "OD", + "answer_id": "OD" + }, + { + "answer": "Current", + "answer_id": "Current" + }, + { + "answer": "CC", + "answer_id": "CC" + } + ], + "onchange_properties": [ + { + "purpose": "FORM_CTRL", + "form_controls": [ { - "question": "OD/CC Limit", - "question_key": "cc_limit", - "type": "1", - "field_width": "45", - "field_type": "num", - "api_properties": null, - "answers": null, - "onchange_properties": null, - "is_repeatable": null, - "validations": [ + "insert_index": "account_type", + "expression": "(String('account_type').toLowerCase() != String('savings') && String('account_type').toLowerCase() != String('current'))", + "value_keys": [ + "account_type" + ], + "questions": [ { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null + "question": "OD/CC Limit", + "question_key": "cc_limit", + "type": "1", + "field_width": "45", + "field_type": "num", + "api_properties": null, + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "validations": [ + + ] } ] } - ] - }] - } - ], - "is_repeatable": null, - "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } - ] - } - - ], - "is_repeatable": "1", - "group_title": "Banking Details", - "group_key": "banking_details" - }, - { - "question_key":"common_remarks", - "question":"Remarks", - "place_holder":"Enter the text", - "type":"7", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "field_width":"45", - "validations":[ - ] - } - ] + ] + } + ], + "is_repeatable": null, + "validations": [ + + ] + } + ], + "is_repeatable": "1", + "group_title": "Banking Details", + "group_key": "banking_details" + }, + { + "question_key": "common_remarks", + "question": "Remarks", + "place_holder": "Enter the text", + "type": "7", + "api_properties": null, + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "string", + "field_width": "45", + "validations": [] + } + ] } \ No newline at end of file diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json index a8828b9..02954cb 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json @@ -36,13 +36,7 @@ "parent_question_key":"total_fund_requirement", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -51,13 +45,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -71,13 +59,7 @@ "answers":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -90,13 +72,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -132,13 +108,7 @@ "parent_question_key":"total_fund_requirement", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -146,13 +116,7 @@ }], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, {