Commit c3d6758b authored by zhangjianqian's avatar zhangjianqian

应急处置功能

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