<template>
  <div>
    <el-button  size="mini" :type="!disabled?'':'primary'" slot="reference" @click="onFinish" :disabled="!disabled">结 束</el-button>
  </div>
</template>

<script>
export default {
  name: "finish",
  props:['disabled'],
  methods:{
    onFinish() {
      this.$confirm('确定结束当前项目吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        const res = await this.$api.requested({
          "id": 20221215163702,
          "content": {
            "sa_projectid": this.$route.query.id
          },
        })
        this.tool.showMessage(res,()=>{
          this.$emit("onFinish")
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消结束项目'
        });
      });
    }
  }
}
</script>

<style scoped>

</style>