
<template>
  <el-row>
    <el-col :span="24">
      <el-form
        :model="commonForm"
        ref="commonForm"
        class="sub-form"
        :validate-on-rule-change="false"
      >
        <el-form-item label="单位" label-width="110px" prop="unit">
          <el-input v-model.trim="commonForm.unit" placeholder="请输入单位" @blur="handleValue('unit')"></el-input>
        </el-form-item>
      </el-form>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: 'CommonForm',
  props: ['data'],
  data() {
    return {
      commonForm: {
        unit: ''
      }
    };
  },
  computed: {},
  created() {
    this._initData();
  },
  mounted() {},
  methods: {
    _initData() {
      this.commonForm.unit = this.data.unit;
    },
    // 传值
    handleValue(from) {
      this.$emit('handleInput', {
        type: from,
        value: this.commonForm[from]
      });
    }
  }
};
</script>

<style lang="less" scoped>
.turns {
  text-align: center;
  height: 40px;
  line-height: 40px;
  color: #dcdfe6;
}
</style>