index.vue 922 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <script>
  2. import { REMOVE } from "@/api/business/purchase/contract";
  3. export default {
  4. name: "DeleteDialog",
  5. data() {
  6. return {};
  7. },
  8. computed: {},
  9. watch: {},
  10. methods: {
  11. //
  12. open(prop) {
  13. this.$confirm("是否删除数据项?", "提示", {
  14. confirmButtonText: "确定",
  15. cancelButtonText: "取消",
  16. type: "info",
  17. })
  18. .then(async () => {
  19. try {
  20. // try
  21. const { msg, code } = await REMOVE(prop);
  22. if (code === 200) {
  23. this.$emit("success");
  24. this.$notify.success(msg);
  25. }
  26. } catch (err) {
  27. // catch
  28. console.error(err);
  29. } finally {
  30. // finally
  31. }
  32. })
  33. .catch((err) => {
  34. console.error(err);
  35. });
  36. },
  37. },
  38. created() {},
  39. mounted() {},
  40. destroyed() {},
  41. };
  42. </script>
  43. <template></template>