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