From 601385232fc07a9bf23bbb0eae5ed4c52b78844b Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Thu, 17 Feb 2022 08:59:47 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E8=BF=87=E6=9C=9F=E6=8E=A8=E9=80=81=E7=9A=84=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=A4=84=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../criminal-records-admin.component.html | 2 +- .../criminal-records-admin.component.ts | 123 ++++-- .../criminal-records.component.html | 2 +- .../criminal-records.component.ts | 121 ++++-- src/app/pages/home/home.component.html | 5 +- src/app/pages/home/home.component.ts | 119 +++++- .../oil-station-info.component.html | 16 +- .../oil-station-info.component.scss | 2 +- .../oil-station-info.component.ts | 25 +- .../oil-unloading-process-list.component.html | 10 +- src/app/pages/pages.module.ts | 13 +- .../today-warning-admin.component.ts | 118 ++++-- .../today-warning/today-warning.component.ts | 115 +++++- .../disposeequipment.component.html | 69 ++++ .../disposeequipment.component.scss | 89 +++++ .../disposeequipment.component.ts | 46 +++ .../warning-statistics-list.component.html | 140 ++++--- .../warning-statistics-list.component.scss | 5 + .../warning-statistics-list.component.ts | 366 ++++++++++-------- src/theme.less | 6 +- 20 files changed, 1036 insertions(+), 356 deletions(-) create mode 100644 src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.html create mode 100644 src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.scss create mode 100644 src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.ts diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.html b/src/app/pages/criminal-records-admin/criminal-records-admin.component.html index 7bb32b7..b9d7056 100644 --- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.html +++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.html @@ -9,7 +9,7 @@
预警类型统计 卸油统计 - + 证照预警统计
diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts b/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts index f1ecf8e..6113888 100644 --- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts +++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts @@ -14,6 +14,7 @@ import { OilUnloadingProcessComponent } from '../oil-unloading-process/oil-unloa import { DispositionComponent } from '../disposition/disposition.component'; import { NzMessageService } from 'ng-zorro-antd/message'; import { TreeService } from 'src/app/service/tree.service'; +import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component'; @Component({ selector: 'app-criminal-records-admin', templateUrl: './criminal-records-admin.component.html', @@ -586,34 +587,102 @@ export class CriminalRecordsAdminComponent implements OnInit { look(item) { - // GetOutOfLineDetailsComponent - // OilUnloadingProcessComponent - // if (!item.violateImage && !item.violateVideo) { - // this.message.create('warning', '没有预警照片或视频!'); - // } else { + console.log('点击item', item) + if (item.violation.eventSystemName == '灭火器维护') { + item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot) + const modal = this.modal.create({ + nzContent: DisposeequipmentComponent, + nzViewContainerRef: this.viewContainerRef, + nzWidth: 380, + nzBodyStyle: { + 'border': '1px solid #91CCFF', + 'border-radius': '0px', + 'padding': '7px', + 'box-shadow': '0 0 8px 0 #fff', + 'background-image': 'linear-gradient(#003665, #000f25)' + }, + nzComponentParams: { + data: item + }, + nzFooter: null, + nzClosable: false, + nzOnOk: async () => { + if (instance.isScrap) { + let body = { + id: item.violatedItemSnapshotObj.id, + isScrapped: true, + organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: '报废成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + this.message.create('success', '报废成功!'); + item.handleTime = new Date() + return true + }) + }) + } else { + if (instance.validateForm.valid) { + await new Promise(resolve => { + let body = { + id: item.violatedItemSnapshotObj.id, + name: instance.validateForm.value.name, + specification: instance.validateForm.value.specification, + productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), + purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), + validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), + organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: '维保成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + resolve(data) + this.message.create('success', '维保成功!'); + item.handleTime = new Date() + return true + }) + }) + }) + } else { + this.message.create('warning', '请填写完整!'); + return false + } + } + } + }); + const instance = modal.getContentComponent(); + } else { + const modal = this.modal.create({ + nzContent: GetOutOfLineDetailsComponent, + nzWrapClassName: "vertical-center-modal", + nzViewContainerRef: this.viewContainerRef, + nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, + nzBodyStyle: { + 'border': '1px solid #6d9cc7', + 'border-radius': '0px', + 'padding': '0px', + 'box-shadow': '0 0 8px 0 #fff', + 'background': '#000D21', + }, + nzComponentParams: { + data: item + }, + nzFooter: null, + nzOnOk: async () => { - // } - const modal = this.modal.create({ - nzContent: GetOutOfLineDetailsComponent, - nzWrapClassName: "vertical-center-modal", - nzViewContainerRef: this.viewContainerRef, - nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, - nzBodyStyle: { - 'border': '1px solid #6d9cc7', - 'border-radius': '0px', - 'padding': '0px', - 'box-shadow': '0 0 8px 0 #fff', - 'background': '#000D21', - }, - nzComponentParams: { - data: item - }, - nzFooter: null, - nzOnOk: async () => { + } + }); + const instance = modal.getContentComponent(); + } - } - }); - const instance = modal.getContentComponent(); } @@ -657,7 +726,7 @@ export class CriminalRecordsAdminComponent implements OnInit { goOilList() { this.router.navigate(['/records/oliunloadinglist']) } - goWarningList(){ + goWarningList() { this.router.navigate(['/records/warningstatisticslist']) } diff --git a/src/app/pages/criminal-records/criminal-records.component.html b/src/app/pages/criminal-records/criminal-records.component.html index 02bf4d6..5c33b51 100644 --- a/src/app/pages/criminal-records/criminal-records.component.html +++ b/src/app/pages/criminal-records/criminal-records.component.html @@ -8,7 +8,7 @@
预警类型统计 卸油统计 - + 证照预警统计
diff --git a/src/app/pages/criminal-records/criminal-records.component.ts b/src/app/pages/criminal-records/criminal-records.component.ts index 5f9ec6d..5434fb8 100644 --- a/src/app/pages/criminal-records/criminal-records.component.ts +++ b/src/app/pages/criminal-records/criminal-records.component.ts @@ -10,6 +10,7 @@ import { debounceTime } from 'rxjs/operators'; import { Router } from '@angular/router'; import { DispositionComponent } from '../disposition/disposition.component'; import { NzMessageService } from 'ng-zorro-antd/message'; +import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component'; @Component({ selector: 'app-criminal-records', templateUrl: './criminal-records.component.html', @@ -532,39 +533,107 @@ export class CriminalRecordsComponent implements OnInit { } look(item) { + if (item.violation.eventSystemName == '灭火器维护') { + item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot) + const modal = this.modal.create({ + nzContent: DisposeequipmentComponent, + nzViewContainerRef: this.viewContainerRef, + nzWidth: 380, + nzBodyStyle: { + 'border': '1px solid #91CCFF', + 'border-radius': '0px', + 'padding': '7px', + 'box-shadow': '0 0 8px 0 #fff', + 'background-image': 'linear-gradient(#003665, #000f25)' + }, + nzComponentParams: { + data: item + }, + nzFooter: null, + nzClosable: false, + nzOnOk: async () => { + if (instance.isScrap) { + let body = { + id: item.violatedItemSnapshotObj.id, + isScrapped: true, + organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: '报废成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + this.message.create('success', '报废成功!'); + item.handleTime = new Date() + return true + }) + }) + } else { + if (instance.validateForm.valid) { + await new Promise(resolve => { + let body = { + id: item.violatedItemSnapshotObj.id, + name: instance.validateForm.value.name, + specification: instance.validateForm.value.specification, + productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), + purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), + validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), + organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: '维保成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + resolve(data) + this.message.create('success', '维保成功!'); + item.handleTime = new Date() + return true + }) + }) + }) + } else { + this.message.create('warning', '请填写完整!'); + return false + } + } + } + }); + const instance = modal.getContentComponent(); + } else { + const modal = this.modal.create({ + nzContent: GetOutOfLineDetailsComponent, + nzWrapClassName: "vertical-center-modal", + nzViewContainerRef: this.viewContainerRef, + nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, + nzBodyStyle: { + 'border': '1px solid #6d9cc7', + 'border-radius': '0px', + 'padding': '0px', + 'box-shadow': '0 0 8px 0 #fff', + 'background': '#000D21', + }, + nzComponentParams: { + data: item + }, + nzFooter: null, + nzOnOk: async () => { - // if (!item.violateImage && !item.violateVideo) { - // this.message.create('warning', '没有预警照片或视频!'); - // } else { - - // } - const modal = this.modal.create({ - nzContent: GetOutOfLineDetailsComponent, - nzWrapClassName: "vertical-center-modal", - nzViewContainerRef: this.viewContainerRef, - nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, - nzBodyStyle: { - 'border': '1px solid #6d9cc7', - 'border-radius': '0px', - 'padding': '0px', - 'box-shadow': '0 0 8px 0 #fff', - 'background': '#000D21', - }, - nzComponentParams: { - data: item - }, - nzFooter: null, - nzOnOk: async () => { + } + }); + const instance = modal.getContentComponent(); + } - } - }); - const instance = modal.getContentComponent(); } goOilList() { this.router.navigate(['/records/petrolStation/oliunloadinglist']) } - goWarningList(){ + goWarningList() { this.router.navigate(['/records/petrolStation/warningstatisticslist']) } dispose(item) { diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html index 2e0d2a0..32b4e32 100644 --- a/src/app/pages/home/home.component.html +++ b/src/app/pages/home/home.component.html @@ -61,9 +61,10 @@ | - + - +
diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index 53ec7fc..6b6a367 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -12,8 +12,9 @@ import { NzModalService } from 'ng-zorro-antd/modal'; import { HttpClient } from '@angular/common/http'; import { ChangePasswordComponent } from '../change-password/change-password.component'; import { listRefreshService } from '../../service/listRefresh.service'; +import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component'; declare var abp: any - +import * as moment from 'moment'; @Component({ selector: 'app-home', templateUrl: './home.component.html', @@ -118,24 +119,104 @@ export class HomeComponent implements OnInit { params: params }).subscribe((data: any) => { console.log('推送信息后获取信息', data) - const modal = this.modal.create({ - nzContent: GetOutOfLineDetailsComponent, - nzWrapClassName: "vertical-center-modal", - nzViewContainerRef: this.viewContainerRef, - nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, - nzBodyStyle: { - 'border': '1px solid #6d9cc7', - 'border-radius': '0px', - 'padding': '0px', - 'box-shadow': '0 0 8px 0 #fff', - 'background': '#000D21', - }, - nzComponentParams: { - data: data.result - }, - nzFooter: null, - }); - const instance = modal.getContentComponent(); + let copydata = data.result + + if (item.notification.data.properties.EventSystemName == '灭火器维护') { + copydata.violatedItemSnapshotObj = JSON.parse(copydata.violatedItemSnapshot) + const modal = this.modal.create({ + nzContent: DisposeequipmentComponent, + nzViewContainerRef: this.viewContainerRef, + nzWidth: 380, + nzBodyStyle: { + 'border': '1px solid #91CCFF', + 'border-radius': '0px', + 'padding': '7px', + 'box-shadow': '0 0 8px 0 #fff', + 'background-image': 'linear-gradient(#003665, #000f25)' + }, + nzComponentParams: { + data: copydata + }, + nzFooter: null, + nzClosable: false, + nzOnOk: async () => { + if (instance.isScrap) { + let body = { + id: copydata.violatedItemSnapshotObj.id, + isScrapped: true, + organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: copydata.id, + handleRecord: '报废成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + this.message.create('success', '报废成功!'); + item.handleTime = new Date() + return true + }) + }) + } else { + if (instance.validateForm.valid) { + await new Promise(resolve => { + let body = { + id: copydata.violatedItemSnapshotObj.id, + name: instance.validateForm.value.name, + specification: instance.validateForm.value.specification, + productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), + purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), + validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), + organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + let body = { + id: copydata.id, + handleRecord: '维保成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + resolve(data) + this.message.create('success', '维保成功!'); + copydata.handleTime = new Date() + return true + }) + }) + }) + } else { + this.message.create('warning', '请填写完整!'); + return false + } + } + } + }); + const instance = modal.getContentComponent(); + } else { + const modal = this.modal.create({ + nzContent: GetOutOfLineDetailsComponent, + nzWrapClassName: "vertical-center-modal", + nzViewContainerRef: this.viewContainerRef, + nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, + nzBodyStyle: { + 'border': '1px solid #6d9cc7', + 'border-radius': '0px', + 'padding': '0px', + 'box-shadow': '0 0 8px 0 #fff', + 'background': '#000D21', + }, + nzComponentParams: { + data: copydata + }, + nzFooter: null, + }); + const instance = modal.getContentComponent(); + } + + + + + + this.messageId.forEach((element) => { if (element.id == item.notification.entityId) { this.notificationService.remove(element.messageId) diff --git a/src/app/pages/oil-station-info/oil-station-info.component.html b/src/app/pages/oil-station-info/oil-station-info.component.html index 189b9a6..f8faf68 100644 --- a/src/app/pages/oil-station-info/oil-station-info.component.html +++ b/src/app/pages/oil-station-info/oil-station-info.component.html @@ -317,6 +317,17 @@
+
+ + + + + + + +
@@ -366,8 +377,9 @@ - + diff --git a/src/app/pages/oil-station-info/oil-station-info.component.scss b/src/app/pages/oil-station-info/oil-station-info.component.scss index a2d0f00..3c22a4e 100644 --- a/src/app/pages/oil-station-info/oil-station-info.component.scss +++ b/src/app/pages/oil-station-info/oil-station-info.component.scss @@ -92,7 +92,7 @@ tr, td { - height: 155px; + height: 200px; } .imgbox { diff --git a/src/app/pages/oil-station-info/oil-station-info.component.ts b/src/app/pages/oil-station-info/oil-station-info.component.ts index e052c8f..c97cfed 100644 --- a/src/app/pages/oil-station-info/oil-station-info.component.ts +++ b/src/app/pages/oil-station-info/oil-station-info.component.ts @@ -94,9 +94,9 @@ export class OilStationInfoComponent implements OnInit { } if (this.httpBody.licenses.length == 0) { this.httpBody.licenses = [ - { name: '营业执照', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 1, hasAnnualInspection: true }, - { name: '危险化学品', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 3, hasAnnualInspection: false }, - { name: '成品油零售', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 2, hasAnnualInspection: true } + { name: '营业执照', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 1, hasAnnualInspection: true }, + { name: '危险化学品', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 3, hasAnnualInspection: false }, + { name: '成品油零售', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 2, hasAnnualInspection: true } ] } this.httpBody.stationType ? this.httpBody.stationType = String(this.httpBody.stationType) : null @@ -204,7 +204,7 @@ export class OilStationInfoComponent implements OnInit { } addTr() { this.httpBody.licenses.push( - { name: this.addName, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: -1, hasAnnualInspection: false }, + { name: this.addName, code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: -1, hasAnnualInspection: false }, ) } deleteTrConfirm(key) { @@ -216,6 +216,23 @@ export class OilStationInfoComponent implements OnInit { } submitForm() { + let valid = true + this.httpBody.licenses.forEach(element => { + if (!element.startTime || !element.endTime || !element.firstWarnTime || !element.secondWarnTime || !element.code) { + valid = false + return + } + if (element.hasAnnualInspection) { + if (!element.annualInspectionWarnTime || !element.annualInspectionOrganizationName || !element.annualInspectionTime) { + valid = false + return + } + } + }); + if (!valid) { + this.message.create('error', '请将证照信息填写完整!'); + return + } if (this.validateForm.valid) { this.isLoadingSave = true this.httpBody.openTime = moment(this.httpBody.openTime).format('YYYY-MM-MM')//开业时间格式化 diff --git a/src/app/pages/oil-unloading-process-list/oil-unloading-process-list.component.html b/src/app/pages/oil-unloading-process-list/oil-unloading-process-list.component.html index e2656dc..562d67f 100644 --- a/src/app/pages/oil-unloading-process-list/oil-unloading-process-list.component.html +++ b/src/app/pages/oil-unloading-process-list/oil-unloading-process-list.component.html @@ -8,7 +8,7 @@
预警类型统计 卸油统计 - + 证照预警统计
@@ -117,13 +117,13 @@
卸油结束时间
-
+
操作前准备预警节点数量
-
+
操作中准备预警节点数量
-
+
全流程准备预警节点数量
@@ -143,7 +143,7 @@
{{item.gasStation.companyName}}
-
+
{{item.gasStation.locationName}}
diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts index b6d67f7..2f2cfcd 100644 --- a/src/app/pages/pages.module.ts +++ b/src/app/pages/pages.module.ts @@ -38,6 +38,7 @@ import { NzTimePickerModule } from 'ng-zorro-antd/time-picker'; import { NzProgressModule } from 'ng-zorro-antd/progress'; import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm'; import { NzBadgeModule } from 'ng-zorro-antd/badge'; +import { NzRadioModule } from 'ng-zorro-antd/radio'; import { TodayWarningAdminComponent } from './today-warning-admin/today-warning-admin.component'; import { CriminalRecordsAdminComponent } from './criminal-records-admin/criminal-records-admin.component'; import { EquipmentInfoComponent } from './equipment-info/equipment-info.component'; @@ -56,11 +57,12 @@ import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/o import { ChangePasswordComponent } from './change-password/change-password.component'; import { FacilitySortPipe } from './facility-sort.pipe'; import { WarningStatisticsListComponent } from './warning-statistics-list/warning-statistics-list.component'; +import { DisposeequipmentComponent } from './warning-statistics-list/disposeequipment/disposeequipment.component'; @NgModule({ - declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent, - TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent, - AddequipmentComponent, EditequipmentComponent,PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, FacilitySortPipe, WarningStatisticsListComponent], + declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent, + TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent, + AddequipmentComponent, EditequipmentComponent, PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, FacilitySortPipe, WarningStatisticsListComponent, DisposeequipmentComponent], imports: [ @@ -99,9 +101,10 @@ import { WarningStatisticsListComponent } from './warning-statistics-list/warnin NzProgressModule, NzNotificationModule, NzPopconfirmModule, - NzBadgeModule + NzBadgeModule, + NzRadioModule ], - entryComponents: [AddequipmentComponent, EditequipmentComponent,GetOutOfLineDetailsComponent,DispositionComponent,OilUnloadingProcessComponent,ChangePasswordComponent], + entryComponents: [AddequipmentComponent, EditequipmentComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, ChangePasswordComponent, DisposeequipmentComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) diff --git a/src/app/pages/today-warning-admin/today-warning-admin.component.ts b/src/app/pages/today-warning-admin/today-warning-admin.component.ts index 2b72f1f..d366cb3 100644 --- a/src/app/pages/today-warning-admin/today-warning-admin.component.ts +++ b/src/app/pages/today-warning-admin/today-warning-admin.component.ts @@ -16,6 +16,7 @@ import 'linqjs'; import { DispositionComponent } from '../disposition/disposition.component'; import { NzMessageService } from 'ng-zorro-antd/message'; import { listRefreshService } from '../../service/listRefresh.service'; +import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component'; @Component({ selector: 'app-today-warning-admin', templateUrl: './today-warning-admin.component.html', @@ -192,28 +193,101 @@ export class TodayWarningAdminComponent implements OnInit { isVisible = false look(item) { - console.log(item) - const modal = this.modal.create({ - nzContent: GetOutOfLineDetailsComponent, - nzWrapClassName: "vertical-center-modal", - nzViewContainerRef: this.viewContainerRef, - nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, - nzBodyStyle: { - 'border': '1px solid #6d9cc7', - 'border-radius': '0px', - 'padding': '0px', - 'box-shadow': '0 0 8px 0 #fff', - 'background': '#000D21', - }, - nzComponentParams: { - data: item - }, - nzFooter: null, - nzOnOk: async () => { - console.log(99999, instance.content) - } - }); - const instance = modal.getContentComponent(); + if (item.violation.eventSystemName == '灭火器维护') { + item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot) + const modal = this.modal.create({ + nzContent: DisposeequipmentComponent, + nzViewContainerRef: this.viewContainerRef, + nzWidth: 380, + nzBodyStyle: { + 'border': '1px solid #91CCFF', + 'border-radius': '0px', + 'padding': '7px', + 'box-shadow': '0 0 8px 0 #fff', + 'background-image': 'linear-gradient(#003665, #000f25)' + }, + nzComponentParams: { + data: item + }, + nzFooter: null, + nzClosable: false, + nzOnOk: async () => { + if (instance.isScrap) { + let body = { + id: item.violatedItemSnapshotObj.id, + isScrapped: true, + organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: '报废成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + this.message.create('success', '报废成功!'); + item.handleTime = new Date() + return true + }) + }) + } else { + if (instance.validateForm.valid) { + await new Promise(resolve => { + let body = { + id: item.violatedItemSnapshotObj.id, + name: instance.validateForm.value.name, + specification: instance.validateForm.value.specification, + productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), + purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), + validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), + organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: '维保成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + resolve(data) + this.message.create('success', '维保成功!'); + item.handleTime = new Date() + return true + }) + }) + }) + } else { + this.message.create('warning', '请填写完整!'); + return false + } + } + } + }); + const instance = modal.getContentComponent(); + } else { + const modal = this.modal.create({ + nzContent: GetOutOfLineDetailsComponent, + nzWrapClassName: "vertical-center-modal", + nzViewContainerRef: this.viewContainerRef, + nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, + nzBodyStyle: { + 'border': '1px solid #6d9cc7', + 'border-radius': '0px', + 'padding': '0px', + 'box-shadow': '0 0 8px 0 #fff', + 'background': '#000D21', + }, + nzComponentParams: { + data: item + }, + nzFooter: null, + nzOnOk: async () => { + console.log(99999, instance.content) + } + }); + const instance = modal.getContentComponent(); + } + } diff --git a/src/app/pages/today-warning/today-warning.component.ts b/src/app/pages/today-warning/today-warning.component.ts index c5b086e..b164462 100644 --- a/src/app/pages/today-warning/today-warning.component.ts +++ b/src/app/pages/today-warning/today-warning.component.ts @@ -11,6 +11,7 @@ import * as moment from 'moment'; import { DispositionComponent } from '../disposition/disposition.component'; import { NzMessageService } from 'ng-zorro-antd/message'; import { listRefreshService } from '../../service/listRefresh.service'; +import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component'; @Component({ selector: 'app-today-warning', templateUrl: './today-warning.component.html', @@ -139,27 +140,101 @@ export class TodayWarningComponent implements OnInit { look(item) { - const modal = this.modal.create({ - nzContent: GetOutOfLineDetailsComponent, - nzWrapClassName: "vertical-center-modal", - nzViewContainerRef: this.viewContainerRef, - nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, - nzBodyStyle: { - 'border': '1px solid #6d9cc7', - 'border-radius': '0px', - 'padding': '0px', - 'box-shadow': '0 0 8px 0 #fff', - 'background': '#000D21', - }, - nzComponentParams: { - data: item - }, - nzFooter: null, - nzOnOk: async () => { + if (item.violation.eventSystemName == '灭火器维护') { + item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot) + const modal = this.modal.create({ + nzContent: DisposeequipmentComponent, + nzViewContainerRef: this.viewContainerRef, + nzWidth: 380, + nzBodyStyle: { + 'border': '1px solid #91CCFF', + 'border-radius': '0px', + 'padding': '7px', + 'box-shadow': '0 0 8px 0 #fff', + 'background-image': 'linear-gradient(#003665, #000f25)' + }, + nzComponentParams: { + data: item + }, + nzFooter: null, + nzClosable: false, + nzOnOk: async () => { + if (instance.isScrap) { + let body = { + id: item.violatedItemSnapshotObj.id, + isScrapped: true, + organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: '报废成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + this.message.create('success', '报废成功!'); + item.handleTime = new Date() + return true + }) + }) + } else { + if (instance.validateForm.valid) { + await new Promise(resolve => { + let body = { + id: item.violatedItemSnapshotObj.id, + name: instance.validateForm.value.name, + specification: instance.validateForm.value.specification, + productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), + purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), + validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), + organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId + } + this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: '维保成功!' + } + this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { + resolve(data) + this.message.create('success', '维保成功!'); + item.handleTime = new Date() + return true + }) + }) + }) + } else { + this.message.create('warning', '请填写完整!'); + return false + } + } + } + }); + const instance = modal.getContentComponent(); + } else { + const modal = this.modal.create({ + nzContent: GetOutOfLineDetailsComponent, + nzWrapClassName: "vertical-center-modal", + nzViewContainerRef: this.viewContainerRef, + nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, + nzBodyStyle: { + 'border': '1px solid #6d9cc7', + 'border-radius': '0px', + 'padding': '0px', + 'box-shadow': '0 0 8px 0 #fff', + 'background': '#000D21', + }, + nzComponentParams: { + data: item + }, + nzFooter: null, + nzOnOk: async () => { + + } + }); + const instance = modal.getContentComponent(); + } - } - }); - const instance = modal.getContentComponent(); } dispose(item) { diff --git a/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.html b/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.html new file mode 100644 index 0000000..91046aa --- /dev/null +++ b/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.html @@ -0,0 +1,69 @@ +
+
+
+ 处置消防器材 +
+ +
+ + + + + +

已处置成功(维保)

+

已处置成功(报废)

+
+
+

消防器材名称

+ + + + + + + +

规格

+ + + + + + + +

购入日期

+ + + + + + +

生产日期

+ + + + + + +

有效期至

+ + + + + + +
+ +
+ + +
+
+
\ No newline at end of file diff --git a/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.scss b/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.scss new file mode 100644 index 0000000..1f1fb6a --- /dev/null +++ b/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.scss @@ -0,0 +1,89 @@ +#disposeequipment { + .title { + font-family: sybold; + width: 100%; + height: 48px; + background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.57) 50%, rgba(35, 153, 255, 0) 100%); + display: flex; + align-items: center; + position: relative; + + .titlecontent { + width: 100%; + height: 32px; + line-height: 32px; + background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.57) 50%, rgba(35, 153, 255, 0) 100%); + text-align: center; + color: #91CCFF; + font-size: 16px; + } + + i { + position: absolute; + right: 12px; + color: #fff; + font-size: 18px; + cursor: pointer; + } + } + .radiobox{ + label{ + color: white; + } + display: flex; + justify-content: center; + margin-top: 12px; + } + .form { + box-sizing: border-box; + padding: 0 17px; + + p { + margin-bottom: 0; + color: #C4E2FC; + margin: 16px 0; + } + + nz-form-item { + margin-bottom: 0; + + input { + color: rgba(145, 204, 255, 0.95) !important; + } + } + + nz-date-picker { + background-color: #143c61; + width: 100%; + } + + .btnbox { + width: 100%; + margin-top: 24px; + margin-bottom: 17px; + display: flex; + justify-content: flex-end; + + button { + border-radius: 0px; + color: #91CCFF; + } + + button:nth-child(2) { + margin-left: 16px; + } + + .ok { + background: rgba(0, 129, 255, 0.4); + } + + .cancel { + border: 1px solid #C4E2FC; + background: #0c1e38; + color: rgba(99, 102, 105, 0.6); + box-shadow: 0 0 3px 0 #fff inset; + } + } + } + +} diff --git a/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.ts b/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.ts new file mode 100644 index 0000000..f474da1 --- /dev/null +++ b/src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.ts @@ -0,0 +1,46 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { HttpClient } from '@angular/common/http'; +@Component({ + selector: 'app-disposeequipment', + templateUrl: './disposeequipment.component.html', + styleUrls: ['./disposeequipment.component.scss'] +}) +export class DisposeequipmentComponent implements OnInit { + + @Input() data?: any; + + validateForm!: FormGroup; + constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } + + radioValue = "A" + data2 + ngOnInit(): void { + this.validateForm = this.fb.group({ + name: [null, [Validators.required]], + specification: [null, [Validators.required]], + buytime: [null, [Validators.required]], + prodtime: [null, [Validators.required]], + validitytime: [null, [Validators.required]] + }); + this.data2 = JSON.parse(JSON.stringify(this.data)) + } + + destroyModal() { + this.modal.destroy({ data: 'this the result data' }); + } + ok() { + this.modal.triggerOk() + } + //是否报废 + isScrap = false + ngModelChange(e) { + console.log(e) + if (e == 'A') { + this.isScrap = false + } else { + this.isScrap = true + } + } +} diff --git a/src/app/pages/warning-statistics-list/warning-statistics-list.component.html b/src/app/pages/warning-statistics-list/warning-statistics-list.component.html index 9463535..45e884d 100644 --- a/src/app/pages/warning-statistics-list/warning-statistics-list.component.html +++ b/src/app/pages/warning-statistics-list/warning-statistics-list.component.html @@ -19,13 +19,12 @@
- 证照预警统计 + 预警统计
{{num}}
总数
- 返回
@@ -34,7 +33,7 @@
- 近30天证照预警走势 + 近30天预警走势
@@ -45,18 +44,19 @@
- +
-