Commit 894c3b6f authored by 13841799530's avatar 13841799530
Browse files

解润东

20220517
优化页面
parent 1a360f97
Loading
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -385,12 +385,13 @@ export default {
            this.text = "隐患上报退回";
            this.postReturnEcho();
        }
        this.proId=this.$route.query.proId,
        this.hdRange=this.$route.query.hdRange,
        this.hdType=this.$route.query.hdType,
        this.hdName=this.$route.query.hdName,
        this.hdId=this.$route.query.hdId,
        this.hdLev=this.$route.query.hdLev
        var obj=JSON.parse(sessionStorage.getItem('obj'))
        this.proId=obj.proId,
        this.hdRange=obj.hdRange,
        this.hdType=obj.hdType,
        this.hdName=obj.hdName,
        this.hdId=obj.hdId,
        this.hdLev=obj.hdLev
        this.getList();
        //隐患巡查跳转回显
        if(this.proId){
@@ -632,6 +633,9 @@ export default {
                        message: "提交成功",
                        duration: 2000,
                    });
                    console.log(this.$route.query)
                    // this.$route.query={}
                    // console.log(this.$route.query)
                    history.go(-1);
                })
                .catch(() => {
+39 −18
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@
            v-model="active"
            color="#2980f7"
            animated
            @change="tabChange"
            @click="tabClick"
           
            :sticky="true"
            offset-top="1.5rem"
        >
@@ -22,7 +23,7 @@
                finished-text="没有更多了"
                @load="onLoad()"
            >
                    <van-cell-group inset v-for="(item, index) in messageList" :key="index">
                    <van-cell-group inset v-for="(item, index) in i.messageList" :key="index">
                        <van-row gutter>
                            <!-- <van-col span="18">
                                <span class="con_title">日查</span>
@@ -80,7 +81,7 @@
                        position: fixed;
                        top: 30%;
                    "
                    v-if="messageList.length == 0"
                    v-if="i.messageList.length == 0"
                >暂无数据</div>
                
            </van-tab>
@@ -153,19 +154,31 @@ export default {
        this.loadingTabs()
    },
    methods: {
        tabChange(name,title){
            console.log(title)
        tabClick(name,title){
            this.page=1
            this.hdType=title
            this.messageList=[]
            this.tabs.forEach((i)=>{
                if(i.title==this.hdType){
                    i.messageList=[]
                    i.loading=true
                    i.finished=false
                }
            })
            this.onLoad();
        },
        // tabChange(name,title){
        //     console.log(title)
        //     this.page=1
        //     this.hdType=title
        //     this.tabs.forEach((i)=>{
        //         if(i.title==this.hdType){
        //             i.messageList=[]
        //             i.loading=true
        //             i.finished=false
        //         }
        //     })
        //     this.onLoad();
        // },
        loadingTabs(){
             postWork("patrol/running/hdType?cycle="+this.id).then(res => {
                this.hdType=res.data[0].hdType
@@ -173,6 +186,7 @@ export default {
                    this.tabs.push({
                        title:i.hdType,
                        api:i.id,
                        messageList:[],
                        loading: false,
                        finished: false,
                        refreshing:false,
@@ -195,20 +209,24 @@ export default {
            let obj = {
                cycle: this.id,
                hdType:this.hdType,
                page:this.page,
                psize:this.psize,
                pageNum:this.page,
                pageSize:this.psize,
            };
            postFun("patrol/running/list?cycle="+this.id+'&hdType='+this.hdType+'&page='+this.page+'&psize='+this.psize)
            postFun("patrol/running/list?cycle="+this.id+'&hdType='+this.hdType+'&pageNum='+this.page+'&pageSize='+this.psize)
                .then(res => {
                    res.rows.forEach((item)=>{
                        this.messageList.push(item)
                        this.tabs.forEach((i)=>{
                            if(i.title==this.hdType){
                                i.messageList.push(item)
                            }
                        })
                    })
                    this.$toast.clear();
                    this.total=res.total
                    this.page++;
                    this.tabs.forEach((i)=>{
                        if(i.title==this.hdType){
                            if (this.messageList.length>=this.total) {
                            if (i.messageList.length>=this.total) {
                                i.finished = true;
                            }
                            i.loading = false;
@@ -240,6 +258,9 @@ export default {
                        name: "add-danger",
                        query:{
                            id:item.id,
                        }
                    });
                    var obj={
                        proId:item.proId,
                        hdRange:item.hdRange,
                        hdType:item.hdType,
@@ -247,7 +268,7 @@ export default {
                        hdId:item.hdId,
                        hdLev:item.hdLev,
                    }
                    });
                    sessionStorage.setItem('obj',JSON.stringify(obj))
                })
                .catch(() => {
                    this.messageList[index].result = 1
@@ -304,7 +325,7 @@ export default {
            this.tabs.forEach((i)=>{
                if(i.title==this.hdType){
                    if (i.refreshing) {
                       this.messageList=[]
                       i.messageList=[]
                        i.refreshing = false;
                    }
                }
+12 −7
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
                     <van-col span="10">
                        <span class="record-time">{{util.timestampToTime(item.endTime,'DT2',true)}}</span>
                    </van-col>
                    <van-col span="4" class="cont-end record-status">{{item.status|status}}</van-col>
                    <van-col span="4" class="cont-end record-status"><span v-if="item.result==null">{{item.status|status}}</span><span v-else class="record-status2">已取消</span></van-col>
                </van-row>
                <!-- <van-row gutte>
                    <van-col span="12">开始时间: 09:30</van-col>
@@ -51,10 +51,12 @@
                    <van-col span="24">项目名称: {{item.projectName}}</van-col>
                </van-row>
                <van-row gutter>
                    <van-col span="24">上报隐患: {{item.hdReportCount?item.hdReportCount:0}}</van-col>
                    <van-col span="24" v-if="item.result==null">上报隐患: {{item.hdReportCount?item.hdReportCount:0}}</van-col>
                    <van-col span="24" v-else>审批结果: {{item.result}}</van-col>
                </van-row>
                <van-row gutter>
                    <van-col span="24">确认隐患: {{item.hdConfirmCount?item.hdConfirmCount:0}}</van-col>
                    <van-col span="24" v-if="item.result==null">确认隐患: {{item.hdConfirmCount?item.hdConfirmCount:0}}</van-col>
                     <van-col span="24" v-else>审批内容: {{item.approveContent?item.approveContent:''}}</van-col>
                </van-row>
                <!-- 长按显示遮罩层 -->
                <!-- :show="showIndex == index" -->
@@ -184,7 +186,6 @@ export default {
        if(this.$route.query.id){
            this.id=this.$route.query.id
        }
        this.loading();
    },
    methods: {
        onConfirm(date) {
@@ -200,8 +201,8 @@ export default {
                cycle:this.id,
                startTime:this.startTime,
                endTime:this.endTime,
                page:this.page,
                psize:this.psize,
                pageNum:this.page,
                pageSize:this.psize,
            }
            getFun('patrol/list',obj).then((res)=>{
                res.rows.forEach((item)=>{
@@ -212,7 +213,8 @@ export default {
                })
                //防止分页超出操作
                this.page++
                this.total=res.rows.total
                this.total=res.total
                console.log(this.patrolList.length)
                if (this.patrolList.length>=this.total) {
                        this.finished = true;
                    }
@@ -293,6 +295,9 @@ export default {
            .record-status {
                color: #008080;
            }
            .record-status2 {
                color: yellow;
            }
            .cont-end {
                display: flex;
                justify-content: flex-end;