OAFRONT4 清理PC付款和工作台文案
这个提交包含在:
@@ -28,6 +28,7 @@ import { Input } from "../components/ui/input";
|
||||
import { Label } from "../components/ui/label";
|
||||
import { Textarea } from "../components/ui/textarea";
|
||||
import { downloadBlob } from "../lib/download";
|
||||
import { formatDisplayDate } from "../lib/displayFormat";
|
||||
import { toast } from "sonner";
|
||||
|
||||
const CONFIDENTIALITY_OPTIONS: ConfidentialityLevel[] = ["public", "internal", "confidential", "restricted"];
|
||||
@@ -39,9 +40,9 @@ const FILTER_STATUS_OPTIONS: Array<{ value: ContractRegistryStatus; label: strin
|
||||
{ value: "archived", label: "已归档" },
|
||||
];
|
||||
const EDITOR_STATUS_OPTIONS: Array<{ value: ContractRegistryPersistedStatus; label: string }> = [
|
||||
{ value: "active", label: "active" },
|
||||
{ value: "draft", label: "draft" },
|
||||
{ value: "archived", label: "archived" },
|
||||
{ value: "active", label: "生效中" },
|
||||
{ value: "draft", label: "草稿" },
|
||||
{ value: "archived", label: "已归档" },
|
||||
];
|
||||
const AMOUNT_PATTERN = /^\d{1,12}(\.\d{1,2})?$/;
|
||||
const EXPIRING_DAYS = 30;
|
||||
@@ -95,6 +96,14 @@ function contractTypeLabel(value: ContractRegistryType) {
|
||||
return "其他";
|
||||
}
|
||||
|
||||
function contractStatusLabel(value: ContractRegistryStatus | ContractRegistryPersistedStatus) {
|
||||
if (value === "active") return "生效中";
|
||||
if (value === "expired") return "已过期";
|
||||
if (value === "draft") return "草稿";
|
||||
if (value === "archived") return "已归档";
|
||||
return value || "-";
|
||||
}
|
||||
|
||||
function buildEmptyEditor(projectId = ""): EditorState {
|
||||
return {
|
||||
contractNo: "",
|
||||
@@ -346,7 +355,7 @@ export function ContractsRegistryPage() {
|
||||
{item.contractNo} · {item.counterpartyName}
|
||||
</div>
|
||||
<div className="mt-1 text-sm text-zinc-600">
|
||||
{contractTypeLabel(item.contractType)} · 到期日 {item.expiryDate ?? "-"} · 责任人 {item.owner?.name ?? "-"}
|
||||
{contractTypeLabel(item.contractType)} · 到期日 {formatDisplayDate(item.expiryDate)} · 责任人 {item.owner?.name ?? "-"}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
@@ -389,7 +398,7 @@ export function ContractsRegistryPage() {
|
||||
|
||||
{editingItem?.status === "expired" ? (
|
||||
<div className="rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900">
|
||||
当前合同因到期日已过,列表状态显示为“已过期”;保存时仍以数据库状态 {editingItem.persistedStatus} 持久化。
|
||||
当前合同因到期日已过,列表状态显示为“已过期”;保存时仍按“{contractStatusLabel(editingItem.persistedStatus)}”留存。
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -705,7 +714,7 @@ export function ContractsRegistryPage() {
|
||||
<div className="space-y-2">
|
||||
<div className="flex flex-wrap items-center gap-3">
|
||||
<div className="font-semibold text-zinc-900">{item.contractNo}</div>
|
||||
<StatusBadge status={item.status} />
|
||||
<StatusBadge status={item.status} label={contractStatusLabel(item.status)} />
|
||||
<span className="rounded-full bg-zinc-100 px-2 py-1 text-xs text-zinc-600">
|
||||
{confidentialityLabel(item.confidentialityLevel)}
|
||||
</span>
|
||||
@@ -715,14 +724,14 @@ export function ContractsRegistryPage() {
|
||||
<div className="text-xs text-zinc-500">
|
||||
{contractTypeLabel(item.contractType)}
|
||||
{item.amount ? ` · ${item.amount} ${item.currency}` : " · 金额未录入"}
|
||||
{item.expiryDate ? ` · 到期日 ${item.expiryDate}` : " · 未设置到期日"}
|
||||
{item.expiryDate ? ` · 到期日 ${formatDisplayDate(item.expiryDate)}` : " · 未设置到期日"}
|
||||
</div>
|
||||
<div className="text-xs text-zinc-500">
|
||||
项目:{item.project ? `${item.project.projectNo} · ${item.project.name}` : "未关联"} · 责任人:
|
||||
{item.owner?.name ?? "-"}
|
||||
</div>
|
||||
<div className="text-xs text-zinc-500">
|
||||
签署:{item.signedDate ?? "-"} · 生效:{item.effectiveDate ?? "-"} · 归档:{item.archiveLocation}
|
||||
签署:{formatDisplayDate(item.signedDate)} · 生效:{formatDisplayDate(item.effectiveDate)} · 归档:{item.archiveLocation}
|
||||
{item.offlineArchiveNo ? ` · 离线档案号 ${item.offlineArchiveNo}` : ""}
|
||||
</div>
|
||||
</div>
|
||||
@@ -760,7 +769,7 @@ export function ContractsRegistryPage() {
|
||||
disabled={toggleStatusMutation.isPending}
|
||||
onClick={() => toggleStatusMutation.mutate(item)}
|
||||
>
|
||||
{item.persistedStatus === "archived" ? "恢复为 active" : "归档"}
|
||||
{item.persistedStatus === "archived" ? "恢复生效" : "归档"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
在新工单中引用
屏蔽一个用户