Commit 3d5214d2 authored by zhangjianqian's avatar zhangjianqian

隐患台账 隐患等级:重大隐患,添加隐患附件;较大隐患和严重隐患,录入基本信息;一般隐患时,可录入整改信息 附件显示

parent f5170068
......@@ -55,6 +55,7 @@ public class TStaningBookServiceImpl implements ITStaningBookService
List<Long> oneList = new ArrayList<>();
oneList.add(deptId);
List<Long> deptIds = selectDeptIds(new ArrayList<>(),oneList);
deptIds.add(deptId);
tStaningBook.setDeptList(deptIds);
List<TStaningBook> list = tStaningBookMapper.selectTStaningBookList(tStaningBook);
return list;
......
......@@ -46,19 +46,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectTStaningBookList" parameterType="TStaningBook" resultMap="TStaningBookResult">
SELECT b.*,s5.nick_name AS escalationName,
SELECT b.*,s1.staff_name AS escalationName,
s2.`staff_name` AS rectificationName,
s3.`staff_name` AS personLiableName ,
d.`dept_name` AS deptName
FROM t_staning_book b
LEFT JOIN t_staff s1 ON b.`escalation` = s1.`staff_id`
LEFT JOIN sys_user s5 ON b.escalation=s5.user_id
LEFT JOIN t_staff s2 ON b.`rectification` = s2.`staff_id`
LEFT JOIN t_staff s3 ON b.`person_liable` = s3.`staff_id`
LEFT JOIN sys_user s1 ON b.`escalation` = s1.`user_id`
LEFT JOIN sys_user s2 ON b.`rectification` = s2.`user_id`
LEFT JOIN sys_user s3 ON b.`person_liable` = s3.`user_id`
LEFT JOIN sys_dept d ON d.`dept_id` = b.`dept_id`
<where>
<foreach collection="deptList" item="deptId" open="AND s1.dept_id in (" separator="," close=")">
<foreach collection="deptList" item="deptId" open="AND b.dept_id in (" separator="," close=")">
#{deptId}
</foreach>
<if test="troubleName != null and troubleName != ''"> and b.trouble_name like concat('%', #{troubleName}, '%')</if>
......
......@@ -149,7 +149,7 @@
<el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-form-item label="隐患类型" prop="troubleType" width="50%" >
<el-select v-model="form.troubleType" placeholder="请选择隐患类型" @change="changeType">
<el-select v-model="form.troubleType" placeholder="请选择隐患类型" >
<el-option
v-for="dict in troubleTypeOptions"
:key="dict.dictValue"
......@@ -161,7 +161,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="隐患等级" prop="troubleLevel">
<el-select v-model="form.troubleLevel" placeholder="请选择隐患等级">
<el-select v-model="form.troubleLevel" placeholder="请选择隐患等级" @change="changeType">
<el-option
v-for="dict in troubleLevelOptions"
:key="dict.dictValue"
......@@ -367,7 +367,7 @@
<el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-form-item label="隐患类型" prop="troubleType" width="50%" >
<el-select v-model="form.troubleType" placeholder="请选择隐患类型" disabled @change="changeType">
<el-select v-model="form.troubleType" placeholder="请选择隐患类型" disabled >
<el-option
v-for="dict in troubleTypeOptions"
:key="dict.dictValue"
......@@ -433,7 +433,16 @@
<el-image :zIndex="9999" :ref="'a'+form.id" :src="form.picture" v-show="false" :preview-src-list="[form.picture]" v-if="form.picture != '' && form.picture != null"></el-image>
</el-form-item>
<el-form-item label="隐患附件" prop="enclosure" v-if="zhong==1">
<el-input v-model="form.enclosure" placeholder="请输入隐患附件" />
<!--<el-input v-model="form.enclosure" placeholder="请输入隐患附件" />-->
<span
style="padding-top: 10px;"
class="dbtn"
@click="checkFile(form.enclosure)"
v-if="form.enclosure != null && form.enclosure!=''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</el-form-item>
<el-row :gutter="24" class="mb8">
<el-col :span="12">
......@@ -467,12 +476,12 @@
</el-form-item>
<el-divider content-position="left"><i class="el-icon-info"></i><span class="boxx">整改信息</span></el-divider>
<el-form-item label="投入费用" prop="investmentCost" v-if="zhong==1">
<el-input v-model="form.investmentCost" placeholder="请输入投入费用" disabled/>
</el-form-item>
<el-form-item label="投入物资" prop="investmentMaterial" v-if="zhong==1">
<el-input v-model="form.investmentMaterial" placeholder="请输入投入物资" disabled/>
</el-form-item>
<!--<el-form-item label="投入费用" prop="investmentCost" v-if="zhong==1">-->
<!--<el-input v-model="form.investmentCost" placeholder="请输入投入费用" disabled/>-->
<!--</el-form-item>-->
<!--<el-form-item label="投入物资" prop="investmentMaterial" v-if="zhong==1">-->
<!--<el-input v-model="form.investmentMaterial" placeholder="请输入投入物资" disabled/>-->
<!--</el-form-item>-->
<el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-form-item label="整改人" prop="rectification" >
......@@ -624,13 +633,15 @@
<el-form-item label="隐患附件" prop="enclosure" v-if="zhong==1">
<!--<el-input v-model="form.enclosure" placeholder="请输入隐患附件" />-->
<FileUpload
listType="picture"
@resFun="getFileInfo($event,3)"
@remove="listRemove($event,3)"
:fileArr="fileList3"
/>
<el-input v-show="false" disabled v-model="form.enclosure"></el-input>
<span
style="padding-top: 10px;"
class="dbtn"
@click="checkFile(form.enclosure)"
v-if="form.enclosure != null && form.enclosure!=''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</el-form-item>
<el-row :gutter="24" class="mb8">
<el-col :span="12">
......@@ -900,6 +911,9 @@ export default {
this.loading = false;
});
},
checkFile(url) {
window.open(url,'_blank');
},
/** 查询员工列表 */
getStaffList() {
this.loading = true;
......@@ -1016,7 +1030,7 @@ export default {
const bookId = row.bookId || this.ids
getBook(bookId).then(response => {
this.form = response.data;
if(this.form.troubleType==2){
if(this.form.troubleLevel==1){
this.zhong = 1
}else{
this.zhong = 0
......@@ -1049,7 +1063,7 @@ export default {
const bookId = row.bookId || this.ids
getBook(bookId).then(response => {
this.form = response.data;
if(this.form.troubleType==2){
if(this.form.troubleLevel==1){
this.zhong = 1
}else{
this.zhong = 0
......@@ -1082,6 +1096,9 @@ export default {
const bookId = row.bookId || this.ids
getBook(bookId).then(response => {
this.form = response.data;
if(this.form.troubleLevel==1){
this.zhong = 1
}
if (this.form.picture) {
this.fileList.push({
url: this.form.picture,
......@@ -1143,10 +1160,10 @@ export default {
console.log("===",row.id);
},
changeType(){
console.log(this.form.troubleType);
if(this.form.troubleType==3){
console.log(this.form.troubleLevel);
if(this.form.troubleLevel==4){
this.zhong = 2;
}else if(this.form.troubleType==2){
}else if(this.form.troubleLevel==1){
this.zhong = 1;
}else{
this.zhong = 0;
......@@ -1157,7 +1174,7 @@ export default {
console.log(this.form);
if(this.fast){
this.form.state = 2;
}else if(this.form.troubleType==3){
}else if(this.form.troubleLevel==4){
this.form.state = 1;
}
this.$refs["form"].validate(valid => {
......@@ -1245,6 +1262,17 @@ export default {
margin-bottom: 10px;
}
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
.boxx {
font-size: 17px;
font-weight: bold;
......
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