Commit b2291088 authored by wanghao's avatar wanghao

台账管理-燃气事故台账,隐患整治台账,农村双代台账 三个模块调整如下

1 逻辑调整,企业和政府都可以录入,政府查看企业数据
2 导出 加上企业信息和部分字段显示调整和优化
3 从新写详情界面替换到之前 disabled去控制显示隐藏的详情界面。
parent d25ede17
......@@ -50,7 +50,7 @@ public class TDoubleBookController extends BaseController
@GetMapping("/export")
public AjaxResult export(TDoubleBook tDoubleBook)
{
List<TDoubleBook> list = tDoubleBookService.selectTDoubleBookList(tDoubleBook);
List<TDoubleBook> list = tDoubleBookService.exportTDoubleBookList(tDoubleBook);
ExcelUtil<TDoubleBook> util = new ExcelUtil<TDoubleBook>(TDoubleBook.class);
return util.exportExcel(list, "双代台账数据");
}
......
......@@ -21,8 +21,10 @@ public class TDoubleBook extends BaseEntity
private Long bookId;
/** 所属企业id */
@Excel(name = "所属企业id")
private Long beyondEnterpriseId;
private String beyondEnterpriseId;
@Excel(name = "所属企业")
private String beyondEnterpriseName;
/** 户主姓名 */
@Excel(name = "户主姓名")
......@@ -33,7 +35,7 @@ public class TDoubleBook extends BaseEntity
private String phone;
/** 改造类型 */
@Excel(name = "改造类型")
@Excel(name = "改造类型",dictType = "t_double_type")
private String type;
/** 完成时间 */
......@@ -43,15 +45,17 @@ public class TDoubleBook extends BaseEntity
/** 用气量 */
@Excel(name = "用气量")
private String dosage;
private float dosage;
/** 0正常 1停用 */
@Excel(name = "0正常 1停用")
@Excel(name = "状态",readConverterExp = "0=正常,1=停用")
private Integer status;
/** 所属区域 */
private Long township;
@Excel(name = "所属区域")
private String township;
private String townshipName;
/** 房屋位置 */
@Excel(name = "房屋位置")
......@@ -64,8 +68,6 @@ public class TDoubleBook extends BaseEntity
/** 0未删除 1已删除 */
private Integer isDel;
private String beyondEnterpriseName;
public String getBeyondEnterpriseName() {
return beyondEnterpriseName;
}
......@@ -83,12 +85,12 @@ public class TDoubleBook extends BaseEntity
{
return bookId;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId)
public void setBeyondEnterpriseId(String beyondEnterpriseId)
{
this.beyondEnterpriseId = beyondEnterpriseId;
}
public Long getBeyondEnterpriseId()
public String getBeyondEnterpriseId()
{
return beyondEnterpriseId;
}
......@@ -128,12 +130,12 @@ public class TDoubleBook extends BaseEntity
{
return finishTime;
}
public void setDosage(String dosage)
public void setDosage(float dosage)
{
this.dosage = dosage;
}
public String getDosage()
public float getDosage()
{
return dosage;
}
......@@ -146,12 +148,12 @@ public class TDoubleBook extends BaseEntity
{
return status;
}
public void setTownship(String township)
public void setTownship(Long township)
{
this.township = township;
}
public String getTownship()
public Long getTownship()
{
return township;
}
......@@ -183,6 +185,14 @@ public class TDoubleBook extends BaseEntity
return isDel;
}
public String getTownshipName() {
return townshipName;
}
public void setTownshipName(String townshipName) {
this.townshipName = townshipName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -39,8 +39,8 @@ public class THiddenDangerStandingBook extends BaseEntity
/** 纬度 */
private BigDecimal latitude;
/** 隐患类型 */
@Excel(name = "隐患类型")
/** 隐患等级 */
@Excel(name = "隐患等级",dictType = "t_hidden_type")
private String hiddenType;
/** 隐患发现人员 */
......@@ -60,11 +60,11 @@ public class THiddenDangerStandingBook extends BaseEntity
private String dealPlanUrl;
/** 整治情况 */
@Excel(name = "整治情况")
@Excel(name = "整治情况",readConverterExp = "1=已完成,2=未完成")
private String remediation;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
@Excel(name = "是否删除",readConverterExp = "0=否,1=是")
private String isDel;
/** 备注 */
......@@ -75,9 +75,14 @@ public class THiddenDangerStandingBook extends BaseEntity
/** 权属单位 */
private String beyondEnterpriseId;
/** 权属单位 */
@Excel(name = "权属单位")
private String enterpriseName;
private String source;
private String township;
private Long township;
private int hiddenTroubleLevel;
......@@ -91,11 +96,11 @@ public class THiddenDangerStandingBook extends BaseEntity
this.source = source;
}
public String getTownship() {
public Long getTownship() {
return township;
}
public void setTownship(String township) {
public void setTownship(Long township) {
this.township = township;
}
......@@ -253,6 +258,14 @@ public class THiddenDangerStandingBook extends BaseEntity
this.hiddenTroubleType = hiddenTroubleType;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -27,6 +27,14 @@ public interface TDoubleBookMapper
*/
public List<TDoubleBook> selectTDoubleBookList(TDoubleBook tDoubleBook);
/**
* 查询双代台账列表
*
* @param tDoubleBook 双代台账
* @return 双代台账集合
*/
public List<TDoubleBook> exportTDoubleBookList(TDoubleBook tDoubleBook);
/**
* 新增双代台账
*
......
......@@ -27,6 +27,14 @@ public interface ITDoubleBookService
*/
public List<TDoubleBook> selectTDoubleBookList(TDoubleBook tDoubleBook);
/**
* 导出双代台账列表
*
* @param tDoubleBook 双代台账
* @return 双代台账集合
*/
public List<TDoubleBook> exportTDoubleBookList(TDoubleBook tDoubleBook);
/**
* 新增双代台账
*
......
package com.zehong.system.service.impl;
import java.util.List;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDoubleBookMapper;
......@@ -41,9 +45,27 @@ public class TDoubleBookServiceImpl implements ITDoubleBookService
@Override
public List<TDoubleBook> selectTDoubleBookList(TDoubleBook tDoubleBook)
{
// 20240726 调整 政府和企业都可以录,企业看自己,政府看所有
if (isEnterprise() && tDoubleBook != null) {
tDoubleBook.setBeyondEnterpriseId(SecurityUtils.getLoginUser().getUser().getDeptId());
}
return tDoubleBookMapper.selectTDoubleBookList(tDoubleBook);
}
/**
* 导出
* @param tDoubleBook 双代台账
* @return r
*/
@Override
public List<TDoubleBook> exportTDoubleBookList(TDoubleBook tDoubleBook) {
// 20240726 调整 政府和企业都可以录,企业看自己,政府看所有
if (isEnterprise() && tDoubleBook != null) {
tDoubleBook.setBeyondEnterpriseId(SecurityUtils.getLoginUser().getUser().getDeptId());
}
return tDoubleBookMapper.exportTDoubleBookList(tDoubleBook);
}
/**
* 新增双代台账
*
......@@ -92,4 +114,15 @@ public class TDoubleBookServiceImpl implements ITDoubleBookService
{
return tDoubleBookMapper.deleteTDoubleBookById(bookId);
}
/**
* 判断是否为企业
* @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");
}
}
......@@ -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.THiddenDangerStandingBookForm;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
......@@ -46,6 +49,10 @@ public class THiddenDangerStandingBookServiceImpl implements ITHiddenDangerStand
@Override
public List<THiddenDangerStandingBook> selectTHiddenDangerStandingBookList(THiddenDangerStandingBookForm tHiddenDangerStandingBook)
{
// 20240726 调整 政府和企业都可以录,企业看自己,政府看所有
if (isEnterprise() && tHiddenDangerStandingBook != null) {
tHiddenDangerStandingBook.setBeyondEnterpriseId(SecurityUtils.getLoginUser().getUser().getDeptId());
}
return tHiddenDangerStandingBookMapper.selectTHiddenDangerStandingBookList(tHiddenDangerStandingBook);
}
......@@ -161,5 +168,14 @@ public class THiddenDangerStandingBookServiceImpl implements ITHiddenDangerStand
return tHiddenDangerStandingBookMapper.hiddenBookStatistics();
}
/**
* 判断是否为企业
* @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");
}
}
......@@ -18,6 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="housesInfo" column="houses_info" />
<result property="createTime" column="create_time" />
<result property="isDel" column="is_del" />
<!-- 导出使用-->
<result property="townshipName" column="townshipName" />
</resultMap>
<sql id="selectTDoubleBookVo">
......@@ -28,6 +30,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN t_enterprise_info e ON b.`beyond_enterprise_id` = e.`enterprise_id`
</sql>
<sql id="exportTDoubleBookVo">
SELECT b.book_id, b.beyond_enterprise_id, b.username, b.phone, b.type, b.finish_time,
b.dosage, b.status, r.f_name as townshipName, b.houses_address, b.houses_info, b.create_time, b.is_del ,
e.`enterprise_name` AS beyondEnterpriseName
FROM t_double_book b
LEFT JOIN t_enterprise_info e ON b.`beyond_enterprise_id` = e.`enterprise_id`
LEFT JOIN t_county_level_region r ON b.`township` = r.`f_id`
</sql>
<select id="selectTDoubleBookList" parameterType="TDoubleBook" resultMap="TDoubleBookResult">
<include refid="selectTDoubleBookVo"/>
<where>
......@@ -36,8 +47,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null and phone != ''"> and b.phone like concat('%', #{phone}, '%')</if>
<if test="type != null and type != ''"> and b.type = #{type}</if>
</where>
order by b.create_time desc
</select>
<select id="exportTDoubleBookList" parameterType="TDoubleBook" resultMap="TDoubleBookResult">
<include refid="exportTDoubleBookVo"/>
<where>
<if test="beyondEnterpriseId != null "> and b.beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="username != null and username != ''"> and b.username like concat('%', #{username}, '%')</if>
<if test="phone != null and phone != ''"> and b.phone like concat('%', #{phone}, '%')</if>
<if test="type != null and type != ''"> and b.type = #{type}</if>
</where>
order by b.create_time desc
</select>
<select id="selectTDoubleBookById" parameterType="Long" resultMap="TDoubleBookResult">
<include refid="selectTDoubleBookVo"/>
where book_id = #{bookId}
......
......@@ -25,23 +25,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remarks" column="remarks" />
<result property="beyondEnterpriseId" column="beyondEnterprise_id" />
<result property="hiddenTroubleType" column="hidden_trouble_type" />
<!-- 导出使用-->
<result property="enterpriseName" column="enterpriseName" />
</resultMap>
<sql id="selectTHiddenDangerStandingBookVo">
select hidden_id, hidden_title, hidden_content, hidden_location, longitude, latitude, hidden_type, hidden_find_people, hidden_find_date, deal_plan, deal_plan_url, remediation, create_by, create_time, update_by, update_time, is_del,beyondEnterprise_id, remarks,township,source,hidden_trouble_type from t_hidden_danger_standing_book
select book.hidden_id, book.hidden_title, book.hidden_content, book.hidden_location, book.longitude,
book.latitude, book.hidden_type,book.hidden_find_people, book.hidden_find_date, book.deal_plan,
book.deal_plan_url, book.remediation, book.create_by, book.create_time,book.update_by, book.update_time,
book.is_del,book.beyondEnterprise_id, book.remarks,book.township,book.source,book.hidden_trouble_type,
info.enterprise_name as enterpriseName
from t_hidden_danger_standing_book book left join t_enterprise_info info on book.beyondEnterprise_id = info.enterprise_id
</sql>
<select id="selectTHiddenDangerStandingBookList" parameterType="THiddenDangerStandingBookForm" resultMap="THiddenDangerStandingBookResult">
<include refid="selectTHiddenDangerStandingBookVo"/>
<where> is_del = '0'
<if test="hiddenTitle != null and hiddenTitle != ''"> and hidden_title like concat('%', #{hiddenTitle}, '%')</if>
<if test="hiddenType != null and hiddenType != ''"> and hidden_type = #{hiddenType}</if>
<if test="remediation != null and remediation != ''"> and remediation = #{remediation}</if>
<if test="hiddenFindDateStart != null "> and hidden_find_date &gt;= #{hiddenFindDateStart}</if>
<if test="hiddenFindDateEnd != null "> and hidden_find_date &lt;= #{hiddenFindDateEnd}</if>
<if test="beyondEnterpriseId != null "> and beyondEnterprise_id = #{beyondEnterpriseId}</if>
<where> book.is_del = '0'
<if test="hiddenTitle != null and hiddenTitle != ''"> and book.hidden_title like concat('%', #{hiddenTitle}, '%')</if>
<if test="hiddenType != null and hiddenType != ''"> and book.hidden_type = #{hiddenType}</if>
<if test="remediation != null and remediation != ''"> and book.remediation = #{remediation}</if>
<if test="hiddenFindDateStart != null "> and book.hidden_find_date &gt;= #{hiddenFindDateStart}</if>
<if test="hiddenFindDateEnd != null "> and book.hidden_find_date &lt;= #{hiddenFindDateEnd}</if>
<if test="beyondEnterpriseId != null "> and book.beyondEnterprise_id = #{beyondEnterpriseId}</if>
</where>
order by create_time desc
order by book.create_time desc
</select>
<select id="selectTHiddenDangerStandingBookStatistic" resultType="THiddenDangerStandingBookVo">
......
<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="10">
<el-form-item label="隐患名称:" >
<span v-if="detailInfo.hiddenTitle">{{ detailInfo.hiddenTitle }}</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="隐患发现人员:">
<span v-if="detailInfo.hiddenFindPeople">{{ detailInfo.hiddenFindPeople }}</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="发现时间:" >
<span v-if="detailInfo.hiddenFindDate">{{ detailInfo.hiddenFindDate }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item label="隐患等级:" >
<span v-if="detailInfo.hiddenType == '1'">一级隐患</span>
<span v-else-if="detailInfo.hiddenType == '2'">二级隐患</span>
<span v-else-if="detailInfo.hiddenType == '3'">三级隐患</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="隐患位置:" >
<span v-if="detailInfo.hiddenLocation">{{ detailInfo.hiddenLocation }}</span>
<span v-else>-</span>
</el-form-item>
<el-form-item label="整治情况:" >
<span v-if="detailInfo.remediation == '1'">已完成</span>
<span v-else-if="detailInfo.remediation == '2'">未完成</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="处理方案:" >
<span class="dbtn" @click="checkFile(detailInfo.dealPlanUrl)" v-if="detailInfo.dealPlan != ''">
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else><el-input disabled/></span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隐患类型:" >
<span v-if="detailInfo.hiddenTroubleType == 1">漏气</span>
<span v-else-if="detailInfo.hiddenTroubleType == 2">腐蚀</span>
<span v-else-if="detailInfo.hiddenTroubleType == 3">裂缝</span>
<span v-else-if="detailInfo.hiddenTroubleType == 4">设备故障</span>
<span v-else-if="detailInfo.hiddenTroubleType == 5">安全距离不足</span>
<span v-else-if="detailInfo.hiddenTroubleType == 6">管道承重</span>
<span v-else-if="detailInfo.hiddenTroubleType == 7">其他</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-row>
<el-col :span="23">
<el-form-item label="隐患内容:" >
<span v-if="detailInfo.hiddenContent">{{ detailInfo.hiddenContent }}</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-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="hiddenContainer"></div>
</div>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { EditorMap } from "@/utils/mapClass/getPath.js";
import { getHidden } from "@/api/standingBook/hidden";
import { enterpriseLists } from "@/api/regulation/info";
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:{
checkFile(url) {
window.open(url,'_blank');
},
//所属单位
getEnterpriseLists(){
const param = {};
// this.judgeOperateType(param);
enterpriseLists(param).then(response => {
this.enterprises = response.rows;
// 如果是企业,则直接把查询条件的的所在单位赋值
if (this.$store.state.user.roleId == 5) {
this.queryParams.beyondEnterpriseId = this.enterprises[0].enterpriseId
}
});
},
getDetailInfo(id){
getHidden(id).then(response => {
this.detailInfo = response.data;
this.getEnterpriseLists();
this.devicePos = [this.detailInfo.longitude, this.detailInfo.latitude];
this.detailOpen = true;
this.$nextTick(() => {
this.map = new EditorMap("hiddenContainer", {}, this);
this.map.addDevice({ path: this.devicePos });
this.map.nowMouseTarget = null;
this.map.mousetoolClose(false);
});
});
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryParams" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="隐患类型" prop="hiddenType">
<el-form-item label="隐患等级" prop="hiddenType">
<el-select v-model="queryParams.hiddenType" placeholder="请选择隐患类型" clearable size="small">
<el-option
v-for="dict in typeOptions"
......@@ -103,7 +103,7 @@
<span
class="dbtn"
@click="checkFile(scope.row.dealPlanUrl)"
v-if="scope.row.dealPlanUrl != null"
v-if="scope.row.dealPlanUrl != null && scope.row.dealPlanUrl != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
......@@ -182,11 +182,11 @@
<el-form-item label="所属乡镇" prop="township">
<el-select v-model="form.township" placeholder="请选择所属乡镇" clearable size="small">
<el-option
v-for="dict in townshipOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
v-for="county in townshipOptions"
:key="county.fId"
:label="county.fName.trim()"
:value="county.fId"
/>
</el-select>
</el-form-item>
</el-col>
......@@ -293,7 +293,7 @@
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="parseInt(item.enterpriseId)"
:value="item.enterpriseId"
></el-option>
</el-select>
</el-form-item>
......@@ -407,6 +407,8 @@
@getPath="getPath"
/>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
......@@ -414,15 +416,17 @@
import { listHidden, getHidden, delHidden, addHidden, updateHidden, exportHidden } from "@/api/standingBook/hidden";
import FileUpload from '@/components/FileUpload';
import GetPos from '@/components/GetPos';
import { EditorMap } from "@/utils/mapClass/getPath.js";
import { enterpriseLists } from "@/api/regulation/info";
import { getDefaultCountyList } from "@/api/area/county";
import DetailInfo from "./DetailInfo";
let uploadfile = require("@/assets/uploadfile.png");
export default {
name: "Hidden",
components: {
FileUpload,
GetPos
GetPos,
DetailInfo
},
data() {
return {
......@@ -516,9 +520,10 @@ export default {
this.getDicts("t_remediation").then(response => {
this.remediationOptions = response.data;
});
this.getDicts("t_township").then(response => {
this.townshipOptions = response.data;
});
// this.getDicts("t_township").then(response => {
// this.townshipOptions = response.data;
// });
this.getCountyInfo();
this.getDicts("t_source").then(response => {
this.sourceOptions = response.data;
});
......@@ -529,6 +534,18 @@ export default {
},
methods: {
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.townshipOptions = res.data;
}
})
},
beyondCountyFormat(row){
let info = this.countyInfo.find(item => item.fId == row.township);
return info?info.fName:"-";
},
/** 查询隐患整治台账列表 */
getList() {
this.loading = true;
......@@ -562,6 +579,7 @@ export default {
hiddenFindPeople: null,
hiddenFindDate: null,
dealPlan: null,
dealPlanUrl: null,
remediation: null,
createBy: null,
createTime: null,
......@@ -603,6 +621,10 @@ export default {
// this.judgeOperateType(param);
enterpriseLists(param).then(response => {
this.enterprises = response.rows;
// 如果是企业,则直接把查询条件的的所在单位赋值
if (this.$store.state.user.roleId == 5) {
this.queryParams.beyondEnterpriseId = this.enterprises[0].enterpriseId
}
});
},
/** 搜索按钮操作 */
......@@ -703,21 +725,22 @@ export default {
},
/** 详细信息跳转 */
showDetail(row) {
this.reset2();
getHidden(row.hiddenId).then(response => {
this.detailForm = response.data;
this.getEnterpriseLists();
this.devicePos = [this.detailForm.longitude, this.detailForm.latitude];
this.open2 = true;
this.title2 = "隐患整治台账详情";
// this.reset2();
// getHidden(row.hiddenId).then(response => {
// this.detailForm = response.data;
// this.getEnterpriseLists();
// this.devicePos = [this.detailForm.longitude, this.detailForm.latitude];
// this.open2 = true;
// this.title2 = "隐患整治台账详情";
this.$nextTick(() => {
this.map = new EditorMap("hiddenContainer", {}, this);
this.map.addDevice({ path: this.devicePos });
this.map.nowMouseTarget = null;
this.map.mousetoolClose(false);
});
});
// this.$nextTick(() => {
// this.map = new EditorMap("hiddenContainer", {}, this);
// this.map.addDevice({ path: this.devicePos });
// this.map.nowMouseTarget = null;
// this.map.mousetoolClose(false);
// });
// });
this.$refs.detail.getDetailInfo(row.hiddenId);
},
checkFile(url) {
window.open(url,'_blank');
......@@ -732,6 +755,7 @@ export default {
},
listRemove(e) {
this.form.dealPlan = "";
this.form.dealPlanUrl = "";
this.fileList = [];
},
MapdialogFun() {
......
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="170px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="所属企业" >
<span v-if="detailInfo.beyondEnterpriseName">{{ detailInfo.beyondEnterpriseName }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="户主姓名">
<span v-if="detailInfo.username">{{ detailInfo.username }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="户主电话" >
<span v-if="detailInfo.phone">{{ detailInfo.phone }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="改造类型" >
<span v-if="detailInfo.type">{{ $parent.typeFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用气量" >
<span v-if="detailInfo.dosage">{{ detailInfo.dosage }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="完成时间" >
<span v-if="detailInfo.finishTime">{{ detailInfo.finishTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属区域" >
<span v-if="detailInfo.township">{{ $parent.townshipFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" >
<span v-if="detailInfo.status == 0">正常</span>
<span v-else-if="detailInfo.status == 1">停用</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="房屋位置" >
<span v-if="detailInfo.housesAddress">{{ detailInfo.housesAddress }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="房屋信息" >
<span v-if="detailInfo.housesInfo">{{ detailInfo.housesInfo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import { getBook } from "@/api/system/book";
export default {
name: "detail-info",
data(){
return{
enterprises: [],
countyInfo: [],
detailInfo: {},
enterpriseName:"",
detailOpen: false,
fUploadTimeLable: "",
fUploadTypeLable: "",
fUploadType: "",
fUploadTime: null
}
},
created() {
this.getCountyInfo();
this.getEnterpriseLists();
},
methods:{
getDetailInfo(id){
getBook(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
// this.detailInfo.fRegion = this.beyondCountyFormat(this.detailInfo);
// let fEnterpriseId = this.detailInfo.fEnterpriseId;
// if (fEnterpriseId != null) {
// this.enterpriseName= this.beyondCompanyFormat(this.detailInfo);
// }
this.detailOpen = true;
}
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属企业" prop="beyondEnterpriseId">
<el-select v-model="queryParams.beyondEnterpriseId" placeholder="请在下拉框中选择名称" maxlength="255" :disabled="false" clearable style="width: 100%;">
<el-select v-model="queryParams.beyondEnterpriseId" placeholder="请在下拉框中选择名称" maxlength="255" :disabled="5 == $store.state.user.roleId" clearable style="width: 100%;">
<el-option v-for="item in test" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId">
</el-option>
</el-select>
......@@ -93,11 +93,11 @@
<el-table-column label="完成时间" align="center" prop="finishTime" width="180">
</el-table-column>
<el-table-column label="用气量" align="center" prop="dosage" />
<el-table-column label="使用状态" align="center" prop="status" />
<el-table-column label="使用状态" align="center" prop="status" :formatter="statusFormat"/>
<el-table-column label="所属区域" align="center" prop="township" :formatter="townshipFormat" />
<el-table-column label="房屋位置" align="center" prop="housesAddress" />
<el-table-column label="房屋信息" align="center" prop="housesInfo" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" width="180px">
<template slot-scope="scope">
<el-button
size="mini"
......@@ -105,6 +105,14 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="showDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
......@@ -162,7 +170,7 @@
<el-col span="12">
<el-form-item label="用气量" prop="dosage">
<el-input v-model="form.dosage" placeholder="请输入用气量" />
<el-input type="Number" v-model="form.dosage" placeholder="请输入用气量" />
</el-form-item>
</el-col>
<el-col span="12">
......@@ -181,10 +189,10 @@
<el-form-item label="所属区域" prop="township">
<el-select v-model="form.township" placeholder="请选择所属区域">
<el-option
v-for="dict in townshipOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="county in townshipOptions"
:key="county.fId"
:label="county.fName.trim()"
:value="county.fId"
></el-option>
</el-select>
</el-form-item>
......@@ -213,16 +221,22 @@
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
<script>
import { listBook, getBook, delBook, addBook, updateBook, exportBook } from "@/api/system/book";
import { selectTEnterprise} from "@/api/regulation/supervise";
import { getDefaultCountyList } from "@/api/area/county";
import DetailInfo from "./DetailInfo";
export default {
name: "Book",
components: {
DetailInfo
},
data() {
return {
......@@ -274,7 +288,8 @@ export default {
{ required: true, message: "户主姓名不能为空", trigger: "blur" }
],
phone: [
{ required: true, message: "户主电话不能为空", trigger: "blur" }
{ required: true, message: "户主电话不能为空", trigger: "blur" },
{ min: 11, max: 11, message: "长度11位", trigger: "blur" },
],
type: [
{ required: true, message: "改造类型不能为空", trigger: "change" }
......@@ -294,14 +309,32 @@ export default {
this.getDicts("t_double_type").then(response => {
this.typeOptions = response.data;
});
this.getDicts("t_township").then(response => {
this.townshipOptions = response.data;
});
// this.getDicts("t_township").then(response => {
// this.townshipOptions = response.data;
// });
this.getCountyInfo();
},
methods: {
/** 详细信息跳转 */
showDetail(row) {
this.$refs.detail.getDetailInfo(row.bookId);
},
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.townshipOptions = res.data;
}
})
},
getEnterp(){
selectTEnterprise().then(response => {
this.test = response.data;
// 如果是企业,则直接把查询条件的的所在单位赋值
if (this.$store.state.user.roleId == 5) {
this.queryParams.beyondEnterpriseId = this.test[0].enterpriseId
}
});
},
/** 查询双代台账列表 */
......@@ -319,7 +352,14 @@ export default {
},
// 所属区域字典翻译
townshipFormat(row, column) {
return this.selectDictLabel(this.townshipOptions, row.township);
let info = this.townshipOptions.find(item => item.fId == row.township);
return info?info.fName:"-";
},
statusFormat(row,column){
if (row.status == 1) {
return "停用"
}
return "正常"
},
// 取消按钮
cancel() {
......@@ -366,6 +406,10 @@ export default {
this.reset();
this.open = true;
this.title = "添加双代台账";
// 如果是企业,则直接把查询条件的的所在单位赋值
if (this.$store.state.user.roleId == 5) {
this.form.beyondEnterpriseId = this.test[0].enterpriseId
}
},
/** 修改按钮操作 */
handleUpdate(row) {
......
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