OAFRONT6 补齐次级长编号压缩
这个提交包含在:
@@ -58,7 +58,8 @@ export function formatTextWithCompactLongNumbers(value: string | number | null |
|
||||
const text = String(value ?? "").trim();
|
||||
if (!text) return "-";
|
||||
|
||||
return text.replace(/\b20[0-9]{12,}\b/g, (match) =>
|
||||
formatCompactIdentifier(match, { head: 10, tail: 4, minLength: 14 }),
|
||||
);
|
||||
return text.replace(/\b20[0-9]{12,}\b/g, (match) => {
|
||||
if (match.length <= 12) return match;
|
||||
return `${match.slice(0, 8)}…${match.slice(-4)}`;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -955,7 +955,7 @@ export function AssetRegistryPage() {
|
||||
<option value="">全部法体</option>
|
||||
{(legalEntitiesQuery.data?.items ?? []).map((item) => (
|
||||
<option key={item.id} value={item.id}>
|
||||
{item.name}
|
||||
{formatTextWithCompactLongNumbers(item.name)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
@@ -1173,7 +1173,7 @@ export function AssetRegistryPage() {
|
||||
<option value="">请选择资产分类</option>
|
||||
{(categoriesQuery.data?.items ?? []).filter((item) => item.enabled).map((item) => (
|
||||
<option key={item.id} value={item.id}>
|
||||
{item.name}
|
||||
{formatTextWithCompactLongNumbers(item.name)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
@@ -1215,7 +1215,7 @@ export function AssetRegistryPage() {
|
||||
<option value="">无采购来源</option>
|
||||
{purchaseOptions.map((item) => (
|
||||
<option key={item.id} value={item.id}>
|
||||
{(item.requestNo ?? item.id)} · {item.title}
|
||||
{formatTextWithCompactLongNumbers(item.requestNo ?? item.id)} · {formatTextWithCompactLongNumbers(item.title)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
@@ -1490,7 +1490,9 @@ export function AssetRegistryPage() {
|
||||
</Button>
|
||||
) : null}
|
||||
{currentAsset?.purchaseRequest ? (
|
||||
<span className="text-sm text-zinc-500">采购来源:{currentAsset.purchaseRequest.requestNo ?? currentAsset.purchaseRequest.id}</span>
|
||||
<span className="text-sm text-zinc-500">
|
||||
采购来源:{formatTextWithCompactLongNumbers(currentAsset.purchaseRequest.requestNo ?? currentAsset.purchaseRequest.id)}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -7,7 +7,13 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, D
|
||||
import { Input } from "../../components/ui/input";
|
||||
import { Textarea } from "../../components/ui/textarea";
|
||||
import { DateTextInput } from "../../components/common/DateTextInput";
|
||||
import { formatCompactIdentifier, formatDisplayDate, formatDisplayDateTime, isCompactedIdentifier } from "../../lib/displayFormat";
|
||||
import {
|
||||
formatCompactIdentifier,
|
||||
formatDisplayDate,
|
||||
formatDisplayDateTime,
|
||||
formatTextWithCompactLongNumbers,
|
||||
isCompactedIdentifier,
|
||||
} from "../../lib/displayFormat";
|
||||
import { formatInvoiceOcrErrorMessage } from "../../lib/invoiceOcr";
|
||||
import { toast } from "sonner";
|
||||
|
||||
@@ -210,7 +216,10 @@ export function InvoiceDetailPanel({
|
||||
{detail.totalAmount ? new Intl.NumberFormat("zh-CN", { style: "currency", currency: "CNY" }).format(Number(detail.totalAmount)) : "-"}
|
||||
</div>
|
||||
<div><span className="text-zinc-500">开票日期:</span>{formatDisplayDate(detail.invoiceDate)}</div>
|
||||
<div><span className="text-zinc-500">文件名:</span>{detail.originalName || "-"}</div>
|
||||
<div>
|
||||
<span className="text-zinc-500">文件名:</span>
|
||||
<span title={detail.originalName || undefined}>{formatTextWithCompactLongNumbers(detail.originalName || "-")}</span>
|
||||
</div>
|
||||
<div className="col-span-2 flex flex-col gap-1">
|
||||
<div>
|
||||
<span className="text-zinc-500">财务核验:</span>
|
||||
|
||||
@@ -5,7 +5,12 @@ import { TableSkeleton } from "../../components/common/TableSkeleton";
|
||||
import { Pagination } from "../../components/common/Pagination";
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../components/ui/dropdown-menu";
|
||||
import { Button } from "../../components/ui/button";
|
||||
import { formatCompactIdentifier, formatDisplayDate, isCompactedIdentifier } from "../../lib/displayFormat";
|
||||
import {
|
||||
formatCompactIdentifier,
|
||||
formatDisplayDate,
|
||||
formatTextWithCompactLongNumbers,
|
||||
isCompactedIdentifier,
|
||||
} from "../../lib/displayFormat";
|
||||
import { formatInvoiceOcrErrorMessage } from "../../lib/invoiceOcr";
|
||||
import { toast } from "sonner";
|
||||
|
||||
@@ -29,6 +34,10 @@ function invoiceDisplayName(item: InvoicePoolListResponse["items"][number]) {
|
||||
return "待识别票据";
|
||||
}
|
||||
|
||||
function compactInvoiceDisplayName(item: InvoicePoolListResponse["items"][number]) {
|
||||
return formatTextWithCompactLongNumbers(invoiceDisplayName(item));
|
||||
}
|
||||
|
||||
function invoiceNumberDisplay(item: InvoicePoolListResponse["items"][number]) {
|
||||
return [item.invoiceCode, item.invoiceNumber].filter(Boolean).join("-") || "-";
|
||||
}
|
||||
@@ -126,7 +135,9 @@ export function InvoiceListCard({
|
||||
<article className="rounded-xl border border-zinc-200 bg-white p-4 shadow-sm" data-testid="invoice-mobile-row" key={item.id}>
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div className="min-w-0">
|
||||
<div className="truncate text-sm font-semibold text-zinc-900">{invoiceDisplayName(item)}</div>
|
||||
<div className="truncate text-sm font-semibold text-zinc-900" title={invoiceDisplayName(item)}>
|
||||
{compactInvoiceDisplayName(item)}
|
||||
</div>
|
||||
<div className="mt-1 text-xs text-zinc-500">{item.invoiceDate ? formatDisplayDate(item.invoiceDate) : "待识别"}</div>
|
||||
</div>
|
||||
<StatusBadge className="shrink-0" status={item.status} />
|
||||
@@ -200,7 +211,9 @@ export function InvoiceListCard({
|
||||
listQuery.data?.items.map((item) => (
|
||||
<tr className="table-row" data-testid="invoice-row" key={item.id}>
|
||||
<td className="table-td">
|
||||
<div className="max-w-[260px] truncate font-medium text-zinc-900">{invoiceDisplayName(item)}</div>
|
||||
<div className="max-w-[260px] truncate font-medium text-zinc-900" title={invoiceDisplayName(item)}>
|
||||
{compactInvoiceDisplayName(item)}
|
||||
</div>
|
||||
<div className="mt-1 text-xs text-zinc-500">{item.invoiceDate ? formatDisplayDate(item.invoiceDate) : "待识别"}</div>
|
||||
</td>
|
||||
<td className="table-td"><StatusBadge status={item.status} /></td>
|
||||
|
||||
在新工单中引用
屏蔽一个用户