<template>
  <a-modal
    :title="modalTitle"
    :width="850"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <div id="printTest">
      <a-row :gutter="{ xs: 8, sm: 16, md: 24}">
        <a-col :span="8" :key="index" v-for="(item,index) in sbList">
          <a-card class="future-print" :bordered="false" :hoverable="true" :body-style="{'text-align':'center',height: '300px'}">
            <img-code :src="item.qrCode" :code-id="item.id" :width="200"></img-code>
            <span>{{ item.name }}</span>
            <span>{{ item.no }}</span>
            <span>{{ item.zbh }}</span>
          </a-card>
        </a-col>
      </a-row>
    </div>
    <template slot="footer">
      <a-button :loading="confirmLoading" type="primary" v-print="'#printTest'">打印</a-button>
    </template>
  </a-modal>
</template>

<script>
import DetailList from '@/components/tools/DetailList'
const DetailListItem = DetailList.Item

export default {
  name: 'PrintSbCode',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      mdl: {},
      modalTitle: null,
      visible: false,
      confirmLoading: false,
      sbList: []
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    base (sbList) {
      this.sbList = sbList
      this.visible = true
      this.modalTitle = '打印二维码'
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    },
    printSave () {

    }
  }
}
</script>

<style>
  .future-print {
    text-align: center;
  }
</style>
