diff --git a/app/admin/lists/inventory_transfer/InventoryTransferLists.php b/app/admin/lists/inventory_transfer/InventoryTransferLists.php index 201538979..858f69aa2 100644 --- a/app/admin/lists/inventory_transfer/InventoryTransferLists.php +++ b/app/admin/lists/inventory_transfer/InventoryTransferLists.php @@ -9,13 +9,14 @@ use app\common\lists\ListsSearchInterface; use app\common\model\store_product\StoreProduct; use app\common\model\system_store\SystemStore; use app\common\model\warehouse\Warehouse; +use app\common\lists\ListsExcelInterface; /** * 商品调拨列表 * Class InventoryTransferLists * @package app\admin\listsinventory_transfer */ -class InventoryTransferLists extends BaseAdminDataLists implements ListsSearchInterface +class InventoryTransferLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { public $ids; @@ -74,7 +75,10 @@ class InventoryTransferLists extends BaseAdminDataLists implements ListsSearchIn ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($item){ - $item->store_name= StoreProduct::where('id',$item->product_id)->value('store_name'); + $find= StoreProduct::where('id',$item->product_id)->withTrashed()->field('store_name,price')->find(); + $item->store_name=$find['store_name']; + $item->price=$find['price']; + $item->total_price=bcmul($find['price'],$item['nums'],2); $type_name=''; if($item->one_type==1){ $item->one_name=SystemStore::where('id',$item->one_id)->value('name'); @@ -116,4 +120,41 @@ class InventoryTransferLists extends BaseAdminDataLists implements ListsSearchIn } } + /** + * @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 = [ + 'store_name' => '商品名称', + 'one_before_nums' => '数量', + 'one_name' => '转出方', + 'one_before_nums' => '转出前数量', + 'one_after_nums' => '转出后数量', + 'two_name' => '转入方', + 'two_before_nums' => '转入前数量', + 'two_after_nums' => '转入后数量', + 'price' => '零售价', + 'total_price' => '总价', + 'type_name' => '类型', + 'create_time' => '时间', + + ]; + return $data; + } } \ No newline at end of file diff --git a/app/common/service/xlsx/OrderAllocation.php b/app/common/service/xlsx/OrderAllocation.php index 94e4f83cf..83ac3ace0 100644 --- a/app/common/service/xlsx/OrderAllocation.php +++ b/app/common/service/xlsx/OrderAllocation.php @@ -125,7 +125,7 @@ class OrderAllocation $sheet->setCellValue('K' . ($count + 8),'门店'); $sheet->setCellValue('L' . ($count + 8),$other_data->system_store_name??''); $sheet->setCellValue('M' . ($count + 8),'区域经理'); - $sheet->setCellValue('N' . ($count + 8),$other_data->regional_manager??''); + $sheet->setCellValue('N' . ($count + 8),$other_data->regional_manager??'张波'); $sheet->setCellValue('A' . ($count + 9),'接单时间'); $sheet->setCellValue('B' . ($count + 9),$order['create_time']??''); diff --git a/app/common/service/xlsx/OrderOutbound.php b/app/common/service/xlsx/OrderOutbound.php index 72fd96d30..c235a7b3d 100644 --- a/app/common/service/xlsx/OrderOutbound.php +++ b/app/common/service/xlsx/OrderOutbound.php @@ -74,10 +74,10 @@ class OrderOutbound $sheet->setCellValue('A' . ($count + 5),'累计接单:'); $sheet->setCellValue('C' . ($count + 5),'预收金额:'); - $sheet->setCellValue('D' . ($count + 5),$order['total_price']); + $sheet->setCellValue('D' . ($count + 5),0); $sheet->setCellValue('E' . ($count + 5),'预收押金:'); $sheet->setCellValue('G' . ($count + 5),'合计预收:'); - $sheet->setCellValue('H' . ($count + 5),$order['total_price']); + $sheet->setCellValue('H' . ($count + 5),0); $sheet->setCellValue('A' . ($count + 6),'出库合计:'); $sheet->setCellValue('C' . ($count + 6),'出库金额:');