<script>
import { REMOVE } from "@/api/business/purchase/contract";

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