Loading src/views/danger/addDanger/addDanger.vue +11 −7 Original line number Original line Diff line number Diff line Loading @@ -288,7 +288,7 @@ export default { LHeader, LHeader, }, }, activated(){ activated(){ this.taskId = this.$route.params.taskId; this.taskId = this.$route.params.taskId || localStorage.getItem('dangerAddTaskId'); console.log(this.taskId ); console.log(this.taskId ); if (this.taskId) { if (this.taskId) { this.isShowreturnCause = true; this.isShowreturnCause = true; Loading @@ -296,9 +296,13 @@ export default { this.postReturnEcho(); this.postReturnEcho(); } } this.getList(); this.getList(); }, mounted() { this.$bus.$on("sourceAyy", res => { this.$bus.$on("sourceAyy", res => { this.source1 = res.join(","); this.source1 = res.join(","); // 销毁一下监听事件 不然会越加越多 this.$bus.$off('riskLevelBus') }); }); }, }, beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) { Loading Loading @@ -340,6 +344,8 @@ export default { this.isShowreturnCause = false; this.isShowreturnCause = false; this.returnCause = ""; // 退回原因 this.returnCause = ""; // 退回原因 this.currentDate = new Date() this.currentDate = new Date() // 清空 localStorage localStorage.removeItem('dangerAddTaskId') } } next(); next(); }, }, Loading Loading @@ -385,13 +391,10 @@ export default { currentDate : new Date() currentDate : new Date() }; }; }, }, created() { }, methods: { methods: { onSubmit(values) { onSubmit(values) { let formdata = new FormData(); let formdata = new FormData(); formdata.append("proId", this.projectId); formdata.append("proId", this.projectId); formdata.append("hdRange", values.hdRange); formdata.append("hdRange", values.hdRange); formdata.append("hdType", values.hdType); formdata.append("hdType", values.hdType); Loading Loading @@ -422,6 +425,7 @@ export default { if (this.taskId) { if (this.taskId) { url = `/hdreport/editSave/${this.taskId}`; url = `/hdreport/editSave/${this.taskId}`; } } console.log(url); postHdReportAdd(url, formdata) postHdReportAdd(url, formdata) .then((res) => { .then((res) => { Loading src/views/danger/reportReturn/index.vue +3 −1 Original line number Original line Diff line number Diff line Loading @@ -111,7 +111,7 @@ export default { this.showIndex = index; this.showIndex = index; }, }, // 提交 // 上报 goSubmit(data) { goSubmit(data) { this.$router.push({ this.$router.push({ name: "add-danger", name: "add-danger", Loading @@ -120,6 +120,8 @@ export default { taskId: data.taskId taskId: data.taskId } } }); }); // 存到缓存里 如果路由跳转或者是缓存中有 就是隐患上报退回 localStorage.setItem('dangerAddTaskId',data.taskId) this.showIndex = null; this.showIndex = null; }, }, // 删除 // 删除 Loading src/views/risk/riskAdd/index.vue +2 −2 Original line number Original line Diff line number Diff line Loading @@ -323,7 +323,7 @@ export default { this.setRank = "" this.setRank = "" } } // 销毁一下监听事件 不然会越加越多 // 销毁一下监听事件 不然会越加越多 this.$bus.$off('riskLevelBus', this.myhandle) this.$bus.$off('riskLevelBus') }); }); }, }, beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) { Loading Loading @@ -480,7 +480,6 @@ export default { formdata.append("id", this.id); formdata.append("id", this.id); url = `/riskMain/editSave/${this.taskId}`; url = `/riskMain/editSave/${this.taskId}`; } } postReAdd(url, formdata) postReAdd(url, formdata) .then(res => { .then(res => { this.$toast.clear(); this.$toast.clear(); Loading @@ -494,6 +493,7 @@ export default { this.$toast.clear(); this.$toast.clear(); this.$toast.fail("提交失败,请稍后再试"); this.$toast.fail("提交失败,请稍后再试"); }); }); this.$toast.clear(); }, }, // 请求表单数据 // 请求表单数据 Loading src/views/risk/riskReturn/index.vue +3 −1 Original line number Original line Diff line number Diff line Loading @@ -8,7 +8,7 @@ inset inset v-for="(item, index) in messageList" v-for="(item, index) in messageList" :key="index" :key="index" @change="touchstart(index, item)" @click="touchstart(index, item)" > > <van-row gutter=""> <van-row gutter=""> <van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col> Loading Loading @@ -131,6 +131,8 @@ export default { taskId: data.taskId taskId: data.taskId } } }); }); // 存到缓存里 如果路由跳转或者是缓存中有 就是隐患上报退回 localStorage.setItem('riskAddTaskId',data.taskId) this.showIndex = null; this.showIndex = null; }, }, // 删除 // 删除 Loading Loading
src/views/danger/addDanger/addDanger.vue +11 −7 Original line number Original line Diff line number Diff line Loading @@ -288,7 +288,7 @@ export default { LHeader, LHeader, }, }, activated(){ activated(){ this.taskId = this.$route.params.taskId; this.taskId = this.$route.params.taskId || localStorage.getItem('dangerAddTaskId'); console.log(this.taskId ); console.log(this.taskId ); if (this.taskId) { if (this.taskId) { this.isShowreturnCause = true; this.isShowreturnCause = true; Loading @@ -296,9 +296,13 @@ export default { this.postReturnEcho(); this.postReturnEcho(); } } this.getList(); this.getList(); }, mounted() { this.$bus.$on("sourceAyy", res => { this.$bus.$on("sourceAyy", res => { this.source1 = res.join(","); this.source1 = res.join(","); // 销毁一下监听事件 不然会越加越多 this.$bus.$off('riskLevelBus') }); }); }, }, beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) { Loading Loading @@ -340,6 +344,8 @@ export default { this.isShowreturnCause = false; this.isShowreturnCause = false; this.returnCause = ""; // 退回原因 this.returnCause = ""; // 退回原因 this.currentDate = new Date() this.currentDate = new Date() // 清空 localStorage localStorage.removeItem('dangerAddTaskId') } } next(); next(); }, }, Loading Loading @@ -385,13 +391,10 @@ export default { currentDate : new Date() currentDate : new Date() }; }; }, }, created() { }, methods: { methods: { onSubmit(values) { onSubmit(values) { let formdata = new FormData(); let formdata = new FormData(); formdata.append("proId", this.projectId); formdata.append("proId", this.projectId); formdata.append("hdRange", values.hdRange); formdata.append("hdRange", values.hdRange); formdata.append("hdType", values.hdType); formdata.append("hdType", values.hdType); Loading Loading @@ -422,6 +425,7 @@ export default { if (this.taskId) { if (this.taskId) { url = `/hdreport/editSave/${this.taskId}`; url = `/hdreport/editSave/${this.taskId}`; } } console.log(url); postHdReportAdd(url, formdata) postHdReportAdd(url, formdata) .then((res) => { .then((res) => { Loading
src/views/danger/reportReturn/index.vue +3 −1 Original line number Original line Diff line number Diff line Loading @@ -111,7 +111,7 @@ export default { this.showIndex = index; this.showIndex = index; }, }, // 提交 // 上报 goSubmit(data) { goSubmit(data) { this.$router.push({ this.$router.push({ name: "add-danger", name: "add-danger", Loading @@ -120,6 +120,8 @@ export default { taskId: data.taskId taskId: data.taskId } } }); }); // 存到缓存里 如果路由跳转或者是缓存中有 就是隐患上报退回 localStorage.setItem('dangerAddTaskId',data.taskId) this.showIndex = null; this.showIndex = null; }, }, // 删除 // 删除 Loading
src/views/risk/riskAdd/index.vue +2 −2 Original line number Original line Diff line number Diff line Loading @@ -323,7 +323,7 @@ export default { this.setRank = "" this.setRank = "" } } // 销毁一下监听事件 不然会越加越多 // 销毁一下监听事件 不然会越加越多 this.$bus.$off('riskLevelBus', this.myhandle) this.$bus.$off('riskLevelBus') }); }); }, }, beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) { Loading Loading @@ -480,7 +480,6 @@ export default { formdata.append("id", this.id); formdata.append("id", this.id); url = `/riskMain/editSave/${this.taskId}`; url = `/riskMain/editSave/${this.taskId}`; } } postReAdd(url, formdata) postReAdd(url, formdata) .then(res => { .then(res => { this.$toast.clear(); this.$toast.clear(); Loading @@ -494,6 +493,7 @@ export default { this.$toast.clear(); this.$toast.clear(); this.$toast.fail("提交失败,请稍后再试"); this.$toast.fail("提交失败,请稍后再试"); }); }); this.$toast.clear(); }, }, // 请求表单数据 // 请求表单数据 Loading
src/views/risk/riskReturn/index.vue +3 −1 Original line number Original line Diff line number Diff line Loading @@ -8,7 +8,7 @@ inset inset v-for="(item, index) in messageList" v-for="(item, index) in messageList" :key="index" :key="index" @change="touchstart(index, item)" @click="touchstart(index, item)" > > <van-row gutter=""> <van-row gutter=""> <van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col> Loading Loading @@ -131,6 +131,8 @@ export default { taskId: data.taskId taskId: data.taskId } } }); }); // 存到缓存里 如果路由跳转或者是缓存中有 就是隐患上报退回 localStorage.setItem('riskAddTaskId',data.taskId) this.showIndex = null; this.showIndex = null; }, }, // 删除 // 删除 Loading