feat: 新增订单数据一级导航

This commit is contained in:
renshen 2026-08-06 16:58:38 +08:00
parent 15a9e3f475
commit 88aca07f8e
3 changed files with 38 additions and 0 deletions

View File

@ -167,6 +167,12 @@ return [
['slug' => 'supplier-payables-report', 'title' => '供应商应付表'],
],
],
[
'slug' => 'order-data',
'title' => '订单数据',
'icon' => 'receipt_long',
'pages' => [],
],
[
'slug' => 'courier-payables',
'title' => '快递应付',

View File

@ -42,6 +42,19 @@ class PagesTest extends FeatureTestCase
->assertDontSee('class="business-blank-page"', false);
}
public function testOrderDataSectionOpensThroughTheSharedWorkspaceRoute()
{
$this->user->attachPermission(
Permission::where('name', 'read-admin-panel')->firstOrFail()
);
$this->loginAs()
->get(route('business.pages.show', ['section' => 'order-data']))
->assertOk()
->assertSeeText('订单数据')
->assertSeeText('该页面暂未配置数据表,敬请期待。');
}
public function testPaperMaterialPagesRenderAsSeparateTables()
{
$this->user->attachPermission(

View File

@ -42,4 +42,23 @@ class NavigationTest extends FeatureTestCase
$this->assertSame('企业设立', $companyRegistration['title']);
}
public function testOrderDataIsConfiguredAsStandaloneSectionBetweenPayablesMenus()
{
$navigation = BusinessNavigation::all();
$slugs = array_column($navigation, 'slug');
$supplierIndex = array_search('supplier-payables', $slugs, true);
$orderIndex = array_search('order-data', $slugs, true);
$courierIndex = array_search('courier-payables', $slugs, true);
$orderData = $navigation[$orderIndex] ?? null;
$this->assertNotFalse($supplierIndex);
$this->assertNotFalse($orderIndex);
$this->assertNotFalse($courierIndex);
$this->assertGreaterThan($supplierIndex, $orderIndex);
$this->assertLessThan($courierIndex, $orderIndex);
$this->assertSame('订单数据', $orderData['title']);
$this->assertSame([], $orderData['pages']);
}
}