del.vue 699 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div class="inline-16">
  3. <el-popconfirm title="确定作废当前商机吗?" @confirm="deleteRow()">
  4. <el-button slot="reference" size="small" type="text">作 废</el-button>
  5. </el-popconfirm>
  6. </div>
  7. </template>
  8. <script>
  9. /*
  10. id:数据id
  11. nameId:接口id
  12. nameKey:接口字段
  13. */
  14. export default {
  15. props: ['id','nameId','nameKey'],
  16. methods: {
  17. async deleteRow() {
  18. let res = await this.$api.requested({
  19.     "id":this.nameId,
  20.     "version":1,
  21.     "content": {
  22.         [this.nameKey]:[this.id]
  23.     }
  24. })
  25. this.tool.showMessage(res,() => {
  26. this.$emit('deleteSuccess')
  27. })
  28. },
  29. }
  30. }
  31. </script>