Funny 3 år sedan
förälder
incheckning
bce607432d
2 ändrade filer med 20 tillägg och 16 borttagningar
  1. 19 15
      src/App.vue
  2. 1 1
      src/common/UsbAutoPrint.vue

+ 19 - 15
src/App.vue

@@ -12,7 +12,7 @@
 
 <script>
 import { getSoundMsg } from "./api/setting.js";
-import {   getPrintOrderInfos } from "./api/order.js";
+import { getPrintOrderInfos } from "./api/order.js";
 import bus from "./common/bus.js";
 import UsbAutoPrint from "./common/UsbAutoPrint";
 
@@ -94,20 +94,24 @@ export default {
       // usb自动打印新订单、预约单
       getPrintOrderInfos({ orderId, waimaiOrderId }).then((res) => {
         console.log("返回内容:", res);
-        if (res.code === 200 && res.data.length) {
-          let len = this.printList.length;
-          res.data = res.data.map((v) => {
-            if (v.exceptTime) {
-              v.timeTxt = "期望" + v.exceptTime;
-            } else {
-              v.exceptTime = "立即送达";
-            }
-            return v;
-          });
-          this.printList = this.printList.concat(res.data);
-          if (!len) {
-            this.printOver(false);
-          }
+        if (res.code === 200) {
+          let data = res.data;
+          data.exceptTime = data.exceptTime ? "期望" + data.exceptTime : "立即送达";
+          this.printData = res.data;
+          this.printNum += 1;
+          // let len = this.printList.length;
+          // res.data = res.data.map((v) => {
+          //   if (v.exceptTime) {
+          //     v.exceptTime = "期望" + v.exceptTime;
+          //   } else {
+          //     v.exceptTime = "立即送达";
+          //   }
+          //   return v;
+          // });
+          // this.printList = this.printList.concat(res.data);
+          // if (!len) {
+          //   this.printOver(false);
+          // }
         }
       });
     },

+ 1 - 1
src/common/UsbAutoPrint.vue

@@ -2,7 +2,7 @@
   <div class="print">
     <!-- <div @click="pringPdf">打印测试</div> -->
     <div id="form1">
-      <div style="font-size: 22px;font-weight: bold;text-align: center;">#{{printInfo.daySeq}}{{printInfo.orderSource}}</div>
+      <div style="font-size: 20px;font-weight: bold;text-align: center;">#{{printInfo.daySeq}}{{printInfo.orderSource}}</div>
       <div style="font-size: 18px;text-align: center;margin:10px 0;">{{printInfo.shopName}}</div>
       <div style="font-size: 18px;font-weight: bold;text-align: center;">{{printInfo.deliveryTime}}</div>
       <div>------------------------------------</div>