按「库存监控」表格在侧边栏增加一级/二级菜单与共用页面 (路由 /planning/large-stock-monitor/:warehouseSlug)。 后端: - 新增 largeStockMonitorConfig.js:26 仓配置,含 wms_co_id / 快照仓名 / routeKey / slug 映射 - 新增 largeStockMonitor.js:config / overview / sku-list 三个接口 - 新增 largeStockMonitorFlow.js:采购进仓、采购退货、销售出仓、销售退货四类单据流水取数 - 新增 verify-large-stock-monitor.js:26 仓端到端校验脚本 - index.js:挂载 /api/large-stock-monitor 路由 口径说明: - 库存周转天数 = 月度发货总件数 / 月度日均库存件数 × 100%,下沉到 SQL CASE WHEN 计算 - 四级分级(滞销预警/慢流/呆滞/僵尸)按库龄 + 周转率双维度判定 - 期末数量取聚水潭实际库存 jst_inventoryInfo(按 wms_co_id 单仓), 不用 pm_stockMonitor.jsStock —— 后者 warehouse 是「归属仓」口径, 会把已调拨到外仓的货仍计在本仓名下(崔桥工厂仓因此虚高约 2.2 万) - 截止时刻统一为快照日次日 01:00(跑批时点),库龄/分级均以此为基准,不再用 GETDATE() 前端: - 新增 LargeStockMonitor 页面、18 列定义、API 封装与样式 - 路由与侧边栏:26 条二级菜单 + 权限点 冲突处理: - 主仓库已下线 /api/dashboard(backend/src/api/dashboard.js 被移除), 相应删除 dashboardRoutes 的 require 与挂载,避免后端启动时 require 失败崩溃 - 保留主仓库新增的「模块化库存监控」菜单组及其子项
160 lines
5.6 KiB
JavaScript
160 lines
5.6 KiB
JavaScript
import React, { lazy, Suspense } from 'react';
|
|
import { createBrowserRouter, Navigate } from 'react-router-dom';
|
|
import BasicLayout from '../layouts/BasicLayout';
|
|
import { AuthPageLoadingFallback, PageLoadingFallback } from '../components/AppLoadingSkeleton';
|
|
|
|
const Login = lazy(() => import('../pages/Login'));
|
|
const Install = lazy(() => import('../pages/Install'));
|
|
const Setup = lazy(() => import('../pages/Setup'));
|
|
const Settings = lazy(() => import('../pages/Settings'));
|
|
const OnlineDesktopUsers = lazy(() => import('../pages/OnlineDesktopUsers'));
|
|
const DesktopExecutionTasks = lazy(() => import('../pages/DesktopExecutionTasks'));
|
|
const MarketingEvents = lazy(() => import('../pages/MarketingEvents'));
|
|
const ProductInformation = lazy(() => import('../pages/ProductInformation'));
|
|
const PromotionModule = lazy(() => import('../pages/PromotionModule'));
|
|
const OperationPlaceholder = lazy(() => import('../pages/OperationPlaceholder'));
|
|
const DevelopmentStylePreview = lazy(() => import('../pages/DevelopmentStylePreview'));
|
|
const ProductAnalysis = lazy(() => import('../pages/ProductAnalysis'));
|
|
const OpsBIncentiveBoard = lazy(() => import('../pages/PlanningUpload/OpsBIncentiveBoard'));
|
|
const ProductMonitoring = lazy(() => import('../pages/ProductMonitoring'));
|
|
const ModularStockMonitor = lazy(() => import('../pages/ModularStockMonitor'));
|
|
const MkhBomData = lazy(() => import('../pages/MkhBomData'));
|
|
const LargeStockMonitor = lazy(() => import('../pages/LargeStockMonitor'));
|
|
|
|
const lazyLoadingElement = <PageLoadingFallback />;
|
|
|
|
const renderLazyComponent = (lazyView, props = {}, fallback = lazyLoadingElement) => {
|
|
const LazyView = lazyView;
|
|
|
|
return (
|
|
<Suspense fallback={fallback}>
|
|
<LazyView {...props} />
|
|
</Suspense>
|
|
);
|
|
};
|
|
|
|
const HOME_URL = '/planning/dev-style-preview';
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: '/login',
|
|
element: renderLazyComponent(Login, {}, <AuthPageLoadingFallback />),
|
|
},
|
|
{
|
|
path: '/callback',
|
|
element: renderLazyComponent(Login, {}, <AuthPageLoadingFallback />),
|
|
},
|
|
{
|
|
path: '/setup',
|
|
element: renderLazyComponent(Setup),
|
|
},
|
|
{
|
|
path: '/install',
|
|
element: renderLazyComponent(Install),
|
|
},
|
|
{
|
|
path: '/',
|
|
element: <BasicLayout />,
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <Navigate to={HOME_URL} replace />,
|
|
},
|
|
{
|
|
path: 'dashboard',
|
|
element: <Navigate to={HOME_URL} replace />,
|
|
},
|
|
{
|
|
path: 'channel',
|
|
element: <Navigate to={HOME_URL} replace />,
|
|
},
|
|
{
|
|
path: 'planning',
|
|
element: <Navigate to={HOME_URL} replace />,
|
|
},
|
|
{
|
|
path: 'planning/operation/marketing-events',
|
|
element: <Navigate to="/planning/operation/marketing-events/activity-products" replace />,
|
|
},
|
|
{
|
|
path: 'planning/operation/marketing-events/activity-products',
|
|
element: renderLazyComponent(MarketingEvents),
|
|
},
|
|
{
|
|
path: 'planning/operation/marketing-tools',
|
|
element: <Navigate to="/planning/operation/marketing-events" replace />,
|
|
},
|
|
{
|
|
path: 'planning/operation/product-information',
|
|
element: renderLazyComponent(ProductInformation),
|
|
},
|
|
{
|
|
path: 'planning/operation/product-analysis',
|
|
element: renderLazyComponent(ProductAnalysis),
|
|
},
|
|
{
|
|
path: 'planning/operation/promotion-module',
|
|
element: renderLazyComponent(PromotionModule),
|
|
},
|
|
{
|
|
path: 'planning/operation/ops-b-incentive',
|
|
element: renderLazyComponent(OpsBIncentiveBoard),
|
|
},
|
|
{
|
|
path: 'planning/operation/product-monitoring',
|
|
element: renderLazyComponent(ProductMonitoring),
|
|
},
|
|
{
|
|
path: 'planning/operation/modular-stock-monitor',
|
|
element: renderLazyComponent(ModularStockMonitor),
|
|
},
|
|
{
|
|
path: 'planning/operation/mkh-bom-data',
|
|
element: renderLazyComponent(MkhBomData),
|
|
},
|
|
{ path: 'planning/operation/store-checkup', element: <Navigate to={HOME_URL} replace /> },
|
|
{ path: 'planning/operation/review-analysis', element: <Navigate to={HOME_URL} replace /> },
|
|
{ path: 'planning/operation/customer-service-checkup', element: <Navigate to={HOME_URL} replace /> },
|
|
{ path: 'planning/operation/pricing-calculator', element: <Navigate to={HOME_URL} replace /> },
|
|
{ path: 'planning/operation/desktop-client-download', element: <Navigate to={HOME_URL} replace /> },
|
|
{ path: 'planning/operation/ai-buyer-show', element: <Navigate to={HOME_URL} replace /> },
|
|
{ path: 'planning/operation/ai-seeding-video', element: <Navigate to={HOME_URL} replace /> },
|
|
{ path: 'settings/desktop-client-releases', element: <Navigate to={HOME_URL} replace /> },
|
|
{
|
|
path: 'planning/operation/:featureKey',
|
|
element: renderLazyComponent(OperationPlaceholder),
|
|
},
|
|
{
|
|
path: 'planning/upload',
|
|
element: <Navigate to={HOME_URL} replace />,
|
|
},
|
|
{
|
|
path: 'planning/dev-style-preview',
|
|
element: renderLazyComponent(DevelopmentStylePreview),
|
|
},
|
|
{
|
|
path: 'planning/large-stock-monitor/:warehouseSlug',
|
|
element: renderLazyComponent(LargeStockMonitor),
|
|
},
|
|
{
|
|
path: 'settings',
|
|
element: renderLazyComponent(Settings),
|
|
},
|
|
{
|
|
path: 'settings/online-desktop-users',
|
|
element: renderLazyComponent(OnlineDesktopUsers),
|
|
},
|
|
{
|
|
path: 'settings/desktop-execution-tasks',
|
|
element: renderLazyComponent(DesktopExecutionTasks),
|
|
},
|
|
{
|
|
path: '*',
|
|
element: <Navigate to={HOME_URL} replace />,
|
|
},
|
|
],
|
|
},
|
|
]);
|
|
|
|
export default router;
|