<!--
  @description: 招标人信息库-列表
  @Modifier: haofengxian
  @routerPath: /informationbase/tendereeInfoList
  @date: 2020-5-8-11:20
-->
<template>
  <table-crud
    :search-form="searchForm"
    search-label-width="153px"
    @on-load="loadData"
  >
    <template v-slot:header>
      招标人信息库
    </template>
    <template v-slot:search="search">
      <el-form-item ref="departName" label="招标人名称" prop="departName">
        <el-input
          v-model.trim="searchForm.departName"
          width="228px"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>
      <el-form-item ref="ecmmerceCode" label="公司编号（电商平台）" prop="ecmmerceCode">
        <el-input
          v-model.trim="searchForm.ecmmerceCode"
          width="228px"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>
    </template>
    <template v-slot:GXTable>
      <el-table
        ref="smallTable"
        v-loading="loading"
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          width="60px"
          align="center"
        />
        <el-table-column
          prop="departName"
          label="招标人名称"
          min-width="230"
        />
        <el-table-column
          header-align="center"
          prop="ecmmerceCode"
          label="电商公司编号（电商平台）"
          width="200"
        />
        <el-table-column
          header-align="center"
          prop="orgCode"
          label="公司编码（集团）"
          width="200"
          align="center"
        />
        <el-table-column
          header-align="center"

          label="上级单位名称"
          prop="parentDepartName"
          min-width="230"
        />
        <el-table-column
          label="联系人"
          prop="linkerName"
          align="center"
          width="110"
        />
        <el-table-column
          label="联系电话"
          prop="mobilePhone"
          align="center"
          min-width="110"
        />
        <el-table-column
          header-align="center"
          label="操作"
          width="200"
        >
          <template slot-scope="scope">
            <el-link
              type="primary"
              @click.stop="checkBidderInfo(scope.row)"
            >
              [查看]
            </el-link>
            <el-link
              type="primary"
              @click.stop="examineBidderResume(scope.row)"
            >
              [招标人履历]
            </el-link>
            <el-link
              type="primary"
              @click.stop="contacts(scope.row)"
            >
              [联系人]
            </el-link>
          </template>
        </el-table-column>
      </el-table>
    </template>
  </table-crud>
</template>

<script>
/* 接口*/
import { queryUserListByRoleName } from '@api/common/user'
export default {
  name: 'RepresentativeTendereeList',
  data() {
    return {
      loading: true,
      // 搜索
      searchForm: {
        tenderName: '', // 项目名称
        ecmmerceCode: '' // 公司编号（电商平台）
      },
      tableData: []
    }
  },
  methods: {
    // 获取数据
    loadData(params, callback) {
      const data = {
        ...params,
        departRoleName: '10'
      }
      queryUserListByRoleName(data).then(response => {
        this.loading = false
        this.tableData = response.data.records
        callback(response.data.total)
      }).catch(() => {
      })
    },
    // 查看
    checkBidderInfo(row) {
      this.$router.push({
        path: '/informationbase/tendereeInfoDetail',
        name: 'TendereeInfoDetail',
        params: {
          id: row.id
        }
      })
    },
    // 联系人
    contacts(row) {
      this.$router.push({
        path: '/informationbase/contactsInfo',
        name: 'ContactsInfo',
        params: {
          id: row.id
        }
      })
    },
    // 查看招标人履历
    examineBidderResume(row) {
      this.$router.push({
        path: '/informationbase/tendereeResumeList',
        name: 'TendereeResumeList',
        params: {
          id: row.id
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
