Commit 16e35194 authored by 王晓倩's avatar 王晓倩

台账管理页面调整,隐患台账文件上传

parent 164b681a
...@@ -74,8 +74,8 @@ public class CommonController ...@@ -74,8 +74,8 @@ public class CommonController
// 上传文件路径 // 上传文件路径
String filePath = GassafetyProgressConfig.getUploadPath(); String filePath = GassafetyProgressConfig.getUploadPath();
// 上传并返回新文件名称 // 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file); String fileName = file.getOriginalFilename();
String url = serverConfig.getUrl() + fileName; String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file);
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName); ajax.put("fileName", fileName);
ajax.put("url", url); ajax.put("url", url);
......
...@@ -56,6 +56,9 @@ public class THiddenDangerStandingBook extends BaseEntity ...@@ -56,6 +56,9 @@ public class THiddenDangerStandingBook extends BaseEntity
@Excel(name = "处理方案") @Excel(name = "处理方案")
private String dealPlan; private String dealPlan;
/** 方案路径 */
private String dealPlanUrl;
/** 整治情况 */ /** 整治情况 */
@Excel(name = "整治情况") @Excel(name = "整治情况")
private String remediation; private String remediation;
...@@ -157,7 +160,16 @@ public class THiddenDangerStandingBook extends BaseEntity ...@@ -157,7 +160,16 @@ public class THiddenDangerStandingBook extends BaseEntity
{ {
return dealPlan; return dealPlan;
} }
public void setRemediation(String remediation)
public String getDealPlanUrl() {
return dealPlanUrl;
}
public void setDealPlanUrl(String dealPlanUrl) {
this.dealPlanUrl = dealPlanUrl;
}
public void setRemediation(String remediation)
{ {
this.remediation = remediation; this.remediation = remediation;
} }
......
...@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="hiddenFindPeople" column="hidden_find_people" /> <result property="hiddenFindPeople" column="hidden_find_people" />
<result property="hiddenFindDate" column="hidden_find_date" /> <result property="hiddenFindDate" column="hidden_find_date" />
<result property="dealPlan" column="deal_plan" /> <result property="dealPlan" column="deal_plan" />
<result property="dealPlanUrl" column="deal_plan_url" />
<result property="remediation" column="remediation" /> <result property="remediation" column="remediation" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
...@@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTHiddenDangerStandingBookVo"> <sql id="selectTHiddenDangerStandingBookVo">
select hidden_id, hidden_title, hidden_content, hidden_location, longitude, latitude, hidden_type, hidden_find_people, hidden_find_date, deal_plan, remediation, create_by, create_time, update_by, update_time, is_del, remarks from t_hidden_danger_standing_book 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, remarks from t_hidden_danger_standing_book
</sql> </sql>
<select id="selectTHiddenDangerStandingBookList" parameterType="THiddenDangerStandingBookForm" resultMap="THiddenDangerStandingBookResult"> <select id="selectTHiddenDangerStandingBookList" parameterType="THiddenDangerStandingBookForm" resultMap="THiddenDangerStandingBookResult">
...@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenFindPeople != null">hidden_find_people,</if> <if test="hiddenFindPeople != null">hidden_find_people,</if>
<if test="hiddenFindDate != null">hidden_find_date,</if> <if test="hiddenFindDate != null">hidden_find_date,</if>
<if test="dealPlan != null">deal_plan,</if> <if test="dealPlan != null">deal_plan,</if>
<if test="dealPlanUrl != null">deal_plan_url,</if>
<if test="remediation != null">remediation,</if> <if test="remediation != null">remediation,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
...@@ -73,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -73,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenFindPeople != null">#{hiddenFindPeople},</if> <if test="hiddenFindPeople != null">#{hiddenFindPeople},</if>
<if test="hiddenFindDate != null">#{hiddenFindDate},</if> <if test="hiddenFindDate != null">#{hiddenFindDate},</if>
<if test="dealPlan != null">#{dealPlan},</if> <if test="dealPlan != null">#{dealPlan},</if>
<if test="dealPlanUrl != null">#{dealPlanUrl},</if>
<if test="remediation != null">#{remediation},</if> <if test="remediation != null">#{remediation},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
...@@ -95,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -95,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenFindPeople != null">hidden_find_people = #{hiddenFindPeople},</if> <if test="hiddenFindPeople != null">hidden_find_people = #{hiddenFindPeople},</if>
<if test="hiddenFindDate != null">hidden_find_date = #{hiddenFindDate},</if> <if test="hiddenFindDate != null">hidden_find_date = #{hiddenFindDate},</if>
<if test="dealPlan != null">deal_plan = #{dealPlan},</if> <if test="dealPlan != null">deal_plan = #{dealPlan},</if>
<if test="dealPlanUrl != null">deal_plan_url = #{dealPlanUrl},</if>
<if test="remediation != null">remediation = #{remediation},</if> <if test="remediation != null">remediation = #{remediation},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
......
...@@ -3,29 +3,55 @@ ...@@ -3,29 +3,55 @@
<el-upload <el-upload
:action="uploadFileUrl" :action="uploadFileUrl"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
:file-list="fileList" :file-list="fileArr"
:limit="1" :limit="1"
:list-type="listType"
:on-error="handleUploadError" :on-error="handleUploadError"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:on-success="handleUploadSuccess" :on-success="handleUploadSuccess"
:show-file-list="false" :on-remove="handleRemove"
:on-preview="handleFileClick"
:on-change="fileChange"
:show-file-list="true"
:headers="headers" :headers="headers"
class="upload-file-uploader" class="upload-file-uploader"
:class="{ hide: fileArr.length>0 ||addShow }"
ref="upload" ref="upload"
> >
<!-- 上传按钮 --> <!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button> <el-button plain type="primary">选取文件</el-button>
<!--<i class="el-icon-plus"></i>-->
<!-- 上传提示 --> <!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip"> <div class="el-upload__tip" slot="tip" v-if="showTip">
请上传 请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template> <template v-if="fileSize">
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
的文件 </template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件,且不超过一个
</div> </div>
</el-upload> </el-upload>
<el-image v-show="false"
id="img"
ref="previewImg"
:src="dialogImageUrl"
:preview-src-list="bigImageArr"
:z-index="9999999"
></el-image>
<!-- <el-dialog
:center="true"
width="50%"
:modal="modal"
:visible.sync="dialogVisible"
>
<img :src="dialogImageUrl" alt="" />
</el-dialog> -->
<!-- 文件列表 --> <!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> <!-- <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list"> <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list">
<el-link :href="file.url" :underline="false" target="_blank"> <el-link :href="file.url" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span> <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
...@@ -34,146 +60,203 @@ ...@@ -34,146 +60,203 @@
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link> <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div> </div>
</li> </li>
</transition-group> </transition-group> -->
</div> </div>
</template> </template>
<script> <script>
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
props: { props: {
// 值 // 值
value: [String, Object, Array], value: [String, Object, Array],
// 大小限制(MB) listType: {
fileSize: { type: String,
type: Number, defaule: "text",
default: 5, },
// 大小限制(MB)
fileSize: {
type: Number,
default: 5,
},
fileArr: {
type: Array,
default: [],
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["doc", "xls", "ppt", "txt", "pdf"],
},
// 是否显示提示
isShowTip: {
type: Boolean,
default: true,
},
}, },
// 文件类型, 例如['png', 'jpg', 'jpeg'] data() {
fileType: { return {
type: Array, uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
default: () => ["doc", "xls", "ppt", "txt", "pdf"], headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
modal: false,
dialogVisible: false,
dialogImageUrl: "",
addShow: true,
};
}, },
// 是否显示提示 computed: {
isShowTip: { // 是否显示提示
type: Boolean, showTip() {
default: true return this.isShowTip && (this.fileType || this.fileSize);
} },
}, // 列表
data() { list() {
return { let temp = 1;
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 if (this.value) {
headers: { // 首先将值转为数组
Authorization: "Bearer " + getToken(), const list = Array.isArray(this.value) ? this.value : [this.value];
}, // 然后将数组转为对象数组
fileList: [], return list.map((item) => {
}; if (typeof item === "string") {
}, item = { name: item, url: item };
computed: { }
// 是否显示提示 item.uid = item.uid || new Date().getTime() + temp++;
showTip() { return item;
return this.isShowTip && (this.fileType || this.fileSize); });
} else {
this.fileList = [];
return [];
}
},
bigImageArr() {
return [this.dialogImageUrl]
},
}, },
// 列表 methods: {
list() { // 上传前校检格式和大小
let temp = 1; handleBeforeUpload(file) {
if (this.value) { // 校检文件类型
// 首先将值转为数组 if (this.fileType) {
const list = Array.isArray(this.value) ? this.value : [this.value]; let fileExtension = "";
// 然后将数组转为对象数组 if (file.name.lastIndexOf(".") > -1) {
return list.map((item) => { fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
if (typeof item === "string") { }
item = { name: item, url: item }; const isTypeOk = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
if (!isTypeOk) {
this.$message.error(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false;
} }
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
this.fileList = [];
return [];
}
},
},
methods: {
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件类型
if (this.fileType) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
} }
const isTypeOk = this.fileType.some((type) => { // 校检文件大小
if (file.type.indexOf(type) > -1) return true; if (this.fileSize) {
if (fileExtension && fileExtension.indexOf(type) > -1) return true; const isLt = file.size / 1024 / 1024 < this.fileSize;
return false; if (!isLt) {
}); this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
if (!isTypeOk) { return false;
this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`); }
return false;
} }
} return true;
// 校检文件大小 },
if (this.fileSize) { // 文件个数超出
const isLt = file.size / 1024 / 1024 < this.fileSize; handleExceed() {
if (!isLt) { this.$message.error(`只允许上传单个文件`);
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`); },
return false; // 上传失败
handleUploadError(err) {
this.$message.error("上传失败, 请重试");
},
// 上传成功回调
handleUploadSuccess(res, file) {
this.$message.success("上传成功");
this.$emit("resFun", res);
},
// 文件列表移除文件
handleRemove(file, fileList) {
console.log("列表移除", file, fileList);
this.addShow = fileList.length > 0 ? true : false;
this.$emit("remove", file);
},
// 删除文件
handleDelete(index) {
this.fileList.splice(index, 1);
this.$emit("input", "");
// let that = this,
// param;
// param = file.response ? file.response.fileName.replace(/\\/g, "%")
// : file.response.url.replace(/\\/g, "%").slice(9);
// $.ajax({
// type: "GET",
// url: process.env.VUE_APP_BASE_API + "/common/deleteFile",
// data: {savePath: param},
// dataType: "json",
// success: function(data){
// if (data) that.$message.success("删除成功");
// else return false;
// }
// });
},
handleFileClick(file, fileList) {
this.dialogImageUrl = file.response ? file.response.url : file.url;
// this.dialogImageUrl =if(this.fileArr) this.fileArr[0].url;
// this.dialogVisible = true;
this.$refs.previewImg.showViewer = false;
console.log(file);
// console.log(file.response.url)
},
// 获取文件名称
getFileName(name) {
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
} else {
return "";
} }
} },
return true; // 当改变列表改变时
}, fileChange(file, fileList) {
// 文件个数超出 this.addShow = fileList.length > 0 ? true : false;
handleExceed() { },
this.$message.error(`只允许上传单个文件`);
},
// 上传失败
handleUploadError(err) {
this.$message.error("上传失败, 请重试");
},
// 上传成功回调
handleUploadSuccess(res, file) {
this.$message.success("上传成功");
this.$emit("input", res.url);
}, },
// 删除文件 created() {
handleDelete(index) { // this.fileList = this.list;
this.fileList.splice(index, 1); this.addShow = this.fileArr.length > 0 ? true : false;
this.$emit("input", '');
}, },
// 获取文件名称
getFileName(name) {
if (name.lastIndexOf("/") > -1) { };
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
} else {
return "";
}
}
},
created() {
this.fileList = this.list;
},
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.upload-file-uploader { img {
margin-bottom: 5px; width: 100%;
} }
.upload-file-list .el-upload-list__item { .upload-file-uploader {
border: 1px solid #e4e7ed; margin-bottom: 5px;
line-height: 2; }
margin-bottom: 10px; .upload-file-list .el-upload-list__item {
position: relative; border: 1px solid #e4e7ed;
} line-height: 2;
.upload-file-list .ele-upload-list__item-content { margin-bottom: 10px;
display: flex; position: relative;
justify-content: space-between; }
align-items: center; .upload-file-list .ele-upload-list__item-content {
color: inherit; display: flex;
} justify-content: space-between;
.ele-upload-list__item-content-action .el-link { align-items: center;
margin-right: 10px; color: inherit;
} }
</style> .ele-upload-list__item-content-action .el-link {
\ No newline at end of file margin-right: 10px;
}
</style>
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="equipmentList" > <el-table v-loading="loading" :data="equipmentList" >
<el-table-column label="台账编号" align="center" prop="safeEquipmentId" width="80px"/>
<el-table-column label="用户名称" align="center" prop="userName" width="220px"/> <el-table-column label="用户名称" align="center" prop="userName" width="220px"/>
<el-table-column label="身份证号" align="center" prop="idCard"/> <el-table-column label="身份证号" align="center" prop="idCard"/>
<el-table-column label="联系电话" align="center" prop="linkMobile"/> <el-table-column label="联系电话" align="center" prop="linkMobile"/>
...@@ -117,7 +116,7 @@ ...@@ -117,7 +116,7 @@
/> />
<!-- 添加或修改用户加装安全装置台账对话框 --> <!-- 添加或修改用户加装安全装置台账对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @cancel="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
......
...@@ -20,11 +20,6 @@ ...@@ -20,11 +20,6 @@
<el-row style="width: 100%;padding: 20px;"> <el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="100px" style="width: 100%;"> <el-form ref="form" v-model="form" label-width="100px" style="width: 100%;">
<el-row>
<el-form-item label="台账编号:" prop="safeEquipmentId">
<font>{{form.safeEquipmentId}}</font>
</el-form-item>
</el-row>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="用户名称:" prop="userName"> <el-form-item label="用户名称:" prop="userName">
......
...@@ -66,28 +66,34 @@ ...@@ -66,28 +66,34 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="hiddenList" > <el-table v-loading="loading" :data="hiddenList" >
<el-table-column label="台账编号" align="center" prop="hiddenId" width="80px"/> <el-table-column label="隐患名称" align="center" prop="hiddenTitle" width="200px"/>
<el-table-column label="隐患名称" align="center" prop="hiddenTitle" /> <el-table-column label="隐患类型" align="center" prop="hiddenType" width="180px">
<el-table-column label="隐患位置" align="center" prop="hiddenLocation" />
<el-table-column label="隐患类型" align="center" prop="hiddenType" />
<el-table-column label="隐患发现人员" align="center" prop="hiddenFindPeople" />
<el-table-column label="发现时间" align="center" prop="hiddenFindDate" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.hiddenFindDate }}</span> <span v-if="scope.row.hiddenType == '1'"></span>
<span v-if="scope.row.hiddenType == '2'"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="处理方案" align="center" prop="dealPlan" > <el-table-column label="隐患位置" align="center" prop="hiddenLocation" width="300px"/>
<el-table-column label="隐患发现人员" align="center" prop="hiddenFindPeople" width="150px"/>
<el-table-column label="发现时间" align="center" prop="hiddenFindDate" width="180px"/>
<el-table-column label="处理方案" align="center" prop="dealPlanUrl" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
<span <span
class="dbtn sd qiCr" class="dbtn"
@click="checkFile(scope.row.dealPlan)" @click="checkFile(scope.row.dealPlanUrl)"
v-if="scope.row.dealPlan != ''" v-if="scope.row.dealPlan != ''"
> >
<i class="el-icon el-icon-view"></i>查看/下载 <i class="el-icon el-icon-view"></i>查看/下载
</span> </span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="整治情况" align="center" prop="remediation" width="180px">
<template slot-scope="scope">
<span v-if="scope.row.remediation != '' && scope.row.remediation != null">{{ scope.row.remediation }}</span>
<span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="整治情况" align="center" prop="remediation" />
<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">
<el-button <el-button
...@@ -124,7 +130,7 @@ ...@@ -124,7 +130,7 @@
/> />
<!-- 添加或修改隐患整治台账对话框 --> <!-- 添加或修改隐患整治台账对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @cancel="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
...@@ -148,7 +154,7 @@ ...@@ -148,7 +154,7 @@
<el-row> <el-row>
<el-col :span="23"> <el-col :span="23">
<el-form-item label="隐患内容" prop="hiddenContent"> <el-form-item label="隐患内容" prop="hiddenContent">
<editor v-model="form.hiddenContent" :min-height="192"/> <el-input type="textarea" v-model="form.hiddenContent" placeholder="请输入隐患内容"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -164,10 +170,10 @@ ...@@ -164,10 +170,10 @@
<el-form-item label="经纬度坐标" prop="longitude"> <el-form-item label="经纬度坐标" prop="longitude">
<el-row> <el-row>
<el-col :span="9"> <el-col :span="9">
<el-input v-model.number="form.longitude" placeholder="请输入经度" /> <el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col> </el-col>
<el-col :span="9" style="margin-left: 10px"> <el-col :span="9" style="margin-left: 10px">
<el-input v-model.number="form.latitude" placeholder="请输入纬度"/> <el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-col> </el-col>
<el-col :span="3" style="margin-left: 30px"> <el-col :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button> <el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
...@@ -197,8 +203,8 @@ ...@@ -197,8 +203,8 @@
<el-row> <el-row>
<el-col :span="23"> <el-col :span="23">
<el-form-item label="处理方案" prop="dealPlan"> <el-form-item label="处理方案" prop="dealPlan">
<MyFileUpload <FileUpload
listType="picture-card" listType="picture"
@resFun="getFileInfo" @resFun="getFileInfo"
@remove="listRemove" @remove="listRemove"
:fileArr="fileList" :fileArr="fileList"
...@@ -243,13 +249,14 @@ ...@@ -243,13 +249,14 @@
<script> <script>
import { listHidden, getHidden, delHidden, addHidden, updateHidden, exportHidden } from "@/api/standingBook/hidden"; import { listHidden, getHidden, delHidden, addHidden, updateHidden, exportHidden } from "@/api/standingBook/hidden";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import MyFileUpload from '@/components/MyFileUpload'; import FileUpload from '@/components/FileUpload';
let uploadfile = require("@/assets/uploadfile.png");
export default { export default {
name: "Hidden", name: "Hidden",
components: { components: {
Editor, Editor,
MyFileUpload FileUpload
}, },
data() { data() {
return { return {
...@@ -296,9 +303,9 @@ export default { ...@@ -296,9 +303,9 @@ export default {
hiddenTitle: [ hiddenTitle: [
{ required: true, message: "请输入隐患名称", trigger: "blur" }, { required: true, message: "请输入隐患名称", trigger: "blur" },
], ],
hiddenType: [ /*hiddenType: [
{ required: true, message: "请选择隐患类型", trigger: "blur" }, { required: true, message: "请选择隐患类型", trigger: "blur" },
], ],*/
hiddenContent: [ hiddenContent: [
{ required: true, message: "请输入隐患内容", trigger: "blur" }, { required: true, message: "请输入隐患内容", trigger: "blur" },
], ],
...@@ -362,6 +369,7 @@ export default { ...@@ -362,6 +369,7 @@ export default {
remarks: null remarks: null
}; };
this.resetForm("form"); this.resetForm("form");
this.fileList = [];
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -385,6 +393,12 @@ export default { ...@@ -385,6 +393,12 @@ export default {
const hiddenId = row.hiddenId || this.ids const hiddenId = row.hiddenId || this.ids
getHidden(hiddenId).then(response => { getHidden(hiddenId).then(response => {
this.form = response.data; this.form = response.data;
if (this.form.dealPlan) {
this.fileList.push({
name: this.form.dealPlan,
url: uploadfile,
});
}
this.open = true; this.open = true;
this.title = "修改隐患整治台账"; this.title = "修改隐患整治台账";
}); });
...@@ -449,11 +463,15 @@ export default { ...@@ -449,11 +463,15 @@ export default {
}) })
}, },
checkFile(url) { checkFile(url) {
window.open('http://localhost:8903/gassafety' + url,'_blank') window.open(url,'_blank');
// window.open('http://222.223.203.154:8092/gassafety' + url,'_blank')
}, },
getFileInfo(res){ getFileInfo(res){
this.form.dealPlan = res.url; this.form.dealPlan = res.fileName;
this.form.dealPlanUrl = res.url;
this.fileList.push({
name: res.fileName,
url: uploadfile,
});
}, },
listRemove(e) { listRemove(e) {
this.form.dealPlan = ""; this.form.dealPlan = "";
...@@ -475,3 +493,19 @@ export default { ...@@ -475,3 +493,19 @@ export default {
} }
}; };
</script> </script>
<style>
.dbtn {
display: inline-block;
padding: 2px 5px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
font-size: 9px;
}
.dbtn:hover {
border-width: 1px;
border-color: rgb(48, 180, 107);
}
</style>
...@@ -19,41 +19,39 @@ ...@@ -19,41 +19,39 @@
</el-row> </el-row>
<el-row style="width: 100%;padding: 20px;"> <el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="100px" style="width: 100%;"> <el-form ref="form" v-model="form" label-width="120px" style="width: 100%;">
<el-row>
<el-form-item label="台账编号:" prop="hiddenId">
<font>{{form.hiddenId}}</font>
</el-form-item>
</el-row>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="用户名称:" prop="userName"> <el-form-item label="隐患名称:" prop="hiddenTitle">
<font>{{form.userName}}</font> <font>{{form.hiddenTitle}}</font>
</el-form-item> </el-form-item>
<el-form-item label="身份证号:" prop="idCard"> <el-form-item label="隐患发现人员:" prop="hiddenFindPeople">
<font>{{form.idCard}}</font> <font>{{form.hiddenFindPeople}}</font>
</el-form-item>
<el-form-item label="品牌名称:" prop="brandName">
<font v-if="form.brandName != '' && form.brandName != null">{{form.brandName}}</font>
<font v-else> - </font>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="用户编号:" prop="userNo"> <el-form-item label="隐患类型:" prop="hiddenType">
<font v-if="form.userNo != '' && form.userNo != null">{{form.userNo}}</font> <font>{{form.hiddenType}}</font>
<font v-else> - </font>
</el-form-item>
<el-form-item label="联系电话:" prop="linkMobile">
<font>{{form.linkMobile}}</font>
</el-form-item> </el-form-item>
<el-form-item label="安装时间:" prop="installTime"> <el-form-item label="发现时间:" prop="hiddenFindDate">
<font>{{form.installTime}}</font> <font>{{form.hiddenFindDate}}</font>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="详细地址:" prop="userAddress"> <el-form-item label="隐患位置:" prop="hiddenLocation">
<font>{{form.userAddress}}</font> <font>{{form.hiddenLocation}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="隐患内容:" prop="hiddenContent">
<font>{{form.hiddenContent}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="整治情况:" prop="remediation">
<font v-if="form.remediation != '' && form.remediation != null">{{form.remediation}}</font>
<font v-else> - </font>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
......
...@@ -76,15 +76,14 @@ ...@@ -76,15 +76,14 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="troubleList" > <el-table v-loading="loading" :data="troubleList" >
<el-table-column label="台账编号" align="center" prop="troubleId" width="80px"/> <el-table-column label="事故名称" align="center" prop="troubleName" width="200px"/>
<el-table-column label="事故名称" align="center" prop="troubleName"/> <el-table-column label="事故类型" align="center" prop="troubleType" width="180px">
<el-table-column label="事故地点" align="center" prop="troubleLocation"/>
<el-table-column label="事故类型" align="center" prop="troubleType" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.troubleType == 1">生产安全事故</span> <span v-if="scope.row.troubleType == 1">生产安全事故</span>
<span v-if="scope.row.troubleType == 2">非生产安全事故</span> <span v-if="scope.row.troubleType == 2">非生产安全事故</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="事故地点" align="center" prop="troubleLocation" width="300px"/>
<el-table-column label="责任单位" align="center" prop="responsibleUnit" /> <el-table-column label="责任单位" align="center" prop="responsibleUnit" />
<el-table-column label="责任人员" align="center" prop="responsiblePeople" /> <el-table-column label="责任人员" align="center" prop="responsiblePeople" />
<el-table-column label="是否处理" align="center" prop="isDeal" width="120px"> <el-table-column label="是否处理" align="center" prop="isDeal" width="120px">
...@@ -130,7 +129,7 @@ ...@@ -130,7 +129,7 @@
/> />
<!-- 添加或修改事故台账对话框 --> <!-- 添加或修改事故台账对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @cancel="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
...@@ -159,10 +158,10 @@ ...@@ -159,10 +158,10 @@
<el-form-item label="经纬度坐标" prop="longitude"> <el-form-item label="经纬度坐标" prop="longitude">
<el-row> <el-row>
<el-col :span="9"> <el-col :span="9">
<el-input v-model.number="form.longitude" placeholder="请输入经度" /> <el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col> </el-col>
<el-col :span="9" style="margin-left: 10px"> <el-col :span="9" style="margin-left: 10px">
<el-input v-model.number="form.latitude" placeholder="请输入纬度"/> <el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-col> </el-col>
<el-col :span="3" style="margin-left: 30px"> <el-col :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button> <el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
...@@ -174,7 +173,7 @@ ...@@ -174,7 +173,7 @@
<el-row> <el-row>
<el-col :span="23"> <el-col :span="23">
<el-form-item label="事故原因" prop="troubleReason"> <el-form-item label="事故原因" prop="troubleReason">
<el-input type="textarea" v-model="form.troubleReason" placeholder="请输入事故原因" /> <el-input v-model="form.troubleReason" placeholder="请输入事故原因" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -306,6 +305,9 @@ export default { ...@@ -306,6 +305,9 @@ export default {
longitude: [ longitude: [
{ required: true, message: "请输入经纬度", trigger: "blur" }, { required: true, message: "请输入经纬度", trigger: "blur" },
], ],
troubleReason: [
{ required: true, message: "请输入事故原因", trigger: "blur" },
],
responsibleUnit: [ responsibleUnit: [
{ required: true, message: "请输入责任单位", trigger: "blur" }, { required: true, message: "请输入责任单位", trigger: "blur" },
], ],
......
...@@ -19,43 +19,52 @@ ...@@ -19,43 +19,52 @@
</el-row> </el-row>
<el-row style="width: 100%;padding: 20px;"> <el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="100px" style="width: 100%;"> <el-form ref="form" v-model="form" label-width="120px" style="width: 100%;">
<el-row>
<el-form-item label="台账编号:" prop="troubleId">
<font>{{form.troubleId}}</font>
</el-form-item>
</el-row>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="用户名称:" prop="userName"> <el-form-item label="事故名称:" prop="troubleName">
<font>{{form.userName}}</font> <font>{{form.troubleName}}</font>
</el-form-item> </el-form-item>
<el-form-item label="身份证号:" prop="idCard"> <el-form-item label="事故原因:" prop="troubleReason">
<font>{{form.idCard}}</font> <font>{{form.troubleReason}}</font>
</el-form-item> </el-form-item>
<el-form-item label="品牌名称:" prop="brandName"> <el-form-item label="责任单位:" prop="responsibleUnit">
<font v-if="form.brandName != '' && form.brandName != null">{{form.brandName}}</font> <font v-if="form.responsibleUnit != '' && form.responsibleUnit != null">{{form.responsibleUnit}}</font>
<font v-else> - </font> <font v-else> - </font>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="用户编号:" prop="userNo"> <el-form-item label="事故类型:" prop="troubleType">
<font v-if="form.userNo != '' && form.userNo != null">{{form.userNo}}</font> <font v-if="form.troubleType == '1'">安全生产事故</font>
<font v-else> - </font> <font v-if="form.troubleType == '2'">非生产安全事故</font>
</el-form-item> </el-form-item>
<el-form-item label="联系电话:" prop="linkMobile"> <el-form-item label="事故地点:" prop="troubleLocation">
<font>{{form.linkMobile}}</font> <font>{{form.troubleLocation}}</font>
</el-form-item> </el-form-item>
<el-form-item label="安装时间:" prop="installTime"> <el-form-item label="责任人员:" prop="responsiblePeople">
<font>{{form.installTime}}</font> <font v-if="form.responsiblePeople != '' && form.responsiblePeople != null">{{form.responsiblePeople}}</font>
<font v-else> - </font>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="详细地址:" prop="userAddress"> <el-form-item label="简要经过:" prop="briefProcess">
<font>{{form.userAddress}}</font> <font v-if="form.briefProcess != '' && form.briefProcess != null">{{form.briefProcess}}</font>
<font v-else> - </font>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row>
<el-col :span="6">
<el-form-item label="是否处理:" prop="isDeal">
<font>{{form.isDeal}}</font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="处理完成时间:" prop="dealDate">
<font>{{form.dealDate}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-form-item label="备注信息:" prop="remarks"> <el-form-item label="备注信息:" prop="remarks">
<font v-if="form.remarks != '' && form.remarks != null">{{form.remarks}}</font> <font v-if="form.remarks != '' && form.remarks != null">{{form.remarks}}</font>
......
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