<template>
  <my-drawer
    class="sop-dialog"
    :visible="visible"
    header="计划变更报备"
    size="80%"
    attach="body"
    :closeOnOverlayClick="false"
    :close-btn="true"
    :footer="false"
    @close="emit('update:visible', false)"
  >
    <plan-change
      v-if="visible"
      :sop="sop"
      :type="type"
      @confirm="stepConfirm"
      @cancel="emit('update:visible', false)"
    ></plan-change>
  </my-drawer>
</template>

<script setup name="PlanChangeDialog">
import PlanChange from './index.vue';

const emit = defineEmits(['update:visible', 'confirm', 'concel']);
const props = defineProps({
  visible: Boolean,
  sop: {
    type: Object,
    default() {
      return {};
    },
  },
  type: {
    type: String,
    default: 'new',
  },
});

const stepConfirm = () => {
  emit('update:visible', false);
  emit('confirm');
};
</script>
