<template>
  <div>
    <el-button type="text" size="mini" @click="onShow" :disabled="!tool.checkAuth($route.name,'editProjectTask') || disabled">删除</el-button>
<!--    <el-popconfirm
        title="确定删除该项目吗？"
    >
      <el-button type="text" size="mini" @click="onDel">删除</el-button>
    </el-popconfirm>-->
  </div>
</template>

<script>
export default {
  name: "delProject",
  props:["data","disabled"],
  methods:{
    onShow(){
      console.log(this.data)
      this.$confirm('确定删除该项目吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.onDel()
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    async onDel(){
      const res = await this.$api.requested({
        "id": 20220905165302,
        "content": {
          "sa_salestargetid": [this.data.sa_salestargetid]
        },
      })
      this.tool.showMessage(res,()=>{
        this.$emit("onDel")
      })
    }
  }
}
</script>

<style scoped>

</style>