开发完成

hyx_2024-9-29_tongbu
shanao 2024-09-12 18:03:09 +08:00
parent 5b483cbdf6
commit ce9d974e99
4 changed files with 64 additions and 89 deletions

View File

@ -3,7 +3,6 @@
<el-form <el-form
ref="form" ref="form"
:model="infoForm" :model="infoForm"
:rules="rules"
label-width="180px" label-width="180px"
style="width: 900px" style="width: 900px"
> >
@ -55,12 +54,10 @@
<el-input v-model="infoForm.summary" :disabled="isDisabled" autocomplete="off"/> <el-input v-model="infoForm.summary" :disabled="isDisabled" autocomplete="off"/>
</el-form-item> </el-form-item>
<el-form-item :label-width="formLabelWidth" label="事故照片" prop="photos"> <el-form-item :label-width="formLabelWidth" label="事故照片" prop="photos">
<el-avatar <el-image
:size="100"
:fit="'scale-down'"
:src="config.fileUrl+infoForm.photos" :src="config.fileUrl+infoForm.photos"
shape="square" :preview-src-list="[config.fileUrl+infoForm.photos]"
@click="dialogImgVisible = true"/> style="width: 100px; height: 100px"/>
</el-form-item> </el-form-item>
<el-form-item :label-width="formLabelWidth" label="原因分析及责任认定" prop="analysis"> <el-form-item :label-width="formLabelWidth" label="原因分析及责任认定" prop="analysis">
<el-input v-model="infoForm.analysis" :disabled="isDisabled" autocomplete="off"/> <el-input v-model="infoForm.analysis" :disabled="isDisabled" autocomplete="off"/>
@ -138,46 +135,14 @@ export default {
incidentTypes: [], incidentTypes: [],
/** 事故等级 */ /** 事故等级 */
incidentLevels: [], incidentLevels: [],
/** 图片 */
fileList: [],
allowRemove: true, //
/** 预览弹窗 */ /** 预览弹窗 */
dialogImgVisible: false, dialogImgVisible: false,
rules: { isDisabled: true
incidentNumber: [{ required: true, message: '事故案号不能为空', trigger: 'blur' }],
incidentName: [{ required: true, message: '事故名称不能为空', trigger: 'blur' }],
HIDDENTYPE: [{ required: true, message: '事故类型不能为空', trigger: 'blur' }],
incidentType: [{ required: true, message: '隐患类型不能为空', trigger: 'blur' }],
incidentLevel: [{ required: true, message: '事故级别不能为空', trigger: 'blur' }],
incidentNature: [{ required: true, message: '事故性质不能为空', trigger: 'blur' }],
location: [{ required: true, message: '事故发生地点不能为空', trigger: 'blur' }],
incidentDate: [{ required: true, message: '事故发生时间不能为空', trigger: 'blur' }],
directLoss: [{ required: true, message: '直接经济损失(万元)不能为空', trigger: 'blur' }],
injured: [{ required: true, message: '受伤人数不能为空', trigger: 'blur' }],
seriouslyInjured: [{ required: true, message: '隐患类型不能为空', trigger: 'blur' }],
cause: [{ required: true, message: '事故起因不能为空', trigger: 'blur' }],
summary: [{ required: true, message: '事故概述不能为空', trigger: 'blur' }],
photos: [{ required: true, message: '事故照片不能为空', trigger: 'blur' }],
analysis: [{ required: true, message: '原因分析及责任认定不能为空', trigger: 'blur' }],
suggestions: [{ required: true, message: '考核建议不能为空', trigger: 'blur' }],
measures: [{ required: true, message: '整改措施不能为空', trigger: 'blur' }],
creator: [{ required: true, message: '填表人不能为空', trigger: 'blur' }],
reportDate: [{ required: true, message: '报出日期不能为空', trigger: 'blur' }]
}
} }
}, },
computed: {
isDisabled() {
return true
}
},
created() { created() {
this.getDict() this.getDict()
const id = this.$parent.id requestFN('/accident/info/' + this.$parent.id, {}).then((data) => {
requestFN('/accident/' + id, {}).then((data) => {
this.infoForm = data.info this.infoForm = data.info
}).catch(() => { }).catch(() => {
}) })

View File

@ -1,16 +1,17 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="searchForm" :model="searchForm" label-width="100px"> <el-form ref="searchForm" :model="searchForm" label-width="100px">
<el-row :gutter="12"> <el-row :gutter="24">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="事故名称" prop="incidentName"> <el-form-item label="事故名称" prop="incidentName">
<el-input v-model="searchForm.incidentName" placeholder="请输入隐患描述" class="filter-item"/> <el-input v-model="searchForm.incidentName" placeholder="请输入隐患描述" class="filter-item"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="5">
<el-form-item label="发生时间" prop="incidentDates"> <el-form-item label="发生时间" prop="incidentDates">
<el-date-picker <el-date-picker
v-model="searchForm.incidentDates" v-model="searchForm.incidentDates"
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
style="width: 100%" style="width: 100%"
@ -25,21 +26,21 @@
<el-input v-model="searchForm.location" placeholder="请输入发生地点" /> <el-input v-model="searchForm.location" placeholder="请输入发生地点" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="3">
<el-form-item label="事故类型" prop="incidentType"> <el-form-item label="事故类型" prop="incidentType">
<el-select v-model="searchForm.incidentType" placeholder="请选择"> <el-select v-model="searchForm.incidentType" placeholder="请选择">
<el-option v-for="item in incidentTypes" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in incidentTypes" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="3">
<el-form-item label="事故等级" prop="incidentLevel"> <el-form-item label="事故等级" prop="incidentLevel">
<el-select v-model="searchForm.incidentLevel" placeholder="请选择"> <el-select v-model="searchForm.incidentLevel" placeholder="请选择">
<el-option v-for="item in incidentLevels" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in incidentLevels" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="5">
<el-button v-waves type="primary" icon="el-icon-search" @click="searchList"></el-button> <el-button v-waves type="primary" icon="el-icon-search" @click="searchList"></el-button>
<el-button v-waves icon="el-icon-refresh" @click="handleReset"></el-button> <el-button v-waves icon="el-icon-refresh" @click="handleReset"></el-button>
<el-button <el-button
@ -63,12 +64,12 @@
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
> >
<el-table-column type="selection" width="55"/> <el-table-column align="center" type="selection" width="55"/>
<el-table-column label="事故名称" prop="incidentName"/> <el-table-column align="center" label="事故名称" prop="incidentName"/>
<el-table-column label="所属公司" prop="companyName"/> <el-table-column align="center" label="所属公司" prop="companyName"/>
<el-table-column label="发生时间" prop="incidentDate"/> <el-table-column align="center" label="发生时间" prop="incidentDate"/>
<el-table-column label="发生地点" prop="location"/> <el-table-column align="center" label="发生地点" prop="location"/>
<el-table-column label="操作" width="300"> <el-table-column align="center" label="操作" width="300">
<template v-slot="{row}"> <template v-slot="{row}">
<el-button icon="el-icon-view" size="mini" @click="goView(row.id)"></el-button> <el-button icon="el-icon-view" size="mini" @click="goView(row.id)"></el-button>
</template> </template>
@ -146,12 +147,13 @@ export default {
if (dates != null && dates.length === 2) { if (dates != null && dates.length === 2) {
this.searchForm.startTime = dates[0] this.searchForm.startTime = dates[0]
this.searchForm.endTime = dates[1] this.searchForm.endTime = dates[1]
delete this.searchForm.incidentDates
} }
const url = '/accident/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page const url = '/accident/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page
requestFN(url, { ...this.searchForm }).then((data) => { requestFN(url, { ...this.searchForm, corpInfoId: this.$parent.corpInfoId }).then((data) => {
this.listLoading = false this.listLoading = false
this.varList = data.varList this.varList = data.varList
this.total = data.page.totalResult this.listQuery.total = data.page.totalResult
}).catch((e) => { }).catch((e) => {
this.listLoading = false this.listLoading = false
}) })
@ -169,7 +171,7 @@ export default {
*/ */
goView(id) { goView(id) {
this.$parent.id = id this.$parent.id = id
this.$parent.activeName = 'List' this.$parent.activeName = 'AddOrEdit'
}, },
/** /**
@ -193,12 +195,20 @@ export default {
}) })
}, },
/**
* 表单清空处理
*/
handleResetInitForm() {
this.searchForm = this.$options.data().searchForm
},
/** /**
* 返回到列表页面 * 返回到列表页面
*/ */
goBack() { goBack() {
this.handleResetInitForm() this.handleResetInitForm()
this.$parent.activeName = 'listCount' this.$parent.activeName = 'ListCount'
this.$parent.corpInfoId = ''
} }
} }
} }

