fix(admin): 修复导出订单出库单功能
- 增加订单未出库时的错误提示 - 修改导出数据的来源,从订单购物车信息
This commit is contained in:
parent
1a89c2f1f8
commit
9482c590ff
@ -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'];
|
||||
|
@ -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']);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user