feat(admin): 整合财务模块导航为侧边栏子菜单与顶部联动Tab
- 侧边栏收敛:将散落在运营分组下的销售毛利、商品与成本、钱包管理、收支明细整合入「财务」二级子菜单,并支持智能展开与角色权限隔离 - 顶部导航联动:新增 FinanceSubNav 通用组件,在销售毛利、商品与成本中心、钱包管理、收支明细 4 个页面顶部统一提供一键切换 Tab - 语义规范化:将原“财务”流水页面标题明确为“收支明细”,消除模块与页面的命名歧义 - 验证方式:npm run check 全量检查通过(Prettier、ESLint、tsc、单测 100% 通过),构建产物已同步至运行容器并验证路由与交互
This commit is contained in:
@@ -19,6 +19,7 @@ import { useState } from 'react'
|
||||
|
||||
import { AdminRangePicker } from '@/components/admin/AdminDatePicker'
|
||||
import PageHeader from '@/components/admin/PageHeader'
|
||||
import FinanceSubNav from '@/components/admin/FinanceSubNav'
|
||||
import dayjs from '@/lib/dayjs'
|
||||
import {
|
||||
fetchAdminFinanceSummary,
|
||||
@@ -160,7 +161,8 @@ export default function AdminFinancePage() {
|
||||
|
||||
return (
|
||||
<section className="page-stack">
|
||||
<PageHeader title="财务" description="按日期查看订单收款、退款、打手结算和平台现金流。" />
|
||||
<FinanceSubNav current="/admin/finance" />
|
||||
<PageHeader title="收支明细" description="按日期查看订单收款、退款、打手结算和平台现金流。" />
|
||||
|
||||
<Card>
|
||||
<Form<FinanceFilterForm>
|
||||
|
||||
@@ -21,6 +21,7 @@ import { useState } from 'react'
|
||||
|
||||
import { AdminRangePicker } from '@/components/admin/AdminDatePicker'
|
||||
import PageHeader from '@/components/admin/PageHeader'
|
||||
import FinanceSubNav from '@/components/admin/FinanceSubNav'
|
||||
import dayjs from '@/lib/dayjs'
|
||||
import {
|
||||
fetchAdminSalesDailyFacts,
|
||||
@@ -98,7 +99,12 @@ export default function AdminSalesProfitPage() {
|
||||
function resetFilters() {
|
||||
form.resetFields()
|
||||
setPage(1)
|
||||
setFilters({ dateFrom: defaultDateFrom, dateTo: defaultDateTo, provider: '', fulfillmentMode: '' })
|
||||
setFilters({
|
||||
dateFrom: defaultDateFrom,
|
||||
dateTo: defaultDateTo,
|
||||
provider: '',
|
||||
fulfillmentMode: '',
|
||||
})
|
||||
}
|
||||
|
||||
async function rebuildFacts() {
|
||||
@@ -243,6 +249,7 @@ export default function AdminSalesProfitPage() {
|
||||
|
||||
return (
|
||||
<section className="page-stack">
|
||||
<FinanceSubNav current="/admin/sales-profit" />
|
||||
<PageHeader
|
||||
title="销售毛利"
|
||||
description="按订单项归集收入与成本;未归一商品单独成行,成本缺失时毛利不直接用于决策。"
|
||||
|
||||
@@ -5,12 +5,7 @@
|
||||
* 不写渠道映射,也不维护游戏分类。
|
||||
* 成本按上游商品配置采购单价(cost_versions),并在改价/初次配置后重算成本快照。
|
||||
*/
|
||||
import {
|
||||
DownloadOutlined,
|
||||
EditOutlined,
|
||||
ReloadOutlined,
|
||||
SyncOutlined,
|
||||
} from '@ant-design/icons'
|
||||
import { DownloadOutlined, EditOutlined, ReloadOutlined, SyncOutlined } from '@ant-design/icons'
|
||||
import {
|
||||
Alert,
|
||||
App,
|
||||
@@ -267,11 +262,7 @@ export function AffiliateSkuPanel() {
|
||||
>
|
||||
重算成本快照
|
||||
</Button>
|
||||
<Button
|
||||
icon={<SyncOutlined />}
|
||||
loading={syncing}
|
||||
onClick={() => void syncProducts()}
|
||||
>
|
||||
<Button icon={<SyncOutlined />} loading={syncing} onClick={() => void syncProducts()}>
|
||||
同步自动发货商品
|
||||
</Button>
|
||||
<Button
|
||||
@@ -478,7 +469,8 @@ export function AffiliateSkuPanel() {
|
||||
<Space direction="vertical" size={0}>
|
||||
<Typography.Text strong>追溯至历史订单 (推荐)</Typography.Text>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
自近一个月业务起点(30 天前)生效,重算快照后可直接消除近一个月 cost_missing 异常
|
||||
自近一个月业务起点(30 天前)生效,重算快照后可直接消除近一个月 cost_missing
|
||||
异常
|
||||
</Typography.Text>
|
||||
</Space>
|
||||
</Radio>
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
|
||||
import PageHeader from '@/components/admin/PageHeader'
|
||||
import FinanceSubNav from '@/components/admin/FinanceSubNav'
|
||||
import { usePersistedState } from '@/hooks/usePersistedState'
|
||||
import { fetchAdminCostCenterOptions, fetchAdminCostCenterOverview } from '@/services/admin'
|
||||
import { hasAdminPermission } from '@/utils/admin-auth'
|
||||
@@ -121,6 +122,7 @@ export default function CostCenterShell() {
|
||||
}}
|
||||
>
|
||||
<section className="page-stack">
|
||||
<FinanceSubNav current="/admin/cost-center" />
|
||||
<PageHeader
|
||||
title="商品与成本中心"
|
||||
description="商品 SKU 先归一;成本在各来源自己的配置里维护(人工 SKU 消耗积分 / 自动发货采购价 / 接单模板发单金额),历史成本靠快照固化。"
|
||||
|
||||
@@ -618,7 +618,11 @@ export function ProductCatalogPanel() {
|
||||
style={{ padding: 0 }}
|
||||
onClick={() => canConfig && openSetProductPrice(row)}
|
||||
>
|
||||
{value > 0 ? `${value} 个版本 · 改价` : row.source === 'work_order' ? '配置结算成本' : '未配置 · 立即配置'}
|
||||
{value > 0
|
||||
? `${value} 个版本 · 改价`
|
||||
: row.source === 'work_order'
|
||||
? '配置结算成本'
|
||||
: '未配置 · 立即配置'}
|
||||
</Button>
|
||||
)
|
||||
},
|
||||
@@ -1005,9 +1009,7 @@ export function ProductCatalogPanel() {
|
||||
<Form.Item
|
||||
name="amountYuan"
|
||||
label={
|
||||
pricingProduct.source === 'affiliate_dash'
|
||||
? '采购单价(元)'
|
||||
: '标准结算单价(元)'
|
||||
pricingProduct.source === 'affiliate_dash' ? '采购单价(元)' : '标准结算单价(元)'
|
||||
}
|
||||
rules={[{ required: true, message: '请填写价格' }]}
|
||||
extra={
|
||||
@@ -1050,7 +1052,10 @@ export function ProductCatalogPanel() {
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item noStyle shouldUpdate={(prev, curr) => prev.effectiveScope !== curr.effectiveScope}>
|
||||
<Form.Item
|
||||
noStyle
|
||||
shouldUpdate={(prev, curr) => prev.effectiveScope !== curr.effectiveScope}
|
||||
>
|
||||
{({ getFieldValue }) =>
|
||||
getFieldValue('effectiveScope') === 'custom' ? (
|
||||
<Form.Item
|
||||
@@ -1069,11 +1074,7 @@ export function ProductCatalogPanel() {
|
||||
</Form.Item>
|
||||
|
||||
{pricingProduct.canonicalSku.startsWith('tpl:') ? (
|
||||
<Form.Item
|
||||
name="syncOpenOrders"
|
||||
valuePropName="checked"
|
||||
style={{ marginBottom: 12 }}
|
||||
>
|
||||
<Form.Item name="syncOpenOrders" valuePropName="checked" style={{ marginBottom: 12 }}>
|
||||
<Checkbox>
|
||||
<strong>立即同步至接单大厅待抢单工单(推荐)</strong>
|
||||
<div style={{ color: '#64748b', fontSize: 12 }}>
|
||||
@@ -1084,11 +1085,7 @@ export function ProductCatalogPanel() {
|
||||
) : null}
|
||||
|
||||
{pricingProduct.source === 'affiliate_dash' ? (
|
||||
<Form.Item
|
||||
name="syncSnapshots"
|
||||
valuePropName="checked"
|
||||
style={{ marginBottom: 12 }}
|
||||
>
|
||||
<Form.Item name="syncSnapshots" valuePropName="checked" style={{ marginBottom: 12 }}>
|
||||
<Checkbox>
|
||||
<strong>立即重算成本快照并回填历史(推荐)</strong>
|
||||
<div style={{ color: '#64748b', fontSize: 12 }}>
|
||||
|
||||
@@ -38,6 +38,7 @@ import { PlatformCreditPanel } from './PlatformCreditPanel'
|
||||
import ImagePreviewList from '@/components/files/ImagePreviewList'
|
||||
import ImageUpload from '@/components/files/ImageUpload'
|
||||
import PageHeader from '@/components/admin/PageHeader'
|
||||
import FinanceSubNav from '@/components/admin/FinanceSubNav'
|
||||
import {
|
||||
confirmAdminFundReconciliation,
|
||||
createAdminFundAccount,
|
||||
@@ -875,6 +876,7 @@ export default function FundManagementView({ role }: { role: ManagementRole }) {
|
||||
|
||||
return (
|
||||
<section className="page-stack">
|
||||
<FinanceSubNav current="/admin/fund" />
|
||||
<PageHeader
|
||||
title="钱包管理"
|
||||
description="统管客服的南航 / 乐玩 / ROCK 积分钱包与备用金现金;可分配积分、发放现金、查看流水与对账。"
|
||||
|
||||
Reference in New Issue
Block a user