shish 4 jaren geleden
bovenliggende
commit
2ee9213e40
1 gewijzigde bestanden met toevoegingen van 6 en 3 verwijderingen
  1. 6 3
      app-ghs/controllers/PurchaseOrderController.php

+ 6 - 3
app-ghs/controllers/PurchaseOrderController.php

@@ -26,13 +26,13 @@ class PurchaseOrderController extends BaseController
 
         $ext = $this->shopExt;
         $printLabelSn = $ext->printLabelSn ?? '';
-        if(empty($printLabelSn)){
+        if (empty($printLabelSn)) {
             util::fail('请设置条码打印机');
         }
         $p = new printUtil($printLabelSn);
 
 
-        foreach ($itemList as $item) {
+        foreach ($itemList as $key => $item) {
             $name = $item->name ?? '';
             $num = !empty($item->itemNum) ? floatval($item->itemNum) : 0;
             if (empty($num)) {
@@ -42,6 +42,9 @@ class PurchaseOrderController extends BaseController
             $p->times = $num;
             $content = '<TEXT x="50" y="20" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
             $content .= '<BC128 x="50" y="90" h="80" s="1" r="0" n="2" w="2">' . $ptItemId . '</BC128>';
+            if ($key % 2 == 1) {
+                $content = '<TEXT x="50" y="90" font="12" w="3" h="3" r="0">。</TEXT>';
+            }
             $p->printLabelMsg($content);
         }
         util::complete();
@@ -64,7 +67,7 @@ class PurchaseOrderController extends BaseController
 
         $ext = $this->shopExt;
         $printLabelSn = $ext->printLabelSn ?? '';
-        if(empty($printLabelSn)){
+        if (empty($printLabelSn)) {
             util::fail('请设置条码打印机');
         }
         $p = new printUtil($printLabelSn);