<!--
  @description: 采购计划-集采计划打包-集采转自采
  @author: lxl
  @date： 2020-11-03 14:32
-->
<template>
  <div>
    <el-dialog
      :visible.sync="dialogTurnData.dialogVisibleTurn"
      :before-close="handleCloseDialog"
      title="集采转自采"
      width="1180px"
    >
      <div class="main mb10">
        <turnAdd
          ref="turnAdd"
          :dialog-turn-data="dialogTurnData"
          :params-id="paramsId"
          @handleCloseDialog="handleCloseDialog"
        />
      </div>
    </el-dialog>
  </div>
</template>
<script>
import turnAdd from './turn-add'

export default {
  name: 'TurnDialog',
  components: {
    turnAdd // 集采转自采编辑组件
  },
  props: {
    dialogTurnData: {
      type: Object,
      default: () => {}
    },
    paramsId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      // confirmLoading: false
    }
  },
  watch: {
    'dialogTurnData.dialogVisibleTurn': function(val) {
      if (val) {
        this.$nextTick(() => {
          this.$refs.turnAdd.loadData()
        })
      }
    }
  },
  methods: {
    // 关闭弹框
    handleCloseDialog() {
      this.$emit('close')
      this.dialogTurnData.dialogVisibleTurn = false
    }
  }
}
</script>
<style scoped>

</style>
