Commit 1e8e04e4 authored by zhangjianqian's avatar zhangjianqian

1.隐患排查任务还没有开始的时候,增加修改功能,开始后不可修改。2.隐患排查任务,选责任部门,再选风险点和责任人。3.任务详情,排查内容显示的不对。

parent 47bb5fb9
package com.zehong.web.controller.hiddenDanger; package com.zehong.web.controller.hiddenDanger;
import java.util.Date;
import java.util.List; import java.util.List;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.zehong.common.core.domain.entity.SysUser; import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.domain.model.LoginUser; import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.utils.ServletUtils; import com.zehong.common.utils.ServletUtils;
...@@ -108,6 +110,10 @@ public class THiddenTroubleWorkController extends BaseController ...@@ -108,6 +110,10 @@ public class THiddenTroubleWorkController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody THiddenTroubleWork tHiddenTroubleWork) public AjaxResult edit(@RequestBody THiddenTroubleWork tHiddenTroubleWork)
{ {
THiddenTroubleWork work = tHiddenTroubleWorkService.selectTHiddenTroubleWorkById(tHiddenTroubleWork.getWorkId());
if (work.getWorkBeginTime().getTime()< new Date().getTime()){
return AjaxResult.error("任务已开始,不可修改");
}
return toAjax(tHiddenTroubleWorkService.updateTHiddenTroubleWork(tHiddenTroubleWork)); return toAjax(tHiddenTroubleWorkService.updateTHiddenTroubleWork(tHiddenTroubleWork));
} }
......
...@@ -90,9 +90,28 @@ public class THiddenTroubleWork extends BaseEntity ...@@ -90,9 +90,28 @@ public class THiddenTroubleWork extends BaseEntity
private Integer isDel; private Integer isDel;
private List<THiddenTroubleWork> children; private List<THiddenTroubleWork> children;
private List<TRiskManager> riskList;
private Integer limits = 0; private Integer limits = 0;
private Integer isupdate = 0;
public List<TRiskManager> getRiskList() {
return riskList;
}
public void setRiskList(List<TRiskManager> riskList) {
this.riskList = riskList;
}
public Integer getIsupdate() {
return isupdate;
}
public void setIsupdate(Integer isupdate) {
this.isupdate = isupdate;
}
public Long getStaffId() { public Long getStaffId() {
return staffId; return staffId;
} }
......
...@@ -60,4 +60,5 @@ public interface TRiskManagerMapper ...@@ -60,4 +60,5 @@ public interface TRiskManagerMapper
public int deleteTRiskManagerByIds(Long[] ids); public int deleteTRiskManagerByIds(Long[] ids);
public String selectNamesByid(String[] ids); public String selectNamesByid(String[] ids);
public List<TRiskManager> selectByids(String[] ids);
} }
...@@ -8,8 +8,10 @@ import java.util.List; ...@@ -8,8 +8,10 @@ import java.util.List;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.THiddenTroubleAssessment; import com.zehong.system.domain.THiddenTroubleAssessment;
import com.zehong.system.domain.TRiskManager;
import com.zehong.system.domain.TStaningBook; import com.zehong.system.domain.TStaningBook;
import com.zehong.system.mapper.THiddenTroubleAssessmentMapper; import com.zehong.system.mapper.THiddenTroubleAssessmentMapper;
import com.zehong.system.mapper.TRiskManagerMapper;
import com.zehong.system.mapper.TStaningBookMapper; import com.zehong.system.mapper.TStaningBookMapper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -32,7 +34,7 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService ...@@ -32,7 +34,7 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService
@Autowired @Autowired
private THiddenTroubleWorkMapper tHiddenTroubleWorkMapper; private THiddenTroubleWorkMapper tHiddenTroubleWorkMapper;
@Autowired @Autowired
private TStaningBookMapper tStaningBookMapper; private TRiskManagerMapper tRiskManagerMapper;
@Autowired @Autowired
private THiddenTroubleAssessmentMapper tHiddenTroubleAssessmentMapper; private THiddenTroubleAssessmentMapper tHiddenTroubleAssessmentMapper;
private static Logger logger = LoggerFactory.getLogger(THiddenTroubleWorkServiceImpl.class); private static Logger logger = LoggerFactory.getLogger(THiddenTroubleWorkServiceImpl.class);
...@@ -46,7 +48,11 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService ...@@ -46,7 +48,11 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService
@Override @Override
public THiddenTroubleWork selectTHiddenTroubleWorkById(Long workId) public THiddenTroubleWork selectTHiddenTroubleWorkById(Long workId)
{ {
return tHiddenTroubleWorkMapper.selectTHiddenTroubleWorkById(workId); THiddenTroubleWork work = tHiddenTroubleWorkMapper.selectTHiddenTroubleWorkById(workId);
work.setRiskList(tRiskManagerMapper.selectByids(work.getContent().split(",")));
return work;
} }
/** /**
...@@ -59,6 +65,11 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService ...@@ -59,6 +65,11 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService
public List<THiddenTroubleWork> selectTHiddenTroubleWorkList(THiddenTroubleWork tHiddenTroubleWork) public List<THiddenTroubleWork> selectTHiddenTroubleWorkList(THiddenTroubleWork tHiddenTroubleWork)
{ {
List<THiddenTroubleWork> list = tHiddenTroubleWorkMapper.selectTHiddenTroubleWorkList(tHiddenTroubleWork); List<THiddenTroubleWork> list = tHiddenTroubleWorkMapper.selectTHiddenTroubleWorkList(tHiddenTroubleWork);
for (THiddenTroubleWork t : list){
if(t.getWorkBeginTime().getTime()> new Date().getTime()){
t.setIsupdate(1);
}
}
if(tHiddenTroubleWork.getParentId()==0){ if(tHiddenTroubleWork.getParentId()==0){
for(THiddenTroubleWork w : list){ for(THiddenTroubleWork w : list){
THiddenTroubleWork tw = new THiddenTroubleWork(); THiddenTroubleWork tw = new THiddenTroubleWork();
......
...@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTHiddenTroubleWorkById" parameterType="Long" resultMap="THiddenTroubleWorkResult"> <select id="selectTHiddenTroubleWorkById" parameterType="Long" resultMap="THiddenTroubleWorkResult">
SELECT tw.work_id, tw.parent_id, tw.book_id, tw.work_cycle, tw.work_name, tw.work_type, tw.work_form, tw.work_begin_time, tw.work_end_time,tw.finish_time, SELECT tw.work_id, tw.parent_id, tw.book_id, tw.work_cycle, tw.work_name, tw.work_type, tw.work_form, tw.work_begin_time, tw.work_end_time,tw.finish_time,
tw.time_term, tw.work_range, tw.dept_id, tw.work_step, tw.content, tw.create_time, tw.create_by, tw.is_del, tw.time_term, tw.work_range, tw.dept_id, tw.work_step, tw.content, tw.create_time, tw.create_by, tw.is_del,
d.dept_name,b.trouble_name d.dept_name,b.trouble_name,tw.staff_id,tw.content
FROM t_hidden_trouble_work tw FROM t_hidden_trouble_work tw
LEFT JOIN sys_dept d ON d.dept_id = tw.dept_id LEFT JOIN sys_dept d ON d.dept_id = tw.dept_id
LEFT JOIN t_staning_book b ON b.book_id = tw.book_id LEFT JOIN t_staning_book b ON b.book_id = tw.book_id
...@@ -137,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -137,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="timeTerm != null">time_term = #{timeTerm},</if> <if test="timeTerm != null">time_term = #{timeTerm},</if>
<if test="workRange != null">work_range = #{workRange},</if> <if test="workRange != null">work_range = #{workRange},</if>
<if test="deptId != null">dept_id = #{deptId},</if> <if test="deptId != null">dept_id = #{deptId},</if>
<if test="staffId != null">staff_id = #{staffId},</if>
<if test="workStep != null">work_step = #{workStep},</if> <if test="workStep != null">work_step = #{workStep},</if>
<if test="content != null">content = #{content},</if> <if test="content != null">content = #{content},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
......
...@@ -89,4 +89,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -89,4 +89,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="selectByids" parameterType="string" resultMap="TRiskManagerResult">
SELECT * from t_risk_manager WHERE id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -96,6 +96,13 @@ ...@@ -96,6 +96,13 @@
</el-table-column> </el-table-column>
<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
v-if = "scope.row.isupdate == 1"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button <el-button
v-if ="scope.row.workCycle==1 || scope.row.parentId!=0" v-if ="scope.row.workCycle==1 || scope.row.parentId!=0"
size="mini" size="mini"
...@@ -199,17 +206,17 @@ ...@@ -199,17 +206,17 @@
<!--<el-form-item label="责任部门" prop="deptId">--> <!--<el-form-item label="责任部门" prop="deptId">-->
<!--<el-input v-model="form.deptId" placeholder="请输入责任部门" />--> <!--<el-input v-model="form.deptId" placeholder="请输入责任部门" />-->
<!--</el-form-item>--> <!--</el-form-item>-->
<!--<el-form-item label="责任部门" prop="deptId">--> <el-form-item label="责任部门" prop="deptId">
<!--&lt;!&ndash;<el-input v-model="form.deptId" placeholder="请输入部门id" />&ndash;&gt;--> <!--<el-input v-model="form.deptId" placeholder="请输入部门id" />-->
<!--<el-select v-model="form.deptId" filterable placeholder="请选择责任部门">--> <el-select v-model="form.deptId" @change="selectUserList" filterable placeholder="请选择责任部门">
<!--<el-option--> <el-option
<!--v-for="dict in deptList"--> v-for="dict in deptList"
<!--:key="dict.deptId"--> :key="dict.deptId"
<!--:label="dict.deptName"--> :label="dict.deptName"
<!--:value="parseInt(dict.deptId)"--> :value="parseInt(dict.deptId)"
<!--&gt;</el-option>--> ></el-option>
<!--</el-select>--> </el-select>
<!--</el-form-item>--> </el-form-item>
<el-form-item label="责任人" prop="staffId"> <el-form-item label="责任人" prop="staffId">
<el-select v-model="form.staffId" filterable placeholder="请选择责任人"> <el-select v-model="form.staffId" filterable placeholder="请选择责任人">
<el-option <el-option
...@@ -247,7 +254,7 @@ ...@@ -247,7 +254,7 @@
v-for="dict in libraryList" v-for="dict in libraryList"
:key="dict.libraryId" :key="dict.libraryId"
:label="dict.riskPointName+'——'+dict.inspectTerm" :label="dict.riskPointName+'——'+dict.inspectTerm"
:value="parseInt(dict.libraryId)" :value="dict.libraryId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -267,9 +274,9 @@ ...@@ -267,9 +274,9 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="排查记录列表" :visible.sync="open2" width="1200px" append-to-body> <el-dialog title="排查记录列表" :visible.sync="open2" width="1300px" append-to-body>
<el-row :gutter="24" > <el-row :gutter="24" >
<el-col :span="6"> <el-col :span="7">
<div class="div-left"> <div class="div-left">
<div style="font-size: 22px;text-align: center;padding: 10px 0 0 0;">任务信息</div> <div style="font-size: 22px;text-align: center;padding: 10px 0 0 0;">任务信息</div>
<el-form label-width="80px" style="padding: 15px 0 0 0;width: 95%"> <el-form label-width="80px" style="padding: 15px 0 0 0;width: 95%">
...@@ -277,9 +284,9 @@ ...@@ -277,9 +284,9 @@
<el-form-item label="任务名称:" style="margin-bottom: 10px"> <el-form-item label="任务名称:" style="margin-bottom: 10px">
<span>{{workInfo.workName}}</span> <span>{{workInfo.workName}}</span>
</el-form-item> </el-form-item>
<el-form-item label="关联隐患:" style="margin-bottom: 10px"> <!--<el-form-item label="关联隐患:" style="margin-bottom: 10px">-->
<span>{{workInfo.troubleName}}</span> <!--<span>{{workInfo.troubleName}}</span>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="任务周期:" style="margin-bottom: 10px"> <el-form-item label="任务周期:" style="margin-bottom: 10px">
<span>{{workInfo.workCycle}}</span> <span>{{workInfo.workCycle}}</span>
</el-form-item> </el-form-item>
...@@ -305,15 +312,22 @@ ...@@ -305,15 +312,22 @@
</el-form-item> </el-form-item>
<el-form-item label="排查内容" prop="content"> <el-form-item label="排查内容" prop="content">
<dl v-html="workInfo.content"> <!--<dl v-html="workInfo.content">-->
{{workInfo.content}} <!--{{workInfo.riskList}}-->
</dl> <!--</dl>-->
<!--<editor v-model="workInfo.content" :min-height="200"/>--> <!--<editor v-model="workInfo.content" :min-height="200"/>-->
</el-form-item> </el-form-item>
<div style="width: 100%;margin-top: -20px">
<div style="width: 90%;margin-left: 8%;margin-top: 10px" v-for="item in workInfo.riskList">
{{item.riskControl}}
</div>
</div>
</el-form> </el-form>
</div> </div>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="17">
<el-table v-loading="loading" :data="childrenList" height="535px" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="childrenList" height="535px" @selection-change="handleSelectionChange">
<el-table-column label="任务名称" align="center" prop="workName" /> <el-table-column label="任务名称" align="center" prop="workName" />
<el-table-column label="排查开始时间" align="center" prop="workBeginTime" width="180"> <el-table-column label="排查开始时间" align="center" prop="workBeginTime" width="180">
...@@ -632,7 +646,7 @@ export default { ...@@ -632,7 +646,7 @@ export default {
created() { created() {
this.getList(); this.getList();
this.getDeptList(); this.getDeptList();
this.selectUserList(); //this.selectUserList();
this.getBookList(); this.getBookList();
this.getDicts("work_type").then(response => { this.getDicts("work_type").then(response => {
this.workCycleOptions = response.data; this.workCycleOptions = response.data;
...@@ -646,9 +660,7 @@ export default { ...@@ -646,9 +660,7 @@ export default {
this.getDicts("assessment_level").then(response => { this.getDicts("assessment_level").then(response => {
this.assessmentLevelOptions = response.data; this.assessmentLevelOptions = response.data;
}); });
listLibrary({pageNum:1,pageSize:1000}).then(response => {
this.libraryList = response.rows;
});
}, },
methods: { methods: {
/** 查询隐患排查任务列表 */ /** 查询隐患排查任务列表 */
...@@ -746,15 +758,23 @@ export default { ...@@ -746,15 +758,23 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
var turnNum = function(nums){
return nums.map(Number);
}
const workId = row.workId || this.ids const workId = row.workId || this.ids
getWorkCheck(workId).then(response => { getWorkCheck(workId).then(response => {
response.data.libraryId = turnNum(response.data.content.split(","));
this.form = response.data; this.form = response.data;
// this.form.libraryId = [11] //= turnNum(this.form.content.split(","));
console.log(this.form)
this.open = true; this.open = true;
this.title = "修改隐患排查任务"; this.title = "修改隐患排查任务";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
console.log(this.form.libraryId);
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.form.content = this.form.libraryId.toString(); this.form.content = this.form.libraryId.toString();
...@@ -837,11 +857,15 @@ export default { ...@@ -837,11 +857,15 @@ export default {
}); });
}, },
// 查询用户列表 // 查询用户列表
selectUserList(){ selectUserList(deptId){
listStaff({ pageNum: 1,pageSize: 99999}).then(response => { console.log(deptId);
listStaff({ pageNum: 1,pageSize: 99999,deptId:deptId}).then(response => {
console.log(response.rows); console.log(response.rows);
this.userList = response.rows; this.userList = response.rows;
}); });
listLibrary({pageNum:1,pageSize:10000,deptId:deptId}).then(response => {
this.libraryList = response.rows;
});
}, },
selectLibrary(val){ selectLibrary(val){
for(var i=0;i<this.libraryList.length;i++){ for(var i=0;i<this.libraryList.length;i++){
...@@ -895,9 +919,10 @@ export default { ...@@ -895,9 +919,10 @@ export default {
min-height: 500px; min-height: 500px;
} }
.div-left{ .div-left{
min-height: 530px; height: 530px;
border-radius: 10px; border-radius: 10px;
background: white; background: white;
overflow-y: auto;
} }
dl{ dl{
......
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