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

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

parent 164b681a
......@@ -74,8 +74,8 @@ public class CommonController
// 上传文件路径
String filePath = GassafetyProgressConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
String fileName = file.getOriginalFilename();
String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file);
AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName);
ajax.put("url", url);
......
......@@ -56,6 +56,9 @@ public class THiddenDangerStandingBook extends BaseEntity
@Excel(name = "处理方案")
private String dealPlan;
/** 方案路径 */
private String dealPlanUrl;
/** 整治情况 */
@Excel(name = "整治情况")
private String remediation;
......@@ -157,7 +160,16 @@ public class THiddenDangerStandingBook extends BaseEntity
{
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;
}
......
......@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="hiddenFindPeople" column="hidden_find_people" />
<result property="hiddenFindDate" column="hidden_find_date" />
<result property="dealPlan" column="deal_plan" />
<result property="dealPlanUrl" column="deal_plan_url" />
<result property="remediation" column="remediation" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
......@@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</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, 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>
<select id="selectTHiddenDangerStandingBookList" parameterType="THiddenDangerStandingBookForm" resultMap="THiddenDangerStandingBookResult">
......@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenFindPeople != null">hidden_find_people,</if>
<if test="hiddenFindDate != null">hidden_find_date,</if>
<if test="dealPlan != null">deal_plan,</if>
<if test="dealPlanUrl != null">deal_plan_url,</if>
<if test="remediation != null">remediation,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
......@@ -73,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenFindPeople != null">#{hiddenFindPeople},</if>
<if test="hiddenFindDate != null">#{hiddenFindDate},</if>
<if test="dealPlan != null">#{dealPlan},</if>
<if test="dealPlanUrl != null">#{dealPlanUrl},</if>
<if test="remediation != null">#{remediation},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
......@@ -95,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenFindPeople != null">hidden_find_people = #{hiddenFindPeople},</if>
<if test="hiddenFindDate != null">hidden_find_date = #{hiddenFindDate},</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="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
......
......@@ -74,7 +74,6 @@
</el-row>
<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="idCard"/>
<el-table-column label="联系电话" align="center" prop="linkMobile"/>
......@@ -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-row>
<el-col :span="11">
......
......@@ -20,11 +20,6 @@
<el-row style="width: 100%;padding: 20px;">
<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-col :span="6">
<el-form-item label="用户名称:" prop="userName">
......
......@@ -66,28 +66,34 @@
</el-row>
<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" />
<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">
<el-table-column label="隐患名称" align="center" prop="hiddenTitle" width="200px"/>
<el-table-column label="隐患类型" align="center" prop="hiddenType" width="180px">
<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>
</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">
<span
class="dbtn sd qiCr"
@click="checkFile(scope.row.dealPlan)"
class="dbtn"
@click="checkFile(scope.row.dealPlanUrl)"
v-if="scope.row.dealPlan != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</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>
</el-table-column>
<el-table-column label="整治情况" align="center" prop="remediation" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -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-row>
<el-col :span="11">
......@@ -148,7 +154,7 @@
<el-row>
<el-col :span="23">
<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-col>
</el-row>
......@@ -164,10 +170,10 @@
<el-form-item label="经纬度坐标" prop="longitude">
<el-row>
<el-col :span="9">
<el-input v-model.number="form.longitude" placeholder="请输入经度" />
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<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 :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
......@@ -197,8 +203,8 @@
<el-row>
<el-col :span="23">
<el-form-item label="处理方案" prop="dealPlan">
<MyFileUpload
listType="picture-card"
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
......@@ -243,13 +249,14 @@
<script>
import { listHidden, getHidden, delHidden, addHidden, updateHidden, exportHidden } from "@/api/standingBook/hidden";
import Editor from '@/components/Editor';
import MyFileUpload from '@/components/MyFileUpload';
import FileUpload from '@/components/FileUpload';
let uploadfile = require("@/assets/uploadfile.png");
export default {
name: "Hidden",
components: {
Editor,
MyFileUpload
FileUpload
},
data() {
return {
......@@ -296,9 +303,9 @@ export default {
hiddenTitle: [
{ required: true, message: "请输入隐患名称", trigger: "blur" },
],
hiddenType: [
/*hiddenType: [
{ required: true, message: "请选择隐患类型", trigger: "blur" },
],
],*/
hiddenContent: [
{ required: true, message: "请输入隐患内容", trigger: "blur" },
],
......@@ -362,6 +369,7 @@ export default {
remarks: null
};
this.resetForm("form");
this.fileList = [];
},
/** 搜索按钮操作 */
handleQuery() {
......@@ -385,6 +393,12 @@ export default {
const hiddenId = row.hiddenId || this.ids
getHidden(hiddenId).then(response => {
this.form = response.data;
if (this.form.dealPlan) {
this.fileList.push({
name: this.form.dealPlan,
url: uploadfile,
});
}
this.open = true;
this.title = "修改隐患整治台账";
});
......@@ -449,11 +463,15 @@ export default {
})
},
checkFile(url) {
window.open('http://localhost:8903/gassafety' + url,'_blank')
// window.open('http://222.223.203.154:8092/gassafety' + url,'_blank')
window.open(url,'_blank');
},
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) {
this.form.dealPlan = "";
......@@ -475,3 +493,19 @@ export default {
}
};
</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 @@
</el-row>
<el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="100px" style="width: 100%;">
<el-row>
<el-form-item label="台账编号:" prop="hiddenId">
<font>{{form.hiddenId}}</font>
</el-form-item>
</el-row>
<el-form ref="form" v-model="form" label-width="120px" style="width: 100%;">
<el-row>
<el-col :span="6">
<el-form-item label="用户名称:" prop="userName">
<font>{{form.userName}}</font>
<el-form-item label="隐患名称:" prop="hiddenTitle">
<font>{{form.hiddenTitle}}</font>
</el-form-item>
<el-form-item label="身份证号:" prop="idCard">
<font>{{form.idCard}}</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 label="隐患发现人员:" prop="hiddenFindPeople">
<font>{{form.hiddenFindPeople}}</font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="用户编号:" prop="userNo">
<font v-if="form.userNo != '' && form.userNo != null">{{form.userNo}}</font>
<font v-else> - </font>
</el-form-item>
<el-form-item label="联系电话:" prop="linkMobile">
<font>{{form.linkMobile}}</font>
<el-form-item label="隐患类型:" prop="hiddenType">
<font>{{form.hiddenType}}</font>
</el-form-item>
<el-form-item label="安装时间:" prop="installTime">
<font>{{form.installTime}}</font>
<el-form-item label="发现时间:" prop="hiddenFindDate">
<font>{{form.hiddenFindDate}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="详细地址:" prop="userAddress">
<font>{{form.userAddress}}</font>
<el-form-item label="隐患位置:" prop="hiddenLocation">
<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-row>
<el-row>
......
......@@ -76,15 +76,14 @@
</el-row>
<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"/>
<el-table-column label="事故地点" align="center" prop="troubleLocation"/>
<el-table-column label="事故类型" align="center" prop="troubleType" >
<el-table-column label="事故名称" align="center" prop="troubleName" width="200px"/>
<el-table-column label="事故类型" align="center" prop="troubleType" width="180px">
<template slot-scope="scope">
<span v-if="scope.row.troubleType == 1">生产安全事故</span>
<span v-if="scope.row.troubleType == 2">非生产安全事故</span>
</template>
</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="responsiblePeople" />
<el-table-column label="是否处理" align="center" prop="isDeal" width="120px">
......@@ -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-row>
<el-col :span="11">
......@@ -159,10 +158,10 @@
<el-form-item label="经纬度坐标" prop="longitude">
<el-row>
<el-col :span="9">
<el-input v-model.number="form.longitude" placeholder="请输入经度" />
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<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 :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
......@@ -174,7 +173,7 @@
<el-row>
<el-col :span="23">
<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-col>
</el-row>
......@@ -306,6 +305,9 @@ export default {
longitude: [
{ required: true, message: "请输入经纬度", trigger: "blur" },
],
troubleReason: [
{ required: true, message: "请输入事故原因", trigger: "blur" },
],
responsibleUnit: [
{ required: true, message: "请输入责任单位", trigger: "blur" },
],
......
......@@ -19,43 +19,52 @@
</el-row>
<el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="100px" style="width: 100%;">
<el-row>
<el-form-item label="台账编号:" prop="troubleId">
<font>{{form.troubleId}}</font>
</el-form-item>
</el-row>
<el-form ref="form" v-model="form" label-width="120px" style="width: 100%;">
<el-row>
<el-col :span="6">
<el-form-item label="用户名称:" prop="userName">
<font>{{form.userName}}</font>
<el-form-item label="事故名称:" prop="troubleName">
<font>{{form.troubleName}}</font>
</el-form-item>
<el-form-item label="身份证号:" prop="idCard">
<font>{{form.idCard}}</font>
<el-form-item label="事故原因:" prop="troubleReason">
<font>{{form.troubleReason}}</font>
</el-form-item>
<el-form-item label="品牌名称:" prop="brandName">
<font v-if="form.brandName != '' && form.brandName != null">{{form.brandName}}</font>
<el-form-item label="责任单位:" prop="responsibleUnit">
<font v-if="form.responsibleUnit != '' && form.responsibleUnit != null">{{form.responsibleUnit}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="用户编号:" prop="userNo">
<font v-if="form.userNo != '' && form.userNo != null">{{form.userNo}}</font>
<font v-else> - </font>
<el-form-item label="事故类型:" prop="troubleType">
<font v-if="form.troubleType == '1'">安全生产事故</font>
<font v-if="form.troubleType == '2'">非生产安全事故</font>
</el-form-item>
<el-form-item label="联系电话:" prop="linkMobile">
<font>{{form.linkMobile}}</font>
<el-form-item label="事故地点:" prop="troubleLocation">
<font>{{form.troubleLocation}}</font>
</el-form-item>
<el-form-item label="安装时间:" prop="installTime">
<font>{{form.installTime}}</font>
<el-form-item label="责任人员:" prop="responsiblePeople">
<font v-if="form.responsiblePeople != '' && form.responsiblePeople != null">{{form.responsiblePeople}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="详细地址:" prop="userAddress">
<font>{{form.userAddress}}</font>
<el-form-item label="简要经过:" prop="briefProcess">
<font v-if="form.briefProcess != '' && form.briefProcess != null">{{form.briefProcess}}</font>
<font v-else> - </font>
</el-form-item>
</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-form-item label="备注信息:" prop="remarks">
<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