<template>
  <el-dialog title="详情" :visible.sync="detailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
    <el-form label-width="90px">
      <el-row class="el-row-table">
        <el-col :span="12">
          <el-form-item label="计划名称">
            <span v-if="detailInfo.title">{{ detailInfo.title }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="计划编号">
            <span v-if="detailInfo.planNo">{{ detailInfo.planNo }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="生产总数">
            <span v-if="detailInfo.total">{{ detailInfo.total }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="创建时间">
            <span v-if="detailInfo.createTime">{{ detailInfo.createTime }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="创建人">
            <span v-if="detailInfo.createBy">{{ detailInfo.createBy }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="计划描述">
            <span v-if="detailInfo.content">{{ detailInfo.content }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

      </el-row>
    </el-form>
  </el-dialog>
</template>

<script>
  import { getPlan } from "@/api/track/plan";
  export default {
    name: "detail-info",
    data(){
        return{
          detailOpen: false,
          detailInfo: {}
        }
    },
    methods:{
      getDetailInfo(id){
        getPlan(id).then(res =>{
          if(res.code == 200){
              this.detailInfo = res.data;
              this.detailOpen = true;
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
