diff --git a/app/api/cross-checking/cross-files-upload.ts b/app/api/cross-checking/cross-files-upload.ts index d2b674a..1ef7341 100644 --- a/app/api/cross-checking/cross-files-upload.ts +++ b/app/api/cross-checking/cross-files-upload.ts @@ -1,5 +1,6 @@ import { UPLOAD_URL, API_BASE_URL } from '../../config/api-config'; import axios from 'axios'; +import { CONTRACT_TYPES, DEFAULT_CONTRACT_TYPE } from '~/constants/contractTypes'; /** * 从不同格式的 API 响应中提取数据 @@ -224,7 +225,8 @@ export async function batchUploadAndAssignCrossCheckingFiles( docType: string, taskType: string = '市局间交叉评查', token: string | null = null, - principalUserIds: number[] = [] + principalUserIds: number[] = [], + attributeType?: string ): Promise<{ successes: Array<{file: CrossCheckingUploadedFile; result: Record}>; failures: Array<{file: CrossCheckingUploadedFile; error: string}>; @@ -249,7 +251,8 @@ export async function batchUploadAndAssignCrossCheckingFiles( is_test_document: isTestDocument, task_name: taskName, doc_type: typeof docType === 'string' ? docType.toUpperCase() : docType, - task_type: taskType + task_type: taskType, + attribute_type: attributeType || null }; // console.log('fileInfo', fileInfo) diff --git a/app/routes/cross-checking.upload.tsx b/app/routes/cross-checking.upload.tsx index 3fea53f..212d297 100644 --- a/app/routes/cross-checking.upload.tsx +++ b/app/routes/cross-checking.upload.tsx @@ -32,6 +32,7 @@ import { type UserInfo } from "~/api/user/user-management"; import { API_BASE_URL } from '~/config/api-config'; +import { CONTRACT_TYPES, DEFAULT_CONTRACT_TYPE } from '~/constants/contractTypes'; export const meta: MetaFunction = () => { return [ @@ -173,6 +174,7 @@ export default function CrossCheckingUpload() { const [documentNumber] = useState(""); const [remark] = useState(""); const [isTestDocument] = useState(false); + const [attributeType, setAttributeType] = useState(DEFAULT_CONTRACT_TYPE); // 文件管理状态 - 简化为单文件上传 const [uploadedFile, setUploadedFile] = useState(null); @@ -358,7 +360,8 @@ export default function CrossCheckingUpload() { selectedDocType.code, // 使用文档类型code taskInfo.type, // 使用任务类型(市局间交叉评查 或 区局间交叉评查) frontendJWT, - principalUserIds // 负责人ID数组 + principalUserIds, // 负责人ID数组 + attributeType // 合同类型 ); @@ -987,6 +990,32 @@ export default function CrossCheckingUpload() { + {/* 合同类型选择器 - 仅在选择合同类型文档时显示 */} + {selectedDocTypeId === 1 && ( +
+
+
选择合同类型(可选)
+
+ {CONTRACT_TYPES.map((type) => ( + + ))} +
+
+
+ )} + {/* 文件上传区域 - 左右布局 */}