R19/R20: 项目主域进 OA 并打通报销差旅周报待办

这个提交包含在:
2026-03-22 08:34:18 +08:00
父节点 0235ccb968
当前提交 3f9738ac9c
共修改 28 个文件,包含 3236 行新增和 21 行删除
+61
查看文件
@@ -0,0 +1,61 @@
import { apiRequestData } from "./http";
import type { ConfidentialityLevel, EmployeeBasic } from "./projects";
export type ContractRegistryItem = {
id: string;
contractNo: string;
projectId: string | null;
counterpartyName: string;
summary: string;
confidentialityLevel: ConfidentialityLevel;
archiveLocation: string;
offlineArchiveNo: string | null;
ownerEmployeeId: string;
status: string;
createdAt: string | null;
updatedAt: string | null;
owner: EmployeeBasic | null;
project: { id: string; projectNo: string; name: string } | null;
};
export async function fetchContractsRegistry(projectId?: string) {
const suffix = projectId ? `?projectId=${encodeURIComponent(projectId)}` : "";
return apiRequestData<{ items: ContractRegistryItem[] }>(`/api/contracts-registry${suffix}`);
}
export async function createContractRegistry(payload: {
contractNo: string;
projectId?: string | null;
counterpartyName: string;
summary: string;
confidentialityLevel?: ConfidentialityLevel;
archiveLocation: string;
offlineArchiveNo?: string | null;
ownerEmployeeId?: string;
status?: string;
}) {
return apiRequestData<{ item: ContractRegistryItem }>("/api/contracts-registry", {
method: "POST",
body: JSON.stringify(payload),
});
}
export async function patchContractRegistry(
id: string,
payload: Partial<{
contractNo: string;
projectId: string | null;
counterpartyName: string;
summary: string;
confidentialityLevel: ConfidentialityLevel;
archiveLocation: string;
offlineArchiveNo: string | null;
ownerEmployeeId: string;
status: string;
}>,
) {
return apiRequestData<{ item: ContractRegistryItem }>(`/api/contracts-registry/${id}`, {
method: "PATCH",
body: JSON.stringify(payload),
});
}