<!--
  @description: 认领项目-查看详情
  @Modifier: haoFx
  @routerPath: /bidProjectClaim/bidProjectClaimDetail
  @date: 2019/12/30-15:03
-->

<template>
  <div>
    <section class="title p0-16 clearfix">
      <div class="title-back pointer" @click="back">
        <i class="iconfont icon-fanhui mr10" />认领项目
      </div>
    </section>
    <!-- 预览页面-->
    <bidProjectPreviewComp class="p0-16" />
    <!--保存按钮-->
    <div class="but_footer">
      <div class="but_footer-h">
        <div class="but_footer-but">
          <el-button :loading="confirmLoading" type="primary" @click="claim('formBidderData')">
            认领
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
/* 接口*/
import { executeClaimProject } from '@/api/bidding/biddingProject'
import bidProjectPreviewComp from '../bidProjectPreview/bidProjectPreviewComp'
export default {
  name: 'BidProjectClaimDetail',
  components: {
    bidProjectPreviewComp
  },
  data() {
    return {
      confirmLoading: false,
      tenderId: this.$route.params.id
    }
  },
  created() {
  },
  methods: {
    // 认领项目
    claim() {
      this.$confirm('确认认领该项目吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        confirmButtonClass: 'confirmBtn',
        cancelButtonClass: 'cancelBtn',
        type: 'warning'
      }).then(() => {
        executeClaimProject(this.tenderId).then(() => {
          this.$message({
            type: 'success',
            message: '操作成功'
          })
          this.back()
        }).catch(() => {
        })
      })
    },
    // 返回
    back() {
      this.$router.push({
        path: '/bidding/bidProjectClaimList'
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>
