<template>
  <div class="remove">
    <img src="@/assets/remove_btn.png" alt="" @click.stop="dialogVisible=true" slot="icon">
    <el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
      <span>该角色已授权，是否确认删除?</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="removeTarget()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: '',
  data () {
    return {
      dialogVisible:false
    };
  },
  props:['teamData'],
  computed: {
  },
  watch: {
  },
  methods: {
    async removeTarget() {
      let res = await this.$api.requested({
        "classname": "sale.team.team",
        "method": "deleteHr",
        "content": {
            "sys_enterprise_hrid": this.teamData.sys_enterprise_hrid
        }
      })
      this.tool.showMessage(res,() => {
        this.$parent.$parent.$parent.$parent.getTeamData()
        this.dialogVisible = false
      })
    },
    handleClose() {
      this.dialogVisible = false
    }
  },
};
</script>

<style scoped>
</style>
