feat(upload): 添加合同类型选择器,用户必须手动选择
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
|||||||
import { updateDocumentAuditStatus } from "~/api/evaluation_points/rules-files";
|
import { updateDocumentAuditStatus } from "~/api/evaluation_points/rules-files";
|
||||||
import { links as fileTypeTagLinks } from "~/components/ui/FileTypeTag";
|
import { links as fileTypeTagLinks } from "~/components/ui/FileTypeTag";
|
||||||
import { getQueueStatus, type QueueStatus } from "~/api/queue";
|
import { getQueueStatus, type QueueStatus } from "~/api/queue";
|
||||||
|
import { CONTRACT_TYPES, DEFAULT_CONTRACT_TYPE } from "~/constants/contractTypes";
|
||||||
|
|
||||||
export function links() {
|
export function links() {
|
||||||
return [
|
return [
|
||||||
@@ -131,7 +132,8 @@ async function handleFileUpload(
|
|||||||
documentId?: number | null,
|
documentId?: number | null,
|
||||||
isReupload: boolean = false,
|
isReupload: boolean = false,
|
||||||
jwtToken?: string,
|
jwtToken?: string,
|
||||||
attachments?: File[]
|
attachments?: File[],
|
||||||
|
attributeType?: string
|
||||||
): Promise<FileUploadResponse> {
|
): Promise<FileUploadResponse> {
|
||||||
// console.log('【handleFileUpload】开始上传:', {
|
// console.log('【handleFileUpload】开始上传:', {
|
||||||
// fileName,
|
// fileName,
|
||||||
@@ -349,6 +351,7 @@ export default function FilesUpload() {
|
|||||||
const [documentNumber, setDocumentNumber] = useState<string>("");
|
const [documentNumber, setDocumentNumber] = useState<string>("");
|
||||||
const [remark, setRemark] = useState<string>("");
|
const [remark, setRemark] = useState<string>("");
|
||||||
const [currentFiles, setCurrentFiles] = useState<File[]>([]);
|
const [currentFiles, setCurrentFiles] = useState<File[]>([]);
|
||||||
|
const [attributeType, setAttributeType] = useState<string>(DEFAULT_CONTRACT_TYPE);
|
||||||
|
|
||||||
// 合同文件上传状态
|
// 合同文件上传状态
|
||||||
// 这些变量暂时未使用,但保留以备将来扩展
|
// 这些变量暂时未使用,但保留以备将来扩展
|
||||||
@@ -1193,7 +1196,8 @@ export default function FilesUpload() {
|
|||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
loaderData.frontendJWT || undefined,
|
loaderData.frontendJWT || undefined,
|
||||||
attachmentFiles
|
attachmentFiles,
|
||||||
|
attributeType
|
||||||
);
|
);
|
||||||
|
|
||||||
// console.log('【合同上传】服务器响应数据:', uploadResp);
|
// console.log('【合同上传】服务器响应数据:', uploadResp);
|
||||||
@@ -1550,7 +1554,9 @@ export default function FilesUpload() {
|
|||||||
isTestDocument,
|
isTestDocument,
|
||||||
temp_n > 1 ? firstFileDocumentId : null, // 第二个文件及以后使用第一个文件的document_id
|
temp_n > 1 ? firstFileDocumentId : null, // 第二个文件及以后使用第一个文件的document_id
|
||||||
false,
|
false,
|
||||||
loaderData.frontendJWT || undefined
|
loaderData.frontendJWT || undefined,
|
||||||
|
undefined,
|
||||||
|
attributeType
|
||||||
);
|
);
|
||||||
|
|
||||||
const timeoutPromise = new Promise<FileUploadResponse>((_, reject) => {
|
const timeoutPromise = new Promise<FileUploadResponse>((_, reject) => {
|
||||||
@@ -2326,6 +2332,30 @@ export default function FilesUpload() {
|
|||||||
</select>
|
</select>
|
||||||
<div className="form-tip">优先级影响文档在队列中的处理顺序</div>
|
<div className="form-tip">优先级影响文档在队列中的处理顺序</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* 只有选择合同类型时才显示合同子类型选择器 */}
|
||||||
|
{isContractType && (
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="contract-type-select" className="form-label">
|
||||||
|
合同类型 <span className="required">*</span>
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="contract-type-select"
|
||||||
|
name="attributeType"
|
||||||
|
className="form-select"
|
||||||
|
value={attributeType}
|
||||||
|
onChange={(e) => setAttributeType(e.target.value)}
|
||||||
|
disabled={uploadStage !== "idle"}
|
||||||
|
required
|
||||||
|
>
|
||||||
|
{CONTRACT_TYPES.map(type => (
|
||||||
|
<option key={type.value} value={type.value}>
|
||||||
|
{type.label}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
<div className="form-tip">选择正确的合同类型以应用对应的审核规则</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label htmlFor="docNumber" className="form-label">文档编号</label>
|
<label htmlFor="docNumber" className="form-label">文档编号</label>
|
||||||
<input
|
<input
|
||||||
|
|||||||
Reference in New Issue
Block a user