Commit 5fd444aa authored by 13841799530's avatar 13841799530

新增隐患联动回显功能

解润东
20220510
parent 7e30b74e
Pipeline #8295 passed with stage
in 5 minutes and 2 seconds
......@@ -379,16 +379,33 @@ export default {
this.$route.params.taskId ||
localStorage.getItem("dangerAddTaskId");
console.log(this.taskId);
if (this.taskId) {
this.isShowreturnCause = true;
this.text = "隐患上报退回";
this.postReturnEcho();
}
this.proId=this.$route.query.proId,
this.hdRange=this.$route.query.hdRange,
this.hdType=this.$route.query.hdType,
this.hdName=this.$route.query.hdName,
this.hdId=this.$route.query.hdId,
this.hdLev=this.$route.query.hdLev
this.getList();
//隐患巡查跳转回显
if(this.hdType){
this.onConRange(this.hdRange)
}
if(this.hdName){
this.onConType(this.hdType)
this.onConDangerName(this.hdName)
}
},
mounted() {
if(this.$route.query.patrolId){this.patrolId=this.$route.query.patrolId}
this.$bus.$on("sourceAyy", (res) => {
setTimeout(() => {
this.source1 = res.join(",");
......@@ -445,7 +462,12 @@ export default {
return {
// 视频预览地址
videoUrl: "",
proId:"",
hdRange:"",
hdType:"",
hdName:"",
hdId:"",
hdLev:"",
id: 0,
text: "新增隐患",
taskId: "",
......@@ -618,7 +640,22 @@ export default {
.then((res) => {
this.$toast.clear();
this.columnsProjectName = res.data.projectInformations;
if(this.proId){
this.columnsProjectName.forEach((i)=>{
if(this.proId==i.id){
this.projectName=i.projectName
}
})
}
this.columnsRange = res.data.hdInventories;
if(this.hdRange){
this.columnsRange.forEach((i)=>{
if(this.hdRange==i.hdRange){
this.range=i.hdRange
}
})
}
this.columnsSource = res.data.factors;
})
.catch(() => {
......@@ -696,6 +733,7 @@ export default {
// 所属项目
onConProjectName(value) {
console.log(value)
if (!value) {
this.showProjectName = false;
return;
......@@ -717,6 +755,9 @@ export default {
return;
}
this.range = value.hdRange;
if(!value.hdRange){
this.range=value
}
this.showRange = false;
this.type = "";
this.dangerName = "";
......@@ -725,6 +766,13 @@ export default {
// 去请求隐患类型的数据
postHdTyp(`/hdreport/showHdType/${this.range}`).then((res) => {
this.columnsType = res.data;
if(this.hdType){
this.columnsType.forEach((i)=>{
if(this.hdType==i.hdType){
this.type=i.hdType
}
})
}
});
},
// 隐患类型
......@@ -734,6 +782,9 @@ export default {
return;
}
this.type = value.hdType;
if(!value.hdType){
this.type=value
}
this.showType = false;
this.dangerName = "";
this.dangerNum = "";
......@@ -742,6 +793,13 @@ export default {
postHdName(`/hdreport/showHdName/${this.range}/${this.type}`).then(
(res) => {
this.columnsDangerName = res.data;
if(this.hdName){
this.columnsDangerName.forEach((i)=>{
if(this.hdName==i.hdName){
this.dangerName=i.hdName
}
})
}
}
);
},
......@@ -752,6 +810,9 @@ export default {
return;
}
this.dangerName = value.hdName;
if(!value.hdName){
this.dangerName=value
}
this.showDangerName = false;
// 请求隐患单编号和隐患级别
postHdInventories(
......
......@@ -102,10 +102,11 @@ export default {
})
},
onClick(val) {
console.log(val)
this.$router.push({
name: "implement",
query:{
id:val.title
id:val.title,
}
});
}
......
......@@ -93,6 +93,7 @@ export default {
messageList: [],
active: 0,
hdType:'',
cycle:'',
tabs: [
// {
// title: "安全管理类",
......@@ -115,6 +116,9 @@ export default {
if (this.$route.query.id) {
this.id = this.$route.query.id;
}
if (this.$route.query.cycle) {
this.cycle = this.$route.query.cycle;
}
this.loadingTabs()
},
methods: {
......@@ -123,7 +127,7 @@ export default {
this.postList()
},
loadingTabs(){
postWork("patrol/running/hdType").then(res => {
postWork("patrol/running/hdType",{cycle:this.id}).then(res => {
this.hdType=res.data[0].hdType
res.data.forEach((i)=>{
this.tabs.push({
......@@ -168,6 +172,7 @@ export default {
if(val == 1){
return
}
console.log(item)
// 如果不合格跳转到隐患上报页面
this.$dialog
.confirm({
......@@ -178,7 +183,13 @@ export default {
this.$router.push({
name: "add-danger",
query:{
patrolId:item.patrolId
patrolId:item.patrolId,
proId:item.proId,
hdRange:item.hdRange,
hdType:item.hdType,
hdName:item.hdName,
hdId:item.hdId,
hdLev:item.hdLev,
}
});
})
......@@ -193,10 +204,10 @@ export default {
loadingType: "spinner",
duration: 0
});
let obj2 = {
cycle: this.id
};
postWork("patrol/running/save", obj2)
// let obj2 = {
// cycle: this.id
// };
postWork("patrol/running/save?cycle="+this.id)
.then(res => {
this.$toast.clear();
this.$toast.success({
......
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