
<!--
  @description:采购立项-项目管理-是否发送成交通知书查看页
  @Modifier:wxy/gmy
  @routerPath:/procurement/procurementDrive/procurementAdvicenoteList
  @date:2020/7/15-16:37
-->
<template>
  <div class="main">
    <el-table
      ref="multipleTable"
      :data="tableData"
      style="width: 100%"
    >
      <el-table-column type="index" label="序号" width="55px" align="center" />
      <el-table-column prop="supplierName" label="供应商名称" min-width="300" align="left" />
      <el-table-column prop="contacts" label="联系人" min-width="120" align="center" />
      <el-table-column prop="contactsTelephone" label="联系电话" min-width="120" align="center" />
      <el-table-column label="是否中标" min-width="80" align="center">
        <template slot-scope="scope">
          <!-- isWinBiding是否中标字段 00 否 01 是   -->
          <span v-if="scope.row.isWinBiding === '00'">否</span>
          <span v-else>是</span>
        </template>
      </el-table-column>
      <el-table-column label="发送时间" min-width="150" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.sendTime }}</span>
        </template>
      </el-table-column>
      <el-table-column label="供应商查收时间" min-width="150" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.receiveTime }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" min-width="100" align="center">
        <template slot-scope="scope">
          <gx-link
            v-if="scope.row.isWinBiding !== '00'"
            :code="'001_009_001'"
            :underline="false"
            size="mini"
            type="primary"
            @click="lookAdvicenote(scope.row)"
          >
            [查看通知书]
          </gx-link>
        </template>
      </el-table-column>
    </el-table>
    <!--分页组件-->
    <pagination :pagination-data="paginationData" @change="initData" />
  </div>
</template>

<script>
/** api */
import { listProcurementNoticePages } from '@/api/procurement/procurementResult'
/* 组件*/
import pagination from '@comp/common/pagination/pagination' // 分页
/* 公共方法*/
import { ListMixin } from '@/mixins/ListMixin' // 分页
import { filterObj } from '@/assets/js/utils' // 深拷贝
export default {
  name: 'ProcurementYetNoAdvicenoteListVue',
  inject: ['getTenderBase'],
  components: {
    pagination // 分页
  },
  mixins: [ListMixin],
  data() {
    return {
      tableData: [],
      // 搜索数据
      searchData: {
        packId: '' // 标段id
      },
      tenderBase: this.getTenderBase() // 获取项目信息
    }
  },
  created() {
    // 初始化查询成交通知书列表信息
    this.initData()
  },
  methods: {
    // 查询条件
    getQueryParams() {
      const param = Object.assign({}, this.searchForm)
      param.pageNo = this.paginationData.pageNo
      param.pageSize = this.paginationData.pageSize
      return filterObj(param)
    },
    // 获取成交通知书列表
    initData() {
      // 查询条件
      const params = this.getQueryParams()
      params.packId = this.tenderBase.packId
      listProcurementNoticePages(params)
        .then(res => {
          this.tableData = res.data.records
          this.paginationData.total = res.data.total
        })
        .catch(() => {})
    },
    // 跳转查看通知书页面
    lookAdvicenote(row) {
      this.$router.push({
        path: '/procurement/procurementDrive/procurementAdvicenoteResult',
        query: {
          winningResultId: row.winningResultId, // 中选结果id
          supplierId: row.supplierId // 供应商id
        }
      })
    }
  }
}
</script>

<style>
</style>
