Commit d03ed31e authored by 罗新东's avatar 罗新东

隐患整改添加标签,登录后页面跳转消息中心页面,隐患历史台账字段修改

parent cb258321
Pipeline #7447 passed with stage
in 15 seconds
<template> <template>
<div> <div>
<!-- 占位导航栏div,防止导航栏挡住内容 --> <!-- 占位导航栏div,防止导航栏挡住内容 -->
<div style="width:100%;height:2rem"></div> <van-tabbar v-model="active" @change="onChange" route>
<van-tabbar v-model="active" @change="onChange"> <van-tabbar-item
<van-tabbar-item v-for="(item, index) in tabBarList"
v-for="(item,index) in tabBarList" :key="index"
:key="index" :icon="active == item.name ? item.imgUrlActive : item.imgUrl"
:icon="active==item.name?item.imgUrlActive: item.imgUrl" >{{ item.text }}</van-tabbar-item
>{{ item.text }}</van-tabbar-item >
> </van-tabbar>
</van-tabbar> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
props:{ data() {
index: { return {
type: Number, active: 0,
default: 0 tabBarList: [
{
key: "1",
name: "0",
imgUrl: require("@/assets/tabBar/new.png"),
imgUrlActive: require("@/assets/tabBar/new-active.png"),
path: "/message-center",
text: "消息中心",
},
{
key: "2",
name: "1",
imgUrl: require("@/assets/tabBar/workbench.png"),
imgUrlActive: require("@/assets/tabBar/workbench-active.png"),
path: "/save-workbench",
text: "安全工作台",
},
{
key: "3",
name: "2",
imgUrl: require("@/assets/tabBar/my.png"),
imgUrlActive: require("@/assets/tabBar/my-active.png"),
path: "/my",
text: "我的地盘",
},
],
};
}, },
}, methods: {
onChange(index) {
data() { if (this.active == index) {
return { this.tabBarList.forEach((item) => {
active: "0", if (item.name == this.active) {
tabBarList: [ this.$router.push(item.path);
{ }
key: "1", });
name:'0', }
imgUrl: require("@/assets/tabBar/new.png"),
imgUrlActive: require("@/assets/tabBar/new-active.png"),
path: "/message-center",
text: "消息中心"
}, },
{ },
key: "2",
name:'1',
imgUrl: require("@/assets/tabBar/workbench.png"),
imgUrlActive: require("@/assets/tabBar/workbench-active.png"),
path: "/save-workbench",
text: "安全工作台"
},
{
key: "3",
name:'2',
imgUrl: require("@/assets/tabBar/my.png"),
imgUrlActive: require("@/assets/tabBar/my-active.png"),
path: "/my",
text: "我的地盘"
}
]
};
},
mounted() {
this.active = this.index
},
methods: {
onChange(index) {
this.active = index;
if(this.active==index){
this.tabBarList.forEach((item)=>{
if(item.name==this.active){
this.$router.push(item.path)
}
})
}else{
}
}
}
}; };
</script> </script>
<style scoped> \ No newline at end of file
/* @import url(); 引入css类 */
</style>
...@@ -12,7 +12,7 @@ router.beforeEach(async(to, from, next) => { ...@@ -12,7 +12,7 @@ router.beforeEach(async(to, from, next) => {
const hasToken = getToken()//确定用户是否已登录 const hasToken = getToken()//确定用户是否已登录
if (hasToken) { if (hasToken) {
if (to.path === '/login2') { if (to.path === '/login2') {
next({ path: '/save-workbench' }) next({ path: '/message-center' })
} else { } else {
next() next()
} }
......
...@@ -445,7 +445,7 @@ const routes = [{ ...@@ -445,7 +445,7 @@ const routes = [{
path: '/stand-book', path: '/stand-book',
name: 'stand-book', name: 'stand-book',
meta: { meta: {
title: '隐患历史台账', title: '隐患台账',
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'),
...@@ -656,6 +656,15 @@ const routes = [{ ...@@ -656,6 +656,15 @@ const routes = [{
}, },
component: () => import('@/views/risk/riskAdd/matrixGrad/index') component: () => import('@/views/risk/riskAdd/matrixGrad/index')
}, },
{
path: '/finish-delay-detail',
name: 'finish-delay-detail',
meta: {
title: '审批详情',
index: 1
},
component: () => import('@/views/danger/changeDanger/finishDelayDetail')
},
// matrix-grad // matrix-grad
] ]
......
...@@ -166,7 +166,7 @@ export function dangerReviewAdd(url, data) { ...@@ -166,7 +166,7 @@ export function dangerReviewAdd(url, data) {
}) })
} }
// 隐患历史台账模块 // 隐患台账模块
export function dangerStandBook(url, data) { export function dangerStandBook(url, data) {
return request({ return request({
url: url, url: url,
......
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
setUserInfo(userInfo) setUserInfo(userInfo)
}) })
setToken(Response.data) setToken(Response.data)
this.$router.push('/save-workbench') this.$router.push('/message-center')
}else if(Response.code==301){ }else if(Response.code==301){
this.$toast.clear() this.$toast.clear()
this.$toast.fail({ this.$toast.fail({
......
<template>
<div>
<LHeader :text="$route.meta.title"></LHeader>
<!-- 内容列表 -->
<div class="con-list">
<div class="cell-wrap">
<!-- <p>隐患上报</p> -->
<van-cell-group inset>
<van-row gutter="">
<van-col span="7"
><span class="field-title"
>隐患单编号:</span
></van-col
>
<van-col span="17">{{ data.pid }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title"
>延期时间:</span
></van-col
>
<van-col span="17">{{ data.applyDate }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title"
>延期理由:</span
></van-col
>
<van-col span="17">{{ data.applyReason }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title"
>审批结果:</span
></van-col
>
<van-col span="17">{{ data.examineResult==0?'退回':(data.examineResult==1?'通过':'待审批') }}</van-col>
</van-row>
<van-row gutter="" v-if="data.examineResult ">
<van-col span="7"
><span class="field-title"
>审批理由:</span
></van-col
>
<van-col span="17">{{ data.examineResult }}</van-col>
</van-row>
<!-- examineResult -->
</van-cell-group>
<van-cell-group>
<van-button plain type="info" block @click="$router.back()" color="#2980F7">返回列表</van-button>
</van-cell-group>
</div>
</div>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js";
export default {
components: {
LHeader,
},
data() {
return {
id: 0,
data: {},
};
},
created() {
this.id = this.$route.params.id;
this.getDetail();
},
methods: {
getDetail() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFun("/delayApply/delayDetails/" + this.id)
.then((res) => {
this.$toast.clear();
this.data = res.data.delayApply;
})
.catch((err) => {
console.log(err);
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
},
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
.con-list {
padding: 10px 10px 0.533333rem;
background-color: #f0f1f5;
.cell-wrap {
position: relative;
}
p {
font-size: 0.4rem;
font-weight: none;
padding-left: 0.16rem;
margin: 0.186667rem 0;
color: #7f7f7f;
}
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.van-row {
margin-bottom: 0.133333rem;
line-height: 0.64rem;
}
}
.confirm-wrap {
position: relative;
}
.journal-wrap {
position: relative;
}
.supervise-wrap {
position: relative;
}
.info-title {
color: #2980f7;
font-weight: none;
}
.field-title {
color: black;
font-weight: none;
}
}
</style>
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患单编号:</van-col> <van-col span="7">隐患单编号:</van-col>
<van-col span="17"> <van-col span="17">
{{ item.businessId || item.id }} {{ item.businessId || item.pid }}
</van-col> </van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">所属项目:</van-col> <van-col span="7">所属项目:</van-col>
<van-col span="17">{{ item.proId }}</van-col> <van-col span="17">{{ item.proId }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="" v-show="item.hdLev">
<van-col span="7">隐患级别:</van-col> <van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ <van-col span="17">{{
item.hdLev | dangerText item.hdLev | dangerText
...@@ -71,11 +71,10 @@ ...@@ -71,11 +71,10 @@
}}</van-col> }}</van-col>
</van-row> </van-row>
<van-row gutter="" v-if="item.taskName"> <van-row gutter="" v-if="item.taskName">
<van-col span="7">工单状态:</van-col> <van-col span="7">工单状态:</van-col>
<van-col span="17">{{ item.taskName }}</van-col> <van-col span="17">{{ item.taskName }}</van-col>
</van-row> </van-row>
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
...@@ -89,16 +88,17 @@ ...@@ -89,16 +88,17 @@
round round
type="info" type="info"
@click="goConfirm(item)" @click="goConfirm(item)"
v-if="active !== 2" v-if="active == 0 || active == 1"
>隐患整改</van-button >隐患整改</van-button
> >
<van-button <van-button
round round
type="info" color="orange"
@click="goDelay(item)" @click="goDelay(item)"
v-if="active !== 2" v-if="active == 0 || active == 1"
>申请延期</van-button
> >
<span style="color: black"> 申请延期</span>
</van-button>
<!-- <van-button round type="warning " @click="goClose(item)" <!-- <van-button round type="warning " @click="goClose(item)"
>关闭</van-button >关闭</van-button
> --> > -->
...@@ -153,6 +153,10 @@ export default { ...@@ -153,6 +153,10 @@ export default {
title: "已整改", title: "已整改",
api: "/rectification/finishList", api: "/rectification/finishList",
}, },
{
title: "已延期",
api: "/rectification/finishDelayList",
},
], ],
}; };
}, },
...@@ -220,57 +224,6 @@ export default { ...@@ -220,57 +224,6 @@ export default {
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
}, },
// onClickTab(val, select = "") {
// this.showIndex = null;
// this.$toast.loading({
// message: "加载中...",
// forbidClick: true,
// loadingType: "spinner",
// duration: 0,
// });
// // 这里根据tab切换调用接口
// let formdata = new FormData();
// formdata.append("select", select);
// [list1, list2]
// [val](formdata)
// .then((res) => {
// console.log(res.rows);
// this.$toast.clear();
// this.messageList = res.rows;
// // 判断有无数据返回
// // if (this.messageList.length == 0) {
// // this.isHaveNews = true;
// // }
// })
// .catch(() => {
// this.$toast.clear();
// this.$toast.fail("加载失败,请稍后再试");
// });
// },
// 此接口暂时废弃
// postList() {
// this.$toast.loading({
// message: "加载中...",
// forbidClick: true,
// loadingType: "spinner",
// duration: 0,
// });
// dangerRect("/rectification/list")
// .then((res) => {
// this.$toast.clear();
// this.messageList = res.rows;
// // 判断有无数据返回
// if (this.messageList.length == 0) {
// this.isHaveNews = true;
// }
// })
// .catch(() => {
// this.$toast.clear();
// this.$toast.fail("加载失败,请稍后再试");
// });
// },
touchstart(index, item) { touchstart(index, item) {
if (this.showIndex != null) { if (this.showIndex != null) {
...@@ -282,10 +235,12 @@ export default { ...@@ -282,10 +235,12 @@ export default {
// 详情 // 详情
goDetail(data) { goDetail(data) {
let name =
this.active == 3 ? "finish-delay-detail" : "normal-detail";
this.$router.push({ this.$router.push({
name: "normal-detail", name,
params: { params: {
id: data.taskId||data.id, id: data.taskId || data.id,
}, },
}); });
this.showIndex = null; this.showIndex = null;
......
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患单编号:</van-col> <van-col span="7">隐患单编号:</van-col>
<van-col span="17">{{ item.businessId }}</van-col> <van-col span="17">{{ item.businessId||item.id }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">所属项目:</van-col> <van-col span="7">所属项目:</van-col>
<van-col span="17">{{ item.proId }}</van-col> <van-col span="17">{{ item.proId }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患级别:</van-col> <van-col span="7" v-if="item.hdLev">隐患级别:</van-col>
<van-col span="17">{{ <van-col span="17">{{
item.hdLev | dangerText item.hdLev | dangerText
}}</van-col> }}</van-col>
...@@ -95,6 +95,19 @@ ...@@ -95,6 +95,19 @@
</template> </template>
</van-cell-group> </van-cell-group>
</div> </div>
<!-- 暂无数据 -->
<div
style="
width: 100%;
text-align: center;
font-size: 0.48rem;
position: fixed;
top: 30%;
"
v-if="messageList.length == 0"
>
暂无数据
</div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
...@@ -148,13 +161,14 @@ export default { ...@@ -148,13 +161,14 @@ export default {
postFun(this.tabs[this.active]["api"], formdata) postFun(this.tabs[this.active]["api"], formdata)
.then((res) => { .then((res) => {
this.$toast.clear(); this.$toast.clear();
this.messageList = res.rows; this.messageList = res.rows||res.data;
// 判断有无数据返回 // 判断有无数据返回
if (this.messageList.length == 0) { if (this.messageList.length == 0) {
this.isHaveNews = true; this.isHaveNews = true;
} }
}) })
.catch(() => { .catch((err) => {
console.log(err)
this.$toast.clear(); this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
...@@ -173,10 +187,11 @@ export default { ...@@ -173,10 +187,11 @@ export default {
// 详情 // 详情
goDetail(data) { goDetail(data) {
let name = this.active==1?'finish-delay-detail':'normal-detail'
this.$router.push({ this.$router.push({
name: "normal-detail", name,
params: { params: {
id: data.businessId, id: data.businessId||data.id,
}, },
}); });
this.showIndex = null; this.showIndex = null;
...@@ -229,4 +244,10 @@ export default { ...@@ -229,4 +244,10 @@ export default {
} }
} }
} }
/deep/.van-tab__pane-wrapper {
min-height: 8rem;
}
.van-tabs__track {
min-height: 3rem;
}
</style> </style>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<van-row gutter=""> <van-row gutter="">
<van-col span="7">工单状态</van-col> <van-col span="7">工单状态</van-col>
<van-col span="17">{{ <van-col span="17">{{
item | formatTime item.taskName
}}</van-col> }}</van-col>
</van-row> </van-row>
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
}, },
data() { data() {
return { return {
text: "隐患历史台账", text: "隐患台账",
active: 0, active: 0,
searchValue: "", searchValue: "",
isHaveNews: false, isHaveNews: false,
......
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