<template>
  <div >
    <div class="content">
      <dataBreadcrumb :breads="breads"></dataBreadcrumb>
      <changeNav :navs="navs"></changeNav>
      <dataTable :table-data="tableData" :columns="columns" :is-pageobj="false" :checklist="checklist">
        <el-table-column slot="operate" label="状态" align="center" fixed="right" >
          <template slot-scope="scope">
            <div v-if="scope.row.status=='CONTRACT_COMPLETE'">合同已完成</div>
            <div v-if="scope.row.status=='PRE_BIDDER_CONTRACT'">待供应商签署合同</div>
            <div v-if="scope.row.status=='PRE_TENDERER_CONTRACT'">待采购商签署合同</div>
            <div v-if="scope.row.status=='PRE_PLATFORM_TO_BIDDER_CONTRACT'">等待与供应商签署合同</div>
            <div v-if="scope.row.status=='PRE_PLATFORM_TO_TENDER_CONTRACT'">等待与采购商签署合同</div>
			<div v-if="scope.row.status=='WAIT_CONTRACT_UPLOAD'">等待合同上传</div>
          </template>
        </el-table-column>
        <el-table-column slot="operate" label="操作" align="center" fixed="right" width="200">
          <template slot-scope="scope">
            <div v-if="scope.row.state==0||scope.row.state==1">
              <el-button type="text" size="small" @click="contractSign(scope.row)">合同签署</el-button>
            </div>
            <div v-if="scope.row.state==2">
              <el-button type="text" size="small" @click="contractSee(scope.row)">合同查看</el-button>
              <el-button type="text" size="small" @click="upload(scope.row)">上传凭证</el-button>
            </div>
            <div v-if="scope.row.state==3">
              <el-button type="text" size="small" @click="contractSign(scope.row)">合同签署</el-button>
              <el-button type="text" size="small" @click="voucherSign(scope.row)">编辑凭证</el-button>
            </div>
            <div v-if="scope.row.state==4">
              <el-button type="text" size="small" @click="contractSign(scope.row)">合同查看</el-button>
              <el-button type="text" size="small" @click="voucherSee(scope.row)">查看凭证</el-button>
            </div>
          </template>
        </el-table-column>
      </dataTable>
    </div>
  </div>
</template>

<script>
import dataTable from '@components/nopageTable.vue'
import dataBreadcrumb from '@components/dataBreadcrumb.vue'
import changeNav from '@components/changeNav.vue'
export default {
  name: 'bidingList',
  components: {
    dataTable,
    dataBreadcrumb,
    changeNav
  },
  data() {
    return {
      checklist: [{
        title: '采购商',
        type: 'input',
        model: 'supply'
      }, {
        title: '状态',
        type: 'select',
        selectlist: [{
          value: '1',
          label: '公开招标'
        }, {
          value: '2',
          label: '邀请招标'
        }],
        change: row => '',
        model: 'state'
      }
      ],		
      breads: ['应收账款买断管理', '应收账款买断列表'],
      navs: ['应收账款买断列表'],
      tableData: [],
      columns: [{
        label: '供应商（中标）',
        prop: 'supply'
      },
      {
        label: '项目名称',
        prop: 'projectName'
      },
      {
        slot: 'operate'
      }
      ], // 操作列
     
      pageObj: {
        size: 10,
        total: 1,
        currentPage: 1,
        sizes: [100, 200, 300],
        func: (currentPage) => {
          this.pageTurning(currentPage)
        }
      }
    }
  },
  methods: {
    contractSign() {
      this.$router.push('/supply/buyOut/contractSign')
    },
    contractSee() {
      this.$router.push('/supply/buyOut/contractSee')
    },
    voucherSee() {
      this.$router.push('/supply/buyOut/voucherSee')
    },
    voucherSign() {
      this.$router.push('/supply/buyOut/voucherSign')
    },
    upload() {
      this.$router.push('/supply/buyOut/upload')
    }
  }
}
</script>

<style scoped>
	
</style>
