Commit ad0258de authored by 13841799530's avatar 13841799530

巡查记录接口联调

解润东
20220505
parent 8e2264db
Pipeline #8239 passed with stage
in 5 minutes and 1 second
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-sticky offset-top="1.5rem"> <!-- <van-sticky offset-top="1.5rem">
<van-search v-model="searchValue" show-action placeholder="请输入搜索内容" @search="onSearch"> <van-search v-model="searchValue" show-action placeholder="请输入搜索内容" @search="onSearch">
<template #action> <template #action>
<div @click="onSearch">搜索</div> <div @click="onSearch">搜索</div>
</template> </template>
</van-search> </van-search>
</van-sticky> </van-sticky> -->
<!-- 内容列表 --> <!-- 内容列表 -->
<!-- 接口对接4 START --> <!-- 接口对接4 START -->
<div class="con-list" @touchmove="showIndex = null"> <div class="con-list" @touchmove="showIndex = null">
<!-- v-for="(item, index) in messageList" <!-- v-for="(item, index) in messageList"
:key="index" :key="index"
@click="touchstart(index, item)"--> @click="touchstart(index, item)"-->
<van-cell-group inset @click="touchstart"> <van-cell-group inset @click="touchstart(item)" v-for="(item, index) in patrolList" :key="index">
<van-row gutte> <van-row gutte>
<van-col span="12"> <van-col span="10">
<span class="record-time">2022年4月8日</span> <span class="record-time">{{util.timestampToTime(item.startTime,'DT2',true)}}</span>
</van-col> </van-col>
<van-col span="12" class="cont-end record-status">已执行</van-col> <van-col span="10">
<span class="record-time">{{util.timestampToTime(item.startTime,'DT2',true)}}</span>
</van-col>
<van-col span="4" class="cont-end record-status">已执行</van-col>
</van-row> </van-row>
<van-row gutte> <!-- <van-row gutte>
<van-col span="12">开始时间: 09:30</van-col> <van-col span="12">开始时间: 09:30</van-col>
<van-col span="12" class="cont-end">结束巡查时间: 11:25</van-col> <van-col span="12" class="cont-end">结束巡查时间: 11:25</van-col>
</van-row>
-->
<van-row gutter>
<van-col span="24">岗位: {{item.postName}}</van-col>
</van-row> </van-row>
<van-row gutter> <van-row gutter>
<van-col span="24">巡查时长: 2小时13分</van-col> <van-col span="24">巡查频次: {{item.cycle|cycle}}</van-col>
</van-row> </van-row>
<van-row gutter> <van-row gutter>
<van-col span="24">上报隐患: 8</van-col> <van-col span="24">上报隐患: {{item.hdReportCount?item.hdReportCount:0}}</van-col>
</van-row> </van-row>
<van-row gutter> <van-row gutter>
<van-col span="24">确认隐患: 5</van-col> <van-col span="24">确认隐患: {{item.hdConfirmCount?item.hdConfirmCount:0}}</van-col>
</van-row> </van-row>
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<!-- :show="showIndex == index" --> <!-- :show="showIndex == index" -->
<van-overlay :show="showIndex"> <van-overlay :show="item.show">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="item.show=false;$forceUpdate()">
<van-button round type="primary" @click="goDetail()">详情</van-button> <van-button round type="primary" @click="goDetail(item)">详情</van-button>
</div> </div>
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
...@@ -54,6 +61,7 @@ ...@@ -54,6 +61,7 @@
</template> </template>
<script> <script>
let that;
import tabBar from "@/components/TabBar"; import tabBar from "@/components/TabBar";
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
...@@ -82,56 +90,90 @@ export default { ...@@ -82,56 +90,90 @@ export default {
}, },
data() { data() {
return { return {
text: "企业级督办", id:'',//巡查周期id
text: "巡查记录",
searchValue: "", searchValue: "",
showIndex:false,
messageList: [], messageList: [],
patrolList:[],//巡查数组
isHaveNews: false, isHaveNews: false,
showIndex: null // 是否显示遮罩层 contentList:[
{
id: "1",
content: "日查"
},
{
id: "2",
content: "周查"
},
{
id: "3",
content: "半月查"
},
{
id: "4",
content: "月查"
},
{
id: "5",
content: "季查"
},
{
id: "6",
content: "半年查"
},
{
id: "7",
content: "年查"
}
]
}; };
}, },
created() { beforeCreate () {
// this.getList(); that = this
},
filters:{
cycle(val){
var value;
that.contentList.forEach((i)=>{
if(i.id==val){
value=i.content
}
})
return value
}
},
mounted(){
if(this.$route.query.id){
this.id=this.$route.query.id
}
this.loading();
}, },
methods: { methods: {
getList(select = "") { loading(){
this.$toast.loading({ var obj={
message: "加载中...", cycle:this.id
forbidClick: true, }
loadingType: "spinner", this.patrolList=[]
duration: 0 getFun('patrol/list',obj).then((res)=>{
}); this.patrolList=res.data
let formdata = new FormData(); this.patrolList.forEach((i)=>{
formdata.append("select", select); i.show=false
superviseSABlist("/supervise/SABlist", formdata)
.then(res => {
this.$toast.clear();
this.messageList = res.data;
// 判断有无数据返回
if (this.messageList.length == 0) {
this.isHaveNews = true;
}
}) })
.catch(() => { })
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
}, },
onSearch(val) { onSearch(val) {
this.getList(this.searchValue); this.getList(this.searchValue);
}, },
touchstart(index, item) { touchstart(item) {
// if (this.showIndex != null) { item.show = true
// this.showIndex = null; this.$forceUpdate()
// return;
// }
// this.showIndex = index;
this.showIndex = true
}, },
// 详情 // 详情
goDetail(data) { goDetail(data) {
console.log(data)
this.$router.push({ this.$router.push({
name: "record-detail" name: "record-detail"
}); });
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
inset inset
v-for="(item, index) in contentList" v-for="(item, index) in contentList"
:key="index" :key="index"
@click="onClick(item.content)" @click="onClick(item)"
> >
<div class="icon-wrap"> <div class="icon-wrap">
<span class="icon-img"> <span class="icon-img">
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { postWork } from "@/service/workbench"; import { postWork } from "@/service/workbench";
import { getFun,postFun } from '@/service/table'
export default { export default {
name: "danger-patrol", name: "danger-patrol",
components: { components: {
...@@ -86,10 +87,10 @@ export default { ...@@ -86,10 +87,10 @@ export default {
}, },
methods: { methods: {
loading(){ loading(){
postWork("patrol/running/listCycle").then((res) => { getFun("patrol/cycle/list").then((res) => {
this.contentLists.forEach((x)=>{ this.contentLists.forEach((x)=>{
res.data.forEach((y)=>{ res.data.forEach((y)=>{
if(x.title==y.cycle){ if(x.title==y){
this.contentList.push(x) this.contentList.push(x)
} }
}) })
...@@ -98,7 +99,10 @@ export default { ...@@ -98,7 +99,10 @@ export default {
}, },
onClick(val) { onClick(val) {
this.$router.push({ this.$router.push({
name: "record-patrol" name: "record-patrol",
query:{
id:val.title
}
}); });
} }
} }
......
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