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

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

parent cb258321
Pipeline #7447 passed with stage
in 15 seconds
<template>
<div>
<!-- 占位导航栏div,防止导航栏挡住内容 -->
<div style="width:100%;height:2rem"></div>
<van-tabbar v-model="active" @change="onChange">
<van-tabbar-item
v-for="(item,index) in tabBarList"
:key="index"
:icon="active==item.name?item.imgUrlActive: item.imgUrl"
>{{ item.text }}</van-tabbar-item
>
</van-tabbar>
</div>
<div>
<!-- 占位导航栏div,防止导航栏挡住内容 -->
<van-tabbar v-model="active" @change="onChange" route>
<van-tabbar-item
v-for="(item, index) in tabBarList"
:key="index"
:icon="active == item.name ? item.imgUrlActive : item.imgUrl"
>{{ item.text }}</van-tabbar-item
>
</van-tabbar>
</div>
</template>
<script>
export default {
props:{
index: {
type: Number,
default: 0
data() {
return {
active: 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: "我的地盘",
},
],
};
},
},
data() {
return {
active: "0",
tabBarList: [
{
key: "1",
name:'0',
imgUrl: require("@/assets/tabBar/new.png"),
imgUrlActive: require("@/assets/tabBar/new-active.png"),
path: "/message-center",
text: "消息中心"
methods: {
onChange(index) {
if (this.active == index) {
this.tabBarList.forEach((item) => {
if (item.name == this.active) {
this.$router.push(item.path);
}
});
}
},
{
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>
<style scoped>
/* @import url(); 引入css类 */
</style>
</script>
\ No newline at end of file
......@@ -12,7 +12,7 @@ router.beforeEach(async(to, from, next) => {
const hasToken = getToken()//确定用户是否已登录
if (hasToken) {
if (to.path === '/login2') {
next({ path: '/save-workbench' })
next({ path: '/message-center' })
} else {
next()
}
......
......@@ -445,7 +445,7 @@ const routes = [{
path: '/stand-book',
name: 'stand-book',
meta: {
title: '隐患历史台账',
title: '隐患台账',
index: 1
},
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'),
......@@ -656,6 +656,15 @@ const routes = [{
},
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
]
......
......@@ -166,7 +166,7 @@ export function dangerReviewAdd(url, data) {
})
}
// 隐患历史台账模块
// 隐患台账模块
export function dangerStandBook(url, data) {
return request({
url: url,
......
......@@ -85,7 +85,7 @@ export default {
setUserInfo(userInfo)
})
setToken(Response.data)
this.$router.push('/save-workbench')
this.$router.push('/message-center')
}else if(Response.code==301){
this.$toast.clear()
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 @@
<van-row gutter="">
<van-col span="7">隐患单编号:</van-col>
<van-col span="17">
{{ item.businessId || item.id }}
{{ item.businessId || item.pid }}
</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">所属项目:</van-col>
<van-col span="17">{{ item.proId }}</van-col>
</van-row>
<van-row gutter="">
<van-row gutter="" v-show="item.hdLev">
<van-col span="7">隐患级别:</van-col>
<van-col span="17">{{
item.hdLev | dangerText
......@@ -71,11 +71,10 @@
}}</van-col>
</van-row>
<van-row gutter="" v-if="item.taskName">
<van-col span="7">工单状态:</van-col>
<van-col span="17">{{ item.taskName }}</van-col>
<van-col span="7">工单状态:</van-col>
<van-col span="17">{{ item.taskName }}</van-col>
</van-row>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null">
......@@ -89,16 +88,17 @@
round
type="info"
@click="goConfirm(item)"
v-if="active !== 2"
v-if="active == 0 || active == 1"
>隐患整改</van-button
>
<van-button
round
type="info"
color="orange"
@click="goDelay(item)"
v-if="active !== 2"
>申请延期</van-button
v-if="active == 0 || active == 1"
>
<span style="color: black"> 申请延期</span>
</van-button>
<!-- <van-button round type="warning " @click="goClose(item)"
>关闭</van-button
> -->
......@@ -153,6 +153,10 @@ export default {
title: "已整改",
api: "/rectification/finishList",
},
{
title: "已延期",
api: "/rectification/finishDelayList",
},
],
};
},
......@@ -220,57 +224,6 @@ export default {
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) {
if (this.showIndex != null) {
......@@ -282,10 +235,12 @@ export default {
// 详情
goDetail(data) {
let name =
this.active == 3 ? "finish-delay-detail" : "normal-detail";
this.$router.push({
name: "normal-detail",
name,
params: {
id: data.taskId||data.id,
id: data.taskId || data.id,
},
});
this.showIndex = null;
......
......@@ -42,14 +42,14 @@
>
<van-row gutter="">
<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 gutter="">
<van-col span="7">所属项目:</van-col>
<van-col span="17">{{ item.proId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患级别:</van-col>
<van-col span="7" v-if="item.hdLev">隐患级别:</van-col>
<van-col span="17">{{
item.hdLev | dangerText
}}</van-col>
......@@ -95,6 +95,19 @@
</template>
</van-cell-group>
</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-tabs>
</div>
......@@ -148,13 +161,14 @@ export default {
postFun(this.tabs[this.active]["api"], formdata)
.then((res) => {
this.$toast.clear();
this.messageList = res.rows;
this.messageList = res.rows||res.data;
// 判断有无数据返回
if (this.messageList.length == 0) {
this.isHaveNews = true;
}
})
.catch(() => {
.catch((err) => {
console.log(err)
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
......@@ -173,10 +187,11 @@ export default {
// 详情
goDetail(data) {
let name = this.active==1?'finish-delay-detail':'normal-detail'
this.$router.push({
name: "normal-detail",
name,
params: {
id: data.businessId,
id: data.businessId||data.id,
},
});
this.showIndex = null;
......@@ -229,4 +244,10 @@ export default {
}
}
}
/deep/.van-tab__pane-wrapper {
min-height: 8rem;
}
.van-tabs__track {
min-height: 3rem;
}
</style>
......@@ -71,7 +71,7 @@
<van-row gutter="">
<van-col span="7">工单状态</van-col>
<van-col span="17">{{
item | formatTime
item.taskName
}}</van-col>
</van-row>
<!-- 长按显示遮罩层 -->
......@@ -118,7 +118,7 @@ export default {
},
data() {
return {
text: "隐患历史台账",
text: "隐患台账",
active: 0,
searchValue: "",
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