|
|
@@ -26,7 +26,7 @@ class WorkClass extends BaseClass
|
|
|
const STATUS_CANCEL = 2;
|
|
|
|
|
|
//打印工单 ssh 20220601
|
|
|
- public static function print($work, $shop)
|
|
|
+ public static function print($work, $shop,$mustPrint=true)
|
|
|
{
|
|
|
$orderSn = $work->orderSn ?? '';
|
|
|
if (!empty($orderSn)) {
|
|
|
@@ -40,20 +40,23 @@ class WorkClass extends BaseClass
|
|
|
$ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
$printLabelSn = $ext->printLabelSn ?? '';
|
|
|
if (empty($printLabelSn)) {
|
|
|
- util::fail('请设置标签打印机');
|
|
|
- }
|
|
|
- $p = new printUtil($printLabelSn);
|
|
|
- $workSn = $work->workSn ?? '';
|
|
|
- $workItemList = WorkClass::getAllByCondition(['workSn' => $workSn], null, '*', null, true);
|
|
|
- if (!empty($workItemList)) {
|
|
|
- foreach ($workItemList as $item) {
|
|
|
- $goodsSn = $item->goodsSn ?? '';
|
|
|
- $num = $item->num ?? 1;
|
|
|
- $name = $item->name ?? '';
|
|
|
- $content = '<TEXT x="40" y="20" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
|
|
|
- $content .= '<BC128 x="40" y="90" h="80" s="1" r="0" n="2" w="2">' . $goodsSn . '</BC128>';
|
|
|
- $p->times = $num;
|
|
|
- $p->printLabelMsg($content);
|
|
|
+ if($mustPrint){
|
|
|
+ util::fail('请设置标签打印机');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $p = new printUtil($printLabelSn);
|
|
|
+ $workSn = $work->workSn ?? '';
|
|
|
+ $workItemList = WorkClass::getAllByCondition(['workSn' => $workSn], null, '*', null, true);
|
|
|
+ if (!empty($workItemList)) {
|
|
|
+ foreach ($workItemList as $item) {
|
|
|
+ $goodsSn = $item->goodsSn ?? '';
|
|
|
+ $num = $item->num ?? 1;
|
|
|
+ $name = $item->name ?? '';
|
|
|
+ $content = '<TEXT x="40" y="20" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
|
|
|
+ $content .= '<BC128 x="40" y="90" h="80" s="1" r="0" n="2" w="2">' . $goodsSn . '</BC128>';
|
|
|
+ $p->times = $num;
|
|
|
+ $p->printLabelMsg($content);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|