diff --git a/app/Http/Controllers/Business/Pages.php b/app/Http/Controllers/Business/Pages.php index 4b1ba6fc..cf8c957e 100644 --- a/app/Http/Controllers/Business/Pages.php +++ b/app/Http/Controllers/Business/Pages.php @@ -381,6 +381,10 @@ class Pages extends Controller $tabColumn = null; $upstreamError = null; + if (($section['slug'] ?? null) === 'product-inventory' && ($page['slug'] ?? null) === 'inventory-report') { + $rows = $this->inventoryReportDemoRows(); + } + if ($page && $content === null) { $descriptor = TableRegistry::describe( $section['slug'], @@ -481,6 +485,26 @@ class Pages extends Controller ]; } + private function inventoryReportDemoRows(): LengthAwarePaginator + { + $columns = config('inventory_report_demo.columns', []); + $rows = collect(config('inventory_report_demo.rows', [])) + ->map(fn (array $row): array => array_combine($columns, $row)); + $perPage = 50; + $currentPage = max(1, request()->integer('page', 1)); + + return new LengthAwarePaginator( + $rows->forPage($currentPage, $perPage)->values(), + $rows->count(), + $perPage, + $currentPage, + [ + 'path' => request()->url(), + 'query' => request()->query(), + ], + ); + } + private function isStoreReceivingAccountPage(string $section, string $page): bool { return $section === 'fund-management' && $page === 'store-receiving-accounts'; diff --git a/config/business_navigation.php b/config/business_navigation.php index ad7c2ab8..d51c89b9 100644 --- a/config/business_navigation.php +++ b/config/business_navigation.php @@ -307,10 +307,32 @@ $navigation = [ 'title' => '进销存报表', 'directory' => [ 'icon' => 'inventory', - 'status' => '字段待定义', - 'description' => '进销存报表页面入口已建立,待确认报表字段和数据来源后接入正式数据。', - 'empty' => '进销存报表字段和数据来源尚未定义。', - 'fields' => [], + 'status' => '演示数据', + 'description' => '按进销存报表模板展示货主、仓库、商品及库存变动数据。', + 'empty' => '暂无进销存演示数据。', + 'fields' => [ + ['name' => 'owner', 'label' => '货主'], + ['name' => 'month', 'label' => '月份', 'kind' => 'date'], + ['name' => 'warehouse_provider', 'label' => '仓储方'], + ['name' => 'warehouse', 'label' => '仓库'], + ['name' => 'product_code', 'label' => '商品编码'], + ['name' => 'category', 'label' => '分类'], + ['name' => 'opening_quantity', 'label' => '期初数量', 'kind' => 'integer'], + ['name' => 'closing_quantity', 'label' => '期末数量', 'kind' => 'integer'], + ['name' => 'processing_in', 'label' => '加工进仓', 'kind' => 'integer'], + ['name' => 'processing_out', 'label' => '加工出仓', 'kind' => 'integer'], + ['name' => 'purchase_in', 'label' => '采购进仓', 'kind' => 'integer'], + ['name' => 'purchase_return', 'label' => '采购退货', 'kind' => 'integer'], + ['name' => 'other_in', 'label' => '其它进仓', 'kind' => 'integer'], + ['name' => 'other_return', 'label' => '其它退货', 'kind' => 'integer'], + ['name' => 'sales_out', 'label' => '销售出仓', 'kind' => 'integer'], + ['name' => 'sales_return', 'label' => '销售退货', 'kind' => 'integer'], + ['name' => 'stocktake', 'label' => '盘点', 'kind' => 'integer'], + ['name' => 'transfer_out', 'label' => '调拨出', 'kind' => 'integer'], + ['name' => 'transfer_in', 'label' => '调拨入', 'kind' => 'integer'], + ['name' => 'opening', 'label' => '期初', 'kind' => 'integer'], + ['name' => 'other_out', 'label' => '其它出库', 'kind' => 'integer'], + ], ], ], ], diff --git a/config/inventory_report_demo.php b/config/inventory_report_demo.php new file mode 100644 index 00000000..97e8beea --- /dev/null +++ b/config/inventory_report_demo.php @@ -0,0 +1,32 @@ + [ + 'owner', 'month', 'warehouse_provider', 'warehouse', 'product_code', 'category', + 'opening_quantity', 'closing_quantity', 'processing_in', 'processing_out', + 'purchase_in', 'purchase_return', 'other_in', 'other_return', 'sales_out', + 'sales_return', 'stocktake', 'transfer_out', 'transfer_in', 'opening', 'other_out', + ], + 'rows' => [ + ['常州简尚家居有限公司', '2026-09-01', '简尚-崔桥工厂仓', '简尚-崔桥工厂仓主仓', '100006981661', '住宅家具 - 书桌', 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '简尚-横林二仓', '客退临时上架仓', '110886Z15', null, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '121630-49', '其他 - 配件', -2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '简尚-崔桥工厂仓', '简尚-崔桥工厂仓主仓', '121640', '住宅家具 - 门厅/玄关柜/玄关架', 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135150-13', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '简尚-分销部专用仓', '简尚-分销部专用仓主仓', '135580', '住宅家具 - 餐边柜', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-1', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-12', '其他 - 配件', -3, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-13', '其他 - 配件', -3, -4, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-14', '其他 - 配件', -4, -5, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-15', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-16', '其他 - 配件', -1, -3, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-17', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-18', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-19', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-21', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-26', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-28', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '常州简尚家居有限公司', '配件单仓', '135590-33', '其他 - 配件', -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['常州简尚家居有限公司', '2026-09-01', '简尚-分销部崔桥专用仓', '简尚-分销部崔桥专用仓主仓', '135600', '住宅家具 - 餐边柜', 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ], +]; diff --git a/resources/views/business/pages/partials/directory-table.blade.php b/resources/views/business/pages/partials/directory-table.blade.php index 70f37587..ffb0a6eb 100644 --- a/resources/views/business/pages/partials/directory-table.blade.php +++ b/resources/views/business/pages/partials/directory-table.blade.php @@ -369,6 +369,11 @@ {{ $upstreamError }} + @elseif (($directory['status'] ?? null) === '演示数据' && $directoryTotal > 0) +