
<!--
  @description:专家评标专业查看组件
  @Modifier: wxy
  @routerPath:
  @date: 2020-09-08 10:19:48
-->
<template>
  <div class="projectInfoDetail">
    <div class="page-title">
      2.评标专业
    </div>
    <section>
      <el-table ref="smallTable" :data="tableData" class="tableLimit" border>
        <el-table-column
          prop="specialtyName"
          label="评标专业"
          header-align="center"
          align="center"
          min-width="140"
        />
        <el-table-column
          prop="specialtyType"
          label="主/辅评"
          header-align="center"
          align="center"
          min-width="140"
        >
          <template slot-scope="scope">
            <!--            <span>{{ scope.row.specialtyType }}</span>-->
            <span>{{ filterDictText(specialtyTypeList, scope.row.specialtyType) }}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="beginYear"
          label="从事起始年份"
          header-align="center"
          align="center"
          min-width="140"
        />
      </el-table>
    </section>
  </div>
</template>

<script>
/* 公共方法 */
import { filterDictText } from '@/assets/js/utils'
/* 接口*/
import { getExpertEvaluationSpecialById } from '@/api/expert/expertscloud.js'
export default {
  data() {
    return {
      tableData: [], // 评标专业信息
      specialtyTypeList: [
        {
          typecode: '01',
          typename: '主'
        },
        {
          typecode: '00',
          typename: '辅'
        }
      ] // 字典信息主/辅评
    }
  },
  created() {
    // 获取评标专业信息
    this.initData()
    // 字典信息查询的key
    const data = ['specialtyType']
    this.$store.dispatch('getGroupType', data).then(res => {
      // this.specialtyTypeList = res.res.specialtyType.data.typeList
    })
  },
  methods: {
    filterDictText, // 引入字典值替换文本通用方法
    initData() {
      const data = {
        expertId: this.$route.params.expertId || this.$route.query.id
      } // 专家id
      getExpertEvaluationSpecialById(data).then(res => {
        this.tableData = res.data.records // 评标专业信息
      })
    }
  }
}
</script>

<style lang='less' scoped>
.baseInfo{
   font-weight: bolder;
}
</style>
