|
@@ -234,27 +234,43 @@ class PurchaseOrderController extends BaseController
|
|
|
$hyPrice = floatval($hyPrice);
|
|
$hyPrice = floatval($hyPrice);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (stringUtil::getWordNum($name) > 8) {
|
|
|
|
|
- $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
|
|
|
|
|
|
|
+ if ($priceOption == 2) {
|
|
|
|
|
+ // 每7个汉字截取一次(支持汉字、字母、数字混合),多处需要同步修改,关键词 label_print_substr
|
|
|
|
|
+ $content = '';
|
|
|
|
|
+ $len = mb_strlen($name, 'UTF-8');
|
|
|
|
|
+ $baseNum = 30;
|
|
|
|
|
+ $u = 0;
|
|
|
|
|
+ for ($i = 0; $i < $len; $i += 7) {
|
|
|
|
|
+ $currentName = mb_substr($name, $i, 7, 'UTF-8');
|
|
|
|
|
+ $number = $baseNum + 110 * $u;
|
|
|
|
|
+ $u++;
|
|
|
|
|
+ $content .= '<TEXT x="30" y="' . $number . '" font="12" w="2" h="2" r="0">' . $currentName . '</TEXT>';
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
|
|
|
|
|
- }
|
|
|
|
|
- if ($key % 2 == 1) {
|
|
|
|
|
- $content .= '<TEXT x="415" y="20" font="12" w="2" h="2" r="0">.</TEXT>';
|
|
|
|
|
|
|
+ if (stringUtil::getWordNum($name) > 8) {
|
|
|
|
|
+ $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($key % 2 == 1) {
|
|
|
|
|
+ $content .= '<TEXT x="415" y="20" font="12" w="2" h="2" r="0">.</TEXT>';
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if ($type == 0) {
|
|
if ($type == 0) {
|
|
|
- $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
|
|
|
|
|
- if (in_array($mainId, [52, 1459])) {
|
|
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
|
|
|
|
|
- } elseif ($mainId == 16948) {
|
|
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
|
|
|
|
|
- } elseif ($mainId == 72057) {
|
|
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
|
|
|
|
|
- } else {
|
|
|
|
|
- if ($priceOption == 0) {
|
|
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
|
|
|
|
|
|
|
+ if ($priceOption != 2) {
|
|
|
|
|
+ $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
|
|
|
|
|
+ if (in_array($mainId, [52, 1459])) {
|
|
|
|
|
+ $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
|
|
|
|
|
+ } elseif ($mainId == 16948) {
|
|
|
|
|
+ $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
|
|
|
|
|
+ } elseif ($mainId == 72057) {
|
|
|
|
|
+ $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
|
|
|
} else {
|
|
} else {
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . ' ' . $price . '元</TEXT>';
|
|
|
|
|
|
|
+ if ($priceOption == 0) {
|
|
|
|
|
+ $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . ' ' . $price . '元</TEXT>';
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -280,74 +296,6 @@ class PurchaseOrderController extends BaseController
|
|
|
util::complete();
|
|
util::complete();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //打印全部 ssh 20220
|
|
|
|
|
- public function actionPrintItem()
|
|
|
|
|
- {
|
|
|
|
|
- $get = Yii::$app->request->get();
|
|
|
|
|
- $id = $get['id'] ?? 0;
|
|
|
|
|
- $type = $get['type'] ?? 0;
|
|
|
|
|
- $item = PurchaseOrderItemClass::getById($id, true);
|
|
|
|
|
- if (empty($item)) {
|
|
|
|
|
- util::fail('没有找到花材');
|
|
|
|
|
- }
|
|
|
|
|
- $name = $item->name ?? '';
|
|
|
|
|
- $num = !empty($item->itemNum) ? floatval($item->itemNum) : 0;
|
|
|
|
|
- if (empty($num)) {
|
|
|
|
|
- util::fail('没有花材数量');
|
|
|
|
|
- }
|
|
|
|
|
- $orderSn = $item->orderSn ?? '';
|
|
|
|
|
- $order = PurchaseOrderClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
|
|
- $mainId = $order->mainId ?? 0;
|
|
|
|
|
-
|
|
|
|
|
- $ext = $this->shopExt;
|
|
|
|
|
- $printLabelSn = $ext->printLabelSn ?? '';
|
|
|
|
|
- if (empty($printLabelSn)) {
|
|
|
|
|
- util::fail('请设置标签打印机');
|
|
|
|
|
- }
|
|
|
|
|
- $p = new printUtil($printLabelSn);
|
|
|
|
|
-
|
|
|
|
|
- $productId = $item->productId ?? 0;
|
|
|
|
|
- $product = ProductClass::getById($productId, true);
|
|
|
|
|
- $smallUnit = $product->smallUnit ?? '';
|
|
|
|
|
- $bigUnit = $product->bigUnit ?? '';
|
|
|
|
|
- $ratio = $product->ratio ?? 20;
|
|
|
|
|
- $ratioType = $product->ratioType ?? 0;
|
|
|
|
|
- if ($ratioType == 1) {
|
|
|
|
|
- $unit = '若干' . $smallUnit . '/' . $bigUnit;
|
|
|
|
|
- } else {
|
|
|
|
|
- $unit = $ratio . $smallUnit . '/' . $bigUnit;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $ptItemId = $item->itemId ?? '';
|
|
|
|
|
-
|
|
|
|
|
- $p->times = $num;
|
|
|
|
|
-
|
|
|
|
|
- if (stringUtil::getWordNum($name) > 7) {
|
|
|
|
|
- $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
|
|
|
|
|
- } else {
|
|
|
|
|
- $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if ($type == 0) {
|
|
|
|
|
- $content .= '<BC128 x="30" y="100" h="70" s="1" r="0" n="4" w="11">' . $ptItemId . '</BC128>';
|
|
|
|
|
- if (in_array($mainId, [52, 1459])) {
|
|
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
|
|
|
|
|
- } elseif ($mainId == 16948) {
|
|
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
|
|
|
|
|
- } elseif ($mainId == 72057) {
|
|
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
|
|
|
|
|
- } else {
|
|
|
|
|
- $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- $content .= '<QR x="35" y="100" e="L" w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $productId . '</QR>';
|
|
|
|
|
- $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $p->printLabelMsg($content);
|
|
|
|
|
- util::complete();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
//取消入库单 ssh 20221211
|
|
//取消入库单 ssh 20221211
|
|
|
public function actionCancel()
|
|
public function actionCancel()
|
|
|
{
|
|
{
|