View File

@ -2,14 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-form ref="searchForm" label-width="100px"> <el-form ref="searchForm" label-width="100px">
<el-row :gutter="12"> <el-row :gutter="12">
<el-col :span="4"> <el-col :span="5">
<el-form-item label="企业名称" prop="corpInfoId"> <el-form-item label="企业名称" prop="corpInfoId">
<el-select v-model="corpInfoId" placeholder="请选择"> <el-select v-model="corpInfoId" placeholder="请选择">
<el-option v-for="item in corpinfos" :key="item.corpInfoId" :label="item.corpName" :value="item.corpInfoId" /> <el-option v-for="item in corpinfos" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="7">
<el-button v-waves type="primary" icon="el-icon-search" @click="searchList"></el-button> <el-button v-waves type="primary" icon="el-icon-search" @click="searchList"></el-button>
<el-button v-waves icon="el-icon-refresh" @click="handleReset"></el-button> <el-button v-waves icon="el-icon-refresh" @click="handleReset"></el-button>
</el-col> </el-col>
@ -27,30 +27,29 @@
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
> >
<el-table-column type="selection" width="55"/> <el-table-column align="center" label="公司名称" prop="companyName" width="100"/>
<el-table-column label="公司名称" prop="companyName"/> <el-table-column align="center" label="放炮" prop="fire"/>
<el-table-column label="放炮" prop="fire"/> <el-table-column align="center" label="容器爆炸" prop="containerBlast"/>
<el-table-column label="容器爆炸" prop="containerBlast"/> <el-table-column align="center" label="道路交通" prop="roadTraffic"/>
<el-table-column label="道路交通" prop="roadTraffic"/> <el-table-column align="center" label="火药爆炸" prop="chemicalBlast"/>
<el-table-column label="火药爆炸" prop="chemicalBlast"/> <el-table-column align="center" label="火灾" prop="fireDamage"/>
<el-table-column label="火灾" prop="fireDamage"/> <el-table-column align="center" label="机械伤害" prop="mechanicalDamage"/>
<el-table-column label="机械伤害" prop="mechanicalDamage"/> <el-table-column align="center" label="锅炉爆炸" prop="boilerBlast"/>
<el-table-column label="锅炉爆炸" prop="boilerBlast"/> <el-table-column align="center" label="淹溺" prop="drowning"/>
<el-table-column label="淹溺" prop="drowning"/> <el-table-column align="center" label="灼烫" prop="scorching"/>
<el-table-column label="灼烫" prop="scorching"/> <el-table-column align="center" label="高处坠落" prop="highFall"/>
<el-table-column label="高处坠落" prop="highFall"/> <el-table-column align="center" label="中毒和窒息" prop="poisoningAndSuffocation"/>
<el-table-column label="中毒和窒息" prop="poisoningAndSuffocation"/> <el-table-column align="center" label="车辆伤害" prop="vehicleDamage"/>
<el-table-column label="车辆伤害" prop="vehicleDamage"/> <el-table-column align="center" label="坍塌" prop="collapse"/>
<el-table-column label="坍塌" prop="collapse"/> <el-table-column align="center" label="冒顶片帮" prop="overhang"/>
<el-table-column label="冒顶片帮" prop="overhang"/> <el-table-column align="center" label="透水" prop="waterOverflow"/>
<el-table-column label="透水" prop="waterOverflow"/> <el-table-column align="center" label="瓦斯爆炸" prop="gasBlast"/>
<el-table-column label="瓦斯爆炸" prop="gasBlast"/> <el-table-column align="center" label="其它爆炸" prop="otherBlast"/>
<el-table-column label="其它爆炸" prop="otherBlast"/> <el-table-column align="center" label="触电" prop="electricShock"/>
<el-table-column label="触电" prop="electricShock"/> <el-table-column align="center" label="物体打击" prop="objectImpact"/>
<el-table-column label="物体打击" prop="objectImpact"/> <el-table-column align="center" label="其它伤害" prop="otherDamage"/>
<el-table-column label="其它伤害" prop="otherDamage"/> <el-table-column align="center" label="起重伤害" prop="seriousInjury"/>
<el-table-column label="起重伤害" prop="seriousInjury"/> <el-table-column align="center" label="操作" width="100">
<el-table-column label="操作" width="300">
<template v-slot="{row}"> <template v-slot="{row}">
<el-button icon="el-icon-view" size="mini" @click="goView(row.corpinfoId)"></el-button> <el-button icon="el-icon-view" size="mini" @click="goView(row.corpinfoId)"></el-button>
</template> </template>
@ -110,7 +109,7 @@ export default {
requestFN(url, { corpInfoId: this.corpInfoId }).then((data) => { requestFN(url, { corpInfoId: this.corpInfoId }).then((data) => {
this.listLoading = false this.listLoading = false
this.varList = data.varList this.varList = data.varList
this.total = data.page.totalResult this.listQuery.total = data.page.totalResult
}).catch(() => { }).catch(() => {
this.listLoading = false this.listLoading = false
}) })
@ -127,18 +126,18 @@ export default {
* 跳转查看企业异常列表页面 * 跳转查看企业异常列表页面
*/ */
goView(id) { goView(id) {
this.$parent.id = id this.$parent.corpInfoId = id
this.$parent.activeName = 'AddOrEdit' this.$parent.activeName = 'List'
}, },
/** /**
* 查询企业信息 * 查询企业信息
*/ */
getDict() { getDict() {
const url = '/accident/page/count' const url = '/accident/corpinfo'
requestFN(url, {} requestFN(url, {}
).then((data) => { ).then((data) => {
this.corpinfos = JSON.parse(data.corpinfo) this.corpinfos = data.corpinfo
}).catch(() => {}) }).catch(() => {})
} }
} }

View File

@ -20,7 +20,8 @@ export default {
data() { data() {
return { return {
activeName: 'ListCount', activeName: 'ListCount',
id: '' id: '',
corpInfoId: ''
} }
}, },
watch: { watch: {