<!--
 * @Description: 采购报价附件上传查看公共组件
 * @Author: gmy
 * @Date: 2020-09-3 15:18:30
   @routerPath:
-->
<template>
  <div>
    <el-dialog
      v-dialogDrag
      :visible.sync="dialogData.dialog"
      :close-on-click-modal="false"
      :lock-scroll="false"
      :title="title"
      width="600px"
      custom-class="el-dialog__body-p8 el-dialog_table"
    >
      <div class="main">
        <!--aswserType 01 展示应发文件  -->
        <div v-show="dialogData.aswserType === '01'">
          <downloadFile ref="fileData" :data="procurementResponseFile" :dis-block="'block'" />
        </div>
        <!--aswserType 02 展示其他文件  -->
        <div v-show="dialogData.aswserType === '02'">
          <downloadFile ref="attachData" :data="procurementAttachFile" :dis-block="'block'" />
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
/* 组件*/
import downloadFile from '@comp/common/updownload/downloadFile'
import { procurementMixins } from '../mixins/procurementMixins'
export default {
  components: {
    downloadFile
  },
  mixins: [procurementMixins],
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return {
          bizId: '', // 报价id
          aswserType: '01', // 应答字段 01 展示应发文件 01 展示应发文件
          dialog: true // 打开弹窗
        }
      }
    }
  },
  data() {
    return {
      title: '', // 标题
      fileData: [], // 应答文件附件数据
      attachData: [], // 其他文件附件
      flag: false
    }
  },
  watch: {
    // 弹框数据
    'dialogData'(val) {
      if (val) {
        // 获取文件id
        this.procurementResponseFile.bizId = this.dialogData.bizId
        this.procurementAttachFile.bizId = this.dialogData.bizId
        if (val.aswserType === '01') {
          this.title = '应答文件'
        } else if (val.aswserType === '02') {
          this.title = '其他文件'
        }
      }
    }
  },
  created() {},
  methods: {}
}
</script>

<style>
</style>

