<!--
  @description: 组建评标委员会-招标人代理机构录入情况--查看
  @author:肖文龙
  @date: 2020年3月11日12:19:41
-->
<template>
  <div>
    <el-table
      ref="smallTable"
      v-loading="loading"
      :data="tableData"
    >
      <el-table-column
        prop="packNo"
        align="center"
        label="标段（包）编号"
        min-width="200"
      />
      <el-table-column
        header-align="center"
        prop="packName"
        label="标段（包）名称"
        min-width="300"
      />
      <el-table-column
        header-align="center"
        prop="tenderManager"
        label="项目经理"
        min-width="120"
        align="center"
      />
      <el-table-column
        header-align="center"
        prop="linkPhone"
        label="联系方式"
        min-width="120"
        align="center"
      />
      <el-table-column
        header-align="center"
        prop="isAssignRepresent"
        label="是否已指定为招标人代表"
        min-width="160"
        align="center"
      >
        <template slot-scope="scope">
          <span
            v-for="(item,index) in agentTendererList"
            v-if="scope.row.isAssignRepresent===item.typecode"
            :key="index"
          >{{ item.typename }}</span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="isTypes==='00'"
        header-align="center"
        label="操作"
        align="center"
        width="80"
      >
        <template slot-scope="scope">
          <el-link
            type="primary"
            @click="deleteRow(scope.row,scope.$index)"
          >
            [删除]
          </el-link>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页-->
    <pagination :pagination-data="paginationData" />
  </div>
</template>

<script>
/* api*/
import { queryRepresentsByGroupIdPages } from '@/api/intensiveeval/intensiveeval'
/* 混合开发*/
import { groupMixin } from '@/views/intensiveeval/mixins/intensiveevalGroupMixin'// 字典信息
import { ListMixin } from '@/mixins/ListMixin'// 分页
/* 组件*/
import pagination from '@comp/common/pagination/pagination'// 分页
export default {
  name: 'AgentTendererDetail',
  components: {
    pagination
  },
  mixins: [groupMixin, ListMixin],
  data() {
    return {
      isTypes: this.$route.meta.isTypes, // 当前使用此页面的角色 00 （代理机构）项目经理-项目驱动 null 牵头人-组建评标委员会
      loading: false, // 刷新loading
      searchForm: {
        groupId: this.$route.query.groupId, // 评委会Id
        pageNo: 1,
        pageSize: 10
      },
      // 评标委员会列表
      tableData: []
    }
  },
  created() {
    this.loadData()// 获取数据
  },
  methods: {
    // 获取数据
    loadData() {
      this.loading = true
      const params = this.getQueryParams()// 查询条件
      queryRepresentsByGroupIdPages(params).then(response => {
        this.tableData = response.data.records
        this.paginationData.total = response.data.total
        this.loading = false
      }).catch(() => {

      })
    },
    // 查询条件
    getQueryParams() {
      const param = Object.assign({}, this.searchForm)
      param.pageNo = this.paginationData.pageNo
      param.pageSize = this.paginationData.pageSize
      return param
    }
  }
}
</script>

<style lang="less" scoped>

</style>
