<template>
  <div>
    <el-button type="text" size="mini" @click="dialogVisible = true" :disabled="data.isdefault === 1 || data.num_customer !== 0">删 除</el-button>
    <el-dialog
        title="删除公海池"
        :visible.sync="dialogVisible"
        width="30%"
        append-to-body
        >
      <span>一旦删除该公海池，将删除该公海池的所有线索，是否确认删除该公海池</span>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false" size="small">取 消</el-button>
    <el-button type="primary" size="small" @click="onSubmit">确 定</el-button>
  </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "delBtn",
  props:["data"],
  data(){
    return {
      dialogVisible:false
    }
  },
  methods:{
    async onSubmit(){
      console.log("删除",this.id)
      const res = await this.$api.requested({
        "id": 20221009100602,
        "content": {
          "sa_customerpoolids": [
            this.data.sa_customerpoolid
          ]
        },
      })
      this.tool.showMessage(res,()=>{
        this.dialogVisible = false
        this.$emit("delSuccess")
      })
    }
  }
}
</script>

<style scoped>

</style>