<!--
  @description: 专家库-抽取条件记录列表
  @Modifier: qrf
  @routerPath: /expert/extractProjectMakeUpContent
  @date: 2020/10/26
-->
<template>
  <div class="projectInfoDetail">
    <el-form ref="form" label-width="160px">
      <div class="page-title">
        <span class="be-required">2 抽取条件记录</span>
      </div>
      <div>
        <section>
          <el-table :data="extractConditionRecording" class="tableLimit" border>
            <el-table-column type="index" label="序号" width="60" align="center" />
            <el-table-column label="评标专业" align="center" prop="specialName" />
            <el-table-column label="抽取人数" align="center" prop="expertNum" />
            <el-table-column label="抽取专家地区" align="center" prop="cityName" />
            <el-table-column label="备选专业" align="center" prop="spareMajorName" />
            <el-table-column label="实际抽取人数" align="center" prop="realNum" />
          </el-table>
        </section>
      </div>
    </el-form>
  </div>
</template>
<script>
/* api */
import { getExtractExpertConditionHistoryById } from '@/api/expert/extractExpert/extractExpert'

export default {
  name: 'ExtractingConditionsRecordingList',
  props: {
    listData: {
      type: String,
      default: function() {
        return
      }
    }
  },
  data() {
    return {
      extractConditionRecording: [] // 抽取条件记录
    }
  },
  created() {
    this.initData()
  },
  methods: {
    initData() {
      const data = this.listData
      this.extractConditionRecording = [] // 清空列表数据
      getExtractExpertConditionHistoryById(data).then((res) => {
        const tableData = res.data
        tableData.forEach((item) => {
          this.extractConditionRecording.push(item.con)
        })
      })
    },
    addExtractCondition() {
      this.$refs.extractingConditionsDialog.openDialog()
    }
  }
}
</script>
