<!--
  @description: 采购计划-集采计划打包-退回计划/退回上报单位-弹框
  @author: lxl
  @date： 2020-11-03 11:32
-->
<template>
  <el-dialog
    :visible.sync="dialogBackPlanData.dialogVisibleBackPlan"
    :before-close="handleCloseDialog"
    :title="dialogBackPlanData.bizTypeCode==='01'?'退回计划':'退回上报单位'"
    width="1000px"
  >
    <div class="main mb10">
      <backPlanAdd
        ref="backPlanAdd"
        :dialog-back-plan-data="dialogBackPlanData"
        :params-id="paramsId"
        @handleCloseDialog="handleCloseDialog"
      />
    </div>
  </el-dialog>
</template>
<script>
import backPlanAdd from './backPlan-add'
export default {
  name: 'BackPlanDialog',
  components: {
    backPlanAdd // 退回计划/退回上报单位编辑组件
  },
  props: {
    dialogBackPlanData: {
      type: Object,
      default: () => {}
    },
    paramsId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      // confirmLoading: false
    }
  },
  watch: {
    'dialogBackPlanData.dialogVisibleBackPlan'(val) {
      if (val) {
        this.$nextTick(() => {
          this.$refs.backPlanAdd.loadData()
        })
      }
    }
  },
  methods: {
    // 关闭弹框
    handleCloseDialog() {
      this.$emit('close')
      this.dialogBackPlanData.dialogVisibleBackPlan = false
    }
  }
}
</script>
<style scoped>
</style>
