<script>
import { REMOVE } from "@/api/business/purchase/apply";
export default {
  name: "DeleteDialog",
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {
    //
    open(prop) {
      this.$confirm("是否删除数据项?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "info",
      })
        .then(async () => {
          try {
            this.loading = true;
            const { id } = prop;
            const { code } = await REMOVE(id);
            if (code === 200) {
              this.$emit("success");
            }
          } catch (err) {
            // catch
          } finally {
            // finally
          }
        })
        .catch((err) => {
          console.error(err);
        });
    },
  },
  created() {},
  mounted() {},
  destroyed() {},
};
</script>
<template></template>
