<!--
  @description: 审核终止招标列表
  @Modifier: haoFx
  @routerPath: /projectManagement/auditStopbiddingRecord
  @date: 2020/3/12-15:41
-->
<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="search">
      <el-form-item label="终止公告" prop="title">
        <el-input v-model.trim="searchForm.title" placeholder="终止公告" style="width:268px" @keyup.enter.native="search.onSearch" />
      </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
          header-align="center"
          prop="title"
          label="终止公告"
          min-width="230"
        />
        <el-table-column
          header-align="center"
          label="标段（包）编号"
          prop="packNo"
          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="auditBulletin(scope.row)"
            >
              [审核]
            </el-link>
            <el-link
              v-if="auditStatus === '01'"
              type="primary"
              @click="auditBulletin(scope.row)"
            >
              [查看]
            </el-link>
          </template>
        </el-table-column>
      </el-table>
    </template>
  </table-crud>
</template>
<script>
/* api*/
import { getAuditStopbiddingBulletinList } from '@api/bidding/stopbiddingRecord'
/* 混入公共方法*/
import { ListMixin } from '@/mixins/ListMixin'
import { initGroupMixin } from '@/mixins/initGroupMixin' // 公共tabs切换页数据list

export default {
  name: 'AuditBulletiNoticeList',
  components: {
  },
  mixins: [ListMixin, initGroupMixin],
  data() {
    return {
      loading: true,
      // 搜索
      searchForm: {
        tenderName: '', // 项目名称
        title: '' // 标题
      },
      tableData: [], // 列表
      auditStatus: '' // 00待审核 01已审核
    }
  },
  created() {
  },
  methods: {
    // 获取招标公告列表数据
    loadData(params, callback, tabData) {
      this.auditStatus = tabData.typecode // 审核状态
      params.auditStatus = tabData.typecode
      getAuditStopbiddingBulletinList(params).then(response => {
        this.loading = false
        this.tableData = response.data.records
        callback(response.data.total)
      }).catch(() => {
        this.loading = false
      })
    },
    // 审核
    auditBulletin(row) {
      this.$router.push({
        path: '/projectManagement/auditStopbiddingRecordContent',
        query: {
          auditStatus: this.auditStatus
        }
      })
      sessionStorage.setItem('bizId', row.stopbiddingBulletinId)
    }
  }
}
</script>

<style lang="less">

</style>
