<!--
 * @Description: 采购计划-查看附件
 * @Author: lxl
 * @Date: 2020-11-17 16:00
-->
<template>
  <div>
    <el-dialog
      v-dialogDrag
      :visible.sync="dialogFileData.checkFileVisible"
      :close-on-click-modal="false"
      :lock-scroll="false"
      append-to-body
      title="附件列表"
      width="700px"
      custom-class="el-dialog__body-p8 el-dialog_table"
    >
      <downloadFile v-if="nextDoc" :data="principalData" :dis-block="'block'" />
    </el-dialog>
  </div>
</template>

<script>
/* 公共组件 */
import downloadFile from '@comp/common/updownload/downloadFile'
export default {
  name: 'CheckFIleCompDialog',
  components: {
    // upload,
    downloadFile
  },
  props: {
    dialogFileData: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      nextDoc: true, // 组件刷新状态
      principalData: {
        bizId: '', // 业务id
        fileType: '' // 文件类型
      }
    }
  },
  watch: {
    'dialogFileData.checkFileVisible'(val) {
      if (val) {
        this.nextDoc = false
        this.$nextTick(() => {
          this.nextDoc = true
          this.principalData.bizId = this.dialogFileData.bizId
          this.principalData.fileType = this.dialogFileData.fileType || 'prot_procurement_plan_detail_attr_base'
          this.dialogFileData.bizId = ''
          this.dialogFileData.fileType = ''
        })
      }
    }
  }
}
</script>

<style>

</style>
