|
|
|
@ -6,6 +6,7 @@ import * as moment from 'moment';
|
|
|
|
|
import { NzModalService } from 'ng-zorro-antd/modal'; |
|
|
|
|
import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component'; |
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message'; |
|
|
|
|
import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component'; |
|
|
|
|
|
|
|
|
|
declare var tools |
|
|
|
|
@Component({ |
|
|
|
@ -669,6 +670,94 @@ export class HomePageComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
look(item) { |
|
|
|
|
console.log('消息item', item)
|
|
|
|
|
if (item.notification.data.eventSystemName == '灭火器维护') { |
|
|
|
|
this.isOpenModel = true |
|
|
|
|
let copydata = item.notification.data |
|
|
|
|
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) { |
|
|
|
|
await new Promise(resolve => { |
|
|
|
|
let body = { |
|
|
|
|
id: copydata.violatedItemSnapshotObj.id, |
|
|
|
|
isScrapped: true, |
|
|
|
|
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId, |
|
|
|
|
name: instance.copydata2.violatedItemSnapshotObj.name, |
|
|
|
|
specification: instance.copydata2.violatedItemSnapshotObj.specification, |
|
|
|
|
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'), |
|
|
|
|
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'), |
|
|
|
|
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD') |
|
|
|
|
} |
|
|
|
|
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { |
|
|
|
|
let body = { |
|
|
|
|
id: item.notification.entityId, |
|
|
|
|
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 { |
|
|
|
|
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: item.notification.entityId, |
|
|
|
|
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(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modal.afterClose.subscribe(result => { |
|
|
|
|
this.isOpenModel = false |
|
|
|
|
this.rollStart() |
|
|
|
|
}); |
|
|
|
|
this.readMess(item.notification.id) |
|
|
|
|
} else { |
|
|
|
|
this.isOpenModel = true |
|
|
|
|
item.notification.data.id = item.notification.entityId |
|
|
|
|
let data = item.notification.data |
|
|
|
@ -698,6 +787,10 @@ export class HomePageComponent implements OnInit {
|
|
|
|
|
this.rollStart() |
|
|
|
|
}); |
|
|
|
|
this.readMess(item.notification.id) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|