From 9482c590ff3b8a483567adadb47e6d03129d7893 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 14 Nov 2024 16:36:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E4=BF=AE=E5=A4=8D=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E8=AE=A2=E5=8D=95=E5=87=BA=E5=BA=93=E5=8D=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 增加订单未出库时的错误提示 - 修改导出数据的来源,从订单购物车信息 --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 8 ++++---- app/common/service/xlsx/OrderOutbound.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 4970dee5..1d32d835 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -610,11 +610,11 @@ class BeforehandOrderLogic extends BaseLogic { $order_info = new OrderOutbound(); $order = BeforehandOrder::where('id', $params['id'])->find(); + if($order['outbound_id']<=0){ + throw new BusinessException('订单未出库,不能导出出库单'); + } $order['admin_name'] = Admin::where('id', $order['admin_id'])->value('name'); - $data = BeforehandOrderCartInfo::where('bhoid', $params['id'])->select()->each(function ($item) { - if($item['total_price']==0 || $item['cart_num']==0){ - throw new BusinessException('数量或金额不能为0'); - } + $data= WarehouseProduct::where('oid',$order['outbound_id'])->select()->each(function ($item) { $find = StoreProduct::where('id', $item['product_id'])->field('top_cate_id,store_name,unit')->find(); $item['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name'); $item['store_name'] = $find['store_name']; diff --git a/app/common/service/xlsx/OrderOutbound.php b/app/common/service/xlsx/OrderOutbound.php index c235a7b3..3d2487be 100644 --- a/app/common/service/xlsx/OrderOutbound.php +++ b/app/common/service/xlsx/OrderOutbound.php @@ -61,9 +61,9 @@ class OrderOutbound $sheet->setCellValue('B' . ($k + 4), $v['store_name']); $sheet->setCellValue('C' . ($k + 4), $v['unit_name']); $sheet->setCellValue('D' . ($k + 4), $v['gross_weight']); - $sheet->setCellValue('E' . ($k + 4), $v['accept_num']==0 ? $v['cart_num'] : $v['accept_num']); + $sheet->setCellValue('E' . ($k + 4), $v['nums']); $sheet->setCellValue('F' . ($k + 4), $v['price']); - $sheet->setCellValue('G' . ($k + 4), $v['pay_price']==0 ? $v['total_price'] : $v['pay_price']); + $sheet->setCellValue('G' . ($k + 4), $v['total_price']); $sheet->mergeCells('H' . ($k + 4) . ':I' . $k + 4); $sheet->setCellValue('H' . ($k + 4), $v['mark']); }