delete.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <div>
  3. <el-button size="mini" @click="dialog=true">删除</el-button>
  4. <el-dialog append-to-body width="30%" title="作废" :visible.sync="dialog">
  5. <el-input type="textarea" size="small" placeholder="作废原因"></el-input>
  6. <div class="dialog-footer">
  7. <el-button size="small" @click="dialog = false" class="normal-btn-width">取 消</el-button>
  8. <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
  9. </div>
  10. </el-dialog>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: '',
  16. data() {
  17. return {
  18. dialog:false,
  19. deletereason:''
  20. };
  21. },
  22. props:['idName','idKey','id'],
  23. computed:{
  24. },
  25. watch:{
  26. },
  27. methods: {
  28. async onSubmit () {
  29. let res = await this.$api.requested({
  30. "id": this.idName,
  31. "content": {
  32. [this.idKey]: [this.id],
  33. "deletereason":this.deletereason
  34. },
  35. })
  36. this.tool.showMessage(res,() => {
  37. this.dialog = false
  38. this.$store.dispatch('changeDetailDrawer',false)
  39. this.$emit('onSuccess')
  40. })
  41. }
  42. },
  43. };
  44. </script>
  45. <style scoped>
  46. </style>