<template>
  <div id="unit">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="one">
          <el-form :model="info" ref="info" label-width="150px">
            <el-col :span="12" class="one_1">
              <el-form-item label="申请单位名称" prop="company">
                <el-input v-model="info.company"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="申请单位所属市县(区)" prop="belong_city">
                <el-input v-model="info.belong_city"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="申请单位详细地址" prop="belong_city_detailed">
                <el-input v-model="info.belong_city_detailed"></el-input>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="12" class="one_1">
              <el-form-item label="保安服务许可证号" prop="company_xkzpzwh">
                <el-input v-model="info.company_xkzpzwh"></el-input>
              </el-form-item>
            </el-col> -->
            <el-col :span="12" class="one_1">
              <el-form-item label="学校或职业培训机构的批准机关" prop="approval_office">
                <el-input v-model="info.approval_office"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12" class="one_1">
              <el-form-item label="批准文号" prop="approval_num">
                <el-input v-model="info.approval_num"></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_information');
export default {
  name: 'unit',
  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>
