“rs/bzrhk测试修复0826版”
This commit is contained in:
1 parent
7c08e1b567
commit
d829eba17a
24 files changed
+307
-220
No files matched your search
+2
-2
@@ -155,8 +155,8 @@ public class TeacherAssessmentController extends BaseController {
|
||||
*/
|
||||
@SaCheckPermission("bzrkh:teacherAssessment:detail")
|
||||
@GetMapping("/classStudentRecords")
|
||||
public R<ClassStudentRecordsVo> getClassStudentRecords(@RequestParam Long classId) {
|
||||
ClassStudentRecordsVo records = teacherAssessmentService.queryClassStudentRecords(classId);
|
||||
public R<ClassStudentRecordsVo> getClassStudentRecords(@RequestParam Long classId, @RequestParam Long planId) {
|
||||
ClassStudentRecordsVo records = teacherAssessmentService.queryClassStudentRecords(classId, planId);
|
||||
return R.ok(records);
|
||||
}
|
||||
|
||||
|
||||
+19
-6
@@ -12,6 +12,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -137,18 +138,30 @@ public interface TeacherAssessmentMapper extends BaseMapperPlus<Object, Object>
|
||||
String selectClassNameById(@Param("classId") Long classId);
|
||||
|
||||
/**
|
||||
* 根据班级ID查询学生违纪记录
|
||||
* 根据班级ID和时间范围查询学生违纪记录
|
||||
*
|
||||
* @param classId 班级ID
|
||||
* @param classId 班级ID
|
||||
* @param startTime 数据提取开始时间
|
||||
* @param endTime 数据提取结束时间
|
||||
* @return 学生违纪记录列表
|
||||
*/
|
||||
List<StudentDisciplineRecordVo> selectStudentDisciplineRecordsByClassId(@Param("classId") Long classId);
|
||||
List<StudentDisciplineRecordVo> selectStudentDisciplineRecordsByClassIdAndTimeRange(@Param("classId") Long classId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
/**
|
||||
* 根据班级ID查询学生奖励记录
|
||||
* 根据班级ID和时间范围查询学生奖励记录
|
||||
*
|
||||
* @param classId 班级ID
|
||||
* @param classId 班级ID
|
||||
* @param startTime 数据提取开始时间
|
||||
* @param endTime 数据提取结束时间
|
||||
* @return 学生奖励记录列表
|
||||
*/
|
||||
List<StudentRewardRecordVo> selectStudentRewardRecordsByClassId(@Param("classId") Long classId);
|
||||
List<StudentRewardRecordVo> selectStudentRewardRecordsByClassIdAndTimeRange(@Param("classId") Long classId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
/**
|
||||
* 根据计划ID查询数据提取时间范围
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @return 包含数据提取开始和结束时间的Map,key为startTime和endTime
|
||||
*/
|
||||
BmzrAssessmentPlanVo selectDataExtractTimeByPlanId(@Param("planId") Long planId);
|
||||
}
|
||||
+2
-1
@@ -99,7 +99,8 @@ public interface ITeacherAssessmentService {
|
||||
* 查询班级学生违纪记录和奖励记录
|
||||
*
|
||||
* @param classId 班级ID
|
||||
* @param planId 考核计划ID
|
||||
* @return 班级学生记录
|
||||
*/
|
||||
ClassStudentRecordsVo queryClassStudentRecords(Long classId);
|
||||
ClassStudentRecordsVo queryClassStudentRecords(Long classId, Long planId);
|
||||
}
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class BmzrAssessmentIndicatorServiceImpl implements IBmzrAssessmentIndica
|
||||
private LambdaQueryWrapper<BmzrAssessmentIndicator> buildQueryWrapper(BmzrAssessmentIndicatorBo bo) {
|
||||
LambdaQueryWrapper<BmzrAssessmentIndicator> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIndicatorName()), BmzrAssessmentIndicator::getIndicatorName, bo.getIndicatorName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIndicatorCode()), BmzrAssessmentIndicator::getIndicatorCode, bo.getIndicatorCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIndicatorCode()), BmzrAssessmentIndicator::getIndicatorCode, bo.getIndicatorCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIndicatorType()), BmzrAssessmentIndicator::getIndicatorType, bo.getIndicatorType());
|
||||
lqw.eq(bo.getParentId() != null, BmzrAssessmentIndicator::getParentId, bo.getParentId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAllowSelfEvaluation()), BmzrAssessmentIndicator::getAllowSelfEvaluation, bo.getAllowSelfEvaluation());
|
||||
|
||||
+4
-4
@@ -97,10 +97,10 @@ public class BmzrAssessmentIndicatorTypeServiceImpl implements IBmzrAssessmentIn
|
||||
log.info("添加指标类型名称模糊查询条件: {}", bo.getIndicatorTypeName());
|
||||
}
|
||||
|
||||
// 指标类型编码精确查询
|
||||
// 指标类型编码模糊查询
|
||||
if (StringUtils.isNotBlank(bo.getIndicatorTypeCode())) {
|
||||
lqw.eq(BmzrAssessmentIndicatorType::getIndicatorTypeCode, bo.getIndicatorTypeCode());
|
||||
log.info("添加指标类型编码精确查询条件: {}", bo.getIndicatorTypeCode());
|
||||
lqw.like(BmzrAssessmentIndicatorType::getIndicatorTypeCode, bo.getIndicatorTypeCode());
|
||||
log.info("添加指标类型编码模糊查询条件: {}", bo.getIndicatorTypeCode());
|
||||
}
|
||||
|
||||
// 状态查询
|
||||
@@ -121,7 +121,7 @@ public class BmzrAssessmentIndicatorTypeServiceImpl implements IBmzrAssessmentIn
|
||||
// 禁用逻辑删除过滤器,查询包含已删除的记录
|
||||
lqw.in(BmzrAssessmentIndicatorType::getDeleted, 0, 1);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIndicatorTypeName()), BmzrAssessmentIndicatorType::getIndicatorTypeName, bo.getIndicatorTypeName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIndicatorTypeCode()), BmzrAssessmentIndicatorType::getIndicatorTypeCode, bo.getIndicatorTypeCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIndicatorTypeCode()), BmzrAssessmentIndicatorType::getIndicatorTypeCode, bo.getIndicatorTypeCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BmzrAssessmentIndicatorType::getStatus, bo.getStatus());
|
||||
lqw.orderByAsc(BmzrAssessmentIndicatorType::getCreateTime);
|
||||
return lqw;
|
||||
|
||||
+2
-2
@@ -75,8 +75,8 @@ public class BmzrAssessmentSchemeServiceImpl implements IBmzrAssessmentSchemeSer
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BmzrAssessmentScheme> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSchemeName()), BmzrAssessmentScheme::getSchemeName, bo.getSchemeName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSchemeCode()), BmzrAssessmentScheme::getSchemeCode, bo.getSchemeCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAcademicYear()), BmzrAssessmentScheme::getAcademicYear, bo.getAcademicYear());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSchemeCode()), BmzrAssessmentScheme::getSchemeCode, bo.getSchemeCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAcademicYear()), BmzrAssessmentScheme::getAcademicYear, bo.getAcademicYear());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSemester()), BmzrAssessmentScheme::getSemester, bo.getSemester());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSelfEvaluationRequired()), BmzrAssessmentScheme::getSelfEvaluationRequired, bo.getSelfEvaluationRequired());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSuperiorEvaluationRequired()), BmzrAssessmentScheme::getSuperiorEvaluationRequired, bo.getSuperiorEvaluationRequired());
|
||||
|
||||
+25
-5
@@ -665,18 +665,38 @@ public class TeacherAssessmentServiceImpl implements ITeacherAssessmentService {
|
||||
* 查询班级学生违纪记录和奖励记录
|
||||
*
|
||||
* @param classId 班级ID
|
||||
* @param planId 考核计划ID
|
||||
* @return 班级学生记录
|
||||
*/
|
||||
@Override
|
||||
public ClassStudentRecordsVo queryClassStudentRecords(Long classId) {
|
||||
public ClassStudentRecordsVo queryClassStudentRecords(Long classId, Long planId) {
|
||||
// 查询班级信息
|
||||
String className = teacherAssessmentMapper.selectClassNameById(classId);
|
||||
|
||||
// 查询班级学生违纪记录
|
||||
List<StudentDisciplineRecordVo> disciplineRecords = teacherAssessmentMapper.selectStudentDisciplineRecordsByClassId(classId);
|
||||
// 查询考核计划的数据提取时间范围
|
||||
BmzrAssessmentPlanVo plan = teacherAssessmentMapper.selectDataExtractTimeByPlanId(planId);
|
||||
if (plan == null) {
|
||||
throw new RuntimeException("考核计划不存在,计划ID:" + planId);
|
||||
}
|
||||
|
||||
// 查询班级学生奖励记录
|
||||
List<StudentRewardRecordVo> rewardRecords = teacherAssessmentMapper.selectStudentRewardRecordsByClassId(classId);
|
||||
Date startTime = plan.getDataExtractStartTime();
|
||||
Date endTime = plan.getDataExtractEndTime();
|
||||
|
||||
List<StudentDisciplineRecordVo> disciplineRecords = null;
|
||||
List<StudentRewardRecordVo> rewardRecords = null;
|
||||
|
||||
// 如果设置了数据提取时间范围,按时间范围查询;否则查询所有记录
|
||||
if (startTime != null && endTime != null) {
|
||||
// 查询指定时间范围内的班级学生违纪记录
|
||||
disciplineRecords = teacherAssessmentMapper.selectStudentDisciplineRecordsByClassIdAndTimeRange(classId, startTime, endTime);
|
||||
|
||||
// 查询指定时间范围内的班级学生奖励记录
|
||||
rewardRecords = teacherAssessmentMapper.selectStudentRewardRecordsByClassIdAndTimeRange(classId, startTime, endTime);
|
||||
} else {
|
||||
// 如果没有设置时间范围,查询所有记录(兼容旧数据)
|
||||
disciplineRecords = teacherAssessmentMapper.selectStudentDisciplineRecordsByClassIdAndTimeRange(classId, null, null);
|
||||
rewardRecords = teacherAssessmentMapper.selectStudentRewardRecordsByClassIdAndTimeRange(classId, null, null);
|
||||
}
|
||||
|
||||
// 构建返回对象
|
||||
ClassStudentRecordsVo result = new ClassStudentRecordsVo();
|
||||
|
||||
+24
-5
@@ -376,13 +376,13 @@
|
||||
<!-- 根据班级ID查询班级名称 -->
|
||||
<select id="selectClassNameById" resultType="java.lang.String">
|
||||
SELECT class_name
|
||||
FROM sys_class
|
||||
FROM xg_class_msg
|
||||
WHERE id = #{classId}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据班级ID查询学生违纪记录 -->
|
||||
<select id="selectStudentDisciplineRecordsByClassId" resultType="org.dromara.bzrkh.domain.vo.StudentDisciplineRecordVo">
|
||||
<!-- 根据班级ID和时间范围查询学生违纪记录 -->
|
||||
<select id="selectStudentDisciplineRecordsByClassIdAndTimeRange" resultType="org.dromara.bzrkh.domain.vo.StudentDisciplineRecordVo">
|
||||
SELECT
|
||||
id,
|
||||
student_id,
|
||||
@@ -410,11 +410,15 @@
|
||||
WHERE class_id = #{classId}
|
||||
AND deleted = 0
|
||||
AND status = '1'
|
||||
<if test="startTime != null and endTime != null">
|
||||
AND discipline_date >= #{startTime}
|
||||
AND discipline_date <= #{endTime}
|
||||
</if>
|
||||
ORDER BY discipline_date DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据班级ID查询学生奖励记录 -->
|
||||
<select id="selectStudentRewardRecordsByClassId" resultType="org.dromara.bzrkh.domain.vo.StudentRewardRecordVo">
|
||||
<!-- 根据班级ID和时间范围查询学生奖励记录 -->
|
||||
<select id="selectStudentRewardRecordsByClassIdAndTimeRange" resultType="org.dromara.bzrkh.domain.vo.StudentRewardRecordVo">
|
||||
SELECT
|
||||
id,
|
||||
student_id,
|
||||
@@ -441,7 +445,22 @@
|
||||
WHERE class_id = #{classId}
|
||||
AND deleted = 0
|
||||
AND status = '1'
|
||||
<if test="startTime != null and endTime != null">
|
||||
AND reward_date >= #{startTime}
|
||||
AND reward_date <= #{endTime}
|
||||
</if>
|
||||
ORDER BY reward_date DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据计划ID查询数据提取时间范围 -->
|
||||
<select id="selectDataExtractTimeByPlanId" resultType="org.dromara.bzrkh.domain.vo.BmzrAssessmentPlanVo">
|
||||
SELECT
|
||||
id,
|
||||
data_extract_start_time,
|
||||
data_extract_end_time
|
||||
FROM bmzr_assessment_plan
|
||||
WHERE id = #{planId}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+30
-1
@@ -26,8 +26,8 @@ import java.util.Map;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.rs.service.impl.RsTrainingRecordServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 培训记录控制器
|
||||
@@ -35,6 +35,7 @@ import org.dromara.rs.service.impl.RsTrainingRecordServiceImpl;
|
||||
* @author weizzzz
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/rs/training/record")
|
||||
public class RsTrainingRecordController extends BaseController {
|
||||
@@ -51,6 +52,34 @@ public class RsTrainingRecordController extends BaseController {
|
||||
return trainingRecordService.selectPageRsTrainingRecordList(record, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试培训地点搜索功能
|
||||
*/
|
||||
@SaCheckPermission("rs:trainingrecord:list")
|
||||
@GetMapping("/test-location")
|
||||
public R<List<RsTrainingRecord>> testLocationSearch(@RequestParam String location) {
|
||||
log.info("测试培训地点搜索 - location参数: {}", location);
|
||||
|
||||
// 创建查询对象
|
||||
RsTrainingRecord record = new RsTrainingRecord();
|
||||
record.setLocation(location);
|
||||
|
||||
log.info("创建的查询对象 - location: {}", record.getLocation());
|
||||
|
||||
// 直接调用Mapper方法
|
||||
List<RsTrainingRecord> list = trainingRecordService.selectRsTrainingRecordList(record);
|
||||
|
||||
log.info("查询结果数量: {}", list.size());
|
||||
if (!list.isEmpty()) {
|
||||
log.info("前3条记录的location值:");
|
||||
list.stream().limit(3).forEach(r ->
|
||||
log.info(" - recordId: {}, location: {}", r.getRecordId(), r.getLocation())
|
||||
);
|
||||
}
|
||||
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出培训记录列表
|
||||
*/
|
||||
|
||||
+18
@@ -63,6 +63,11 @@ public class RsTrainingRecordServiceImpl implements IRsTrainingRecordService, Ap
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<RsTrainingRecord> selectPageRsTrainingRecordList(RsTrainingRecord record, PageQuery pageQuery) {
|
||||
// ===== 调试日志:检查location参数 =====
|
||||
log.info("培训记录查询参数 - location: {}", record.getLocation());
|
||||
log.info("培训记录查询参数 - courseName: {}", record.getCourseName());
|
||||
log.info("培训记录查询参数 - department: {}", record.getDepartment());
|
||||
|
||||
// ===== 业务逻辑层权限过滤 =====
|
||||
// 根据用户角色进行数据权限过滤
|
||||
if (!LoginHelper.isSuperAdmin()) {
|
||||
@@ -85,9 +90,22 @@ public class RsTrainingRecordServiceImpl implements IRsTrainingRecordService, Ap
|
||||
}
|
||||
}
|
||||
|
||||
// ===== 调试日志:检查权限过滤后的参数 =====
|
||||
log.info("权限过滤后 - location: {}", record.getLocation());
|
||||
log.info("权限过滤后 - userId: {}", record.getUserId());
|
||||
|
||||
// 使用手动分页方式,参考培训申请的实现
|
||||
List<RsTrainingRecord> allList = trainingRecordMapper.selectRsTrainingRecordList(record);
|
||||
|
||||
// ===== 调试日志:检查查询结果 =====
|
||||
log.info("查询结果总数: {}", allList.size());
|
||||
if (!allList.isEmpty() && record.getLocation() != null && !record.getLocation().isEmpty()) {
|
||||
long matchCount = allList.stream()
|
||||
.filter(r -> r.getLocation() != null && r.getLocation().contains(record.getLocation()))
|
||||
.count();
|
||||
log.info("包含location[{}]的记录数: {}", record.getLocation(), matchCount);
|
||||
}
|
||||
|
||||
// 创建分页对象
|
||||
Page<RsTrainingRecord> page = pageQuery.build();
|
||||
long current = page.getCurrent();
|
||||
|
||||
@@ -60,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="completionStatus != null and completionStatus != ''">and r.completion_status = #{completionStatus}</if>
|
||||
<if test="status != null and status != ''">and r.status = #{status}</if>
|
||||
<if test="department != null and department != ''">and r.department like concat('%', #{department}, '%')</if>
|
||||
<if test="location != null and location != ''">and r.location like concat('%', #{location}, '%')</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''">and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')</if>
|
||||
<if test="params.endTime != null and params.endTime != ''">and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')</if>
|
||||
</where>
|
||||
|
||||
@@ -98,12 +98,13 @@ export const submitAssessmentScore = (data: AssessmentSubmitVO): AxiosPromise<vo
|
||||
/**
|
||||
* 查询班级学生违纪记录和奖励记录
|
||||
* @param classId 班级ID
|
||||
* @param planId 考核计划ID
|
||||
*/
|
||||
export const getClassStudentRecords = (classId: string | number): AxiosPromise<any> => {
|
||||
export const getClassStudentRecords = (classId: string | number, planId: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/bzrkh/teacherAssessment/classStudentRecords',
|
||||
method: 'get',
|
||||
params: { classId }
|
||||
params: { classId, planId }
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划名称" prop="planName">
|
||||
<el-input v-model="queryParams.planName" placeholder="请输入计划名称" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.planName" placeholder="请输入计划名称(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -31,12 +31,12 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班级名称" prop="className">
|
||||
<el-input v-model="queryParams.className" placeholder="请输入班级名称" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.className" placeholder="请输入班级名称(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班主任姓名" prop="teacherName">
|
||||
<el-input v-model="queryParams.teacherName" placeholder="请输入班主任姓名" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.teacherName" placeholder="请输入班主任姓名(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -71,7 +71,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="班级名称" align="center" prop="className" min-width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="班主任姓名" align="center" prop="evaluatedUserName" min-width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="班主任姓名" align="center" prop="teacherName" min-width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="申请时间" align="center" min-width="180" sortable="custom" prop="submitTime">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.submitTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="指标编码" prop="indicatorCode">
|
||||
<el-input v-model="queryParams.indicatorCode" placeholder="请输入指标编码" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.indicatorCode" placeholder="请输入指标编码(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="指标类型编码" prop="indicatorTypeCode">
|
||||
<el-input v-model="queryParams.indicatorTypeCode" placeholder="请输入指标类型编码" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.indicatorTypeCode" placeholder="请输入指标类型编码(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="指标类型名称" prop="indicatorTypeName">
|
||||
<el-input v-model="queryParams.indicatorTypeName" placeholder="请输入指标类型名称" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.indicatorTypeName" placeholder="请输入指标类型名称(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -203,16 +203,22 @@ const handleQuery = () => {
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
|
||||
// 构建查询参数,过滤掉undefined和null值
|
||||
// 构建查询参数,正确处理空字符串和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 })
|
||||
// 修复:正确处理空字符串,只过滤undefined和null
|
||||
...(queryParams.value.indicatorTypeCode !== undefined && queryParams.value.indicatorTypeCode !== null && { indicatorTypeCode: queryParams.value.indicatorTypeCode }),
|
||||
...(queryParams.value.indicatorTypeName !== undefined && queryParams.value.indicatorTypeName !== null && { indicatorTypeName: queryParams.value.indicatorTypeName }),
|
||||
...(queryParams.value.status !== undefined && queryParams.value.status !== null && { status: queryParams.value.status })
|
||||
};
|
||||
|
||||
console.log('📋 发送查询请求,参数:', queryData);
|
||||
console.log('🔍 原始查询参数:', {
|
||||
indicatorTypeCode: `"${queryParams.value.indicatorTypeCode}"`,
|
||||
indicatorTypeName: `"${queryParams.value.indicatorTypeName}"`,
|
||||
status: `"${queryParams.value.status}"`
|
||||
});
|
||||
|
||||
try {
|
||||
const res = await listAssessmentIndicatorType(queryData);
|
||||
@@ -251,7 +257,7 @@ const resetQuery = () => {
|
||||
// 重置表单字段
|
||||
queryFormRef.value?.resetFields();
|
||||
|
||||
// 手动重置查询参数对象
|
||||
// 手动重置查询参数对象,确保清空所有搜索条件
|
||||
queryParams.value.indicatorTypeCode = undefined;
|
||||
queryParams.value.indicatorTypeName = undefined;
|
||||
queryParams.value.status = undefined;
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学年" prop="academicYear">
|
||||
<el-input v-model="queryParams.academicYear" placeholder="请输入学年" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学期" prop="semester">
|
||||
<el-select v-model="queryParams.semester" placeholder="请选择学期" clearable style="width: 100%">
|
||||
@@ -44,22 +39,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 100%"
|
||||
@change="handleQuery"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
@@ -312,7 +291,6 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const schemeOptions = ref<BmzrAssessmentSchemeVO[]>([]);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
@@ -347,7 +325,6 @@ const data = reactive<PageData<AssessmentPlanForm, AssessmentPlanQuery>>({
|
||||
planName: undefined,
|
||||
planCode: undefined,
|
||||
schemeId: undefined,
|
||||
academicYear: undefined,
|
||||
semester: undefined,
|
||||
planStatus: undefined,
|
||||
params: {}
|
||||
@@ -370,11 +347,6 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询考核计划列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
queryParams.value.params = {};
|
||||
if (dateRange.value && dateRange.value.length === 2 && dateRange.value[0] && dateRange.value[1]) {
|
||||
queryParams.value.params['beginCreateTime'] = dateRange.value[0] as string;
|
||||
queryParams.value.params['endCreateTime'] = dateRange.value[1] as string;
|
||||
}
|
||||
const res = await listAssessmentPlan(queryParams.value);
|
||||
assessmentPlanList.value = res.rows;
|
||||
total.value = res.total;
|
||||
@@ -411,7 +383,6 @@ const handleQuery = () => {
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
dateRange.value = ['', ''];
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="方案编码" prop="schemeCode">
|
||||
<el-input v-model="queryParams.schemeCode" placeholder="请输入方案编码" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.schemeCode" placeholder="请输入方案编码(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学年" prop="academicYear">
|
||||
<el-input v-model="queryParams.academicYear" placeholder="请输入学年" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.academicYear" placeholder="请输入学年(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- Tab切换 -->
|
||||
<el-tabs type="border-card" style="margin-top: 16px">
|
||||
<el-tabs v-model="studentRecordsActiveTab" type="border-card" style="margin-top: 16px">
|
||||
<!-- 违纪记录Tab -->
|
||||
<el-tab-pane label="违纪记录" name="discipline">
|
||||
<el-table :data="studentRecordsData?.disciplineRecords || []" border style="width: 100%" max-height="400" empty-text="暂无违纪记录">
|
||||
@@ -464,6 +464,7 @@ const monthlyScoreForm = reactive({
|
||||
const studentRecordsVisible = ref(false);
|
||||
const studentRecordsLoading = ref(false);
|
||||
const studentRecordsData = ref<ClassStudentRecordsVO>();
|
||||
const studentRecordsActiveTab = ref('discipline'); // 默认激活违纪记录标签页
|
||||
|
||||
const dialogTitle = computed(() => {
|
||||
const className = assessmentDetail.value?.classDetail?.className || '';
|
||||
@@ -654,14 +655,17 @@ const loadAssessmentDetail = async () => {
|
||||
|
||||
/** 查看学生违规处分信息 */
|
||||
const handleViewStudentViolations = async () => {
|
||||
if (!props.classId) {
|
||||
proxy?.$modal.msgError('缺少班级ID参数');
|
||||
if (!props.classId || !props.planId) {
|
||||
proxy?.$modal.msgError('缺少必要参数(班级ID或计划ID)');
|
||||
return;
|
||||
}
|
||||
|
||||
// 重置为默认激活的违纪记录标签页
|
||||
studentRecordsActiveTab.value = 'discipline';
|
||||
|
||||
studentRecordsLoading.value = true;
|
||||
try {
|
||||
const res = await getClassStudentRecords(props.classId);
|
||||
const res = await getClassStudentRecords(props.classId, props.planId);
|
||||
studentRecordsData.value = res.data;
|
||||
studentRecordsVisible.value = true;
|
||||
} catch (error) {
|
||||
|
||||
@@ -362,7 +362,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- Tab切换 -->
|
||||
<el-tabs type="border-card" style="margin-top: 16px">
|
||||
<el-tabs v-model="studentRecordsActiveTab" type="border-card" style="margin-top: 16px">
|
||||
<!-- 违纪记录Tab -->
|
||||
<el-tab-pane label="违纪记录" name="discipline">
|
||||
<el-table :data="studentRecordsData?.disciplineRecords || []" border style="width: 100%" max-height="400" empty-text="暂无违纪记录">
|
||||
@@ -571,6 +571,7 @@ const specialWorkForm = reactive({
|
||||
const studentRecordsVisible = ref(false);
|
||||
const studentRecordsLoading = ref(false);
|
||||
const studentRecordsData = ref<ClassStudentRecordsVO>();
|
||||
const studentRecordsActiveTab = ref('discipline'); // 默认激活违纪记录标签页
|
||||
|
||||
const dialogTitle = computed(() => {
|
||||
const className = getCurrentClassDetail()?.className || '';
|
||||
@@ -992,14 +993,17 @@ const loadAssessmentDetail = async () => {
|
||||
|
||||
/** 查看学生违规处分信息 */
|
||||
const handleViewStudentViolations = async () => {
|
||||
if (!props.classId) {
|
||||
proxy?.$modal.msgError('缺少班级ID参数');
|
||||
if (!props.classId || !props.planId) {
|
||||
proxy?.$modal.msgError('缺少必要参数(班级ID或计划ID)');
|
||||
return;
|
||||
}
|
||||
|
||||
// 重置为默认激活的违纪记录标签页
|
||||
studentRecordsActiveTab.value = 'discipline';
|
||||
|
||||
studentRecordsLoading.value = true;
|
||||
try {
|
||||
const res = await getClassStudentRecords(props.classId);
|
||||
const res = await getClassStudentRecords(props.classId, props.planId);
|
||||
studentRecordsData.value = res.data;
|
||||
studentRecordsVisible.value = true;
|
||||
} catch (error) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<el-card class="box-card">
|
||||
<!-- 审批管理选项卡 -->
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-click="handleTabClick">
|
||||
<!-- 待审批申请 -->
|
||||
<el-tab-pane label="待审批申请" name="pending">
|
||||
<!-- 出国审批 -->
|
||||
<el-tab-pane label="出国审批" name="pending">
|
||||
<div class="tab-content">
|
||||
<!-- 搜索区域 -->
|
||||
<transition :enter-active-class="animate.searchAnimate.enter" :leave-active-class="animate.searchAnimate.leave">
|
||||
@@ -42,20 +42,6 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="出国时间">
|
||||
<el-date-picker
|
||||
v-model="pendingDateRange"
|
||||
style="width: 100%"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
@change="handlePendingDateRangeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -185,20 +171,6 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="审批时间">
|
||||
<el-date-picker
|
||||
v-model="recordDateRange"
|
||||
style="width: 100%"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
@change="handleRecordDateRangeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -228,9 +200,9 @@
|
||||
<!-- 审批记录表格 -->
|
||||
<el-table v-loading="recordLoading" border :data="recordList" @row-dblclick="handleViewRecord" v-hasPermi="['rs:overseas:list']">
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属部门" align="center" prop="department" width="140" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="出国目的" align="center" prop="purposeText" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="目的地" align="center" prop="destination" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属部门" align="center" prop="department" width="140" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="出国时间" align="center" min-width="220" :show-overflow-tooltip="true">
|
||||
<template #default="scope"> {{ formatDate(scope.row.startDate) }} 至 {{ formatDate(scope.row.endDate) }} </template>
|
||||
</el-table-column>
|
||||
@@ -246,15 +218,7 @@
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleViewRecord(scope.row)" v-hasPermi="['rs:overseas:query']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="查看审批历史" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="info"
|
||||
icon="List"
|
||||
@click.stop="handleViewApprovalHistory(scope.row)"
|
||||
v-hasPermi="['rs:overseas:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<!-- 查看审批历史按钮已隐藏 -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -435,16 +399,13 @@ const state = reactive({
|
||||
pendingList: [] as OverseasApplicationVO[],
|
||||
pendingTotal: 0,
|
||||
showPendingSearch: true,
|
||||
pendingDateRange: [] as string[],
|
||||
pendingQueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applicantName: '',
|
||||
department: '',
|
||||
destination: '',
|
||||
status: '0', // 只查询待审核状态
|
||||
startDateBegin: '',
|
||||
startDateEnd: ''
|
||||
status: '0' // 只查询待审核状态
|
||||
} as OverseasApplicationQuery,
|
||||
|
||||
// 审批记录列表相关
|
||||
@@ -452,7 +413,6 @@ const state = reactive({
|
||||
recordList: [] as OverseasApprovalVO[],
|
||||
recordTotal: 0,
|
||||
showRecordSearch: true,
|
||||
recordDateRange: [] as string[],
|
||||
recordQueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -461,9 +421,7 @@ const state = reactive({
|
||||
approvalStatus: '',
|
||||
applicantName: '',
|
||||
department: '',
|
||||
destination: '',
|
||||
approvalTimeBegin: '',
|
||||
approvalTimeEnd: ''
|
||||
destination: ''
|
||||
} as OverseasApprovalQuery,
|
||||
|
||||
// 查看详情
|
||||
@@ -520,13 +478,11 @@ const {
|
||||
pendingList,
|
||||
pendingTotal,
|
||||
showPendingSearch,
|
||||
pendingDateRange,
|
||||
pendingQueryParams,
|
||||
recordLoading,
|
||||
recordList,
|
||||
recordTotal,
|
||||
showRecordSearch,
|
||||
recordDateRange,
|
||||
recordQueryParams,
|
||||
viewDialog,
|
||||
viewData,
|
||||
@@ -631,28 +587,54 @@ const handleRecordQuery = () => {
|
||||
|
||||
// 重置搜索
|
||||
const resetPendingQuery = () => {
|
||||
proxy.resetForm('pendingQueryForm');
|
||||
state.pendingDateRange = [];
|
||||
state.pendingQueryParams.status = '0'; // 保持查询待审核状态
|
||||
handlePendingQuery();
|
||||
try {
|
||||
// 重置查询参数
|
||||
Object.assign(state.pendingQueryParams, {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applicantName: '',
|
||||
department: '',
|
||||
destination: '',
|
||||
status: '0' // 保持查询待审核状态
|
||||
});
|
||||
// 重置表单字段
|
||||
const form = proxy.$refs.pendingQueryForm;
|
||||
if (form && typeof form.resetFields === 'function') {
|
||||
form.resetFields();
|
||||
}
|
||||
handlePendingQuery();
|
||||
} catch (error) {
|
||||
console.error('重置查询条件时发生错误:', error);
|
||||
handlePendingQuery();
|
||||
}
|
||||
};
|
||||
|
||||
const resetRecordQuery = () => {
|
||||
proxy.resetForm('recordQueryForm');
|
||||
handleRecordQuery();
|
||||
};
|
||||
|
||||
// 处理日期范围变化
|
||||
const handlePendingDateRangeChange = (dates: string[] | null) => {
|
||||
if (dates && dates.length === 2) {
|
||||
state.pendingQueryParams.startDateBegin = dates[0];
|
||||
state.pendingQueryParams.startDateEnd = dates[1];
|
||||
} else {
|
||||
state.pendingQueryParams.startDateBegin = '';
|
||||
state.pendingQueryParams.startDateEnd = '';
|
||||
try {
|
||||
// 重置查询参数
|
||||
Object.assign(state.recordQueryParams, {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applicationId: undefined,
|
||||
approvalLevel: '',
|
||||
approvalStatus: '',
|
||||
applicantName: '',
|
||||
department: '',
|
||||
destination: ''
|
||||
});
|
||||
// 重置表单字段
|
||||
const form = proxy.$refs.recordQueryForm;
|
||||
if (form && typeof form.resetFields === 'function') {
|
||||
form.resetFields();
|
||||
}
|
||||
handleRecordQuery();
|
||||
} catch (error) {
|
||||
console.error('重置查询条件时发生错误:', error);
|
||||
handleRecordQuery();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 查看申请详情
|
||||
const handleViewApplication = async (row: OverseasApplicationVO) => {
|
||||
try {
|
||||
@@ -840,16 +822,7 @@ const getApprovalStatusTagType = (status: string): 'success' | 'warning' | 'dang
|
||||
return typeMap[status] || 'info';
|
||||
};
|
||||
|
||||
// 审批记录日期范围变化处理
|
||||
const handleRecordDateRangeChange = (dates: [string, string] | null) => {
|
||||
if (dates && dates.length === 2) {
|
||||
state.recordQueryParams.approvalTimeBegin = dates[0];
|
||||
state.recordQueryParams.approvalTimeEnd = dates[1];
|
||||
} else {
|
||||
state.recordQueryParams.approvalTimeBegin = '';
|
||||
state.recordQueryParams.approvalTimeEnd = '';
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -31,19 +31,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="申请时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 100%"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="handleDateRangeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -483,6 +471,8 @@ const userStore = useUserStore();
|
||||
|
||||
// 表单引用
|
||||
const applicationFormRef = ref<any>(null);
|
||||
const applicationQueryForm = ref<any>(null);
|
||||
const recordQueryForm = ref<any>(null);
|
||||
|
||||
const state = reactive({
|
||||
// 选项卡相关
|
||||
@@ -498,9 +488,7 @@ const state = reactive({
|
||||
pageSize: 10,
|
||||
destination: '',
|
||||
status: '',
|
||||
purpose: '',
|
||||
applyTimeBegin: '',
|
||||
applyTimeEnd: ''
|
||||
purpose: ''
|
||||
} as OverseasApplicationQuery,
|
||||
|
||||
// 记录列表相关
|
||||
@@ -555,8 +543,7 @@ const state = reactive({
|
||||
status: '0'
|
||||
},
|
||||
|
||||
// 时间范围
|
||||
dateRange: [],
|
||||
|
||||
|
||||
// 字典数据
|
||||
statusOptions: [
|
||||
@@ -603,7 +590,6 @@ const {
|
||||
approvalHistoryLoading,
|
||||
approvalHistoryList,
|
||||
currentApplication,
|
||||
dateRange,
|
||||
statusOptions,
|
||||
purposeOptions,
|
||||
completionStatusOptions
|
||||
@@ -706,30 +692,38 @@ const handleRecordQuery = () => {
|
||||
getRecordList();
|
||||
};
|
||||
|
||||
// 重置搜索
|
||||
// 重置搜索(参考培训审批的正确实现)
|
||||
const resetApplicationQuery = () => {
|
||||
proxy.resetForm('applicationQueryForm');
|
||||
state.dateRange = [];
|
||||
state.applicationQueryParams.applyTimeBegin = '';
|
||||
state.applicationQueryParams.applyTimeEnd = '';
|
||||
handleApplicationQuery();
|
||||
// 重置表单字段显示
|
||||
applicationQueryForm.value?.resetFields();
|
||||
// 重置查询参数
|
||||
Object.assign(state.applicationQueryParams, {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
destination: '',
|
||||
status: '',
|
||||
purpose: '',
|
||||
params: {}
|
||||
});
|
||||
getApplicationList();
|
||||
};
|
||||
|
||||
const resetRecordQuery = () => {
|
||||
proxy.resetForm('recordQueryForm');
|
||||
handleRecordQuery();
|
||||
// 重置表单字段显示
|
||||
recordQueryForm.value?.resetFields();
|
||||
// 重置查询参数
|
||||
Object.assign(state.recordQueryParams, {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applicantName: '',
|
||||
destination: '',
|
||||
completionStatus: '',
|
||||
params: {}
|
||||
});
|
||||
getRecordList();
|
||||
};
|
||||
|
||||
// 时间范围改变
|
||||
const handleDateRangeChange = (dates: any) => {
|
||||
if (dates && dates.length === 2) {
|
||||
state.applicationQueryParams.applyTimeBegin = dates[0];
|
||||
state.applicationQueryParams.applyTimeEnd = dates[1];
|
||||
} else {
|
||||
state.applicationQueryParams.applyTimeBegin = '';
|
||||
state.applicationQueryParams.applyTimeEnd = '';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 新增申请
|
||||
const handleAddApplication = () => {
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="审批时间">
|
||||
<el-form-item label="审批时间" prop="dateRange">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
v-model="queryParams.dateRange"
|
||||
style="width: 100%"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
@@ -369,6 +369,11 @@ const { rs_approval_status, rs_approval_level, rs_overseas_purpose } = proxy.use
|
||||
// 选项卡相关
|
||||
const activeTab = ref('approval');
|
||||
|
||||
// 表单ref
|
||||
const queryFormRef = ref();
|
||||
const recordQueryForm = ref();
|
||||
const approvalRef = ref();
|
||||
|
||||
// 出国审批相关
|
||||
const approvalList = ref([]);
|
||||
const open = ref(false);
|
||||
@@ -381,7 +386,6 @@ const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref('');
|
||||
const detailData = ref({});
|
||||
const dateRange = ref([]);
|
||||
|
||||
// 审批记录相关
|
||||
const recordList = ref([]);
|
||||
@@ -404,7 +408,8 @@ const data = reactive({
|
||||
approvalTimeBegin: null,
|
||||
approvalTimeEnd: null,
|
||||
applicantName: null, // 申请人姓名搜索
|
||||
purpose: null // 出国目的搜索
|
||||
purpose: null, // 出国目的搜索
|
||||
dateRange: [] // 日期范围
|
||||
},
|
||||
recordQueryParams: {
|
||||
pageNum: 1,
|
||||
@@ -505,11 +510,32 @@ function handleQuery() {
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
queryParams.value.approvalTimeBegin = null;
|
||||
queryParams.value.approvalTimeEnd = null;
|
||||
proxy.resetForm('queryFormRef');
|
||||
try {
|
||||
// 先手动清空查询参数
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applicationId: null,
|
||||
approverId: null,
|
||||
approverName: null,
|
||||
approvalLevel: null,
|
||||
approvalStatus: null,
|
||||
approvalTimeBegin: null,
|
||||
approvalTimeEnd: null,
|
||||
applicantName: null,
|
||||
purpose: null,
|
||||
dateRange: []
|
||||
};
|
||||
// 再重置表单
|
||||
if (queryFormRef.value && typeof queryFormRef.value.resetFields === 'function') {
|
||||
queryFormRef.value.resetFields();
|
||||
}
|
||||
handleQuery();
|
||||
} catch (error) {
|
||||
console.error('重置查询条件时发生错误:', error);
|
||||
// 即使出错也要重新查询
|
||||
handleQuery();
|
||||
}
|
||||
}
|
||||
|
||||
/** 审批记录搜索按钮操作 */
|
||||
@@ -520,8 +546,27 @@ function handleRecordQuery() {
|
||||
|
||||
/** 审批记录重置按钮操作 */
|
||||
function resetRecordQuery() {
|
||||
proxy.resetForm('recordQueryForm');
|
||||
try {
|
||||
// 先手动清空查询参数
|
||||
recordQueryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applicantName: null,
|
||||
approverName: null,
|
||||
approvalStatus: null,
|
||||
approvalTimeBegin: null,
|
||||
approvalTimeEnd: null
|
||||
};
|
||||
// 再重置表单
|
||||
if (recordQueryForm.value && typeof recordQueryForm.value.resetFields === 'function') {
|
||||
recordQueryForm.value.resetFields();
|
||||
}
|
||||
handleRecordQuery();
|
||||
} catch (error) {
|
||||
console.error('重置查询条件时发生错误:', error);
|
||||
// 即使出错也要重新查询
|
||||
handleRecordQuery();
|
||||
}
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
@@ -542,7 +587,7 @@ function reset() {
|
||||
approvalOpinion: null,
|
||||
approvalTime: null
|
||||
};
|
||||
proxy.resetForm('approvalRef');
|
||||
approvalRef.value?.resetFields();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
@@ -596,7 +641,7 @@ function handleViewRecord(row) {
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs['approvalRef'].validate((valid) => {
|
||||
approvalRef.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.approvalId != null) {
|
||||
updateOverseasApproval(form.value).then((response) => {
|
||||
|
||||
@@ -994,6 +994,7 @@ const showRecordSearch = ref(true);
|
||||
courseName: '',
|
||||
userId: undefined as string | number | undefined,
|
||||
userName: '',
|
||||
location: '',
|
||||
department: '',
|
||||
completionStatus: '',
|
||||
includeApprovedApplications: true, // 包含已通过审批的申请数据
|
||||
|
||||
@@ -147,14 +147,6 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审批结果" prop="status">
|
||||
<el-select v-model="approvalRecordQueryParams.status" placeholder="请选择审批结果" clearable style="width: 100%">
|
||||
<el-option label="已通过" value="1" />
|
||||
<el-option label="已拒绝" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -206,14 +198,11 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批意见" align="center" prop="opinion" :show-overflow-tooltip="true" min-width="150" />
|
||||
<el-table-column label="操作" align="center" width="160">
|
||||
<el-table-column label="操作" align="center" width="80">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleViewApprovalRecord(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="查看审批历史" placement="top">
|
||||
<el-button link type="info" icon="List" @click.stop="handleViewApprovalHistory(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -600,7 +589,6 @@ const approvalRecordQueryParams = reactive({
|
||||
pageSize: 10,
|
||||
courseName: '',
|
||||
userName: '',
|
||||
status: '',
|
||||
includeApprovedApplications: true, // 包含已通过审批的申请数据
|
||||
params: {}
|
||||
});
|
||||
@@ -794,7 +782,7 @@ const getApprovalRecordList = async () => {
|
||||
// 获取所有审批记录(不限于当前用户审批过的)
|
||||
const queryParams = {
|
||||
...approvalRecordQueryParams,
|
||||
status: approvalRecordQueryParams.status || '1,2', // 默认获取已通过和已拒绝的记录
|
||||
status: '1,2', // 获取已通过和已拒绝的记录
|
||||
includeApprovedApplications: true // 确保包含已通过状态的培训申请数据
|
||||
};
|
||||
const response = await listAllApprovalRecords(queryParams);
|
||||
@@ -823,7 +811,6 @@ const resetApprovalRecordQuery = () => {
|
||||
pageSize: 10,
|
||||
courseName: '',
|
||||
userName: '',
|
||||
status: '',
|
||||
includeApprovedApplications: true, // 保持包含已通过审批的申请数据
|
||||
params: {}
|
||||
});
|
||||
@@ -874,7 +861,7 @@ const handleExportApprovalRecord = async () => {
|
||||
try {
|
||||
const queryParams = {
|
||||
...approvalRecordQueryParams,
|
||||
status: approvalRecordQueryParams.status || '1,2', // 默认导出已通过和已拒绝的记录
|
||||
status: '1,2', // 导出已通过和已拒绝的记录
|
||||
includeApprovedApplications: true // 确保包含已通过状态的培训申请数据
|
||||
};
|
||||
const response = await exportApprovalRecord(queryParams);
|
||||
|
||||
Reference in new issue
Block a user