<!--
  @description: 采购计划-集采计划打包-采购方式变更
  @author: lxl
  @date： 2020-11-03 10:32
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogModifyData.dialogVisibleModify"
    :before-close="handleCloseDialog"
    title="采购方式变更"
    width="800px"
  >
    <div class="main mb10">
      <modifyAdd
        ref="modifyAdd"
        :dialog-modify-data="dialogModifyData"
        :params-id="paramsId"
        @handleCloseDialog="handleCloseDialog"
      />
    </div>
  </el-dialog>
</template>
<script>
import modifyAdd from './modify-add'
export default {
  name: 'ModifyDialog',
  components: {
    modifyAdd // 采购方式变更编辑组件
  },
  props: {
    dialogModifyData: {
      type: Object,
      default: () => {}
    },
    paramsId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
    }
  },
  watch: {
    'dialogModifyData.dialogVisibleModify'(val) {
      if (val) {
        this.$nextTick(() => {
          this.$refs.modifyAdd.loadData()
        })
      }
    }
  },
  methods: {
    // 关闭弹框
    handleCloseDialog() {
      this.$emit('close')
      this.dialogModifyData.dialogVisibleModify = false
    }
  }
}
</script>
<style scoped>
</style>
