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