diff --git a/src/api/archivesManagement/fileManager/fileManager.js b/src/api/archivesManagement/fileManager/fileManager.js index e351e8be..ef3e332d 100644 --- a/src/api/archivesManagement/fileManager/fileManager.js +++ b/src/api/archivesManagement/fileManager/fileManager.js @@ -9,6 +9,13 @@ export function getProListAPI(data) { data: data, }) } +export function getProjectNameByIdApi(data) { + return request({ + url: '/blade-system/fileManage/getProjectNameById', + method: 'POST', + data: data, + }) +} // 获取档案目录树 diff --git a/src/views/fileManager/file-data.vue b/src/views/fileManager/file-data.vue index 39f2e968..24e7a3b7 100644 --- a/src/views/fileManager/file-data.vue +++ b/src/views/fileManager/file-data.vue @@ -5,10 +5,8 @@
档案同步 - 发起归档 - 完整性确认 返回
@@ -56,32 +54,38 @@ - + -
-
- -
-
-

确认所有档案已完整,可以进行移交?

-

确认后不可再上传文件。

-
-
+ + + + + + + +
@@ -103,7 +107,11 @@ import { } from '@element-plus/icons-vue' import LeftTree from './components/leftTree.vue' import RightTable from './components/rightTable.vue' -import { fileExtractApi, updateIntegrityStatusApi } from '@/api/archivesManagement/fileManager/fileManager' +import { + fileExtractApi, + getProjectNameByIdApi, + updateIntegrityStatusApi +} from '@/api/archivesManagement/fileManager/fileManager'; const route = useRoute() const router = useRouter() @@ -117,14 +125,45 @@ const isSyncing = ref(false) const syncSuccess = ref(false) const syncError = ref(false) const integrityStatus = ref(false) -const confirmDialogVisible = ref(false) +const archiveDialogVisible = ref(false) +const archiveForm = ref({ + projectName: '', + description: '' +}) +const archiveFormRef = ref(null) +const archiveRules = ref({ + description: [ + { message: '请输入归档描述', trigger: 'blur' }, + { min: 1, max: 200, message: '归档描述长度应在1-200个字符之间', trigger: 'blur' } + ] +}) // 生命周期 onMounted(() => { projectId.value = route.query.id fileStatus.value = route.query.fileStatus + // 获取项目名称并回显 + getProjectName() }) +// 获取项目名称 +const getProjectName = async () => { + try { + const res = await getProjectNameByIdApi({ + id: projectId.value + }) + if (res.data?.code === 200) { + const project = res.data.data + archiveForm.value.projectName = project.proName || '未知项目' + } else { + archiveForm.value.projectName = '未知项目' + } + } catch (error) { + console.error('获取项目名称失败:', error) + archiveForm.value.projectName = '未知项目' + } +} + // 方法 const handleClose = () => { router.go(-1) @@ -134,29 +173,39 @@ const handleNodeClick = (data) => { selectedNode.value = data } -const moveListConfirm = () => { - integrityStatus.value = true +const showArchiveDialog = () => { + archiveDialogVisible.value = true + // 重置表单 + archiveForm.value.description = '' } -const handleIntegrityStatus = () => { - confirmDialogVisible.value = true -} - -const confirmIntegrityStatus = async () => { +const submitArchive = async () => { + // 表单验证 + if (!archiveFormRef.value) return try { - const res = await updateIntegrityStatusApi({ proId: projectId.value }) + await archiveFormRef.value.validate() + } catch (error) { + return + } + + try { + // 调用归档接口 + const res = await updateIntegrityStatusApi({ + proId: projectId.value, + description: archiveForm.value.description + }) if (res.data.code === 200) { - ElMessage.success('完整性确认成功') - confirmDialogVisible.value = false + ElMessage.success('归档成功') + archiveDialogVisible.value = false setTimeout(() => { - router.push('/archivesManagement/fileManager') + router.push('/fileManager/index') }, 200) } else { - ElMessage.error(res.data.msg || '完整性确认失败') + ElMessage.error(res.data.msg || '归档失败') } } catch (error) { - ElMessage.error('完整性确认失败,请重试') - console.error('完整性确认失败:', error) + ElMessage.error('归档失败,请重试') + console.error('归档失败:', error) } } diff --git a/src/views/fileManager/index.vue b/src/views/fileManager/index.vue index 67aa2163..599dfa1e 100644 --- a/src/views/fileManager/index.vue +++ b/src/views/fileManager/index.vue @@ -185,7 +185,7 @@ export default { case '0': return '未归档移交'; case '1': - return '已确认完整性'; + return '已发起归档申请'; case '2': return '已归档移交'; default: