<template>
  <div>
    <el-button style="width:100%" type="primary" slot="reference" block size="mini" @click="onShow">领 取</el-button>
  </div>
</template>

<script>
export default {
  name: "receive",
  props:["id"],
  methods:{
    onShow(){
      this.$confirm('确定领取该客户吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.onReceive()
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    async onReceive(){
      const res = await this.$api.requested({
        "id": 20221014160202,
        "content": {
          "sa_customersid":this.id
        },
      })
      this.tool.showMessage(res,() => {
        this.$emit('receiveSuccess')
      })
    }
  }
}
</script>

<style scoped>

</style>