<script>
import PrintBill from './PrintBill.vue'

export default {
  name: 'Demo',
  components: { PrintBill },
  methods: {
    print () {
      this.$refs.print.print({
          reprint: '正常',
          billUrl: 'iot_bill',
          operator: `张三丰`,
          condition: '21952838'
      })
    },
    printOk () {
      console.log('打印成功')
    },
    test1 () {
      this.$printB('iot_bill_template', { condition: '21971601' })
    },
    test2 () {
      this.$printC('DiagnosisCertificate', { title: 'DiagnosisCertificate' })
    }
  }
}
</script>

<template>
  <div>
    <a-button @click="print">打印</a-button>
    <a-button @click="test1">测试打印1</a-button>
    <a-button @click="test2">测试打印2</a-button>

    <print-bill ref="print" @ok="printOk" :autoPrint="false"></print-bill>
  </div>
</template>

<style scoped>

</style>
