Commit c27c1d32 authored by 王李辉's avatar 王李辉

增加退回页面

parent 4fe88fcb
......@@ -253,24 +253,26 @@ const routes = [
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/my'),
},
{
path: '/danger',
name: 'danger',
path: '/add-danger',
name: 'add-danger',
meta: {
title:'隐患上报',
title:'新增隐患',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/addDanger'),
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/addDanger/addDanger'),
},
{
path: '/add-danger',
name: 'add-danger',
path: '/report-return',
name: 'report-return',
meta: {
title:'新增隐患',
title:'隐患上报已退回',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/addDanger/addDanger'),
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/reportReturn'),
},
{
path: '/confirme-danger',
name: 'confirme-danger',
......@@ -393,6 +395,17 @@ const routes = [
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAdd'),
},
{
path: '/risk-return',
name: 'risk-return',
meta: {
title:'风险上报',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskReturn'),
},
{
path: '/risk-confirme',
name: 'risk-confirme',
......
<template>
<div>
<LHeader :text="text"></LHeader>
<van-form
@submit="onSubmit"
:scroll-to-error="true"
:show-error='false'
:show-error="false"
validate-trigger="onSubmit"
>
<van-field
v-if="isShowreturnCause"
v-model="returnCause"
readonly
rows="1"
autosize=""
label="退回原因"
name="退回原因"
type="textarea"
/>
<van-field
readonly
clickable
......@@ -26,7 +39,6 @@
/>
</van-popup>
<van-field
readonly
clickable
......@@ -83,7 +95,7 @@
@cancel="showDangerName = false"
/>
</van-popup>
<van-field
v-model="dangerNum"
readonly
......@@ -119,7 +131,6 @@
/>
</van-popup>
<van-field
readonly
clickable
......@@ -159,7 +170,7 @@
</van-popup>
<van-field
v-model=" location"
v-model="location"
name="检查部位"
label="检查部位"
placeholder="请输入"
......@@ -242,7 +253,7 @@
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime } from '@/utils/format'
import { timestampToTime } from "@/utils/format";
export default {
components: {
LHeader
......@@ -261,19 +272,24 @@ export default {
columnsType: ["隐患类型1", "隐患类型2", "隐患类型3", "隐患类型4"],
dangerName: "", //隐患项目名称
showDangerName: false,
columnsDangerName: ["隐患项目名称1", "隐患项目名称2", "隐患项目名称3", "隐患项目名称4"],
dangerNum: "",//隐患项目编号
dangerLevel: "",//隐患项目级别
findTime: "",//隐患发现时间
columnsDangerName: [
"隐患项目名称1",
"隐患项目名称2",
"隐患项目名称3",
"隐患项目名称4"
],
dangerNum: "", //隐患项目编号
dangerLevel: "", //隐患项目级别
findTime: "", //隐患发现时间
showFindTime: false,
source: "",// 风险源
source: "", // 风险源
showSource: false,
columnsSource: ["人的因素", "物的因素", "环境因素", "管理因素"],
source1: "",// 风险源第二个字段
source1: "", // 风险源第二个字段
showSource1: false,
columnsSource1: ["人的因素", "物的因素", "环境因素", "管理因素"],
location: "", // 检查部位
describe: "",// 隐患描述
describe: "", // 隐患描述
uploaderImg: [], //图像上传
uploaderVideo: [], //视频上传
expireTime: "", // 隐患到期时间
......@@ -281,10 +297,18 @@ export default {
recPeople: "",
showRecPeople: false,
columnsRecPeople: ["张三", "李四", "王五"]
columnsRecPeople: ["张三", "李四", "王五"],
returnCause: "你这不行啊", // 退回原因
isShowreturnCause: false
};
},
mounted() {},
created() {
if (this.$route.query.status) {
this.isShowreturnCause = true;
this.text = "隐患上报退回"
}
},
methods: {
onSubmit(values) {
console.log("submit", values);
......@@ -311,7 +335,7 @@ export default {
},
// 隐患发现时间
onConFindTime(date) {
this.findTime = timestampToTime(date,'DT1',true)
this.findTime = timestampToTime(date, "DT1", true);
this.showFindTime = false;
},
// 风险源
......@@ -319,14 +343,14 @@ export default {
this.source = value;
this.showSource = false;
},
// 风险源第二个字段
// 风险源第二个字段
onConSource1(value) {
this.source1 = value;
this.showSource1 = false;
},
// 隐患到期时间
onConExpireTime(date) {
this.expireTime = timestampToTime(date,'DT1',true)
this.expireTime = timestampToTime(date, "DT1", true);
this.showExpireTime = false;
},
// 隐患整改人
......@@ -337,7 +361,7 @@ export default {
cancel() {
this.$router.go(-1);
},
}
}
};
</script>
......
<template>
<div>
<!-- 内容列表 -->
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="read(item)"
@touchstart="touchstart(index, item)"
@touchend.prevent="touchend(index)"
>
<div class="messgae-title">{{ item.noticeTitle }}</div>
<div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{
item.createUserName
}}{{ item.noticeTitle }}相关的待处理任务...
</div>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)"
>详情</van-button
>
<van-button round type="info" @touchstart="goDelete(item)"
>修改</van-button
>
</div>
</van-overlay>
</van-cell-group>
</div>
<!-- 加号 -->
<div class="add" @click="goAdd">+</div>
</div>
</template>
<script>
import { dangerReturn } from "@/service/danger";
export default {
data() {
return {
messageList: [
{
noticeTitle: "隐患上报消息",
upcomingUserName: "张某某",
createUserName: "李某某",
noticeTitle: "重要任务"
}
],
Loop: "", // 定时器
showIndex: null // 是否显示遮罩层
};
},
created() {
this.postList()
},
methods: {
// 请求已退回列表数据
postList(){
dangerReturn('hdreport/list').then(res =>{
if(res.code == 0){
console.log(res);
}
})
},
goAdd(){
this.$router.push('/add-danger');
},
read(){},
touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if(this.showIndex != null){
this.showIndex = null;
return
}
this.Loop = setTimeout(() => {
this.showIndex = index
},300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
},
// 详情
goDetail(data){
console.log(data);
this.showIndex = null
},
// 删除
goDelete(data){
console.log(data);
this.showIndex = null
},
}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
// 内容
.con-list {
padding: 10px 10px 0;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.message-content {
margin-top: 10px;
}
.van-overlay{
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
}
}
}
.add{
width: 1.333333rem;
height: 1.333333rem;
color: white;
font-weight: bold;
font-size: 1.48rem;
background-color: #02a7f0;
text-align: center;
line-height: 1.333333rem;
border-radius: 50%;
position: fixed;
right: .533333rem;
bottom: 1.866667rem;
}
</style>
......@@ -2,42 +2,22 @@
<div>
<LHeader :text="text"></LHeader>
<van-search v-model="searchValue" placeholder="搜索" @search="onSearch" />
<van-tabs
v-model="active"
color="#247df7"
title-inactive-colo="#d0d1d1"
title-active-color="#000000"
>
<van-tab title="待提交">
<wait-submit></wait-submit>
</van-tab>
<van-tab title="已提交">
<committed></committed>
</van-tab>
<van-tab title="已退回">
<returned></returned>
</van-tab>
</van-tabs>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import WaitSubmit from "./waitSubmit";
import Returned from "./returned";
import Committed from './committed';
export default {
components: {
LHeader: LHeader,
WaitSubmit,
Returned,
Committed
},
data() {
return {
text: "隐患上报",
active: "1",
text: "上报退回",
searchValue: ""
};
},
......
......@@ -10,12 +10,23 @@
@touchstart="touchstart(index, item)"
@touchend.prevent="touchend(index)"
>
<div class="messgae-title">{{ item.noticeTitle }}</div>
<div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{
item.createUserName
}}{{ item.noticeTitle }}相关的待处理任务...
</div>
<van-row gutter="">
<van-col span="7">所属工程名称:</van-col>
<van-col span="17">{{ item.project }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患项目名称:</van-col>
<van-col span="17">{{ item.subject }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患发现时间:</van-col>
<van-col span="17">{{ item.findTime }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ item.level }}</van-col>
</van-row>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
......@@ -23,16 +34,13 @@
<van-button round type="primary" @touchstart="goDetail(item)"
>详情</van-button
>
<van-button round type="info" @touchstart="goDelete(item)"
>修改</van-button
<van-button round type="warning" @touchstart="goDelete(item)"
>删除</van-button
>
</div>
</van-overlay>
</van-cell-group>
</div>
<!-- 加号 -->
<div class="add" @click="goAdd">+</div>
</div>
</template>
......@@ -42,10 +50,10 @@ export default {
return {
messageList: [
{
noticeTitle: "隐患上报消息",
upcomingUserName: "张某某",
createUserName: "李某某",
noticeTitle: "重要任务"
project: "朝阳区和平街14区简易住宅楼改造项目",
subject: "临时用电施工组织设计未对盾构施工用电进行专项说明。",
findTime: "2021-10-26 16:30:00",
level: "一般隐患A"
}
],
Loop: "", // 定时器
......@@ -54,21 +62,17 @@ export default {
},
mounted() {},
methods: {
goAdd(){
this.$router.push('/add-danger');
},
read(){},
read() {},
touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if(this.showIndex != null){
if (this.showIndex != null) {
this.showIndex = null;
return
return;
}
this.Loop = setTimeout(() => {
this.showIndex = index
},300); // 这里的1000是指需要长按的时间,单位为ms
this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
......@@ -76,59 +80,46 @@ export default {
},
// 详情
goDetail(data){
goDetail(data) {
console.log(data);
this.showIndex = null
this.$router.push({
path: '/add-danger',
query: {status: "退回"}
});
this.showIndex = null;
},
// 删除
goDelete(data){
goDelete(data) {
console.log(data);
this.showIndex = null
},
this.showIndex = null;
}
}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
// 内容
.con-list {
padding: 10px 10px 0;
.con-list {
padding: 10px 10px 0;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.message-content {
margin-top: 10px;
}
.van-overlay{
position: absolute;
.wrapper {
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.van-row{
margin-bottom: .133333rem;
line-height: .64rem;
}
.van-overlay {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
}
}
}
.add{
width: 1.333333rem;
height: 1.333333rem;
color: white;
font-weight: bold;
font-size: 1.48rem;
background-color: #02a7f0;
text-align: center;
line-height: 1.333333rem;
border-radius: 50%;
position: fixed;
right: .533333rem;
bottom: 1.866667rem;
}
}
</style>
......@@ -7,6 +7,16 @@
:show-error="false"
validate-trigger="onSubmit"
>
<van-field
v-if="isShowreturnCause"
v-model="returnCause"
readonly
rows="1"
autosize=""
label="退回原因"
name="退回原因"
type="textarea"
/>
<van-field
readonly
clickable
......@@ -309,9 +319,16 @@ export default {
administrationImg:[],//管理措施图片
urgent:"", //应急措施文字
urgentImg:[],//应急措施图片
returnCause: "你这不行啊", // 退回原因
isShowreturnCause: false
};
},
mounted() {},
created() {
if (this.$route.query.status) {
this.isShowreturnCause = true;
this.text = "风险上报退回"
}
},
methods: {
onSubmit(values) {
console.log("submit", values);
......
<template>
<div>
<LHeader :text="text"></LHeader>
<van-search v-model="searchValue" placeholder="搜索" @search="onSearch" />
<risk-returned></risk-returned>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import RiskReturned from "./riskReturned";
export default {
components: {
LHeader: LHeader,
RiskReturned,
},
data() {
return {
text: "上报退回",
searchValue: ""
};
},
mounted() {},
methods: {
onSearch(val) {
console.log(val);
},
}
};
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>
......@@ -10,12 +10,23 @@
@touchstart="touchstart(index, item)"
@touchend.prevent="touchend(index)"
>
<div class="messgae-title">{{ item.noticeTitle }}</div>
<div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{
item.createUserName
}}{{ item.noticeTitle }}相关的待处理任务...
</div>
<van-row gutter="">
<van-col span="7">所属工程名称:</van-col>
<van-col span="17">{{ item.project }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患项目名称:</van-col>
<van-col span="17">{{ item.subject }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患发现时间:</van-col>
<van-col span="17">{{ item.findTime }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ item.level }}</van-col>
</van-row>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
......@@ -23,16 +34,13 @@
<van-button round type="primary" @touchstart="goDetail(item)"
>详情</van-button
>
<van-button round type="info" @touchstart="goDelete(item)"
>修改</van-button
<van-button round type="warning" @touchstart="goDelete(item)"
>删除</van-button
>
</div>
</van-overlay>
</van-cell-group>
</div>
<!-- 加号 -->
<div class="add" @click="goAdd">+</div>
</div>
</template>
......@@ -42,10 +50,10 @@ export default {
return {
messageList: [
{
noticeTitle: "隐患上报消息",
upcomingUserName: "wang某某",
createUserName: "李某某",
noticeTitle: "重要任务"
project: "朝阳区和平街14区简易住宅楼改造项目",
subject: "临时用电施工组织设计未对盾构施工用电进行专项说明。",
findTime: "2021-10-26 16:30:00",
level: "一般隐患A"
}
],
Loop: "", // 定时器
......@@ -54,21 +62,17 @@ export default {
},
mounted() {},
methods: {
goAdd(){
this.$router.push('/add-danger');
},
read(){},
read() {},
touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if(this.showIndex != null){
if (this.showIndex != null) {
this.showIndex = null;
return
return;
}
this.Loop = setTimeout(() => {
this.showIndex = index
},300); // 这里的1000是指需要长按的时间,单位为ms
this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
......@@ -76,59 +80,46 @@ export default {
},
// 详情
goDetail(data){
goDetail(data) {
console.log(data);
this.showIndex = null
this.$router.push({
path: '/risk-add',
query: {status: "退回"}
});
this.showIndex = null;
},
// 删除
goDelete(data){
goDelete(data) {
console.log(data);
this.showIndex = null
},
this.showIndex = null;
}
}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
// 内容
.con-list {
padding: 10px 10px 0;
.con-list {
padding: 10px 10px 0;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.message-content {
margin-top: 10px;
}
.van-overlay{
position: absolute;
.wrapper {
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.van-row{
margin-bottom: .133333rem;
line-height: .64rem;
}
.van-overlay {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
}
}
}
.add{
width: 1.333333rem;
height: 1.333333rem;
color: white;
font-weight: bold;
font-size: 1.48rem;
background-color: #02a7f0;
text-align: center;
line-height: 1.333333rem;
border-radius: 50%;
position: fixed;
right: .533333rem;
bottom: 1.866667rem;
}
}
</style>
......@@ -46,7 +46,7 @@
<van-cell value="风控分级管控" />
<van-grid :column-num="5">
<van-grid-item
@click="riskJump(item.path)"
@click="riskJump(item.path)"
v-for="item in finalRiskList"
:key="item.key"
:icon="item.imgUrl"
......@@ -60,7 +60,7 @@
<van-cell value="隐患排查治理" />
<van-grid :column-num="5">
<van-grid-item
@click="dangerJump(item.path)"
@click="dangerJump(item.path)"
v-for="item in finalDangerList"
:key="item.key"
:icon="item.imgUrl"
......@@ -131,14 +131,14 @@ export default {
text: "风险上报"
},
{
key: "2",
path:"/risk-confirme",
key: "3",
path: "/risk-confirme",
imgUrl: require("@/assets/workbench/risk-confirm.png"),
text: "风险确认"
},
{
key: "3",
path:"/risk-account",
key: "4",
path: "/risk-account",
imgUrl: require("@/assets/workbench/risk-account.png"),
text: "风险台账"
}
......@@ -153,13 +153,7 @@ export default {
text: "隐患上报"
},
{
key: "2",
path: "/add-danger",
imgUrl: require("@/assets/workbench/rectification-notice.png"),
text: "上报退回"
},
{
key: "3",
key: "3",
path: "/confirme-danger",
imgUrl: require("@/assets/workbench/danger-confirm.png"),
text: "隐患确认"
......@@ -251,12 +245,12 @@ export default {
this.$router.push(path);
}
},
dangerJump(path){
dangerJump(path) {
if (path) {
this.$router.push(path);
}
},
riskJump(path){
riskJump(path) {
if (path) {
this.$router.push(path);
}
......@@ -275,6 +269,19 @@ export default {
this.finalRiskList = [...this.riskList].filter(x =>
[...this.powerObj.风险分级管控].some(y => y.menuName === x.text)
);
// 如果有隐患上报权限 则在添加一个 上报退回的权限
this.powerObj.风险分级管控.map(item => {
if (item.menuName == "风险上报") {
let obj = {
key: "2",
path: "/risk-return",
imgUrl: require("@/assets/workbench/plane-approval.png"),
text: "上报退回"
};
this.finalRiskList.splice(1, 0, obj);
}
});
} else {
this.finalRiskList = [];
}
......@@ -283,6 +290,18 @@ export default {
this.finalDangerList = [...this.dangerList].filter(x =>
[...this.powerObj.隐患排查治理].some(y => y.menuName === x.text)
);
// 如果有隐患上报权限 则在添加一个 上报退回的权限
this.powerObj.隐患排查治理.map(item => {
if (item.menuName == "隐患上报") {
let obj = {
key: "2",
path: "/report-return",
imgUrl: require("@/assets/workbench/rectification-notice.png"),
text: "上报退回"
};
this.finalDangerList.splice(1, 0, obj);
}
});
} else {
this.finalDangerList = [];
}
......
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