<!--
  @description: 财务报告信息
  @Modifier: ht
  @date: 2020-7-17-10:57
-->
<template>
    <div>
        <div class="title p0-16 clearfix">
            <div class="title-back pointer" @click="back">
                <i class="iconfont icon-fanhui mr10" />财务报告信息
            </div>
        </div>
        <div :class="invitationDetailType = 'view'">
            <!--项目信息-->
            <dl class="projectInfoDetail">
                <dt>
                    <p class="projectInfoDetail_icon">
                        <i class="iconfont icon-xiangmujibenxinxi" />
                    </p>
                    财务报告信息
                </dt>
                <dd>
                    <table class="tableData">
                        <tr>
                            <td>年度</td>
                            <td>{{ formData.annual }}</td>
                            <td>资产总计(万元)</td>
                            <td>{{ formData.total }}</td>
                        </tr>
                        <tr>
                            <td>营业收入(万元)</td>
                            <td>{{ formData.operatingIncome }}</td>
                            <td>资产负债率（%）</td>
                            <td>{{ formData.liabilitiesRate }}</td>
                        </tr>
                        <tr>
                            <td>流动资产</td>
                            <td>{{ formData.currentAssets }}</td>
                            <td>流动负债</td>
                            <td>{{ formData.currentLiabilities }}</td>
                        </tr>
                        <tr>
                            <td>流动比率（%）</td>
                            <td>{{ formData.currentRate }}</td>
                            <td>主营业务利润率（%)</td>
                            <td>{{ formData.operatingMargin }}</td>
                        </tr>
                        <tr>
                            <td>净利润(万元)</td>
                            <td>{{ formData.retainedProfits }}</td>
                            <td>净资产(万元)</td>
                            <td>{{ formData.netWorth }}</td>
                        </tr>
                        <tr>
                            <td>固定资产(万元)</td>
                            <td>{{ formData.fixedAssets }}</td>
                            <td>现金流量净额(万元)</td>
                            <td>{{ formData.netCashFlow }}</td>
                        </tr>
                        <tr>
                            <td>注册资金(万元)</td>
                            <td>{{ formData.registeredCapital }}</td>
                            <td>净资产收益率(%)</td>
                            <td>{{ formData.returnOnEquity }}</td>
                        </tr>
                        <tr>
                            <td>总资产报酬率(%)</td>
                            <td>{{ formData.returnOnTotalAsset }}</td>
                            <td>速动比率(%)</td>
                            <td>{{ formData.quickRatio }}</td>
                        </tr>
                        <tr>
                            <td>负债总计(万元)</td>
                            <td>{{ formData.totalliabilities }}</td>
                        </tr>
                    </table>
                </dd>
            </dl>
            <!--邀请函信息-->
            <dl class="projectInfoDetail">
                <dt>
                    <p class="projectInfoDetail_icon">
                        <i class="iconfont icon-xiangmujibenxinxi" />
                    </p>
                    附件信息
                </dt>
                <dd>
                    <table class="tableData">
                        <tr class="singleRow">
                            <td>附件下载</td>
                            <td colspan="3">
                                <div v-for="(item,index) in scanCertificate" :key="index" class="file">
                                    <a ref="downLoads" class="inline-file">
                                      <span @click="downLoadClick(item)">
                                        <i class="iconfont icon-icon_file" />
                                        {{ item.fileName }}
                                      </span>
                                    </a>
                                </div>
                            </td>
                        </tr>
                    </table>
                </dd>
            </dl>
        </div>
        <!--当前页面从哪进来的  01 驱动内列表页 并且不是工作流-->
        <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>
/* 接口*/
import { findFinancialReportsInfo, downAttachmentLoadFile } from '@api/bidding/bidderRepresentative'
import { download } from '@/assets/js/utils/index'
/* 公用方法*/
import { filterObj } from '@/assets/js/utils'
// 常用方法

export default {
  name: 'FinancialReportsInfo',
  components: {
  },
  data() {
    return {
      loading: true,
      searchForm: {
        id: this.$route.query.id
      },
      formData: {
        annual: '', // 年度
        total: '', // 资产总计(万元)
        operatingIncome: '', // 营业收入(万元)
        liabilitiesRate: '', // 资产负债率（%）
        currentAssets: '', // 流动资产
        currentLiabilities: '', // 流动负债
        currentRate: '', // 流动比率（%）
        operatingMargin: '', // 主营业务利润率（%)
        retainedProfits: '', // 净利润(万元)
        companyName: '', // 企业名称
        netWorth: '', // 净资产(万元)
        fixedAssets: '', // 固定资产(万元)
        netCashFlow: '', // 现金流量净额(万元)
        registeredCapital: '', // 注册资金(万元)
        returnOnEquity: '', // 净资产收益率(%)
        returnOnTotalAsset: '', // 总资产报酬率
        quickRatio: '', // 速动比率
        totalliabilities: '' // 负债总计(万元)
      },
      scanCertificate: []
    }
  },
  created() {
    this.loadData()
  },
  methods: {
    loadData() {
      const params = this.getQueryParams() // 查询条件
      findFinancialReportsInfo(params).then(response => {
        this.loading = false
        this.formData = response.data
        this.scanCertificate = response.data.scanCertificate
      }).catch(() => {
        this.loading = false
      })
    },
    // 查询条件
    getQueryParams() {
      const param = Object.assign({}, this.searchForm)
      return filterObj(param)
    },
    // 返回
    back() {
      this.$router.push('/bidderRepresentative/financialReportsList')
    },
    downLoadClick(item) {
      const params = {
        fileName: item.fileName,
        fileId: item.fileId
      }
      downAttachmentLoadFile(params).then(res => {
        download(res, item.fileName)
      }).catch(() => {
        this.loading = false
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>
