Browse Source

[完善]完善消防设施的处置

dev
邵佳豪 3 years ago
parent
commit
a848784faf
  1. 34
      src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
  2. 33
      src/app/pages/criminal-records/criminal-records.component.ts
  3. 151
      src/app/pages/home-page/home-page.component.ts
  4. 161
      src/app/pages/home/home.component.ts
  5. 2
      src/app/pages/oil-station-info/oil-station-info.component.html
  6. 3
      src/app/pages/oil-station-info/oil-station-info.component.ts
  7. 34
      src/app/pages/today-warning-admin/today-warning-admin.component.ts
  8. 34
      src/app/pages/today-warning/today-warning.component.ts
  9. 4
      src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.html
  10. 6
      src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.ts
  11. 40
      src/app/pages/warning-statistics-list/warning-statistics-list.component.ts

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

@ -608,23 +608,31 @@ export class CriminalRecordsAdminComponent implements OnInit {
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (instance.isScrap) { if (instance.isScrap) {
let body = { await new Promise(resolve => {
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 = { let body = {
id: item.id, id: item.violatedItemSnapshotObj.id,
handleRecord: '报废成功!' 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'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
this.message.create('success', '报废成功!'); let body = {
item.handleTime = new Date() id: item.id,
return true 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 { } else {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise(resolve => {

33
src/app/pages/criminal-records/criminal-records.component.ts

@ -553,21 +553,28 @@ export class CriminalRecordsComponent implements OnInit {
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (instance.isScrap) { if (instance.isScrap) {
let body = { await new Promise(resolve => {
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 = { let body = {
id: item.id, id: item.violatedItemSnapshotObj.id,
handleRecord: '报废成功!' 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'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
this.message.create('success', '报废成功!'); let body = {
item.handleTime = new Date() id: item.id,
return true 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 { } else {

151
src/app/pages/home-page/home-page.component.ts

@ -6,6 +6,7 @@ import * as moment from 'moment';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component'; import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component';
declare var tools declare var tools
@Component({ @Component({
@ -668,36 +669,128 @@ export class HomePageComponent implements OnInit {
isOpenModel: boolean = false isOpenModel: boolean = false
look(item) { look(item) {
console.log('消息item', item) console.log('消息item', item)
this.isOpenModel = true if (item.notification.data.eventSystemName == '灭火器维护') {
item.notification.data.id = item.notification.entityId this.isOpenModel = true
let data = item.notification.data let copydata = item.notification.data
const modal = this.modal.create({ copydata.violatedItemSnapshotObj = JSON.parse(copydata.violatedItemSnapshot)
nzContent: GetOutOfLineDetailsComponent, const modal = this.modal.create({
nzWrapClassName: "vertical-center-modal", nzContent: DisposeequipmentComponent,
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, nzWidth: 380,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #6d9cc7', 'border': '1px solid #91CCFF',
'border-radius': '0px', 'border-radius': '0px',
'padding': '0px', 'padding': '7px',
'box-shadow': '0 0 8px 0 #fff', 'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21', 'background-image': 'linear-gradient(#003665, #000f25)'
}, },
nzComponentParams: { nzComponentParams: {
data: data data: copydata
}, },
nzFooter: null, nzFooter: null,
nzOnOk: async () => { 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
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
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => {
this.isOpenModel = false
this.rollStart()
});
this.readMess(item.notification.id)
}
}
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => {
this.isOpenModel = false
this.rollStart()
});
this.readMess(item.notification.id)
} }

161
src/app/pages/home/home.component.ts

@ -119,101 +119,108 @@ export class HomeComponent implements OnInit {
params: params params: params
}).subscribe((data: any) => { }).subscribe((data: any) => {
console.log('推送信息后获取信息', data) console.log('推送信息后获取信息', data)
let copydata = data.result
setTimeout(() => {
if (item.notification.data.properties.EventSystemName == '灭火器维护') { let copydata = data.result
copydata.violatedItemSnapshotObj = JSON.parse(copydata.violatedItemSnapshot) if (item.notification.data.properties.EventSystemName == '灭火器维护') {
const modal = this.modal.create({ copydata.violatedItemSnapshotObj = JSON.parse(copydata.violatedItemSnapshot)
nzContent: DisposeequipmentComponent, const modal = this.modal.create({
nzViewContainerRef: this.viewContainerRef, nzContent: DisposeequipmentComponent,
nzWidth: 380, nzViewContainerRef: this.viewContainerRef,
nzBodyStyle: { nzWidth: 380,
'border': '1px solid #91CCFF', nzBodyStyle: {
'border-radius': '0px', 'border': '1px solid #91CCFF',
'padding': '7px', 'border-radius': '0px',
'box-shadow': '0 0 8px 0 #fff', 'padding': '7px',
'background-image': 'linear-gradient(#003665, #000f25)' 'box-shadow': '0 0 8px 0 #fff',
}, 'background-image': 'linear-gradient(#003665, #000f25)'
nzComponentParams: { },
data: copydata nzComponentParams: {
}, data: copydata
nzFooter: null, },
nzClosable: false, nzFooter: null,
nzOnOk: async () => { nzClosable: false,
if (instance.isScrap) { nzOnOk: async () => {
let body = { if (instance.isScrap) {
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 => { await new Promise(resolve => {
let body = { let body = {
id: copydata.violatedItemSnapshotObj.id, id: copydata.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, isScrapped: true,
specification: instance.validateForm.value.specification, organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), name: instance.copydata2.violatedItemSnapshotObj.name,
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), specification: instance.copydata2.violatedItemSnapshotObj.specification,
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'),
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId 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) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: copydata.id, id: copydata.id,
handleRecord: '维保成功!' handleRecord: '报废成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '维保成功!'); this.message.create('success', '报废成功!');
copydata.handleTime = new Date() copydata.handleTime = new Date()
return true return true
}) })
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整!'); if (instance.validateForm.valid) {
return false 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();
const instance = modal.getContentComponent(); } else {
} else { const modal = this.modal.create({
const modal = this.modal.create({ nzContent: GetOutOfLineDetailsComponent,
nzContent: GetOutOfLineDetailsComponent, nzWrapClassName: "vertical-center-modal",
nzWrapClassName: "vertical-center-modal", nzViewContainerRef: this.viewContainerRef,
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, nzBodyStyle: {
nzBodyStyle: { 'border': '1px solid #6d9cc7',
'border': '1px solid #6d9cc7', 'border-radius': '0px',
'border-radius': '0px', 'padding': '0px',
'padding': '0px', 'box-shadow': '0 0 8px 0 #fff',
'box-shadow': '0 0 8px 0 #fff', 'background': '#000D21',
'background': '#000D21', },
}, nzComponentParams: {
nzComponentParams: { data: copydata
data: copydata },
}, nzFooter: null,
nzFooter: null, });
}); const instance = modal.getContentComponent();
const instance = modal.getContentComponent(); }
} }, 0);

2
src/app/pages/oil-station-info/oil-station-info.component.html

@ -322,7 +322,7 @@
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}" <input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}"
placeholder="证件编号" [(ngModel)]="item.annualInspectionOrganizationName" nz-input placeholder="证件编号" [(ngModel)]="item.code" nz-input
type="text" /> type="text" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>

3
src/app/pages/oil-station-info/oil-station-info.component.ts

@ -217,14 +217,17 @@ export class OilStationInfoComponent implements OnInit {
submitForm() { submitForm() {
let valid = true let valid = true
console.log(this.httpBody.licenses)
this.httpBody.licenses.forEach(element => { this.httpBody.licenses.forEach(element => {
if (!element.startTime || !element.endTime || !element.firstWarnTime || !element.secondWarnTime || !element.code) { if (!element.startTime || !element.endTime || !element.firstWarnTime || !element.secondWarnTime || !element.code) {
valid = false valid = false
console.log('普通拦截')
return return
} }
if (element.hasAnnualInspection) { if (element.hasAnnualInspection) {
if (!element.annualInspectionWarnTime || !element.annualInspectionOrganizationName || !element.annualInspectionTime) { if (!element.annualInspectionWarnTime || !element.annualInspectionOrganizationName || !element.annualInspectionTime) {
valid = false valid = false
console.log('年检拦截')
return return
} }
} }

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

@ -213,23 +213,31 @@ export class TodayWarningAdminComponent implements OnInit {
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (instance.isScrap) { if (instance.isScrap) {
let body = { await new Promise(resolve => {
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 = { let body = {
id: item.id, id: item.violatedItemSnapshotObj.id,
handleRecord: '报废成功!' 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'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
this.message.create('success', '报废成功!'); let body = {
item.handleTime = new Date() id: item.id,
return true 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 { } else {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise(resolve => {

34
src/app/pages/today-warning/today-warning.component.ts

@ -160,23 +160,31 @@ export class TodayWarningComponent implements OnInit {
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (instance.isScrap) { if (instance.isScrap) {
let body = { await new Promise(resolve => {
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 = { let body = {
id: item.id, id: item.violatedItemSnapshotObj.id,
handleRecord: '报废成功!' 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'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
this.message.create('success', '报废成功!'); let body = {
item.handleTime = new Date() id: item.id,
return true 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 { } else {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise(resolve => {

4
src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.html

@ -12,9 +12,9 @@
<label nz-radio nzValue="B">报废</label> <label nz-radio nzValue="B">报废</label>
</nz-radio-group> </nz-radio-group>
<p *ngIf="data2.handleTime && !data2.violatedItemSnapshotObj.isScrap" <p *ngIf="data2.handleTime && !data2.violatedItemSnapshotObj.isScrap"
style="color: green;text-align: center;margin-top: 12px;">已处置成功(维保)</p> style="color: green;text-align: center;margin-top: 12px;">已处置成功</p>
<p *ngIf="data2.handleTime && data2.violatedItemSnapshotObj.isScrap" <p *ngIf="data2.handleTime && data2.violatedItemSnapshotObj.isScrap"
style="color: red;text-align: center;margin-top: 12px;">已处置成功(报废)</p> style="color: red;text-align: center;margin-top: 12px;">已处置成功</p>
<form nz-form [formGroup]="validateForm" class="form"> <form nz-form [formGroup]="validateForm" class="form">
<div *ngIf="!isScrap && !data2.handleTime"> <div *ngIf="!isScrap && !data2.handleTime">
<p>消防器材名称</p> <p>消防器材名称</p>

6
src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.ts

@ -16,7 +16,13 @@ export class DisposeequipmentComponent implements OnInit {
radioValue = "A" radioValue = "A"
data2 data2
copydata2
ngOnInit(): void { ngOnInit(): void {
this.copydata2 = JSON.parse(JSON.stringify(this.data))
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
name: [null, [Validators.required]], name: [null, [Validators.required]],
specification: [null, [Validators.required]], specification: [null, [Validators.required]],

40
src/app/pages/warning-statistics-list/warning-statistics-list.component.ts

@ -637,6 +637,7 @@ export class WarningStatisticsListComponent implements OnInit {
} }
//处置消防设施 //处置消防设施
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,
@ -655,27 +656,31 @@ export class WarningStatisticsListComponent implements OnInit {
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (instance.isScrap) { if (instance.isScrap) {
let body = { await new Promise(resolve => {
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'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: item.id, id: item.violatedItemSnapshotObj.id,
handleRecord: '报废成功!' 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'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
this.message.create('success', '报废成功!'); let body = {
item.handleTime = new Date() id: item.id,
return true 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 { } else {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise(resolve => {
@ -689,7 +694,6 @@ export class WarningStatisticsListComponent implements OnInit {
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
// item.violatedItemSnapshotObj = data.result
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '维保成功!' handleRecord: '维保成功!'

Loading…
Cancel
Save