This commit is contained in:
parent
8dbe92c1b6
commit
d9fa6d07c5
|
|
@ -9,3 +9,17 @@ export function list(data) {
|
||||||
data: 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,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,15 @@
|
||||||
@refresh-change="refreshChange"
|
@refresh-change="refreshChange"
|
||||||
@on-load="onLoad"
|
@on-load="onLoad"
|
||||||
>
|
>
|
||||||
|
<template #menu-left>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="showRectifyNoticeDialog"
|
||||||
|
>
|
||||||
|
下发整改通知
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template #fileName="{ row }">
|
<template #fileName="{ row }">
|
||||||
<span class="file-name-link" @click="viewFile(row)">{{ row.fileName }}</span>
|
<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"
|
<ViewFile v-if="isViewflag" :rowData="row" :title="title" :isAdd="isAdd" @closeDialog="closeDialog"
|
||||||
@showColose="showColose" :width="600" />
|
@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>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRouter } from 'vue-router';
|
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();
|
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({
|
const props = defineProps({
|
||||||
projectId: {
|
projectId: {
|
||||||
|
|
@ -73,6 +174,40 @@ const page = reactive({
|
||||||
|
|
||||||
const query = 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 配置
|
// Avue 配置
|
||||||
const option = reactive({
|
const option = reactive({
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
|
|
@ -145,7 +280,6 @@ const handleDetail = (rowData) => {
|
||||||
isflag.value = true;
|
isflag.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** 修改操作 */
|
/** 修改操作 */
|
||||||
const handleUpdate = (rowData) => {
|
const handleUpdate = (rowData) => {
|
||||||
title.value = '修改';
|
title.value = '修改';
|
||||||
|
|
@ -155,6 +289,7 @@ const handleUpdate = (rowData) => {
|
||||||
row.value.detailStatus = false;
|
row.value.detailStatus = false;
|
||||||
isflag.value = true;
|
isflag.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRect = (rowData) => {
|
const handleRect = (rowData) => {
|
||||||
title.value = '加入整改清单';
|
title.value = '加入整改清单';
|
||||||
isRect.value = 'rect';
|
isRect.value = 'rect';
|
||||||
|
|
@ -217,7 +352,7 @@ const onLoad = async (pageParam, params = {}) => {
|
||||||
page.total = res.data.total;
|
page.total = res.data.total;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error('加载表格数据失败:', error);
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
@ -234,6 +369,117 @@ watch(() => props.selectedNode, (newVal) => {
|
||||||
onLoad(page, { parentId, proId });
|
onLoad(page, { parentId, proId });
|
||||||
}, { immediate: true });
|
}, { 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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
@ -245,4 +491,12 @@ watch(() => props.selectedNode, (newVal) => {
|
||||||
.file-name-link:hover {
|
.file-name-link:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clear-btn {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-btn {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,22 @@ export default {
|
||||||
prop: 'auditStatus',
|
prop: 'auditStatus',
|
||||||
search: true,
|
search: true,
|
||||||
slot: true, // 启用插槽
|
slot: true, // 启用插槽
|
||||||
|
type: 'select', // 设置为下拉框
|
||||||
|
dicData: [ // 定义下拉选项
|
||||||
|
{
|
||||||
|
label: '待审核',
|
||||||
|
value: '0'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '审核通过',
|
||||||
|
value: '1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '已下发整改',
|
||||||
|
value: '2'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
searchFilterable: true // 可搜索
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue