<!--
  @description: 提交澄清函
  @Modifier: haoFx
  @routerPath:/bidding/projectDrive/clarification/submitClarification
  @date: 2020/3/13-15:46
-->
<template>
  <div>
    <!--澄清函pdf预览-->
    <clarificationLetterPdfDetail />
    <!--保存按钮-->
    <div class="but_footer">
      <div class="but_footer-h" />
      <div class="but_footer-but">
        <el-button @click="editorClarify">
          编辑
        </el-button>
        <el-button :loading="confirmLoading" type="primary" @click="submit">
          提交
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
/* api*/
import { submitClarificationInfo } from '@/api/bidding/bidClarification'// 澄清
/* 组件*/
import clarificationLetterPdfDetail from '../clarificationPM/publishClarification/clarificationLetterPdf-detail'
export default {
  name: 'SubmitClarification',
  components: {
    clarificationLetterPdfDetail
  },
  data() {
    return {
      confirmLoading: false // 控制按钮重复点击Loding
    }
  },
  methods: {
    // 编辑澄清
    editorClarify() {
      this.$router.push({
        path: '/bidding/projectDrive/clarificationQuestionReply/clarificationQuestionAdd',
        query: {
          ...this.$route.query
        }
      })
    },
    // 提交
    submit() {
      this.$confirm('是否确认提交?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        confirmButtonClass: 'confirmBtn',
        cancelButtonClass: 'cancelBtn',
        type: 'warning'
      }).then(() => {
        const data = {
          clarificationId: this.$route.query.clarificationId, // 澄清Id
          processInitDto: {} // 审核人信息传回得信息
        }
        this.confirmLoading = true
        submitClarificationInfo(data).then(res => {
          this.$router.push({
            path: '/bidding/projectDrive/clarificationQuestionReply/clarificationQuestionList',
            query: {
              ...this.$route.query
            }
          })
          this.confirmLoading = false
        })
      }).catch(() => {
        this.confirmLoading = false
      })
    }
  }
}
</script>

<style scoped>

</style>
