|
@@ -1,7 +1,9 @@
|
|
|
<template>
|
|
|
+ <div ref="qrcode" id="qrcode" style="display:none;"></div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import QRCode from "qrcodejs2";
|
|
|
import { getLodop } from "./LodopFuncs.js";
|
|
|
import { mapGetters } from "vuex";
|
|
|
export default {
|
|
@@ -29,14 +31,25 @@ export default {
|
|
|
handler() {
|
|
|
if (JSON.stringify(this.printData) !== "{}") {
|
|
|
this.printInfo = this.printData;
|
|
|
- this.usbPrinterList.forEach((e) => {
|
|
|
- if (this.deviceName) {
|
|
|
- if (e.deviceName === this.deviceName) {
|
|
|
+ if (this.printData.openQrCode) {
|
|
|
+ this.$refs.qrcode.innerHTML = "";
|
|
|
+ let qrcode = new QRCode("qrcode", {
|
|
|
+ width: 100,
|
|
|
+ height: 100, // 高度
|
|
|
+ text: this.printData.orderidView, // 二维码内容
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.usbPrinterList.forEach((e) => {
|
|
|
+ if (this.deviceName) {
|
|
|
+ if (e.deviceName === this.deviceName) {
|
|
|
+ this.pringPdf(e);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
this.pringPdf(e);
|
|
|
}
|
|
|
- } else {
|
|
|
- this.pringPdf(e);
|
|
|
- }
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -235,6 +248,8 @@ export default {
|
|
|
pageWidth === 1
|
|
|
? "---------------#" + printInfo.daySeq + "完-------------"
|
|
|
: "------------------#" + printInfo.daySeq + "完----------------"
|
|
|
+ }</div><div style="display:flex;justify-content: center;align-items: center;">${
|
|
|
+ num === 1 ? this.$refs.qrcode.innerHTML : ""
|
|
|
}</div> </div>`;
|
|
|
return html1 + html2 + html3;
|
|
|
},
|