This commit is contained in:
liang.chao 2025-12-04 15:49:42 +08:00
parent 9199264e78
commit 008d2c93eb
3 changed files with 91 additions and 35 deletions

View File

@ -9,6 +9,13 @@ export function getProListAPI(data) {
data: data, data: data,
}) })
} }
export function getProjectNameByIdApi(data) {
return request({
url: '/blade-system/fileManage/getProjectNameById',
method: 'POST',
data: data,
})
}
// 获取档案目录树 // 获取档案目录树

View File

@ -5,10 +5,8 @@
<div class="toolbar-left"> <div class="toolbar-left">
<el-button type="warning" plain icon="Bottom" @click="handleFileExtract" <el-button type="warning" plain icon="Bottom" @click="handleFileExtract"
v-if="fileStatus === '0' && !integrityStatus">档案同步</el-button> v-if="fileStatus === '0' && !integrityStatus">档案同步</el-button>
<el-button type="success" plain icon="Finished" @click="moveListConfirm" <el-button type="success" plain icon="Finished" @click="showArchiveDialog"
v-if="fileStatus === '0' && !integrityStatus">发起归档</el-button> v-if="fileStatus === '0' && !integrityStatus">发起归档</el-button>
<el-button type="success" plain icon="Finished" @click="handleIntegrityStatus"
v-if="fileStatus === '0' && integrityStatus">完整性确认</el-button>
<el-button type="danger" plain icon="Close" @click="handleClose">返回</el-button> <el-button type="danger" plain icon="Close" @click="handleClose">返回</el-button>
</div> </div>
</div> </div>
@ -56,32 +54,38 @@
</template> </template>
</el-dialog> </el-dialog>
<!-- 完整性确认弹框 --> <!-- 发起归档弹框 -->
<el-dialog <el-dialog
v-model="confirmDialogVisible" v-model="archiveDialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
:show-close="true" :show-close="true"
width="450px" width="500px"
> >
<template #header> <template #header>
<div class="dialog-title"> <div class="dialog-title">
<span>操作确认</span> <span>发起归档</span>
</div> </div>
</template> </template>
<div class="confirm-content"> <el-form :model="archiveForm" label-width="100px" :rules="archiveRules" ref="archiveFormRef">
<div class="confirm-icon"> <el-form-item label="归档工程" prop="projectName">
<el-icon color="#E6A23C" :size="48"><QuestionFilled /></el-icon> <el-input v-model="archiveForm.projectName" placeholder="归档工程" disabled />
</div> </el-form-item>
<div class="confirm-text"> <el-form-item label="归档描述" prop="description">
<p class="main-message">确认所有档案已完整,可以进行移交?</p> <el-input
<p class="sub-message">确认后不可再上传文件</p> v-model="archiveForm.description"
</div> type="textarea"
</div> :rows="4"
placeholder="请输入归档描述"
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button class="clear-btn" @click="confirmDialogVisible = false">取消</el-button> <el-button class="clear-btn" @click="archiveDialogVisible = false">取消</el-button>
<el-button type="primary" class="search-btn" @click="confirmIntegrityStatus">确定</el-button> <el-button type="primary" class="search-btn" @click="submitArchive">确定</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -103,7 +107,11 @@ import {
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import LeftTree from './components/leftTree.vue' import LeftTree from './components/leftTree.vue'
import RightTable from './components/rightTable.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 route = useRoute()
const router = useRouter() const router = useRouter()
@ -117,14 +125,45 @@ const isSyncing = ref(false)
const syncSuccess = ref(false) const syncSuccess = ref(false)
const syncError = ref(false) const syncError = ref(false)
const integrityStatus = 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(() => { onMounted(() => {
projectId.value = route.query.id projectId.value = route.query.id
fileStatus.value = route.query.fileStatus 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 = () => { const handleClose = () => {
router.go(-1) router.go(-1)
@ -134,29 +173,39 @@ const handleNodeClick = (data) => {
selectedNode.value = data selectedNode.value = data
} }
const moveListConfirm = () => { const showArchiveDialog = () => {
integrityStatus.value = true archiveDialogVisible.value = true
//
archiveForm.value.description = ''
} }
const handleIntegrityStatus = () => { const submitArchive = async () => {
confirmDialogVisible.value = true //
} if (!archiveFormRef.value) return
const confirmIntegrityStatus = async () => {
try { 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) { if (res.data.code === 200) {
ElMessage.success('完整性确认成功') ElMessage.success('归档成功')
confirmDialogVisible.value = false archiveDialogVisible.value = false
setTimeout(() => { setTimeout(() => {
router.push('/archivesManagement/fileManager') router.push('/fileManager/index')
}, 200) }, 200)
} else { } else {
ElMessage.error(res.data.msg || '完整性确认失败') ElMessage.error(res.data.msg || '归档失败')
} }
} catch (error) { } catch (error) {
ElMessage.error('完整性确认失败,请重试') ElMessage.error('归档失败,请重试')
console.error('完整性确认失败:', error) console.error('归档失败:', error)
} }
} }

View File

@ -185,7 +185,7 @@ export default {
case '0': case '0':
return '未归档移交'; return '未归档移交';
case '1': case '1':
return '已确认完整性'; return '已发起归档申请';
case '2': case '2':
return '已归档移交'; return '已归档移交';
default: default: