@ -47,7 +47,7 @@ export class WarningStatisticsListComponent implements OnInit {
let lastD = lw . getDate ( ) ;
this . startdate = JSON . parse ( JSON . stringify ( lastY + "-" + ( lastM < 10 ? "0" + lastM : lastM ) + "-" + ( lastD < 10 ? "0" + lastD : lastD ) ) ) ; //三十天之前日期
this . validateForm = this . fb . group ( {
state : [ '0' ] ,
eventSystemName : null ,
organization : [ null ] ,
datePicker : [ [ this . startdate , this . enddate ] ]
} ) ;
@ -470,6 +470,7 @@ export class WarningStatisticsListComponent implements OnInit {
defaultOrId : string
//获取所有组织机构
nodes : any = [ ]
eventSystemNameOption = [ ]
getAllOrganization() {
let OrganizationUnitId = sessionStorage . getItem ( 'isGasStation' ) == 'true' ? JSON . parse ( sessionStorage . getItem ( 'userdataOfgasstation' ) ) . organization.id : JSON.parse ( sessionStorage . getItem ( 'userdata' ) ) . organization . id
let params = {
@ -494,14 +495,20 @@ export class WarningStatisticsListComponent implements OnInit {
} ) ;
this . http . get ( '/api/services/app/Violation/GetAllList' ) . subscribe ( ( data : any ) = > {
console . log ( '预警事件' , data . result )
let option1
let option2
data . result . forEach ( element = > {
if ( element . eventSystemName == '证照预警' ) {
this . licenseId = element . id
option1 = element . id
}
if ( element . eventSystemName == '灭火器维护' ) {
this . equipmentId = element . id
option2 = element . id
}
} ) ;
this . eventSystemNameOption = [
{ id : option1 , name : '证照预警' } ,
{ id : option2 , name : '消防设施预警' } ,
]
this . list = [ ]
this . SkipCount = '0'
this . getLicenseList ( )
@ -530,20 +537,23 @@ export class WarningStatisticsListComponent implements OnInit {
} else {
organizationUnitId = this . validateForm . value . organization
}
let ViolationIds = [ ]
if ( this . validateForm . value . state == '0' ) {
ViolationIds = [ this . licenseId ]
console . log ( 456 , this . validateForm . value )
if ( this . validateForm . value . eventSystemName ) {
ViolationIds . push ( this . validateForm . value . eventSystemName )
} else {
ViolationIds = [ this . equipmentId ]
this . eventSystemNameOption . forEach ( element = > {
ViolationIds . push ( element . id )
} ) ;
}
console . log ( '查询日期' , this . validateForm . value . datePicker )
let params = {
ViolationIds : ViolationIds ,
organizationUnitId : organizationUnitId ,
ViolateTime : ( this . validateForm . value . datePicker [ 0 ] && this . validateForm . value . datePicker [ 1 ] ) ? [ moment ( this . validateForm . value . datePicker [ 0 ] ) . format ( 'yyyy-MM-DD HH:mm:ss' ) , moment ( this . validateForm . value . datePicker [ 1 ] ) . format ( 'yyyy-MM-DD HH:mm:ss' ) ] : null ,
IsContainsChildren : 'true' ,
SkipCount : '0' ,
MaxResultCount : '9999 '
SkipCount : this.SkipCount ,
MaxResultCount : '50 '
}
this . http . get ( '/api/services/app/ViolateRecord/GetAll' , {
params : params
@ -559,19 +569,6 @@ export class WarningStatisticsListComponent implements OnInit {
} )
}
isLicenseTable = true
tableChange ( $event ) {
console . log ( '走了几遍' )
this . SkipCount = '0'
this . list = [ ]
if ( $event == 0 ) {
this . isLicenseTable = true
} else {
this . isLicenseTable = false
}
this . getLicenseList ( )
}
submitForm ( ) : void {
for ( const i in this . validateForm . controls ) {
@ -581,10 +578,9 @@ export class WarningStatisticsListComponent implements OnInit {
this . list = [ ]
this . SkipCount = '0'
this . getLicenseList ( )
}
resetForm ( e : MouseEvent ) : void {
e . preventDefault ( ) ;
for ( const key in this . validateForm . controls ) {
@ -594,9 +590,12 @@ export class WarningStatisticsListComponent implements OnInit {
console . log ( '赋值日期' , [ this . startdate , this . enddate ] )
this . validateForm . patchValue ( {
datePicker : [ this . startdate , this . enddate ] ,
state : '0' ,
eventSystemName : null ,
organization : JSON.parse ( sessionStorage . getItem ( 'userdata' ) ) . organization . id
} ) ;
this . list = [ ]
this . SkipCount = '0'
this . getLicenseList ( )
}
ngAfterViewInit ( ) : void {
fromEvent ( this . element . nativeElement . querySelector ( ` #tbody ` ) as HTMLCanvasElement , 'scroll' ) . pipe ( debounceTime ( 100 ) ) . subscribe ( ( event : any ) = > { //监听 DOM 滚动事件
@ -612,6 +611,7 @@ export class WarningStatisticsListComponent implements OnInit {
}
look ( item ) {
console . log ( item )
if ( item . violation . eventSystemName == '证照预警' ) {
const modal = this . modal . create ( {
nzContent : GetOutOfLineDetailsComponent ,
nzWrapClassName : "vertical-center-modal" ,
@ -633,11 +633,14 @@ export class WarningStatisticsListComponent implements OnInit {
}
} ) ;
const instance = modal . getContentComponent ( ) ;
} else {
this . dispose ( item )
}
}
//处置消防设施
dispose ( item ) {
console . log ( item )
const modal = this . modal . create ( {
nzContent : DisposeequipmentComponent ,
nzViewContainerRef : this.viewContainerRef ,
@ -715,6 +718,8 @@ export class WarningStatisticsListComponent implements OnInit {
} ) ;
const instance = modal . getContentComponent ( ) ;
}
goOilList() {
if ( this . router . url . indexOf ( 'petrolStation' ) != - 1 ) {
this . router . navigate ( [ '/records/petrolStation/oliunloadinglist' ] )