MIF7 移动信息架构整改收口
这个提交包含在:
@@ -1,10 +1,9 @@
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { fetchPurchaseRequestDetail } from "../api/purchaseRequests";
|
||||
import { PageHeader } from "../components/common/PageHeader";
|
||||
import { MobileDetailHeader } from "../components/mobile/MobileDetailHeader";
|
||||
import { StatusBadge } from "../components/common/StatusBadge";
|
||||
import { PageScaffold } from "../components/patterns/PageScaffold";
|
||||
import { Button } from "../components/ui/button";
|
||||
import {
|
||||
formatApprovalHistoryTime,
|
||||
resolvePurchaseDisplayCode,
|
||||
@@ -36,6 +35,13 @@ function formatBytes(value: number) {
|
||||
return `${(value / 1024 / 1024).toFixed(1)} MB`;
|
||||
}
|
||||
|
||||
function purchaseProgressFallback(status: string | undefined) {
|
||||
if (status === "draft") return "/mobile/approvals?progress=draft";
|
||||
if (status === "approved") return "/mobile/approvals?progress=approved";
|
||||
if (status === "rejected" || status === "cancelled") return "/mobile/approvals?progress=returned";
|
||||
return "/mobile/approvals?progress=reviewing";
|
||||
}
|
||||
|
||||
export function MobilePurchaseRequestDetailPage() {
|
||||
const { purchaseRequestId = "" } = useParams();
|
||||
|
||||
@@ -50,14 +56,12 @@ export function MobilePurchaseRequestDetailPage() {
|
||||
|
||||
return (
|
||||
<PageScaffold className="space-y-3 pb-4">
|
||||
<PageHeader
|
||||
title="采购详情"
|
||||
meta={detail ? <StatusBadge status={detail.status} /> : null}
|
||||
actions={
|
||||
<Button asChild size="sm" type="button" variant="secondary">
|
||||
<Link to="/mobile/approvals">返回</Link>
|
||||
</Button>
|
||||
}
|
||||
<MobileDetailHeader
|
||||
title={displayCode}
|
||||
subtitle="采购详情"
|
||||
status={detail ? <StatusBadge status={detail.status} /> : null}
|
||||
fallbackTo={purchaseProgressFallback(detail?.status)}
|
||||
testId="mobile-purchase-detail-header"
|
||||
/>
|
||||
|
||||
{!purchaseRequestId ? (
|
||||
|
||||
在新工单中引用
屏蔽一个用户