index.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <script>
  2. import { ALTERATION } 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. return new Promise((resolve, reject) => {
  14. this.$confirm("是否变更数据项?", "提示", {
  15. confirmButtonText: "确定",
  16. cancelButtonText: "取消",
  17. type: "info",
  18. })
  19. .then(async () => {
  20. try {
  21. // try
  22. const { msg, code } = await ALTERATION(prop);
  23. if (code === 200) {
  24. resolve(true);
  25. this.$emit("success");
  26. this.$notify.success(msg);
  27. }
  28. } catch (err) {
  29. // catch
  30. reject(false);
  31. console.error(err);
  32. } finally {
  33. // finally
  34. }
  35. })
  36. .catch(() => reject(false));
  37. });
  38. },
  39. },
  40. created() {},
  41. mounted() {},
  42. destroyed() {},
  43. };
  44. </script>
  45. <template></template>