
<!--
  @description: 正在参与项目-采购文件-缴费容器
  @author: gmy
  @routerPath:/procurement/procurementDriveSupplier/procurementTenderfeeVessel
  @date: 2020-5-20 8:43:58
-->
<template>
  <div>
    <!-- 第一次进入时值为null走支付页面-->
    <procurementColleAdd v-if="payType === null" />
    <!--    二次进入时 判断支付方式payType 99 是其他凭证 00 01 的是在线支付 payStatus下单情况 01 支付成功 00下过单 单是没有收到支付成功通知-->
    <procurementColleDeatil v-if="payType !== '99' && payStatus === '01'" />
    <procurementColleAdd v-if="payType && payStatus === '00'" />
    <procurementColleAdd v-if="payType && payStatus === null" />
    <procurementAudit v-if="payType === '99'" :pay-status="payStatus" :audit-status="auditStatus" />
  </div>
</template>

<script>
/* api*/
import { paymentOfTenderFeeMessage } from '@/api/procurement/procurementProtdoc'//  获取缴纳纳标书费信息
import { getProtFeePage } from '@/api/procurement/procurementProject' // 获取保存发票api
import procurementColleAdd from './procurementCollection-add' // 收取标书费
import procurementColleDeatil from './procurementCollection-detail' // 不收取标书费
import procurementAudit from '../procurementTenderfeeAudit/procurementTenderfee'
export default {
  name: 'ProcurementCollectionContentVue',
  components: {
    procurementColleAdd,
    procurementColleDeatil,
    procurementAudit
  },
  data() {
    return {
      // 获取联系人数据参数
      packId: '', // 标段id
      isReceiveTenderDocumentPrice: '', // 是否收取标书费00 不收取 01 收取标书费
      payStatus: '',
      auditStatus: '',
      payType: '',
      // 获取缴费信息数据
      feeData: {
        packId: '', // 标段Id
        feeType: '', // 保证金 标书费
        payAmount: 0, // 金额
        invoiceType: ''
      }
    }
  },
  created() {
    // 调用获取是否收取标书费方法
    this.getSupplierDriveTaskData()
  },
  methods: {
    // 获取
    getSupplierDriveTaskData() {
      const packId = this.$route.query.packId
      paymentOfTenderFeeMessage(packId).then(res => {
        this.isReceiveTenderDocumentPrice = res.data.isReceiveTenderDocumentPrice
        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 => {
        this.auditStatus = res.data.auditStatus
        this.payStatus = res.data.payStatus
        this.payType = res.data.payType
      }).catch(() => {
      })
    }
  }
}
</script>

<style scoped>

</style>
