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

<template>
    <div>
        <LHeader v-bind:text="text"></LHeader>
        <div class="card">
            <div>检查名称：{{nums.name}}</div>
            <div>检查类型：{{nums.type}}</div>
            <div>检查开始时间：{{nums.planStartTime}}</div>
            <div>检查结束时间：{{nums.planEndTime}}</div>
            <div>检查地点：{{nums.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:{},
            text:'问题上报'
        }
    },
    mounted() {
        this.init()
    },
    methods: {
        init(){
            var id=sessionStorage.getItem('id')
            this.nums=[];
            getFun('check/carry/count',{planId:id}).then((Response)=>{
                this.nums=Response.data
            })
        },
        end(){
            this.$dialog.confirm({
                title: '提示',
                message: '确定结束检查上报？',
            }).then(()=>{
                this.$router.push('/checked')
            })
        },
        problem(){
            this.$router.push('/list')
        },
        note(){
            this.$router.push({
                name:'note',
                query:{
                    id:this.nums.id
                }
            })
        },
        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>
