From ae439f13895eccfba59d8f7b9d1af17d14851244 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 8 Nov 2024 16:37:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E4=B8=BA=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=A1=A8=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=87=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 BeforehandOrderLists 类中实现 ListsExcelInterface 接口,添加导出文件名和导出字段方法 - 在 OrderOutbound 类中增加下单时间和送货时间字段,并调整收货地址显示格式 --- .../beforehand_order/BeforehandOrderLists.php | 39 ++++++++++++++++++- app/common/service/xlsx/OrderOutbound.php | 11 +++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index 23e62ed3..ca59aa15 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -9,13 +9,14 @@ use app\common\lists\ListsSearchInterface; use app\common\model\auth\Admin; use app\common\model\purchase_product_offer\PurchaseProductOffer; use app\common\model\system_store\SystemStore; +use app\common\lists\ListsExcelInterface; /** * 预订单表列表 * Class BeforehandOrderLists * @package app\admin\listsbeforehand_order */ -class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInterface +class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { @@ -105,5 +106,41 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte { return BeforehandOrder::where($this->searchWhere)->count(); } + /** + * @notes 导出文件名 + * @return string + * @author 乔峰 + * @date 2022/11/24 16:17 + */ + public function setFileName(): string + { + return '预订单表'; + } + + + /** + * @notes 导出字段 + * @return string[] + * @author 乔峰 + * @date 2022/11/24 16:17 + */ + public function setExcelFields(): array + { + $data=[ + 'id'=>'ID', + 'order_id'=>'单号', + 'order_type_name'=>'订单类型', + 'system_store' => '门店', + 'admin_name' => '门店', + 'warehousing' => '入库', + 'outbound' => '出库', + 'total_price' => '总价', + 'admin_name' => '用户', + 'mark' => '备注', + 'msg' => '通知', + 'create_time' => '时间', + ]; + return $data; + } } \ No newline at end of file diff --git a/app/common/service/xlsx/OrderOutbound.php b/app/common/service/xlsx/OrderOutbound.php index 55c679cc..72fd96d3 100644 --- a/app/common/service/xlsx/OrderOutbound.php +++ b/app/common/service/xlsx/OrderOutbound.php @@ -93,8 +93,17 @@ class OrderOutbound $sheet->mergeCells('G' . ($count + 7) . ':I' . $count + 7); $sheet->setCellValue('G' . ($count + 7),$order['system_store_name']); - $sheet->mergeCells('B' . ($count + 8) . ':I' . $count + 8); + $sheet->mergeCells('B' . ($count + 8) . ':C' . $count + 8); $sheet->setCellValue('A'. ($count + 8), '收货地址:'); + + $sheet->mergeCells('E' . ($count + 8) . ':F' . $count + 8); + $sheet->setCellValue('D'. ($count + 8), '下单时间:'); + $sheet->setCellValue('E'. ($count + 8), $order['create_time']); + + $sheet->setCellValue('G'. ($count + 8), '送货时间:'); + $sheet->mergeCells('H' . ($count + 8) . ':I' . $count + 8); + $sheet->setCellValue('H'. ($count + 8), $other_data->arrival_time??''); + $sheet->setCellValue('B'. ($count + 8), $other_data->address??''); $sheet->mergeCells('B' . ($count + 9) . ':E' . $count + 9);