<!--
  @description: 审核重新招标列表
  @Modifier: haoFx
  @routerPath: /projectManagement/auditChangeBulletin
  @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="tenderName">
        <el-input v-model.trim="searchForm.tenderName" 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="tenderName"
          label="招标项目名称"
          min-width="230"
        />
        <el-table-column
          header-align="center"
          label="标段（包）编号"
          prop="packNo"
          align="left"
          min-width="200"
        />
        <!--          <el-table-column
            label="是否重新制作招标文件"
            header-align="center"
            prop="isChangeDoc"
            min-width="100"
          >
            <template slot-scope="scope">
              <span v-if="scope.row.isChangeDoc==='01'">是</span>
              <span v-if="scope.row.isChangeDoc==='00'">否</span>
            </template>
          </el-table-column>-->
        <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 { getRebiddingRecordAuditList } from '@api/bidding/rebiddingRecord'
/* 混入公共方法*/
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
      getRebiddingRecordAuditList(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/auditRebiddingRecordContent',
        query: {
          auditStatus: this.auditStatus // 00待审核 01已审核
        }
      })
      sessionStorage.setItem('bizId', row.rebiddingRecordId)
    }
  }
}
</script>

<style lang="less">

</style>
