<template>
  <div style="display:inline;margin-left:10px">
    <el-popconfirm
      title="确定删除吗？"
      @confirm="deleteRow">
      <el-button size="small" :type="type" :icon="icon" slot="reference">删 除</el-button>
    </el-popconfirm>
  </div>
</template>

<script>
export default {
  props:['data','type','icon'],
  methods:{
    deleteRow () {
      this.$api.requested({
        "classname": "webmanage.sale.agents.agents",
        "method": "delete_agent",
        "content": {
          "sa_agentsid":this.data.sa_agentsid
        }
      }).then(res=>{
        this.tool.showMessage(res)
        this.type === 'default'?this.$router.go(-1):this.$emit('onAgentSuccess')
      })
    },
  }
}

</script>
<style>
</style>