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