Browse Source

[新增]判断是否singleSignOn决定查询日期区间

test-assets
邵佳豪 1 year ago
parent
commit
59df72222f
  1. 3
      src/app/auth.guard.ts
  2. 1224
      src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts
  3. 15
      src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
  4. 17
      src/app/pages/records/records-nav/records-nav.component.ts
  5. 568
      src/app/pages/today-warning-admin/today-warning-admin.component.ts

3
src/app/auth.guard.ts

@ -24,6 +24,7 @@ export class AuthGuard implements CanActivate {
next.queryParams.singleSignOn &&
next.queryParams.singleSignOn === "true"
) {
sessionStorage.setItem("singleSignOn", "true");
await this.autoLogin();
}
return this.checkLogin();
@ -48,7 +49,7 @@ export class AuthGuard implements CanActivate {
return new Promise<void>((resolve, reject) => {
this.http
.post("/api/TokenAuth/Authenticate", {
userNameOrEmailAddress: "superadmin",
userNameOrEmailAddress: "admin",
password: "Admin119119119",
})
.subscribe(

1224
src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts

File diff suppressed because it is too large Load Diff

15
src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts

@ -47,6 +47,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
//获取三十天前日期
var lw = new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30); //最后一个数字30可改,30天的意思
console.log("le", lw);
var lastY = lw.getFullYear();
var lastM = lw.getMonth() + 1;
var lastD = lw.getDate();
@ -142,6 +143,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
let nowY = myDate.getFullYear();
let nowM = myDate.getMonth() + 1;
let nowD = myDate.getDate();
this.enddate =
nowY +
"-" +
@ -149,7 +151,16 @@ export class OilUnloadingProcessListComponent implements OnInit {
"-" +
(nowD < 10 ? "0" + nowD : nowD); //当前日期
//获取三十天前日期
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29); //最后一个数字30可改,30天的意思
let lw;
if (
sessionStorage.getItem("singleSignOn") &&
sessionStorage.getItem("singleSignOn") === "true"
) {
lw = new Date(myDate - 1000 * 60 * 60 * 24 * 180); //最后一个数字30可改,30天的意思
} else {
lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29); //最后一个数字30可改,30天的意思
}
let lastY = lw.getFullYear();
let lastM = lw.getMonth() + 1;
let lastD = lw.getDate();
@ -870,7 +881,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
console.log(item);
let arr = [];
let arr1 = item.oilUnloadingNodes.find((item) => {
return item.nodeName == "车辆进场" || item.nodeName == "油罐车进场";
return item.nodeName == "车辆进场" || item.nodeName == "油罐车进场";
});
let arr2 = item.oilUnloadingNodes.find((item) => {
return (

17
src/app/pages/records/records-nav/records-nav.component.ts

@ -21,14 +21,6 @@ export class RecordsNavComponent implements OnInit {
menu = [];
selectedMenu;
ngOnInit(): void {
if (this.router.url.indexOf("oliunloadinglist") !== -1) {
console.log('走这个列里看看看看')
this.selectedMenu = "卸油统计";
}else{
this.selectedMenu = this.menu[0];
}
let a = sessionStorage.getItem("userdata");
this.userMenu = JSON.parse(a).menus;
for (let index = 0; index < this.userMenu.length; index++) {
@ -47,6 +39,12 @@ export class RecordsNavComponent implements OnInit {
}
}
}
if (this.router.url.indexOf("oliunloadinglist") !== -1) {
this.selectedMenu = "卸油统计";
} else {
this.selectedMenu = this.menu[0];
}
// this.selectedMenu = this.menu[0];
this.routerChange();
}
@ -65,8 +63,7 @@ export class RecordsNavComponent implements OnInit {
if (this.selectedMenu == "预警类型统计") {
this.router.navigate(["/records_nav/all"]);
} else if (this.selectedMenu == "卸油统计") {
console.log(888888888888888888888888)
console.log(888888888888888888888888);
this.router.navigate(["/records_nav/oliunloadinglist"]);
} else if (this.selectedMenu == "证照预警统计") {
this.router.navigate(["/records_nav/warningstatisticslist"]);

568
src/app/pages/today-warning-admin/today-warning-admin.component.ts

@ -1,29 +1,38 @@
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { HttpClient } from '@angular/common/http';
import { NzModalService } from 'ng-zorro-antd/modal';
import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component';
import * as moment from 'moment';
import { TreeService } from '../../service/tree.service';
import { NavChangeService } from '../../service/navChange.service';
import 'linqjs';
import { DispositionComponent } from '../disposition/disposition.component';
import { NzMessageService } from 'ng-zorro-antd/message';
import { listRefreshService } from '../../service/listRefresh.service';
import { DisposeequipmentComponent } from '../records/warning-statistics-list/disposeequipment/disposeequipment.component';
import { Component, OnInit, ViewContainerRef } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { Router } from "@angular/router";
import { HttpClient } from "@angular/common/http";
import { NzModalService } from "ng-zorro-antd/modal";
import { GetOutOfLineDetailsComponent } from "../today-warning/get-out-of-line-details/get-out-of-line-details.component";
import * as moment from "moment";
import { TreeService } from "../../service/tree.service";
import { NavChangeService } from "../../service/navChange.service";
import "linqjs";
import { DispositionComponent } from "../disposition/disposition.component";
import { NzMessageService } from "ng-zorro-antd/message";
import { listRefreshService } from "../../service/listRefresh.service";
import { DisposeequipmentComponent } from "../records/warning-statistics-list/disposeequipment/disposeequipment.component";
@Component({
selector: 'app-today-warning-admin',
templateUrl: './today-warning-admin.component.html',
styleUrls: ['./today-warning-admin.component.scss']
selector: "app-today-warning-admin",
templateUrl: "./today-warning-admin.component.html",
styleUrls: ["./today-warning-admin.component.scss"],
})
export class TodayWarningAdminComponent implements OnInit {
validateForm!: FormGroup;
constructor(private listRefreshService: listRefreshService, private http: HttpClient, private fb: FormBuilder, private router: Router, private toTree: TreeService, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private navChangeService: NavChangeService, private message: NzMessageService) { }
isSpin: boolean = false
constructor(
private listRefreshService: listRefreshService,
private http: HttpClient,
private fb: FormBuilder,
private router: Router,
private toTree: TreeService,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private navChangeService: NavChangeService,
private message: NzMessageService
) {}
isSpin: boolean = false;
isMisinformation: boolean = false//误报按钮的显隐
isMisinformation: boolean = false; //误报按钮的显隐
ngOnInit(): void {
this.validateForm = this.fb.group({
level: [null],
@ -33,95 +42,115 @@ export class TodayWarningAdminComponent implements OnInit {
area: [null],
disposalState: [null],
appealState: [null],
datePickerStart: [new Date(`${moment(new Date()).format('YYYY-MM-DD')} 00:00`)],
datePickerEnd: [new Date(`${moment(new Date()).format('YYYY-MM-DD')} 23:59`)]
datePickerStart: [
new Date(`${moment(new Date()).format("YYYY-MM-DD")} 00:00`),
],
datePickerEnd: [
new Date(`${moment(new Date()).format("YYYY-MM-DD")} 23:59`),
],
});
this.warningType()
this.isSpin = true
this.getAllOrganization()
this.warningType();
this.isSpin = true;
this.getAllOrganization();
this.listRefreshService.getMessage().subscribe((message: any) => {
//列表刷新
if (message.type == 'add') {
this.getEarlyWarningList()
if (message.type == "add") {
this.getEarlyWarningList();
}
//更新处置状态
if (message.type == 'updatehandleTime') {
console.log('更新处置状态', message)
if (message.type == "updatehandleTime") {
console.log("更新处置状态", message);
// console.log(this.list)
this.list.forEach(element => {
this.list.forEach((element) => {
if (element.id == message.data) {
element.handleTime = new Date()
element.handleTime = new Date();
}
});
}
});
let loginUserInfo
if (sessionStorage.getItem('isGasStation') == 'true') {
loginUserInfo = JSON.parse(sessionStorage.getItem('userdataOfgasstation'))
let loginUserInfo;
if (sessionStorage.getItem("isGasStation") == "true") {
loginUserInfo = JSON.parse(
sessionStorage.getItem("userdataOfgasstation")
);
} else {
loginUserInfo = JSON.parse(sessionStorage.getItem('userdata'))
loginUserInfo = JSON.parse(sessionStorage.getItem("userdata"));
}
if (loginUserInfo.permissions.find((item) => {
return item.name == 'Data.Violation.Positive.Censor'
})) {
this.isMisinformation = true
if (
loginUserInfo.permissions.find((item) => {
return item.name == "Data.Violation.Positive.Censor";
})
) {
this.isMisinformation = true;
} else {
this.isMisinformation = false
this.isMisinformation = false;
}
}
//预警类型接口
warningTypesDetails: any
warningTypesDetailsCopy: any
warningTypesDetails: any;
warningTypesDetailsCopy: any;
warningTypes: any //预警接口数据
warningTypesCopy: any
warningLevels: any
warningLevelsCopy: any
warningTypes: any; //预警接口数据
warningTypesCopy: any;
warningLevels: any;
warningLevelsCopy: any;
warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result))
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)) //原始数据备份
this.warningTypes = (data.result as any).groupBy((t) => { return t.violationType });
this.warningTypesCopy = (data.result as any).groupBy((t) => { return t.violationType })
this.warningLevels = (data.result as any).groupBy((t) => { return t.level });
this.warningLevelsCopy = (data.result as any).groupBy((t) => { return t.level })
this.warningLevels.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
this.warningLevelsCopy.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
this.http
.get("/api/services/app/Violation/GetAllList")
.subscribe((data: any) => {
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result));
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)); //原始数据备份
this.warningTypes = (data.result as any).groupBy((t) => {
return t.violationType;
});
this.warningTypesCopy = (data.result as any).groupBy((t) => {
return t.violationType;
});
this.warningLevels = (data.result as any).groupBy((t) => {
return t.level;
});
this.warningLevelsCopy = (data.result as any).groupBy((t) => {
return t.level;
});
this.warningLevels.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
this.warningLevelsCopy.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
// console.log(111, this.warningTypesDetails)
// console.log(222, this.warningTypesCopy)
// console.log(333, this.warningLevels)
});
// console.log(111, this.warningTypesDetails)
// console.log(222, this.warningTypesCopy)
// console.log(333, this.warningLevels)
})
}
typeChange(e) {
if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningLevels = this.warningLevelsCopy
return
this.warningTypesDetails = this.warningTypesDetailsCopy;
this.warningLevels = this.warningLevelsCopy;
return;
}
this.warningTypes.forEach(element => {
this.warningTypes.forEach((element) => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningLevels = (element as any).groupBy((t) => { return t.level });
this.warningTypesDetails = element;
this.warningLevels = (element as any).groupBy((t) => {
return t.level;
});
}
});
this.validateForm.patchValue({
@ -130,17 +159,19 @@ export class TodayWarningAdminComponent implements OnInit {
}
levelChange(e) {
if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningTypes = this.warningTypesCopy
this.warningTypesDetails = this.warningTypesDetailsCopy;
this.warningTypes = this.warningTypesCopy;
this.validateForm.patchValue({
type: null,
});
return
return;
}
this.warningLevels.forEach(element => {
this.warningLevels.forEach((element) => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningTypes = (element as any).groupBy((t) => { return t.violationType });
this.warningTypesDetails = element;
this.warningTypes = (element as any).groupBy((t) => {
return t.violationType;
});
}
});
this.validateForm.patchValue({
@ -148,100 +179,127 @@ export class TodayWarningAdminComponent implements OnInit {
});
}
defaultOrId: string
defaultOrId: string;
//获取所有组织机构
nodes: any = []
nodes: any = [];
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 = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
}
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
IsContainsChildren: "true",
};
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
element.key = element.id;
element.title = element.displayName;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
this.defaultOrId = JSON.parse(
sessionStorage.getItem("userdata")
).organization.id;
this.validateForm.value.organization = this.defaultOrId;
this.getEarlyWarningList();
});
this.nodes = [...this.toTree.toTree(data.result.items)]
this.defaultOrId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
this.validateForm.value.organization = this.defaultOrId
this.getEarlyWarningList()
})
}
//获得预警列表
list: any = [
]
totalCount: string //预警总数
isLoading = false
//获得预警列表
list: any = [];
totalCount: string; //预警总数
isLoading = false;
getEarlyWarningList() {
this.isLoading = true
let ViolationIds = []
this.isLoading = true;
let ViolationIds = [];
if (this.validateForm.value.event) {
ViolationIds = this.validateForm.value.event
ViolationIds = this.validateForm.value.event;
}
if (this.validateForm.value.type && !this.validateForm.value.event) {
this.warningTypesDetails.forEach(item => {
item.id ? ViolationIds.push(item.id) : null
this.warningTypesDetails.forEach((item) => {
item.id ? ViolationIds.push(item.id) : null;
});
}
let disposalState
if (this.validateForm.value.disposalState == '0') {
disposalState = true
} else if (this.validateForm.value.disposalState == '1') {
disposalState = false
let disposalState;
if (this.validateForm.value.disposalState == "0") {
disposalState = true;
} else if (this.validateForm.value.disposalState == "1") {
disposalState = false;
} else {
disposalState = null
disposalState = null;
}
// console.log(this.validateForm.value)
this.isSpin = true
let ViolateTime = null;
if (
sessionStorage.getItem("singleSignOn") &&
sessionStorage.getItem("singleSignOn") === "true"
) {
ViolateTime = [
"2023-9-1",
moment(this.validateForm.value.datePickerEnd).format("yyyy-MM-DD"),
];
} else {
this.validateForm.value.datePickerEnd &&
this.validateForm.value.datePickerStart
? (ViolateTime = [
moment(this.validateForm.value.datePickerStart).format(
"yyyy-MM-DD HH:mm:ss"
),
moment(this.validateForm.value.datePickerEnd).format(
"yyyy-MM-DD HH:mm:ss"
),
])
: (ViolateTime = null);
}
this.isSpin = true;
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateAreas: this.validateForm.value.area,
organizationUnitId: this.validateForm.value.organization,
ViolateTime: (this.validateForm.value.datePickerEnd && this.validateForm.value.datePickerStart) ? [moment(this.validateForm.value.datePickerStart).format('yyyy-MM-DD HH:mm:ss'), moment(this.validateForm.value.datePickerEnd).format('yyyy-MM-DD HH:mm:ss')] : null,
ViolateTime: ViolateTime,
// ViolateTime: ['2021-10-27', '2021-11-26'],
IsHandled: disposalState,
AppealStatus: this.validateForm.value.appealState,
IsContainsChildren: 'true',
SkipCount: '0',
MaxResultCount: '9999',
Positive: 'true'
}
this.http.get('/api/services/app/ViolateRecord/GetAll', {
params: params
}).subscribe((data: any) => {
this.list = data.result.items
this.totalCount = data.result.totalCount
console.log('预警列表', this.list)
this.isSpin = false
this.isLoading = false
let obj = {
name: '改变数量',
num: this.totalCount
}
setTimeout(() => {
this.navChangeService.sendMessage(obj);//发布一条消息
}, 0);
})
IsContainsChildren: "true",
SkipCount: "0",
MaxResultCount: "9999",
Positive: "true",
};
this.http
.get("/api/services/app/ViolateRecord/GetAll", {
params: params,
})
.subscribe((data: any) => {
this.list = data.result.items;
this.totalCount = data.result.totalCount;
console.log("预警列表", this.list);
this.isSpin = false;
this.isLoading = false;
let obj = {
name: "改变数量",
num: this.totalCount,
};
setTimeout(() => {
this.navChangeService.sendMessage(obj); //发布一条消息
}, 0);
});
}
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.getEarlyWarningList()
this.getEarlyWarningList();
}
resetForm(e: MouseEvent): void {
@ -252,93 +310,125 @@ export class TodayWarningAdminComponent implements OnInit {
this.validateForm.controls[key].updateValueAndValidity();
}
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
datePickerStart: new Date(`${moment(new Date()).format('YYYY-MM-DD')} 00:00`),
datePickerEnd: new Date(`${moment(new Date()).format('YYYY-MM-DD')} 23:59`)
organization: JSON.parse(sessionStorage.getItem("userdata")).organization
.id,
datePickerStart: new Date(
`${moment(new Date()).format("YYYY-MM-DD")} 00:00`
),
datePickerEnd: new Date(
`${moment(new Date()).format("YYYY-MM-DD")} 23:59`
),
});
this.getEarlyWarningList()
this.getEarlyWarningList();
}
isVisible = false
isVisible = false;
look(item) {
if (item.violation.violationType == '设备监测') {
item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot)
if (item.violation.violationType == "设备监测") {
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)'
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
data: item,
},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
if (instance.isScrap) {
await new Promise(resolve => {
await new Promise((resolve) => {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name,
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
storageLocation:
instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(
instance.copydata2.violatedItemSnapshotObj.productionDate
).format("yyyy-MM-DD"),
maintenanceDate: moment(
instance.copydata2.violatedItemSnapshotObj.maintenanceDate
).format("yyyy-MM-DD"),
validityEndTime: moment(
instance.copydata2.violatedItemSnapshotObj.validityEndTime
).format("yyyy-MM-DD"),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
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
})
})
})
organizationUnitId:
item.violatedItemSnapshotObj.organizationUnitId,
};
this.http
.put("/api/services/app/FireEquipment/Update", body)
.subscribe((data: any) => {
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 {
if (instance.validateForm.valid) {
await new Promise(resolve => {
await new Promise((resolve) => {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).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
})
})
})
productionDate: moment(
instance.validateForm.value.productionDate
).format("yyyy-MM-DD"),
maintenanceDate: moment(
instance.validateForm.value.maintenanceDate
).format("yyyy-MM-DD"),
validityEndTime: moment(
instance.validateForm.value.validityEndTime
).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
this.message.create("warning", "请填写完整!");
return false;
}
}
}
},
});
const instance = modal.getContentComponent();
} else {
@ -346,69 +436,73 @@ export class TodayWarningAdminComponent implements OnInit {
nzContent: GetOutOfLineDetailsComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: 'modelnobg',
nzClassName: "modelnobg",
nzBodyStyle: {
'border-radius': '0px',
'padding': '0px',
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
data: item
data: item,
},
nzFooter: null,
nzOnOk: async () => {
console.log('误报处理')
console.log("误报处理");
for (let index = 0; index < this.list.length; index++) {
const element = this.list[index];
if (element.id == item.id) {
this.list.splice(index, 1)
this.totalCount = String(Number(this.totalCount) - 1)
this.list.splice(index, 1);
this.totalCount = String(Number(this.totalCount) - 1);
// this.SkipCount = String(Number(this.SkipCount) - 1)
}
}
}
},
});
const instance = modal.getContentComponent();
}
}
dispose(item) {
console.log(item)
console.log(item);
const modal = this.modal.create({
nzContent: DispositionComponent,
nzWrapClassName: "vertical-center-modal",
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)'
border: "1px solid #91CCFF",
"border-radius": "0px",
padding: "7px",
"box-shadow": "0 0 8px 0 #fff",
"background-image": "linear-gradient(#003665, #000f25)",
},
nzComponentParams: {},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
await new Promise((resolve) => {
let body = {
id: item.id,
handleRecord: instance.validateForm.value.content
}
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data)
this.message.create('success', '处置成功!');
item.handleTime = new Date()
return true
})
})
handleRecord: instance.validateForm.value.content,
};
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
this.message.create("warning", "请填写完整!");
return false;
}
},
});

Loading…
Cancel
Save