<!--
 * 严肃声明：
 * 开源版本请务必保留此注释头信息，若删除我方将保留所有法律责任追究！
 * 本系统已申请软件著作权，受国家版权局知识产权以及国家计算机软件著作权保护！
 * 可正常分享和学习源码，不得用于违法犯罪活动，违者必究！
 * Copyright (c) 2020 陈尼克 all rights reserved.
 * 版权所有，侵权必究！
 *
-->

<template>
    <div>
        <LHeader v-bind:text="text"></LHeader>
        <div class="card">
            <div>检查名称：{{itemlist.name}}</div>
            <div>检查类型：{{itemlist.type}}</div>
            <div>检查开始时间：{{itemlist.planStartTime}}</div>
            <div>检查结束时间：{{itemlist.planEndTime}}</div>
            <div>检查地点：{{itemlist.address}}</div>
        </div>
        <div class="button-more">
            <van-button type="primary" round size="large" @click="problem">检查问题上报{{nums.TroubleNumber}}</van-button>
            <van-button type="primary" round size="large" @click="formwork">检查清单模板{{nums.addTroubleNumber}}</van-button>
            <van-button type="primary" round size="large" @click="note">检查问题记录{{nums.listNumber}}</van-button>
            <van-button type="primary" round size="large" @click="end">结束上报</van-button>
        </div>
    </div>
</template>

<script>
import LHeader from '@/components/header.vue'
import { getFun,postFun } from '@/service/table'
export default {
    name: 'problem',
    components: {
        "LHeader":LHeader
    },
    data() {
        return {
            nums:{},
            itemlist:{},
            text:'问题上报'
        }
    },
    mounted() {
        if(this.$route.query.checkitemId){
            this.itemlist={
                id:this.$route.query.checkitemId,
                name:this.$route.query.name,
                type:this.$route.query.type,
                planStartTime:this.$route.query.planStartTime,
                planEndTime:this.$route.query.planEndTime,
                address:this.$route.query.address,
            }
        }
        this.init()
    },
    methods: {
        init(){
            this.nums=[];
            getFun('check/carry/count').then((Response)=>{
                this.nums=Response.data
            })
        },
        end(){
            this.$dialog.confirm({
                title: '提示',
                message: '确定结束检查上报？',
            })
        },
        problem(){
            this.$router.push('/list')
        },
        note(){
            this.$router.push('/note')
        },
        formwork(){
            this.$router.push('/formwork')
        }
    }
}
</script>
<style lang="less" scoped>
    .card{
        width:90%;
        box-shadow: 0px 0px 10px 2px #F3F3F3;
        padding: 0.25rem;
        margin:0.4rem auto;
        background: white;
    }
    .card div{
        font-size: 0.4rem;
    }
    .button-more{
        text-align: center;
    }
    .van-button{
        width: 80%;
        margin-top: 0.4rem;
    }
</style>
