<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="notice/list" :table-top="60" :page-obj="pageObj">
        <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.id)">修改 </el-button>
            <el-button v-else type="text" size="small" @click="handleSee(scope.row.id)">查看 </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
      },
      {
        label: '状态',
        prop: 'Status'
      },
      {
        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}`)
    },
  async getabortiveList() {
    try {
  	  let message={};
  	  message.projectId=localStorage.getItem("projectId");
  	  message.type="ABORTIVE"
      const {
        data,
        code
      } = await simpleList(message)
      if (code === 200) {
        this.tableData = data
      }
    } catch (e) {
      console.log(e)
    }
  }
  }
}
</script>

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