<template>
  <div>
    <el-form :model="dialogForm" ref="addForm" label-width="120px" label-position="left">
      <el-form-item label="项目名称" prop="xm_name">
        <el-input readonly v-model="dialogForm.xm_name"></el-input>
      </el-form-item>
      <el-form-item label="项目类别" prop="xm_type_option_n">
        <el-input readonly v-model="dialogForm.xm_type_option_n"></el-input>
      </el-form-item>
      <el-form-item label="责任科室" prop="department_name">
        <el-input readonly v-model="dialogForm.department_name"></el-input>
      </el-form-item>
      <el-form-item label="责任人" prop="xm_zrr">
        <el-input readonly v-model="dialogForm.xm_zrr"></el-input>
      </el-form-item>
      <el-form-item label="项目开始时间" prop="xm_start_time">
        <el-input readonly v-model="dialogForm.xm_start_time"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { xmgl_xmzlkDetail } from "./api";
export default {
  data() {
    return {
      dialogForm: {},
    }
  },
  props: ["currentId"],
  watch: {
    currentId: {
      immediate: true,
      handler(val) {
        if (val != "") {
          this.initDetailInfo(val);
        }
      }
    }
  },
  methods: {
    async initDetailInfo(id) {
      let res = await xmgl_xmzlkDetail({ xm_id: id });
      this.dialogForm = res.one_info;
      this.dialogForm.xm_start_time = this.dialogForm.xm_start_time.substring(0, 10);
    }
  }
}
</script>

<style>
</style>