From e9ed9a463d9742a89d6a28eb459a634d50169982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E5=B1=85?= Date: Wed, 18 Nov 2026 09:19:42 +0800 Subject: [PATCH 01/59] fix(external-sales): rename module to foreign trade sales (cherry picked from commit 8c7ac24459aa4c2b69a071ebbda19427a7fc31b5) --- .../management/external-sales/export/route.ts | 2 +- .../api/supply-chain/management/external-sales/route.ts | 4 ++-- .../src/app/supply-chain/config/supply-chain-menu.test.ts | 2 +- .../management/blank-pages/ExternalSalesView.test.tsx | 2 +- .../management/blank-pages/ExternalSalesView.tsx | 8 ++++---- furniture-3d-system/src/lib/external-freight.ts | 2 +- furniture-3d-system/src/lib/external-sales-export.test.ts | 2 +- furniture-3d-system/src/lib/external-sales-export.ts | 2 +- .../src/lib/supply-chain-management-blank-pages.test.ts | 2 +- .../src/lib/supply-chain-management-blank-pages.ts | 2 +- .../src/lib/supply-chain-permission-targets.ts | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/furniture-3d-system/src/app/api/supply-chain/management/external-sales/export/route.ts b/furniture-3d-system/src/app/api/supply-chain/management/external-sales/export/route.ts index 2e3f0c86..7111bef5 100644 --- a/furniture-3d-system/src/app/api/supply-chain/management/external-sales/export/route.ts +++ b/furniture-3d-system/src/app/api/supply-chain/management/external-sales/export/route.ts @@ -67,7 +67,7 @@ export async function GET(request: NextRequest) { if (!access.download) { return jsonError( ErrorCode.AUTH_PERMISSION_DENIED, - '当�账�没有外销销�导出��', + '当�账�没有外贸销�导出��', 403, ctx.requestId, ) diff --git a/furniture-3d-system/src/app/api/supply-chain/management/external-sales/route.ts b/furniture-3d-system/src/app/api/supply-chain/management/external-sales/route.ts index c2a5fbaa..3c53c7c4 100644 --- a/furniture-3d-system/src/app/api/supply-chain/management/external-sales/route.ts +++ b/furniture-3d-system/src/app/api/supply-chain/management/external-sales/route.ts @@ -32,14 +32,14 @@ export async function GET(request: NextRequest) { if (!access.view) { return jsonError( ErrorCode.AUTH_PERMISSION_DENIED, - '当�账�没有外销销�查看��', + '当�账�没有外贸销�查看��', 403, ctx.requestId, ) } const parsed = querySchema.safeParse(Object.fromEntries(request.nextUrl.searchParams.entries())) if (!parsed.success) { - return jsonError(ErrorCode.VALIDATION_INVALID_FORMAT, '外销销�查询�数�正确', 400, ctx.requestId) + return jsonError(ErrorCode.VALIDATION_INVALID_FORMAT, '外贸销�查询�数�正确', 400, ctx.requestId) } const monthRange = parsed.data.view === 'summary' && parsed.data.month ? externalSalesMonthRange(parsed.data.month) diff --git a/furniture-3d-system/src/app/supply-chain/config/supply-chain-menu.test.ts b/furniture-3d-system/src/app/supply-chain/config/supply-chain-menu.test.ts index 826727ea..b3054bd6 100644 --- a/furniture-3d-system/src/app/supply-chain/config/supply-chain-menu.test.ts +++ b/furniture-3d-system/src/app/supply-chain/config/supply-chain-menu.test.ts @@ -182,7 +182,7 @@ describe('supply chain menu', () => { route: '/supply-chain/management/blank-pages/blank-page-6', }), expect.objectContaining({ - label: '外销销�', + label: '外贸销�', module: '��管�', route: '/supply-chain/management/blank-pages/blank-page-7', }), diff --git a/furniture-3d-system/src/app/supply-chain/management/blank-pages/ExternalSalesView.test.tsx b/furniture-3d-system/src/app/supply-chain/management/blank-pages/ExternalSalesView.test.tsx index 0b70d8f8..a8c75118 100644 --- a/furniture-3d-system/src/app/supply-chain/management/blank-pages/ExternalSalesView.test.tsx +++ b/furniture-3d-system/src/app/supply-chain/management/blank-pages/ExternalSalesView.test.tsx @@ -216,7 +216,7 @@ beforeEach(() => { }) as unknown as typeof fetch }) -describe('外销销�', () => { +describe('外贸销�', () => { it('renders all requested subpages and the summary headers', async () => { render() diff --git a/furniture-3d-system/src/app/supply-chain/management/blank-pages/ExternalSalesView.tsx b/furniture-3d-system/src/app/supply-chain/management/blank-pages/ExternalSalesView.tsx index a8c07ca7..9d92f1c3 100644 --- a/furniture-3d-system/src/app/supply-chain/management/blank-pages/ExternalSalesView.tsx +++ b/furniture-3d-system/src/app/supply-chain/management/blank-pages/ExternalSalesView.tsx @@ -150,7 +150,7 @@ function formatDateTime(value: string) { async function readResponse(response: Response) { const payload = await response.json().catch(() => null) if (!response.ok || !payload?.success) { - throw new Error(payload?.error?.message || '外销销�数�加载失败') + throw new Error(payload?.error?.message || '外贸销�数�加载失败') } return payload.data as ExternalSalesPage } @@ -224,7 +224,7 @@ export function ExternalSalesView({ }) .catch((cause) => { if (cause instanceof DOMException && cause.name === 'AbortError') return - setError(cause instanceof Error ? cause.message : '外销销�数�加载失败') + setError(cause instanceof Error ? cause.message : '外贸销�数�加载失败') }) .finally(() => { if (!controller.signal.aborted) setLoading(false) @@ -339,7 +339,7 @@ export function ExternalSalesView({ const encodedName = disposition.match(/filename\*=UTF-8''([^;]+)/i)?.[1] anchor.download = encodedName ? decodeURIComponent(encodedName) - : `外销销�-${TABS.find((tab) => tab.key === view)?.label ?? ''}.xlsx` + : `外贸销�-${TABS.find((tab) => tab.key === view)?.label ?? ''}.xlsx` anchor.style.display = 'none' document.body.appendChild(anchor) anchor.click() @@ -398,7 +398,7 @@ export function ExternalSalesView({ -
+
{TABS.map((tab) => { const Icon = tab.icon return ( diff --git a/furniture-3d-system/src/lib/external-freight.ts b/furniture-3d-system/src/lib/external-freight.ts index 2119e7bc..fdbf48cd 100644 --- a/furniture-3d-system/src/lib/external-freight.ts +++ b/furniture-3d-system/src/lib/external-freight.ts @@ -175,7 +175,7 @@ export async function parseExternalFreightWorkbook( export async function createExternalFreightTemplate() { const workbook = new ExcelJS.Workbook() - workbook.creator = '供应链中心 · 外销销�' + workbook.creator = '供应链中心 · 外贸销�' workbook.created = new Date() const worksheet = workbook.addWorksheet('货代费', { views: [{ state: 'frozen', ySplit: 1 }], diff --git a/furniture-3d-system/src/lib/external-sales-export.test.ts b/furniture-3d-system/src/lib/external-sales-export.test.ts index 45c9b787..d297dcf2 100644 --- a/furniture-3d-system/src/lib/external-sales-export.test.ts +++ b/furniture-3d-system/src/lib/external-sales-export.test.ts @@ -181,7 +181,7 @@ describe('external sales export', () => { now: new Date('2026-11-16T02:03:04.000Z'), }) - expect(result.fileName).toMatch(/^外销销�-货代费-20261116-/) + expect(result.fileName).toMatch(/^外贸销�-货代费-20261116-/) expect(result.bytes.byteLength).toBeGreaterThan(0) }) }) diff --git a/furniture-3d-system/src/lib/external-sales-export.ts b/furniture-3d-system/src/lib/external-sales-export.ts index 7673e47c..d557bef0 100644 --- a/furniture-3d-system/src/lib/external-sales-export.ts +++ b/furniture-3d-system/src/lib/external-sales-export.ts @@ -218,6 +218,6 @@ export async function createExternalSalesExportWorkbook(input: { const bytes = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' }) as ArrayBuffer return { bytes, - fileName: `外销销�-${VIEW_LABELS[input.view]}-${exportTimestamp(input.now ?? new Date())}.xlsx`, + fileName: `外贸销�-${VIEW_LABELS[input.view]}-${exportTimestamp(input.now ?? new Date())}.xlsx`, } } diff --git a/furniture-3d-system/src/lib/supply-chain-management-blank-pages.test.ts b/furniture-3d-system/src/lib/supply-chain-management-blank-pages.test.ts index 6def090b..739f8ca1 100644 --- a/furniture-3d-system/src/lib/supply-chain-management-blank-pages.test.ts +++ b/furniture-3d-system/src/lib/supply-chain-management-blank-pages.test.ts @@ -10,7 +10,7 @@ describe('��管�空白页注册表', () => { '特殊备货&特殊入库�程监控', '商�SABC打标', '选�明细', - '外销销�', + '外贸销�', '�平�账�', ]) expect(getManagementBlankPage('blank-page-2')?.route) diff --git a/furniture-3d-system/src/lib/supply-chain-management-blank-pages.ts b/furniture-3d-system/src/lib/supply-chain-management-blank-pages.ts index c1fbb394..639ff2fc 100644 --- a/furniture-3d-system/src/lib/supply-chain-management-blank-pages.ts +++ b/furniture-3d-system/src/lib/supply-chain-management-blank-pages.ts @@ -22,7 +22,7 @@ export const MANAGEMENT_BLANK_PAGES: readonly ManagementBlankPageDefinition[] = }, { key: 'blank-page-7', - label: '外销销�', + label: '外贸销�', route: '/supply-chain/management/blank-pages/blank-page-7', }, { diff --git a/furniture-3d-system/src/lib/supply-chain-permission-targets.ts b/furniture-3d-system/src/lib/supply-chain-permission-targets.ts index 3a078f19..8e5a5a0f 100644 --- a/furniture-3d-system/src/lib/supply-chain-permission-targets.ts +++ b/furniture-3d-system/src/lib/supply-chain-permission-targets.ts @@ -268,7 +268,7 @@ export const SUPPLY_CHAIN_PERMISSION_TARGETS: SupplyChainPermissionTarget[] = [ { key: 'orderNotDispatched', label: '应�未�', description: '查看应�未�订��超时原因�处�人与原始订�明细' }, { key: 'managementBlankPage1', label: '空白页 1', description: '��管�空白页 1' }, { key: 'managementBlankPage2', label: '空白页 2', description: '��管�空白页 2' }, - { key: 'managementBlankPage7', label: '外销销�', description: '外销销�查看�下载与维护' }, + { key: 'managementBlankPage7', label: '外贸销�', description: '外贸销�查看�下载与维护' }, { key: 'managementBlankPage8', label: '�平�账�', description: '�平�账���水和��金的查看�导入�导出与�置维护' }, { key: 'finishedProductProgress', label: '��进度明细', description: '��进度查看�导出与维护' }, { key: 'employeeHours', label: '员工工时统计', description: '员工本人�部门或全公�数�范围�独设置' }, From 40ea09f274e85edbbd8b855660f2b78152ce6d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E5=B1=85?= Date: Wed, 18 Nov 2026 09:43:55 +0800 Subject: [PATCH 02/59] =?UTF-8?q?merge(limit-management):=20=E5=90=88?= =?UTF-8?q?=E5=85=A5=E7=A0=B4=E4=BB=B7=E5=AE=A1=E6=A0=B8=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=B8=8E=E7=8A=B6=E6=80=81=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 3e9fdc27c0a547c176fd6b81baa38b4814ee2c56) --- .../breach-orders/[id]/route.ts | 4 +- .../custom-table/BreachOrderTab.test.tsx | 142 +++++++++++++++++- .../custom-table/BreachOrderTab.tsx | 65 ++++---- .../custom-table/CustomTableView.test.tsx | 2 +- .../custom-table/breach-order.module.css | 2 + ...chain-breach-order-monitor.service.test.ts | 37 ++++- .../supply-chain-breach-order.service.ts | 7 +- 7 files changed, 226 insertions(+), 33 deletions(-) diff --git a/furniture-3d-system/src/app/api/supply-chain/limit-management/breach-orders/[id]/route.ts b/furniture-3d-system/src/app/api/supply-chain/limit-management/breach-orders/[id]/route.ts index d3513c40..42919633 100644 --- a/furniture-3d-system/src/app/api/supply-chain/limit-management/breach-orders/[id]/route.ts +++ b/furniture-3d-system/src/app/api/supply-chain/limit-management/breach-orders/[id]/route.ts @@ -19,6 +19,7 @@ const actionSchema = z.discriminatedUnion('action', [ decision: z.enum(['PASS', 'REJECT', 'RETURN', 'LEFT']), reason: z.string().max(60).optional(), note: z.string().max(100).optional(), + scope: z.enum(['ORDER', 'LINK']).default('ORDER'), }), ]) @@ -28,7 +29,7 @@ function friendlyValidationMessage(path: string) { if (path === 'description') return '申诉说明最多 100 字,请精简���交' if (path === 'processNo') return '�程�最多 60 个字符,请核对��试' if (path.startsWith('images')) return '凭�图片过大或超过 3 张,请压缩��试(�张�超过 4MB)' - if (path === 'scope') return '申诉范围��法,请刷新页���试' + if (path === 'scope') return '批��作范围��法,请刷新页���试' if (path === 'note') return '审核��最多 100 字,请精简���交' if (path === 'reason') return '审核原因��法,请�新选择' if (path === 'decision') return '审核�作��法,请刷新页���试' @@ -81,6 +82,7 @@ export async function POST(request: NextRequest, context: { params: Promise<{ id decision: parsed.data.decision, reason: parsed.data.reason, note: parsed.data.note, + scope: parsed.data.scope, }) return jsonSuccess(result, 200, ctx.requestId) } catch (error) { diff --git a/furniture-3d-system/src/app/supply-chain/management/custom-table/BreachOrderTab.test.tsx b/furniture-3d-system/src/app/supply-chain/management/custom-table/BreachOrderTab.test.tsx index f62e4e56..e3f9ed7a 100644 --- a/furniture-3d-system/src/app/supply-chain/management/custom-table/BreachOrderTab.test.tsx +++ b/furniture-3d-system/src/app/supply-chain/management/custom-table/BreachOrderTab.test.tsx @@ -92,17 +92,27 @@ describe('BreachOrderTab field layout', () => { name: new RegExp(`^${header}(?:\\s|$)`), })).toBeInTheDocument() } + expect(screen.queryByRole('columnheader', { + name: /^上架时间(?:\s|$)/, + })).not.toBeInTheDocument() for (const value of ['京东', '店铺甲', 'BARCODE-1', '��负责人甲', '部门负责人丙', '利润中心�']) { expect(screen.getByText(value)).toBeInTheDocument() } + expect(screen.getByRole('button', { name: /全部\s*1/ })).toBeInTheDocument() + expect(screen.getByRole('button', { name: /待申诉\s*1/ })).toBeInTheDocument() + expect(screen.getByRole('button', { name: /待审核\s*0/ })).toBeInTheDocument() expect(screen.queryByText(/本月��/)).not.toBeInTheDocument() expect(screen.queryByRole('button', { name: '导出��明细' })).not.toBeInTheDocument() }) it('exports every filtered page instead of only the first 200 rows', async () => { + let exportedBlob: Blob | null = null Object.defineProperty(URL, 'createObjectURL', { configurable: true, - value: jest.fn(() => 'blob:breach-export'), + value: jest.fn((blob: Blob) => { + exportedBlob = blob + return 'blob:breach-export' + }), }) Object.defineProperty(URL, 'revokeObjectURL', { configurable: true, @@ -120,6 +130,136 @@ describe('BreachOrderTab field layout', () => { expect(urls.some((url) => url.includes('page=2&pageSize=5000') && url.includes('includeStats=0'))).toBe(true) }) expect(anchorClick).toHaveBeenCalled() + expect(exportedBlob).not.toBeNull() + const csv = await new Promise((resolve, reject) => { + const reader = new FileReader() + reader.onload = () => resolve(String(reader.result ?? '')) + reader.onerror = () => reject(reader.error) + reader.readAsText(exportedBlob as unknown as Blob) + }) + expect(csv).not.toContain('上架时间') + expect(csv).not.toContain('2026-09-01') + }) + + it('does not show listing time in the order detail', async () => { + ;(global.fetch as jest.Mock).mockImplementation((input) => { + const url = new URL(String(input), 'http://localhost') + if (url.pathname.endsWith('/breach-orders/breach-1')) { + return Promise.resolve({ + ok: true, + json: async () => ({ + success: true, + data: { + order: baseRow, + linkOrders: [], + canAppeal: false, + canReview: true, + }, + }), + } as Response) + } + return response([baseRow], { page: 1, total: 1, totalPages: 1 }) + }) + render() + + fireEvent.click(await screen.findByText('SO-1')) + + expect(await screen.findByText('�价�程结�日期')).toBeInTheDocument() + expect(screen.queryByText('上架时间')).not.toBeInTheDocument() + expect(screen.queryByText('2026-09-01')).not.toBeInTheDocument() + }) + + it('shows the checked link batch option when submitting an appeal', async () => { + ;(global.fetch as jest.Mock).mockImplementation((input) => { + const url = new URL(String(input), 'http://localhost') + if (url.pathname.endsWith('/breach-orders/breach-1')) { + return Promise.resolve({ + ok: true, + json: async () => ({ + success: true, + data: { + order: baseRow, + linkOrders: [ + { id: 'breach-1', oId: 'O-1', soId: 'SO-1', status: 'PENDING_APPEAL', payDate: baseRow.payDate, buyerPaidAmount: 80, appliedFromLink: false }, + { id: 'breach-2', oId: 'O-2', soId: 'SO-2', status: 'PENDING_APPEAL', payDate: baseRow.payDate, buyerPaidAmount: 80, appliedFromLink: false }, + ], + canAppeal: true, + canReview: false, + }, + }), + } as Response) + } + return response([baseRow], { page: 1, total: 1, totalPages: 1 }) + }) + render() + + fireEvent.click(await screen.findByText('SO-1')) + + const batchAppeal = await screen.findByRole('checkbox', { name: /按链接批�申诉/ }) + expect(batchAppeal).toBeChecked() + expect(screen.getByText(/当�链接�有 1 个待申诉订�/)).toBeInTheDocument() + }) + + it('shows the checked link batch option when reviewing and sends LINK scope', async () => { + const reviewRow = { ...baseRow, status: 'PENDING_REVIEW', statusLabel: '待审核' } + ;(global.fetch as jest.Mock).mockImplementation((input, init) => { + const url = new URL(String(input), 'http://localhost') + if (url.pathname.endsWith('/breach-orders/breach-1') && init?.method === 'POST') { + return Promise.resolve({ + ok: true, + json: async () => ({ success: true, data: { covered: 2, status: 'APPROVED' } }), + } as Response) + } + if (url.pathname.endsWith('/breach-orders/breach-1')) { + return Promise.resolve({ + ok: true, + json: async () => ({ + success: true, + data: { + order: reviewRow, + linkOrders: [ + { id: 'breach-1', oId: 'O-1', soId: 'SO-1', status: 'PENDING_REVIEW', payDate: baseRow.payDate, buyerPaidAmount: 80, appliedFromLink: false }, + { id: 'breach-2', oId: 'O-2', soId: 'SO-2', status: 'PENDING_REVIEW', payDate: baseRow.payDate, buyerPaidAmount: 80, appliedFromLink: false }, + ], + canAppeal: false, + canReview: true, + }, + }), + } as Response) + } + return Promise.resolve({ + ok: true, + json: async () => ({ + success: true, + data: { + rows: [reviewRow], + pageInfo: { page: 1, total: 1, totalPages: 1 }, + stats: { total: 1, byStatus: { PENDING_REVIEW: 1 }, canAppeal: false, canReview: true }, + canAppeal: false, + canReview: true, + }, + }), + } as Response) + }) + render() + + fireEvent.click(await screen.findByText('SO-1')) + + const batchReview = await screen.findByRole('checkbox', { name: /按链接批�审核/ }) + expect(batchReview).toBeChecked() + expect(screen.getByText(/当�链接�有 1 个待审核订�/)).toBeInTheDocument() + fireEvent.click(screen.getByRole('button', { name: '通过' })) + + await waitFor(() => { + const reviewCall = (global.fetch as jest.Mock).mock.calls.find(([input, init]) => ( + String(input).endsWith('/breach-orders/breach-1') && init?.method === 'POST' + )) + expect(JSON.parse(String(reviewCall?.[1]?.body))).toMatchObject({ + action: 'review', + decision: 'PASS', + scope: 'LINK', + }) + }) }) it('选择��负责人�查询会把 ownerKeyword ��到�务端', async () => { diff --git a/furniture-3d-system/src/app/supply-chain/management/custom-table/BreachOrderTab.tsx b/furniture-3d-system/src/app/supply-chain/management/custom-table/BreachOrderTab.tsx index 5c718be4..994d07e2 100644 --- a/furniture-3d-system/src/app/supply-chain/management/custom-table/BreachOrderTab.tsx +++ b/furniture-3d-system/src/app/supply-chain/management/custom-table/BreachOrderTab.tsx @@ -52,7 +52,6 @@ type BreachOrder = { reviewReason: string reviewNote: string fineAmount: number | null - listedAt: string | null flowEndDate: string | null } @@ -123,7 +122,6 @@ const TABLE_COLUMNS: readonly BreachTableColumn[] = [ { field: 'profitCenter', label: '利润中心', width: 120 }, { field: 'orderStatus', label: '订�状�', width: 104 }, { field: 'refundStatus', label: '退款状�', width: 104 }, - { field: 'listedAt', label: '上架时间', width: 104 }, { field: 'flowEndDate', label: '�程结�日期', width: 116 }, { field: 'status', label: '审核状�', width: 96, filterKey: 'status' }, ] @@ -229,6 +227,7 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { const [previewImage, setPreviewImage] = useState(null) const [reviewReason, setReviewReason] = useState(BREACH_REJECT_REASONS[0]) const [reviewNote, setReviewNote] = useState('') + const [reviewScope, setReviewScope] = useState<'ORDER' | 'LINK'>('LINK') const [busy, setBusy] = useState(false) const [message, setMessage] = useState('') const [dateFrom, setDateFrom] = useState(DEFAULT_MONTH_BOUNDS.startDate) @@ -333,6 +332,7 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { setProcessNo(data.order.processNo || '') // 链接级申诉默认勾选(按业务�求,无需��手动勾选) setAppealScope('LINK') + setReviewScope('LINK') setAppealImages(Array.isArray(data.order.appealImages) ? data.order.appealImages : []) setReviewReason(data.order.reviewReason || BREACH_REJECT_REASONS[0]) setReviewNote(data.order.reviewNote || '') @@ -357,9 +357,18 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { ? order.status === 'PENDING_APPEAL' || order.status === 'RETURNED' || secondAppealAllowed : false const canAppeal = hasAppealPermission && appealStatusEligible - const linkCount = useMemo( - () => detail?.linkOrders.filter((item) => item.status === 'PENDING_APPEAL' || item.status === 'RETURNED').length ?? 0, - [detail], + const appealLinkCount = useMemo( + () => detail?.linkOrders.filter((item) => ( + item.id !== order?.id + && (item.status === 'PENDING_APPEAL' || item.status === 'RETURNED') + )).length ?? 0, + [detail, order?.id], + ) + const reviewLinkCount = useMemo( + () => detail?.linkOrders.filter((item) => ( + item.id !== order?.id && item.status === 'PENDING_REVIEW' + )).length ?? 0, + [detail, order?.id], ) const requirement = breachAppealRequirement(appealType) const hasActiveFilters = Boolean( @@ -487,8 +496,6 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { /> ) - const linkScopeAvailable = linkCount > 1 - /** 申诉凭�缩略图(点击查看大图)。 */ const evidenceThumbs = (images: string[] | null | undefined, label: string) => { const list = Array.isArray(images) ? images.filter((url) => typeof url === 'string' && Boolean(url)) : [] @@ -547,7 +554,7 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { const header = kind === 'fine' ? ['线上订��', '内部订��', '平�', '店铺', '商�编�', '��负责人', '部门负责人', '利润中心', '商家实收', '�价', '价差', '驳回原因', '审核人', '��金�'] - : ['付款日期', '平�', '店铺', '线上订��', '内部订��', '商�编�', '店铺款�编�', '店铺商�编�', '数�', '买家实付', '平�承担', '商家实收', '�价�价', '�价×数�', '价差', '��负责人', '部门负责人', '利润中心', '订�状�', '退款状�', '上架时间', '�程结�日期', '审核状�', '申诉类型', '�程�'] + : ['付款日期', '平�', '店铺', '线上订��', '内部订��', '商�编�', '店铺款�编�', '店铺商�编�', '数�', '买家实付', '平�承担', '商家实收', '�价�价', '�价×数�', '价差', '��负责人', '部门负责人', '利润中心', '订�状�', '退款状�', '�程结�日期', '审核状�', '申诉类型', '�程�'] const lines = [header.join(',')] const seenFineOrders = new Set() for (const row of rows) { @@ -559,7 +566,7 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { if (assessedFine > 0) seenFineOrders.add(fineOrderKey) const cells = kind === 'fine' ? [row.soId, row.oId, row.platform, row.shopName, row.itemCode, row.ownerName, row.deptOwner, row.profitCenter, row.sellerIncomeAmount, row.limitTotal, row.gapAmount, row.reviewReason, row.reviewedBy, assessedFine] - : [day(row.payDate), row.platform, row.shopName, row.soId, row.oId, row.itemCode, row.shopStyleCode, row.shopItemCode, row.qty, row.buyerPaidAmount, row.platformBearAmount, row.sellerIncomeAmount, row.limitUnitPrice, row.limitTotal, row.gapAmount, row.ownerName, row.deptOwner, row.profitCenter, row.orderStatus, row.refundStatus, day(row.listedAt), day(row.flowEndDate), row.statusLabel, row.appealType, row.processNo] + : [day(row.payDate), row.platform, row.shopName, row.soId, row.oId, row.itemCode, row.shopStyleCode, row.shopItemCode, row.qty, row.buyerPaidAmount, row.platformBearAmount, row.sellerIncomeAmount, row.limitUnitPrice, row.limitTotal, row.gapAmount, row.ownerName, row.deptOwner, row.profitCenter, row.orderStatus, row.refundStatus, day(row.flowEndDate), row.statusLabel, row.appealType, row.processNo] lines.push(cells.map((value) => `"${String(value ?? '').replaceAll('"', '""')}"`).join(',')) } const blob = new Blob(['\ufeff' + lines.join('\n')], { type: 'text/csv;charset=utf-8' }) @@ -649,7 +656,7 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { const response = await fetch(`/api/supply-chain/limit-management/breach-orders/${order.id}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ action: 'review', decision, reason: reviewReason, note: reviewNote }), + body: JSON.stringify({ action: 'review', decision, reason: reviewReason, note: reviewNote, scope: reviewScope }), }) const body = await response.json() if (!response.ok || !body?.success) throw new Error(body?.error?.message || '审核失败') @@ -677,6 +684,9 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { {STATUS_TABS.map((tab) => ( ))}
@@ -767,7 +777,6 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { {text(row.profitCenter)} {text(row.orderStatus)} {text(row.refundStatus)} - {day(row.listedAt)} {day(row.flowEndDate)} {row.statusLabel} @@ -822,7 +831,6 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) {
利润中心{text(order.profitCenter)}
订�状�{text(order.orderStatus)}
退款状�{text(order.refundStatus)}
-
上架时间{day(order.listedAt)}
�价�程结�日期{day(order.flowEndDate)}
@@ -849,21 +857,15 @@ export function BreachOrderTab({ canExport = false }: { canExport?: boolean }) { ))} - {linkScopeAvailable ? ( -