<template>
  <div class="inline-16">
    <el-popconfirm title="确定作废当前商机吗？" @confirm="deleteRow()">
      <el-button slot="reference" size="small" type="text">作 废</el-button>
    </el-popconfirm>
  </div>
</template>

<script>
/* 
id:数据id
nameId:接口id
nameKey:接口字段
 */
export default {
  props: ['id','nameId','nameKey'],
  methods: {
    async deleteRow() {
      let res = await this.$api.requested({
        "id":this.nameId,
        "version":1,
        "content": {
            [this.nameKey]:[this.id]
        }
      })
      this.tool.showMessage(res,() => {
        this.$emit('deleteSuccess')
      })
    },
  }
}

</script>
