<template>
  <div id="material">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="one">
          <el-form :model="info" ref="info" label-width="120px">
            <el-col :span="12" class="one_1">
              <el-form-item label="国籍">
                <el-input v-model="info.nationality" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="姓名">
                <el-input v-model="info.name" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="公民身份号码">
                <el-input v-model="info.card" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="现住地省市县">
                <el-input v-model="info.onhouse_city" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="现住址详址">
                <el-input v-model="info.onaddress_detailed" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="联系电话">
                <el-input v-model="info.phone" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="单位名称">
                <el-input v-model="info.company" readonly></el-input>
              </el-form-item>
            </el-col>
          </el-form>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
const { mapActions } = createNamespacedHelpers('company_applicant');
export default {
  name: 'material',
  props: {},
  components: {},
  data: function () {
    return {
      info: {},
    };
  },
  async created() {
    if (this.id) await this.search();
  },
  methods: {
    ...mapActions(['fetch']),
    async search() {
      const res = await this.fetch({ company_id: this.id });
      if (this.$checkRes(res)) {
        if (res.data) this.$set(this, 'info', res.data);
      }
    },
  },
  computed: {
    ...mapState(['user']),
    id() {
      return this.$route.query.id;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .one {
    .one_1 {
      padding: 0 10px;
    }
  }
}
</style>
