feat: 新增负数预警预估子页面
Co-authored-by: 苏木 <594326199@qq.com> Co-committed-by: 苏木 <594326199@qq.com>
This commit is contained in:
parent
10626f0e55
commit
5f24bf4fcf
@ -5265,7 +5265,18 @@ class Pages extends Controller
|
||||
'planting-loss' => app(\Modules\EcommerceFinance\View\PlantingLossPageData::class)->page(),
|
||||
'finance-data' => app(\Modules\EcommerceFinance\View\SupplierReconciliationPageData::class)->financeData(),
|
||||
'supplier-data' => app(\Modules\EcommerceFinance\View\SupplierReconciliationPageData::class)->supplierData(),
|
||||
'supplier-negative-alert' => app(SupplierNegativeAlertPageData::class)->page(),
|
||||
'supplier-negative-alert',
|
||||
'supplier-negative-alert-data' => app(SupplierNegativeAlertPageData::class)->page(),
|
||||
'supplier-payable-forecast' => [
|
||||
'view' => 'business.pages.negative-alerts.supplier-payable-forecast',
|
||||
],
|
||||
'courier-negative-alert',
|
||||
'courier-negative-alert-data' => [
|
||||
'view' => 'business.pages.negative-alerts.courier-negative-alert',
|
||||
],
|
||||
'courier-freight-forecast' => [
|
||||
'view' => 'business.pages.negative-alerts.courier-freight-forecast',
|
||||
],
|
||||
'store-report-data-logic' => $this->prepareStoreReportLogic(),
|
||||
'tax-forecast-data-logic' => $this->contentForTaxForecastLogic(),
|
||||
default => null,
|
||||
|
||||
@ -746,8 +746,24 @@ $navigation = [
|
||||
'title' => '负数预警',
|
||||
'icon' => 'warning_amber',
|
||||
'pages' => [
|
||||
['slug' => 'supplier-negative-alert', 'title' => '供应商负数预警'],
|
||||
['slug' => 'courier-negative-alert', 'title' => '快递负数预警'],
|
||||
[
|
||||
'slug' => 'supplier-negative-alert',
|
||||
'title' => '供应商负数预警',
|
||||
'children_inherit_parent_access' => true,
|
||||
'children' => [
|
||||
['slug' => 'supplier-negative-alert-data', 'title' => '供应商负数预警'],
|
||||
['slug' => 'supplier-payable-forecast', 'title' => '供应商货款预估'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'slug' => 'courier-negative-alert',
|
||||
'title' => '快递负数预警',
|
||||
'children_inherit_parent_access' => true,
|
||||
'children' => [
|
||||
['slug' => 'courier-negative-alert-data', 'title' => '快递负数预警'],
|
||||
['slug' => 'courier-freight-forecast', 'title' => '快递运费预估'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
@include('business.pages.negative-alerts._placeholder', [
|
||||
'icon' => 'local_shipping',
|
||||
'scopeLabel' => '快递运费预估',
|
||||
'statusTitle' => '快递运费预估口径待接入',
|
||||
'description' => '页面入口已建立,待确认预估月份、快递范围、运费统计口径及数据来源后接入真实数据。',
|
||||
'scopeItems' => [
|
||||
['label' => '统计周期', 'value' => '待确认'],
|
||||
['label' => '数据来源', 'value' => '待接入'],
|
||||
['label' => '运费口径', 'value' => '待确认'],
|
||||
],
|
||||
'emptyTitle' => '快递运费预估数据待接入',
|
||||
'emptyDescription' => '接入后将按快递展示待付运费预估、数据日期和核对结果。',
|
||||
])
|
||||
@ -671,7 +671,7 @@
|
||||
查询
|
||||
</button>
|
||||
<a class="sna-button"
|
||||
href="{{ route('business.pages.show', ['section' => 'negative-alerts', 'page' => 'supplier-negative-alert']) }}">
|
||||
href="{{ route('business.pages.show', ['section' => 'negative-alerts', 'page' => 'supplier-negative-alert-data']) }}">
|
||||
<span class="material-icons-outlined" aria-hidden="true">refresh</span>
|
||||
重置
|
||||
</a>
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
@include('business.pages.negative-alerts._placeholder', [
|
||||
'icon' => 'request_quote',
|
||||
'scopeLabel' => '供应商货款预估',
|
||||
'statusTitle' => '供应商货款预估口径待接入',
|
||||
'description' => '页面入口已建立,待确认预估月份、供应商范围、货款统计口径及数据来源后接入真实数据。',
|
||||
'scopeItems' => [
|
||||
['label' => '统计周期', 'value' => '待确认'],
|
||||
['label' => '数据来源', 'value' => '待接入'],
|
||||
['label' => '货款口径', 'value' => '待确认'],
|
||||
],
|
||||
'emptyTitle' => '供应商货款预估数据待接入',
|
||||
'emptyDescription' => '接入后将按供应商展示待付货款预估、数据日期和核对结果。',
|
||||
])
|
||||
@ -6,6 +6,7 @@ use App\Http\Controllers\Business\PayablesFinalActions;
|
||||
use App\Listeners\Menu\ShowInAdmin;
|
||||
use App\Models\Auth\Permission;
|
||||
use App\Utilities\BusinessNavigation;
|
||||
use App\Utilities\SidebarPermissions;
|
||||
use Modules\EcommerceFinance\Repositories\SupplierManagementMirrorRepository;
|
||||
use Modules\EcommerceFinance\Repositories\SupplierPayableReportRepository;
|
||||
use Modules\EcommerceFinance\Services\PayablesFinalRegistry;
|
||||
@ -27,7 +28,7 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
$this->app->instance(SupplierPayableReportRepository::class, $payableReport);
|
||||
}
|
||||
|
||||
public function test_negative_alerts_is_a_payables_section_with_two_children(): void
|
||||
public function test_negative_alerts_is_a_payables_section_with_two_subpage_groups(): void
|
||||
{
|
||||
$navigation = collect(BusinessNavigation::all())->keyBy('slug');
|
||||
$alertSection = $navigation->get('negative-alerts');
|
||||
@ -38,6 +39,18 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
['supplier-negative-alert', 'courier-negative-alert'],
|
||||
array_column($alertSection['pages'], 'slug'),
|
||||
);
|
||||
$this->assertSame(
|
||||
['supplier-negative-alert-data', 'supplier-payable-forecast'],
|
||||
array_column($alertSection['pages'][0]['children'], 'slug'),
|
||||
);
|
||||
$this->assertSame(
|
||||
['courier-negative-alert-data', 'courier-freight-forecast'],
|
||||
array_column($alertSection['pages'][1]['children'], 'slug'),
|
||||
);
|
||||
$this->assertTrue($alertSection['pages'][0]['children_inherit_parent_access']);
|
||||
$this->assertTrue($alertSection['pages'][1]['children_inherit_parent_access']);
|
||||
$this->assertContains('negative-alerts/supplier-payable-forecast', SidebarPermissions::allKeys());
|
||||
$this->assertContains('negative-alerts/courier-freight-forecast', SidebarPermissions::allKeys());
|
||||
$this->assertNotContains(
|
||||
'supplier-negative-alert',
|
||||
array_column($navigation->get('supplier-reconciliation')['pages'], 'slug'),
|
||||
@ -48,6 +61,29 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
$this->assertSame('negative-alerts', $payables['sections'][0]['slug']);
|
||||
}
|
||||
|
||||
public function test_negative_alert_parent_pages_redirect_to_their_data_pages(): void
|
||||
{
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-negative-alert',
|
||||
]))
|
||||
->assertRedirect(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-negative-alert-data',
|
||||
]));
|
||||
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'courier-negative-alert',
|
||||
]))
|
||||
->assertRedirect(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'courier-negative-alert-data',
|
||||
]));
|
||||
}
|
||||
|
||||
public function test_supplier_and_courier_negative_alert_pages_render_as_tabs(): void
|
||||
{
|
||||
$this->saveSupplierPayable('negative:1', '负余额供应商', '-128.50', '2026-09', [
|
||||
@ -96,11 +132,21 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
$response = $this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-negative-alert',
|
||||
'page' => 'supplier-negative-alert-data',
|
||||
]))
|
||||
->assertOk()
|
||||
->assertSeeText('供应商负数预警')
|
||||
->assertSeeText('快递负数预警')
|
||||
->assertSeeText('供应商货款预估')
|
||||
->assertSeeText('快递运费预估')
|
||||
->assertSee(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-payable-forecast',
|
||||
]), false)
|
||||
->assertSee(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'courier-freight-forecast',
|
||||
]), false)
|
||||
->assertSeeText('按负数预警公式筛出的终版数据')
|
||||
->assertSeeText('供应商余额 - 应付余额 + 预估金额 < 0')
|
||||
->assertSeeText('负余额供应商')
|
||||
@ -153,7 +199,7 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'courier-negative-alert',
|
||||
'page' => 'courier-negative-alert-data',
|
||||
]))
|
||||
->assertOk()
|
||||
->assertSeeText('供应商负数预警')
|
||||
@ -162,6 +208,31 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
->assertSeeText('待接入');
|
||||
}
|
||||
|
||||
public function test_supplier_and_courier_negative_alert_forecast_subpages_render(): void
|
||||
{
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-payable-forecast',
|
||||
]))
|
||||
->assertOk()
|
||||
->assertSeeText('供应商负数预警')
|
||||
->assertSeeText('供应商货款预估')
|
||||
->assertSeeText('供应商货款预估口径待接入')
|
||||
->assertSeeText('供应商货款预估数据待接入');
|
||||
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'courier-freight-forecast',
|
||||
]))
|
||||
->assertOk()
|
||||
->assertSeeText('快递负数预警')
|
||||
->assertSeeText('快递运费预估')
|
||||
->assertSeeText('快递运费预估口径待接入')
|
||||
->assertSeeText('快递运费预估数据待接入');
|
||||
}
|
||||
|
||||
public function test_supplier_negative_alert_filters_by_month_and_supplier(): void
|
||||
{
|
||||
$this->saveSupplierPayable('negative:sep', '九月负余额供应商', '-99.00', '2026-09');
|
||||
@ -170,7 +241,7 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-negative-alert',
|
||||
'page' => 'supplier-negative-alert-data',
|
||||
'month' => '2026-08',
|
||||
'supplier' => '八月负余额',
|
||||
]))
|
||||
@ -206,7 +277,7 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-negative-alert',
|
||||
'page' => 'supplier-negative-alert-data',
|
||||
]))
|
||||
->assertOk()
|
||||
->assertSeeText('一键发送待处理采购(2 人)');
|
||||
@ -214,7 +285,7 @@ class NegativeAlertPagesTest extends FeatureTestCase
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-negative-alert',
|
||||
'page' => 'supplier-negative-alert-data',
|
||||
'checker' => '李萌',
|
||||
'settlement_method' => '订单合同',
|
||||
'purchaser' => '采购甲',
|
||||
|
||||
@ -550,7 +550,7 @@ class SupplierNegativeAlertDingTalkTest extends FeatureTestCase
|
||||
{
|
||||
return route('business.pages.show', array_merge([
|
||||
'section' => 'negative-alerts',
|
||||
'page' => 'supplier-negative-alert',
|
||||
'page' => 'supplier-negative-alert-data',
|
||||
], $query));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user