<!--
  @description: 评标大厅-供应商列表
  @Modifier：yf/wxy
  @routerPath:
  @date2020-8-4- 11:39:19
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :close-on-click-modal="false"
    :lock-scroll="false"
    title="供应商列表"
    width="840px"
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <!--供应商列表-->
    <div class="p16">
      <el-table
        ref="smallTable"
        v-loading="loading"
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          header-align="center"
          align="center"
          width="60"
        />
        <el-table-column
          prop="departname"
          label="供应商名称"
          header-align="center"
          align="left"
          min-width="130"
        />
        <el-table-column
          label="统一社会信用代码"
          prop="orgCode"
          header-align="center"
          align="center"
          width="180"
        />
        <el-table-column
          prop="address"
          label="地址"
          min-width="150"
          header-align="center"
          align="left"
        />
      </el-table>
      <!--分页组件-->
      <pagination :pagination-data="paginationData" @change="loadData" />
    </div>
  </el-dialog>
</template>

<script>
/* api接口*/
import { listProcurementSignUpByPackId } from '@api/procurement/procurementEvaluation'
/* 公共参数方法*/
import { ListMixin } from '@/mixins/ListMixin'
/* 分页组件*/
import pagination from '@comp/common/pagination/pagination'
export default {
  name: 'SupplierListDialog',
  components: {
    pagination // 分页组件
  },
  mixins: [ListMixin],
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return {
          dialog: false // false 关闭弹框  true 打开弹框
        }
      }
    },
    getTenderBase: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      loading: true,
      tableData: [] // 供应商数据
    }
  },
  watch: {
    'dialogData.dialog'(val) {
      // 打开弹框加载数据
      if (val) {
        this.loadData()
      }
    }
  },
  mounted() {
  },
  methods: {
    // 加载数据
    loadData() {
      // 请求参数
      const params = {
        packId: this.getTenderBase.packId,
        pageNo: this.paginationData.pageNo,
        pageSize: this.paginationData.pageSize
      }
      // 调接口
      listProcurementSignUpByPackId(params).then(res => {
        this.loading = false
        this.tableData = res.data.records // 供应商数据
        this.paginationData.total = res.data.total
      }).catch(() => {
        this.loading = false
      })
    }
  }
}
</script>

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