<!--
  @description: 异议
  @Modifier: 杨胜国
  @routerPath:/procurement/procurementDriveSupplier/procClarificationQuestionSupplier/procObjectionDetail
  @date: 2021-02-08 10:48:06
-->
<template>
  <div>
    <table class="tableData">
      <tr>
        <td>
          问题内容
        </td>
        <td colspan="3">
          {{ formData.questionDescribe }}
        </td>
      </tr>
      <tr>
        <td>
          问题附件
        </td>
        <td colspan="3">
          <downloadFile :data="questionContent" />
        </td>
      </tr>
    </table>
    <div class="but_footer">
      <div class="but_footer-h" />
      <div class="but_footer-but">
        <el-button @click="back">
          返 回
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
/* api*/
import { getEditQuestionInfo } from '@/api/procurement/procurementProject'// 澄清
/* 混合开发方法-参数字段*/
import { clarificationGroupMixin } from '../mixins/clarificationGroupMixin'// 澄清质疑-公用参数
import { clarificationMixin } from '../mixins/clarificationMixin'// 澄清质疑-公用参数
/* 组件*/
import downloadFile from '@comp/common/updownload/downloadFile'
export default {
  name: 'ObjectionDetail',
  components: {
    downloadFile
  },
  mixins: [clarificationMixin, clarificationGroupMixin],
  data() {
    return {
      formData: {},
      // 问题附件
      questionContent: {
        bizId: '',
        fileType: 'procurement_question_content'
      }
    }
  },
  created() {
    // 获取问题详情
    this.getEditQuestionInfo()
  },
  methods: {
    // 采购人-新增时获取澄清版本
    getEditQuestionInfo() {
      const params = {
        questionId: this.$route.params.questionId,
        packId: this.$route.params.packId
      }
      getEditQuestionInfo(params).then(response => {
        this.formData = response.data
        this.questionContent.bizId = response.data.questionId
      }).catch(() => {
      })
    },
    back() {
      // 如果是专家评标-澄清质疑 roleCode 11 采购员  OFF_EXPERT 评标专家
      if (this.roleCode === 'OFF_EXPERT') {
        this.$router.push({
          name: 'procClarificationQuestionExpertList'
        })
      } else {
        this.$router.push({
          name: 'procClarificationQuestionList'
        })
      }
    }
  }
}
</script>

<style scoped>
</style>
