WastePrintModal.vue 1.38 KB
<template>
  <a-modal
    :visible="visible"
    :confirm-loading="confirmLoading"
    @cancel="handleCancel"
    width="30%"
  >
    <div>
      <a-row>
        <div class="noprint container" style="text-align:right; padding: 20px;float: right">
          <a-button v-print="'#content2'" ghost type="primary">打印</a-button>
        </div>

      </a-row>
      <div id="content2" ref="orderForm1" style="text-align: center">
        <vue-qr :text="url" :size="100" :margin="0"></vue-qr>
      </div>

      <div style="margin-top: 2rem">
        <p>{{ url }}</p>
      </div>

    </div>
    <template slot="footer">
      <a-button @click="handleCancel" v-show="false"></a-button>
    </template>
  </a-modal>
</template>

<script>
import VueQr from 'vue-qr'
import QRCode from "qrcodejs2";

export default {
  name: 'WastePrintModal',
  components: {
    VueQr,
    'barcode': QRCode
  },
  data() {
    return {
      confirmLoading: false,
      visible: false,
      loading: false,
      dataSource: [],
      titleSource: [],
      url: '',
      projectName: '',
      ids: [],
    }
  },
  methods: {
    handleCancel(e) {
      this.visible = false
    },
    open(url, projectName) {
      this.visible = true
      this.url = url;
      this.projectName = projectName;

    },
    print() {
      window.print()
    },
    doPrint() { //方法

    },

  }
}
</script>

<style scoped>
</style>