<!--
  @description:  专家-申请变更列表
  @Modifier: qrf
  @routerPath: /expert/expertInfoChange
  @date: 2020/10/13-15:56
-->
<template>
  <div>
    <el-table
      ref="smallTable"
      v-loading="loading"
      :data="tableData"
      class="tableLimit"
    >
      <el-table-column
        type="index"
        label="序号"
        width="60px"
        align="center"
      />
      <el-table-column
        prop="expertName"
        align="center"
        label="申请人"
        min-width="170"
      />
      <el-table-column
        align="center"
        prop="createTime"
        label="申请时间"
        min-width="120"
      />
      <el-table-column
        align="center"
        prop="auditStatus"
        label="审核状态"
        min-width="120"
      >
        <template slot-scope="scope">
          <span>{{ filterDictText(auditStatusList, scope.row.auditStatus) }}</span>
        </template>
      </el-table-column>
      <el-table-column
        align="center"
        label="操作"
        width="160"
      >
        <template>
          <el-link
            type="primary"
            @click.stop="changeDetail"
          >
            [查看]
          </el-link>
        </template>
      </el-table-column>
    </el-table>

    <!--分页组件-->
    <pagination :pagination-data="paginationData" @change="loadData" />
  </div>
</template>
<script>
/* api*/
import { getChangeExpertList, getExpertApplyData } from '@/api/expert/expertChange' // 获取变更列表 获取变更id
/* 混合开发方法-参数字段*/
import { ListMixin } from '@/mixins/ListMixin'// 分页
import { filterDictText } from '@/assets/js/utils'
/* 组件*/
import pagination from '@comp/common/pagination/pagination'
// 分页
export default {
  name: 'ExpertChangeInfoList',
  components: {
    pagination // 分页
  },
  mixins: [ListMixin],
  data() {
    return {
      loading: true,
      tableData: []
    }
  },
  created() {
    this.loadData()
    // 字典信息查询的key
    const data = ['auditStatus']
    this.$store.dispatch('getGroupType', data).then(res => {
      this.auditStatusList = res.res.auditStatus.data.typeList
    })
  },
  methods: {
    filterDictText,
    loadData() {
      const data = {
        pageNo: this.paginationData.pageNo,
        pageSize: this.paginationData.pageSize
      }
      getChangeExpertList(data).then(res => {
        this.tableData = res.data.records
        this.paginationData.total = res.data.total
      })
      this.loading = false
    },
    changeDetail() {
      getExpertApplyData().then(res => {
        this.btnLoding = true
        this.$router.push({
          path: 'perfectInfo',
          query: {
            type: this.$route.meta.type, // 页面类型
            applyId: res.data // 变更id
          }
        })
      })
    }
  }
}
</script>

<style lang="less" scoped>
</style>

