wuzhen update

This commit is contained in:
wuzhen committed 2025-09-01 14:58:40 +08:00
1 parent 2c51e0ec3b
commit 37383d837d
2 files changed
+40 -12

No files matched your search

@@ -134,6 +134,7 @@
<el-table-column label="申请类型" align="center" prop="applicationType" min-width="100">
<template #default="scope">
<el-tag v-if="scope.row.applicationType === 'RECOMMEND'" type="primary">教师推荐</el-tag>
<el-tag v-else-if="scope.row.applicationType === 'TEACHER_RECOMMEND'" type="primary">教师推荐</el-tag>
<el-tag v-else-if="scope.row.applicationType === 'STUDENT'" type="success">学生申请</el-tag>
<el-tag v-else-if="scope.row.applicationType === 'AUTO'" type="info">自动评定</el-tag>
<el-tag v-else-if="scope.row.applicationType === 'DIRECT'" type="warning">直接指定</el-tag>
@@ -311,7 +312,7 @@
<div class="flex-1">
<div class="student-basic-info flex items-center space-x-4 mb-2">
<span class="font-bold">{{ student.studentName }}</span>
<span class="text-gray-600">{{ student.studentNo }}</span>
<span class="text-gray-600">{{ student.studentCode }}</span>
<span class="text-gray-500">{{ student.gender }}</span>
<span class="text-gray-500">{{ student.phone }}</span>
</div>
@@ -963,7 +964,7 @@ const filterStudents = () => {
filteredStudents.value = classStudents.value;
} else {
filteredStudents.value = classStudents.value.filter(
(student: any) => student.studentName?.includes(studentKeyword.value) || student.studentNo?.includes(studentKeyword.value)
(student: any) => student.studentName?.includes(studentKeyword.value) || student.studentCode?.includes(studentKeyword.value)
);
}
};
@@ -989,7 +990,8 @@ const toggleStudentSelection = (student: any, checked: boolean) => {
if (availableScholarshipTypes.value.length === 1) {
const scholarshipType = availableScholarshipTypes.value[0];
if (canSelectScholarshipType(student, scholarshipType)) {
student.selectedScholarshipType = scholarshipType;
// ✅ 创建对象副本,避免引用问题
student.selectedScholarshipType = { ...scholarshipType };
updateScholarshipInfo(student);
console.log('🎯 自动选择唯一可用的奖学金类型:', scholarshipType.name);
} else {
@@ -1042,12 +1044,25 @@ const clearSelectedStudents = () => {
/** 更新奖学金信息 */
const updateScholarshipInfo = (student: any) => {
console.log('🔄 更新奖学金信息:', { studentName: student.studentName, selectedType: student.selectedScholarshipType?.name });
console.log('🔄 更新奖学金信息:', {
studentName: student.studentName,
selectedType: student.selectedScholarshipType?.name,
originalType: student.selectedScholarshipType
});
if (student.selectedScholarshipType) {
// ✅ 立即创建对象副本,确保 v-model 绑定的是副本而不是原始引用
student.selectedScholarshipType = { ...student.selectedScholarshipType };
// 使用副本更新相关字段
student.selectedLevel = student.selectedScholarshipType.levelType;
student.selectedAmount = student.selectedScholarshipType.amount;
console.log('✅ 创建奖学金类型副本:', {
copy: student.selectedScholarshipType,
name: student.selectedScholarshipType.name
});
// 检查名额是否足够
if (!canSelectScholarshipType(student, student.selectedScholarshipType)) {
ElMessage.warning(`${student.selectedScholarshipType.name} 名额不足,请选择其他类型`);
@@ -1120,7 +1135,7 @@ const submitBatchApplication = async () => {
const studentApplications = selectedStudents.value.map((s: any) => ({
studentId: String(s.studentId || s.id),
studentName: s.studentName,
studentNo: s.studentNo,
studentNo: s.studentCode, // ✅ 修复:使用后端返回的 studentCode 字段作为学号
scholarshipTypeId: s.selectedScholarshipType.id,
deptId: classInfo.value.deptId,
applicationReason: `班主任批量申请 - ${s.selectedScholarshipType.name}`,
@@ -114,6 +114,7 @@
<el-form-item label="申请类型" prop="applicationType">
<el-select v-model="queryParams.applicationType" placeholder="请选择申请类型" clearable style="width: 100%">
<el-option label="教师推荐" value="RECOMMEND" />
<el-option label="教师推荐" value="TEACHER_RECOMMEND" />
<el-option label="学生申请" value="STUDENT" />
<el-option label="自动评定" value="AUTO" />
<el-option label="直接指定" value="DIRECT" />
@@ -194,6 +195,7 @@
<template #default="scope">
<el-tag v-if="scope.row.applicationType === 'RECOMMEND'" type="primary">教师推荐</el-tag>
<el-tag v-else-if="scope.row.applicationType === 'STUDENT'" type="success">学生申请</el-tag>
<el-tag v-else-if="scope.row.applicationType === 'TEACHER_RECOMMEND'" type="primary">教师推荐</el-tag>
<el-tag v-else-if="scope.row.applicationType === 'AUTO'" type="info">自动评定</el-tag>
<el-tag v-else-if="scope.row.applicationType === 'DIRECT'" type="warning">直接指定</el-tag>
<el-tag v-else type="info">{{ scope.row.applicationType }}</el-tag>
@@ -684,14 +686,25 @@ function handleReview(row) {
console.log('🔍 [DEBUG] handleReview 开始执行');
console.log('🔍 [DEBUG] 传入的row数据:', JSON.stringify(row, null, 2));
reviewForm.value = {
id: row.id,
status: 'APPROVED',
reviewComment: ''
};
// 先获取完整的申请数据
getScholarshipApplication(row.id)
.then((response) => {
console.log('🔍 [DEBUG] 获取到完整申请数据:', response.data);
console.log('🔍 [DEBUG] 设置的reviewForm:', JSON.stringify(reviewForm.value, null, 2));
reviewOpen.value = true;
// 设置完整的审核表单数据
reviewForm.value = {
...response.data, // 包含所有申请信息
status: 'APPROVED', // 默认审核状态
reviewComment: '' // 审核意见
};
console.log('🔍 [DEBUG] 设置的完整reviewForm:', JSON.stringify(reviewForm.value, null, 2));
reviewOpen.value = true;
})
.catch((error) => {
console.error('❌ [ERROR] 获取申请详情失败:', error);
proxy.$modal.msgError('获取申请详情失败');
});
}
/** 查看详情 */