<!--
  @description:查看供货记录详情-弹框
  @Modifier:肖文龙
  @routerPath:supplierDeclaration/supplier/supplYrecord
  @date:2020/2/17-17:27
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="data.dialog"
    :close-on-click-modal="false"
    title="查看供货记录"
    width="700px"
    custom-class="el-dialog__body-p0"
    top="calc((100vh - 551px) / 2)"
    style="padding:0 50px;"
  >
    <div class="main" style="margin-bottom:10px">
      <table class="tableData">
        <tr>
          <td>年度</td>
          <td>{{ financialConditionData.year }}</td>
        </tr>
        <tr>
          <td>币种</td>
          <td>
            <span v-for="(groupItem,index) in currencies" v-if="financialConditionData.currencies===groupItem.typecode" :key="index">
              {{ groupItem.typename }}
            </span>
          </td>
        </tr>
        <tr>
          <td>资产总计（万元）</td>
          <td>{{ financialConditionData.totalAssets }}</td>
        </tr>
        <tr>
          <td>负债总计（万元）</td>
          <td>{{ financialConditionData.totalLiabilities }}</td>
        </tr>
        <tr>
          <td>利润总额（万元）</td>
          <td>{{ financialConditionData.totalProfit }}</td>
        </tr>
        <tr>
          <td>营业收入(万元)</td>
          <td>{{ financialConditionData.businessIncome }}</td>
        </tr>
        <tr>
          <td>净利润（万元）</td>
          <td>{{ financialConditionData.netProfit }}</td>
        </tr>
        <tr>
          <td>负债率（%）</td>
          <td>{{ financialConditionData.assetLiabilityRatio }}</td>
        </tr>

        <tr>
          <td>流动负债总计(万元)</td>
          <td>{{ financialConditionData.totalCurrentAssets }}</td>
        </tr>

        <tr>
          <td>流动资产总计(万元)</td>
          <td>{{ financialConditionData.totalCurrentLiabilities }}</td>
        </tr>
        <tr>
          <td>流动比率(%)</td>
          <td>{{ financialConditionData.flowRate }}</td>
        </tr>
        <tr>
          <td>财务审计报告扫描件</td>
          <td><downloadFile v-if="financialAuditingReportData.bizId" :data="financialAuditingReportData" /></td>
        </tr>
      </table>
    </div>
  </el-dialog>
</template>

<script>
/* 接口*/
import { queryFinancialSituationInfo } from '@/api/supplier/supplierFinancialSituation'
/* 混合开发*/
import { declareHegSupperGroupMixin } from '@/views/supplier/editorDeclaration/mixins/declareHegSupperGroupMixin'// 供应商-字典
import { declareHegSupperMixins } from '@/views/supplier/editorDeclaration/mixins/declareHegSupperMixins'// 应商-公用方法参数
/* 组件*/
import downloadFile from '@comp/common/updownload/downloadFile'// 附件
import { mapGetters } from 'vuex'
export default {
  name: 'FinancialSituationDetailDialog',
  components: {
    downloadFile
  },
  mixins: [declareHegSupperGroupMixin, declareHegSupperMixins],
  props: {
    // 弹框展示状态
    data: {
      type: Object,
      default: function() {
        return {
          dialog: false, // 弹窗状态
          id: '', // 编辑时才会有供货记录id
          oldId: '' // 修改时用的Id
        }
      }
    }
  },
  data() {
    return {
    }
  },
  computed: {
    ...mapGetters(['language'])
  },
  created() {
    this.initData()// 初始化数据
    this.getSupplyRecordDictionaries()// 申报材料供货记录-字典信息
  },
  methods: {
    // 初始化数据
    initData() {
      const data = {
        id: this.data.id,
        oldId: this.data.oldId
      }
      queryFinancialSituationInfo(data).then(res => {
        this.financialConditionData = res.data
        this.financialAuditingReportData.bizId = this.financialConditionData.id// 财务审计报告扫描件
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
