This commit is contained in:
liang.chao 2025-12-08 15:46:00 +08:00
parent 8dbe92c1b6
commit d9fa6d07c5
3 changed files with 291 additions and 7 deletions

View File

@ -9,3 +9,17 @@ export function list(data) {
data: data,
})
}
export function getArchivingManageFilesApi(data) {
return request({
url: '/blade-system/archivingManage/getArchivingManageFiles',
method: 'POST',
data: data,
})
}
export function submitRectifyNoticeApi(data) {
return request({
url: '/blade-system/archivingManage/addRectification',
method: 'POST',
data: data,
})
}

View File

@ -13,6 +13,15 @@
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template #menu-left>
<el-button
type="primary"
plain
@click="showRectifyNoticeDialog"
>
下发整改通知
</el-button>
</template>
<template #fileName="{ row }">
<span class="file-name-link" @click="viewFile(row)">{{ row.fileName }}</span>
@ -22,19 +31,111 @@
<!-- 预览文件 -->
<ViewFile v-if="isViewflag" :rowData="row" :title="title" :isAdd="isAdd" @closeDialog="closeDialog"
@showColose="showColose" :width="600" />
<!-- 下发整改通知弹框 -->
<el-dialog
class="l-dialog"
:title="rectifyNoticeTitle"
v-model="rectifyNoticeDialogVisible"
:show-close="true"
:close-on-click-modal="false"
@close="handleRectifyNoticeClose"
append-to-body
>
<el-form
ref="rectifyNoticeFormRef"
:model="rectifyNoticeForm"
:rules="rectifyNoticeRules"
label-width="120px"
size="default"
>
<el-form-item label="工程档案" prop="selectedFiles">
<div>
<el-button
plain
type="primary"
size="mini"
icon="Plus"
@click="handleSelectFile"
>
选择
</el-button>
<div v-if="rectifyNoticeForm.selectedFiles.length > 0" style="margin-top: 10px">
<el-table :data="rectifyNoticeForm.selectedFiles" border size="small" style="width: 100%">
<el-table-column label="序号" width="60" align="center">
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="parParentName" label="所属分类" min-width="200" />
<el-table-column prop="parentName" label="所属案卷" min-width="100" />
<el-table-column prop="fileName" label="文件名称" min-width="100" />
<el-table-column label="操作" width="80" align="center">
<template #default="scope">
<el-button
type="text"
icon="Delete"
size="small"
style="color: #f56c6c"
@click="removeSelectedFile(scope.$index)"
/>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-form-item>
<el-form-item label="整改描述" prop="rectifyDescription">
<el-input
v-model="rectifyNoticeForm.rectifyDescription"
type="textarea"
:rows="4"
placeholder="请输入整改描述"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button class="clear-btn" @click="handleRectifyNoticeClose">
取消
</el-button>
<el-button
type="primary"
class="search-btn"
@click="submitRectifyNotice"
>
确认
</el-button>
</template>
<!-- 文件树弹窗 -->
<FileTree
v-if="fileTreeDialogVisible"
:is-add="fileTreeIsAdd"
:row-data="fileTreeRowData"
:title="fileTreeTitle"
@close-dialog="closeFileTreeDialog"
@get-tree-data="getTreeData"
:data-form="fileTreeRowData"
:width="600"
/>
</el-dialog>
</el-card>
</div>
</template>
<script setup>
import { useRouter } from 'vue-router';
import { ref, reactive, watch, nextTick } from 'vue';
import { ElMessage, ElLoading, ElMessageBox } from 'element-plus';
import { getFileManageApi } from '@/api/archivesManagement/fileManager/fileManager.js';
import { getArchivingManageFilesApi,submitRectifyNoticeApi } from '@/api/archivesManagement/archivingManage'; // API
import ViewFile from '@/views/viewFile/viewFile.vue';
import FileTree from '@/views/common/fileTree.vue'; //
const router = useRouter();
import { ref, reactive, watch, nextTick } from 'vue';
import {
getFileManageApi
} from '@/api/archivesManagement/fileManager/fileManager.js';
import ViewFile from '@/views/viewFile/viewFile.vue';
const props = defineProps({
projectId: {
@ -73,6 +174,40 @@ const page = reactive({
const query = reactive({});
//
const rectifyNoticeDialogVisible = ref(false);
const rectifyNoticeTitle = ref('下发整改通知');
const rectifyNoticeFormRef = ref();
const rectifyNoticeForm = reactive({
selectedFiles: [],
rectifyDescription: ''
});
const rectifyNoticeRules = {
selectedFiles: [
{
validator: (rule, value, callback) => {
if (!value || value.length === 0) {
callback(new Error('请选择工程档案'));
} else {
callback();
}
},
trigger: 'change'
}
],
rectifyDescription: [
{ required: true, message: '请输入整改描述', trigger: 'blur' },
{ min: 1, max: 200, message: '整改描述长度应在1-200个字符之间', trigger: 'blur' }
]
};
//
const fileTreeDialogVisible = ref(false);
const fileTreeTitle = ref('');
const fileTreeIsAdd = ref('rectify');
const fileTreeRowData = ref({});
// Avue
const option = reactive({
height: 'auto',
@ -145,7 +280,6 @@ const handleDetail = (rowData) => {
isflag.value = true;
};
/** 修改操作 */
const handleUpdate = (rowData) => {
title.value = '修改';
@ -155,6 +289,7 @@ const handleUpdate = (rowData) => {
row.value.detailStatus = false;
isflag.value = true;
};
const handleRect = (rowData) => {
title.value = '加入整改清单';
isRect.value = 'rect';
@ -217,7 +352,7 @@ const onLoad = async (pageParam, params = {}) => {
page.total = res.data.total;
}
} catch (error) {
console.error('加载表格数据失败:', error);
} finally {
loading.value = false;
}
@ -234,6 +369,117 @@ watch(() => props.selectedNode, (newVal) => {
onLoad(page, { parentId, proId });
}, { immediate: true });
//
const showRectifyNoticeDialog = () => {
rectifyNoticeDialogVisible.value = true;
//
rectifyNoticeForm.selectedFiles = [];
rectifyNoticeForm.rectifyDescription = '';
nextTick(() => {
if (rectifyNoticeFormRef.value) {
rectifyNoticeFormRef.value.clearValidate();
}
});
};
const handleRectifyNoticeClose = () => {
rectifyNoticeDialogVisible.value = false;
//
rectifyNoticeForm.selectedFiles = [];
rectifyNoticeForm.rectifyDescription = '';
};
const handleSelectFile = () => {
if (!props.projectId) {
ElMessage.error('请先选择项目');
return;
}
fileTreeTitle.value = '选择工程档案';
fileTreeRowData.value = { proId: props.projectId };
fileTreeDialogVisible.value = true;
};
const closeFileTreeDialog = () => {
fileTreeDialogVisible.value = false;
};
const getTreeData = async (nodeId) => {
try {
// API getTransferApplyFiles
const res = await getArchivingManageFilesApi({
id: nodeId, // ID
proId: props.projectId // ID
});
if (Array.isArray(res.data.data)) {
for (const item of res.data.data) {
const newFile = {
proFilesContentsId: item.id,
parParentName: item.parParentName || '未分类',
parentName: item.parentName || '未命名案卷',
fileName: item.fileName,
proId: props.projectId,
fileSourceId: item.fileId,
filePath: item.filePath || ''
};
const exists = rectifyNoticeForm.selectedFiles.some(
(f) => f.proFilesContentsId === newFile.proFilesContentsId
);
if (!exists) {
rectifyNoticeForm.selectedFiles.push(newFile);
}
}
}
//
nextTick(() => {
rectifyNoticeFormRef.value?.validateField('selectedFiles');
});
} catch (error) {
console.error('获取文件树数据失败:', error);
ElMessage.error('获取文件数据失败');
}
};
const removeSelectedFile = (index) => {
rectifyNoticeForm.selectedFiles.splice(index, 1);
nextTick(() => {
rectifyNoticeFormRef.value?.validateField('selectedFiles');
});
};
const submitRectifyNotice = async () => {
try {
await rectifyNoticeFormRef.value.validate();
} catch {
return;
}
try {
const loading = ElLoading.service({
lock: true,
text: '正在下发整改通知,请稍候...',
background: 'rgba(0,0,0,0.5)'
});
// ID
const fileIds = rectifyNoticeForm.selectedFiles.map(file => file.fileSourceId).join(',');
await submitRectifyNoticeApi({
fileId: fileIds, // ID
proId: props.projectId, // ID
description: rectifyNoticeForm.rectifyDescription //
});
loading.close();
ElMessage.success('整改通知下发成功');
handleRectifyNoticeClose();
} catch (error) {
console.error('提交整改通知失败:', error);
ElMessage.error('整改通知下发失败');
}
};
</script>
<style scoped>
@ -245,4 +491,12 @@ watch(() => props.selectedNode, (newVal) => {
.file-name-link:hover {
text-decoration: underline;
}
.clear-btn {
margin-right: 10px;
}
.search-btn {
margin-left: 10px;
}
</style>

View File

@ -82,6 +82,22 @@ export default {
prop: 'auditStatus',
search: true,
slot: true, //
type: 'select', //
dicData: [ //
{
label: '待审核',
value: '0'
},
{
label: '审核通过',
value: '1'
},
{
label: '已下发整改',
value: '2'
}
],
searchFilterable: true //
},
],
},