<template>
  <div>
    <div class="content">
      <dataBreadcrumb :breads="breads"></dataBreadcrumb>
      <el-button class="absolute" type="primary" @click="release">发布流标公告</el-button>
      <dataTable :table-data="tableData" :columns="columns"  url="tender-notice/list" :table-top="100" :page-obj="pageObj">
			<el-table-column slot="auditStatus" label="状态" align="center"  width="100">
			  <template slot-scope="scope">
			    <div v-if="scope.row.auditStatus==0">未审核</div>
						   <div  v-else-if="scope.row.auditStatus==1">审核通过</div>
						    <div v-else>未通过</div>
			  </template>
			</el-table-column>
		<el-table-column slot="operate" label="操作" align="center" fixed="right" width="100">
          <template slot-scope="scope">
            <el-button v-if="scope.row.auditStatus===2" type="text" size="small" @click="handleModify(scope.row.noticeId)">修改 </el-button>
            <el-button v-else type="text" size="small" @click="handleSee(scope.row.noticeId)">查看 </el-button>
          </template>
        </el-table-column>
      </dataTable>
    </div>
  </div>
</template>

<script>
import dataBreadcrumb from '@components/dataBreadcrumb.vue'
import dataTable from '@components/dataTable.vue'
export default {
  components: {
    dataTable,
    dataBreadcrumb
  },
  data() {
    return {
		pageObj: {
		  size: 10,
      currentPage: 1,
      noticeType:"ABORTIVE",
		  func: (currentPage) => {
		    this.pageTurning(currentPage)
		  }
		},
      projectId: 2,
      breads: ['招标管理 ', '招标项目管理', '工作台'],
      tableData: [],
      columns: [{
        label: '公告名称',
        prop: 'title'
      },
      {
        label: '创建时间',
        prop: 'createTime',
        sortable: true
      },
     {
       slot: 'auditStatus'
     },
      // {
      //   label: '备注',
      //   prop: 'reason'
      // },
      {
        slot: 'operate'
      }
      ] /// 操作列

    }
  },
  created() {
	  this.pageObj.projectId=localStorage.getItem("projectId")
  },
  methods: {
    handleModify(id) {
      this.$router.push({
        path: '/purchaser/bid/bidStage/failList/failNotice',
        query: {
          id:id
        }
      })
    },
    release() {
	   this.$router.push("/purchaser/bid/bidStage/failList/failNotice")
    },
    handleSee(id) {
      this.$router.push(`/purchaser/bid/bidStage/failList/see?id=${id}`)
    },
  }
}
</script>

<style scoped>
	.absolute {
		position: absolute;
		top: 65px
	}
</style>
