This commit is contained in:
liang.chao 2025-12-03 13:24:52 +08:00
parent 139bed3da0
commit 64e06acc4d
2 changed files with 119 additions and 4 deletions

View File

@ -99,6 +99,13 @@ export function deleteRectificationApi(data) {
data:data,
})
}
export function issueRectificationApi(data) {
return request({
url: '/blade-system/fileManage/issue',
method: 'post',
data:data,
})
}
// 删除档案目录
export function delFileManageApi(data) {

View File

@ -4,11 +4,23 @@
<template #header>
<div class="card-header">
<span>整改清单</span>
<el-button size="small" @click="goBack">返回</el-button>
<el-button @click="goBack">返回</el-button>
</div>
</template>
<!-- 表格保留操作列 -->
<!-- 操作栏 -->
<div class="operation-bar">
<el-button
type="primary"
@click="handleIssue"
:disabled="selectedRows.length === 0"
:loading="issueLoading"
>
下发
</el-button>
</div>
<!-- 表格复选框列 -->
<avue-crud
:data="tableData"
:page="page"
@ -20,6 +32,7 @@
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
@search-change="handleSearch"
@selection-change="handleSelectionChange"
>
<!-- 操作列编辑按钮 -->
<template #menu="{ row, size }">
@ -81,7 +94,8 @@ import { Edit,Delete } from '@element-plus/icons-vue';
import {
selectRectificationListApi,
updateRectificationApi,
deleteRectificationApi
deleteRectificationApi,
issueRectificationApi
} from '@/api/archivesManagement/fileManager/fileManager.js';
const route = useRoute();
@ -91,7 +105,9 @@ const router = useRouter();
const projectId = route.query.projectId;
const loading = ref(false);
const issueLoading = ref(false); //
const tableData = ref([]);
const selectedRows = ref([]); //
const page = reactive({
currentPage: 1,
pageSize: 10,
@ -99,7 +115,7 @@ const page = reactive({
});
const searchParams = ref({}); //
//
//
const option = reactive({
height: 'auto',
index: true,
@ -115,7 +131,18 @@ const option = reactive({
searchShow: true, //
searchMenuSpan: 6, //
searchMenuAlign: 'right', //
selection: true, //
selectable: (row, index) => {
// isIssue
return row.isIssue !== 1; // isIssue 1
},
column: [
{
type: 'selection',
width: 55,
align: 'center',
reserveSelection: true
},
{
label: '项目名称',
prop: 'proName',
@ -133,6 +160,21 @@ const option = reactive({
label: '整改内容',
prop: 'description',
sortable: true,
},
{
label: '下发状态',
prop: 'isIssue',
type: 'tag',
align: 'center',
width: 100,
dicData: [
{ label: '未下发', value: 0 },
{ label: '已下发', value: 1 }
],
colors: {
0: 'warning',
1: 'success'
}
}
]
});
@ -170,6 +212,7 @@ const onLoad = async (pageParam = page) => {
const handleResetSearch = (done) => {
searchParams.value = {}; //
page.currentPage = 1; //
selectedRows.value = []; //
onLoad(); //
done && done(); // Avue
};
@ -181,6 +224,7 @@ const handleSearch = (params, done) => {
console.log('查询参数:', searchParams.value);
//
page.currentPage = 1; //
selectedRows.value = []; //
onLoad();
done && done(); //
};
@ -188,18 +232,76 @@ const handleSearch = (params, done) => {
//
const handleCurrentChange = (val) => {
page.currentPage = val;
selectedRows.value = []; //
onLoad();
};
const handleSizeChange = (val) => {
page.pageSize = val;
selectedRows.value = []; //
onLoad();
};
//
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
console.log('选中的行:', selectedRows.value);
};
//
const goBack = () => {
router.go(-1);
};
// ================== ==================
const handleIssue = async () => {
if (selectedRows.value.length === 0) {
ElMessage.warning('请先选择要下发的整改项');
return;
}
//
const pendingRows = selectedRows.value.filter(row => row.isIssue !== 1);
if (pendingRows.length === 0) {
ElMessage.warning('选中的项已全部下发,无需重复操作');
return;
}
try {
await ElMessageBox.confirm(
`确定要下发选中的 ${pendingRows.length} 项整改内容吗?`,
'提示',
{
confirmButtonText: '确定下发',
cancelButtonText: '取消',
type: 'warning'
}
);
issueLoading.value = true;
// ID
const ids = pendingRows.map(row => row.id);
const res = await issueRectificationApi({ ids });
if (res.data?.code === 200) {
ElMessage.success(`成功下发 ${pendingRows.length} 项整改内容`);
selectedRows.value = []; //
onLoad(); //
} else {
ElMessage.error(res.data?.msg || '下发失败');
}
} catch (error) {
if (error === 'cancel') {
return; //
}
ElMessage.error('下发失败:' + (error.message || '请检查网络或参数'));
console.error('下发请求异常:', error);
} finally {
issueLoading.value = false;
}
};
// ================== ==================
const dialogVisible = ref(false);
const formData = ref({});
@ -273,6 +375,7 @@ const submitEdit = async () => {
submitLoading.value = false;
}
};
//
const handleRemove = async (row) => {
//
@ -319,4 +422,9 @@ const handleRemove = async (row) => {
justify-content: space-between;
align-items: center;
}
.operation-bar {
margin-bottom: 15px;
padding: 10px 0;
}
</style>