<!--
  @description: 运维-结果公示审核列表
  @Modifier: hfx
  @routerPath:/projectManagement//resultBulletinAudit
  @date: 2020/2/19-17:55
-->
<template>
  <table-crud
    ref="tableCrud"
    :search-form="searchForm"
    :tabs="auditStatusList"
    search-label-width="100px"
    @on-load="loadData"
  >
    <template v-slot:header>
      结果公示审核列表
    </template>
    <template v-slot:search="">
      <el-form-item label="结果公示" prop="title">
        <el-input v-model.trim="searchForm.title" placeholder="结果公示" style="width:268px" />
      </el-form-item>
      <el-form-item label="招标项目名称" prop="tenderName">
        <el-input v-model.trim="searchForm.tenderName" placeholder="招标项目名称" style="width:268px" />
      </el-form-item>
    </template>
    <template v-slot:GXTable>
      <el-table
        ref="smallTable"
        v-loading="loading"
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          align="center"
          width="60"
        />
        <el-table-column
          label="结果公示"
          header-align="center"
          prop="title"
          min-width="230"
        />
        <el-table-column
          header-align="center"
          prop="tenderName"
          label="招标项目名称"
          min-width="230"
        />
        <el-table-column
          header-align="center"
          label="包编号"
          prop="packNos"
          align="left"
          min-width="200"
        />
        <el-table-column label="操作" align="center" width="80">
          <template slot-scope="scope">
            <el-link
              v-if="auditStatus === '00'"
              type="primary"
              @click="audit(scope.row)"
            >
              [审核]
            </el-link>
            <el-link
              v-if="auditStatus === '01'"
              type="primary"
              @click="audit(scope.row)"
            >
              [查看]
            </el-link>
          </template>
        </el-table-column>
      </el-table>
    </template>
  </table-crud>
</template>
<script>
/* api*/
import { listWaitAuditTenderWinBidResultBulletinPages } from '@api/bidding/bidCalibration'
/* 混合开发方法-参数字段*/
import { ListMixin } from '@/mixins/ListMixin'
import { initGroupMixin } from '@/mixins/initGroupMixin' // 公共tabs切换页数据list
export default {
  name: 'ConfirmQualifiedResultAuditList',
  components: {
  },
  mixins: [ListMixin, initGroupMixin],
  data() {
    return {
      loading: false,
      // 搜索
      searchForm: {
        tenderName: '', // 项目名称
        title: '' // 公告标题
      },
      tableData: [], // 列表
      auditStatus: '' // 00待审核 01已审核
    }
  },
  created() {
  },
  methods: {
    // 获取数据
    loadData(params, callback, tabData) {
      this.auditStatus = tabData.typecode // 审核状态
      params.auditStatus = tabData.typecode
      listWaitAuditTenderWinBidResultBulletinPages(params).then(response => {
        this.loading = false
        this.tableData = response.data.records
        callback(response.data.total)
      }).catch(() => {
        this.loading = false
      })
    },
    // 审核
    audit(row) {
      this.$router.push({
        path: '/projectManagement/resultBulletinAuditDetail',
        query: {
          auditStatus: this.auditStatus, // 审核状态 00待审核 01已审核
          winBidResultBulletinId: row.id
        }
      })
    }
  }
}
</script>

<style lang="less">

</style>
