<template>
  <div class="audit-business-address">
    <div class="table-box">
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="date" label="法人相关">
          <template slot-scope="scope">
            <div class="address-box">
              <div>年龄：</div>
              {{ detailsInfo.age }}
            </div>
          </template></el-table-column>
        <el-table-column prop="date" label="是否达标" label-class-name="rule-required" width="200">
          <template slot-scope="scope">
            <div class="address-box">
              <el-select v-model="ageCompliance" placeholder="请选择是否达标" :disabled="disabled">
                <el-option label="是" :value="1"></el-option>
                <el-option label="否" :value="0"></el-option>
              </el-select>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    detailsInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      ageCompliance: '',
      tableData: [
        { age: '', ageCompliance: '' }
      ]
    }
  },
  watch: {
    detailsInfo: {
      handler(newV) {
        if (newV === undefined) return
        const { ageCompliance } = JSON.parse(JSON.stringify(this.detailsInfo))
        this.ageCompliance = ageCompliance
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    getParams() {
      return {
        ageCompliance: this.ageCompliance
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.audit-business-address {
  .address-box {
    display: flex;
    height: 40px;
    line-height: 40px;
    border-bottom: 1px solid #f0f0f0;
    padding-right: 10px;
    padding-left: 10px;
    & > div {
      &:first-child {
        min-width: 100px;
        font-size: 14px;
      }
    }
  }
}
</style>

<style lang="scss">
.audit-business-address {
  .el-table .cell {
    padding-left: 0px;
    padding-right: 0px;
  }
}
</style>
