From 58fb99cc5b20f80b678476c935d920c9534afb6d Mon Sep 17 00:00:00 2001 From: Alex beart Date: Thu, 16 Mar 2023 23:22:24 +0530 Subject: [PATCH] issue screen with other Small fixes --- src/app/app.module.ts | 8 +- src/app/dashboard/dashboard.component.ts | 2 +- .../new-edit-device.component.ts | 2 +- .../issue-add/issue-add.component.html | 100 ++++++ .../issue-add/issue-add.component.scss | 111 +++++++ .../issue-add/issue-add.component.spec.ts | 25 ++ .../issue-add/issue-add.component.ts | 70 +++++ .../issue-list/issue-list.component.html | 62 ++++ .../issue-list/issue-list.component.scss | 109 +++++++ .../issue-list/issue-list.component.spec.ts | 25 ++ .../issue-list/issue-list.component.ts | 292 ++++++++++++++++++ .../kyc-approval/kyc-approval.component.html | 10 +- .../kyc-approval.component.spec.ts | 12 +- .../kyc-approval/kyc-approval.component.ts | 3 + src/app/location/location.component.ts | 2 +- 15 files changed, 820 insertions(+), 13 deletions(-) create mode 100644 src/app/kyc-approval/issue-add/issue-add.component.html create mode 100644 src/app/kyc-approval/issue-add/issue-add.component.scss create mode 100644 src/app/kyc-approval/issue-add/issue-add.component.spec.ts create mode 100644 src/app/kyc-approval/issue-add/issue-add.component.ts create mode 100644 src/app/kyc-approval/issue-list/issue-list.component.html create mode 100644 src/app/kyc-approval/issue-list/issue-list.component.scss create mode 100644 src/app/kyc-approval/issue-list/issue-list.component.spec.ts create mode 100644 src/app/kyc-approval/issue-list/issue-list.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 70504a0..665fc26 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -281,6 +281,8 @@ import { DownloadCertificateComponent } from './dashboard/download-certificate/d import { DeviceSettingComponent } from './device-setting/device-setting.component'; import { UserSettingComponent } from './user-setting/user-setting.component'; import { IndexingReportComponent } from './indexingReport/index-report.component'; +import { IssueListKycComponent } from './kyc-approval/issue-list/issue-list.component'; +import { IssueAddKycComponent } from './kyc-approval/issue-add/issue-add.component'; // import { DisatanceReportComponent } from './report/disatance-report/disatance-report.component'; // import { MainComponent } from './report/main/main.component'; // import { AcReportsComponent } from './report/ac-report/ac-report.component'; @@ -533,6 +535,8 @@ export function createTranslateLoader(http: Http) { RtoMasterComponent, DeviceKYCComponent, DeviceDocComponent, + IssueAddKycComponent, + IssueListKycComponent, NewRoutePlanReportComponent, ModelMasterComponent, TrackedUntrackedVehiclesComponent, @@ -621,8 +625,8 @@ export function createTranslateLoader(http: Http) { ], schemas: [ NO_ERRORS_SCHEMA ], - entryComponents:[PoiDtlDelComponent,EditDeviceMasterComponent,AcreportInfoComponent,GpsEditMasterComponent,RenewalHistoryComponent,PoiMenuComponent,ExpenseComponentComponent, - AddpoiBylocationComponent,CreateTripComponent,CommentWindowComponent,DetailComponent,DailyDetailsComponent,RenewVehicleComponent,ViewCustomerDetailsComponent,OtpScreenComponent,DeviceDocComponent,TrackedUntrackedVehiclesComponent,DownloadCertificateComponent, + entryComponents:[IssueAddKycComponent, PoiDtlDelComponent,EditDeviceMasterComponent,AcreportInfoComponent,GpsEditMasterComponent,RenewalHistoryComponent,PoiMenuComponent,ExpenseComponentComponent, + AddpoiBylocationComponent,CreateTripComponent,CommentWindowComponent,DetailComponent,DailyDetailsComponent,RenewVehicleComponent,ViewCustomerDetailsComponent,OtpScreenComponent,DeviceDocComponent,IssueAddKycComponent,IssueListKycComponent,TrackedUntrackedVehiclesComponent,DownloadCertificateComponent, AnnouncementComponent,SelectUntrackVehiclesComponent,ExpenselistComponent,AddPlanComponent,AddDriverComponent,ShowPullDataLinkComponent,HualtListComponent,ShoRoutePlanComponent,EChalanComponent,TrackedVehiclesComponent,ViewCertificateComponent,], providers: [/* AuthService , */ AlertService, Data, SimpleTimer,DatainjectionService,ContactService,ReportService, { provide: MD_DIALOG_DATA, useValue: {} }, diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 35d6f9c..7e6db58 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -1694,7 +1694,7 @@ testTable() { "data":null, "defaultContent": "", "render":function(data,type,row){ - if(row.kycStatus && row.kycStatus=="Approved") { + if(row.kycStatus && row.kycStatus=="Approved" && !that.superAdmin) { return '' } else { diff --git a/src/app/dashboard/new-edit-device/new-edit-device.component.ts b/src/app/dashboard/new-edit-device/new-edit-device.component.ts index 9df8d7c..c12a1b0 100644 --- a/src/app/dashboard/new-edit-device/new-edit-device.component.ts +++ b/src/app/dashboard/new-edit-device/new-edit-device.component.ts @@ -407,7 +407,7 @@ export class NewEditDeviceComponent implements OnInit { Mileage : "10", phn: this.deviceForm.value.contactNo, sim_number: this.deviceForm.value.contactNo, - created_by: this.userId, + created_by: this.deviceData.created_by && this.deviceData.created_by._id ? this.deviceData.created_by : this.userId, supAdmin: this.sup_admin, // driver_name: this.driver, // contact_number: this.dcontact, diff --git a/src/app/kyc-approval/issue-add/issue-add.component.html b/src/app/kyc-approval/issue-add/issue-add.component.html new file mode 100644 index 0000000..33ccb9a --- /dev/null +++ b/src/app/kyc-approval/issue-add/issue-add.component.html @@ -0,0 +1,100 @@ +
+
+
+
+ + +
+ + + +
+ +
+ Required field. +
+
+
+
+ + +
+
+ Required field. +
+
+
+
+ + +
+
+ Required field. +
+
+
+
+ + +
+
+ Required field. +
+
+
+
+ + +
+
+ Required field. +
+
+
+
+ + +
+
+ Required field. +
+
+
+ +
+ + + +
+
+
\ No newline at end of file diff --git a/src/app/kyc-approval/issue-add/issue-add.component.scss b/src/app/kyc-approval/issue-add/issue-add.component.scss new file mode 100644 index 0000000..566f0df --- /dev/null +++ b/src/app/kyc-approval/issue-add/issue-add.component.scss @@ -0,0 +1,111 @@ +.headStyle { + text-align: center; + font-size: 22px; + font-weight: 500; + margin-top: 10px; + color: #6b6a6a; +} +.error-msg { + color: red; +} +.InputStyle { + padding: 10px; + padding-bottom: 20px; + background-color: #efefef; + margin-bottom: 10px; + .selecStyle { + display: inherit; + width: 56%; + padding-left: 16px; + margin-left: 50px; + + border-radius: 10px; + } +} + +.topDiv { + padding-top: 59px; + background: whitesmoke; + height: 100vh; +} + +.rowStyle { + // margin: 5px; + // background: white; + height: 84vh; + // box-shadow: 3px 1px 5px 0px #b2b0ae; +} + +#deviceTable input { + border-radius: 5px; +} + +::-webkit-scrollbar { + width: 10px; +} + +/* Track */ +::-webkit-scrollbar-track { + background: rgb(153, 153, 153); +} + +/* Handle */ +::-webkit-scrollbar-thumb { + // background: rgb(74, 118, 184); + background: #868e96; +} + +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { + background: #555; +} + +#toast { + visibility: hidden; + max-width: 150px; + height: 50px; + /*margin-left: -125px;*/ + margin: auto; + background-color: #333; + color: #fff; + text-align: center; + border-radius: 2px; + + position: fixed; + z-index: 1; + left: 60%; + right: 0; + bottom: 80%; + font-size: 13px; + white-space: nowrap; +} +#toast #img { + width: 150px; + height: 150px; + + float: left; + + padding-top: 16px; + padding-bottom: 16px; + + box-sizing: border-box; + + background-color: #111; + color: #fff; +} +#toast #desc { + color: #fff; + + padding: 16px; + + overflow: hidden; + white-space: nowrap; +} + +#toast.show { + visibility: visible; + -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, + fadeout 0.5s 2.5s; + animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, + fadeout 0.5s 4.5s; +} diff --git a/src/app/kyc-approval/issue-add/issue-add.component.spec.ts b/src/app/kyc-approval/issue-add/issue-add.component.spec.ts new file mode 100644 index 0000000..f7dd662 --- /dev/null +++ b/src/app/kyc-approval/issue-add/issue-add.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { IssueListKycComponent } from './issue-list.component'; + +describe('IssueListKycComponent', () => { + let component: IssueListKycComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ IssueListKycComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IssueListKycComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/kyc-approval/issue-add/issue-add.component.ts b/src/app/kyc-approval/issue-add/issue-add.component.ts new file mode 100644 index 0000000..7d13df7 --- /dev/null +++ b/src/app/kyc-approval/issue-add/issue-add.component.ts @@ -0,0 +1,70 @@ +import { Component, OnInit, TemplateRef } from '@angular/core'; +import { BsDatepickerConfig, BsModalRef, BsModalService } from 'ngx-bootstrap'; + +declare var $: any; +declare var swal: any +import * as moment from 'moment'; +import { ContactService } from '../../contact.service'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { MdDialogRef } from '@angular/material'; +@Component({ + selector: 'app-issue-add-kyc', + templateUrl: './issue-add.component.html', + styleUrls: ['./issue-add.component.scss'] +}) +export class IssueAddKycComponent implements OnInit { + issues=[]; + + bsConfig: Partial; + issueForm:FormGroup; + userId + colorTheme = 'theme-dark-blue'; + Load: boolean; + constructor(private contactService:ContactService,private dialogRef: MdDialogRef) { + this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY, h:mm:ss a' }, { containerClass: this.colorTheme }); + this.issueForm = new FormGroup({ + VehicleNo:new FormControl('',[Validators.required,]), + DeviceIMEI:new FormControl('',[Validators.required,]), + email:new FormControl('',[Validators.required,]), + mobile:new FormControl('',[Validators.required,]), + fileName:new FormControl(''), + msg:new FormControl('',[Validators.required,]), + }) + } + get VehicleNo() { return this.issueForm.get('VehicleNo'); } + get DeviceIMEI() { return this.issueForm.get('DeviceIMEI'); } + get email() { return this.issueForm.get('email'); } + get mobile() { return this.issueForm.get('mobile'); } + get fileName() { return this.issueForm.get('fileName'); } + get msg() { return this.issueForm.get('msg'); } + + ngOnInit() { + + this.userId= JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id; + // this.getIssues() + } + submit() { + if(this.issueForm.valid) { + let postObj = this.issueForm.value; + postObj.user = this.userId + this.contactService.post('/customer_support/post_inquiry',postObj).subscribe(res=>{ + console.log(res); + swal({ + title: 'Saved!', + html: 'Your Issue has been Created.', + icon: 'success' + }) + this.dialogRef.close() + + }) + } + } + + + + + + + + +} diff --git a/src/app/kyc-approval/issue-list/issue-list.component.html b/src/app/kyc-approval/issue-list/issue-list.component.html new file mode 100644 index 0000000..eaa3bfa --- /dev/null +++ b/src/app/kyc-approval/issue-list/issue-list.component.html @@ -0,0 +1,62 @@ +
+
+
+

{{'Issue List' | translate}}

+
+
+ +
+
+
+
+ +
+
+
+ + + +
+
+
+
+ + + +
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + +
{{'Ticket ID'|translate}} {{'Posted By'|translate}} {{'Email'|translate}} {{'Phone'|translate}} {{'Posted On' | translate}}{{'Assigned To' | translate}}{{'Message' | translate}}{{'Status' | translate}}{{'Remark' | translate}}{{'Closed Date' | translate}}{{'Update Status' | translate}}
+ + +
+ diff --git a/src/app/kyc-approval/issue-list/issue-list.component.scss b/src/app/kyc-approval/issue-list/issue-list.component.scss new file mode 100644 index 0000000..ab6827e --- /dev/null +++ b/src/app/kyc-approval/issue-list/issue-list.component.scss @@ -0,0 +1,109 @@ +.headStyle { + text-align: center; + font-size: 22px; + font-weight: 500; + margin-top: 10px; + color: #6b6a6a; +} + +.InputStyle { + padding: 10px; + padding-bottom: 20px; + background-color: #efefef; + margin-bottom: 10px; + .selecStyle { + display: inherit; + width: 56%; + padding-left: 16px; + margin-left: 50px; + + border-radius: 10px; + } +} + +.topDiv { + padding-top: 59px; + background: whitesmoke; + height: 100vh; +} + +.rowStyle { + // margin: 5px; + // background: white; + height: 84vh; + // box-shadow: 3px 1px 5px 0px #b2b0ae; +} + +#deviceTable input { + border-radius: 5px; +} + +::-webkit-scrollbar { + width: 10px; +} + +/* Track */ +::-webkit-scrollbar-track { + background: rgb(153, 153, 153); +} + +/* Handle */ +::-webkit-scrollbar-thumb { + // background: rgb(74, 118, 184); + background: #868e96; +} + +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { + background: #555; +} + +#toast { + visibility: hidden; + max-width: 150px; + height: 50px; + /*margin-left: -125px;*/ + margin: auto; + background-color: #333; + color: #fff; + text-align: center; + border-radius: 2px; + + position: fixed; + z-index: 1; + left: 60%; + right: 0; + bottom: 80%; + font-size: 13px; + white-space: nowrap; +} +#toast #img { + width: 150px; + height: 150px; + + float: left; + + padding-top: 16px; + padding-bottom: 16px; + + box-sizing: border-box; + + background-color: #111; + color: #fff; +} +#toast #desc { + color: #fff; + + padding: 16px; + + overflow: hidden; + white-space: nowrap; +} + +#toast.show { + visibility: visible; + -webkit-animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 2s, + fadeout 0.5s 2.5s; + animation: fadein 0.5s, expand 0.5s 0.5s, stay 3s 1s, shrink 0.5s 4s, + fadeout 0.5s 4.5s; +} diff --git a/src/app/kyc-approval/issue-list/issue-list.component.spec.ts b/src/app/kyc-approval/issue-list/issue-list.component.spec.ts new file mode 100644 index 0000000..f7dd662 --- /dev/null +++ b/src/app/kyc-approval/issue-list/issue-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { IssueListKycComponent } from './issue-list.component'; + +describe('IssueListKycComponent', () => { + let component: IssueListKycComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ IssueListKycComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IssueListKycComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/kyc-approval/issue-list/issue-list.component.ts b/src/app/kyc-approval/issue-list/issue-list.component.ts new file mode 100644 index 0000000..c66f616 --- /dev/null +++ b/src/app/kyc-approval/issue-list/issue-list.component.ts @@ -0,0 +1,292 @@ +import { Component, OnInit, TemplateRef } from '@angular/core'; +import { BsDatepickerConfig, BsModalRef, BsModalService } from 'ngx-bootstrap'; +import {MdDialog} from '@angular/material'; +declare var $: any; +declare var swal: any +import * as moment from 'moment'; +import { ContactService } from '../../contact.service'; +import { IssueAddKycComponent } from '../issue-add/issue-add.component'; +@Component({ + selector: 'app-issue-list-kyc', + templateUrl: './issue-list.component.html', + styleUrls: ['./issue-list.component.scss'] +}) +export class IssueListKycComponent implements OnInit { + issues=[]; + modalRef: BsModalRef; + bsConfig: Partial; + fromDate=new Date(); + toDate=new Date(); + tabelObj: any; + userId + colorTheme = 'theme-dark-blue'; + Load: boolean; + constructor(private contactService:ContactService,private modalService: BsModalService,private dialog:MdDialog) { + this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY, h:mm:ss a' }, { containerClass: this.colorTheme }); + } + + ngOnInit() { + var fTime = new Date(); + fTime.setHours(0,0,0,0); + this.fromDate = new Date(fTime); + + var today = new Date(); + var startDate = new Date(today.getFullYear(), today.getMonth(), 1); + this.fromDate=startDate + this.userId= JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id; + // this.getIssues() + this.testTable() + } + + getIssues(){ + + + this.contactService.get("/customer_support/getIssues?user="+this.userId+"&from="+this.fromDate+"&to="+this.toDate).subscribe((res:any)=>{ + console.log(res); + this.issues=res; + }) + } + + + addIssue(): void { + const dialogRef = this.dialog.open(IssueAddKycComponent, { + data: {}, + }); + + dialogRef.afterClosed().subscribe(result => { + this.testTable(); + }); + } + testTable() { + const that = this; + console.log("inside function"); + $(document).ready(function () { + that.tabelObj = $('#deviceTable').DataTable({ + // dom: 'Bfrtip', + // buttons: [ 'copy', 'csv', 'ex cel', 'pdf', 'print' ], + "autoWidth": true, + 'deferRender':true, + "processing": true, + "searching": true, + pagingType: 'full_numbers', + pageLength: 25, + serverSide: false, + "scrollX": true, + "scrollY": '65vh', + "scrollCollapse": true, + lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], + "rowCallback": function(row: Node, data: any | Object, index: number){ + $('#edit', row).bind('click', () => { + + console.log(data); + + var body={} + if(data.support_status=='OPEN'){ + body={ + title: "Update Status", + // text: "Please Enter Solution Remark:", + // input: 'text', + showCancelButton: true , + confirmButtonColor: 'green', + confirmButtonText:'IN PROGRESS' + } + }else{ + body={ + title: "Update Status", + text: "Please Enter Solution Remark:", + input: 'text', + showCancelButton: true , + confirmButtonColor: 'green', + + } + } + // var req={ + // id:data._id, + // ticketStatus:'RESOLVED' + // } + // that.contactService.post('/customer_support/updateCustomerQuery',req).subscribe(res=>{ + // console.log(res); + // that.tabelObj.ajax.reload() + // }) + swal(body + // { + // // title: 'Are you sure?', + // title: "Update Status", + // text: "Please Enter Solution Remark:", + // input: 'text', + // showCancelButton: true , + // confirmButtonColor: 'green', + // } + ).then((result) =>{ + if(result){ + console.log(result); + var req={ + id:data._id, + solutionRemarks:data.support_status=='OPEN'?undefined:result, + ticketStatus:data.support_status=='OPEN'?'IN PROGRESS':'CLOSE' + } + that.contactService.post('/customer_support/updateCustomerQuery',req).subscribe(res=>{ + console.log(res); + that.tabelObj.ajax.reload() + }) + + }else{ + console.log(result); + } + + }) + + }); + }, + ajax: (dataTablesParameters, callback) => { + console.log('temptemptemptemptemp', dataTablesParameters); + that.Load = true; + var suburl = ""; + that.contactService.get("/customer_support/getIssues?user="+that.userId+"&from="+that.fromDate+"&to="+that.toDate).subscribe((res:any)=>{ + console.log(res); + that.issues=res; + for(var i=0;i`; + } else{ + button=``; + } + return button + } + }, + + ], + "columnDefs": [ + { className: "dt-body-left", "targets": [0,1,2,3,4,5,6,7,8,9,10] }, + { + "targets": '_all', + "createdCell": function (td, cellData, rowData, row, col) { + $(td).css('padding', '18px') + } + }, + { "width": "10px", "targets": 0 }, + { "width": "40px", "targets": 1 }, + { "width": "100px", "targets": 2 }, + { "width": "70px", "targets": 3 }, + { "width": "70px", "targets": 4 }, + { "width": "70px", "targets": 5 }, + { "width": "70px", "targets": 6 }, + { "width": "70px", "targets": 7 }, + { "width": "70px", "targets": 8 }, + { "width": "70px", "targets": 9 }, + { "width": "70px", "targets": 10 }, + + ], order: [[ 4, 'desc' ], [ 0, 'asc' ]] + }); + + }); + + } + changeDate(){ + console.log("chabjhdsb",this.toDate,this.fromDate); + + this.tabelObj.ajax.reload(); + } + + openModal(template: TemplateRef,data) { + this.modalRef = this.modalService.show(template,{'backdrop':'static',class:'modal-lg modal-dialog-centered'}); + + } + + + +} diff --git a/src/app/kyc-approval/kyc-approval.component.html b/src/app/kyc-approval/kyc-approval.component.html index a02454f..c0cbd6a 100644 --- a/src/app/kyc-approval/kyc-approval.component.html +++ b/src/app/kyc-approval/kyc-approval.component.html @@ -26,7 +26,10 @@ Customer KYC --> + @@ -50,7 +53,7 @@
{{ data_descip }}
Loading…
-
+