Commit f1505463 authored by 王李辉's avatar 王李辉
Browse files

Merge branch 'develop' of http://git.censoft.com.cn/BCDH-HSE/bcdh-app into develop

parents efc787b9 ad0258de
Loading
Loading
Loading
Loading
Loading
+89 −47
Original line number Diff line number Diff line
<template>
    <div>
        <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">
                <template #action>
                    <div @click="onSearch">搜索</div>
                </template>
            </van-search>
        </van-sticky>
        </van-sticky> -->
        <!-- 内容列表 -->
        <!-- 接口对接4 START -->
        <div class="con-list" @touchmove="showIndex = null">
            <!-- v-for="(item, index) in messageList"
        :key="index"
            @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-col span="12">
                        <span class="record-time">2022年4月8日</span>
                    <van-col span="10">
                        <span class="record-time">{{util.timestampToTime(item.startTime,'DT2',true)}}</span>
                    </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 gutte>
                <!-- <van-row gutte>
                    <van-col span="12">开始时间: 09:30</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 gutter>
                    <van-col span="24">巡查时长: 2小时13分</van-col>
                    <van-col span="24">巡查频次: {{item.cycle|cycle}}</van-col>
                </van-row>
                <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 gutter>
                    <van-col span="24">确认隐患: 5</van-col>
                    <van-col span="24">确认隐患: {{item.hdConfirmCount?item.hdConfirmCount:0}}</van-col>
                </van-row>
                <!-- 长按显示遮罩层 -->
                <!-- :show="showIndex == index" -->
                <van-overlay :show="showIndex">
                    <div class="wrapper" @click.stop="showIndex = null">
                        <van-button round type="primary" @click="goDetail()">详情</van-button>
                <van-overlay :show="item.show">
                    <div class="wrapper" @click.stop="item.show=false;$forceUpdate()">
                        <van-button round type="primary" @click="goDetail(item)">详情</van-button>
                    </div>
                </van-overlay>
            </van-cell-group>
@@ -54,6 +61,7 @@
</template>

<script>
let that;
import tabBar from "@/components/TabBar";
import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js";
@@ -82,56 +90,90 @@ export default {
    },
    data() {
        return {
            text: "企业级督办",
            id:'',//巡查周期id
            text: "巡查记录",
            searchValue: "",
            showIndex:false,
            messageList: [],
            patrolList:[],//巡查数组
            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() {
        // this.getList();
    beforeCreate () {
	    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: {
        getList(select = "") {
            this.$toast.loading({
                message: "加载中...",
                forbidClick: true,
                loadingType: "spinner",
                duration: 0
            });
            let formdata = new FormData();
            formdata.append("select", select);
            superviseSABlist("/supervise/SABlist", formdata)
                .then(res => {
                    this.$toast.clear();
                    this.messageList = res.data;
                    // 判断有无数据返回
                    if (this.messageList.length == 0) {
                        this.isHaveNews = true;
        loading(){
            var obj={
                cycle:this.id
            }
            this.patrolList=[]
            getFun('patrol/list',obj).then((res)=>{
                this.patrolList=res.data
                this.patrolList.forEach((i)=>{
                    i.show=false
                })
            })
                .catch(() => {
                    this.$toast.clear();
                    this.$toast.fail("加载失败,请稍后再试");
                });
        },

        onSearch(val) {
            this.getList(this.searchValue);
        },

        touchstart(index, item) {
            // if (this.showIndex != null) {
            //     this.showIndex = null;
            //     return;
            // }
            // this.showIndex = index;
            this.showIndex = true
        touchstart(item) {
            item.show = true
            this.$forceUpdate()
        },
        
        // 详情
        goDetail(data) {
            console.log(data)
            this.$router.push({
                name: "record-detail"
            });
+8 −4
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
                inset
                v-for="(item, index) in contentList"
                :key="index"
                @click="onClick(item.content)"
                @click="onClick(item)"
            >
                <div class="icon-wrap">
                    <span class="icon-img">
@@ -31,6 +31,7 @@
<script>
import LHeader from "@/components/header.vue";
import { postWork } from "@/service/workbench";
import { getFun,postFun } from '@/service/table'
export default {
    name: "danger-patrol",
    components: {
@@ -86,10 +87,10 @@ export default {
    },
    methods: {
        loading(){
            postWork("patrol/running/listCycle").then((res) => {
            getFun("patrol/cycle/list").then((res) => {
                this.contentLists.forEach((x)=>{
                    res.data.forEach((y)=>{
                        if(x.title==y.cycle){
                        if(x.title==y){
                            this.contentList.push(x)
                        }
                    })
@@ -98,7 +99,10 @@ export default {
        },
        onClick(val) {
            this.$router.push({
                name: "record-patrol"
                name: "record-patrol",
                query:{
                    id:val.title
                }
            });
        }
    }