新增进销存报表菜单入口 (#212)

在商品价格管理下新增进销存报表入口和只读空状态页面;NavigationTest 5 passed,53 assertions。
This commit is contained in:
chenxi 2026-09-20 12:27:03 +08:00
parent 56949d6d29
commit da4e7d79bc
2 changed files with 34 additions and 1 deletions

View File

@ -302,6 +302,17 @@ $navigation = [
'pages' => [
['slug' => 'normal-products', 'title' => '普通商品资料'],
['slug' => 'online-daifa-price', 'title' => '线上代发价格'],
[
'slug' => 'inventory-report',
'title' => '进销存报表',
'directory' => [
'icon' => 'inventory',
'status' => '字段待定义',
'description' => '进销存报表页面入口已建立,待确认报表字段和数据来源后接入正式数据。',
'empty' => '进销存报表字段和数据来源尚未定义。',
'fields' => [],
],
],
],
],
[

View File

@ -18,7 +18,20 @@ class NavigationTest extends FeatureTestCase
->assertSeeText('商品价格管理')
->assertSee('/workspace/order-data/raw-data', false)
->assertSee('/workspace/refunds/non-jingxi-refund-data', false)
->assertSee('/workspace/product-inventory/normal-products', false);
->assertSee('/workspace/product-inventory/normal-products', false)
->assertSee('/workspace/product-inventory/inventory-report', false);
}
public function testInventoryReportMenuPageIsAvailable(): void
{
$this->loginAs()
->get(route('business.pages.show', [
'section' => 'product-inventory',
'page' => 'inventory-report',
]))
->assertOk()
->assertSeeText('进销存报表')
->assertSeeText('进销存报表字段和数据来源尚未定义。');
}
public function testGroupedNavigationKeepsRestrictedPagePermissions(): void
@ -91,6 +104,7 @@ class NavigationTest extends FeatureTestCase
$receivablesIndex = array_search('store-receivables', $slugs, true);
$orderData = $navigation[$orderIndex] ?? null;
$refund = $navigation[$refundIndex] ?? null;
$productInventory = $navigation[$productIndex] ?? null;
$financialOperations = collect($navigation)->firstWhere('slug', 'financial-operations');
$this->assertNotFalse($invoiceIndex);
@ -148,6 +162,14 @@ class NavigationTest extends FeatureTestCase
['订单售后费用明细', '商品推广费用明细'],
array_column($orderData['pages'][0]['tabs'], 'title')
);
$this->assertSame(
['normal-products', 'online-daifa-price', 'inventory-report'],
array_column($productInventory['pages'], 'slug')
);
$this->assertSame(
['普通商品资料', '线上代发价格', '进销存报表'],
array_column($productInventory['pages'], 'title')
);
$this->assertArrayNotHasKey('children', $orderData['pages'][0]);
$this->assertSame(
['bill-offset'],