<!--
 * @description: 弹窗
 * @author: tangQing
 * @date: 2022-12-28
!-->
<template>
  <div>
    <el-dialog
      v-dialogDrag
      :visible.sync="dialogData.visible"
      :close-on-click-modal="false"
      title="文件上传"
      width="550px"
      custom-class="el-dialog_table"
    >
      <div>
        <upload
          ref="upload"
          :limit="1"
          :data="upLoadData"
          :auto-delete="true"
          :auto-upload="true"
          file-ref="fileRef"
          accept=".pdf"
          title=""
          tip-text="2、请上传已盖章公告pdf文件,不要超过500M。"
          @onSuccess="onSuccess"
        />
      </div>
      <div class="but_footer">
        <div class="but_footer-h">
          <div class="but_footer-but">
            <el-button @click="dialogData.visible= false">
              关 闭
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { webConfirmResultNoticeComplete } from '@api/bidding/bidCalibration'
import upload from '@comp/common/updownload/upload'
export default {
  components: {
    upload
  },
  props: {
    // 弹框展示状态
    dialogData: {
      type: Object,
      default: function() {

      }
    }
  },
  data() {
    return {
      // 文件上传
      upLoadData: {
        bizId: '', // 业务主键Id
        fileType: 'winBidResultNoticeContent '// 文件类型
      }
    }
  },
  created() {
    this.upLoadData.bizId = this.dialogData.noticeId
  },
  methods: {
    onSuccess(val) {
      const data = {
        noticeId: this.upLoadData.bizId, // 公告Id
        fileId: val[0].fileData.fileId// 公告Id
      }
      webConfirmResultNoticeComplete(data).then((res) => {
      })
    }

  }
}
</script>
<style scoped>
.candialg{
  margin-bottom:20px
}
</style>
