Files
ccdi/ruoyi-ui/src/views/ccdiProject/index.vue

284 lines
7.4 KiB
Vue
Raw Normal View History

2026-01-30 11:01:13 +08:00
<template>
<div class="app-container dpc-project-container">
<!-- 页面标题 -->
<div class="page-header">
<h2 class="page-title">初核项目管理</h2>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新建项目</el-button>
2026-01-30 11:01:13 +08:00
</div>
<!-- 搜索和操作区 -->
<search-bar
:show-search="showSearch"
:tab-counts="tabCounts"
2026-01-30 11:01:13 +08:00
@query="handleQuery"
/>
<!-- 项目列表表格 -->
<project-table
:loading="loading"
:data-list="projectList"
:total="total"
:page-params="queryParams"
@pagination="handlePagination"
2026-01-30 11:01:13 +08:00
@enter="handleEnter"
@view-result="handleViewResult"
@re-analyze="handleReAnalyze"
@archive="handleArchive"
/>
<!-- 快捷入口区 -->
<quick-entry
@import-history="handleImport"
@create-quarterly="handleCreateQuarterly"
@create-employee="handleCreateEmployee"
@create-highrisk="handleCreateHighRisk"
/>
<!-- 新建项目弹窗 -->
<add-project-dialog
:visible.sync="addDialogVisible"
:title="addDialogTitle"
:form="projectForm"
@submit="handleSubmitProject"
@close="handleCloseAddDialog"
/>
<!-- 导入历史项目弹窗 -->
<import-history-dialog
:visible.sync="importDialogVisible"
@submit="handleSubmitImport"
@close="handleCloseImportDialog"
/>
<!-- 项目归档确认弹窗 -->
<archive-confirm-dialog
:visible.sync="archiveDialogVisible"
:project-data="currentArchiveProject"
@confirm="handleConfirmArchive"
@close="archiveDialogVisible = false"
/>
</div>
</template>
<script>
import {listProject, getStatusCounts} from '@/api/ccdiProject'
2026-01-30 11:01:13 +08:00
import SearchBar from './components/SearchBar'
import ProjectTable from './components/ProjectTable'
import QuickEntry from './components/QuickEntry'
import AddProjectDialog from './components/AddProjectDialog'
import ImportHistoryDialog from './components/ImportHistoryDialog'
import ArchiveConfirmDialog from './components/ArchiveConfirmDialog'
export default {
2026-03-02 19:18:45 +08:00
name: "DpcProject",
2026-01-30 11:01:13 +08:00
components: {
SearchBar,
ProjectTable,
QuickEntry,
AddProjectDialog,
ImportHistoryDialog,
2026-03-02 19:18:45 +08:00
ArchiveConfirmDialog,
2026-01-30 11:01:13 +08:00
},
data() {
return {
// 加载状态
loading: true,
// 显示搜索栏
showSearch: true,
// 总条数
total: 0,
// 项目列表
projectList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
projectName: null,
status: null
2026-01-30 11:01:13 +08:00
},
// 标签页数量统计
tabCounts: {
all: 0,
'0': 0,
'1': 0,
'2': 0
2026-01-30 11:01:13 +08:00
},
// 新增/编辑弹窗
addDialogVisible: false,
2026-03-02 19:18:45 +08:00
addDialogTitle: "新建项目",
2026-01-30 11:01:13 +08:00
projectForm: {},
// 导入历史项目弹窗
importDialogVisible: false,
// 归档确认弹窗
archiveDialogVisible: false,
2026-03-02 19:18:45 +08:00
currentArchiveProject: null,
};
2026-01-30 11:01:13 +08:00
},
created() {
2026-03-02 19:18:45 +08:00
this.getList();
2026-01-30 11:01:13 +08:00
},
methods: {
/** 查询项目列表 */
getList() {
this.loading = true
// 并行请求列表数据和状态统计
Promise.all([
listProject(this.queryParams),
getStatusCounts()
]).then(([listResponse, countsResponse]) => {
// 处理列表数据
this.projectList = listResponse.rows
this.total = listResponse.total
// 处理状态统计
2026-02-28 09:44:44 +08:00
const counts = countsResponse.data || {}
this.tabCounts = {
2026-02-28 09:44:44 +08:00
all: counts.all || 0,
'0': counts.status0 || 0,
'1': counts.status1 || 0,
'2': counts.status2 || 0
}
2026-01-30 11:01:13 +08:00
this.loading = false
2026-02-28 09:44:44 +08:00
}).catch((error) => {
2026-01-30 11:01:13 +08:00
this.loading = false
2026-02-28 09:44:44 +08:00
console.error('加载数据失败:', error)
this.$modal.msgError('加载数据失败,请稍后重试')
2026-01-30 11:01:13 +08:00
})
},
/** 搜索按钮操作 */
handleQuery(queryParams) {
if (queryParams) {
2026-03-02 19:18:45 +08:00
this.queryParams = { ...this.queryParams, ...queryParams };
2026-01-30 11:01:13 +08:00
}
2026-03-02 19:18:45 +08:00
this.queryParams.pageNum = 1;
this.getList();
2026-01-30 11:01:13 +08:00
},
/** 分页事件处理 */
handlePagination(pagination) {
if (pagination) {
this.queryParams.pageNum = pagination.pageNum
this.queryParams.pageSize = pagination.pageSize
}
this.getList()
},
2026-01-30 11:01:13 +08:00
/** 新增按钮操作 */
handleAdd() {
2026-03-02 19:18:45 +08:00
this.projectForm = this.getEmptyForm();
this.addDialogTitle = "新建项目";
this.addDialogVisible = true;
2026-01-30 11:01:13 +08:00
},
/** 获取空表单 */
getEmptyForm() {
return {
projectId: null,
2026-03-02 19:18:45 +08:00
projectName: "",
projectDesc: "",
startDate: "",
endDate: "",
2026-01-30 11:01:13 +08:00
targetCount: 0,
2026-03-02 19:18:45 +08:00
targetPersons: [],
};
2026-01-30 11:01:13 +08:00
},
/** 关闭新增弹窗 */
handleCloseAddDialog() {
2026-03-02 19:18:45 +08:00
this.addDialogVisible = false;
this.projectForm = {};
2026-01-30 11:01:13 +08:00
},
/** 提交项目表单 */
handleSubmitProject(data) {
// 不需要再次调用API因为AddProjectDialog已经处理了
2026-01-30 11:01:13 +08:00
this.addDialogVisible = false
this.getList() // 刷新列表
2026-01-30 11:01:13 +08:00
},
/** 导入历史项目 */
handleImport() {
2026-03-02 19:18:45 +08:00
this.importDialogVisible = true;
2026-01-30 11:01:13 +08:00
},
/** 关闭导入弹窗 */
handleCloseImportDialog() {
2026-03-02 19:18:45 +08:00
this.importDialogVisible = false;
2026-01-30 11:01:13 +08:00
},
/** 提交导入 */
handleSubmitImport(data) {
2026-03-02 19:18:45 +08:00
console.log("导入历史项目:", data);
this.$modal.msgSuccess("项目导入成功");
this.importDialogVisible = false;
this.getList();
2026-01-30 11:01:13 +08:00
},
/** 创建季度初核 */
handleCreateQuarterly() {
2026-03-02 19:18:45 +08:00
this.projectForm = this.getEmptyForm();
this.addDialogTitle = "创建季度初核项目";
this.addDialogVisible = true;
2026-01-30 11:01:13 +08:00
},
/** 创建新员工排查 */
handleCreateEmployee() {
2026-03-02 19:18:45 +08:00
this.projectForm = this.getEmptyForm();
this.addDialogTitle = "创建新员工排查项目";
this.addDialogVisible = true;
2026-01-30 11:01:13 +08:00
},
/** 创建高风险专项 */
handleCreateHighRisk() {
2026-03-02 19:18:45 +08:00
this.projectForm = this.getEmptyForm();
this.addDialogTitle = "创建高风险专项项目";
this.addDialogVisible = true;
2026-01-30 11:01:13 +08:00
},
/** 进入项目 */
handleEnter(row) {
2026-03-02 19:18:45 +08:00
this.$router.push({
path: `ccdiProject/detail/${row.projectId}`,
});
// this.$modal.msgSuccess("进入项目: " + row.projectName);
2026-01-30 11:01:13 +08:00
},
/** 查看结果 */
handleViewResult(row) {
this.$router.push({
path: `/ccdiProject/detail/${row.projectId}`,
query: { tab: "overview" },
});
2026-01-30 11:01:13 +08:00
},
/** 重新分析 */
handleReAnalyze(row) {
2026-03-02 19:18:45 +08:00
console.log("重新分析:", row);
this.$modal.msgSuccess("正在重新分析项目: " + row.projectName);
2026-01-30 11:01:13 +08:00
},
/** 归档项目 */
handleArchive(row) {
2026-03-02 19:18:45 +08:00
this.currentArchiveProject = row;
this.archiveDialogVisible = true;
2026-01-30 11:01:13 +08:00
},
/** 确认归档 */
handleConfirmArchive(data) {
2026-03-02 19:18:45 +08:00
console.log("确认归档:", data);
this.$modal.msgSuccess("项目已归档");
this.archiveDialogVisible = false;
this.getList();
},
},
};
2026-01-30 11:01:13 +08:00
</script>
<style lang="scss" scoped>
.dpc-project-container {
padding: 24px;
background: #F8F9FA;
2026-01-30 11:01:13 +08:00
min-height: calc(100vh - 140px);
}
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
2026-01-30 11:01:13 +08:00
.page-title {
margin: 0;
font-size: 20px;
2026-01-30 11:01:13 +08:00
font-weight: 500;
color: #303133;
}
}
</style>