<!--
  @description: 正在参与项目-标书费-其他方式支付审核情况
  @author: gmy
  @routerPath:/procurement/procurementDriveSupplier/procurementCollectionAudit
  @date: 2020-5-20 8:43:58
-->
<template>
  <div>
    <tenderfeeAuditYet v-if="auditStatus === '00' || auditStatus === '01'" :status="auditStatus" />
    <tenderfeeAuditNo v-if="auditStatus==='02'" :audit-status="auditStatus" />
  </div>
</template>

<script>
/* api*/
import { paymentOfTenderFeeMessage } from '@/api/procurement/procurementProtdoc'//  获取缴纳纳标书费信息
import { getProtFeePage } from '@/api/procurement/procurementFee' // 获取保存发票api
import tenderfeeAuditNo from './procurementTenderfeeAudit-add'
import tenderfeeAuditYet from './procurementvoucherAduit-detail'
export default {
  name: 'ProcurementBiddingVue',
  inject: ['getTenderBase'],
  components: {
    tenderfeeAuditYet, // 待审核或者审核通过
    tenderfeeAuditNo // 审核不通过
  },
  data() {
    return {
      // 获取缴费信息数据
      feeData: {
        packId: '', // 标段Id
        feeType: '', // 保证金 标书费
        payAmount: 0, // 金额
        invoiceType: ''
      },
      auditStatus: '',
      tenderBase: this.getTenderBase() // 获取项目信息
    }
  },
  created() {
    this.feeData.packId = this.tenderBase.packId
    // 查询采购项目信息
    this.getSupplierDriveTaskData()
  },
  methods: {
    getSupplierDriveTaskData() {
      const packId = this.tenderBase.packId
      paymentOfTenderFeeMessage(packId).then(res => {
        this.feeData.packId = res.data.packId // 标段id
        this.feeData.feeType = res.data.feeType // 保证金或者标书费字段
        this.feeData.payAmount = res.data.payAmount // 标书费
        this.feeData.invoiceType = res.data.invoiceType // 发票类型
        this.getProtFeeData(this.feeData) // 调用获取页面开票数据方法
      }).catch(res => {

      })
    },
    // 封装获取页面开票数据
    getProtFeeData(data) {
      getProtFeePage(data).then(res => {
        // 初次进入页面 需要判断
        if (!this.auditStatus) {
          this.auditStatus = res.data.auditStatus
        }
      }).catch(() => {
      })
    }
  }
}
</script>

<style scoped>

</style>
