提交代码
This commit is contained in:
1 parent
bf25ceba66
commit
55457496b7
7 files changed
+1494
-167
No files matched your search
@@ -80,6 +80,18 @@ export const getStudentOptions = (
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询单人留宿有效数据
|
||||
* 获取所有有效的假期留宿数据,筛选出在同一时间段内该宿舍只有一个学生留宿的记录
|
||||
* @returns 单人留宿有效数据列表
|
||||
*/
|
||||
export const getSinglePersonValidStay = (): AxiosPromise<HolidayStayVO[]> => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/singlePersonValidStay',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取校区选项列表
|
||||
* @returns 校区选项列表
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -723,7 +723,7 @@ const data = reactive<PageData<HolidayStayForm, HolidayStayQuery>>({
|
||||
extField1: undefined,
|
||||
extField2: undefined,
|
||||
extField3: undefined,
|
||||
status: undefined,
|
||||
status: 'valid', // 默认显示有效状态的记录
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
@@ -769,7 +769,7 @@ const getList = async () => {
|
||||
const requestParams = { ...queryParams.value };
|
||||
|
||||
// 添加创建人过滤条件 - 班主任只能看到自己创建的数据
|
||||
requestParams.createBy = userStore.userId;
|
||||
(requestParams as any).createBy = userStore.userId;
|
||||
|
||||
// 根据状态设置时间过滤条件
|
||||
if (requestParams.status) {
|
||||
@@ -855,6 +855,44 @@ const handleUpdate = async (row?: HolidayStayVO) => {
|
||||
const res = await getHolidayStay(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
|
||||
// 确保当前学生信息在选项中(修复学生选择器显示问题)
|
||||
if (form.value.studentId && form.value.studentName && form.value.studentNo) {
|
||||
const currentStudent: StudentOptionVO = {
|
||||
id: form.value.studentId,
|
||||
name: form.value.studentName,
|
||||
studentNo: form.value.studentNo,
|
||||
gender: '0', // 默认值,实际不影响显示
|
||||
phone: form.value.studentPhone,
|
||||
collegeId: form.value.collegeId,
|
||||
collegeName: form.value.collegeName,
|
||||
majorId: form.value.majorId,
|
||||
majorName: form.value.majorName,
|
||||
classId: form.value.classId,
|
||||
className: form.value.className,
|
||||
dormInfo: {
|
||||
campusId: form.value.campusId,
|
||||
campusName: form.value.campusName,
|
||||
areaId: form.value.areaId,
|
||||
areaName: form.value.areaName,
|
||||
buildingId: form.value.buildingId,
|
||||
buildingName: form.value.buildingName,
|
||||
roomId: form.value.roomId,
|
||||
roomName: form.value.roomName,
|
||||
bedId: form.value.bedId,
|
||||
bedName: form.value.bedName
|
||||
}
|
||||
};
|
||||
|
||||
// 检查是否已经存在,避免重复添加
|
||||
const existingStudent = studentOptions.value.find((s) => s.id === form.value.studentId);
|
||||
if (!existingStudent) {
|
||||
studentOptions.value = [currentStudent];
|
||||
} else {
|
||||
// 更新现有学生信息
|
||||
Object.assign(existingStudent, currentStudent);
|
||||
}
|
||||
}
|
||||
|
||||
// 根据已有数据级联加载宿舍选项
|
||||
await loadCascadeOptionsForUpdate(form.value);
|
||||
|
||||
@@ -921,7 +959,7 @@ const remoteSearchStudents = async (query: string) => {
|
||||
const res = await getStudentOptions(params);
|
||||
// 根据实际接口返回格式调整数据获取方式
|
||||
console.log('学生搜索响应:', res);
|
||||
studentOptions.value = res.rows || [];
|
||||
studentOptions.value = (res as any).rows || [];
|
||||
|
||||
// 调试:检查第一个学生的数据
|
||||
if (studentOptions.value.length > 0) {
|
||||
@@ -964,7 +1002,7 @@ const loadInitialStudents = async () => {
|
||||
const res = await getStudentOptions(params);
|
||||
// 根据实际接口返回格式调整数据获取方式
|
||||
console.log('初始学生数据响应:', res);
|
||||
studentOptions.value = res.rows || [];
|
||||
studentOptions.value = (res as any).rows || [];
|
||||
|
||||
// 调试:检查第一个学生的数据
|
||||
if (studentOptions.value.length > 0) {
|
||||
@@ -1542,6 +1580,7 @@ const handleAttachmentData = async () => {
|
||||
|
||||
// 将逗号分隔的字符串转换为数组
|
||||
const ossIdsArray = form.value.attachmentOssIds
|
||||
.toString()
|
||||
.split(',')
|
||||
.map((id) => id.trim())
|
||||
.filter((id) => id);
|
||||
|
||||
Reference in new issue
Block a user