
<!--
  @description:评标-推荐组长-已设置组长
  @Modifier:wxy/gmy
  @routerPath:/procurement/evaluationLobbyDrive/expertElectLeaderDetail
  @date:2020/11/02-11:48
-->
<template>
  <div class="main">
    <div>
      <!-- 专家列表 -->
      <el-table v-loading="loading" :data="tableData">
        <el-table-column type="index" label="序号" width="55" align="center" />
        <el-table-column label="姓名" width="120" prop="expertName" align="center" />
        <el-table-column v-if="showInfo || showVoted" key="1" label="身份证号" min-width="150" prop="idcardNo" align="center" />
        <el-table-column v-if="showInfo || showVoted" key="2" label="手机号" min-width="120" prop="expertTelephone" align="center" />
        <el-table-column v-if="showInfo || showVoted" key="3" label="性别" width="80" prop="sex" align="center" />
        <el-table-column label="专家类型" min-width="100" prop="personType" align="center">
          <template slot-scope="scope">
            {{ filterDictText(personTypeList,scope.row.personType) }}
          </template>
        </el-table-column>
        <el-table-column label="评标类别" prop="expertTypes" align="center" min-width="150">
          <template slot-scope="scope">
            <span v-for="(item, index) in scope.row.expertTypes" :key="index">
              {{ filterDictText(expertTypeList,item) }}
            </span>
          </template>
        </el-table-column>
        <el-table-column label="组长类型" min-width="130" prop="expertLeaderType" align="center">
          <template slot-scope="scope">
            {{ scope.row.expertLeaderType }}
          </template>
        </el-table-column>
        <el-table-column label="需推荐候选人" width="100" prop="isRecommendCandidate" align="center">
          <template slot-scope="scope">
            <span v-if="scope.row.isRecommendCandidate!=='00' && scope.row.isRecommendCandidate!=='' && scope.row.isRecommendCandidate!==null">是</span>
          </template>
        </el-table-column>
        <el-table-column v-if="showInfo" label="签到" width="80" prop="signResult" align="center">
          <template slot-scope="scope">
            <span v-if="scope.row.signResult === '01'">是</span>
            <span v-if="scope.row.signResult === '00'">否</span>
          </template>
        </el-table-column>
        <el-table-column v-if="showVoted" label="废标" width="80" prop="isWaste" align="center">
          <template slot-scope="scope">
            <span v-if="scope.row.isWaste === '01'">废标</span>
            <span v-if="scope.row.isWaste === '00'">不废标</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
/* 公共接口*/
import { procurementCommitteeGroupMixin } from '../../procurementCommittee/mixins/procurementCommitteeGroupMixins'
import { probidCommitteeMixin } from '../../procurementCommittee/mixins/procurementCommitteeMixins'
/* api接口*/
import {
  listExpertdrawOffByPackId,
  viewEvalSigninByPackId
} from '@api/procurement/procurementEvaluation'
/* 公用方法*/
import { filterDictText } from '@/assets/js/utils'// 常用方法
/* 混合开发方法-参数字段*/
import { ListMixin } from '@/mixins/ListMixin' // 分页
export default {
  name: 'ExpertLeaderDetail',
  inject: ['getTenderBase'],
  mixins: [procurementCommitteeGroupMixin, probidCommitteeMixin, ListMixin],
  props: {
    showVoted: {
      type: Boolean,
      default: function() {
        return false
      }
    }
  },
  data() {
    return {
      loading: true, // loading效果
      tableData: [], // 推荐组长列表
      getTenderBase: this.getTenderBase(), // 项目基本信息
      metaType: this.$route.meta.type, // 路由meta中type信息 managerView为项目经理查看
      showInfo: false // 是否展示专家的身份证号、手机号、性别等信息
    }
  },
  watch: {
  },
  created() {
    this.initData()
  },
  methods: {
    filterDictText,
    initData() {
      // 关闭loading
      this.loading = false
      // 判断是否为项目经理查看
      if (this.metaType === 'managerView') {
        viewEvalSigninByPackId(this.getTenderBase.packId).then(res => {
          this.tableData = res.data.expertDrawOffVos
          this.paginationData.total = res.data.total
          // 展示专家身份信息
          this.showInfo = true
        })
        return
      }
      // 获取专家列表
      const params = this.getQueryParams()// 查询条件
      listExpertdrawOffByPackId(params).then(res => {
        this.tableData = res.data.records
        this.paginationData.total = res.data.total
      })
    },
    // 查询条件
    getQueryParams() {
      const param = {
        packId: this.getTenderBase.packId, // 标段id
        pageNo: '',
        pageSize: ''
      }
      param.pageNo = this.paginationData.pageNo
      param.pageSize = this.paginationData.pageSize
      return param
    }
  }
}
</script>

<style lang="less" scoped>
.pointer{
  margin: 10px 0;
}
</style>
