<template>
  <div>
    <span @click="showPayment">{{label}}</span>
    <!-- 付款确认书 -->
    <payment-confirmation :visible.sync="paymentVisible" :form="paymentItem" :api="api" editModel="''"></payment-confirmation>
  </div>
</template>

<script>
import paymentConfirmation from '../paymentConfirmation'
export default {
  components: {
    paymentConfirmation
  },
  props: {
    itemObj: {
      type: [Object],
      default: () => {}
    }
  },
  data () {
    return {
      paymentVisible: false,
      paymentItem: {},
      api: {}
    }
  },
  methods: {
    showPayment () {
      this.paymentVisible = true
      this.paymentItem = this.itemObj
    }
  },
  computed: {
    label () {
      let keys = Object.keys(this.itemObj)
      if (!keys.length) return ''
      return this.itemObj['assetCode']
    }
  }
}
</script>
