<template>
  <div class="app-container">
    <el-form ref="form" :model="items" label-width="80px">
      <el-form-item v-if="showAdditionalInput" label="出场原因" label-width="200px">
        <el-input
          type="textarea"
          maxlength="80"
          show-word-limit
          :autosize="{ minRows: 4, maxRows: 6}"
          placeholder="请输入内容"
          v-model="items.reason"
          @change="changeReason"
          :disabled="disabled"
          :style="{ width: '30%' }">
        </el-input>
      </el-form-item>
      <el-form-item label="分包商单位名称" label-width="200px">
        <el-input v-model="items.subName" :style="{width:'30%'}" :disabled="true"/>
      </el-form-item>
      <el-form-item label="单位地址"   label-width="200px">
        <el-input v-model="items.address" :style="{width:'30%'}" :disabled="true"/>
      </el-form-item>
      <el-form-item label="法人姓名" label-width="200px">
        <el-input v-model="items.corporateName" :style="{width:'30%'}" :disabled="true"/>
      </el-form-item>
      <el-form-item label="法人联系方式" label-width="200px">
        <el-input v-model="items.corporatePhone" :style="{width:'30%'}"
                  :disabled="true"/>
      </el-form-item>
      <el-form-item label="社会统一征信代码" label-width="200px">
        <el-input v-model="items.socialUnifiedCreditCode" :style="{width:'30%'}"
                  :disabled="true"/>
      </el-form-item>
      <el-form-item label="入场日期" label-width="200px">
        <el-input v-model="items.admissionDate" :style="{width:'30%'}"
                  :disabled="true"/>
      </el-form-item>
      <el-form-item label="离场日期" label-width="200px">
        <el-input v-model="items.departureDate" :style="{width:'30%'}"
                  :disabled="true"/>
      </el-form-item>
      <el-form-item label="负责人" label-width="200px">
        <el-input v-model="items.leaderName" :style="{width:'30%'}" :disabled="true"/>
      </el-form-item>
      <el-form-item label="负责人联系方式" label-width="200px">
        <el-input v-model="items.leaderPhone" :style="{width:'30%'}" :disabled="true"/>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    // 出场原因根据需要设定是否显示动态项
    showAdditionalInput: false,
    disabled:false,
    items: {
      type: Object,
      default: () => {
        return {
          // 出场原因
          additionalField: '',
          // 监理单位名称
          consName: '',
          // 单位地址
          address: '',
          // 法人姓名
          corporateName: '',
          // 法人联系方式
          corporatePhone: '',
          // 社会统一征信代码
          socialUnifiedCreditCode: '',
          // 入场日期
          admissionDate: '',
          // 离场日期
          departureDate: '',
          //审核状态
          auditType:'出场'
        }
      }
    },
  },
  methods: {
    changeReason(e) {
      this.$emit('reason', e)
    }
  }
}
</script>
