<!--
  @description:CA管理-CA发票管理-发票信息  CA管理-投标服务费财务管理-发票信息   CA管理-增值服务-发票信息  CA管理-培训服务-录入发票
  @Modifier:肖文龙
  @routerPath:/caManage/invoiceManage/informationDetail
              /addService/addServiceManagementList/informationDetail
              /bidServiceFee/bidServiceFeeManagementList/informationDetail
              /trainingServices/trainingServicesManagementList/informationDetail
  @date:2019-12-6 14:50:32
-->
<template>
  <div class="p0-16">
    <!-- 返回 -->
    <section class="title">
      <router-link :to="returnPrev">
        <i class="iconfont icon-fanhui pointer" />
      </router-link>
      发票信息
    </section>
    <!-- 发票信息 -->
    <div class="page-title">
      01 发票信息
    </div>
    <table class="tableData">
      <tr>
        <td>发票抬头</td>
        <td>{{ tableData.buyersLinkerName }}</td>
        <td>是否开票</td>
        <td>{{ tableData.purchaseMethod=='00'?'否':"是" }}</td>
      </tr>
      <tr>
        <td>是否专票</td>
        <td>{{ tableData.purchaseMethod=='00'?'否':"是" }}</td>
        <td>联系人</td>
        <td>{{ tableData.buyersLinkerTel }}</td>
      </tr>
      <tr>
        <td>联系电话</td>
        <td>{{ tableData.contactsNumber }}</td>
        <td>发票金额（元）</td>
        <td>{{ tableData.cityCode }}</td>
      </tr>
      <tr>
        <td>发票号码</td>
        <td>{{ tableData.buyersCode }}</td>
        <td>采购计划</td>
        <td>{{ tableData.purchaseMethod=='00'?'无':'有' }}</td>
      </tr>
    </table>
    <el-form class="file">
      <el-form-item style="width:50%" label="发票附件:" prop="">
        <div>
          <img src="http://pic1.nipic.com/2008-08-14/2008814183939909_2.jpg" class="invoiceEnclosure">
        </div>
      </el-form-item>
    </el-form>
    <!-- 普票信息 -->
    <div class="page-title">
      02 普票信息
    </div>
    <table class="tableData">
      <tr>
        <td>开票信息</td>
        <td>{{ tableData.materialType }}</td>
        <td>开户银行</td>
        <td>{{ tableData.buyersLinkerAddress }}</td>
      </tr>
      <tr>
        <td>基本账户账号</td>
        <td>{{ tableData.buyersLinkerEmail }}</td>
        <td>电话</td>
        <td>{{ tableData.buyersLinkerTel }}</td>
      </tr>
      <tr>
        <td>地址</td>
        <td colspan="3">
          {{ tableData.buyersLinkerTel }}
        </td>
      </tr>
    </table>
    <el-form class="file">
      <el-form-item style="width:50%" label="开票信息:" prop="table.billingInvoice">
        <div><img src="http://pic1.nipic.com/2008-08-14/2008814183939909_2.jpg" class="invoiceEnclosure"></div>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { getSublist } from '@/api/purchase/purchaseMain'
export default {
  name: 'InformationDetail',
  components: {},
  data() {
    return {
      title: '',
      // 发票信息
      formData: {
        information: {
          id: '', //
          invoiceRise: '', // 发票抬头
          specialTicket: '', // 是否专票
          billingStatus: '', // 是否开票
          contacts: '', // 联系人
          contactsNumber: '', // 联系电话
          invoiceAmount: '', // 发票金额（元)
          invoice: '', // 发票号码
          invoiceEnclosure: '', // 发票附件
          purchasePlan: '', // 采购计划
          billingInvoice: '', // 开票信息
          openAccountBank: '', // 开户银行
          basicAccountAccount: '', // 基本账户账号
          mobilePhone: '', // 移动电话
          address: '', // 地址
          dutyParagraph: '', // 税号
          paymentAmount: '' // 缴费金额（元）
        }
      },
      // 发票信息
      tableData: [],
      returnPrev: '' // 返回

    }
  },
  mounted() {
    // 项目Id
    const projectId = this.$route.query.id
    // 返回
    this.returnPrev = `${this.$route.matched[0].path}/${this.$route.params.invoice}`
    // 初始化项目信息
    getSublist(projectId).then(response => {
      // ==============初始化===================
      // 采购项目信息
      this.tableData = response.data.tbpurchaseMainEntityVO
      // 物料类型
      if (response.data.tbpurchaseMainEntityVO.materialType === '00') {
        this.tableData.materialType = '现货/标准品'
      } else if (response.data.tbpurchaseMainEntityVO.materialType === '01') {
        this.tableData.materialType = '加工/定制品'
      } else {
        this.tableData.materialType = '服务'
      }
      // 订单类型
      if (response.data.tbpurchaseMainEntityVO.orderType === '00') {
        this.tableData.orderType = '标准订单(单次采购)'
      } else {
        this.tableData.orderType = '价格协议(长期采购)'
      }
      // 组织形式
      if (response.data.tbpurchaseMainEntityVO.orgMethod === '00') {
        this.tableData.orgMethod = '自行采购'
      } else {
        this.tableData.orgMethod = '委托代理机构采购'
      }
      // 采购方式
      if (response.data.tbpurchaseMainEntityVO.purchaseType === '00') {
        this.tableData.purchaseType = '一次询价'
      } else if (response.data.tbpurchaseMainEntityVO.purchaseType === '01') {
        this.tableData.purchaseType = '竞价'
      } else {
        this.tableData.purchaseType = '二次询价'
      }
    })
  },
  methods: {}
}
</script>

<style lang="less" scoped>

</style>
