Commit c3d6758b authored by zhangjianqian's avatar zhangjianqian

应急处置功能

parent e3ea7958
...@@ -37,8 +37,8 @@ public class TEventInfo extends BaseEntity ...@@ -37,8 +37,8 @@ public class TEventInfo extends BaseEntity
private String eventLocation; private String eventLocation;
/** 报案时间 */ /** 报案时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "报案时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "报案时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date reportTime; private Date reportTime;
/** 报案人 */ /** 报案人 */
......
...@@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportPerson != null and reportPerson != ''"> and report_person like concat('%', #{reportPerson}, '%')</if> <if test="reportPerson != null and reportPerson != ''"> and report_person like concat('%', #{reportPerson}, '%')</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != ''"> and beyond_enterprise_id = #{beyondEnterpriseId}</if> <if test="beyondEnterpriseId != null and beyondEnterpriseId != ''"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
</where> </where>
order by report_time
</select> </select>
<select id="selectTEventInfoById" parameterType="Long" resultMap="TEventInfoResult"> <select id="selectTEventInfoById" parameterType="Long" resultMap="TEventInfoResult">
......
...@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planLevel != null and planLevel != ''"> and plan_level = #{planLevel}</if> <if test="planLevel != null and planLevel != ''"> and plan_level = #{planLevel}</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != ''"> and beyond_enterprise_id = #{beyondEnterpriseId}</if> <if test="beyondEnterpriseId != null and beyondEnterpriseId != ''"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
</where> </where>
order by create_time desc
</select> </select>
<select id="selectTPlanInfoById" parameterType="Long" resultMap="TPlanInfoResult"> <select id="selectTPlanInfoById" parameterType="Long" resultMap="TPlanInfoResult">
......
...@@ -111,13 +111,13 @@ ...@@ -111,13 +111,13 @@
<el-table-column label="事件地点" align="center" prop="eventLocation" /> <el-table-column label="事件地点" align="center" prop="eventLocation" />
<el-table-column label="报案时间" align="center" prop="reportTime" width="180"> <el-table-column label="报案时间" align="center" prop="reportTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="报案人" align="center" prop="reportPerson" /> <el-table-column label="报案人" align="center" prop="reportPerson" />
<el-table-column label="事件处置信息" align="center" prop="eventDeal" /> <el-table-column label="事件处置信息" align="center" prop="eventDeal" />
<el-table-column label="事件评估信息" align="center" prop="eventAssessment" /> <el-table-column label="事件评估信息" align="center" prop="eventAssessment" />
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseId" /> <el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="备注" align="center" prop="remarks" /> <el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<div class="division"> <div class="division">
<div style="width: 50%"> <div style="width: 45%">
<el-form-item label="事件名称" prop="eventTitle"> <el-form-item label="事件名称" prop="eventTitle">
<el-input v-model="form.eventTitle" placeholder="请输入事件名称" /> <el-input v-model="form.eventTitle" placeholder="请输入事件名称" />
</el-form-item> </el-form-item>
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
</div> </div>
<div style="width: 50%"> <div style="width: 50%">
<el-form-item label="所属企业" prop="beyondEnterpriseId"> <el-form-item label="所属企业" prop="beyondEnterpriseId">
<el-select v-model="form.beyondEnterpriseId" placeholder="请选择预案等级" @change="qiyechang"> <el-select v-model="form.beyondEnterpriseName" placeholder="请选择预案等级" @change="qiyechang">
<el-option <el-option
v-for = "dict in enterpriseList" v-for = "dict in enterpriseList"
:key = "dict.enterpriseId" :key = "dict.enterpriseId"
...@@ -212,8 +212,8 @@ ...@@ -212,8 +212,8 @@
<el-form-item label="报案时间" prop="reportTime"> <el-form-item label="报案时间" prop="reportTime">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="form.reportTime" v-model="form.reportTime"
type="date" type="datetime"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择报案时间"> placeholder="选择报案时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -222,10 +222,10 @@ ...@@ -222,10 +222,10 @@
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<el-form-item label="事件处置信息" prop="eventDeal"> <el-form-item label="事件处置信息" prop="eventDeal" style="width: 60%">
<el-input v-model="form.eventDeal" type="textarea" placeholder="请输入事件处置信息" /> <el-input v-model="form.eventDeal" type="textarea" placeholder="请输入事件处置信息" />
</el-form-item> </el-form-item>
<el-form-item label="事件评估信息" prop="eventAssessment"> <el-form-item label="事件评估信息" prop="eventAssessment" style="width: 60%">
<el-input v-model="form.eventAssessment" type="textarea" placeholder="请输入事件评估信息" /> <el-input v-model="form.eventAssessment" type="textarea" placeholder="请输入事件评估信息" />
</el-form-item> </el-form-item>
...@@ -367,6 +367,7 @@ export default { ...@@ -367,6 +367,7 @@ export default {
return item.enterpriseId === value; return item.enterpriseId === value;
}); });
this.form.beyondEnterpriseName = obj.enterpriseName; this.form.beyondEnterpriseName = obj.enterpriseName;
this.form.beyondEnterpriseId = value;
}, },
// 事件类型:1.泄漏 2.火灾 3.爆炸字典翻译 // 事件类型:1.泄漏 2.火灾 3.爆炸字典翻译
eventTypeFormat(row, column) { eventTypeFormat(row, column) {
...@@ -508,3 +509,8 @@ export default { ...@@ -508,3 +509,8 @@ export default {
justify-content:flex-start; justify-content:flex-start;
} }
</style> </style>
<style lang="scss" scoped>
::v-deep .el-select{
width: 100%;
}
</style>
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<el-table-column label="应急设备及车辆" align="center" prop="planEquipment" /> <el-table-column label="应急设备及车辆" align="center" prop="planEquipment" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remarks" /> <el-table-column label="备注" align="center" prop="remarks" />
...@@ -117,6 +117,12 @@ ...@@ -117,6 +117,12 @@
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:planInfo:edit']" v-hasPermi="['system:planInfo:edit']"
>修改</el-button> >修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-document-copy"
@click="handleDtail(scope.row)"
>详情</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -137,15 +143,15 @@ ...@@ -137,15 +143,15 @@
/> />
<!-- 添加或修改应急预案对话框 --> <!-- 添加或修改应急预案对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<div class="division"> <div class="division">
<div style="width: 50%;"> <div style="width: 40%;">
<el-form-item label="预案标题" prop="planTitle"> <el-form-item label="预案标题" prop="planTitle" >
<el-input v-model="form.planTitle" placeholder="请输入预案标题" /> <el-input v-model="form.planTitle" placeholder="请输入预案标题" :readonly="readonly"/>
</el-form-item> </el-form-item>
<el-form-item label="预案类型" prop="planType"> <el-form-item label="预案类型" prop="planType">
<el-select v-model="form.planType" placeholder="请选择预案类型"> <el-select v-model="form.planType" placeholder="请选择预案类型" :disabled="readonly">
<el-option <el-option
v-for = "dict in planTypeList" v-for = "dict in planTypeList"
:key = "dict.dictValue" :key = "dict.dictValue"
...@@ -155,7 +161,7 @@ ...@@ -155,7 +161,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="预案等级" prop="planLevel"> <el-form-item label="预案等级" prop="planLevel">
<el-select v-model="form.planLevel" placeholder="请选择预案等级"> <el-select v-model="form.planLevel" placeholder="请选择预案等级" :disabled="readonly">
<el-option <el-option
v-for = "dict in planLevelList" v-for = "dict in planLevelList"
:key = "dict.dictValue" :key = "dict.dictValue"
...@@ -164,11 +170,26 @@ ...@@ -164,11 +170,26 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="预案图片" prop="iconUrl"> <el-form-item label="所属企业" prop="beyondEnterpriseName">
<el-select v-model="form.beyondEnterpriseName" placeholder="请选择预案等级" @change="qiyechang" :disabled="readonly">
<el-option
v-for = "dict in enterpriseList"
:key = "dict.enterpriseId"
:label = "dict.enterpriseName"
:value = "dict.enterpriseId"
/>
</el-select>
</el-form-item>
<el-form-item label="应急设备车辆" prop="planEquipment" >
<el-input v-model="form.planEquipment" placeholder="请输入应急设备及车辆" :readonly="readonly"/>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" :readonly="readonly" />
</el-form-item>
<el-form-item label="预案附件" id="fujian" prop="iconUrl">
<el-upload <el-upload
:action="uploadImgUrl" :action="uploadImgUrl"
list-type="picture-card" list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-success ="uploadsuccess" :on-success ="uploadsuccess"
:on-remove="handleRemove" :on-remove="handleRemove"
:file-list="fileList"> :file-list="fileList">
...@@ -176,39 +197,20 @@ ...@@ -176,39 +197,20 @@
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>--> <!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
</el-upload> </el-upload>
<el-dialog :visible.sync="dialogVisible"> <!--<el-dialog :visible.sync="dialogVisible">-->
<img width="100%" :src="dialogImageUrl" alt=""> <!--<img width="100%" :src="dialogImageUrl" alt="">-->
</el-dialog> <!--</el-dialog>-->
</el-form-item> </el-form-item>
<el-form-item label="应急方案" prop="planContents"> <el-form-item label="预案附件" id="fujianxia" prop="iconUrl" style="display: none">
<el-upload <a @click="downloadFile" style="color: blue">下载附件>></a>
class="upload-demo" <!--<el-input v-model="fileurl" placeholder="" />-->
:action="uploadImgUrl"
:on-success="uploadsuccess2"
:on-remove="handleRemove2"
:file-list="fileList2"
list-type="text">
<el-button size="small" id = "uploadfang" type="primary">点击上传</el-button>
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
</el-upload>
</el-form-item> </el-form-item>
</div> </div>
<div style="width: 50%;"> <div style="width: 60%;">
<el-form-item label="所属企业" prop="beyondEnterpriseId"> <el-form-item label="应急方案" prop="planContents">
<el-select v-model="form.beyondEnterpriseId" placeholder="请选择预案等级" @change="qiyechang"> <!--<el-input v-model="form.planContents" placeholder="" />-->
<el-option <editor v-model="form.planContents" style="height: 300px;" readonly/>
v-for = "dict in enterpriseList" <!--<textarea id="editorA" v-model="form.planContents" height="100%"></textarea>-->
:key = "dict.enterpriseId"
:label = "dict.enterpriseName"
:value = "dict.enterpriseId"
/>
</el-select>
</el-form-item>
<el-form-item label="应急设备车辆" prop="planEquipment">
<el-input v-model="form.planEquipment" placeholder="请输入应急设备及车辆" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
...@@ -223,7 +225,7 @@ ...@@ -223,7 +225,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button id="yesbutton" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -232,16 +234,18 @@ ...@@ -232,16 +234,18 @@
<script> <script>
import { listPlanInfo, getPlanInfo, delPlanInfo, addPlanInfo, updatePlanInfo, exportPlanInfo,enterpriseList } from "@/api/system/planInfo"; import { listPlanInfo, getPlanInfo, delPlanInfo, addPlanInfo, updatePlanInfo, exportPlanInfo,enterpriseList } from "@/api/system/planInfo";
import Editor from '@/components/Editor';
export default { export default {
name: "PlanInfo", name: "PlanInfo",
components: { components: {
Editor
}, },
data() { data() {
return { return {
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
// 遮罩层 // 遮罩层
loading: true, loading: true,
readonly: true,
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
// 选中数组 // 选中数组
...@@ -266,7 +270,7 @@ export default { ...@@ -266,7 +270,7 @@ export default {
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
fileList:[], fileList:[],
fileList2:[], fileurl:'',
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -283,7 +287,7 @@ export default { ...@@ -283,7 +287,7 @@ export default {
planTitle: [ planTitle: [
{ required: true, message: "标题不能为空", trigger: "blur" } { required: true, message: "标题不能为空", trigger: "blur" }
], ],
beyondEnterpriseId: [ beyondEnterpriseName: [
{ required: true, message: "所属企业不能为空", trigger: "blur" } { required: true, message: "所属企业不能为空", trigger: "blur" }
], ],
planType: [ planType: [
...@@ -322,15 +326,18 @@ export default { ...@@ -322,15 +326,18 @@ export default {
}); });
}, },
qiyechang(value){ qiyechang(value){
console.log(value)
let obj = {}; let obj = {};
obj = this.enterpriseList.find((item)=>{ obj = this.enterpriseList.find((item)=>{
return item.enterpriseId === value; return item.enterpriseId === value;
}); });
this.form.beyondEnterpriseName = obj.enterpriseName; this.form.beyondEnterpriseName = obj.enterpriseName;
this.form.beyondEnterpriseId = value;
}, },
//上传图片 //上传图片
uploadsuccess(response){ uploadsuccess(response){
this.form.iconUrl=response.url; this.form.iconUrl=response.url;
console.log(this.fileList)
//console.log(document.getElementsByClassName("el-upload--picture-card")) //console.log(document.getElementsByClassName("el-upload--picture-card"))
document.getElementsByClassName("el-upload--picture-card")[0].style.display="none"; document.getElementsByClassName("el-upload--picture-card")[0].style.display="none";
}, },
...@@ -341,21 +348,31 @@ export default { ...@@ -341,21 +348,31 @@ export default {
this.dialogImageUrl = file.url; this.dialogImageUrl = file.url;
this.dialogVisible = true; this.dialogVisible = true;
}, },
//上传方案
handleRemove2(file, fileList) {
document.getElementById("uploadfang").style.display="";
},
uploadsuccess2(response){
this.form.planContents=response.url;
document.getElementById("uploadfang").style.display="none";
},
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.fileList = []; this.fileList = [];
this.fileList2 = [];
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
//点击下载
downloadFile() {
var item = this.fileurl;
var title = item.split("/")[item.split("/").length-1];
this.download(item,title);
},
download (src, fileName) {
let x = new XMLHttpRequest();
x.open("GET", src, true);
x.responseType = 'blob';
x.onload = function(e) {
let url = window.URL.createObjectURL(x.response)
let a = document.createElement('a');
a.href = url
a.download = fileName
a.click()
}
x.send();
},
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
...@@ -395,18 +412,39 @@ export default { ...@@ -395,18 +412,39 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.open = true;
this.readonly=false;
this.fileList = []; this.fileList = [];
this.fileList2 = [];
this.reset(); this.reset();
this.open = true;
this.title = "添加应急预案"; this.title = "添加应急预案";
document.getElementById("fujian").style.display=""
document.getElementById("fujianxia").style.display="none"
document.getElementById("yesbutton").style.display="" ;
document.getElementsByClassName("el-upload--picture-card")[0].style.display=""; document.getElementsByClassName("el-upload--picture-card")[0].style.display="";
document.getElementById("uploadfang").style.display="";
},
handleDtail(row){
this.readonly=true;
this.fileList = [];
this.reset();
this.open = true;
const planId = row.planId || this.ids
getPlanInfo(planId).then(response => {
this.form = response.data;
this.title = "应急预案详情";
this.fileList = [{name: 'file', url: row.iconUrl}];
this.fileurl = row.iconUrl;
document.getElementById("yesbutton").style.display="none" ;
document.getElementById("fujian").style.display="none"
document.getElementById("fujianxia").style.display=""
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.readonly=false;
this.fileList = []; this.fileList = [];
this.fileList2 = [];
this.reset(); this.reset();
const planId = row.planId || this.ids const planId = row.planId || this.ids
getPlanInfo(planId).then(response => { getPlanInfo(planId).then(response => {
...@@ -417,14 +455,11 @@ export default { ...@@ -417,14 +455,11 @@ export default {
this.fileList = [{name: 'file', url: row.iconUrl}]; this.fileList = [{name: 'file', url: row.iconUrl}];
this.$nextTick(()=>{ this.$nextTick(()=>{
document.getElementsByClassName("el-upload--picture-card")[0].style.display="none" document.getElementsByClassName("el-upload--picture-card")[0].style.display="none"
document.getElementById("yesbutton").style.display="" ;
}) })
} }
if(row.planContents!=null||row.planContents==""){ document.getElementById("fujian").style.display=""
this.fileList2 = [{name: 'file2', url: row.planContents}]; document.getElementById("fujianxia").style.display="none"
this.$nextTick(()=>{
document.getElementById("uploadfang").style.display="none"
})
}
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
...@@ -496,3 +531,8 @@ export default { ...@@ -496,3 +531,8 @@ export default {
justify-content:flex-start; justify-content:flex-start;
} }
</style> </style>
<style lang="scss" scoped>
::v-deep .el-select{
width: 100%;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment