“班主任考核修复weiz”

This commit is contained in:
weizhong committed 2025-08-25 01:11:33 +08:00
1 parent 3c62f1f6de
commit 6bffe5fa08
6 files changed
+184 -85

No files matched your search

@@ -88,7 +88,7 @@ public class AssessmentApprovalController extends BaseController {
/**
* 批量审核拒绝
*/
@SaCheckPermission("bzrkh:assessmentApproval:reject")
@SaCheckPermission("bzrkh:assessmentApproval:approve")
@Log(title = "班主任考核审核", businessType = BusinessType.UPDATE)
@PostMapping("/batchReject")
public R<Void> batchReject(@Validated @RequestBody BatchApprovalBo bo) {
@@ -83,11 +83,36 @@ public class BmzrAssessmentIndicatorTypeServiceImpl implements IBmzrAssessmentIn
private LambdaQueryWrapper<BmzrAssessmentIndicatorType> buildQueryWrapper(BmzrAssessmentIndicatorTypeBo bo) {
LambdaQueryWrapper<BmzrAssessmentIndicatorType> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getDeleted() != null, BmzrAssessmentIndicatorType::getDeleted, bo.getDeleted());
lqw.like(StringUtils.isNotBlank(bo.getIndicatorTypeName()), BmzrAssessmentIndicatorType::getIndicatorTypeName, bo.getIndicatorTypeName());
lqw.eq(StringUtils.isNotBlank(bo.getIndicatorTypeCode()), BmzrAssessmentIndicatorType::getIndicatorTypeCode, bo.getIndicatorTypeCode());
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BmzrAssessmentIndicatorType::getStatus, bo.getStatus());
// 添加调试日志
log.info("构建查询条件 - 输入参数: indicatorTypeCode={}, indicatorTypeName={}, status={}, deleted={}",
bo.getIndicatorTypeCode(), bo.getIndicatorTypeName(), bo.getStatus(), bo.getDeleted());
// 默认只查询未删除的记录
lqw.eq(BmzrAssessmentIndicatorType::getDeleted, 0);
// 指标类型名称模糊查询
if (StringUtils.isNotBlank(bo.getIndicatorTypeName())) {
lqw.like(BmzrAssessmentIndicatorType::getIndicatorTypeName, bo.getIndicatorTypeName());
log.info("添加指标类型名称模糊查询条件: {}", bo.getIndicatorTypeName());
}
// 指标类型编码精确查询
if (StringUtils.isNotBlank(bo.getIndicatorTypeCode())) {
lqw.eq(BmzrAssessmentIndicatorType::getIndicatorTypeCode, bo.getIndicatorTypeCode());
log.info("添加指标类型编码精确查询条件: {}", bo.getIndicatorTypeCode());
}
// 状态查询
if (StringUtils.isNotBlank(bo.getStatus())) {
lqw.eq(BmzrAssessmentIndicatorType::getStatus, bo.getStatus());
log.info("添加状态查询条件: {}", bo.getStatus());
}
// 按创建时间排序
lqw.orderByAsc(BmzrAssessmentIndicatorType::getCreateTime);
log.info("最终查询条件构建完成");
return lqw;
}
@@ -1,45 +0,0 @@
-- 培训管理权限设置
-- 创建于 2025-07-23
-- 培训课程管理权限
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `remark`) VALUES
(2111, '培训课程查询', 2110, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:course:query', '#', 1, NOW(), '培训课程查询权限'),
(2112, '培训课程新增', 2110, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:course:add', '#', 1, NOW(), '培训课程新增权限'),
(2113, '培训课程修改', 2110, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:course:edit', '#', 1, NOW(), '培训课程修改权限'),
(2114, '培训课程删除', 2110, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:course:remove', '#', 1, NOW(), '培训课程删除权限'),
(2115, '培训课程导出', 2110, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:course:export', '#', 1, NOW(), '培训课程导出权限');
-- 培训申请管理权限
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `remark`) VALUES
(2121, '培训申请查询', 2110, 6, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:application:query', '#', 1, NOW(), '培训申请查询权限'),
(2122, '培训申请新增', 2110, 7, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:application:add', '#', 1, NOW(), '培训申请新增权限'),
(2123, '培训申请修改', 2110, 8, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:application:edit', '#', 1, NOW(), '培训申请修改权限'),
(2124, '培训申请删除', 2110, 9, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:application:remove', '#', 1, NOW(), '培训申请删除权限'),
(2125, '培训申请导出', 2110, 10, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:application:export', '#', 1, NOW(), '培训申请导出权限'),
(2126, '培训申请列表', 2110, 11, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:application:list', '#', 1, NOW(), '培训申请列表权限');
-- 培训审批管理权限
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `remark`) VALUES
(2131, '培训审批查询', 2110, 12, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:approval:query', '#', 1, NOW(), '培训审批查询权限'),
(2132, '培训审批新增', 2110, 13, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:approval:add', '#', 1, NOW(), '培训审批新增权限'),
(2133, '培训审批修改', 2110, 14, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:approval:edit', '#', 1, NOW(), '培训审批修改权限'),
(2134, '培训审批删除', 2110, 15, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:approval:remove', '#', 1, NOW(), '培训审批删除权限'),
(2135, '培训审批导出', 2110, 16, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:approval:export', '#', 1, NOW(), '培训审批导出权限'),
(2136, '培训审批处理', 2110, 17, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:approval:process', '#', 1, NOW(), '培训审批处理权限'),
(2137, '培训审批列表', 2110, 18, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:approval:list', '#', 1, NOW(), '培训审批列表权限');
-- 培训记录管理权限
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `remark`) VALUES
(2141, '培训记录查询', 2110, 19, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:record:query', '#', 1, NOW(), '培训记录查询权限'),
(2142, '培训记录新增', 2110, 20, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:record:add', '#', 1, NOW(), '培训记录新增权限'),
(2143, '培训记录修改', 2110, 21, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:record:edit', '#', 1, NOW(), '培训记录修改权限'),
(2144, '培训记录删除', 2110, 22, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:record:remove', '#', 1, NOW(), '培训记录删除权限'),
(2145, '培训记录导出', 2110, 23, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:record:export', '#', 1, NOW(), '培训记录导出权限'),
(2146, '培训记录列表', 2110, 24, '', NULL, NULL, 1, 0, 'F', '0', '0', 'rs:training:record:list', '#', 1, NOW(), '培训记录列表权限');
-- 为管理员角色赋予培训管理所有权限
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES
(1, 2111), (1, 2112), (1, 2113), (1, 2114), (1, 2115),
(1, 2121), (1, 2122), (1, 2123), (1, 2124), (1, 2125), (1, 2126),
(1, 2131), (1, 2132), (1, 2133), (1, 2134), (1, 2135), (1, 2136), (1, 2137),
(1, 2141), (1, 2142), (1, 2143), (1, 2144), (1, 2145), (1, 2146);
@@ -185,13 +185,51 @@ const data = reactive<PageData<AssessmentIndicatorTypeForm, AssessmentIndicatorT
const { queryParams, form, rules } = toRefs(data);
/** 搜索按钮操作 */
const handleQuery = () => {
console.log('🔍 搜索按钮点击,当前查询参数:', {
indicatorTypeCode: queryParams.value.indicatorTypeCode,
indicatorTypeName: queryParams.value.indicatorTypeName,
status: queryParams.value.status,
pageNum: queryParams.value.pageNum,
pageSize: queryParams.value.pageSize
});
queryParams.value.pageNum = 1;
getList();
};
/** 查询班主任考核指标类型列表 */
const getList = async () => {
loading.value = true;
const res = await listAssessmentIndicatorType(queryParams.value);
assessmentIndicatorTypeList.value = res.rows;
total.value = res.total;
loading.value = false;
// 构建查询参数,过滤掉undefined和null值
const queryData = {
pageNum: queryParams.value.pageNum,
pageSize: queryParams.value.pageSize,
...(queryParams.value.indicatorTypeCode && { indicatorTypeCode: queryParams.value.indicatorTypeCode }),
...(queryParams.value.indicatorTypeName && { indicatorTypeName: queryParams.value.indicatorTypeName }),
...(queryParams.value.status && { status: queryParams.value.status })
};
console.log('📋 发送查询请求,参数:', queryData);
try {
const res = await listAssessmentIndicatorType(queryData);
console.log('📊 查询结果:', {
total: res.total,
dataCount: res.rows?.length,
firstItem: res.rows?.[0]
});
assessmentIndicatorTypeList.value = res.rows;
total.value = res.total;
} catch (error) {
console.error('❌ 查询失败:', error);
proxy?.$modal.msgError('查询失败,请检查网络连接');
} finally {
loading.value = false;
}
};
/** 取消按钮 */
@@ -206,16 +244,28 @@ const reset = () => {
assessmentIndicatorTypeFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
console.log('🔄 重置查询参数');
// 重置表单字段
queryFormRef.value?.resetFields();
handleQuery();
// 手动重置查询参数对象
queryParams.value.indicatorTypeCode = undefined;
queryParams.value.indicatorTypeName = undefined;
queryParams.value.status = undefined;
queryParams.value.pageNum = 1;
console.log('🔄 重置后的查询参数:', {
indicatorTypeCode: queryParams.value.indicatorTypeCode,
indicatorTypeName: queryParams.value.indicatorTypeName,
status: queryParams.value.status,
pageNum: queryParams.value.pageNum
});
// 重新查询
getList();
};
/** 多选框选中数据 */
@@ -285,6 +335,15 @@ const handleDelete = async (row?: AssessmentIndicatorTypeVO) => {
};
onMounted(() => {
console.log('🚀 页面初始化,开始加载数据');
console.log('📋 初始查询参数:', {
indicatorTypeCode: queryParams.value.indicatorTypeCode,
indicatorTypeName: queryParams.value.indicatorTypeName,
status: queryParams.value.status,
pageNum: queryParams.value.pageNum,
pageSize: queryParams.value.pageSize
});
getList();
});
</script>
+83 -23
View File
@@ -75,7 +75,7 @@
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
<template #default="scope">
<!-- 审核通过状态:只显示查看考核按钮 -->
<template v-if="scope.row.auditStatus === '1'">
@@ -86,6 +86,7 @@
icon="View"
:disabled="loading || !isDataReady"
@click="handleViewAssessment(scope.row)"
v-hasPermi="['bzrkh:teacherAssessment:detail']"
></el-button>
</el-tooltip>
</template>
@@ -94,16 +95,17 @@
<!-- 未提交状态、草稿状态或审核不通过状态:显示提交考核按钮 -->
<template v-if="!scope.row.submitted || scope.row.auditStatus === '9' || scope.row.auditStatus === '2'">
<el-tooltip content="提交考核" placement="top">
<el-button
link
type="primary"
icon="Edit"
:disabled="loading || !isDataReady"
@click="handleSubmitAssessment(scope.row)"
></el-button>
<el-button
link
type="primary"
icon="Edit"
:disabled="loading || !isDataReady"
@click="handleSubmitAssessment(scope.row)"
v-hasPermi="['bzrkh:teacherAssessment:submit']"
></el-button>
</el-tooltip>
</template>
<!-- 待审核状态:显示查看考核按钮 -->
<!-- 待审核状态:显示查看考核和撤销按钮 -->
<template v-else-if="scope.row.auditStatus === '0'">
<el-tooltip content="查看考核" placement="top">
<el-button
@@ -112,6 +114,17 @@
icon="View"
:disabled="loading || !isDataReady"
@click="handleViewAssessment(scope.row)"
v-hasPermi="['bzrkh:teacherAssessment:detail']"
></el-button>
</el-tooltip>
<el-tooltip content="撤销考核" placement="top">
<el-button
link
type="warning"
icon="Close"
:disabled="loading || !isDataReady"
@click="handleWithdrawAssessment(scope.row)"
v-hasPermi="['bzrkh:teacherAssessment:withdraw']"
></el-button>
</el-tooltip>
</template>
@@ -149,7 +162,8 @@
</template>
<script setup name="TeacherAssessment" lang="ts">
import { computed, nextTick } from 'vue';
import { computed, nextTick, getCurrentInstance } from 'vue';
import type { FormInstance as ElFormInstance } from 'element-plus';
import {
listTeacherClasses,
listTeacherAssessmentPlans,
@@ -223,8 +237,17 @@ const getTeacherClasses = async () => {
if (teacherClasses.value.length > 0) {
// 默认选中第一个班级
activeTab.value = teacherClasses.value[0].id?.toString() || '';
// 设置查询参数中的班级ID
// 重置搜索条件并设置查询参数中的班级ID
queryParams.value.planName = undefined; // 确保搜索条件被重置
queryParams.value.pageNum = 1;
queryParams.value.classId = activeTab.value;
console.log('🔄 初始化完成:', {
activeTab: activeTab.value,
classId: queryParams.value.classId,
planName: queryParams.value.planName
});
// 等待activeTab设置完成后再获取列表
await nextTick();
await getList();
@@ -241,14 +264,16 @@ const getTeacherClasses = async () => {
const getList = async () => {
loading.value = true;
try {
console.log('📋 查询参数:', {
classId: queryParams.value.classId,
teacherId: userStore.userId,
planName: queryParams.value.planName,
planStatus: queryParams.value.planStatus
});
// 构建完整的查询参数
const queryData = {
...queryParams.value,
teacherId: userStore.userId, // 确保包含teacherId
planStatus: '1' // 确保包含planStatus
};
const res = await listTeacherAssessmentPlans(queryParams.value);
console.log('📋 查询参数:', queryData);
const res = await listTeacherAssessmentPlans(queryData);
console.log('📊 查询结果:', {
total: res.total,
dataCount: res.rows?.length,
@@ -270,16 +295,19 @@ const handleTabChange = async (tabName: string) => {
console.log('🔄 标签页值变化:', {
oldClassId: queryParams.value.classId,
newTabName: tabName,
activeTab: activeTab.value
activeTab: activeTab.value,
oldPlanName: queryParams.value.planName
});
// 重置分页和设置班级ID
// 重置分页和搜索条件,设置新的班级ID
queryParams.value.pageNum = 1;
queryParams.value.planName = undefined; // 重置搜索条件,避免标签页间共享
queryParams.value.classId = tabName;
console.log('🔄 参数设置完成:', {
classId: queryParams.value.classId,
activeTab: activeTab.value
activeTab: activeTab.value,
planName: queryParams.value.planName
});
// 等待参数设置完成后再查询
@@ -303,8 +331,40 @@ const handleQuery = () => {
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
console.log('🔄 开始重置查询参数');
try {
// 保存当前班级ID和计划状态(这些不应该被重置)
const currentClassId = queryParams.value.classId;
const currentPlanStatus = queryParams.value.planStatus;
// 手动重置查询参数到初始状态
queryParams.value.planName = undefined;
queryParams.value.pageNum = 1;
// 恢复不应该被重置的参数
queryParams.value.classId = currentClassId;
queryParams.value.planStatus = currentPlanStatus;
console.log('🔄 重置后的查询参数:', {
planName: queryParams.value.planName,
pageNum: queryParams.value.pageNum,
classId: queryParams.value.classId,
planStatus: queryParams.value.planStatus,
teacherId: userStore.userId
});
// 等待DOM更新完成后再刷新数据
nextTick(() => {
console.log('🔄 开始强制刷新数据');
// 强制刷新数据
getList();
});
} catch (error) {
console.error('❌ 重置查询参数时发生错误:', error);
// 即使出错也要尝试刷新数据
getList();
}
};
@@ -316,7 +316,7 @@
<template #footer>
<div class="dialog-footer">
<el-button :loading="saveLoading" type="primary" @click="handleSubmit">保存</el-button>
<el-button :loading="submitLoading" type="success" @click="handleSubmitForApproval">提交</el-button>
<el-button :loading="submitLoading" type="success" @click="handleSubmitForApproval" v-hasPermi="['bzrkh:teacherAssessment:submit']">提交</el-button>
<el-button @click="handleClose">取消</el-button>
</div>
</template>