Commit a293de31 authored by wanghao's avatar wanghao

1 台账管理-燃气事故台账 逻辑调整,企业和政府都可以录入,政府查看企业数据。

2 台账管理-燃气事故台账 详情界面展示优化。
parent 78a38583
......@@ -53,7 +53,7 @@ public class TSafeEquipmentStandingBook extends BaseEntity
private String brandName;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
@Excel(name = "是否删除",readConverterExp = "0=否,1=是")
private String isDel;
/** 备注 */
......
......@@ -25,7 +25,7 @@ public class TTroubleStandingBook extends BaseEntity
@Excel(name = "事故名称")
private String troubleName;
private String township;
private Long township;
/** 事故地点 */
@Excel(name = "事故地点")
......@@ -38,7 +38,7 @@ public class TTroubleStandingBook extends BaseEntity
private BigDecimal latitude;
/** 事故类型:1.生产安全事故 2.非生产安全事故 */
@Excel(name = "事故类型:1.生产安全事故 2.非生产安全事故")
@Excel(name = "事故类型",readConverterExp="1=生产安全事故,2=非生产安全事故")
private String troubleType;
/** 简要经过 */
......@@ -46,11 +46,11 @@ public class TTroubleStandingBook extends BaseEntity
private String briefProcess;
/** 事故原因 */
@Excel(name = "事故原因")
@Excel(name = "事故原因",dictType = "t_trouble_reason")
private String troubleReason;
/** 是否人员伤亡 */
@Excel(name = "是否人员伤亡")
@Excel(name = "是否人员伤亡",readConverterExp = "1=是,2=否")
private String isCasualties;
/** 受伤人数 */
......@@ -70,7 +70,7 @@ public class TTroubleStandingBook extends BaseEntity
private String responsiblePeople;
/** 是否处理:1.已处理 2.未处理 */
@Excel(name = "是否处理:1.已处理 2.未处理")
@Excel(name = "是否处理",readConverterExp="1=是,2=否")
private String isDeal;
/** 事故发生时间 */
......@@ -84,18 +84,47 @@ public class TTroubleStandingBook extends BaseEntity
private Date dealDate;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
@Excel(name = "是否删除",readConverterExp="0=否,1=是")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public String getTownship() {
/**
* 所属企业id 不是必填
*/
private String enterpriseId;
/**
* 所属企业name 查询 和 导出使用
*/
/** 备注 */
@Excel(name = "所属企业")
private String enterpriseName;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public Long getTownship() {
return township;
}
public void setTownship(String township) {
public void setTownship(Long township) {
this.township = township;
}
......
......@@ -44,4 +44,6 @@ public class TTroubleStandingBookForm
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dealDateEnd;
private String enterpriseId;
}
......@@ -48,7 +48,7 @@ public class TSafeEquipmentStandingBookServiceImpl implements ITSafeEquipmentSta
public List<TSafeEquipmentStandingBook> selectTSafeEquipmentStandingBookList(TSafeEquipmentStandingBookForm tSafeEquipmentStandingBook)
{
// 20240725 调整 政府和企业都可以录,企业看自己,政府看所有
if (isEnterprise()) {
if (isEnterprise() && tSafeEquipmentStandingBook != null) {
tSafeEquipmentStandingBook.setEnterpriseId(SecurityUtils.getLoginUser().getUser().getDeptId());
}
......
......@@ -2,8 +2,11 @@ package com.zehong.system.service.impl;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.zehong.common.core.domain.entity.SysRole;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.TTroubleStandingBookVo;
......@@ -46,6 +49,10 @@ public class TTroubleStandingBookServiceImpl implements ITTroubleStandingBookSer
@Override
public List<TTroubleStandingBook> selectTTroubleStandingBookList(TTroubleStandingBookForm tTroubleStandingBook)
{
// 20240725 调整 政府和企业都可以录,企业看自己,政府看所有
if (isEnterprise() && tTroubleStandingBook != null) {
tTroubleStandingBook.setEnterpriseId(SecurityUtils.getLoginUser().getUser().getDeptId());
}
return tTroubleStandingBookMapper.selectTTroubleStandingBookList(tTroubleStandingBook);
}
......@@ -159,4 +166,13 @@ public class TTroubleStandingBookServiceImpl implements ITTroubleStandingBookSer
}
/**
* 判断是否为企业
* @return
*/
private boolean isEnterprise(){
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
List<String> roleKeys = roles.stream().map(item -> item.getRoleKey()).collect(Collectors.toList());
return roleKeys.contains("qy");
}
}
......@@ -28,24 +28,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="enterpriseId" column="enterprise_id" />
<result property="enterpriseName" column="enterpriseName" />
</resultMap>
<sql id="selectTTroubleStandingBookVo">
select trouble_id, trouble_name, trouble_location,township, longitude, latitude, trouble_type, brief_process, trouble_reason, is_casualties, injury_num, death_num, responsible_unit, responsible_people, is_deal,happen_date, deal_date, create_by, create_time, update_by, update_time, is_del, remarks from t_trouble_standing_book
select book.trouble_id, book.trouble_name, book.trouble_location,book.township, book.longitude, book.latitude,
book.trouble_type,book.brief_process, book.trouble_reason, book.is_casualties, book.injury_num,
book.death_num, book.responsible_unit,book.responsible_people, book.is_deal,book.happen_date,
book.deal_date, book.create_by, book.create_time, book.update_by,book.update_time, book.is_del,
book.remarks,book.enterprise_id,info.enterprise_name as enterpriseName
from t_trouble_standing_book book
left join t_enterprise_info info on book.enterprise_id = info.enterprise_id
</sql>
<select id="selectTTroubleStandingBookList" parameterType="TTroubleStandingBookForm" resultMap="TTroubleStandingBookResult">
<include refid="selectTTroubleStandingBookVo"/>
<where> is_del = '0'
<if test="troubleName != null and troubleName != ''"> and trouble_name like concat('%', #{troubleName}, '%')</if>
<if test="troubleType != null and troubleType != ''"> and trouble_type = #{troubleType}</if>
<if test="isDeal != null and isDeal != ''"> and is_deal = #{isDeal}</if>
<if test="happenDateStart != null "> and happen_date &gt;= #{happenDateStart}</if>
<if test="happenDateEnd != null "> and happen_date &lt;= #{happenDateEnd}</if>
<if test="dealDateStart != null "> and deal_date &gt;= #{dealDateStart}</if>
<if test="dealDateEnd != null "> and deal_date &lt;= #{dealDateEnd}</if>
<where> book.is_del = '0'
<if test="troubleName != null and troubleName != ''"> and book.trouble_name like concat('%', #{troubleName}, '%')</if>
<if test="troubleType != null and troubleType != ''"> and book.trouble_type = #{troubleType}</if>
<if test="isDeal != null and isDeal != ''"> and book.is_deal = #{isDeal}</if>
<if test="happenDateStart != null "> and book.happen_date &gt;= #{happenDateStart}</if>
<if test="happenDateEnd != null "> and book.happen_date &lt;= #{happenDateEnd}</if>
<if test="dealDateStart != null "> and book.deal_date &gt;= #{dealDateStart}</if>
<if test="dealDateEnd != null "> and book.deal_date &lt;= #{dealDateEnd}</if>
<if test="enterpriseId != null and enterpriseId!= '' "> and book.enterprise_id = #{enterpriseId} </if>
</where>
order by create_time desc
order by book.create_time desc
</select>
<select id="selectTTroubleStandingBookStatistic" resultType="TTroubleStandingBookVo">
......@@ -86,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
<if test="enterpriseId != null">enterprise_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="troubleName != null">#{troubleName},</if>
......@@ -110,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
<if test="enterpriseId != null">#{enterpriseId},</if>
</trim>
</insert>
......@@ -138,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
</trim>
where trouble_id = #{troubleId}
</update>
......
......@@ -75,6 +75,7 @@
<el-table-column label="用户名称" align="center" prop="userName" width="200px"/>
<el-table-column label="身份证号" align="center" prop="idCard" width="180px"/>
<el-table-column label="联系电话" align="center" prop="linkMobile"/>
<el-table-column label="所属企业" align="center" prop="enterpriseName" :formatter="enterpriseFormat" :show-overflow-tooltip="true"/>
<el-table-column label="详细地址" align="center" prop="userAddress" width="380px"/>
<el-table-column label="安装时间" align="center" prop="installTime"/>
<el-table-column label="品牌名称" align="center" prop="brandName"/>
......@@ -391,6 +392,9 @@ export default {
this.open2 = false;
this.reset2();
},
enterpriseFormat(row){
return row.enterpriseName==null?"-":row.enterpriseName;
},
// 表单重置
reset1() {
this.form = {
......
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="1200px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-row>
<el-col :span="14">
<el-form label-width="120px">
<el-row>
<el-col :span="11">
<el-form-item label="事故名称:" >
<span v-if="detailInfo.troubleName">{{ detailInfo.troubleName }}</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="事故原因:">
<span v-if="detailInfo.troubleReason">{{ detailInfo.troubleReason }}</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="责任单位:" >
<span v-if="detailInfo.responsibleUnit">{{ detailInfo.responsibleUnit }}</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="是否人员伤亡:" >
<span v-if="detailInfo.isCasualties == '1'"></span>
<span v-else-if="detailInfo.isCasualties == '2'"></span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事故类型:" >
<span v-if="detailInfo.troubleType == '1'">安全生产事故</span>
<span v-else-if="detailInfo.troubleType == '2'">非生产安全事故</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="事故地点:" >
<span v-if="detailInfo.troubleLocation">{{ detailInfo.troubleLocation }}</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="责任人员:" >
<span v-if="detailInfo.responsiblePeople">{{ detailInfo.responsiblePeople }}</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="是否处理:" >
<span v-if="detailInfo.isDeal == '1'">已处理</span>
<span v-else-if="detailInfo.isDeal == '2'">未处理</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="detailInfo.isCasualties == '1'">
<el-col :span="11">
<el-form-item label="受伤人数:" >
<span v-if="detailInfo.injuryNum">{{ detailInfo.injuryNum }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="死亡人数:" >
<span v-if="detailInfo.deathNum">{{ detailInfo.deathNum }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="处理完成时间:" >
<span v-if="detailInfo.dealDate">{{ detailInfo.dealDate }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="简要经过:" >
<span v-if="detailInfo.briefProcess">{{ detailInfo.briefProcess }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="备注信息:" >
<span v-if="detailInfo.remarks">{{ detailInfo.remarks }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="所属企业:" >
<span v-if="detailInfo.enterpriseName">{{ detailInfo.enterpriseName }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-col>
<el-col :span="9">
<div style="width: 100%;height: 390px; border: 1px solid rgb(218, 213, 213);margin-bottom: 10px;">
<div style="width: 100%;height: 100%" id="troubleContainer"></div>
</div>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { getTrouble} from "@/api/standingBook/trouble";
import { EditorMap } from "@/utils/mapClass/getPath.js";
export default {
name: "detail-info",
data(){
return{
detailInfo: {},
enterpriseName:"",
detailOpen: false,
devicePos: [],
map: null,
reasonOptions:[],
}
},
created() {
this.getDicts("t_trouble_reason").then(response => {
this.reasonOptions = response.data;
});
},
methods:{
statusFormat2(row, column) {
return this.selectDictLabel(this.reasonOptions, row.troubleReason);
},
getDetailInfo(id){
getTrouble(id).then(response => {
this.detailInfo = response.data;
this.detailInfo.troubleReason = this.statusFormat2(this.detailInfo,0);
this.devicePos = [this.detailInfo.longitude, this.detailInfo.latitude];
this.detailOpen = true;
this.$nextTick(() => {
this.map = new EditorMap("troubleContainer", {}, this);
this.map.addDevice({ path: this.devicePos });
this.map.nowMouseTarget = null;
this.map.mousetoolClose(false);
});
});
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -81,7 +81,8 @@
<span v-if="scope.row.troubleType == 2">非生产安全事故</span>
</template>
</el-table-column>
<el-table-column label="所属乡镇" align="center" prop="township" :formatter="statusFormat"/>
<el-table-column label="所属企业" align="center" prop="enterpriseName" :formatter="enterpriseFormat" :show-overflow-tooltip="true"/>
<el-table-column label="所属乡镇" align="center" prop="township" :formatter="beyondCountyFormat"/>
<el-table-column label="事故地点" align="center" prop="troubleLocation" width="300px"/>
<el-table-column label="事故发生时间" align="center" prop="happenDate" width="150px"/>
......@@ -154,12 +155,12 @@
<el-col :span="11">
<el-form-item label="所属乡镇" prop="township">
<el-select v-model="form.township" placeholder="请选择处理结果" filterable style="width: 100%" >
<el-option
v-for="dict in addressOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
<el-option
v-for="county in countyInfo"
:key="county.fId"
:label="county.fName.trim()"
:value="county.fId"
/>
</el-select>
</el-form-item>
</el-col>
......@@ -230,12 +231,12 @@
<el-row v-if="form.isCasualties == '1'">
<el-col :span="11">
<el-form-item label="受伤人数" prop="injuryNum">
<el-input v-model.number="form.injuryNum" placeholder="请输入受伤人数" />
<el-input-number style="width: 100%;" class="left-aligned-input" :controls="false" :min="0" v-model.number="form.injuryNum" placeholder="请输入受伤人数" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="死亡人数" prop="deathNum">
<el-input v-model.number="form.deathNum" placeholder="请输入死亡人数" />
<el-input-number style="width: 100%;" class="left-aligned-input" :controls="false" :min="0" v-model.number="form.deathNum" placeholder="请输入死亡人数" />
</el-form-item>
</el-col>
</el-row>
......@@ -282,6 +283,16 @@
<el-input type="textarea" v-model="form.remarks" placeholder="请输入备注信息" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属企业" prop="enterpriseId">
<el-select v-model="form.enterpriseId" placeholder="请在下拉框中选择名称" maxlength="255" style="width: 100%;">
<el-option v-for="item in enterpriseList" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
......@@ -380,6 +391,8 @@
@getPath="getPath"
/>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
......@@ -387,11 +400,14 @@
import { listTrouble, getTrouble, delTrouble, addTrouble, updateTrouble, exportTrouble } from "@/api/standingBook/trouble";
import GetPos from '@/components/GetPos';
import { EditorMap } from "@/utils/mapClass/getPath.js";
import { selectTEnterprise} from "@/api/regulation/supervise";
import { getDefaultCountyList } from "@/api/area/county";
import DetailInfo from "./DetailInfo";
export default {
name: "Trouble",
components: {
GetPos
GetPos,DetailInfo
},
data() {
return {
......@@ -401,6 +417,10 @@ export default {
exportLoading: false,
// 选中数组
ids: [],
// 企业数据
enterpriseList:[],
//县级行政区
countyInfo: [],
// 非单个禁用
single: true,
// 非多个禁用
......@@ -490,8 +510,30 @@ export default {
this.getDicts("t_trouble_reason").then(response => {
this.reasonOptions = response.data;
});
this.getEnterp();
this.getCountyInfo();
},
methods: {
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.countyInfo = res.data;
}
})
},
enterpriseFormat(row){
return row.enterpriseName==null?"-":row.enterpriseName;
},
beyondCountyFormat(row){
let info = this.countyInfo.find(item => item.fId == row.township);
return info?info.fName:"-";
},
getEnterp(){
selectTEnterprise().then(response => {
this.enterpriseList = response.data;
});
},
/** 查询事故台账列表 */
getList() {
this.loading = true;
......@@ -602,6 +644,10 @@ export default {
this.reset1();
this.open1 = true;
this.title1 = "添加燃气事故台账";
// 如果当前是企业,则直接赋值
if (this.$store.state.user.roleId == 5) {
this.form.enterpriseId = this.enterpriseList[0].enterpriseId;
}
},
/** 修改按钮操作 */
handleUpdate(row) {
......@@ -665,22 +711,24 @@ export default {
},
/** 详细信息跳转 */
showDetail(row) {
this.reset2();
getTrouble(row.troubleId).then(response => {
this.detailForm = response.data;
this.detailForm.troubleReason = this.statusFormat2(this.detailForm,0);
this.devicePos = [this.detailForm.longitude, this.detailForm.latitude];
console.log("this.devicePos",this.devicePos);
this.open2 = true;
this.title2 = "燃气事故台账详情";
// this.reset2();
// getTrouble(row.troubleId).then(response => {
// this.detailForm = response.data;
// this.detailForm.troubleReason = this.statusFormat2(this.detailForm,0);
// this.devicePos = [this.detailForm.longitude, this.detailForm.latitude];
// console.log("this.devicePos",this.devicePos);
// this.open2 = true;
// this.title2 = "燃气事故台账详情";
this.$nextTick(() => {
this.map = new EditorMap("troubleContainer", {}, this);
this.map.addDevice({ path: this.devicePos });
this.map.nowMouseTarget = null;
this.map.mousetoolClose(false);
});
});
// this.$nextTick(() => {
// this.map = new EditorMap("troubleContainer", {}, this);
// this.map.addDevice({ path: this.devicePos });
// this.map.nowMouseTarget = null;
// this.map.mousetoolClose(false);
// });
// });
this.$refs.detail.getDetailInfo(row.troubleId);
},
MapdialogFun() {
this.dialogTableVisible = true;
......@@ -698,3 +746,11 @@ export default {
}
};
</script>
<style>
/* 自定义输入框样式 */
.left-aligned-input .el-input__inner{
text-align: left;
padding-left: 5px; /* 根据需要调整内边距 */
}
</style>
\ No newline at end of file
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