|
|
@@ -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}`,
|