<!--
  @description: 查看保函
  @Modifier: sunxinman
  @routerPath: /fee/letterDetail
  @date: 2020/03/30-16:30
-->
<template>
  <div>
    <section class="title p0-16 clearfix">
      <!-- 返回 -->
      <div class="title-back pointer" @click="back()">
        <i class="iconfont icon-fanhui mr10" />查看保函
      </div>
    </section>
    <section class="p0-16">
      <!-- 表格部分 -->
      <table class="tableData">
        <tr>
          <td>项目编号</td>
          <td>{{ formData.tenderNo }}</td>
          <td>项目名称</td>
          <td>{{ formData.tenderName }}</td>
        </tr>
        <tr>
          <td>标段（包）编号</td>
          <td>{{ formData.packNo }}</td>
          <td>标段（包）名称</td>
          <td>{{ formData.packName }}</td>
        </tr>
        <tr>
          <td>投标人</td>
          <td>{{ formData.supplierName }}</td>
          <td>支付方式</td>
          <td>保函</td>
        </tr>
        <tr>
          <td>金额（元）</td>
          <td>{{ formData.amount }}</td>
          <td>币种</td>
          <td>
            <span
              v-for="(item,index) in currencyList"
              v-if="formData.currency === item.typecode"
              :key="index"
            > {{ item.typename }}</span>
          </td>
        </tr>
        <tr>
          <td>保函有效期</td>
          <td>
            {{ formData.startTime && $Moment(formData.startTime).format(momentDateTime) }} - {{ formData.endTime && $Moment(formData.endTime).format(momentDateTime) }}
          </td>
          <td>保函出具单位</td>
          <td>{{ formData.issueDepart }}</td>
        </tr>
        <tr>
          <td>保函扫描件</td>
          <td colspan="3">
            <downloadFile :data="letterUpLoadData" />
          </td>
          <!--       <td>发票类型</td>
          <td>
            <span
              v-for="(item,index) in invoiceTypeList"
              v-if="formData.invoiceType === item.typecode"
              :key="index"
            > {{ item.typename }}</span>
          </td>-->
        </tr>
        <tr>
          <td>保函出具时间</td>
          <td>
            {{ formData.issueTime && $Moment(formData.issueTime).format(momentDateTime) }}
          </td>
          <td>接收时间</td>
          <td>
            {{ formData.receiveTime && $Moment(formData.receiveTime).format(momentDateTime) }}
          </td>
        </tr>
        <tr>
          <td>备注</td>
          <td colspan="3">
            {{ formData.remark }}
          </td>
        </tr>
      </table>
    </section>
    <!--操作按钮-->
    <div class="but_footer">
      <div class="but_footer-h">
        <div class="but_footer-but">
          <el-button @click="back">
            关闭
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
/* 接口*/
import { detailGuaranteeInfo } from '@api/fee/bailfee'
/* 混合开发方法-参数字段*/
import { cashDepositGroupMixin } from '../../mixins/cashDepositGroupMixin'
import { cashDepositMixin } from '../../mixins/cashDepositMixin'
/* 组件*/
import downloadFile from '@comp/common/updownload/downloadFile' // 获取附件信息 下载组件
export default {
  name: 'LetterDetail',
  components: {
    downloadFile// 文件下载
  },
  mixins: [cashDepositGroupMixin, cashDepositMixin],
  data() {
    return {
      guaranteeId: this.$route.params.guaranteeId, // 保函id
      formData: {}
    }
  },
  created() {
    this.letterUpLoadData.bizId = this.guaranteeId
    this.getDetailGuaranteeInfo()
  },
  methods: {
    // 获取数据
    getDetailGuaranteeInfo() {
      detailGuaranteeInfo(this.guaranteeId).then(res => {
        this.formData = res.data
      })
    },
    // 返回
    back() {
      this.$router.push({
        path: '/fee/letterManage',
        name: 'LetterManageList',
        params: {
          packId: this.$route.params.packId
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>

</style>
