<template>
  <div>
    <el-button size="small" class="inline-16" :type="length === 0?'':'primary'" @click="onshow" :disabled="length === 0">批量删除</el-button>
  </div>
</template>

<script>
export default {
  name: "batchDeletion",
  props:["sys_object","ownerids"],
  data(){
    return {
      length:0
    }
  },
  methods:{
    onshow() {
      this.$confirm('是否确认彻底删除数据，一旦删除，无法恢复?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        closeOnClickModal:false,
        type: 'warning'
      }).then(() => {
        this.onDel()
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    async onDel(){
      const res = await this.$api.requested({
        "id": 20230103131204,
        "content": {
          "sys_object": this.sys_object,//1-线索,2-客户,3-合同,4-项目商机,5-报价单
          "ownerids": this.ownerids
        }
      })
      this.tool.showMessage(res,()=>{
        this.$emit("delSuccess")
      })
    }
  }
}
</script>

<style scoped>

</style>