index.vue 989 B

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