<template>
  <div class="inline-16">
    <el-button slot="reference" type="primary" size="mini" @click="onShow">撤 回</el-button>
  </div>
</template>

<script>
export default {
  props:['data'],
  methods:{
    onShow() {
      this.$confirm('确定撤回当前线索吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        closeOnClickModal:false
      }).then(() => {
        this.revoke()
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消撤回操作'
        });
      });
    },
    async revoke () {
      const res = await this.$api.requested({
        "classname": "webmanage.saletool.orderclue.privateclue.PrivateClue",
        "method": "revoke",
        "content": {
          "sat_orderclueid": this.data.sat_orderclueid
        }
      })
      this.tool.showMessage(res,()=>{
        this.$emit('onSuccess')
      })
    }
  }
}

</script>
<style>
</style>