From 664fc05faf2fcad94ee3cd974b26d0a3989a107e Mon Sep 17 00:00:00 2001 From: renshen <1005457301@qq.com> Date: Mon, 19 Oct 2026 14:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=94=B9=E4=B8=BA=E8=B4=A2?= =?UTF-8?q?=E5=8A=A1=E9=A9=BE=E9=A9=B6=E8=88=B1=E9=AA=A8=E6=9E=B6=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=8A=A0=E5=85=A5=E5=B8=B8=E7=94=A8=E7=BD=91=E5=9D=80?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 首页不再展示业务目录:改为财务驾驶舱(本月收入/支出/毛利/毛利率/应收/应付 + 趋势 + 风险预警位置),指标待接入 - 侧边栏常用网址:新增聚水潭,搜索框右侧书签入口展示 - 更新首页相关测试 --- config/sidebar_links.php | 1 + resources/views/business/pages/home.blade.php | 276 +++++++----------- tests/Feature/Auth/DingTalkLoginTest.php | 5 +- tests/Feature/Business/PagesTest.php | 9 +- 4 files changed, 108 insertions(+), 183 deletions(-) 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