<!--
  @description: 发起评审费报销-报销申请-查看标段（包）列表
  @Modifier: sunxinman
  @routerPath:
  @date: 2020/04/14 15:50
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :close-on-click-modal="false"
    :title="title"
    width="1000px"
    append-to-body
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <!--查询列表-->
    <div>
      <el-table
        ref="singleTable"
        :data="list"
        size="mini"
      >
        <el-table-column
          type="index"
          label="序号"
          align="center"
        />
        <el-table-column
          label="项目名称"
          prop="tenderName"
          min-width="300px"

          header-align="center"
        />
        <el-table-column
          label="项目编号"
          align="center"
          prop="tenderNo"
          width="150px"
        />
        <el-table-column
          label="标段（包）名称"
          header-align="center"

          prop="packName"
          min-width="300"
        />
        <el-table-column
          label="标段（包）编号"
          header-align="center"
          prop="packNo"
          min-width="160px"
        />
      </el-table>
      <!--分页组件-->
      <pagination :pagination-data="paginationData" @change="loadData" />
    </div>
  </el-dialog>
</template>

<script>
/* 接口*/
import { queryExpertMeeingPackPageList } from '@/api/intensiveeval/intensiveeval.js'//
/* 公用方法*/
import { filterObj } from '@/assets/js/utils'// 过滤空的key
/* 混合开发方法-参数字段*/
import { ListMixin } from '@/mixins/ListMixin'// 分页
/* 组件*/
import pagination from '@comp/common/pagination/pagination'// 分页
export default {
  name: 'PackageDetailDialog',
  components: {
    pagination// 分页
  },
  mixins: [ListMixin],
  props: {
    // 弹框展示状态
    dialogData: {
      type: Object,
      default: function() {
        return {
          dialog: false,
          meetingId: ''// 会议信息id
        }
      }
    }
  },
  data() {
    return {
      title: '查看标段（包）列表', // 标题
      list: [] // 列表数据
    }
  },
  watch: {
    // 监听-弹框展示状态
    'dialogData.dialog'(val) {
      if (val) {
        // 弹框已打开
        // 加载数据
        this.loadData()
      }
    }
  },
  methods: {
    // 加载数据
    loadData() {
      const params = this.getParams()// 查询条件
      queryExpertMeeingPackPageList(params).then(response => {
        this.list = response.data.records
        this.paginationData.total = response.data.total
      }).catch(() => {

      })
    },
    // 查询条件
    getParams() {
      const param = {
        meetingId: this.dialogData.meetingId, // 会议id
        pageNo: this.paginationData.pageNo,
        pageSize: this.paginationData.pageSize
      }
      return filterObj(param)// 过滤空的key
    }
  }
}
</script>

<style scoped lang="less">

</style>
