<template>
  <el-dialog title="任务详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
    <!-- 任务详情 -->
    <TaskInfo v-if="detailOpen" :detailInfo="taskInfo"/>

    <!-- 检查范围 -->
    <Scope v-if="detailOpen" :fHazardCheckTaskId="taskInfo.fInsTaskInforId"/>

    <!-- 检查项 -->
    <Inspect v-if="detailOpen" :fCheckTaskCode="taskInfo.fUniqueCode"/>

    <!-- 调查项 -->
    <Survey v-if="detailOpen" :fCheckTaskCode="taskInfo.fUniqueCode"/>
  </el-dialog>
</template>

<script>
  import { listInfor } from "@/api/supervision/task";
  import TaskInfo from "../../task/components/TaskInfo";
  import Scope from "../../task/components/Scope";
  import Inspect from "../../task/components/Inspect";
  import Survey from "../../task/components/Survey";
  export default {
    name: "task-info",
    components:{
      TaskInfo,
      Scope,
      Inspect,
      Survey
    },
    data(){
      return{
        detailOpen: false,
        taskInfo:{},
      }
    },
    methods:{
      getTaskInfo(fCheckTaskCode){
        listInfor({fUniqueCode:fCheckTaskCode}).then(res =>{
          if(res.code == 200 && res.rows){
            this.taskInfo = res.rows[0];
            this.detailOpen = true;
          }
        })
      },
    }
  }
</script>

<style scoped>

</style>