diff --git a/config/sidebar_links.php b/config/sidebar_links.php index ba0ae652..ad4e2443 100644 --- a/config/sidebar_links.php +++ b/config/sidebar_links.php @@ -9,4 +9,5 @@ */ return [ + ['title' => '聚水潭', 'url' => 'https://w.erp321.com/login.aspx'], ]; diff --git a/resources/views/business/pages/home.blade.php b/resources/views/business/pages/home.blade.php index c0120b71..6ae47e2f 100644 --- a/resources/views/business/pages/home.blade.php +++ b/resources/views/business/pages/home.blade.php @@ -1,9 +1,16 @@ @php - $pageTotal = collect($sections)->sum(static fn (array $section): int => count($section['pages'])); + $kpis = [ + ['key' => 'income', 'label' => '本月收入'], + ['key' => 'expense', 'label' => '本月支出'], + ['key' => 'gross_profit', 'label' => '本月毛利'], + ['key' => 'gross_margin', 'label' => '毛利率'], + ['key' => 'receivable', 'label' => '应收余额'], + ['key' => 'payable', 'label' => '应付余额'], + ]; @endphp - 首页 + 财务驾驶舱 -
-
-

{{ user()->name }},欢迎回来

-

从下面的模块进入要处理的页面,也可以直接用左侧菜单搜索。

-
+
+
+

FINANCE COCKPIT

+

财务驾驶舱

+

指标口径和数据源待确认,下面先留出位置;确认后接入真实数据。

+
-
- @foreach ($groups as $group) -
-

{{ $group['title'] }}

- +
+ @foreach ($kpis as $kpi) +
+ {{ $kpi['label'] }} + — + 待接入
@endforeach
- @if ($sections !== []) -
-

- 全部业务模块 - {{ count($sections) }} 个模块 · {{ $pageTotal }} 个页面 +
+
+

+ + 近 12 个月收入 / 支出

- @foreach ($sections as $section) -
- - - {{ $section['title'] }} - {{ count($section['pages']) }} 个页面 - -
- @foreach ($section['pages'] as $sectionPage) - {{ $sectionPage['title'] }} - @endforeach -
-
- @endforeach +
图表位置(接入数据后显示趋势)
- @endif +
+

+ + 风险预警 +

+
预警位置(接入数据后显示待处理事项)
+
+

diff --git a/tests/Feature/Auth/DingTalkLoginTest.php b/tests/Feature/Auth/DingTalkLoginTest.php index e5af8185..5f99f310 100644 --- a/tests/Feature/Auth/DingTalkLoginTest.php +++ b/tests/Feature/Auth/DingTalkLoginTest.php @@ -131,7 +131,7 @@ class DingTalkLoginTest extends FeatureTestCase ]); $this->get(route('dashboard', ['company_id' => $this->company->id])) ->assertOk() - ->assertSee('data-home-nav', false); + ->assertSee('data-cockpit', false); } public function test_limited_login_gets_only_three_courier_pages_and_blocks_direct_urls(): void @@ -569,8 +569,7 @@ class DingTalkLoginTest extends FeatureTestCase $this->actingAs($created)->withSession(['dingtalk_identity_id' => $created->dingtalkIdentity->id, 'dingtalk_roster_checked_at' => now()->timestamp]) ->get(route('dashboard')) ->assertOk() - ->assertSee('data-home-nav', false) - ->assertSeeText('店铺基础信息'); + ->assertSee('data-cockpit', false); $this->withExceptionHandling()->get(route('business.pages.show', [ 'company_id' => $this->company->id, 'section' => 'company-management', 'page' => 'basic-information', ]))->assertForbidden(); diff --git a/tests/Feature/Business/PagesTest.php b/tests/Feature/Business/PagesTest.php index 8fe9b743..c8be3981 100644 --- a/tests/Feature/Business/PagesTest.php +++ b/tests/Feature/Business/PagesTest.php @@ -19,15 +19,14 @@ use Tests\Feature\FeatureTestCase; class PagesTest extends FeatureTestCase { - public function testDashboardShowsHomeNavigationInsteadOfOpeningTheFirstBusinessPage(): void + public function testDashboardShowsFinanceCockpitInsteadOfOpeningTheFirstBusinessPage(): void { $this->loginAs() ->get(route('dashboard', ['company_id' => company_id()])) ->assertOk() - ->assertSee('data-home-nav', false) - ->assertSeeText('全部业务模块') - ->assertSee(route('business.pages.show', ['section' => 'courier-payables', 'page' => 'quote-management']), false) - ->assertSee(route('business.pages.show', ['section' => 'company-management', 'page' => 'subject-operating-report']), false); + ->assertSee('data-cockpit', false) + ->assertSeeText('财务驾驶舱') + ->assertSee('data-cockpit-kpi="income"', false); } public function testInventoryReportProvidesAFilteredExportButton(): void