Merge branch 'master' of http://47.99.164.66:3000/hzdyjs-xg/all-project
This commit is contained in:
commit
56ede5d005
469 files changed
+70832
-49238
No files matched your search
@@ -1,13 +1,12 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DormBedVO, DormBedDetailVO, DormBedForm, DormBedQuery } from '@/api/xg/xgss/dormBed/types';
|
||||
import { DormBedVO, DormBedForm, DormBedQuery, DormBedDetailVO } from '@/api/xg/xgss/dormBed/types';
|
||||
|
||||
/**
|
||||
* 查询宿舍床位信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormBed = (query?: DormBedQuery): AxiosPromise<DormBedVO[]> => {
|
||||
return request({
|
||||
url: '/dormbed/dormBed/list',
|
||||
@@ -73,6 +72,17 @@ export const getBedDetailsByRoomId = (roomId: string | number): AxiosPromise<Dor
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询当前用户所在学院的指定房间床位详细信息列表(包含学生信息)
|
||||
* @param roomId 房间ID
|
||||
*/
|
||||
export const getBedDetailsByRoomIdForCurrentUserCollege = (roomId: string | number): AxiosPromise<DormBedDetailVO[]> => {
|
||||
return request({
|
||||
url: '/dormbed/dormBed/details/college/room/' + roomId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询指定宿舍楼的床位详细信息列表(包含学生信息)
|
||||
* @param buildingId 宿舍楼ID
|
||||
@@ -84,6 +94,18 @@ export const getBedDetailsByBuildingId = (buildingId: string | number): AxiosPro
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询指定房间中属于指定班级的床位详细信息列表(包含学生信息)
|
||||
* @param roomId 房间ID
|
||||
* @param classId 班级ID
|
||||
*/
|
||||
export const getBedDetailsByRoomIdAndClassId = (roomId: string | number, classId: string | number): AxiosPromise<DormBedDetailVO[]> => {
|
||||
return request({
|
||||
url: `/dormbed/dormBed/details/room/${roomId}/class/${classId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量分配床位给二级学院
|
||||
* @param data 批量分配参数
|
||||
@@ -101,3 +123,21 @@ export const batchAllocateBedsToCollege = (data: {
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量分配床位给班级
|
||||
* @param data 批量分配给班级参数
|
||||
*/
|
||||
export const batchAllocateBedsToClass = (data: {
|
||||
bedIds: (string | number)[];
|
||||
classIds: (string | number)[];
|
||||
classStudentCounts?: number[];
|
||||
buildingId?: string | number;
|
||||
buildingType?: string;
|
||||
}) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/batchAllocateToClass',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DormBedStudentVO, DormBedStudentForm, DormBedStudentQuery } from '@/api/xg/xgss/dormBedStudent/dormBedStudent/types';
|
||||
import { DormBedStudentVO, DormBedStudentForm, DormBedStudentQuery, DormBuildingTreeVO } from '@/api/xg/xgss/dormBedStudent/dormBedStudent/types';
|
||||
|
||||
/**
|
||||
* 查询床位学生分配关系列表
|
||||
@@ -61,3 +61,214 @@ export const delDormBedStudent = (id: string | number | Array<string | number>)
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量收回宿舍床位
|
||||
*/
|
||||
export const batchRecallDormBeds = (data: { bedIds: Array<string | number> }) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/batchRecall',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量回收班级分配床位(保留学院分配)
|
||||
*/
|
||||
export const batchRecallClassAllocation = (data: { bedIds: Array<string | number> }) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/batchRecallClassAllocation',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取当前用户二级学院的宿舍楼树形结构
|
||||
* 校区-宿舍区-宿舍楼三级结构,校区和宿舍区不可选,只有宿舍楼可以选择
|
||||
*/
|
||||
export const getCurrentUserCollegeDormTree = (): AxiosPromise<DormBuildingTreeVO[]> => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/currentUserCollegeDormTree',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// ============== 班主任分配相关API ==============
|
||||
|
||||
/**
|
||||
* 获取班主任管理的班级宿舍楼树形结构
|
||||
* 只显示班主任管理班级分配到的宿舍楼
|
||||
*/
|
||||
export const getClassTeacherDormTree = (classId?: string | number): AxiosPromise<DormBuildingTreeVO[]> => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/getClassTeacherDormTree',
|
||||
method: 'get',
|
||||
params: { classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取班主任管理班级的房间床位详情(带学生信息)
|
||||
* @param buildingId 宿舍楼ID,为空则查询所有楼栋
|
||||
*/
|
||||
export const getClassTeacherBedDetails = (buildingId?: string | number, classId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/getClassTeacherBedDetails',
|
||||
method: 'get',
|
||||
params: { buildingId, classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取班主任管理的未分配床位学生列表
|
||||
*/
|
||||
export const getClassTeacherUnallocatedStudents = (classId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/getClassTeacherUnallocatedStudents',
|
||||
method: 'get',
|
||||
params: { classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任一键随机分配床位
|
||||
* @param buildingId 宿舍楼ID,为空则全部分配
|
||||
*/
|
||||
export const classTeacherRandomAllocation = (buildingId?: string | number, classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/classTeacherRandomAllocation',
|
||||
method: 'post',
|
||||
params: { buildingId, classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任一键按学号分配床位
|
||||
* @param buildingId 宿舍楼ID,为空则全部分配
|
||||
*/
|
||||
export const classTeacherStudentNoAllocation = (buildingId?: string | number, classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/classTeacherStudentNoAllocation',
|
||||
method: 'post',
|
||||
params: { buildingId, classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任选择性分配床位(弹窗模式)
|
||||
* @param allocationParams 分配参数 {bedIds: number[], studentIds: number[], allocationType: 'random' | 'studentNo'}
|
||||
*/
|
||||
export const classTeacherSelectiveAllocation = (
|
||||
allocationParams: {
|
||||
bedIds: Array<string | number>;
|
||||
studentIds: Array<string | number>;
|
||||
allocationType: 'random' | 'studentNo';
|
||||
},
|
||||
classId?: string | number
|
||||
) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/classTeacherSelectiveAllocation',
|
||||
method: 'post',
|
||||
data: allocationParams,
|
||||
params: { classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任一键收回床位
|
||||
* @param buildingId 宿舍楼ID,为空则全部收回
|
||||
*/
|
||||
export const classTeacherRecallBeds = (buildingId?: string | number, classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/classTeacherRecallBeds',
|
||||
method: 'post',
|
||||
params: { buildingId, classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任收回选中床位
|
||||
* @param bedIds 床位ID数组
|
||||
* @param classId 班级ID,可为空
|
||||
*/
|
||||
export const classTeacherRecallSelectedBeds = (bedIds: number[], classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/classTeacherRecallSelectedBeds',
|
||||
method: 'post',
|
||||
data: bedIds,
|
||||
params: { classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任退宿选中床位
|
||||
* @param bedIds 床位ID数组
|
||||
* @param classId 班级ID,可为空
|
||||
*/
|
||||
export const classTeacherStayawaySelectedBeds = (bedIds: number[], classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/classTeacherStayawaySelectedBeds',
|
||||
method: 'post',
|
||||
data: bedIds,
|
||||
params: { classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任床位互换
|
||||
* 将两个有学生的床位进行互换
|
||||
* @param sourceStudentId 源学生ID
|
||||
* @param targetStudentId 目标学生ID
|
||||
* @param classId 班级ID,可为空
|
||||
*/
|
||||
export const classTeacherExchangeBeds = (sourceStudentId: string | number, targetStudentId: string | number, classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/classTeacherExchangeBeds',
|
||||
method: 'post',
|
||||
params: { sourceStudentId, targetStudentId, classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任床位移动
|
||||
* 将学生从当前床位移动到指定的空闲床位
|
||||
* @param sourceStudentId 源学生ID
|
||||
* @param targetBedId 目标床位ID
|
||||
* @param classId 班级ID,可为空
|
||||
*/
|
||||
export const classTeacherMoveBed = (sourceStudentId: string | number, targetBedId?: string | number, classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/classTeacherMoveBed',
|
||||
method: 'post',
|
||||
params: { sourceStudentId, targetBedId, classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取班级所有已入住宿舍的学生床位信息
|
||||
* 包含床位信息(校区名称、宿舍区名称、楼栋名称、房间名称、床位名称)
|
||||
* 和学生信息(学生姓名、学号、性别)
|
||||
* @param classId 班级ID,可为空
|
||||
*/
|
||||
export const getClassOccupiedBedDetails = (classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/getClassOccupiedBedDetails',
|
||||
method: 'get',
|
||||
params: { classId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取班级所有未安排学生的床位信息
|
||||
* 包含床位信息(校区名称、宿舍区名称、楼栋名称、房间名称、床位名称)
|
||||
* @param classId 班级ID,可为空
|
||||
*/
|
||||
export const getClassUnoccupiedBedDetails = (classId?: string | number) => {
|
||||
return request({
|
||||
url: '/dormBedStudent/dormBedStudent/getClassUnoccupiedBedDetails',
|
||||
method: 'get',
|
||||
params: { classId }
|
||||
});
|
||||
};
|
||||
@@ -223,3 +223,43 @@ export interface DormBedStudentQuery extends PageQuery {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍楼树形结构VO
|
||||
*/
|
||||
export interface DormBuildingTreeVO {
|
||||
/**
|
||||
* 节点ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* 节点类型 (campus:校区, area:宿舍区, building:宿舍楼)
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* 是否禁用节点(校区和宿舍区节点禁用点击)
|
||||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* 宿舍楼层数(仅宿舍楼节点有此字段)
|
||||
*/
|
||||
buildingFloors?: number;
|
||||
|
||||
/**
|
||||
* 宿舍楼类型(1男生楼 2女生楼 3混合楼)(仅宿舍楼节点有此字段)
|
||||
*/
|
||||
buildingType?: string;
|
||||
|
||||
/**
|
||||
* 子节点
|
||||
*/
|
||||
children?: DormBuildingTreeVO[];
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
DormHygieneCheckVO,
|
||||
DormHygieneCheckForm,
|
||||
DormHygieneCheckQuery,
|
||||
DormHygieneCheckCompleteForm,
|
||||
DormHygieneStudentScoreVO,
|
||||
DormHygieneStudentScoreForm,
|
||||
DormHygieneStudentScoreQuery
|
||||
} from '@/api/xg/xgss/dormHygieneCheck/dormHygieneCheck/types';
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormHygieneCheck = (query?: DormHygieneCheckQuery): AxiosPromise<DormHygieneCheckVO[]> => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormHygieneCheck = (id: string | number): AxiosPromise<DormHygieneCheckVO> => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增宿舍卫生检查(包含学生评分数据)
|
||||
* @param data 完整的宿舍卫生检查数据,包含学生评分信息
|
||||
*/
|
||||
export const addDormHygieneCheck = (data: DormHygieneCheckCompleteForm) => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/addWithStudentScores',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改宿舍卫生检查(包含学生评分数据)
|
||||
* @param data 完整的宿舍卫生检查数据,包含学生评分信息
|
||||
*/
|
||||
export const updateDormHygieneCheck = (data: DormHygieneCheckCompleteForm) => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/updateWithStudentScores',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除宿舍卫生检查
|
||||
* @param id
|
||||
*/
|
||||
export const delDormHygieneCheck = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查学生评分列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listDormHygieneStudentScores = (query?: DormHygieneStudentScoreQuery): AxiosPromise<DormHygieneStudentScoreVO[]> => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneStudentScore/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查学生评分详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormHygieneStudentScore = (id: string | number): AxiosPromise<DormHygieneStudentScoreVO> => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneStudentScore/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增宿舍卫生检查学生评分
|
||||
* @param data
|
||||
*/
|
||||
export const addDormHygieneStudentScore = (data: DormHygieneStudentScoreForm) => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneStudentScore',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改宿舍卫生检查学生评分
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormHygieneStudentScore = (data: DormHygieneStudentScoreForm) => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneStudentScore',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除宿舍卫生检查学生评分
|
||||
* @param id
|
||||
*/
|
||||
export const delDormHygieneStudentScore = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneStudentScore/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据卫生检查ID查询学生评分列表
|
||||
* @param hygieneCheckId 卫生检查ID
|
||||
* @returns 学生评分列表
|
||||
*/
|
||||
export const getStudentScoresByCheckId = (hygieneCheckId: string | number): AxiosPromise<DormHygieneStudentScoreVO[]> => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneStudentScore/getByCheckId/' + hygieneCheckId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量删除指定卫生检查的学生评分记录
|
||||
* @param hygieneCheckId 卫生检查ID
|
||||
*/
|
||||
export const deleteStudentScoresByCheckId = (hygieneCheckId: string | number) => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneStudentScore/deleteByCheckId/' + hygieneCheckId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取校区选项列表
|
||||
* @returns 校区选项列表
|
||||
*/
|
||||
export const getCampusOptions = (): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus/list',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定校区的宿舍区选项列表
|
||||
* @param campusId 校区ID
|
||||
* @returns 宿舍区选项列表
|
||||
*/
|
||||
export const getAreaOptions = (campusId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea/list',
|
||||
method: 'get',
|
||||
params: campusId ? { campusId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定宿舍区的宿舍楼选项列表
|
||||
* @param areaId 宿舍区ID
|
||||
* @returns 宿舍楼选项列表
|
||||
*/
|
||||
export const getBuildingOptions = (areaId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding/list',
|
||||
method: 'get',
|
||||
params: areaId ? { areaId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定宿舍楼的房间选项列表
|
||||
* @param buildingId 宿舍楼ID
|
||||
* @returns 房间选项列表
|
||||
*/
|
||||
export const getRoomOptions = (buildingId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/xgss/dormRoom/list',
|
||||
method: 'get',
|
||||
params: buildingId ? { buildingId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出宿舍卫生检查数据(包含学生卫生情况)
|
||||
* @param query 查询条件
|
||||
* @returns Blob 导出文件数据
|
||||
*/
|
||||
export const exportDormHygieneCheck = (query?: DormHygieneCheckQuery) => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/advancedExport',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,648 @@
|
||||
export interface DormHygieneCheckVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
/**
|
||||
* 检查标题
|
||||
*/
|
||||
checkTitle: string;
|
||||
|
||||
/**
|
||||
* 检查日期
|
||||
*/
|
||||
checkDate: string;
|
||||
|
||||
/**
|
||||
* 检查员ID,关联sys_user.id
|
||||
*/
|
||||
checkerId: string | number;
|
||||
|
||||
/**
|
||||
* 检查员姓名
|
||||
*/
|
||||
checkerName: string;
|
||||
|
||||
/**
|
||||
* 检查类型(1日常检查 2专项检查 3突击检查 4复查)
|
||||
*/
|
||||
checkType: string;
|
||||
|
||||
/**
|
||||
* 检查级别(1宿管员 2学院 3学校)
|
||||
*/
|
||||
checkLevel: string;
|
||||
|
||||
/**
|
||||
* 宿舍房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId: string | number;
|
||||
|
||||
/**
|
||||
* 房间编号
|
||||
*/
|
||||
roomCode: string;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName: string;
|
||||
|
||||
/**
|
||||
* 宿舍总分(0-100分)
|
||||
*/
|
||||
totalScore: number;
|
||||
|
||||
/**
|
||||
* 卫生等级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
hygieneGrade: string;
|
||||
|
||||
/**
|
||||
* 附件OSS ID列表,逗号分隔
|
||||
*/
|
||||
attachmentIds: string | number;
|
||||
|
||||
/**
|
||||
* 检查总结
|
||||
*/
|
||||
checkSummary: string;
|
||||
|
||||
/**
|
||||
* 整改建议
|
||||
*/
|
||||
improvementSuggestions: string;
|
||||
|
||||
/**
|
||||
* 检查备注
|
||||
*/
|
||||
checkRemarks: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormHygieneCheckForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 检查标题
|
||||
*/
|
||||
checkTitle?: string;
|
||||
|
||||
/**
|
||||
* 检查日期
|
||||
*/
|
||||
checkDate?: string;
|
||||
|
||||
/**
|
||||
* 检查员ID,关联sys_user.id
|
||||
*/
|
||||
checkerId?: string | number;
|
||||
|
||||
/**
|
||||
* 检查员姓名
|
||||
*/
|
||||
checkerName?: string;
|
||||
|
||||
/**
|
||||
* 检查类型(1日常检查 2专项检查 3突击检查 4复查)
|
||||
*/
|
||||
checkType?: string;
|
||||
|
||||
/**
|
||||
* 检查级别(1宿管员 2学院 3学校)
|
||||
*/
|
||||
checkLevel?: string;
|
||||
|
||||
/**
|
||||
* 宿舍房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId?: string | number;
|
||||
|
||||
/**
|
||||
* 房间编号
|
||||
*/
|
||||
roomCode?: string;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍总分(0-100分)
|
||||
*/
|
||||
totalScore?: number;
|
||||
|
||||
/**
|
||||
* 卫生等级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
hygieneGrade?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS ID列表,逗号分隔
|
||||
*/
|
||||
attachmentIds?: string | number;
|
||||
|
||||
/**
|
||||
* 检查总结
|
||||
*/
|
||||
checkSummary?: string;
|
||||
|
||||
/**
|
||||
* 整改建议
|
||||
*/
|
||||
improvementSuggestions?: string;
|
||||
|
||||
/**
|
||||
* 检查备注
|
||||
*/
|
||||
checkRemarks?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormHygieneCheckQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 检查标题
|
||||
*/
|
||||
checkTitle?: string;
|
||||
|
||||
/**
|
||||
* 检查日期
|
||||
*/
|
||||
checkDate?: string;
|
||||
|
||||
/**
|
||||
* 检查员ID,关联sys_user.id
|
||||
*/
|
||||
checkerId?: string | number;
|
||||
|
||||
/**
|
||||
* 检查员姓名
|
||||
*/
|
||||
checkerName?: string;
|
||||
|
||||
/**
|
||||
* 检查类型(1日常检查 2专项检查 3突击检查 4复查)
|
||||
*/
|
||||
checkType?: string;
|
||||
|
||||
/**
|
||||
* 检查级别(1宿管员 2学院 3学校)
|
||||
*/
|
||||
checkLevel?: string;
|
||||
|
||||
/**
|
||||
* 宿舍房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId?: string | number;
|
||||
|
||||
/**
|
||||
* 房间编号
|
||||
*/
|
||||
roomCode?: string;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍总分(0-100分)
|
||||
*/
|
||||
totalScore?: number;
|
||||
|
||||
/**
|
||||
* 卫生等级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
hygieneGrade?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS ID列表,逗号分隔
|
||||
*/
|
||||
attachmentIds?: string | number;
|
||||
|
||||
/**
|
||||
* 检查总结
|
||||
*/
|
||||
checkSummary?: string;
|
||||
|
||||
/**
|
||||
* 整改建议
|
||||
*/
|
||||
improvementSuggestions?: string;
|
||||
|
||||
/**
|
||||
* 检查备注
|
||||
*/
|
||||
checkRemarks?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
// 宿舍级联选择相关类型
|
||||
export interface CampusOptionVO {
|
||||
id: string | number;
|
||||
campusName: string;
|
||||
}
|
||||
|
||||
export interface AreaOptionVO {
|
||||
id: string | number;
|
||||
areaName: string;
|
||||
}
|
||||
|
||||
export interface BuildingOptionVO {
|
||||
id: string | number;
|
||||
buildingName: string;
|
||||
}
|
||||
|
||||
export interface RoomOptionVO {
|
||||
id: string | number;
|
||||
roomName: string;
|
||||
roomCode?: string;
|
||||
}
|
||||
|
||||
// 学生评分相关类型定义
|
||||
export interface DormHygieneStudentScoreVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
/**
|
||||
* 卫生检查ID,关联xg_dorm_hygiene_check.id
|
||||
*/
|
||||
hygieneCheckId: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位编号
|
||||
*/
|
||||
bedCode?: string;
|
||||
|
||||
/**
|
||||
* 学生个人得分(0-100分)
|
||||
*/
|
||||
studentScore?: number;
|
||||
|
||||
/**
|
||||
* 出勤状态(1在寝 2外出 3请假 4其他)
|
||||
*/
|
||||
attendanceStatus: string;
|
||||
|
||||
/**
|
||||
* 学生评级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
studentGrade?: string;
|
||||
|
||||
/**
|
||||
* 是否为寝室长(0否 1是)
|
||||
*/
|
||||
isResponsiblePerson?: number;
|
||||
|
||||
/**
|
||||
* 评分备注
|
||||
*/
|
||||
scoreRemarks?: string;
|
||||
|
||||
/**
|
||||
* 改进意见
|
||||
*/
|
||||
improvementNotes?: string;
|
||||
}
|
||||
|
||||
export interface DormHygieneStudentScoreForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 卫生检查ID,关联xg_dorm_hygiene_check.id
|
||||
*/
|
||||
hygieneCheckId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位编号
|
||||
*/
|
||||
bedCode?: string;
|
||||
|
||||
/**
|
||||
* 学生个人得分(0-100分)
|
||||
*/
|
||||
studentScore?: number;
|
||||
|
||||
/**
|
||||
* 出勤状态(1在寝 2外出 3请假 4其他)
|
||||
*/
|
||||
attendanceStatus?: string;
|
||||
|
||||
/**
|
||||
* 学生评级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
studentGrade?: string;
|
||||
|
||||
/**
|
||||
* 是否为寝室长(0否 1是)
|
||||
*/
|
||||
isResponsiblePerson?: number;
|
||||
|
||||
/**
|
||||
* 评分备注
|
||||
*/
|
||||
scoreRemarks?: string;
|
||||
|
||||
/**
|
||||
* 改进意见
|
||||
*/
|
||||
improvementNotes?: string;
|
||||
}
|
||||
|
||||
export interface DormHygieneStudentScoreQuery extends PageQuery {
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 卫生检查ID,关联xg_dorm_hygiene_check.id
|
||||
*/
|
||||
hygieneCheckId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 出勤状态(1在寝 2外出 3请假 4其他)
|
||||
*/
|
||||
attendanceStatus?: string;
|
||||
|
||||
/**
|
||||
* 学生评级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
studentGrade?: string;
|
||||
}
|
||||
|
||||
// 宿舍卫生检查完整表单类型(包含学生评分数据)
|
||||
export interface DormHygieneCheckCompleteForm extends DormHygieneCheckForm {
|
||||
/**
|
||||
* 学生评分数据列表
|
||||
*/
|
||||
studentScores?: DormHygieneStudentScoreForm[];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
DormHygieneStudentScoreVO,
|
||||
DormHygieneStudentScoreForm,
|
||||
DormHygieneStudentScoreQuery
|
||||
} from '@/api/xg/xgss/dormHygieneStudentScore/dormHygieneStudentScore/types';
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查学生评分列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormHygieneStudentScore = (query?: DormHygieneStudentScoreQuery): AxiosPromise<DormHygieneStudentScoreVO[]> => {
|
||||
return request({
|
||||
url: '/dormHygieneStudentScore/dormHygieneStudentScore/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查学生评分详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormHygieneStudentScore = (id: string | number): AxiosPromise<DormHygieneStudentScoreVO> => {
|
||||
return request({
|
||||
url: '/dormHygieneStudentScore/dormHygieneStudentScore/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增宿舍卫生检查学生评分
|
||||
* @param data
|
||||
*/
|
||||
export const addDormHygieneStudentScore = (data: DormHygieneStudentScoreForm) => {
|
||||
return request({
|
||||
url: '/dormHygieneStudentScore/dormHygieneStudentScore',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改宿舍卫生检查学生评分
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormHygieneStudentScore = (data: DormHygieneStudentScoreForm) => {
|
||||
return request({
|
||||
url: '/dormHygieneStudentScore/dormHygieneStudentScore',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除宿舍卫生检查学生评分
|
||||
* @param id
|
||||
*/
|
||||
export const delDormHygieneStudentScore = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/dormHygieneStudentScore/dormHygieneStudentScore/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,311 @@
|
||||
export interface DormHygieneStudentScoreVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
/**
|
||||
* 卫生检查ID,关联xg_dorm_hygiene_check.id
|
||||
*/
|
||||
hygieneCheckId: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId: string | number;
|
||||
|
||||
/**
|
||||
* 床位编号
|
||||
*/
|
||||
bedCode: string;
|
||||
|
||||
/**
|
||||
* 学生个人得分(0-100分)
|
||||
*/
|
||||
studentScore: number;
|
||||
|
||||
/**
|
||||
* 是否在寝(1在寝 2外出 3请假 4其他)
|
||||
*/
|
||||
attendanceStatus: string;
|
||||
|
||||
/**
|
||||
* 学生评级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
studentGrade: string;
|
||||
|
||||
/**
|
||||
* 是否为寝室长(0否 1是)
|
||||
*/
|
||||
isResponsiblePerson: number;
|
||||
|
||||
/**
|
||||
* 评分备注
|
||||
*/
|
||||
scoreRemarks: string;
|
||||
|
||||
/**
|
||||
* 改进意见
|
||||
*/
|
||||
improvementNotes: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormHygieneStudentScoreForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 卫生检查ID,关联xg_dorm_hygiene_check.id
|
||||
*/
|
||||
hygieneCheckId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位编号
|
||||
*/
|
||||
bedCode?: string;
|
||||
|
||||
/**
|
||||
* 学生个人得分(0-100分)
|
||||
*/
|
||||
studentScore?: number;
|
||||
|
||||
/**
|
||||
* 是否在寝(1在寝 2外出 3请假 4其他)
|
||||
*/
|
||||
attendanceStatus?: string;
|
||||
|
||||
/**
|
||||
* 学生评级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
studentGrade?: string;
|
||||
|
||||
/**
|
||||
* 是否为寝室长(0否 1是)
|
||||
*/
|
||||
isResponsiblePerson?: number;
|
||||
|
||||
/**
|
||||
* 评分备注
|
||||
*/
|
||||
scoreRemarks?: string;
|
||||
|
||||
/**
|
||||
* 改进意见
|
||||
*/
|
||||
improvementNotes?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormHygieneStudentScoreQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 卫生检查ID,关联xg_dorm_hygiene_check.id
|
||||
*/
|
||||
hygieneCheckId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位编号
|
||||
*/
|
||||
bedCode?: string;
|
||||
|
||||
/**
|
||||
* 学生个人得分(0-100分)
|
||||
*/
|
||||
studentScore?: number;
|
||||
|
||||
/**
|
||||
* 是否在寝(1在寝 2外出 3请假 4其他)
|
||||
*/
|
||||
attendanceStatus?: string;
|
||||
|
||||
/**
|
||||
* 学生评级(A优秀 B良好 C合格 D不合格)
|
||||
*/
|
||||
studentGrade?: string;
|
||||
|
||||
/**
|
||||
* 是否为寝室长(0否 1是)
|
||||
*/
|
||||
isResponsiblePerson?: number;
|
||||
|
||||
/**
|
||||
* 评分备注
|
||||
*/
|
||||
scoreRemarks?: string;
|
||||
|
||||
/**
|
||||
* 改进意见
|
||||
*/
|
||||
improvementNotes?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,19 @@ export const listDormRoom = (query?: DormRoomQuery): AxiosPromise<DormRoomVO[]>
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询当前用户所在学院的宿舍房间信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listDormRoomForCurrentUserCollege = (query?: DormRoomQuery): AxiosPromise<DormRoomVO[]> => {
|
||||
return request({
|
||||
url: '/xgss/dormRoom/college/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍房间信息详细
|
||||
* @param id
|
||||
@@ -51,6 +64,32 @@ export const updateDormRoom = (data: DormRoomForm) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询指定班级的宿舍房间信息列表
|
||||
* @param classId 班级ID
|
||||
* @param query 查询条件
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listDormRoomByClassId = (classId: string | number, query?: DormRoomQuery): AxiosPromise<DormRoomVO[]> => {
|
||||
return request({
|
||||
url: `/xgss/dormRoom/class/${classId}/list`,
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询指定房间的床位详细信息列表(包含学生信息)
|
||||
* @param roomId 房间ID
|
||||
* @returns {*}
|
||||
*/
|
||||
export const getDormBedDetailsByRoomId = (roomId: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: `/dormbed/dormBed/details/room/${roomId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除宿舍房间信息
|
||||
* @param id
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
DormViolationVO,
|
||||
DormViolationForm,
|
||||
DormViolationQuery,
|
||||
StudentOptionVO,
|
||||
StudentOptionQuery,
|
||||
CampusOptionVO,
|
||||
AreaOptionVO,
|
||||
BuildingOptionVO,
|
||||
RoomOptionVO,
|
||||
BedOptionVO
|
||||
} from '@/api/xg/xgss/dormViolation/dormViolation/types';
|
||||
|
||||
/**
|
||||
* 查询宿舍违纪记录列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormViolation = (query?: DormViolationQuery): AxiosPromise<DormViolationVO[]> => {
|
||||
return request({
|
||||
url: '/dormViolation/dormViolation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍违纪记录详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormViolation = (id: string | number): AxiosPromise<DormViolationVO> => {
|
||||
return request({
|
||||
url: '/dormViolation/dormViolation/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增宿舍违纪记录
|
||||
* @param data
|
||||
*/
|
||||
export const addDormViolation = (data: DormViolationForm) => {
|
||||
return request({
|
||||
url: '/dormViolation/dormViolation',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改宿舍违纪记录
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormViolation = (data: DormViolationForm) => {
|
||||
return request({
|
||||
url: '/dormViolation/dormViolation',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除宿舍违纪记录
|
||||
* @param id
|
||||
*/
|
||||
export const delDormViolation = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/dormViolation/dormViolation/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取学生选择器选项列表(支持按学号、姓名检索)
|
||||
* @param query 查询参数
|
||||
* @returns 学生选项列表
|
||||
*/
|
||||
export const getStudentOptions = (
|
||||
query?: StudentOptionQuery
|
||||
): AxiosPromise<{
|
||||
total: number;
|
||||
rows: StudentOptionVO[];
|
||||
}> => {
|
||||
return request({
|
||||
url: '/dormViolation/dormViolation/studentOptions',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取校区选项列表
|
||||
* @returns 校区选项列表
|
||||
*/
|
||||
export const getCampusOptions = (): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus/list',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定校区的宿舍区选项列表
|
||||
* @param campusId 校区ID
|
||||
* @returns 宿舍区选项列表
|
||||
*/
|
||||
export const getAreaOptions = (campusId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea/list',
|
||||
method: 'get',
|
||||
params: campusId ? { campusId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定宿舍区的宿舍楼选项列表
|
||||
* @param areaId 宿舍区ID
|
||||
* @returns 宿舍楼选项列表
|
||||
*/
|
||||
export const getBuildingOptions = (areaId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding/list',
|
||||
method: 'get',
|
||||
params: areaId ? { areaId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定宿舍楼的房间选项列表
|
||||
* @param buildingId 宿舍楼ID
|
||||
* @returns 房间选项列表
|
||||
*/
|
||||
export const getRoomOptions = (buildingId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/xgss/dormRoom/list',
|
||||
method: 'get',
|
||||
params: buildingId ? { buildingId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定房间的床位选项列表
|
||||
* @param roomId 房间ID
|
||||
* @returns 床位选项列表
|
||||
*/
|
||||
export const getBedOptions = (roomId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/dormbed/dormBed/list',
|
||||
method: 'get',
|
||||
params: roomId ? { roomId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据学生ID获取学生详细信息
|
||||
* @param studentId 学生ID
|
||||
* @returns 学生详细信息
|
||||
*/
|
||||
export const getStudentById = (studentId: string | number): AxiosPromise<StudentOptionVO> => {
|
||||
return request({
|
||||
url: `/dormViolation/dormViolation/student/${studentId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,483 @@
|
||||
export interface DormViolationVO {
|
||||
/**
|
||||
* 违纪记录ID(主键)
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 校区ID
|
||||
*/
|
||||
campusId: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName: string;
|
||||
|
||||
/**
|
||||
* 宿舍区域ID
|
||||
*/
|
||||
areaId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区域名称
|
||||
*/
|
||||
areaName: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
buildingId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName: string;
|
||||
|
||||
/**
|
||||
* 宿舍房间ID
|
||||
*/
|
||||
roomId: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName: string;
|
||||
|
||||
/**
|
||||
* 床位ID
|
||||
*/
|
||||
bedId: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName: string;
|
||||
|
||||
/**
|
||||
* 违纪类型
|
||||
*/
|
||||
violationType: string;
|
||||
|
||||
/**
|
||||
* 违纪等级:1轻微 2一般 3严重 4特别严重
|
||||
*/
|
||||
violationLevel: string;
|
||||
|
||||
/**
|
||||
* 违纪发生时间
|
||||
*/
|
||||
violationTime: string;
|
||||
|
||||
/**
|
||||
* 违纪行为描述
|
||||
*/
|
||||
violationDescription: string;
|
||||
|
||||
/**
|
||||
* 涉及其他学生id(逗号分隔)
|
||||
*/
|
||||
involvedStudents: string;
|
||||
|
||||
/**
|
||||
* 附件OSS ID列表(逗号分隔)
|
||||
*/
|
||||
attachmentOssIds: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormViolationForm extends BaseEntity {
|
||||
/**
|
||||
* 违纪记录ID(主键)
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 校区ID
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区域ID
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区域名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍房间ID
|
||||
*/
|
||||
roomId?: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName?: string;
|
||||
|
||||
/**
|
||||
* 违纪类型
|
||||
*/
|
||||
violationType?: string;
|
||||
|
||||
/**
|
||||
* 违纪等级:1轻微 2一般 3严重 4特别严重
|
||||
*/
|
||||
violationLevel?: string;
|
||||
|
||||
/**
|
||||
* 违纪发生时间
|
||||
*/
|
||||
violationTime?: string;
|
||||
|
||||
/**
|
||||
* 违纪行为描述
|
||||
*/
|
||||
violationDescription?: string;
|
||||
|
||||
/**
|
||||
* 涉及其他学生id(逗号分隔)或数组
|
||||
*/
|
||||
involvedStudents?: string | (string | number)[];
|
||||
|
||||
/**
|
||||
* 附件OSS ID列表(逗号分隔)
|
||||
*/
|
||||
attachmentOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormViolationQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 校区ID
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区域ID
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区域名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍房间ID
|
||||
*/
|
||||
roomId?: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName?: string;
|
||||
|
||||
/**
|
||||
* 违纪类型
|
||||
*/
|
||||
violationType?: string;
|
||||
|
||||
/**
|
||||
* 违纪等级:1轻微 2一般 3严重 4特别严重
|
||||
*/
|
||||
violationLevel?: string;
|
||||
|
||||
/**
|
||||
* 违纪发生时间
|
||||
*/
|
||||
violationTime?: string;
|
||||
|
||||
/**
|
||||
* 违纪行为描述
|
||||
*/
|
||||
violationDescription?: string;
|
||||
|
||||
/**
|
||||
* 涉及其他学生id(逗号分隔)
|
||||
*/
|
||||
involvedStudents?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS ID列表(逗号分隔)
|
||||
*/
|
||||
attachmentOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
// 学生选择相关类型
|
||||
export interface StudentOptionVO {
|
||||
id: string | number;
|
||||
name: string;
|
||||
studentNo: string;
|
||||
gender: string;
|
||||
collegeId?: string | number;
|
||||
collegeName?: string;
|
||||
majorId?: string | number;
|
||||
majorName?: string;
|
||||
classId?: string | number;
|
||||
className?: string;
|
||||
phone?: string;
|
||||
dormInfo?: {
|
||||
campusId?: string | number;
|
||||
campusName?: string;
|
||||
areaId?: string | number;
|
||||
areaName?: string;
|
||||
buildingId?: string | number;
|
||||
buildingName?: string;
|
||||
roomId?: string | number;
|
||||
roomName?: string;
|
||||
bedId?: string | number;
|
||||
bedName?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface StudentOptionQuery extends PageQuery {
|
||||
keyword?: string;
|
||||
}
|
||||
|
||||
// 宿舍级联选择相关类型
|
||||
export interface CampusOptionVO {
|
||||
id: string | number;
|
||||
campusName: string;
|
||||
}
|
||||
|
||||
export interface AreaOptionVO {
|
||||
id: string | number;
|
||||
areaName: string;
|
||||
}
|
||||
|
||||
export interface BuildingOptionVO {
|
||||
id: string | number;
|
||||
buildingName: string;
|
||||
}
|
||||
|
||||
export interface RoomOptionVO {
|
||||
id: string | number;
|
||||
roomName: string;
|
||||
}
|
||||
|
||||
export interface BedOptionVO {
|
||||
id: string | number;
|
||||
bedName: string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { HolidayStayVO, HolidayStayForm, HolidayStayQuery, StudentOptionVO, StudentOptionQuery } from '@/api/xg/xgss/holidayStay/holidayStay/types';
|
||||
|
||||
/**
|
||||
* 查询假期留宿管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listHolidayStay = (query?: HolidayStayQuery): AxiosPromise<HolidayStayVO[]> => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询假期留宿管理详细
|
||||
* @param id
|
||||
*/
|
||||
export const getHolidayStay = (id: string | number): AxiosPromise<HolidayStayVO> => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增假期留宿管理
|
||||
* @param data
|
||||
*/
|
||||
export const addHolidayStay = (data: HolidayStayForm) => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改假期留宿管理
|
||||
* @param data
|
||||
*/
|
||||
export const updateHolidayStay = (data: HolidayStayForm) => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除假期留宿管理
|
||||
* @param id
|
||||
*/
|
||||
export const delHolidayStay = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取学生选择器选项列表(支持按学号、姓名检索)
|
||||
* @param query 查询参数
|
||||
* @returns 学生选项列表
|
||||
*/
|
||||
export const getStudentOptions = (query?: StudentOptionQuery): AxiosPromise<{
|
||||
total: number;
|
||||
rows: StudentOptionVO[];
|
||||
}> => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/studentOptions',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取校区选项列表
|
||||
* @returns 校区选项列表
|
||||
*/
|
||||
export const getCampusOptions = (): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus/list',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定校区的宿舍区选项列表
|
||||
* @param campusId 校区ID
|
||||
* @returns 宿舍区选项列表
|
||||
*/
|
||||
export const getAreaOptions = (campusId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea/list',
|
||||
method: 'get',
|
||||
params: campusId ? { campusId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定宿舍区的宿舍楼选项列表
|
||||
* @param areaId 宿舍区ID
|
||||
* @returns 宿舍楼选项列表
|
||||
*/
|
||||
export const getBuildingOptions = (areaId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding/list',
|
||||
method: 'get',
|
||||
params: areaId ? { areaId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定宿舍楼的房间选项列表
|
||||
* @param buildingId 宿舍楼ID
|
||||
* @returns 房间选项列表
|
||||
*/
|
||||
export const getRoomOptions = (buildingId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/xgss/dormRoom/list',
|
||||
method: 'get',
|
||||
params: buildingId ? { buildingId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定房间的床位选项列表
|
||||
* @param roomId 房间ID
|
||||
* @returns 床位选项列表
|
||||
*/
|
||||
export const getBedOptions = (roomId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/dormbed/dormBed/list',
|
||||
method: 'get',
|
||||
params: roomId ? { roomId } : undefined
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,757 @@
|
||||
export interface HolidayStayVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName: string;
|
||||
|
||||
/**
|
||||
* 房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName: string;
|
||||
|
||||
/**
|
||||
* 假期类型(寒假、暑假、春节假期、国庆假期等)
|
||||
*/
|
||||
holidayType: string | number;
|
||||
|
||||
/**
|
||||
* 申请留宿开始日期
|
||||
*/
|
||||
applyStartDate: string;
|
||||
|
||||
/**
|
||||
* 申请留宿结束日期
|
||||
*/
|
||||
applyEndDate: string;
|
||||
|
||||
/**
|
||||
* 留宿原因(必填)
|
||||
*/
|
||||
stayReason: string;
|
||||
|
||||
/**
|
||||
* 留宿原因类型(学习、实习、家庭困难、其他)
|
||||
*/
|
||||
stayReasonType: string;
|
||||
|
||||
/**
|
||||
* 学生联系电话
|
||||
*/
|
||||
studentPhone: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人姓名
|
||||
*/
|
||||
emergencyContact: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人电话
|
||||
*/
|
||||
emergencyPhone: string;
|
||||
|
||||
/**
|
||||
* 家长同意(0否 1是)
|
||||
*/
|
||||
parentConsent: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID,多个用逗号分隔(申请材料、证明文件等)
|
||||
*/
|
||||
attachmentOssIds: string | number;
|
||||
|
||||
/**
|
||||
* 扩展字段1
|
||||
*/
|
||||
extField1: string;
|
||||
|
||||
/**
|
||||
* 扩展字段2
|
||||
*/
|
||||
extField2: string;
|
||||
|
||||
/**
|
||||
* 扩展字段3
|
||||
*/
|
||||
extField3: string;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface HolidayStayForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId?: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName?: string;
|
||||
|
||||
/**
|
||||
* 假期类型(寒假、暑假、春节假期、国庆假期等)
|
||||
*/
|
||||
holidayType?: string | number;
|
||||
|
||||
/**
|
||||
* 申请留宿开始日期
|
||||
*/
|
||||
applyStartDate?: string;
|
||||
|
||||
/**
|
||||
* 申请留宿结束日期
|
||||
*/
|
||||
applyEndDate?: string;
|
||||
|
||||
/**
|
||||
* 留宿原因(必填)
|
||||
*/
|
||||
stayReason?: string;
|
||||
|
||||
/**
|
||||
* 留宿原因类型(学习、实习、家庭困难、其他)
|
||||
*/
|
||||
stayReasonType?: string;
|
||||
|
||||
/**
|
||||
* 学生联系电话
|
||||
*/
|
||||
studentPhone?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人姓名
|
||||
*/
|
||||
emergencyContact?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人电话
|
||||
*/
|
||||
emergencyPhone?: string;
|
||||
|
||||
/**
|
||||
* 家长同意(0否 1是)
|
||||
*/
|
||||
parentConsent?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID,多个用逗号分隔(申请材料、证明文件等)
|
||||
*/
|
||||
attachmentOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 扩展字段1
|
||||
*/
|
||||
extField1?: string;
|
||||
|
||||
/**
|
||||
* 扩展字段2
|
||||
*/
|
||||
extField2?: string;
|
||||
|
||||
/**
|
||||
* 扩展字段3
|
||||
*/
|
||||
extField3?: string;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface HolidayStayQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId?: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName?: string;
|
||||
|
||||
/**
|
||||
* 假期类型(寒假、暑假、春节假期、国庆假期等)
|
||||
*/
|
||||
holidayType?: string | number;
|
||||
|
||||
/**
|
||||
* 申请留宿开始日期
|
||||
*/
|
||||
applyStartDate?: string;
|
||||
|
||||
/**
|
||||
* 申请留宿结束日期
|
||||
*/
|
||||
applyEndDate?: string;
|
||||
|
||||
/**
|
||||
* 留宿原因(必填)
|
||||
*/
|
||||
stayReason?: string;
|
||||
|
||||
/**
|
||||
* 留宿原因类型(学习、实习、家庭困难、其他)
|
||||
*/
|
||||
stayReasonType?: string;
|
||||
|
||||
/**
|
||||
* 学生联系电话
|
||||
*/
|
||||
studentPhone?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人姓名
|
||||
*/
|
||||
emergencyContact?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人电话
|
||||
*/
|
||||
emergencyPhone?: string;
|
||||
|
||||
/**
|
||||
* 家长同意(0否 1是)
|
||||
*/
|
||||
parentConsent?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID,多个用逗号分隔(申请材料、证明文件等)
|
||||
*/
|
||||
attachmentOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 扩展字段1
|
||||
*/
|
||||
extField1?: string;
|
||||
|
||||
/**
|
||||
* 扩展字段2
|
||||
*/
|
||||
extField2?: string;
|
||||
|
||||
/**
|
||||
* 扩展字段3
|
||||
*/
|
||||
extField3?: string;
|
||||
|
||||
/**
|
||||
* 状态过滤(valid-有效,invalid-失效)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生选择器选项
|
||||
*/
|
||||
export interface StudentOptionVO {
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 学生联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 宿舍信息
|
||||
*/
|
||||
dormInfo?: {
|
||||
campusId?: string | number;
|
||||
campusName?: string;
|
||||
areaId?: string | number;
|
||||
areaName?: string;
|
||||
buildingId?: string | number;
|
||||
buildingName?: string;
|
||||
roomId?: string | number;
|
||||
roomName?: string;
|
||||
bedId?: string | number;
|
||||
bedName?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生选择器查询参数
|
||||
*/
|
||||
export interface StudentOptionQuery {
|
||||
/**
|
||||
* 搜索关键字(学号或姓名)
|
||||
*/
|
||||
keyword?: string;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
pageNum?: number;
|
||||
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校区选项
|
||||
*/
|
||||
export interface CampusOptionVO {
|
||||
/**
|
||||
* 校区ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName: string;
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
campusCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍区选项
|
||||
*/
|
||||
export interface AreaOptionVO {
|
||||
/**
|
||||
* 宿舍区ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName: string;
|
||||
|
||||
/**
|
||||
* 校区ID
|
||||
*/
|
||||
campusId: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍楼选项
|
||||
*/
|
||||
export interface BuildingOptionVO {
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID
|
||||
*/
|
||||
areaId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间选项
|
||||
*/
|
||||
export interface RoomOptionVO {
|
||||
/**
|
||||
* 房间ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
buildingId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 床位选项
|
||||
*/
|
||||
export interface BedOptionVO {
|
||||
/**
|
||||
* 床位ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName: string;
|
||||
|
||||
/**
|
||||
* 房间ID
|
||||
*/
|
||||
roomId: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 床位状态(0-空闲,1-已分配,2-已入住)
|
||||
*/
|
||||
bedStatus?: string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,3 +44,11 @@ export function delClassMsg(id: string | number) {
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取当前登录人作为班主任的班级列表
|
||||
export function getMyClassListAsTeacher(): AxiosPromise<ClassMsgVO[]> {
|
||||
return request({
|
||||
url: '/classMsg/classMsg/myClassListAsTeacher',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -207,6 +207,14 @@ export function getStudentTree(secondaryCollegeId: number = 101): AxiosPromise<R
|
||||
});
|
||||
}
|
||||
|
||||
// 获取当前用户所在学院的学生信息树
|
||||
export function getCurrentUserStudentTree(): AxiosPromise<R<XgStudentTreeVO[]>> {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg/getCurrentUserStudentTree',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 学生状态修改
|
||||
export function changeStudentStatus(studentId: string | number, status: string): AxiosPromise<R<any>> {
|
||||
// 实际使用时连接后端接口
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { InternshipInfoVO, InternshipInfoQuery, ClassInfoVO, InternshipStatisticsVO } from '@/api/zsjy/types';
|
||||
import {
|
||||
InternshipInfoVO,
|
||||
InternshipInfoQuery,
|
||||
InternshipInfoAddBO,
|
||||
InternshipInfoEditBO,
|
||||
ClassInfoVO,
|
||||
InternshipStatisticsVO
|
||||
} from '@/api/zsjy/types';
|
||||
import { TableDataInfo, R } from '@/api/types';
|
||||
|
||||
/**
|
||||
* 查询实习信息列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const listInternshipInfo = (query?: InternshipInfoQuery): AxiosPromise<InternshipInfoVO[]> => {
|
||||
export const listInternshipInfo = (query?: InternshipInfoQuery): AxiosPromise<TableDataInfo<InternshipInfoVO>> => {
|
||||
return request({
|
||||
url: '/zsjy/internship/list',
|
||||
method: 'get',
|
||||
@@ -18,13 +26,24 @@ export const listInternshipInfo = (query?: InternshipInfoQuery): AxiosPromise<In
|
||||
* 查询学生实习详细信息
|
||||
* @param studentId 学生ID
|
||||
*/
|
||||
export const getInternshipInfo = (studentId: string | number): AxiosPromise<InternshipInfoVO> => {
|
||||
export const getInternshipInfo = (studentId: string | number): AxiosPromise<R<InternshipInfoVO>> => {
|
||||
return request({
|
||||
url: `/zsjy/internship/${studentId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取当前学生实习信息
|
||||
* @returns 当前登录学生的实习信息
|
||||
*/
|
||||
export const getCurrentStudentInternship = (): AxiosPromise<R<InternshipInfoVO>> => {
|
||||
return request({
|
||||
url: '/zsjy/internship/current',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出实习信息列表
|
||||
* @param query 查询参数
|
||||
@@ -41,7 +60,7 @@ export const exportInternshipInfo = (query: InternshipInfoQuery) => {
|
||||
/**
|
||||
* 获取班级信息列表(用于下拉选择)
|
||||
*/
|
||||
export const getClassOptions = (): AxiosPromise<ClassInfoVO[]> => {
|
||||
export const getClassOptions = (): AxiosPromise<R<ClassInfoVO[]>> => {
|
||||
return request({
|
||||
url: '/zsjy/internship/classes',
|
||||
method: 'get'
|
||||
@@ -52,10 +71,45 @@ export const getClassOptions = (): AxiosPromise<ClassInfoVO[]> => {
|
||||
* 获取实习统计数据
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const getInternshipStatistics = (query?: InternshipInfoQuery): AxiosPromise<InternshipStatisticsVO> => {
|
||||
export const getInternshipStatistics = (query?: InternshipInfoQuery): AxiosPromise<R<InternshipStatisticsVO>> => {
|
||||
return request({
|
||||
url: '/zsjy/internship/statistics',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增实习信息
|
||||
* @param data 实习信息数据
|
||||
*/
|
||||
export const addInternshipInfo = (data: InternshipInfoAddBO): AxiosPromise<R<void>> => {
|
||||
return request({
|
||||
url: '/zsjy/internship',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改实习信息
|
||||
* @param data 实习信息数据
|
||||
*/
|
||||
export const updateInternshipInfo = (data: InternshipInfoEditBO): AxiosPromise<R<void>> => {
|
||||
return request({
|
||||
url: '/zsjy/internship',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除实习信息
|
||||
* @param internshipId 实习信息ID
|
||||
*/
|
||||
export const delInternshipInfo = (internshipId: string | number): AxiosPromise<R<void>> => {
|
||||
return request({
|
||||
url: `/zsjy/internship/${internshipId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 查询实习日常记录列表
|
||||
export function listInternshipDaily(query) {
|
||||
return request({
|
||||
url: '/zsjy/internship/daily/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 学生签到打卡
|
||||
export function checkIn(data) {
|
||||
return request({
|
||||
url: '/zsjy/internship/daily/checkin',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 新增实习日常记录
|
||||
export function addInternshipDaily(data) {
|
||||
return request({
|
||||
url: '/zsjy/internship/daily',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取学生考勤日历
|
||||
export function getCalendar(studentId, params) {
|
||||
return request({
|
||||
url: `/zsjy/internship/daily/calendar/${studentId}`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
// 获取考勤统计数据
|
||||
export function getStatistics(query) {
|
||||
return request({
|
||||
url: '/zsjy/internship/daily/statistics',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询学生月度总结列表
|
||||
export function listInternshipMonthly(query: any) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取学生月度总结详细信息
|
||||
export function getInternshipMonthly(monthlyId: string | number) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/' + monthlyId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增学生月度总结
|
||||
export function addInternshipMonthly(data: any) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改学生月度总结
|
||||
export function updateInternshipMonthly(data: any) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除学生月度总结
|
||||
export function delInternshipMonthly(monthlyIds: string | number | Array<string | number>) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/' + monthlyIds,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 提交月度总结审批
|
||||
export function submitInternshipMonthly(monthlyId: string | number) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/submit/' + monthlyId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
// 自动保存草稿
|
||||
export function autosaveInternshipMonthly(data: any) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/autosave',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 检查月份重复
|
||||
export function checkSummaryMonth(summaryMonth: string) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/check/' + summaryMonth,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取月度总结模板
|
||||
export function getMonthlyTemplate(summaryMonth: string) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/template/' + summaryMonth,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取状态统计
|
||||
export function getMonthlyStatistics() {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/statistics',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出月度总结数据
|
||||
export function exportInternshipMonthly(query: any) {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取学生当前实习信息
|
||||
export function getCurrentInternshipInfo() {
|
||||
return request({
|
||||
url: '/zsjy/internship/monthly/current-internship',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { InternshipVisitVO, InternshipVisitQuery, InternshipVisitAddBO, InternshipVisitEditBO } from '@/api/zsjy/types';
|
||||
import { TableDataInfo, R } from '@/api/types';
|
||||
|
||||
/**
|
||||
* 查询班主任走访记录列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const listInternshipVisit = (query?: InternshipVisitQuery): AxiosPromise<TableDataInfo<InternshipVisitVO>> => {
|
||||
return request({
|
||||
url: '/zsjy/internshipVisit/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询班主任走访记录详细信息
|
||||
* @param visitId 走访记录ID
|
||||
*/
|
||||
export const getInternshipVisit = (visitId: string | number): AxiosPromise<R<InternshipVisitVO>> => {
|
||||
return request({
|
||||
url: `/zsjy/internshipVisit/${visitId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增班主任走访记录
|
||||
* @param data 走访记录信息
|
||||
*/
|
||||
export const addInternshipVisit = (data: InternshipVisitAddBO): AxiosPromise<R<void>> => {
|
||||
return request({
|
||||
url: '/zsjy/internshipVisit',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改班主任走访记录
|
||||
* @param data 走访记录信息
|
||||
*/
|
||||
export const updateInternshipVisit = (data: InternshipVisitEditBO): AxiosPromise<R<void>> => {
|
||||
return request({
|
||||
url: '/zsjy/internshipVisit',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除班主任走访记录
|
||||
* @param visitIds 走访记录ID
|
||||
*/
|
||||
export const delInternshipVisit = (visitIds: string | number | Array<string | number>): AxiosPromise<R<void>> => {
|
||||
return request({
|
||||
url: `/zsjy/internshipVisit/${visitIds}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出班主任走访记录列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const exportInternshipVisit = (query: InternshipVisitQuery) => {
|
||||
return request({
|
||||
url: '/zsjy/internshipVisit/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取可选项列表(学生选择)
|
||||
*/
|
||||
export const getInternshipVisitOptions = (): AxiosPromise<R<InternshipVisitVO[]>> => {
|
||||
return request({
|
||||
url: '/zsjy/internshipVisit/options',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
+576
-11
@@ -769,7 +769,7 @@ export interface InternshipInfoVO {
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
mobile?: string;
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
@@ -804,7 +804,7 @@ export interface InternshipInfoVO {
|
||||
/**
|
||||
* 班主任姓名
|
||||
*/
|
||||
classMasterName?: string;
|
||||
classTeacherName?: string;
|
||||
|
||||
/**
|
||||
* 实习状态 (0=未实习, 1=实习中, 2=实习完成)
|
||||
@@ -819,7 +819,7 @@ export interface InternshipInfoVO {
|
||||
/**
|
||||
* 实习公司
|
||||
*/
|
||||
internshipCompany?: string;
|
||||
companyName?: string;
|
||||
|
||||
/**
|
||||
* 实习岗位
|
||||
@@ -829,17 +829,42 @@ export interface InternshipInfoVO {
|
||||
/**
|
||||
* 实习开始时间
|
||||
*/
|
||||
internshipStartTime?: string;
|
||||
internshipStartDate?: string;
|
||||
|
||||
/**
|
||||
* 实习结束时间
|
||||
*/
|
||||
internshipEndTime?: string;
|
||||
internshipEndDate?: string;
|
||||
|
||||
/**
|
||||
* 实习地点
|
||||
*/
|
||||
internshipLocation?: string;
|
||||
companyAddress?: string;
|
||||
|
||||
/**
|
||||
* 实习津贴
|
||||
*/
|
||||
internshipAllowance?: number;
|
||||
|
||||
/**
|
||||
* 单位联系人
|
||||
*/
|
||||
contactPersonName?: string;
|
||||
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
contactPersonPhone?: string;
|
||||
|
||||
/**
|
||||
* 协议状态
|
||||
*/
|
||||
agreementStatus?: string;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
@@ -862,6 +887,256 @@ export interface InternshipInfoVO {
|
||||
updateBy?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实习信息新增 BO
|
||||
*/
|
||||
export interface InternshipInfoAddBO {
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名(前端显示用)
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学生学号(前端显示用)
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 实习状态(1进行中 2已完成 3中断)
|
||||
*/
|
||||
internshipStatus: string;
|
||||
|
||||
/**
|
||||
* 实习单位名称
|
||||
*/
|
||||
companyName: string;
|
||||
|
||||
/**
|
||||
* 实习单位地址
|
||||
*/
|
||||
companyAddress: string;
|
||||
|
||||
/**
|
||||
* 单位联系人
|
||||
*/
|
||||
companyContact?: string;
|
||||
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
companyPhone?: string;
|
||||
|
||||
/**
|
||||
* 行业类型
|
||||
*/
|
||||
companyIndustry?: string;
|
||||
|
||||
/**
|
||||
* 单位规模
|
||||
*/
|
||||
companyScale?: string;
|
||||
|
||||
/**
|
||||
* 实习岗位
|
||||
*/
|
||||
internshipPosition: string;
|
||||
|
||||
/**
|
||||
* 实习薪资
|
||||
*/
|
||||
internshipAllowance?: number;
|
||||
|
||||
/**
|
||||
* 实习开始时间
|
||||
*/
|
||||
internshipStartDate: string;
|
||||
|
||||
/**
|
||||
* 实习结束时间
|
||||
*/
|
||||
internshipEndDate: string;
|
||||
|
||||
/**
|
||||
* 联系人姓名
|
||||
*/
|
||||
contactPersonName: string;
|
||||
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
contactPersonPhone: string;
|
||||
|
||||
/**
|
||||
* 岗位职责
|
||||
*/
|
||||
positionDuties?: string;
|
||||
|
||||
/**
|
||||
* 工作时长
|
||||
*/
|
||||
workHours?: string;
|
||||
|
||||
/**
|
||||
* 住宿地址
|
||||
*/
|
||||
accommodationAddress?: string;
|
||||
|
||||
/**
|
||||
* 住宿类型
|
||||
*/
|
||||
accommodationType?: string;
|
||||
|
||||
/**
|
||||
* 住宿费用
|
||||
*/
|
||||
accommodationCost?: number;
|
||||
|
||||
/**
|
||||
* 实习协议状态(1已签署 2未签署)
|
||||
*/
|
||||
agreementStatus: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实习信息编辑 BO
|
||||
*/
|
||||
export interface InternshipInfoEditBO {
|
||||
/**
|
||||
* 实习信息ID
|
||||
*/
|
||||
internshipId: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名(前端显示用)
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学生学号(前端显示用)
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 实习状态(1进行中 2已完成 3中断)
|
||||
*/
|
||||
internshipStatus: string;
|
||||
|
||||
/**
|
||||
* 实习单位名称
|
||||
*/
|
||||
companyName: string;
|
||||
|
||||
/**
|
||||
* 实习单位地址
|
||||
*/
|
||||
companyAddress: string;
|
||||
|
||||
/**
|
||||
* 单位联系人
|
||||
*/
|
||||
companyContact?: string;
|
||||
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
companyPhone?: string;
|
||||
|
||||
/**
|
||||
* 行业类型
|
||||
*/
|
||||
companyIndustry?: string;
|
||||
|
||||
/**
|
||||
* 单位规模
|
||||
*/
|
||||
companyScale?: string;
|
||||
|
||||
/**
|
||||
* 实习岗位
|
||||
*/
|
||||
internshipPosition: string;
|
||||
|
||||
/**
|
||||
* 实习薪资
|
||||
*/
|
||||
internshipAllowance?: number;
|
||||
|
||||
/**
|
||||
* 实习开始时间
|
||||
*/
|
||||
internshipStartDate: string;
|
||||
|
||||
/**
|
||||
* 实习结束时间
|
||||
*/
|
||||
internshipEndDate: string;
|
||||
|
||||
/**
|
||||
* 联系人姓名
|
||||
*/
|
||||
contactPersonName: string;
|
||||
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
contactPersonPhone: string;
|
||||
|
||||
/**
|
||||
* 岗位职责
|
||||
*/
|
||||
positionDuties?: string;
|
||||
|
||||
/**
|
||||
* 工作时长
|
||||
*/
|
||||
workHours?: string;
|
||||
|
||||
/**
|
||||
* 住宿地址
|
||||
*/
|
||||
accommodationAddress?: string;
|
||||
|
||||
/**
|
||||
* 住宿类型
|
||||
*/
|
||||
accommodationType?: string;
|
||||
|
||||
/**
|
||||
* 住宿费用
|
||||
*/
|
||||
accommodationCost?: number;
|
||||
|
||||
/**
|
||||
* 实习协议状态(1已签署 2未签署)
|
||||
*/
|
||||
agreementStatus: string;
|
||||
|
||||
/**
|
||||
* 实际结束日期
|
||||
*/
|
||||
actualEndDate?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实习信息查询 BO
|
||||
*/
|
||||
@@ -909,17 +1184,27 @@ export interface InternshipInfoQuery {
|
||||
/**
|
||||
* 实习公司
|
||||
*/
|
||||
internshipCompany?: string;
|
||||
companyName?: string;
|
||||
|
||||
/**
|
||||
* 开始时间范围
|
||||
* 实习开始日期-开始
|
||||
*/
|
||||
startTimeBegin?: string;
|
||||
internshipStartDateBegin?: string;
|
||||
|
||||
/**
|
||||
* 开始时间范围
|
||||
* 实习开始日期-结束
|
||||
*/
|
||||
startTimeEnd?: string;
|
||||
internshipStartDateEnd?: string;
|
||||
|
||||
/**
|
||||
* 班主任ID(用于数据权限控制)
|
||||
*/
|
||||
classTeacherId?: string | number;
|
||||
|
||||
/**
|
||||
* 辅导员ID(用于数据权限控制)
|
||||
*/
|
||||
counselorId?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -986,3 +1271,283 @@ export interface InternshipStatisticsVO {
|
||||
*/
|
||||
internshipRate?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 班主任走访记录 VO
|
||||
*/
|
||||
export interface InternshipVisitVO {
|
||||
/**
|
||||
* 走访记录ID
|
||||
*/
|
||||
visitId?: string | number;
|
||||
|
||||
/**
|
||||
* 实习记录ID
|
||||
*/
|
||||
internshipId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNumber?: string;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
companyName?: string;
|
||||
|
||||
/**
|
||||
* 企业地址
|
||||
*/
|
||||
companyAddress?: string;
|
||||
|
||||
/**
|
||||
* 走访日期
|
||||
*/
|
||||
visitDate?: string;
|
||||
|
||||
/**
|
||||
* 走访人员
|
||||
*/
|
||||
visitorName?: string;
|
||||
|
||||
/**
|
||||
* 走访人员职务
|
||||
*/
|
||||
visitorPosition?: string;
|
||||
|
||||
/**
|
||||
* 走访目的
|
||||
*/
|
||||
visitPurpose?: string;
|
||||
|
||||
/**
|
||||
* 企业情况
|
||||
*/
|
||||
companySituation?: string;
|
||||
|
||||
/**
|
||||
* 学生表现
|
||||
*/
|
||||
studentPerformance?: string;
|
||||
|
||||
/**
|
||||
* 发现问题
|
||||
*/
|
||||
problemsFound?: string;
|
||||
|
||||
/**
|
||||
* 改进建议
|
||||
*/
|
||||
suggestions?: string;
|
||||
|
||||
/**
|
||||
* 走访总结
|
||||
*/
|
||||
visitSummary?: string;
|
||||
|
||||
/**
|
||||
* 现场照片(JSON格式)
|
||||
*/
|
||||
visitImages?: string;
|
||||
|
||||
/**
|
||||
* 走访文件附件(JSON格式)
|
||||
*/
|
||||
visitFiles?: string;
|
||||
|
||||
/**
|
||||
* 状态(0-草稿 1-已提交 2-已审核)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime?: string;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
createBy?: number;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime?: string;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
updateBy?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 班主任走访记录查询参数
|
||||
*/
|
||||
export interface InternshipVisitQuery extends PageQuery {
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNumber?: string;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
companyName?: string;
|
||||
|
||||
/**
|
||||
* 走访人员
|
||||
*/
|
||||
visitorName?: string;
|
||||
|
||||
/**
|
||||
* 走访日期-开始
|
||||
*/
|
||||
visitDateBegin?: string;
|
||||
|
||||
/**
|
||||
* 走访日期-结束
|
||||
*/
|
||||
visitDateEnd?: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 班主任走访记录新增参数
|
||||
*/
|
||||
export interface InternshipVisitAddBO {
|
||||
/**
|
||||
* 实习记录ID
|
||||
*/
|
||||
internshipId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
companyName?: string;
|
||||
|
||||
/**
|
||||
* 企业地址
|
||||
*/
|
||||
companyAddress?: string;
|
||||
|
||||
/**
|
||||
* 走访日期
|
||||
*/
|
||||
visitDate?: string;
|
||||
|
||||
/**
|
||||
* 走访人员
|
||||
*/
|
||||
visitorName?: string;
|
||||
|
||||
/**
|
||||
* 走访人员职务
|
||||
*/
|
||||
visitorPosition?: string;
|
||||
|
||||
/**
|
||||
* 走访目的
|
||||
*/
|
||||
visitPurpose?: string;
|
||||
|
||||
/**
|
||||
* 企业情况
|
||||
*/
|
||||
companySituation?: string;
|
||||
|
||||
/**
|
||||
* 学生表现
|
||||
*/
|
||||
studentPerformance?: string;
|
||||
|
||||
/**
|
||||
* 发现问题
|
||||
*/
|
||||
problemsFound?: string;
|
||||
|
||||
/**
|
||||
* 改进建议
|
||||
*/
|
||||
suggestions?: string;
|
||||
|
||||
/**
|
||||
* 走访总结
|
||||
*/
|
||||
visitSummary?: string;
|
||||
|
||||
/**
|
||||
* 现场照片(JSON格式)
|
||||
*/
|
||||
visitImages?: string;
|
||||
|
||||
/**
|
||||
* 走访文件附件(JSON格式)
|
||||
*/
|
||||
visitFiles?: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 班主任走访记录编辑参数
|
||||
*/
|
||||
export interface InternshipVisitEditBO extends InternshipVisitAddBO {
|
||||
/**
|
||||
* 走访记录ID
|
||||
*/
|
||||
visitId?: string | number;
|
||||
}
|
||||
@@ -455,14 +455,38 @@ const handleBeforeUpload = (file: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 设置超时处理 - 如果60秒后仍在loading状态,自动关闭并提示
|
||||
const timeoutId = setTimeout(() => {
|
||||
if (number.value > 0) {
|
||||
console.warn('上传超时,自动关闭loading');
|
||||
(proxy as any)?.$modal.closeLoading();
|
||||
(proxy as any)?.$modal.msgError('上传超时,请检查网络连接或重试');
|
||||
number.value = 0; // 重置计数器
|
||||
}
|
||||
}, 60000); // 60秒超时
|
||||
|
||||
//压缩图片,开启压缩并且大于指定的压缩大小时才压缩
|
||||
if (props.compressSupport && file.size / 1024 > props.compressTargetSize) {
|
||||
(proxy as any)?.$modal.loading('正在上传图片,请稍候...');
|
||||
number.value++;
|
||||
return compressAccurately(file, props.compressTargetSize);
|
||||
|
||||
// 压缩图片时的错误处理
|
||||
try {
|
||||
return compressAccurately(file, props.compressTargetSize);
|
||||
} catch (compressionError) {
|
||||
console.error('图片压缩失败:', compressionError);
|
||||
clearTimeout(timeoutId);
|
||||
(proxy as any)?.$modal.closeLoading();
|
||||
(proxy as any)?.$modal.msgError('图片压缩失败,请重试');
|
||||
number.value--;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
(proxy as any)?.$modal.loading('正在上传图片,请稍候...');
|
||||
number.value++;
|
||||
|
||||
// 保存timeout ID以便在上传完成时清除
|
||||
(file as any).uploadTimeoutId = timeoutId;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -476,6 +500,11 @@ const handleUploadSuccess = (res: any, file: any) => {
|
||||
console.log('handleUploadSuccess:res', res);
|
||||
console.log('handleUploadSuccess:file', file);
|
||||
|
||||
// 清除上传超时处理
|
||||
if ((file as any).uploadTimeoutId) {
|
||||
clearTimeout((file as any).uploadTimeoutId);
|
||||
}
|
||||
|
||||
if (res.code === 200) {
|
||||
const uploadItem = {
|
||||
name: res.data.fileName,
|
||||
@@ -488,7 +517,9 @@ const handleUploadSuccess = (res: any, file: any) => {
|
||||
} else {
|
||||
number.value--;
|
||||
(proxy as any)?.$modal.closeLoading();
|
||||
(proxy as any)?.$modal.msgError(res.msg);
|
||||
// 提供更详细的错误信息
|
||||
const errorMsg = res.msg || '上传失败,请重试';
|
||||
(proxy as any)?.$modal.msgError(errorMsg);
|
||||
imageUploadRef.value?.handleRemove(file);
|
||||
uploadedSuccessfully();
|
||||
}
|
||||
@@ -657,9 +688,62 @@ const uploadedSuccessfully = async () => {
|
||||
};
|
||||
|
||||
// 上传失败
|
||||
const handleUploadError = () => {
|
||||
(proxy as any)?.$modal.msgError('上传图片失败');
|
||||
const handleUploadError = (error: any, file: any) => {
|
||||
console.error('上传失败详细信息:', error);
|
||||
|
||||
// 清除上传超时处理
|
||||
if (file && (file as any).uploadTimeoutId) {
|
||||
clearTimeout((file as any).uploadTimeoutId);
|
||||
}
|
||||
|
||||
// 确保关闭loading
|
||||
(proxy as any)?.$modal.closeLoading();
|
||||
|
||||
// 减少计数器
|
||||
number.value--;
|
||||
|
||||
// 根据错误类型提供不同的错误信息
|
||||
let errorMessage = '上传图片失败';
|
||||
|
||||
if (error.response) {
|
||||
const status = error.response.status;
|
||||
const responseData = error.response.data;
|
||||
|
||||
switch (status) {
|
||||
case 403:
|
||||
errorMessage = '没有文件上传权限,请联系管理员';
|
||||
break;
|
||||
case 413:
|
||||
errorMessage = '文件太大,超过服务器限制';
|
||||
break;
|
||||
case 500:
|
||||
errorMessage = '服务器内部错误,请稍后重试';
|
||||
break;
|
||||
case 504:
|
||||
errorMessage = '上传超时,请检查网络连接';
|
||||
break;
|
||||
default:
|
||||
if (responseData && responseData.msg) {
|
||||
errorMessage = responseData.msg;
|
||||
} else if (responseData && typeof responseData === 'string') {
|
||||
errorMessage = `上传失败: ${responseData}`;
|
||||
} else {
|
||||
errorMessage = `上传失败,错误代码: ${status}`;
|
||||
}
|
||||
}
|
||||
} else if (error.request) {
|
||||
// 网络错误
|
||||
if (error.code === 'ECONNABORTED' || error.message.includes('timeout')) {
|
||||
errorMessage = '上传超时,请检查网络连接或文件大小';
|
||||
} else {
|
||||
errorMessage = '网络连接错误,请检查网络设置';
|
||||
}
|
||||
} else if (error.message) {
|
||||
errorMessage = `上传失败: ${error.message}`;
|
||||
}
|
||||
|
||||
console.error('上传错误信息:', errorMessage);
|
||||
(proxy as any)?.$modal.msgError(errorMessage);
|
||||
};
|
||||
|
||||
// 预览
|
||||
|
||||
Vendored
+7
@@ -5,6 +5,13 @@ declare global {
|
||||
/** vue Instance */
|
||||
declare type ComponentInternalInstance = ComponentInstance;
|
||||
|
||||
/**
|
||||
* 扩展ComponentInternalInstance以包含useDict方法
|
||||
*/
|
||||
// declare interface ComponentPublicInstance {
|
||||
// useDict?: (...args: string[]) => { [key: string]: DictDataOption[] };
|
||||
// }
|
||||
|
||||
/**
|
||||
* 界面字段隐藏属性
|
||||
*/
|
||||
|
||||
@@ -7,12 +7,14 @@
|
||||
## 功能特性
|
||||
|
||||
### 1. 统计概览
|
||||
|
||||
- 待审核申请数量
|
||||
- 已通过申请数量
|
||||
- 已通过申请数量
|
||||
- 已拒绝申请数量
|
||||
- 总处理数量
|
||||
|
||||
### 2. 待审核申请管理
|
||||
|
||||
- 查看待审核申请列表
|
||||
- 支持多条件搜索(岗位名称、学生姓名、学号、学院名称、申请日期)
|
||||
- 单个申请审核(通过/拒绝)
|
||||
@@ -20,6 +22,7 @@
|
||||
- 查看申请详情
|
||||
|
||||
### 3. 所有申请查看
|
||||
|
||||
- 查看所有申请记录
|
||||
- 支持按状态筛选
|
||||
- 导出申请数据
|
||||
@@ -40,16 +43,19 @@ xgreview/
|
||||
## 技术特点
|
||||
|
||||
### 1. 响应式设计
|
||||
|
||||
- 使用Vue 3 Composition API
|
||||
- TypeScript类型支持
|
||||
- Element Plus UI组件库
|
||||
|
||||
### 2. 数据管理
|
||||
|
||||
- 基于学工处审核API
|
||||
- 支持分页查询
|
||||
- 实时数据更新
|
||||
|
||||
### 3. 用户体验
|
||||
|
||||
- 加载状态提示
|
||||
- 操作反馈消息
|
||||
- 响应式布局
|
||||
@@ -57,6 +63,7 @@ xgreview/
|
||||
## API接口
|
||||
|
||||
### 主要接口
|
||||
|
||||
- `listPendingApplications` - 获取待审核申请列表
|
||||
- `listStudentAffairsApplications` - 获取所有申请列表
|
||||
- `getStudentAffairsApplication` - 获取申请详情
|
||||
@@ -68,15 +75,18 @@ xgreview/
|
||||
## 使用说明
|
||||
|
||||
### 1. 访问路径
|
||||
|
||||
```
|
||||
/jcbt/workstudy/xgreview
|
||||
```
|
||||
|
||||
### 2. 权限要求
|
||||
|
||||
- 需要学工处审核权限
|
||||
- 支持批量操作权限
|
||||
|
||||
### 3. 操作流程
|
||||
|
||||
1. 查看统计概览,了解待处理申请数量
|
||||
2. 在"待审核申请"标签页中查看待处理申请
|
||||
3. 使用搜索功能筛选特定申请
|
||||
@@ -100,16 +110,19 @@ xgreview/
|
||||
## 开发说明
|
||||
|
||||
### 1. 组件复用
|
||||
|
||||
本模块复用了学院审核模块的组件结构,但使用不同的API接口和字段。
|
||||
|
||||
### 2. 样式规范
|
||||
|
||||
遵循项目的前端开发规范,使用统一的颜色主题和组件样式。
|
||||
|
||||
### 3. 错误处理
|
||||
|
||||
包含完整的错误处理机制,提供用户友好的错误提示。
|
||||
|
||||
## 更新日志
|
||||
|
||||
- **2025-01-03**:创建学工处审核模块
|
||||
- **2025-01-03**:实现基础审核功能
|
||||
- **2025-01-03**:添加统计概览和批量操作
|
||||
- **2025-01-03**:添加统计概览和批量操作
|
||||
@@ -7,12 +7,14 @@
|
||||
## ✅ 已完成功能
|
||||
|
||||
### 1. 主页面 (index.vue)
|
||||
|
||||
- ✅ 统计卡片展示(待审核、已通过、已拒绝、总计)
|
||||
- ✅ 标签页切换(待审核申请、所有申请)
|
||||
- ✅ 响应式布局和美观的UI设计
|
||||
- ✅ 与后勤管理模块保持一致的样式风格
|
||||
|
||||
### 2. 待审核申请组件 (PendingApplications.vue)
|
||||
|
||||
- ✅ 多条件搜索表单(岗位名称、学生姓名、学号、学院名称、申请日期)
|
||||
- ✅ 批量操作按钮(批量通过、批量拒绝)
|
||||
- ✅ 数据表格展示(包含学院审核状态)
|
||||
@@ -22,6 +24,7 @@
|
||||
- ✅ 分页功能
|
||||
|
||||
### 3. 所有申请组件 (AllApplications.vue)
|
||||
|
||||
- ✅ 扩展搜索条件(包含学工处审核状态)
|
||||
- ✅ 完整申请列表展示
|
||||
- ✅ 学院审核和学工处审核状态对比
|
||||
@@ -29,6 +32,7 @@
|
||||
- ✅ 审核操作(针对待审核状态)
|
||||
|
||||
### 4. 申请详情组件 (ApplicationDetail.vue)
|
||||
|
||||
- ✅ 完整的申请信息展示
|
||||
- ✅ 学院审核信息展示
|
||||
- ✅ 学工处审核信息展示
|
||||
@@ -36,23 +40,27 @@
|
||||
- ✅ 立即审核功能
|
||||
|
||||
### 5. 路由配置 (jcbt.ts)
|
||||
|
||||
- ✅ 创建jcbt模块路由配置
|
||||
- ✅ 包含学工处审核模块路由
|
||||
- ✅ 支持懒加载
|
||||
|
||||
### 6. 文档说明
|
||||
|
||||
- ✅ README.md - 详细的功能说明和使用指南
|
||||
- ✅ 开发总结.md - 开发过程和成果总结
|
||||
|
||||
## 🏗️ 技术架构
|
||||
|
||||
### 前端技术栈
|
||||
|
||||
- **Vue 3.5.13** + **TypeScript 5.8.3**
|
||||
- **Element Plus** UI组件库
|
||||
- **Composition API** 响应式编程
|
||||
- **SCSS** 样式预处理器
|
||||
|
||||
### 组件结构
|
||||
|
||||
```
|
||||
xgreview/
|
||||
├── index.vue # 主页面
|
||||
@@ -66,6 +74,7 @@ xgreview/
|
||||
```
|
||||
|
||||
### API接口
|
||||
|
||||
- 基于 `@/api/jcbt/workStudyApplicationStudentAffairsReview.ts`
|
||||
- 支持加密请求(AES+RSA)
|
||||
- 完整的CRUD操作接口
|
||||
@@ -73,16 +82,19 @@ xgreview/
|
||||
## 🎨 设计特点
|
||||
|
||||
### 1. 视觉一致性
|
||||
|
||||
- 与学院审核模块保持完全一致的视觉风格
|
||||
- 使用相同的颜色主题和组件样式
|
||||
- 统一的布局结构和交互模式
|
||||
|
||||
### 2. 用户体验
|
||||
|
||||
- 响应式设计,支持不同屏幕尺寸
|
||||
- 加载状态提示和操作反馈
|
||||
- 直观的操作流程和清晰的界面布局
|
||||
|
||||
### 3. 功能完整性
|
||||
|
||||
- 覆盖完整的审核业务流程
|
||||
- 支持单个和批量操作
|
||||
- 提供详细的数据展示和操作记录
|
||||
@@ -90,53 +102,61 @@ xgreview/
|
||||
## 🔧 开发规范遵循
|
||||
|
||||
### 1. 前端开发规范
|
||||
|
||||
- ✅ 遵循 `.cursor/cursorrules-frontend.md` 规范
|
||||
- ✅ 使用Vue 3 Composition API
|
||||
- ✅ TypeScript类型定义完整
|
||||
- ✅ 组件化开发,代码复用
|
||||
|
||||
### 2. 项目结构规范
|
||||
|
||||
- ✅ 页面代码存放在 `web/src/views/jcbt/workstudy/xgreview/`
|
||||
- ✅ API代码存放在 `web/src/api/jcbt/`
|
||||
- ✅ 路由配置存放在 `web/src/router/`
|
||||
|
||||
### 3. 代码质量
|
||||
|
||||
- ✅ 完整的错误处理机制
|
||||
- ✅ 清晰的代码注释和文档
|
||||
- ✅ 遵循Vue 3最佳实践
|
||||
|
||||
## 📊 功能对比
|
||||
|
||||
| 功能模块 | 学院审核 | 学工处审核 | 状态 |
|
||||
|---------|---------|-----------|------|
|
||||
| 统计概览 | ✅ | ✅ | 完全一致 |
|
||||
| 待审核列表 | ✅ | ✅ | 完全一致 |
|
||||
| 所有申请 | ✅ | ✅ | 完全一致 |
|
||||
| 申请详情 | ✅ | ✅ | 完全一致 |
|
||||
| 审核操作 | ✅ | ✅ | 完全一致 |
|
||||
| 批量操作 | ✅ | ✅ | 完全一致 |
|
||||
| 导出功能 | ✅ | ✅ | 完全一致 |
|
||||
| 功能模块 | 学院审核 | 学工处审核 | 状态 |
|
||||
| ---------- | -------- | ---------- | -------- |
|
||||
| 统计概览 | ✅ | ✅ | 完全一致 |
|
||||
| 待审核列表 | ✅ | ✅ | 完全一致 |
|
||||
| 所有申请 | ✅ | ✅ | 完全一致 |
|
||||
| 申请详情 | ✅ | ✅ | 完全一致 |
|
||||
| 审核操作 | ✅ | ✅ | 完全一致 |
|
||||
| 批量操作 | ✅ | ✅ | 完全一致 |
|
||||
| 导出功能 | ✅ | ✅ | 完全一致 |
|
||||
|
||||
## 🚀 部署说明
|
||||
|
||||
### 1. 文件位置
|
||||
|
||||
所有文件已正确放置在指定目录:
|
||||
|
||||
- 主页面:`web/src/views/jcbt/workstudy/xgreview/index.vue`
|
||||
- 组件:`web/src/views/jcbt/workstudy/xgreview/components/`
|
||||
- 路由:`web/src/router/jcbt.ts`
|
||||
|
||||
### 2. 访问路径
|
||||
|
||||
```
|
||||
/jcbt/workstudy/xgreview
|
||||
```
|
||||
|
||||
### 3. 权限要求
|
||||
|
||||
- 需要学工处审核权限
|
||||
- 支持批量操作权限
|
||||
|
||||
## 🔍 测试建议
|
||||
|
||||
### 1. 功能测试
|
||||
|
||||
- 统计数据展示
|
||||
- 搜索和筛选功能
|
||||
- 审核操作流程
|
||||
@@ -144,11 +164,13 @@ xgreview/
|
||||
- 导出功能
|
||||
|
||||
### 2. 兼容性测试
|
||||
|
||||
- 不同浏览器兼容性
|
||||
- 不同屏幕尺寸响应式
|
||||
- 权限控制验证
|
||||
|
||||
### 3. 性能测试
|
||||
|
||||
- 大数据量加载性能
|
||||
- 操作响应速度
|
||||
- 内存使用情况
|
||||
@@ -156,16 +178,19 @@ xgreview/
|
||||
## 📝 后续优化建议
|
||||
|
||||
### 1. 功能增强
|
||||
|
||||
- 添加审核历史记录
|
||||
- 支持审核意见模板
|
||||
- 增加数据统计图表
|
||||
|
||||
### 2. 性能优化
|
||||
|
||||
- 实现虚拟滚动
|
||||
- 添加数据缓存
|
||||
- 优化API请求
|
||||
|
||||
### 3. 用户体验
|
||||
|
||||
- 添加操作引导
|
||||
- 支持快捷键操作
|
||||
- 增加个性化设置
|
||||
@@ -186,4 +211,4 @@ xgreview/
|
||||
**开发完成时间**:2025-01-03
|
||||
**开发状态**:✅ 完成
|
||||
**代码质量**:⭐⭐⭐⭐⭐
|
||||
**文档完整性**:⭐⭐⭐⭐⭐
|
||||
**文档完整性**:⭐⭐⭐⭐⭐
|
||||
@@ -0,0 +1,685 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<div class="flex-layout">
|
||||
<!-- 左侧:宿舍树(不含学生树) -->
|
||||
<div class="tree-sidebar">
|
||||
<!-- 班级切换 Tabs -->
|
||||
<el-card shadow="hover" class="tree-card">
|
||||
<template #header>
|
||||
<div class="card-header-title">我的班级</div>
|
||||
</template>
|
||||
<el-tabs v-model="activeClassId" type="card" @tab-click="handleClassTabChange">
|
||||
<el-tab-pane v-for="cls in myClassList" :key="String(cls.id)" :label="`${cls.className}`" :name="String(cls.id)" />
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
|
||||
<!-- 宿舍楼树 -->
|
||||
<el-card shadow="hover" class="tree-card mt-4">
|
||||
<div class="card-header-title">宿舍楼</div>
|
||||
<el-input
|
||||
v-model="buildingName"
|
||||
prefix-icon="Search"
|
||||
placeholder="请输入宿舍楼名称"
|
||||
clearable
|
||||
@clear="watchBuildingName"
|
||||
@keyup.enter="watchBuildingName"
|
||||
/>
|
||||
<el-tree
|
||||
ref="dormTreeRef"
|
||||
class="mt-2"
|
||||
node-key="id"
|
||||
:data="dormOptions"
|
||||
:props="{ label: 'label', children: 'children', disabled: 'disabled' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="custom-tree-node">
|
||||
<el-tooltip v-if="data.disabled" effect="dark" content="此节点不可选择,请选择具体的宿舍楼" placement="right">
|
||||
<span :class="{ 'disabled-node': data.disabled }">{{ node.label }}</span>
|
||||
</el-tooltip>
|
||||
<span v-else>
|
||||
<span v-if="data.type === 'building'" :class="data.buildingType === '1' ? 'male-building' : 'female-building'">
|
||||
{{ data.buildingType === '1' ? '(男)' : '(女)' }}
|
||||
</span>
|
||||
{{ node.label }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 右侧内容区 -->
|
||||
<div class="content-area">
|
||||
<transition :enter-active-class="animate.searchAnimate.enter" :leave-active-class="animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" inline>
|
||||
<el-form-item label="房间号" prop="roomName">
|
||||
<el-input v-model="queryParams.roomName" placeholder="请输入房间号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="roomStatus">
|
||||
<el-select v-model="queryParams.roomStatus" placeholder="房间状态" clearable>
|
||||
<el-option label="正常" value="0" />
|
||||
<el-option label="维修中" value="1" />
|
||||
<el-option label="停用" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card v-if="!activeClassId" shadow="hover" class="empty-tip">
|
||||
<div class="flex flex-col items-center justify-center h-[400px]">
|
||||
<el-icon class="text-gray-400 text-5xl mb-4"><InfoFilled /></el-icon>
|
||||
<p class="text-gray-500 text-lg">当前账号没有班主任班级</p>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card v-else-if="!selectedBuilding" shadow="hover" class="empty-tip">
|
||||
<div class="flex flex-col items-center justify-center h-[400px]">
|
||||
<el-icon class="text-gray-400 text-5xl mb-4"><InfoFilled /></el-icon>
|
||||
<p class="text-gray-500 text-lg">请在左侧选择宿舍楼</p>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<template v-else>
|
||||
<el-card shadow="hover" class="mb-4">
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" icon="check" size="small" @click="openSelectiveAllocation">分配给学生</el-button>
|
||||
<el-button type="success" icon="Refresh" size="small" @click="handleRandomAllocation" :loading="actionLoading"
|
||||
>一键随机分配</el-button
|
||||
>
|
||||
<el-button type="primary" icon="Sort" size="small" @click="handleStudentNoAllocation" :loading="actionLoading"
|
||||
>按学号分配</el-button
|
||||
>
|
||||
<el-button type="warning" icon="RefreshLeft" size="small" @click="handleRecall" :loading="actionLoading">一键收回</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12" style="text-align: right">
|
||||
<el-button link type="primary" size="small" :loading="expandAllLoading" :disabled="expandAllLoading || loading" @click="expandAll"
|
||||
>全部展开</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
:loading="collapseAllLoading"
|
||||
:disabled="collapseAllLoading || loading"
|
||||
@click="collapseAll"
|
||||
>全部收起</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<!-- 操作信息 -->
|
||||
<div class="mb-4">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="flex flex-wrap items-center gap-4">
|
||||
<span class="font-bold whitespace-nowrap"
|
||||
>{{ selectedBuilding?.label }}
|
||||
<span :class="selectedBuilding?.buildingType === '1' ? 'male-building' : 'female-building'">
|
||||
{{ selectedBuilding?.buildingType === '1' ? '(男生楼)' : '(女生楼)' }}
|
||||
</span>
|
||||
- 房间与床位</span
|
||||
>
|
||||
<div class="text-blue-500 flex flex-wrap items-center gap-2">
|
||||
<span class="whitespace-nowrap"> 已选择: {{ selectedBedCount }} 个床位 </span>
|
||||
<span v-if="selectedBedCount > 0" class="whitespace-nowrap text-sm">
|
||||
[可分配: <el-tag size="small" type="success">{{ selectedBedStats.available }}</el-tag> 个, 已分配:
|
||||
<el-tag size="small" type="warning">{{ selectedBedStats.allocated }}</el-tag> 个, 维修中:
|
||||
<el-tag size="small" type="danger">{{ selectedBedStats.maintenance }}</el-tag>
|
||||
个]
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 房间及床位树形表格(仅床位可选) -->
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
v-loading="loading || expandAllLoading || collapseAllLoading"
|
||||
element-loading-text="处理中..."
|
||||
:data="filteredRoomList"
|
||||
row-key="id"
|
||||
border
|
||||
:expand-row-keys="expandedRowKeys"
|
||||
@expand-change="handleExpandChange"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
table-layout="auto"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" :selectable="checkSelectable" />
|
||||
<el-table-column prop="roomName" label="房间/宿舍名称" min-width="160">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isBed">{{ scope.row.roomName }} (房间)</span>
|
||||
<span v-else>{{ scope.row.bedName }} (床位)</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="floorNum" label="楼层" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isBed">{{ scope.row.floorNum }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<template v-if="!scope.row.isBed">
|
||||
<span>{{ scope.row.roomType === '1' ? '标准间' : scope.row.roomType === '2' ? '单人间' : '套间' }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-tag v-if="scope.row.bedType === '1'" type="success" size="small">下铺</el-tag>
|
||||
<el-tag v-else-if="scope.row.bedType === '2'" type="warning" size="small">上铺</el-tag>
|
||||
<el-tag v-else-if="scope.row.bedType === '3'" type="danger" size="small">中铺</el-tag>
|
||||
<el-tag v-else type="info" size="small">独立床</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<template v-if="!scope.row.isBed">
|
||||
<div class="flex flex-col items-center gap-1">
|
||||
<el-tag v-if="scope.row.roomStatus === '0'" type="success">正常</el-tag>
|
||||
<el-tag v-else-if="scope.row.roomStatus === '1'" type="warning">维修中</el-tag>
|
||||
<el-tag v-else type="danger">停用</el-tag>
|
||||
<span v-if="scope.row.roomStatus === '0'" class="text-xs text-gray-500">
|
||||
(已分配: {{ scope.row.children?.filter((bed) => bed.studentId).length || 0 }}/{{ scope.row.children?.length || 0 }}床位)
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-tag v-if="scope.row.bedStatus === '2'" type="danger">维修中</el-tag>
|
||||
<el-tag v-else-if="scope.row.studentId" type="warning">已分配</el-tag>
|
||||
<el-tag v-else type="success">空闲</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="学号" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.isBed && scope.row.studentNo">{{ scope.row.studentNo }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="学生姓名" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.isBed && scope.row.studentName">{{ scope.row.studentName }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" width="60" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.isBed && scope.row.studentGender !== undefined">
|
||||
<el-tag v-if="scope.row.studentGender === '0'" type="primary" size="small">男</el-tag>
|
||||
<el-tag v-else-if="scope.row.studentGender === '1'" class="female-tag" size="small">女</el-tag>
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="150" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
{{ scope.row.remark || scope.row.bedRemark }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 选择性分配对话框(床位 ←→ 学生) -->
|
||||
<selective-allocation-dialog
|
||||
v-model="selectiveDialog.visible"
|
||||
:title="selectiveDialog.title"
|
||||
:building-info="selectedBuilding"
|
||||
:class-id="activeClassId"
|
||||
@success="handleAllocationSuccess"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ClassTeacherBedAllocation">
|
||||
import { ref, reactive, computed, onMounted, nextTick, watch } from 'vue';
|
||||
import { InfoFilled } from '@element-plus/icons-vue';
|
||||
import type { DormBuildingTreeVO } from '@/api/xg/xgss/dormBedStudent/dormBedStudent/types';
|
||||
import {
|
||||
getClassTeacherDormTree,
|
||||
classTeacherRandomAllocation,
|
||||
classTeacherStudentNoAllocation,
|
||||
classTeacherRecallBeds
|
||||
} from '@/api/xg/xgss/dormBedStudent/dormBedStudent';
|
||||
import { listDormRoomByClassId, getDormBedDetailsByRoomId } from '@/api/xg/xgss/dormRoom';
|
||||
import type { ClassMsgVO } from '@/api/xg/xsjcxx/classMsg/types';
|
||||
import { getMyClassListAsTeacher } from '@/api/xg/xsjcxx/classMsg/classMsg';
|
||||
import ElMessage from 'element-plus/es/components/message/index';
|
||||
import ElMessageBox from 'element-plus/es/components/message-box/index';
|
||||
|
||||
// 组件
|
||||
import SelectiveAllocationDialog from './components/SelectiveAllocationDialog.vue';
|
||||
|
||||
// 左侧树&查询
|
||||
const dormTreeRef = ref();
|
||||
const queryFormRef = ref();
|
||||
const tableRef = ref();
|
||||
const buildingName = ref('');
|
||||
const showSearch = ref(true);
|
||||
const loading = ref(false);
|
||||
const expandAllLoading = ref(false);
|
||||
const collapseAllLoading = ref(false);
|
||||
const actionLoading = ref(false);
|
||||
const expandedRowKeys = ref<string[]>([]);
|
||||
|
||||
const animate = reactive({
|
||||
searchAnimate: {
|
||||
enter: 'animate__animated animate__fadeInDown',
|
||||
leave: 'animate__animated animate__fadeOutUp'
|
||||
}
|
||||
});
|
||||
|
||||
// Tabs 班级
|
||||
const myClassList = ref<ClassMsgVO[]>([]);
|
||||
const activeClassId = ref<string>('');
|
||||
|
||||
// 宿舍树数据
|
||||
const dormOptions = ref<DormBuildingTreeVO[]>([]);
|
||||
const selectedBuilding = ref<DormBuildingTreeVO>();
|
||||
|
||||
// 房间/床位
|
||||
const roomList = ref<any[]>([]);
|
||||
|
||||
// 查询参数(前端过滤)
|
||||
const queryParams = reactive({
|
||||
roomName: '',
|
||||
roomStatus: undefined as string | undefined
|
||||
});
|
||||
|
||||
// 选择统计
|
||||
const selectedRows = ref<any[]>([]);
|
||||
const selectedBedCount = ref(0);
|
||||
const selectedBedStats = ref({
|
||||
available: 0,
|
||||
allocated: 0,
|
||||
maintenance: 0
|
||||
});
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value: string, data: DormBuildingTreeVO) => {
|
||||
if (!value) return true;
|
||||
return (data.label || '').toLowerCase().indexOf(value.toLowerCase()) !== -1;
|
||||
};
|
||||
|
||||
/** 监听宿舍楼名称变化,筛选树 */
|
||||
const watchBuildingName = () => {
|
||||
dormTreeRef.value?.filter(buildingName.value);
|
||||
};
|
||||
watch(buildingName, watchBuildingName);
|
||||
|
||||
/** 班级切换 */
|
||||
const handleClassTabChange = async () => {
|
||||
selectedBuilding.value = undefined;
|
||||
roomList.value = [];
|
||||
await loadDormTree();
|
||||
};
|
||||
|
||||
/** 获取我的班级(班主任) */
|
||||
const loadMyClassList = async () => {
|
||||
try {
|
||||
const res = await getMyClassListAsTeacher();
|
||||
myClassList.value = (res.data || []) as any;
|
||||
if (myClassList.value.length > 0) {
|
||||
activeClassId.value = String(myClassList.value[0].id);
|
||||
await loadDormTree();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取班主任宿舍楼树 */
|
||||
const loadDormTree = async () => {
|
||||
try {
|
||||
const res = await getClassTeacherDormTree(activeClassId.value);
|
||||
dormOptions.value = (res.data || []).map((node: any) => ({
|
||||
...node,
|
||||
disabled: node.type !== 'building'
|
||||
}));
|
||||
} catch (e) {
|
||||
console.error('获取宿舍楼树失败', e);
|
||||
}
|
||||
};
|
||||
|
||||
/** 节点点击:仅 building 有效 */
|
||||
const handleNodeClick = (data: any) => {
|
||||
if (data.type !== 'building') return;
|
||||
selectedBuilding.value = data;
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 查询(重新加载房间床位数据) */
|
||||
const handleQuery = () => {
|
||||
loadRoomData();
|
||||
};
|
||||
|
||||
/** 重置查询 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields?.();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 加载房间与床位(使用新的班级房间查询接口) */
|
||||
const loadRoomData = async () => {
|
||||
if (!selectedBuilding.value) return;
|
||||
loading.value = true;
|
||||
try {
|
||||
// 1. 调用新的班级房间查询接口,获取指定班级在指定宿舍楼的房间信息
|
||||
const roomRes = await listDormRoomByClassId(activeClassId.value as any, {
|
||||
buildingId: selectedBuilding.value.id as any,
|
||||
pageNum: 1,
|
||||
pageSize: 1000 // 设置较大的页面大小获取所有数据
|
||||
});
|
||||
|
||||
// 后端返回的是TableDataInfo格式,从rows字段获取实际数据
|
||||
const roomData = (roomRes.data as any)?.rows || roomRes.data || [];
|
||||
|
||||
// 2. 为每个房间获取床位详细信息
|
||||
const roomsWithBeds = await Promise.all(
|
||||
roomData.map(async (room: any) => {
|
||||
try {
|
||||
const bedRes = await getDormBedDetailsByRoomId(room.id);
|
||||
const bedData = bedRes.data || [];
|
||||
return {
|
||||
...room,
|
||||
isBed: false,
|
||||
children: bedData.map((bed: any) => ({
|
||||
...bed,
|
||||
isBed: true
|
||||
}))
|
||||
};
|
||||
} catch (e) {
|
||||
console.warn(`获取房间 ${room.id} 的床位信息失败:`, e);
|
||||
return {
|
||||
...room,
|
||||
isBed: false,
|
||||
children: []
|
||||
};
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
roomList.value = roomsWithBeds;
|
||||
// 默认清空选择
|
||||
nextTick(() => tableRef.value?.clearSelection());
|
||||
selectedRows.value = [];
|
||||
updateSelectionCount([]);
|
||||
} catch (e) {
|
||||
console.error('加载房间床位失败', e);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 过滤后的房间数据(前端过滤) */
|
||||
const filteredRoomList = computed(() => {
|
||||
const name = (queryParams.roomName || '').trim().toLowerCase();
|
||||
const status = queryParams.roomStatus;
|
||||
if (!name && !status) return roomList.value;
|
||||
const matchRoom = (room: any) => {
|
||||
const nameOk = !name || (room.roomName || '').toLowerCase().includes(name);
|
||||
const statusOk = !status || room.roomStatus === status;
|
||||
return nameOk && statusOk;
|
||||
};
|
||||
return roomList.value
|
||||
.filter((room) => matchRoom(room))
|
||||
.map((room) => ({
|
||||
...room,
|
||||
children: room.children || []
|
||||
}));
|
||||
});
|
||||
|
||||
/** 展开/收起 */
|
||||
const handleExpandChange = (row: any, expanded: boolean) => {
|
||||
const key = String(row.id);
|
||||
if (expanded) expandedRowKeys.value.push(key);
|
||||
else expandedRowKeys.value = expandedRowKeys.value.filter((k) => k !== key);
|
||||
};
|
||||
const expandAll = async () => {
|
||||
if (expandAllLoading.value || !filteredRoomList.value?.length) return;
|
||||
expandAllLoading.value = true;
|
||||
await nextTick();
|
||||
expandedRowKeys.value = filteredRoomList.value.map((room) => String(room.id));
|
||||
await nextTick();
|
||||
expandAllLoading.value = false;
|
||||
};
|
||||
const collapseAll = async () => {
|
||||
if (collapseAllLoading.value) return;
|
||||
collapseAllLoading.value = true;
|
||||
await nextTick();
|
||||
expandedRowKeys.value = [];
|
||||
await nextTick();
|
||||
collapseAllLoading.value = false;
|
||||
};
|
||||
|
||||
/** 行可选(仅未分配且非维修中的床位可选) */
|
||||
const checkSelectable = (row: any) => {
|
||||
return row.isBed && !row.studentId && row.bedStatus !== '2';
|
||||
};
|
||||
|
||||
/** 选择变化 */
|
||||
const handleSelectionChange = (rows: any[]) => {
|
||||
selectedRows.value = rows;
|
||||
updateSelectionCount(rows);
|
||||
};
|
||||
|
||||
/** 更新选择统计 */
|
||||
const updateSelectionCount = (rows: any[]) => {
|
||||
const bedStats = { available: 0, allocated: 0, maintenance: 0 } as any;
|
||||
rows.forEach((row) => {
|
||||
if (!row.isBed) return;
|
||||
if (row.bedStatus === '2') bedStats.maintenance++;
|
||||
else if (row.studentId) bedStats.allocated++;
|
||||
else bedStats.available++;
|
||||
});
|
||||
selectedBedCount.value = rows.filter((r) => r.isBed).length;
|
||||
selectedBedStats.value = bedStats;
|
||||
};
|
||||
|
||||
/** 打开选择性分配弹窗 */
|
||||
const selectiveDialog = reactive({ visible: false, title: '分配床位给学生' });
|
||||
const openSelectiveAllocation = () => {
|
||||
if (!selectedBuilding.value) {
|
||||
ElMessage.warning('请先选择宿舍楼');
|
||||
return;
|
||||
}
|
||||
selectiveDialog.visible = true;
|
||||
};
|
||||
|
||||
/** 分配成功回调(刷新) */
|
||||
const handleAllocationSuccess = () => {
|
||||
loadRoomData();
|
||||
};
|
||||
|
||||
/** 一键随机分配 */
|
||||
const handleRandomAllocation = async () => {
|
||||
if (!selectedBuilding.value) return ElMessage.warning('请先选择宿舍楼');
|
||||
try {
|
||||
await ElMessageBox.confirm('确认对本班级在该楼栋内进行随机分配吗?', '提示', { type: 'warning' });
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
actionLoading.value = true;
|
||||
await classTeacherRandomAllocation(selectedBuilding.value.id as any, activeClassId.value as any);
|
||||
ElMessage.success('随机分配成功');
|
||||
loadRoomData();
|
||||
} catch (e) {
|
||||
ElMessage.error('随机分配失败');
|
||||
} finally {
|
||||
actionLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 按学号分配 */
|
||||
const handleStudentNoAllocation = async () => {
|
||||
if (!selectedBuilding.value) return ElMessage.warning('请先选择宿舍楼');
|
||||
try {
|
||||
await ElMessageBox.confirm('确认按学号顺序为学生分配床位吗?', '提示', { type: 'warning' });
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
actionLoading.value = true;
|
||||
await classTeacherStudentNoAllocation(selectedBuilding.value.id as any, activeClassId.value as any);
|
||||
ElMessage.success('按学号分配成功');
|
||||
loadRoomData();
|
||||
} catch (e) {
|
||||
ElMessage.error('按学号分配失败');
|
||||
} finally {
|
||||
actionLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 一键收回 */
|
||||
const handleRecall = async () => {
|
||||
if (!selectedBuilding.value) return ElMessage.warning('请先选择宿舍楼');
|
||||
try {
|
||||
await ElMessageBox.confirm('确认收回本班级在该楼栋内的所有床位分配吗?', '提示', { type: 'warning' });
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
actionLoading.value = true;
|
||||
await classTeacherRecallBeds(selectedBuilding.value.id as any, activeClassId.value as any);
|
||||
ElMessage.success('收回成功');
|
||||
loadRoomData();
|
||||
} catch (e) {
|
||||
ElMessage.error('收回失败');
|
||||
} finally {
|
||||
actionLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadMyClassList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.flex-layout {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.tree-sidebar {
|
||||
width: 300px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tree-card {
|
||||
flex: 1;
|
||||
max-height: calc(50vh - 24px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tree-card :deep(.el-card__body) {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.content-area {
|
||||
flex-grow: 1;
|
||||
overflow: visible;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.el-table :deep(.el-table__cell) {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.el-table :deep(.el-table__fixed-right) {
|
||||
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.el-card :deep(.el-table) {
|
||||
width: 100% !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.el-card :deep(.el-table__body-wrapper) {
|
||||
overflow-x: auto !important;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
.el-card :deep(.el-table__header-wrapper) {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.el-card :deep(.el-table__body),
|
||||
.el-card :deep(.el-table__header) {
|
||||
min-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-card :deep(.el-table__inner-wrapper) {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.card-header-title {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
font-size: 16px;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
min-width: max-content;
|
||||
}
|
||||
|
||||
.disabled-node {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.male-building {
|
||||
color: var(--el-color-primary);
|
||||
font-weight: bold;
|
||||
}
|
||||
.female-building {
|
||||
color: #ff69b4;
|
||||
font-weight: bold;
|
||||
}
|
||||
.female-tag {
|
||||
background-color: rgba(255, 105, 180, 0.1) !important;
|
||||
color: #ff69b4 !important;
|
||||
border-color: rgba(255, 105, 180, 0.1) !important;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,704 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :title="title" width="1000px" :before-close="handleClose" destroy-on-close class="bed-transfer-dialog">
|
||||
<div class="transfer-container">
|
||||
<!-- 当前选中床位信息 -->
|
||||
<div class="current-bed-info">
|
||||
<div class="info-header">
|
||||
<h3 class="info-title">
|
||||
<el-icon><Avatar /></el-icon>
|
||||
当前选中床位
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<el-card v-if="props.selectedBed" shadow="hover" class="bed-card">
|
||||
<div class="bed-info-grid">
|
||||
<div class="info-item">
|
||||
<span class="label">学生姓名:</span>
|
||||
<span class="value">{{ props.selectedBed.studentName }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">学号:</span>
|
||||
<span class="value">{{ props.selectedBed.studentNo }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">性别:</span>
|
||||
<el-tag v-if="props.selectedBed.studentGender === '0'" type="primary" size="small">男</el-tag>
|
||||
<el-tag v-else-if="props.selectedBed.studentGender === '1'" class="female-tag" size="small">女</el-tag>
|
||||
</div>
|
||||
<!-- <div class="info-item">
|
||||
<span class="label">校区:</span>
|
||||
<span class="value">{{ props.selectedBed.campusName || '未知' }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">区域:</span>
|
||||
<span class="value">{{ props.selectedBed.areaName || '未知' }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">楼栋:</span>
|
||||
<span class="value">{{ props.selectedBed.buildingName || '未知' }}</span>
|
||||
</div> -->
|
||||
<div class="info-item">
|
||||
<span class="label">房间号:</span>
|
||||
<span class="value">{{ props.selectedBed.roomName }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">床位号:</span>
|
||||
<span class="value">{{ props.selectedBed.bedName }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">床位类型:</span>
|
||||
<el-tag v-if="props.selectedBed.bedType === '1'" type="success" size="small">下铺</el-tag>
|
||||
<el-tag v-else-if="props.selectedBed.bedType === '2'" type="warning" size="small">上铺</el-tag>
|
||||
<el-tag v-else-if="props.selectedBed.bedType === '3'" type="danger" size="small">中铺</el-tag>
|
||||
<el-tag v-else type="info" size="small">独立床</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 调宿模式选择 -->
|
||||
<div class="transfer-mode">
|
||||
<div class="mode-header">
|
||||
<h3 class="mode-title">
|
||||
<el-icon><Switch /></el-icon>
|
||||
调宿模式
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<el-radio-group v-model="transferMode" @change="handleModeChange">
|
||||
<el-radio value="exchange">
|
||||
<el-icon><Refresh /></el-icon>
|
||||
床位互换
|
||||
<span class="mode-desc">与另一个有学生的床位互换</span>
|
||||
</el-radio>
|
||||
<el-radio value="move">
|
||||
<el-icon><Right /></el-icon>
|
||||
移动床位
|
||||
<span class="mode-desc">移动到一个空闲的床位</span>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
<!-- 目标床位选择区域 -->
|
||||
<div class="target-bed-area">
|
||||
<div class="area-header">
|
||||
<h3 class="area-title">
|
||||
<el-icon><House /></el-icon>
|
||||
目标床位选择
|
||||
<el-tag v-if="transferMode === 'exchange'" type="warning" size="small">请选择有学生的床位</el-tag>
|
||||
<el-tag v-else type="success" size="small">请选择空闲床位</el-tag>
|
||||
<el-tag v-if="props.selectedBed?.studentGender" type="info" size="small">
|
||||
已过滤:仅显示{{ props.selectedBed.studentGender === '0' ? '男生' : '女生' }}可住床位
|
||||
</el-tag>
|
||||
</h3>
|
||||
<div class="stats">
|
||||
<span v-if="selectedTargetBed"> 已选择目标床位:{{ selectedTargetBed.roomName }} - {{ selectedTargetBed.bedName }} </span>
|
||||
<span v-else class="text-gray-500">请选择目标床位</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-bar">
|
||||
<el-input v-model="bedSearchKey" placeholder="搜索房间号、床位号" prefix-icon="Search" clearable @input="handleBedSearch" />
|
||||
</div>
|
||||
|
||||
<div class="bed-list" v-loading="bedLoading">
|
||||
<el-table
|
||||
ref="bedTableRef"
|
||||
:data="filteredBedList"
|
||||
row-key="id"
|
||||
height="300"
|
||||
max-height="300"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
:expand-row-keys="expandRowKeys"
|
||||
@expand-change="handleExpandChange"
|
||||
@current-change="handleTargetBedSelection"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="roomName" label="房间/床位" min-width="180">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isBed" class="inline-flex items-center gap-1 whitespace-nowrap">
|
||||
<el-icon><House /></el-icon>
|
||||
{{ scope.row.roomName }}
|
||||
</span>
|
||||
<span v-else class="inline-flex items-center gap-1 whitespace-nowrap">
|
||||
<el-icon><Avatar /></el-icon>
|
||||
{{ scope.row.bedName }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="校区" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.campusName" class="text-gray-700">{{ scope.row.campusName }}</span>
|
||||
<span v-else class="text-gray-400">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="楼栋" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.buildingName" class="text-gray-700">{{ scope.row.buildingName }}</span>
|
||||
<span v-else class="text-gray-400">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.isBed">
|
||||
<el-tag v-if="scope.row.bedType === '1'" type="success" size="small">下铺</el-tag>
|
||||
<el-tag v-if="scope.row.bedType === '2'" type="warning" size="small">上铺</el-tag>
|
||||
<el-tag v-if="scope.row.bedType === '3'" type="danger" size="small">中铺</el-tag>
|
||||
<el-tag v-if="!scope.row.bedType || scope.row.bedType === '4'" type="info" size="small">独立床</el-tag>
|
||||
</template>
|
||||
<span v-else class="text-gray-400">
|
||||
<span>{{ scope.row.roomType === '1' ? '标准间' : scope.row.roomType === '2' ? '单人间' : '套间' }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.isBed">
|
||||
<el-tag v-if="scope.row.bedGenderType === '1'" type="primary" size="small">男生</el-tag>
|
||||
<el-tag v-if="scope.row.bedGenderType === '2'" type="danger" size="small">女生</el-tag>
|
||||
<el-tag v-if="scope.row.bedGenderType === '3'" type="info" size="small">混合</el-tag>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-tag v-if="scope.row.buildingType === '1'" type="primary" size="small">男生楼</el-tag>
|
||||
<el-tag v-if="scope.row.buildingType === '2'" type="danger" size="small">女生楼</el-tag>
|
||||
<el-tag v-if="scope.row.buildingType === '3'" type="info" size="small">混合楼</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.isBed">
|
||||
<el-tag v-if="scope.row.studentId" type="warning" size="small">已分配</el-tag>
|
||||
<el-tag v-else type="success" size="small">空闲</el-tag>
|
||||
</template>
|
||||
<span v-else class="text-gray-400">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="学生" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.isBed && scope.row.studentName">{{ scope.row.studentName }}</span>
|
||||
<span v-else-if="scope.row.isBed" class="text-gray-400">—</span>
|
||||
<span v-else class="text-gray-400">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="学号" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.isBed && scope.row.studentNo">{{ scope.row.studentNo }}</span>
|
||||
<span v-else-if="scope.row.isBed" class="text-gray-400">—</span>
|
||||
<span v-else class="text-gray-400">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="性别" width="60" align="center">
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.isBed && scope.row.studentGender !== undefined">
|
||||
<el-tag v-if="scope.row.studentGender === '0'" type="primary" size="small">男</el-tag>
|
||||
<el-tag v-else-if="scope.row.studentGender === '1'" class="female-tag" size="small">女</el-tag>
|
||||
</template>
|
||||
<span v-else-if="scope.row.isBed" class="text-gray-400">—</span>
|
||||
<span v-else class="text-gray-400">—</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm" :disabled="!selectedTargetBed" :loading="confirmLoading">
|
||||
确认{{ transferMode === 'exchange' ? '互换' : '移动' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, watch, nextTick } from 'vue';
|
||||
import { Avatar, House, Switch, Refresh, Right } from '@element-plus/icons-vue';
|
||||
import ElMessage from 'element-plus/es/components/message/index';
|
||||
import ElMessageBox from 'element-plus/es/components/message-box/index';
|
||||
// 导入调宿相关的API方法
|
||||
import { getClassTeacherBedDetails, classTeacherExchangeBeds, classTeacherMoveBed } from '@/api/xg/xgss/dormBedStudent/dormBedStudent';
|
||||
// @ts-expect-error 新添加的API方法,类型定义可能尚未更新
|
||||
import { getClassOccupiedBedDetails, getClassUnoccupiedBedDetails } from '@/api/xg/xgss/dormBedStudent/dormBedStudent';
|
||||
|
||||
// 定义 props
|
||||
const props = defineProps<{
|
||||
title?: string;
|
||||
selectedBed?: any;
|
||||
buildingInfo?: any;
|
||||
classId?: string;
|
||||
parentClassInfo?: any;
|
||||
}>();
|
||||
|
||||
// 定义 emits
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean];
|
||||
success: [];
|
||||
}>();
|
||||
|
||||
// 定义 model
|
||||
const dialogVisible = defineModel<boolean>({ default: false });
|
||||
|
||||
// 状态变量
|
||||
const transferMode = ref<'exchange' | 'move'>('exchange'); // 调宿模式
|
||||
const selectedTargetBed = ref<any>(null); // 选中的目标床位
|
||||
const bedSearchKey = ref(''); // 床位搜索关键字
|
||||
const bedLoading = ref(false); // 床位数据加载状态
|
||||
const confirmLoading = ref(false); // 确认按钮加载状态
|
||||
const expandRowKeys = ref<string[]>([]); // 展开的房间行
|
||||
const bedTableRef = ref(); // 床位表格引用
|
||||
|
||||
// 床位数据
|
||||
const bedList = ref<any[]>([]);
|
||||
|
||||
// 过滤后的床位列表
|
||||
const filteredBedList = computed(() => {
|
||||
if (!bedSearchKey.value) {
|
||||
return bedList.value;
|
||||
}
|
||||
|
||||
const keyword = bedSearchKey.value.toLowerCase();
|
||||
return bedList.value.filter((room) => {
|
||||
if (room.roomName.toLowerCase().includes(keyword)) {
|
||||
return true;
|
||||
}
|
||||
if (room.children) {
|
||||
const hasMatchBed = room.children.some((bed: any) => bed.bedName.toLowerCase().includes(keyword));
|
||||
if (hasMatchBed) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// 监听对话框显示状态
|
||||
watch(dialogVisible, (newVal) => {
|
||||
if (newVal) {
|
||||
loadBedData();
|
||||
} else {
|
||||
resetDialog();
|
||||
}
|
||||
});
|
||||
|
||||
// 监听调宿模式变化
|
||||
const handleModeChange = () => {
|
||||
selectedTargetBed.value = null;
|
||||
bedTableRef.value?.setCurrentRow(null);
|
||||
|
||||
// 根据新的调宿模式重新加载床位数据
|
||||
loadBedData();
|
||||
};
|
||||
|
||||
// 加载床位数据
|
||||
const loadBedData = async () => {
|
||||
if (!props.classId) return;
|
||||
|
||||
bedLoading.value = true;
|
||||
try {
|
||||
let response;
|
||||
if (transferMode.value === 'exchange') {
|
||||
// 互换模式:获取已分配学生的床位信息
|
||||
response = await getClassOccupiedBedDetails(props.classId);
|
||||
} else {
|
||||
// 移动模式:获取未分配学生的床位信息
|
||||
response = await getClassUnoccupiedBedDetails(props.classId);
|
||||
}
|
||||
|
||||
let rawData = response.data || [];
|
||||
|
||||
// 在互换模式下,过滤掉当前选中的床位
|
||||
if (transferMode.value === 'exchange' && props.selectedBed?.id) {
|
||||
const originalCount = rawData.length;
|
||||
rawData = rawData.filter((bed: any) => bed.bedId !== props.selectedBed.id);
|
||||
const filteredCount = rawData.length;
|
||||
console.log(`互换模式过滤当前床位:原始床位 ${originalCount} 个,过滤后 ${filteredCount} 个`);
|
||||
}
|
||||
|
||||
// 根据当前学生性别过滤床位数据
|
||||
const filteredData = filterBedsByGender(rawData);
|
||||
|
||||
// 转换数据格式为树形结构(按房间分组)
|
||||
const processedData = convertToBedTreeData(filteredData);
|
||||
bedList.value = processedData;
|
||||
|
||||
// 自动展开所有房间
|
||||
await nextTick();
|
||||
expandRowKeys.value = processedData.map((room: any) => String(room.id));
|
||||
} catch (error) {
|
||||
console.error('加载床位数据失败', error);
|
||||
ElMessage.error('加载床位数据失败');
|
||||
} finally {
|
||||
bedLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 根据当前学生性别过滤床位数据
|
||||
const filterBedsByGender = (bedDetails: any[]) => {
|
||||
if (!props.selectedBed?.studentGender) {
|
||||
console.warn('当前学生性别信息缺失,跳过性别过滤');
|
||||
return bedDetails; // 如果没有学生性别信息,不进行过滤
|
||||
}
|
||||
|
||||
const currentStudentGender = props.selectedBed.studentGender; // '0'男 '1'女
|
||||
const originalCount = bedDetails.length;
|
||||
|
||||
const filteredBeds = bedDetails.filter((bed: any) => {
|
||||
const bedGenderType = bed.bedGenderType; // '1'男生楼 '2'女生楼 '3'混合楼
|
||||
|
||||
// 混合楼的床位可以分配给任何性别的学生
|
||||
if (bedGenderType === '3') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 男学生只能分配到男生楼的床位
|
||||
if (currentStudentGender === '0' && bedGenderType === '1') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 女学生只能分配到女生楼的床位
|
||||
if (currentStudentGender === '1' && bedGenderType === '2') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
const filteredCount = filteredBeds.length;
|
||||
console.log(`性别过滤结果:原始床位 ${originalCount} 个,过滤后 ${filteredCount} 个(${currentStudentGender === '0' ? '男学生' : '女学生'})`);
|
||||
|
||||
return filteredBeds;
|
||||
};
|
||||
|
||||
// 将床位详情数据转换为树形结构
|
||||
const convertToBedTreeData = (bedDetails: any[]) => {
|
||||
const roomMap = new Map();
|
||||
|
||||
bedDetails.forEach((bed: any) => {
|
||||
const roomKey = `${bed.buildingName}-${bed.roomName}`;
|
||||
|
||||
if (!roomMap.has(roomKey)) {
|
||||
roomMap.set(roomKey, {
|
||||
id: `room_${bed.bedId}_${Math.random()}`, // 使用随机ID避免冲突
|
||||
roomName: bed.roomName,
|
||||
buildingName: bed.buildingName,
|
||||
areaName: bed.areaName,
|
||||
campusName: bed.campusName,
|
||||
roomType: '1', // 默认标准间
|
||||
buildingType: bed.bedGenderType, // 楼栋性别类型
|
||||
isBed: false,
|
||||
children: []
|
||||
});
|
||||
}
|
||||
|
||||
const room = roomMap.get(roomKey);
|
||||
room.children.push({
|
||||
id: bed.bedId,
|
||||
bedName: bed.bedName,
|
||||
bedType: bed.bedType || '0',
|
||||
bedGenderType: bed.bedGenderType, // 床位性别类型:1男生楼 2女生楼 3混合楼
|
||||
studentId: bed.studentId || null,
|
||||
studentName: bed.studentName || null,
|
||||
studentNo: bed.studentNo || null,
|
||||
studentGender: bed.gender || null,
|
||||
roomName: bed.roomName,
|
||||
buildingName: bed.buildingName,
|
||||
areaName: bed.areaName,
|
||||
campusName: bed.campusName,
|
||||
isBed: true
|
||||
});
|
||||
});
|
||||
|
||||
return Array.from(roomMap.values());
|
||||
};
|
||||
|
||||
// 处理床位搜索
|
||||
const handleBedSearch = () => {
|
||||
// 搜索后自动展开所有房间
|
||||
nextTick(() => {
|
||||
if (filteredBedList.value.length > 0) {
|
||||
expandRowKeys.value = filteredBedList.value.map((room) => String(room.id));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 处理行展开
|
||||
const handleExpandChange = (row: any, expanded: boolean) => {
|
||||
const expandKey = String(row.id);
|
||||
if (expanded) {
|
||||
if (!expandRowKeys.value.includes(expandKey)) {
|
||||
expandRowKeys.value.push(expandKey);
|
||||
}
|
||||
} else {
|
||||
const index = expandRowKeys.value.indexOf(expandKey);
|
||||
if (index !== -1) {
|
||||
expandRowKeys.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 处理目标床位选择
|
||||
const handleTargetBedSelection = (currentRow: any) => {
|
||||
if (!currentRow || !currentRow.isBed) {
|
||||
selectedTargetBed.value = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 不能选择当前床位自己
|
||||
if (currentRow.id === props.selectedBed?.id) {
|
||||
ElMessage.warning('不能选择当前床位自己');
|
||||
bedTableRef.value?.setCurrentRow(null);
|
||||
selectedTargetBed.value = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据模式验证选择
|
||||
if (transferMode.value === 'exchange') {
|
||||
// 互换模式:必须选择有学生的床位
|
||||
if (!currentRow.studentId) {
|
||||
ElMessage.warning('互换模式下,请选择有学生的床位');
|
||||
bedTableRef.value?.setCurrentRow(null);
|
||||
selectedTargetBed.value = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 互换模式:验证两个学生的性别是否适合各自的目标床位
|
||||
const currentStudentGender = props.selectedBed?.studentGender;
|
||||
const targetStudentGender = currentRow.studentGender;
|
||||
const currentBedGenderType = props.selectedBed?.bedGenderType;
|
||||
const targetBedGenderType = currentRow.bedGenderType;
|
||||
|
||||
if (currentStudentGender && targetStudentGender && currentBedGenderType && targetBedGenderType) {
|
||||
// 检查当前学生是否适合目标床位
|
||||
const currentStudentCanUseTargetBed =
|
||||
targetBedGenderType === '3' || // 混合楼
|
||||
(currentStudentGender === '0' && targetBedGenderType === '1') || // 男学生到男生楼
|
||||
(currentStudentGender === '1' && targetBedGenderType === '2'); // 女学生到女生楼
|
||||
|
||||
// 检查目标学生是否适合当前床位
|
||||
const targetStudentCanUseCurrentBed =
|
||||
currentBedGenderType === '3' || // 混合楼
|
||||
(targetStudentGender === '0' && currentBedGenderType === '1') || // 男学生到男生楼
|
||||
(targetStudentGender === '1' && currentBedGenderType === '2'); // 女学生到女生楼
|
||||
|
||||
if (!currentStudentCanUseTargetBed || !targetStudentCanUseCurrentBed) {
|
||||
const currentGenderText = currentStudentGender === '0' ? '男生' : '女生';
|
||||
const targetGenderText = targetStudentGender === '0' ? '男生' : '女生';
|
||||
ElMessage.warning(`性别不匹配:${currentGenderText}和${targetGenderText}无法在这两个床位间互换`);
|
||||
bedTableRef.value?.setCurrentRow(null);
|
||||
selectedTargetBed.value = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 移动模式:必须选择空闲床位
|
||||
if (currentRow.studentId) {
|
||||
ElMessage.warning('移动模式下,请选择空闲床位');
|
||||
bedTableRef.value?.setCurrentRow(null);
|
||||
selectedTargetBed.value = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
selectedTargetBed.value = currentRow;
|
||||
};
|
||||
|
||||
// 确认操作
|
||||
const handleConfirm = async () => {
|
||||
if (!selectedTargetBed.value) {
|
||||
ElMessage.warning('请先选择目标床位');
|
||||
return;
|
||||
}
|
||||
|
||||
confirmLoading.value = true;
|
||||
try {
|
||||
const confirmMessage =
|
||||
transferMode.value === 'exchange'
|
||||
? `确认将 ${props.selectedBed.studentName}(${props.selectedBed.roomName}-${props.selectedBed.bedName})与 ${selectedTargetBed.value.studentName}(${selectedTargetBed.value.roomName}-${selectedTargetBed.value.bedName})进行床位互换吗?`
|
||||
: `确认将 ${props.selectedBed.studentName}(${props.selectedBed.roomName}-${props.selectedBed.bedName})移动到 ${selectedTargetBed.value.roomName}-${selectedTargetBed.value.bedName} 吗?`;
|
||||
|
||||
await ElMessageBox.confirm(confirmMessage, '确认调宿', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
// 调用API
|
||||
if (transferMode.value === 'exchange') {
|
||||
// 互换模式:传入两个学生ID
|
||||
await classTeacherExchangeBeds(props.selectedBed.studentId, selectedTargetBed.value.studentId, props.classId);
|
||||
} else {
|
||||
// 移动模式:传入学生ID和目标床位ID
|
||||
await classTeacherMoveBed(props.selectedBed.studentId, selectedTargetBed.value.id, props.classId);
|
||||
}
|
||||
|
||||
ElMessage.success(`${transferMode.value === 'exchange' ? '互换' : '移动'}成功`);
|
||||
emit('success');
|
||||
handleClose();
|
||||
} catch (error: any) {
|
||||
if (error !== 'cancel') {
|
||||
console.error('调宿操作失败', error);
|
||||
ElMessage.error('调宿操作失败');
|
||||
}
|
||||
} finally {
|
||||
confirmLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 关闭对话框
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
// 重置对话框
|
||||
const resetDialog = () => {
|
||||
transferMode.value = 'exchange';
|
||||
selectedTargetBed.value = null;
|
||||
bedSearchKey.value = '';
|
||||
bedList.value = [];
|
||||
expandRowKeys.value = [];
|
||||
confirmLoading.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.bed-transfer-dialog {
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
.transfer-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.current-bed-info .info-header,
|
||||
.transfer-mode .mode-header,
|
||||
.target-bed-area .area-header {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.info-title,
|
||||
.mode-title,
|
||||
.area-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.bed-card {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.bed-info-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.info-item .label {
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.info-item .value {
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.transfer-mode {
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
padding: 16px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.transfer-mode :deep(.el-radio) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.transfer-mode :deep(.el-radio:hover) {
|
||||
background-color: #f0f9ff;
|
||||
}
|
||||
|
||||
.transfer-mode :deep(.el-radio.is-checked) {
|
||||
background-color: #e1f5fe;
|
||||
}
|
||||
|
||||
.mode-desc {
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.target-bed-area .area-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.stats {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.bed-name {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.female-tag {
|
||||
background-color: rgba(255, 105, 180, 0.1) !important;
|
||||
color: #ff69b4 !important;
|
||||
border-color: rgba(255, 105, 180, 0.1) !important;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* 表格样式 */
|
||||
:deep(.el-table) {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
:deep(.el-table .el-table__row) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:deep(.el-table .el-table__row:hover) {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
:deep(.el-table .current-row) {
|
||||
background-color: #e6f7ff !important;
|
||||
}
|
||||
|
||||
:deep(.el-table .current-row:hover) {
|
||||
background-color: #d1eeff !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,519 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :title="title" width="1200px" :before-close="handleClose" destroy-on-close class="selective-allocation-dialog">
|
||||
<div class="allocation-container">
|
||||
<!-- 左侧:床位选择区域 -->
|
||||
<div class="selection-area">
|
||||
<div class="area-header">
|
||||
<h3 class="area-title">
|
||||
<el-icon><House /></el-icon>
|
||||
可用床位选择
|
||||
</h3>
|
||||
<div class="stats">
|
||||
已选择 <el-tag type="primary" size="small">{{ selectedBeds.length }}</el-tag> 个床位
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-bar">
|
||||
<el-input v-model="bedSearchKey" placeholder="搜索房间号、床位号" prefix-icon="Search" clearable @input="handleBedSearch" />
|
||||
</div>
|
||||
|
||||
<div class="bed-list" v-loading="bedLoading">
|
||||
<el-table
|
||||
ref="bedTableRef"
|
||||
:data="filteredBedList"
|
||||
row-key="id"
|
||||
height="400"
|
||||
@selection-change="handleBedSelectionChange"
|
||||
@select-all="handleBedSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" :selectable="checkBedSelectable" />
|
||||
<el-table-column prop="roomName" label="房间" width="100" />
|
||||
<el-table-column prop="bedName" label="床位" width="100" />
|
||||
<el-table-column label="类型" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.bedType === '1'" type="success" size="small">下铺</el-tag>
|
||||
<el-tag v-else-if="scope.row.bedType === '2'" type="warning" size="small">上铺</el-tag>
|
||||
<el-tag v-else-if="scope.row.bedType === '3'" type="danger" size="small">中铺</el-tag>
|
||||
<el-tag v-else type="info" size="small">独立床</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80" align="center">
|
||||
<template #default>
|
||||
<el-tag type="success" size="small">空闲</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 中间:操作区域 -->
|
||||
<div class="operation-area">
|
||||
<div class="match-info">
|
||||
<el-icon class="match-icon"><Connection /></el-icon>
|
||||
<div class="match-stats">
|
||||
<div class="stat-item">
|
||||
<span class="label">床位:</span>
|
||||
<span class="value">{{ selectedBeds.length }}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="label">学生:</span>
|
||||
<span class="value">{{ selectedStudents.length }}</span>
|
||||
</div>
|
||||
<div class="match-status" :class="{ 'matched': isMatched, 'unmatched': !isMatched }">
|
||||
{{ isMatched ? '✓ 数量匹配' : '✗ 数量不匹配' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="allocation-buttons">
|
||||
<el-button type="success" icon="Refresh" :disabled="!isMatched" @click="handleRandomAllocation"> 随机分配 </el-button>
|
||||
<el-button type="primary" icon="Sort" :disabled="!isMatched" @click="handleStudentNoAllocation"> 按学号分配 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧:学生选择区域 -->
|
||||
<div class="selection-area">
|
||||
<div class="area-header">
|
||||
<h3 class="area-title">
|
||||
<el-icon><User /></el-icon>
|
||||
未分配学生选择
|
||||
</h3>
|
||||
<div class="stats">
|
||||
已选择 <el-tag type="warning" size="small">{{ selectedStudents.length }}</el-tag> 名学生
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-bar">
|
||||
<el-input v-model="studentSearchKey" placeholder="搜索学号、姓名" prefix-icon="Search" clearable @input="handleStudentSearch" />
|
||||
</div>
|
||||
|
||||
<div class="student-list" v-loading="studentLoading">
|
||||
<el-table
|
||||
ref="studentTableRef"
|
||||
:data="filteredStudentList"
|
||||
row-key="id"
|
||||
height="400"
|
||||
@selection-change="handleStudentSelectionChange"
|
||||
@select-all="handleStudentSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="studentNo" label="学号" width="120" />
|
||||
<el-table-column prop="studentName" label="姓名" width="100" />
|
||||
<el-table-column label="性别" width="60" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.studentGender === '0'" type="primary" size="small">男</el-tag>
|
||||
<el-tag v-else-if="scope.row.studentGender === '1'" class="female-tag" size="small">女</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="className" label="班级" min-width="120" :show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm" :disabled="!isMatched">确认分配</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch, nextTick } from 'vue';
|
||||
import { House, User, Connection } from '@element-plus/icons-vue';
|
||||
import type { DormBuildingTreeVO } from '@/api/xg/xgss/dormBedStudent/dormBedStudent/types';
|
||||
import {
|
||||
getClassTeacherBedDetails,
|
||||
getClassTeacherUnallocatedStudents,
|
||||
classTeacherSelectiveAllocation
|
||||
} from '@/api/xg/xgss/dormBedStudent/dormBedStudent';
|
||||
import ElMessage from 'element-plus/es/components/message/index';
|
||||
|
||||
// 定义组件选项
|
||||
defineOptions({
|
||||
name: 'SelectiveAllocationDialog'
|
||||
});
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
title?: string;
|
||||
buildingInfo?: DormBuildingTreeVO;
|
||||
classId?: string | number;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: boolean): void;
|
||||
(e: 'success'): void;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
title: '选择性分配床位'
|
||||
});
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 对话框显示状态
|
||||
const dialogVisible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => emit('update:modelValue', value)
|
||||
});
|
||||
|
||||
// 加载状态
|
||||
const bedLoading = ref(false);
|
||||
const studentLoading = ref(false);
|
||||
|
||||
// 搜索关键字
|
||||
const bedSearchKey = ref('');
|
||||
const studentSearchKey = ref('');
|
||||
|
||||
// 表格引用
|
||||
const bedTableRef = ref();
|
||||
const studentTableRef = ref();
|
||||
|
||||
// 数据列表
|
||||
const bedList = ref<any[]>([]);
|
||||
const studentList = ref<any[]>([]);
|
||||
const selectedBeds = ref<any[]>([]);
|
||||
const selectedStudents = ref<any[]>([]);
|
||||
|
||||
// 计算属性:过滤后的列表
|
||||
const filteredBedList = computed(() => {
|
||||
if (!bedSearchKey.value) return bedList.value;
|
||||
const key = bedSearchKey.value.toLowerCase();
|
||||
return bedList.value.filter((bed) => (bed.roomName || '').toLowerCase().includes(key) || (bed.bedName || '').toLowerCase().includes(key));
|
||||
});
|
||||
|
||||
const filteredStudentList = computed(() => {
|
||||
if (!studentSearchKey.value) return studentList.value;
|
||||
const key = studentSearchKey.value.toLowerCase();
|
||||
return studentList.value.filter(
|
||||
(student) => (student.studentNo || '').toLowerCase().includes(key) || (student.studentName || '').toLowerCase().includes(key)
|
||||
);
|
||||
});
|
||||
|
||||
// 计算属性:是否匹配
|
||||
const isMatched = computed(() => {
|
||||
return selectedBeds.value.length > 0 && selectedStudents.value.length > 0 && selectedBeds.value.length === selectedStudents.value.length;
|
||||
});
|
||||
|
||||
// 监听建筑信息变化,加载数据
|
||||
watch(
|
||||
() => props.buildingInfo,
|
||||
async (newValue) => {
|
||||
if (newValue && props.modelValue) {
|
||||
await loadData();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 监听对话框打开,加载数据
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
async (newValue) => {
|
||||
if (newValue && props.buildingInfo) {
|
||||
await loadData();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/** 加载数据 */
|
||||
const loadData = async () => {
|
||||
await Promise.all([loadBedData(), loadStudentData()]);
|
||||
};
|
||||
|
||||
/** 加载床位数据 */
|
||||
const loadBedData = async () => {
|
||||
if (!props.buildingInfo) return;
|
||||
|
||||
bedLoading.value = true;
|
||||
try {
|
||||
const res = await getClassTeacherBedDetails(props.buildingInfo.id as any, props.classId as any);
|
||||
const allBeds: any[] = [];
|
||||
(res.data || []).forEach((room: any) => {
|
||||
if (room.children && room.children.length > 0) {
|
||||
room.children.forEach((bed: any) => {
|
||||
// 只要空闲床位(没有学生分配)
|
||||
if (!bed.studentId && bed.bedStatus !== '2') {
|
||||
allBeds.push({
|
||||
...bed,
|
||||
roomName: room.roomName
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
bedList.value = allBeds;
|
||||
} catch (error) {
|
||||
console.error('获取床位数据失败', error);
|
||||
ElMessage.error('获取床位数据失败');
|
||||
} finally {
|
||||
bedLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 加载学生数据 */
|
||||
const loadStudentData = async () => {
|
||||
studentLoading.value = true;
|
||||
try {
|
||||
const res = await getClassTeacherUnallocatedStudents(props.classId as any);
|
||||
studentList.value = res.data || [];
|
||||
} catch (error) {
|
||||
console.error('获取学生数据失败', error);
|
||||
ElMessage.error('获取学生数据失败');
|
||||
} finally {
|
||||
studentLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 床位搜索 */
|
||||
const handleBedSearch = () => {};
|
||||
/** 学生搜索 */
|
||||
const handleStudentSearch = () => {};
|
||||
|
||||
/** 检查床位是否可选 */
|
||||
const checkBedSelectable = (row: any) => {
|
||||
return !row.studentId && row.bedStatus !== '2';
|
||||
};
|
||||
|
||||
/** 床位选择变化 */
|
||||
const handleBedSelectionChange = (selection: any[]) => {
|
||||
selectedBeds.value = selection;
|
||||
};
|
||||
/** 床位全选 */
|
||||
const handleBedSelectAll = (selection: any[]) => {
|
||||
selectedBeds.value = selection;
|
||||
};
|
||||
|
||||
/** 学生选择变化 */
|
||||
const handleStudentSelectionChange = (selection: any[]) => {
|
||||
selectedStudents.value = selection;
|
||||
};
|
||||
/** 学生全选 */
|
||||
const handleStudentSelectAll = (selection: any[]) => {
|
||||
selectedStudents.value = selection;
|
||||
};
|
||||
|
||||
/** 随机分配 */
|
||||
const handleRandomAllocation = async () => {
|
||||
if (!isMatched.value) {
|
||||
ElMessage.warning('请确保床位和学生数量匹配');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const allocationParams = {
|
||||
bedIds: selectedBeds.value.map((bed) => bed.id),
|
||||
studentIds: selectedStudents.value.map((student) => student.id),
|
||||
allocationType: 'random' as const
|
||||
};
|
||||
|
||||
await classTeacherSelectiveAllocation(allocationParams, props.classId as any);
|
||||
ElMessage.success('随机分配成功');
|
||||
handleSuccess();
|
||||
} catch (error) {
|
||||
ElMessage.error('随机分配失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 按学号分配 */
|
||||
const handleStudentNoAllocation = async () => {
|
||||
if (!isMatched.value) {
|
||||
ElMessage.warning('请确保床位和学生数量匹配');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const allocationParams = {
|
||||
bedIds: selectedBeds.value.map((bed) => bed.id),
|
||||
studentIds: selectedStudents.value.map((student) => student.id),
|
||||
allocationType: 'studentNo' as const
|
||||
};
|
||||
|
||||
await classTeacherSelectiveAllocation(allocationParams, props.classId as any);
|
||||
ElMessage.success('按学号分配成功');
|
||||
handleSuccess();
|
||||
} catch (error) {
|
||||
ElMessage.error('按学号分配失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 确认分配(默认随机) */
|
||||
const handleConfirm = () => {
|
||||
handleRandomAllocation();
|
||||
};
|
||||
|
||||
/** 分配成功处理 */
|
||||
const handleSuccess = () => {
|
||||
emit('success');
|
||||
handleClose();
|
||||
};
|
||||
|
||||
/** 关闭对话框 */
|
||||
const handleClose = () => {
|
||||
selectedBeds.value = [];
|
||||
selectedStudents.value = [];
|
||||
bedSearchKey.value = '';
|
||||
studentSearchKey.value = '';
|
||||
bedList.value = [];
|
||||
studentList.value = [];
|
||||
|
||||
nextTick(() => {
|
||||
bedTableRef.value?.clearSelection();
|
||||
studentTableRef.value?.clearSelection();
|
||||
});
|
||||
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.selective-allocation-dialog :deep(.el-dialog__body) {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.allocation-container {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.selection-area {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.area-header {
|
||||
background: #f5f7fa;
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.area-title {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.stats {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.bed-list,
|
||||
.student-list {
|
||||
flex: 1;
|
||||
padding: 15px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.operation-area {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 30px;
|
||||
padding: 20px;
|
||||
background: #fafafa;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.match-info {
|
||||
text-align: center;
|
||||
}
|
||||
.match-icon {
|
||||
font-size: 32px;
|
||||
color: #909399;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.match-stats {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.stat-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.label {
|
||||
color: #606266;
|
||||
}
|
||||
.value {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
.match-status {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.match-status.matched {
|
||||
background: #f0f9ff;
|
||||
color: #67c23a;
|
||||
border: 1px solid #b3e19d;
|
||||
}
|
||||
.match-status.unmatched {
|
||||
background: #fef0f0;
|
||||
color: #f56c6c;
|
||||
border: 1px solid #f5c6cb;
|
||||
}
|
||||
|
||||
.allocation-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
width: 100%;
|
||||
}
|
||||
.allocation-buttons .el-button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.female-tag {
|
||||
background-color: rgba(255, 105, 180, 0.1) !important;
|
||||
color: #ff69b4 !important;
|
||||
border-color: rgba(255, 105, 180, 0.1) !important;
|
||||
}
|
||||
|
||||
.selection-area :deep(.el-table) {
|
||||
border: none;
|
||||
}
|
||||
.selection-area :deep(.el-table__header) {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
.selection-area :deep(.el-table th) {
|
||||
background: #f8f9fa !important;
|
||||
color: #606266;
|
||||
font-weight: 600;
|
||||
}
|
||||
.selection-area :deep(.el-table td) {
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
.selection-area :deep(.el-table__row:hover > td) {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,518 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 搜索表单区域 -->
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检查标题" prop="checkTitle">
|
||||
<el-input v-model="queryParams.checkTitle" placeholder="请输入检查标题" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检查日期" prop="checkDate">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="queryParams.checkDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择检查日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检查类型" prop="checkType">
|
||||
<el-select v-model="queryParams.checkType" placeholder="请选择检查类型" clearable>
|
||||
<el-option v-for="dict in xg_dorm_hygiene_check_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检查级别" prop="checkLevel">
|
||||
<el-select v-model="queryParams.checkLevel" placeholder="请选择检查级别" clearable>
|
||||
<el-option v-for="dict in xg_dorm_hygiene_check_level" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="卫生等级" prop="hygieneGrade">
|
||||
<el-select v-model="queryParams.hygieneGrade" placeholder="请选择卫生等级" clearable>
|
||||
<el-option v-for="dict in xg_dorm_hygiene_grade" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form-item class="search-buttons">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 数据表格区域 -->
|
||||
<el-card shadow="never" class="table-container">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dormHygieneCheck:dormHygieneCheck:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate()"
|
||||
v-hasPermi="['dormHygieneCheck:dormHygieneCheck:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dormHygieneCheck:dormHygieneCheck:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="dormHygieneCheckList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="false" />
|
||||
<el-table-column label="检查标题" align="center" prop="checkTitle" />
|
||||
<el-table-column label="检查日期" align="center" prop="checkDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查类型" align="center" prop="checkType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="xg_dorm_hygiene_check_type" :value="scope.row.checkType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查级别" align="center" prop="checkLevel">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="xg_dorm_hygiene_check_level" :value="scope.row.checkLevel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="房间名称" align="center" prop="roomName" />
|
||||
<el-table-column label="宿舍楼名称" align="center" prop="buildingName" />
|
||||
<el-table-column label="宿舍区名称" align="center" prop="areaName" />
|
||||
<el-table-column label="校区名称" align="center" prop="campusName" />
|
||||
<el-table-column label="宿舍总分" align="center" prop="totalScore" />
|
||||
<el-table-column label="卫生等级" align="center" prop="hygieneGrade">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="xg_dorm_hygiene_grade" :value="scope.row.hygieneGrade" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="120">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['dormHygieneCheck:dormHygieneCheck:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dormHygieneCheck:dormHygieneCheck:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 宿舍卫生检查弹窗组件 -->
|
||||
<DormHygieneCheckDialog
|
||||
v-model="dialog.visible"
|
||||
:title="dialog.title"
|
||||
:form-data="form"
|
||||
@submit="handleDialogSubmit"
|
||||
@close="handleDialogClose"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DormHygieneCheck" lang="ts">
|
||||
import { ref, reactive, toRefs, onMounted, getCurrentInstance, ComponentInternalInstance, watch } from 'vue';
|
||||
import ElMessage from 'element-plus/es/components/message/index';
|
||||
import ElMessageBox from 'element-plus/es/components/message-box/index';
|
||||
import ElLoading from 'element-plus/es/components/loading/index';
|
||||
import {
|
||||
listDormHygieneCheck,
|
||||
getDormHygieneCheck,
|
||||
delDormHygieneCheck,
|
||||
addDormHygieneCheck,
|
||||
updateDormHygieneCheck,
|
||||
exportDormHygieneCheck
|
||||
} from '@/api/xg/xgss/dormHygieneCheck/dormHygieneCheck';
|
||||
import {
|
||||
DormHygieneCheckVO,
|
||||
DormHygieneCheckQuery,
|
||||
DormHygieneCheckForm,
|
||||
DormHygieneCheckCompleteForm
|
||||
} from '@/api/xg/xgss/dormHygieneCheck/dormHygieneCheck/types';
|
||||
import DormHygieneCheckDialog from './DormHygieneCheckDialog.vue';
|
||||
|
||||
// 类型定义
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface PageData<T, Q> {
|
||||
form: T;
|
||||
queryParams: Q;
|
||||
rules: Record<string, any>;
|
||||
}
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { xg_dorm_hygiene_check_level, xg_dorm_hygiene_check_type, xg_dorm_hygiene_grade } = toRefs<any>(
|
||||
proxy?.useDict('xg_dorm_hygiene_check_level', 'xg_dorm_hygiene_check_type', 'xg_dorm_hygiene_grade')
|
||||
);
|
||||
|
||||
const dormHygieneCheckList = ref<DormHygieneCheckVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: DormHygieneCheckForm = {
|
||||
id: undefined,
|
||||
deleted: undefined,
|
||||
checkTitle: undefined,
|
||||
checkDate: new Date().toISOString().slice(0, 19).replace('T', ' '),
|
||||
checkerId: undefined,
|
||||
checkerName: undefined,
|
||||
checkType: '1',
|
||||
checkLevel: '1',
|
||||
roomId: undefined,
|
||||
roomCode: undefined,
|
||||
roomName: undefined,
|
||||
buildingId: undefined,
|
||||
buildingName: undefined,
|
||||
areaId: undefined,
|
||||
areaName: undefined,
|
||||
campusId: undefined,
|
||||
campusName: undefined,
|
||||
totalScore: undefined,
|
||||
hygieneGrade: 'A',
|
||||
attachmentIds: undefined,
|
||||
checkSummary: undefined,
|
||||
improvementSuggestions: undefined,
|
||||
checkRemarks: undefined
|
||||
};
|
||||
|
||||
const data = reactive<PageData<DormHygieneCheckForm, DormHygieneCheckQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deleted: undefined,
|
||||
checkTitle: undefined,
|
||||
checkDate: undefined,
|
||||
checkerId: undefined,
|
||||
checkerName: undefined,
|
||||
checkType: undefined,
|
||||
checkLevel: undefined,
|
||||
roomId: undefined,
|
||||
roomCode: undefined,
|
||||
roomName: undefined,
|
||||
buildingId: undefined,
|
||||
buildingName: undefined,
|
||||
areaId: undefined,
|
||||
areaName: undefined,
|
||||
campusId: undefined,
|
||||
campusName: undefined,
|
||||
totalScore: undefined,
|
||||
hygieneGrade: undefined,
|
||||
attachmentIds: undefined,
|
||||
checkSummary: undefined,
|
||||
improvementSuggestions: undefined,
|
||||
checkRemarks: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
checkTitle: [{ required: true, message: '检查标题不能为空', trigger: 'blur' }],
|
||||
checkDate: [{ required: true, message: '检查日期不能为空', trigger: 'blur' }],
|
||||
roomId: [{ required: true, message: '宿舍房间ID不能为空', trigger: 'blur' }],
|
||||
roomName: [{ required: true, message: '房间名称不能为空', trigger: 'blur' }],
|
||||
buildingId: [{ required: true, message: '宿舍楼ID不能为空', trigger: 'blur' }],
|
||||
buildingName: [{ required: true, message: '宿舍楼名称不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询宿舍卫生检查列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await listDormHygieneCheck(queryParams.value);
|
||||
dormHygieneCheckList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
console.error('查询列表失败:', error);
|
||||
ElMessage.error('查询列表失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 弹窗关闭事件处理 */
|
||||
const handleDialogClose = () => {
|
||||
dialog.visible = false;
|
||||
reset();
|
||||
};
|
||||
|
||||
/** 弹窗提交事件处理 */
|
||||
const handleDialogSubmit = async (formData: DormHygieneCheckCompleteForm) => {
|
||||
try {
|
||||
if (formData.id) {
|
||||
await updateDormHygieneCheck(formData);
|
||||
} else {
|
||||
await addDormHygieneCheck(formData);
|
||||
}
|
||||
ElMessage.success('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
ElMessage.error('操作失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
const currentUser = proxy?.$store?.state?.user || {};
|
||||
const resetData = {
|
||||
...initFormData,
|
||||
checkDate: new Date().toISOString().slice(0, 19).replace('T', ' '),
|
||||
checkerId: currentUser.userId || undefined,
|
||||
checkerName: currentUser.nickName || undefined
|
||||
};
|
||||
form.value = resetData;
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DormHygieneCheckVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加宿舍卫生检查';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DormHygieneCheckVO) => {
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改宿舍卫生检查';
|
||||
|
||||
const loadingInstance = ElLoading.service({
|
||||
target: '.el-dialog__body',
|
||||
text: '正在加载数据...',
|
||||
background: 'rgba(255, 255, 255, 0.8)'
|
||||
});
|
||||
|
||||
try {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDormHygieneCheck(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
} catch (error) {
|
||||
console.error('加载编辑数据失败:', error);
|
||||
ElMessage.error('加载数据失败,请重试');
|
||||
dialog.visible = false;
|
||||
} finally {
|
||||
loadingInstance.close();
|
||||
}
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DormHygieneCheckVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
try {
|
||||
await ElMessageBox.confirm('是否确认删除宿舍卫生检查编号为"' + _ids + '"的数据项?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
await delDormHygieneCheck(_ids);
|
||||
ElMessage.success('删除成功');
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('删除失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
// try {
|
||||
// ElMessage.info('正在导出数据,请稍候...');
|
||||
// const res = await exportDormHygieneCheck(queryParams.value);
|
||||
|
||||
// // 创建下载链接
|
||||
// const blob = new Blob([res.data], {
|
||||
// type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
// });
|
||||
// const url = window.URL.createObjectURL(blob);
|
||||
// const link = document.createElement('a');
|
||||
// link.href = url;
|
||||
// link.download = `宿舍卫生检查数据_${new Date().toISOString().slice(0, 10)}.xlsx`;
|
||||
|
||||
// // 触发下载
|
||||
// document.body.appendChild(link);
|
||||
// link.click();
|
||||
// document.body.removeChild(link);
|
||||
// window.URL.revokeObjectURL(url);
|
||||
|
||||
// ElMessage.success('导出成功');
|
||||
// } catch (error) {
|
||||
// console.error('导出失败:', error);
|
||||
// ElMessage.error('导出失败,请重试');
|
||||
// }
|
||||
proxy?.download(
|
||||
'dormHygieneCheck/dormHygieneCheck/advancedExport',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`宿舍卫生检查数据_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 主容器样式 */
|
||||
.dorm-hygiene-check-container {
|
||||
padding: 16px;
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 搜索表单容器 */
|
||||
.search-form-container {
|
||||
margin-bottom: 16px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* 表格容器 */
|
||||
.table-container {
|
||||
margin-top: 16px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* 搜索按钮样式 */
|
||||
.search-buttons {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.search-buttons .el-form-item__content {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* 工具类 */
|
||||
.mb8 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 确保卡片间距正确 */
|
||||
.el-card {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.el-card:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* 防止重复显示的关键样式 */
|
||||
.dorm-hygiene-check-container > * {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dorm-hygiene-check-container > *:not(:first-child) {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
/* 确保过渡动画正常工作 */
|
||||
.search-form-container {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
/* 表格样式优化 */
|
||||
.el-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 分页样式 */
|
||||
.pagination-container {
|
||||
margin-top: 16px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.dorm-hygiene-check-container {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.search-form-container,
|
||||
.table-container {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,457 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="删除标志" prop="deleted">
|
||||
<el-input v-model="queryParams.deleted" placeholder="请输入删除标志" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="卫生检查ID,关联xg_dorm_hygiene_check.id" prop="hygieneCheckId">
|
||||
<el-input
|
||||
v-model="queryParams.hygieneCheckId"
|
||||
placeholder="请输入卫生检查ID,关联xg_dorm_hygiene_check.id"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="学生ID,关联xg_student_msg.id" prop="studentId">
|
||||
<el-input v-model="queryParams.studentId" placeholder="请输入学生ID,关联xg_student_msg.id" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班级ID" prop="classId">
|
||||
<el-input v-model="queryParams.classId" placeholder="请输入班级ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班级名称" prop="className">
|
||||
<el-input v-model="queryParams.className" placeholder="请输入班级名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专业ID" prop="majorId">
|
||||
<el-input v-model="queryParams.majorId" placeholder="请输入专业ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专业名称" prop="majorName">
|
||||
<el-input v-model="queryParams.majorName" placeholder="请输入专业名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学院ID" prop="collegeId">
|
||||
<el-input v-model="queryParams.collegeId" placeholder="请输入学院ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学院名称" prop="collegeName">
|
||||
<el-input v-model="queryParams.collegeName" placeholder="请输入学院名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="床位ID,关联xg_dorm_bed.id" prop="bedId">
|
||||
<el-input v-model="queryParams.bedId" placeholder="请输入床位ID,关联xg_dorm_bed.id" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="床位编号" prop="bedCode">
|
||||
<el-input v-model="queryParams.bedCode" placeholder="请输入床位编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生个人得分" prop="studentScore">
|
||||
<el-input v-model="queryParams.studentScore" placeholder="请输入学生个人得分" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否在寝" prop="attendanceStatus">
|
||||
<el-select v-model="queryParams.attendanceStatus" placeholder="请选择是否在寝" clearable>
|
||||
<el-option v-for="dict in xg_student_attendance_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学生评级" prop="studentGrade">
|
||||
<el-select v-model="queryParams.studentGrade" placeholder="请选择学生评级" clearable>
|
||||
<el-option v-for="dict in xg_dorm_hygiene_grade" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否为寝室长" prop="isResponsiblePerson">
|
||||
<el-select v-model="queryParams.isResponsiblePerson" placeholder="请选择是否为寝室长" clearable>
|
||||
<el-option v-for="dict in sys_yesno" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="评分备注" prop="scoreRemarks">
|
||||
<el-input v-model="queryParams.scoreRemarks" placeholder="请输入评分备注" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="改进意见" prop="improvementNotes">
|
||||
<el-input v-model="queryParams.improvementNotes" placeholder="请输入改进意见" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dormHygieneStudentScore:dormHygieneStudentScore:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate()"
|
||||
v-hasPermi="['dormHygieneStudentScore:dormHygieneStudentScore:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['dormHygieneStudentScore:dormHygieneStudentScore:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['dormHygieneStudentScore:dormHygieneStudentScore:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="dormHygieneStudentScoreList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="删除标志" align="center" prop="deleted" />
|
||||
<el-table-column label="卫生检查ID,关联xg_dorm_hygiene_check.id" align="center" prop="hygieneCheckId" />
|
||||
<el-table-column label="学生ID,关联xg_student_msg.id" align="center" prop="studentId" />
|
||||
<el-table-column label="学号" align="center" prop="studentNo" />
|
||||
<el-table-column label="学生姓名" align="center" prop="studentName" />
|
||||
<el-table-column label="班级ID" align="center" prop="classId" />
|
||||
<el-table-column label="班级名称" align="center" prop="className" />
|
||||
<el-table-column label="专业ID" align="center" prop="majorId" />
|
||||
<el-table-column label="专业名称" align="center" prop="majorName" />
|
||||
<el-table-column label="学院ID" align="center" prop="collegeId" />
|
||||
<el-table-column label="学院名称" align="center" prop="collegeName" />
|
||||
<el-table-column label="床位ID,关联xg_dorm_bed.id" align="center" prop="bedId" />
|
||||
<el-table-column label="床位编号" align="center" prop="bedCode" />
|
||||
<el-table-column label="学生个人得分" align="center" prop="studentScore" />
|
||||
<el-table-column label="是否在寝" align="center" prop="attendanceStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="xg_student_attendance_status" :value="scope.row.attendanceStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="学生评级" align="center" prop="studentGrade">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="xg_dorm_hygiene_grade" :value="scope.row.studentGrade" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否为寝室长" align="center" prop="isResponsiblePerson">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.isResponsiblePerson" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分备注" align="center" prop="scoreRemarks" />
|
||||
<el-table-column label="改进意见" align="center" prop="improvementNotes" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['dormHygieneStudentScore:dormHygieneStudentScore:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dormHygieneStudentScore:dormHygieneStudentScore:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改宿舍卫生检查学生评分对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="dormHygieneStudentScoreFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="删除标志" prop="deleted">
|
||||
<el-input v-model="form.deleted" placeholder="请输入删除标志" />
|
||||
</el-form-item>
|
||||
<el-form-item label="卫生检查ID,关联xg_dorm_hygiene_check.id" prop="hygieneCheckId">
|
||||
<el-input v-model="form.hygieneCheckId" placeholder="请输入卫生检查ID,关联xg_dorm_hygiene_check.id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生ID,关联xg_student_msg.id" prop="studentId">
|
||||
<el-input v-model="form.studentId" placeholder="请输入学生ID,关联xg_student_msg.id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="form.studentNo" placeholder="请输入学号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="form.studentName" placeholder="请输入学生姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班级ID" prop="classId">
|
||||
<el-input v-model="form.classId" placeholder="请输入班级ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班级名称" prop="className">
|
||||
<el-input v-model="form.className" placeholder="请输入班级名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专业ID" prop="majorId">
|
||||
<el-input v-model="form.majorId" placeholder="请输入专业ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专业名称" prop="majorName">
|
||||
<el-input v-model="form.majorName" placeholder="请输入专业名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学院ID" prop="collegeId">
|
||||
<el-input v-model="form.collegeId" placeholder="请输入学院ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学院名称" prop="collegeName">
|
||||
<el-input v-model="form.collegeName" placeholder="请输入学院名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="床位ID,关联xg_dorm_bed.id" prop="bedId">
|
||||
<el-input v-model="form.bedId" placeholder="请输入床位ID,关联xg_dorm_bed.id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="床位编号" prop="bedCode">
|
||||
<el-input v-model="form.bedCode" placeholder="请输入床位编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生个人得分" prop="studentScore">
|
||||
<el-input v-model="form.studentScore" placeholder="请输入学生个人得分" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否在寝" prop="attendanceStatus">
|
||||
<el-select v-model="form.attendanceStatus" placeholder="请选择是否在寝">
|
||||
<el-option v-for="dict in xg_student_attendance_status" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学生评级" prop="studentGrade">
|
||||
<el-select v-model="form.studentGrade" placeholder="请选择学生评级">
|
||||
<el-option v-for="dict in xg_dorm_hygiene_grade" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否为寝室长" prop="isResponsiblePerson">
|
||||
<el-select v-model="form.isResponsiblePerson" placeholder="请选择是否为寝室长">
|
||||
<el-option v-for="dict in sys_yesno" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="评分备注" prop="scoreRemarks">
|
||||
<el-input v-model="form.scoreRemarks" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="改进意见" prop="improvementNotes">
|
||||
<el-input v-model="form.improvementNotes" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DormHygieneStudentScore" lang="ts">
|
||||
import {
|
||||
listDormHygieneStudentScore,
|
||||
getDormHygieneStudentScore,
|
||||
delDormHygieneStudentScore,
|
||||
addDormHygieneStudentScore,
|
||||
updateDormHygieneStudentScore
|
||||
} from '@/api/xg/xgss/dormHygieneStudentScore/dormHygieneStudentScore';
|
||||
import {
|
||||
DormHygieneStudentScoreVO,
|
||||
DormHygieneStudentScoreQuery,
|
||||
DormHygieneStudentScoreForm
|
||||
} from '@/api/xg/xgss/dormHygieneStudentScore/dormHygieneStudentScore/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { xg_dorm_hygiene_grade, xg_student_attendance_status, sys_yesno } = toRefs<any>(
|
||||
proxy?.useDict('xg_dorm_hygiene_grade', 'xg_student_attendance_status', 'sys_yesno')
|
||||
);
|
||||
|
||||
const dormHygieneStudentScoreList = ref<DormHygieneStudentScoreVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const dormHygieneStudentScoreFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: DormHygieneStudentScoreForm = {
|
||||
id: undefined,
|
||||
deleted: undefined,
|
||||
hygieneCheckId: undefined,
|
||||
studentId: undefined,
|
||||
studentNo: undefined,
|
||||
studentName: undefined,
|
||||
classId: undefined,
|
||||
className: undefined,
|
||||
majorId: undefined,
|
||||
majorName: undefined,
|
||||
collegeId: undefined,
|
||||
collegeName: undefined,
|
||||
bedId: undefined,
|
||||
bedCode: undefined,
|
||||
studentScore: undefined,
|
||||
attendanceStatus: undefined,
|
||||
studentGrade: undefined,
|
||||
isResponsiblePerson: undefined,
|
||||
scoreRemarks: undefined,
|
||||
improvementNotes: undefined
|
||||
};
|
||||
const data = reactive<PageData<DormHygieneStudentScoreForm, DormHygieneStudentScoreQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deleted: undefined,
|
||||
hygieneCheckId: undefined,
|
||||
studentId: undefined,
|
||||
studentNo: undefined,
|
||||
studentName: undefined,
|
||||
classId: undefined,
|
||||
className: undefined,
|
||||
majorId: undefined,
|
||||
majorName: undefined,
|
||||
collegeId: undefined,
|
||||
collegeName: undefined,
|
||||
bedId: undefined,
|
||||
bedCode: undefined,
|
||||
studentScore: undefined,
|
||||
attendanceStatus: undefined,
|
||||
studentGrade: undefined,
|
||||
isResponsiblePerson: undefined,
|
||||
scoreRemarks: undefined,
|
||||
improvementNotes: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
hygieneCheckId: [{ required: true, message: '卫生检查ID,关联xg_dorm_hygiene_check.id不能为空', trigger: 'blur' }],
|
||||
studentId: [{ required: true, message: '学生ID,关联xg_student_msg.id不能为空', trigger: 'blur' }],
|
||||
studentNo: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
|
||||
studentName: [{ required: true, message: '学生姓名不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询宿舍卫生检查学生评分列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDormHygieneStudentScore(queryParams.value);
|
||||
dormHygieneStudentScoreList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
dormHygieneStudentScoreFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DormHygieneStudentScoreVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加宿舍卫生检查学生评分';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DormHygieneStudentScoreVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDormHygieneStudentScore(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改宿舍卫生检查学生评分';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
dormHygieneStudentScoreFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateDormHygieneStudentScore(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addDormHygieneStudentScore(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DormHygieneStudentScoreVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除宿舍卫生检查学生评分编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delDormHygieneStudentScore(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'dormHygieneStudentScore/dormHygieneStudentScore/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`dormHygieneStudentScore_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" :title="title" width="500px" append-to-body @close="closeDialog">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="床位编号" prop="bedCode">
|
||||
<el-input v-model="form.bedCode" placeholder="请输入床位编号" maxlength="20" />
|
||||
</el-form-item>
|
||||
<el-form-item label="床位名称" prop="bedName">
|
||||
<el-input v-model="form.bedName" placeholder="请输入床位名称" maxlength="20" />
|
||||
</el-form-item>
|
||||
<el-form-item label="床位状态" prop="bedStatus">
|
||||
<el-radio-group v-model="form.bedStatus">
|
||||
<el-radio label="0">空闲</el-radio>
|
||||
<el-radio label="1" disabled>已分配</el-radio>
|
||||
<el-radio label="2">维修中</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="床位类型" prop="bedType">
|
||||
<el-radio-group v-model="form.bedType">
|
||||
<el-radio label="1">下铺</el-radio>
|
||||
<el-radio label="2">上铺</el-radio>
|
||||
<el-radio label="3">中铺</el-radio>
|
||||
<el-radio label="4">独立床</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import { DormBedForm } from '@/api/xg/xgss/dormBed/types';
|
||||
import { addDormBed, updateDormBed, getDormBed } from '@/api/xg/xgss/dormBed';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
title: string;
|
||||
bedId?: string | number;
|
||||
roomId: string | number;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'success']);
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const visible = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const initFormData: DormBedForm = {
|
||||
id: '',
|
||||
bedCode: '',
|
||||
bedName: '',
|
||||
roomId: '',
|
||||
bedStatus: '0',
|
||||
bedType: '4',
|
||||
remark: ''
|
||||
};
|
||||
|
||||
const form = reactive<DormBedForm>({ ...initFormData });
|
||||
|
||||
// 表单校验规则
|
||||
const rules = reactive<FormRules>({
|
||||
bedCode: [{ required: true, message: '床位编号不能为空', trigger: 'blur' }],
|
||||
bedName: [{ required: true, message: '床位名称不能为空', trigger: 'blur' }],
|
||||
bedStatus: [{ required: true, message: '床位状态不能为空', trigger: 'change' }],
|
||||
bedType: [{ required: true, message: '床位类型不能为空', trigger: 'change' }]
|
||||
});
|
||||
|
||||
// 监听visible属性变化
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
visible.value = val;
|
||||
if (val) {
|
||||
resetForm();
|
||||
// 设置表单初始值
|
||||
form.roomId = props.roomId;
|
||||
// 编辑模式,获取床位详情
|
||||
if (props.bedId) {
|
||||
console.log('开始获取床位详情, bedId:', props.bedId);
|
||||
getDormBed(props.bedId)
|
||||
.then((res) => {
|
||||
console.log('获取床位详情成功:', res.data);
|
||||
if (res.data) {
|
||||
Object.assign(form, res.data);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取床位详情失败', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听visible变化,同步回父组件
|
||||
watch(
|
||||
() => visible.value,
|
||||
(val) => {
|
||||
emit('update:modelValue', val);
|
||||
}
|
||||
);
|
||||
|
||||
// 关闭对话框
|
||||
const closeDialog = () => {
|
||||
visible.value = false;
|
||||
resetForm();
|
||||
};
|
||||
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
Object.assign(form, { ...initFormData });
|
||||
formRef.value?.resetFields();
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid) => {
|
||||
if (valid) {
|
||||
try {
|
||||
if (props.bedId) {
|
||||
// 修改
|
||||
form.id = props.bedId;
|
||||
await updateDormBed(form);
|
||||
} else {
|
||||
// 新增
|
||||
await addDormBed(form);
|
||||
}
|
||||
closeDialog();
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('操作失败', error);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 添加默认导出以支持导入
|
||||
defineOptions({
|
||||
name: 'BedDialog'
|
||||
});
|
||||
</script>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" :title="title" width="500px" append-to-body @close="closeDialog">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="楼层" prop="floorNum">
|
||||
<el-input v-model="form.floorNum" placeholder="请输入楼层" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="房间编号" prop="roomCode">
|
||||
<el-input v-model="form.roomCode" placeholder="请输入房间编号" maxlength="20" />
|
||||
</el-form-item>
|
||||
<el-form-item label="房间名称" prop="roomName">
|
||||
<el-input v-model="form.roomName" placeholder="请输入房间名称" maxlength="20" />
|
||||
</el-form-item>
|
||||
<el-form-item label="房间类型" prop="roomType">
|
||||
<el-select v-model="form.roomType" placeholder="请选择房间类型" clearable style="width: 100%">
|
||||
<el-option label="标准间" value="1" />
|
||||
<el-option label="单人间" value="2" />
|
||||
<el-option label="套间" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="床位数量" prop="actualBeds">
|
||||
<el-input-number v-model="form.actualBeds" :min="1" :max="8" controls-position="right" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="房间面积" prop="roomArea">
|
||||
<el-input v-model="form.roomArea" placeholder="请输入房间面积" maxlength="20">
|
||||
<template #append>
|
||||
<span style="color: #000; background: transparent">平方米</span>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="房间状态" prop="roomStatus">
|
||||
<el-radio-group v-model="form.roomStatus">
|
||||
<el-radio label="0">正常</el-radio>
|
||||
<el-radio label="1">维修中</el-radio>
|
||||
<el-radio label="2">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import { DormRoomForm, DormRoomVO } from '@/api/xg/xgss/dormRoom/types';
|
||||
import { addDormRoom, updateDormRoom } from '@/api/xg/xgss/dormRoom';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
title: string;
|
||||
roomId?: string | number;
|
||||
floorNum: number;
|
||||
buildingId: string | number;
|
||||
room?: DormRoomVO;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'success']);
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const visible = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const initFormData: DormRoomForm = {
|
||||
id: undefined,
|
||||
roomCode: '',
|
||||
roomName: '',
|
||||
floorNum: 1,
|
||||
buildingId: '',
|
||||
actualBeds: 4,
|
||||
roomArea: 0,
|
||||
roomType: '1',
|
||||
roomStatus: '0',
|
||||
remark: ''
|
||||
};
|
||||
|
||||
const form = reactive<DormRoomForm>({ ...initFormData });
|
||||
|
||||
// 表单校验规则
|
||||
const rules = reactive<FormRules>({
|
||||
roomCode: [{ required: true, message: '房间编号不能为空', trigger: 'blur' }],
|
||||
roomName: [{ required: true, message: '房间名称不能为空', trigger: 'blur' }],
|
||||
floorNum: [{ required: true, message: '楼层不能为空', trigger: 'blur' }],
|
||||
actualBeds: [{ required: true, message: '床位数量不能为空', trigger: 'change' }],
|
||||
roomType: [{ required: true, message: '房间类型不能为空', trigger: 'change' }],
|
||||
roomStatus: [{ required: true, message: '房间状态不能为空', trigger: 'change' }]
|
||||
});
|
||||
|
||||
// 监听visible属性变化
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
visible.value = val;
|
||||
if (val) {
|
||||
// 完全重置表单,确保没有残留数据
|
||||
resetForm();
|
||||
|
||||
// 重新设置基本参数
|
||||
form.floorNum = props.floorNum;
|
||||
form.buildingId = props.buildingId;
|
||||
|
||||
// 如果是编辑模式且有room数据,填充表单数据
|
||||
if (props.room) {
|
||||
Object.keys(form).forEach((key) => {
|
||||
if (key in props.room) {
|
||||
form[key] = props.room[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听visible变化,同步回父组件
|
||||
watch(
|
||||
() => visible.value,
|
||||
(val) => {
|
||||
emit('update:modelValue', val);
|
||||
}
|
||||
);
|
||||
|
||||
// 关闭对话框
|
||||
const closeDialog = () => {
|
||||
visible.value = false;
|
||||
resetForm();
|
||||
};
|
||||
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
// 使用深拷贝确保完全重置
|
||||
Object.keys(form).forEach((key) => {
|
||||
form[key] = initFormData[key];
|
||||
});
|
||||
formRef.value?.resetFields();
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid) => {
|
||||
if (valid) {
|
||||
try {
|
||||
console.log(props.roomId);
|
||||
if (props.roomId) {
|
||||
// 修改
|
||||
form.id = props.roomId;
|
||||
await updateDormRoom(form);
|
||||
} else {
|
||||
// 新增
|
||||
await addDormRoom(form);
|
||||
}
|
||||
closeDialog();
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('操作失败', error);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 添加默认导出以支持导入
|
||||
defineOptions({
|
||||
name: 'RoomDialog'
|
||||
});
|
||||
</script>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -55,7 +55,7 @@
|
||||
|
||||
<!-- 学生树 -->
|
||||
<el-card shadow="hover" class="tree-card mt-4">
|
||||
<div class="card-header-title">学生信息</div>
|
||||
<div class="card-header-title">学院床位需求信息(已分配/总需求)</div>
|
||||
<el-input
|
||||
v-model="studentSearchKey"
|
||||
prefix-icon="Search"
|
||||
@@ -133,6 +133,28 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" icon="check" size="small" @click="handleAddRoom">分配给二级学院</el-button>
|
||||
<el-button type="warning" icon="RefreshLeft" size="small" @click="handleBatchRecall">批量收回宿舍</el-button>
|
||||
<el-button type="danger" icon="UserFilled" size="small" @click="handleBatchStayaway">批量退宿床位</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12" style="text-align: right">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
:loading="expandAllLoading"
|
||||
:disabled="expandAllLoading || selectionLoading || loading"
|
||||
@click="expandAll"
|
||||
>全部展开</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
:loading="collapseAllLoading"
|
||||
:disabled="collapseAllLoading || selectionLoading || loading"
|
||||
@click="collapseAll"
|
||||
>全部收起</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -170,10 +192,12 @@
|
||||
<!-- 房间及床位树形表格 -->
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
v-loading="loading"
|
||||
v-loading="loading || selectionLoading || expandAllLoading || collapseAllLoading"
|
||||
element-loading-text="处理中..."
|
||||
:data="roomList"
|
||||
row-key="id"
|
||||
border
|
||||
:height="tableMaxHeight"
|
||||
:expand-row-keys="expandedRowKeys"
|
||||
@expand-change="handleExpandChange"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
@@ -183,10 +207,16 @@
|
||||
:row-class-name="getRowClassName"
|
||||
>
|
||||
<el-table-column type="selection" width="55" :selectable="checkSelectable" />
|
||||
<el-table-column prop="roomName" label="房间/宿舍名称" min-width="160">
|
||||
<el-table-column prop="roomName" label="房间/宿舍名称" min-width="180">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isBed">{{ scope.row.roomName }} (房间)</span>
|
||||
<span v-else>{{ scope.row.bedName }} (床位)</span>
|
||||
<span v-if="!scope.row.isBed" class="inline-flex items-center gap-1 whitespace-nowrap">
|
||||
<el-icon><House /></el-icon>
|
||||
{{ scope.row.roomName }}
|
||||
</span>
|
||||
<span v-else class="inline-flex items-center gap-1 whitespace-nowrap">
|
||||
<el-icon><Avatar /></el-icon>
|
||||
{{ scope.row.bedName }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="floorNum" label="楼层" width="80" align="center">
|
||||
@@ -327,8 +357,8 @@
|
||||
</template>
|
||||
|
||||
<script setup name="DormRoomTreeManagement" lang="ts">
|
||||
import { ref, computed, reactive, onMounted, nextTick, watch, getCurrentInstance } from 'vue';
|
||||
import { InfoFilled } from '@element-plus/icons-vue';
|
||||
import { ref, computed, reactive, onMounted, onUnmounted, nextTick, watch, getCurrentInstance } from 'vue';
|
||||
import { InfoFilled, House, Avatar, UserFilled } from '@element-plus/icons-vue';
|
||||
import type { DormTreeNode, BedInfo } from '@/api/xg/xgss/xsssfjgl/types';
|
||||
import type { DormRoomVO } from '@/api/xg/xgss/dormRoom/types';
|
||||
import type { DormBedDetailVO } from '@/api/xg/xgss/dormBed/types';
|
||||
@@ -344,6 +374,7 @@ import ElMessageBox from 'element-plus/es/components/message-box/index';
|
||||
import RoomDialog from './components/RoomDialog.vue';
|
||||
import BedDialog from './components/BedDialog.vue';
|
||||
import CollegeAllocationDialog from './components/CollegeAllocationDialog.vue';
|
||||
import { batchRecallDormBeds, classTeacherStayawaySelectedBeds } from '@/api/xg/xgss/dormBedStudent/dormBedStudent';
|
||||
|
||||
// const { proxy } = getCurrentInstance();
|
||||
|
||||
@@ -356,6 +387,17 @@ const showSearch = ref(true);
|
||||
const loading = ref(false);
|
||||
const expandedRowKeys = ref<string[]>([]);
|
||||
|
||||
// 窗口高度响应式变量
|
||||
const windowHeight = ref(window.innerHeight);
|
||||
|
||||
// 加载状态:展开/收起/选择
|
||||
const expandAllLoading = ref(false);
|
||||
const collapseAllLoading = ref(false);
|
||||
const selectionLoading = ref(false);
|
||||
|
||||
// 小延迟,确保加载动画先渲染
|
||||
const delay = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
// 选择状态
|
||||
const selectedRows = ref<any[]>([]);
|
||||
const selectedRoomCount = ref(0);
|
||||
@@ -427,6 +469,30 @@ const studentTreeRef = ref();
|
||||
const studentSearchKey = ref('');
|
||||
const studentTreeData = ref<XgStudentTreeVO[]>([]);
|
||||
|
||||
// 表格最大高度计算
|
||||
const tableMaxHeight = computed(() => {
|
||||
// 根据不同屏幕尺寸动态调整预留空间
|
||||
let reservedHeight = 320; // 基础预留高度(考虑到搜索区域、操作按钮、统计信息等内容)
|
||||
|
||||
if (windowHeight.value < 768) {
|
||||
// 小屏幕(手机/平板)- 预留更多空间
|
||||
reservedHeight = 380;
|
||||
} else if (windowHeight.value < 1024) {
|
||||
// 中等屏幕
|
||||
reservedHeight = 350;
|
||||
} else {
|
||||
// 大屏幕 - 预留较少空间,充分利用屏幕
|
||||
reservedHeight = 320;
|
||||
}
|
||||
|
||||
return Math.max(400, windowHeight.value - reservedHeight);
|
||||
});
|
||||
|
||||
// 处理窗口大小变化
|
||||
const handleResize = () => {
|
||||
windowHeight.value = window.innerHeight;
|
||||
};
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value: string, data: DormTreeNode) => {
|
||||
if (!value) return true;
|
||||
@@ -643,6 +709,94 @@ const handleAddRoom = () => {
|
||||
collegeAllocationDialog.visible = true;
|
||||
};
|
||||
|
||||
/** 批量收回宿舍 */
|
||||
const handleBatchRecall = async () => {
|
||||
if (!selectedBuilding.value) {
|
||||
ElMessage.warning('请先选择宿舍楼');
|
||||
return;
|
||||
}
|
||||
const selectedBeds = selectedRows.value.filter((row) => row.isBed).map((row) => row.id);
|
||||
if (selectedBeds.length === 0) {
|
||||
ElMessage.warning('请先选择要收回的床位');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const content = `确认收回选中的 ${selectedBeds.length} 个床位吗?\n\n重要提示:回收后,学生已分配的宿舍都会回收,无法恢复`;
|
||||
await ElMessageBox.confirm(content, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await batchRecallDormBeds({ bedIds: selectedBeds });
|
||||
ElMessage.success('批量收回成功');
|
||||
// 刷新数据
|
||||
selectableRowsCache.value = [];
|
||||
loadRoomData();
|
||||
} catch (e) {
|
||||
ElMessage.error('批量收回失败');
|
||||
console.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
/** 批量退宿床位 */
|
||||
const handleBatchStayaway = async () => {
|
||||
if (!selectedBuilding.value) {
|
||||
ElMessage.warning('请先选择宿舍楼');
|
||||
return;
|
||||
}
|
||||
const selectedBeds = selectedRows.value.filter((row) => row.isBed).map((row) => row.id);
|
||||
if (selectedBeds.length === 0) {
|
||||
ElMessage.warning('请先选择要退宿的床位');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const content = `确认退宿选中的 ${selectedBeds.length} 个床位吗?\n\n重要提示:退宿后,这些床位上学生的床位信息将被清空,同时该床位归还学校。`;
|
||||
await ElMessageBox.confirm(content, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await classTeacherStayawaySelectedBeds(selectedBeds);
|
||||
ElMessage.success('批量退宿成功');
|
||||
// 刷新数据
|
||||
selectableRowsCache.value = [];
|
||||
loadRoomData();
|
||||
} catch (e) {
|
||||
ElMessage.error('批量退宿失败');
|
||||
console.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
/** 全部展开 */
|
||||
const expandAll = async () => {
|
||||
if (expandAllLoading.value || selectionLoading.value || !roomList.value?.length) return;
|
||||
expandAllLoading.value = true;
|
||||
await nextTick();
|
||||
await delay(16);
|
||||
expandedRowKeys.value = roomList.value.map((room) => String(room.id));
|
||||
await nextTick();
|
||||
expandAllLoading.value = false;
|
||||
};
|
||||
|
||||
/** 全部收起 */
|
||||
const collapseAll = async () => {
|
||||
if (collapseAllLoading.value || selectionLoading.value) return;
|
||||
collapseAllLoading.value = true;
|
||||
await nextTick();
|
||||
await delay(16);
|
||||
expandedRowKeys.value = [];
|
||||
await nextTick();
|
||||
collapseAllLoading.value = false;
|
||||
};
|
||||
|
||||
/** 编辑房间 */
|
||||
const handleEditRoom = (row: any) => {
|
||||
roomDialog.title = '编辑房间';
|
||||
@@ -727,6 +881,8 @@ const handleCollegeAllocationSuccess = () => {
|
||||
selectableRowsCache.value = [];
|
||||
// 刷新房间和床位数据
|
||||
loadRoomData();
|
||||
// 刷新学生信息树数据
|
||||
getStudentTreeData();
|
||||
// 清空选择状态
|
||||
isUpdatingSelection.value = true;
|
||||
try {
|
||||
@@ -741,13 +897,13 @@ const handleCollegeAllocationSuccess = () => {
|
||||
|
||||
/** 处理行的展开/收起 */
|
||||
const handleExpandChange = (row: any, expanded: boolean) => {
|
||||
const rowId = String(row.roomId);
|
||||
const expandKey = String(row.id);
|
||||
if (expanded) {
|
||||
// 添加到已展开行数组
|
||||
expandedRowKeys.value.push(rowId);
|
||||
expandedRowKeys.value.push(expandKey);
|
||||
} else {
|
||||
// 从已展开行数组中移除
|
||||
const index = expandedRowKeys.value.findIndex((key) => key === rowId);
|
||||
const index = expandedRowKeys.value.findIndex((key) => key === expandKey);
|
||||
if (index !== -1) {
|
||||
expandedRowKeys.value.splice(index, 1);
|
||||
}
|
||||
@@ -854,7 +1010,10 @@ const getAllSelectableRows = () => {
|
||||
const selectableRowsCache = ref<any[]>([]);
|
||||
|
||||
/** 处理全选事件 */
|
||||
const handleSelectAll = (selection: any[]) => {
|
||||
const handleSelectAll = async (selection: any[]) => {
|
||||
if (selectionLoading.value) return;
|
||||
|
||||
selectionLoading.value = true;
|
||||
// 避免在全选操作时触发联动逻辑
|
||||
isUpdatingSelection.value = true;
|
||||
|
||||
@@ -862,6 +1021,9 @@ const handleSelectAll = (selection: any[]) => {
|
||||
// 判断是全选还是取消全选
|
||||
const isSelectAll = selection.length > 0;
|
||||
|
||||
await nextTick();
|
||||
await delay(16);
|
||||
|
||||
if (isSelectAll) {
|
||||
console.log('================>全选0');
|
||||
// 全选操作:选择所有可用的行(包括房间和床位)
|
||||
@@ -892,6 +1054,7 @@ const handleSelectAll = (selection: any[]) => {
|
||||
}
|
||||
} finally {
|
||||
isUpdatingSelection.value = false;
|
||||
selectionLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1029,6 +1192,14 @@ onMounted(() => {
|
||||
currentController.abort();
|
||||
currentController = null;
|
||||
}
|
||||
|
||||
// 添加窗口大小变化监听器
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
|
||||
// 组件卸载时移除事件监听器
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1284,4 +1455,8 @@ onMounted(() => {
|
||||
.el-table :deep(.bed-row:hover) {
|
||||
background-color: #e8f0f5 !important; /* 床位行hover时的深一点灰色 */
|
||||
}
|
||||
|
||||
:deep(.el-table--default .cell) {
|
||||
color: #000000 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,695 @@
|
||||
<template>
|
||||
<div class="checkin-container">
|
||||
<!-- 顶部状态卡片 -->
|
||||
<el-card class="status-card" shadow="hover">
|
||||
<div class="status-header">
|
||||
<div class="user-info">
|
||||
<el-avatar :size="60" :src="userInfo.avatar" icon="UserFilled" />
|
||||
<div class="info-text">
|
||||
<h3>{{ userInfo.studentName || userInfo.nickName }}</h3>
|
||||
<p>学号:{{ userInfo.studentNumber || '未设置' }}</p>
|
||||
<p>班级:{{ userInfo.className || '未设置' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="time-info">
|
||||
<div class="current-time">{{ currentTime }}</div>
|
||||
<div class="current-date">{{ currentDate }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 签到区域 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-card class="checkin-card" shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon class="header-icon"><Clock /></el-icon>
|
||||
<span>签到打卡</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="checkin-content">
|
||||
<!-- 签到状态显示 -->
|
||||
<div class="status-display">
|
||||
<div v-if="todayRecord.checkInTime" class="checked-in">
|
||||
<el-icon class="status-icon success"><SuccessFilled /></el-icon>
|
||||
<div class="status-text">
|
||||
<h4>已签到</h4>
|
||||
<p>{{ todayRecord.checkInTime }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="not-checked-in">
|
||||
<el-icon class="status-icon waiting"><Clock /></el-icon>
|
||||
<div class="status-text">
|
||||
<h4>未签到</h4>
|
||||
<p>请点击下方按钮进行签到</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 签到按钮 -->
|
||||
<div class="checkin-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
:disabled="todayRecord.checkInTime || loading"
|
||||
:loading="loading"
|
||||
@click="handleCheckIn"
|
||||
class="checkin-btn"
|
||||
>
|
||||
<el-icon><Location /></el-icon>
|
||||
{{ todayRecord.checkInTime ? '已签到' : '立即签到' }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 位置信息 -->
|
||||
<div class="location-info" v-if="locationInfo.address">
|
||||
<el-icon><MapPin /></el-icon>
|
||||
<span>{{ locationInfo.address }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-card class="checkout-card" shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon class="header-icon"><Clock /></el-icon>
|
||||
<span>签退打卡</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="checkout-content">
|
||||
<!-- 签退状态显示 -->
|
||||
<div class="status-display">
|
||||
<div v-if="todayRecord.checkOutTime" class="checked-out">
|
||||
<el-icon class="status-icon success"><SuccessFilled /></el-icon>
|
||||
<div class="status-text">
|
||||
<h4>已签退</h4>
|
||||
<p>{{ parseTime(todayRecord.checkOutTime, '{h}:{i}') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="not-checked-out">
|
||||
<el-icon class="status-icon waiting"><Clock /></el-icon>
|
||||
<div class="status-text">
|
||||
<h4>未签退</h4>
|
||||
<p>{{ todayRecord.checkInTime ? '可以进行签退' : '请先签到' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 签退按钮 -->
|
||||
<div class="checkout-actions">
|
||||
<el-button
|
||||
type="success"
|
||||
size="large"
|
||||
:disabled="!todayRecord.checkInTime || todayRecord.checkOutTime || loading"
|
||||
:loading="loading"
|
||||
@click="handleCheckOut"
|
||||
class="checkout-btn"
|
||||
>
|
||||
<el-icon><Location /></el-icon>
|
||||
{{ todayRecord.checkOutTime ? '已签退' : '立即签退' }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 工作时长 -->
|
||||
<div class="duration-info" v-if="todayRecord.workDuration">
|
||||
<el-icon><Timer /></el-icon>
|
||||
<span>工作时长:{{ todayRecord.workDuration }}小时</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 工作内容填写 -->
|
||||
<el-card class="work-content-card" shadow="hover" v-if="todayRecord.checkInTime">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon class="header-icon"><Edit /></el-icon>
|
||||
<span>今日工作内容</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="work-content">
|
||||
<el-form ref="workFormRef" :model="workForm" label-width="100px">
|
||||
<el-form-item label="工作内容" prop="workContent">
|
||||
<el-input
|
||||
v-model="workForm.workContent"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请详细描述今日的工作内容..."
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="workForm.remark"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="可填写工作心得、遇到的问题等..."
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="saveWorkContent" :loading="saving">
|
||||
<el-icon><DocumentAdd /></el-icon>
|
||||
保存工作内容
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 最近记录 -->
|
||||
<el-card class="recent-records-card" shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon class="header-icon"><List /></el-icon>
|
||||
<span>最近考勤记录</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="recent-records">
|
||||
<el-table :data="recentRecords" style="width: 100%">
|
||||
<el-table-column label="日期" width="120">
|
||||
<template #default="scope">
|
||||
{{ parseTime(scope.row.checkDate, '{m}-{d}') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签到时间" width="100">
|
||||
<template #default="scope">
|
||||
{{ scope.row.checkInTime || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签退时间" width="100">
|
||||
<template #default="scope">
|
||||
{{ scope.row.checkOutTime || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作时长" width="100">
|
||||
<template #default="scope">
|
||||
{{ scope.row.workDuration ? scope.row.workDuration + 'h' : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusType(scope.row.status)" size="small">
|
||||
{{ getStatusText(scope.row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作内容" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ scope.row.workContent || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="InternshipCheckin">
|
||||
import { checkIn } from '@/api/zsjy/internshipDaily';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const saving = ref(false);
|
||||
const currentTime = ref('');
|
||||
const currentDate = ref('');
|
||||
const userInfo = ref({});
|
||||
const todayRecord = ref({});
|
||||
const recentRecords = ref([]);
|
||||
const locationInfo = ref({});
|
||||
|
||||
// 工作内容表单
|
||||
const workForm = ref({
|
||||
workContent: '',
|
||||
remark: ''
|
||||
});
|
||||
|
||||
// 获取用户信息
|
||||
const getUserInfo = () => {
|
||||
// 从store或接口获取用户信息
|
||||
userInfo.value = {
|
||||
studentName: '张三',
|
||||
studentNumber: '20230001',
|
||||
className: '计算机科学与技术2023-1班',
|
||||
avatar: ''
|
||||
};
|
||||
};
|
||||
|
||||
// 获取今日考勤记录
|
||||
const getTodayRecord = () => {
|
||||
// 调用接口获取今日考勤记录
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
// 这里应该调用实际的API
|
||||
todayRecord.value = {
|
||||
checkDate: today,
|
||||
checkInTime: null,
|
||||
checkOutTime: null,
|
||||
workDuration: null,
|
||||
status: '0'
|
||||
};
|
||||
};
|
||||
|
||||
// 获取最近考勤记录
|
||||
const getRecentRecords = () => {
|
||||
// 调用接口获取最近7天的考勤记录
|
||||
recentRecords.value = [
|
||||
{
|
||||
checkDate: '2024-01-15',
|
||||
checkInTime: '2024-01-15 09:00:00',
|
||||
checkOutTime: '2024-01-15 18:00:00',
|
||||
workDuration: 8,
|
||||
status: '1',
|
||||
workContent: '参与项目开发,完成用户模块设计'
|
||||
}
|
||||
// 更多记录...
|
||||
];
|
||||
};
|
||||
|
||||
// 获取地理位置
|
||||
const getLocation = () => {
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
const { latitude, longitude } = position.coords;
|
||||
locationInfo.value = {
|
||||
latitude,
|
||||
longitude,
|
||||
address: '获取位置中...'
|
||||
};
|
||||
// 调用地图API获取详细地址
|
||||
getAddressFromCoords(latitude, longitude);
|
||||
},
|
||||
(error) => {
|
||||
console.error('获取位置失败:', error);
|
||||
proxy.$modal.msgError('获取位置失败,请检查浏览器权限设置');
|
||||
}
|
||||
);
|
||||
} else {
|
||||
proxy.$modal.msgError('浏览器不支持地理位置功能');
|
||||
}
|
||||
};
|
||||
|
||||
// 根据坐标获取地址
|
||||
const getAddressFromCoords = (lat, lng) => {
|
||||
// 这里可以调用高德地图、百度地图等API
|
||||
// 模拟地址信息
|
||||
setTimeout(() => {
|
||||
locationInfo.value.address = '浙江省杭州市西湖区某某大厦';
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
// 处理签到
|
||||
const handleCheckIn = async () => {
|
||||
if (!locationInfo.value.latitude) {
|
||||
proxy.$modal.msgError('请先获取位置信息');
|
||||
getLocation();
|
||||
return;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
|
||||
try {
|
||||
const checkInData = {
|
||||
checkInLocation: locationInfo.value.address,
|
||||
latitude: locationInfo.value.latitude,
|
||||
longitude: locationInfo.value.longitude,
|
||||
checkInTime: new Date().toISOString()
|
||||
};
|
||||
|
||||
await checkIn(checkInData);
|
||||
|
||||
proxy.$modal.msgSuccess('签到成功');
|
||||
getTodayRecord(); // 刷新今日记录
|
||||
getRecentRecords(); // 刷新最近记录
|
||||
} catch (error) {
|
||||
console.error('签到失败:', error);
|
||||
proxy.$modal.msgError('签到失败,请重试');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 处理签退
|
||||
const handleCheckOut = async () => {
|
||||
if (!locationInfo.value.latitude) {
|
||||
proxy.$modal.msgError('请先获取位置信息');
|
||||
getLocation();
|
||||
return;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
|
||||
try {
|
||||
const checkOutData = {
|
||||
checkOutLocation: locationInfo.value.address,
|
||||
latitude: locationInfo.value.latitude,
|
||||
longitude: locationInfo.value.longitude,
|
||||
checkOutTime: new Date().toISOString()
|
||||
};
|
||||
|
||||
// 调用签退接口
|
||||
// await checkOut(checkOutData);
|
||||
|
||||
proxy.$modal.msgSuccess('签退成功');
|
||||
getTodayRecord(); // 刷新今日记录
|
||||
getRecentRecords(); // 刷新最近记录
|
||||
} catch (error) {
|
||||
console.error('签退失败:', error);
|
||||
proxy.$modal.msgError('签退失败,请重试');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 保存工作内容
|
||||
const saveWorkContent = async () => {
|
||||
if (!workForm.value.workContent.trim()) {
|
||||
proxy.$modal.msgError('请填写工作内容');
|
||||
return;
|
||||
}
|
||||
|
||||
saving.value = true;
|
||||
|
||||
try {
|
||||
// 调用保存工作内容的接口
|
||||
// await updateWorkContent(workForm.value);
|
||||
|
||||
proxy.$modal.msgSuccess('工作内容保存成功');
|
||||
getTodayRecord(); // 刷新今日记录
|
||||
} catch (error) {
|
||||
console.error('保存失败:', error);
|
||||
proxy.$modal.msgError('保存失败,请重试');
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 获取状态类型
|
||||
const getStatusType = (status) => {
|
||||
const statusMap = {
|
||||
'0': 'info',
|
||||
'1': 'success',
|
||||
'2': 'warning',
|
||||
'3': 'danger'
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
};
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status) => {
|
||||
const statusMap = {
|
||||
'0': '未签到',
|
||||
'1': '正常',
|
||||
'2': '迟到',
|
||||
'3': '早退'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
};
|
||||
|
||||
// 更新时间
|
||||
const updateTime = () => {
|
||||
const now = new Date();
|
||||
currentTime.value = now.toLocaleTimeString('zh-CN', {
|
||||
hour12: false,
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit'
|
||||
});
|
||||
currentDate.value = now.toLocaleDateString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
weekday: 'long'
|
||||
});
|
||||
};
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getUserInfo();
|
||||
getTodayRecord();
|
||||
getRecentRecords();
|
||||
getLocation();
|
||||
updateTime();
|
||||
|
||||
// 每秒更新时间
|
||||
setInterval(updateTime, 1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.checkin-container {
|
||||
padding: 20px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
|
||||
.status-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.status-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
|
||||
.info-text {
|
||||
h3 {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 2px 0;
|
||||
opacity: 0.9;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.time-info {
|
||||
text-align: right;
|
||||
|
||||
.current-time {
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.current-date {
|
||||
font-size: 16px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.checkin-card,
|
||||
.checkout-card {
|
||||
border-radius: 12px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
|
||||
.header-icon {
|
||||
font-size: 18px;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
.checkin-content,
|
||||
.checkout-content {
|
||||
text-align: center;
|
||||
padding: 20px 0;
|
||||
|
||||
.status-display {
|
||||
margin-bottom: 24px;
|
||||
|
||||
.checked-in,
|
||||
.checked-out,
|
||||
.not-checked-in,
|
||||
.not-checked-out {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
.status-icon {
|
||||
font-size: 48px;
|
||||
|
||||
&.success {
|
||||
color: #67c23a;
|
||||
}
|
||||
|
||||
&.waiting {
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.status-text {
|
||||
h4 {
|
||||
margin: 0 0 4px 0;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
color: #909399;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.checkin-actions,
|
||||
.checkout-actions {
|
||||
margin-bottom: 16px;
|
||||
|
||||
.checkin-btn,
|
||||
.checkout-btn {
|
||||
width: 200px;
|
||||
height: 48px;
|
||||
font-size: 16px;
|
||||
border-radius: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.location-info,
|
||||
.duration-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.work-content-card,
|
||||
.recent-records-card {
|
||||
border-radius: 12px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
|
||||
.header-icon {
|
||||
font-size: 18px;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
.work-content {
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.recent-records {
|
||||
:deep(.el-table) {
|
||||
.el-table__header-wrapper {
|
||||
th {
|
||||
background-color: #f8f9fa;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table__row {
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.checkin-container {
|
||||
padding: 12px;
|
||||
|
||||
.status-header {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
gap: 16px;
|
||||
|
||||
.user-info {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.time-info {
|
||||
text-align: center;
|
||||
|
||||
.current-time {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.checkin-btn,
|
||||
.checkout-btn {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 动画效果 */
|
||||
.checkin-card,
|
||||
.checkout-card,
|
||||
.work-content-card,
|
||||
.recent-records-card {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.checkin-btn,
|
||||
.checkout-btn {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 20px rgba(64, 158, 255, 0.3);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,864 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 搜索区域 -->
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<!-- 第一行:4个搜索条件 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学号" prop="studentNumber">
|
||||
<el-input v-model="queryParams.studentNumber" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="实习单位" prop="companyName">
|
||||
<el-input v-model="queryParams.companyName" placeholder="请输入实习单位" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="签到状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择签到状态" clearable style="width: 100%">
|
||||
<el-option label="已签到" value="1" />
|
||||
<el-option label="未签到" value="0" />
|
||||
<el-option label="迟到" value="2" />
|
||||
<el-option label="早退" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第二行:日期筛选 + 操作按钮 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签到日期">
|
||||
<el-date-picker
|
||||
v-model="daterangeCheckTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="handleQuery"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 统计卡片区域 -->
|
||||
<div class="mb-[10px]">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stat-card stat-card-primary">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><User /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.totalStudents || 0 }}</div>
|
||||
<div class="stat-label">实习学生总数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stat-card stat-card-success">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><SuccessFilled /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.todayCheckedIn || 0 }}</div>
|
||||
<div class="stat-label">今日已签到</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stat-card stat-card-warning">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><WarningFilled /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.todayLate || 0 }}</div>
|
||||
<div class="stat-label">今日迟到</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stat-card stat-card-info">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Clock /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.attendanceRate || '0%' }}</div>
|
||||
<div class="stat-label">本月出勤率</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<el-card shadow="never" class="button-card">
|
||||
<div class="card-header-vertical">
|
||||
<div class="toolbar-title">实习日常管理</div>
|
||||
<div class="button-group">
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['zsjy:internshipdaily:add']">新增签到</el-button>
|
||||
<el-button plain icon="Search" @click="showSearch = !showSearch">搜索</el-button>
|
||||
<el-button type="primary" plain icon="Download" @click="handleExport" v-hasPermi="['zsjy:internshipdaily:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-card shadow="never" class="table-card">
|
||||
<div class="table-container">
|
||||
<el-table
|
||||
ref="internshipDailyTableRef"
|
||||
v-loading="loading"
|
||||
:data="internshipDailyList"
|
||||
row-key="id"
|
||||
class="scroll-table"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
|
||||
<el-table-column label="学生信息" min-width="180" align="left">
|
||||
<template #default="scope">
|
||||
<div class="student-info">
|
||||
<div class="student-name">{{ scope.row.studentName }}</div>
|
||||
<div class="student-number">学号:{{ scope.row.studentNumber }}</div>
|
||||
<!-- <div class="student-class">班级:{{ scope.row.className }}</div> -->
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="实习单位" prop="companyName" min-width="150" align="left" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="签到时间" min-width="120" align="center">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.checkInTime">
|
||||
<div>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</div>
|
||||
<div class="time-detail">{{ scope.row.checkInTime }}</div>
|
||||
</div>
|
||||
<span v-else class="text-danger">未签到</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="签退时间" min-width="120" align="center">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.checkOutTime">
|
||||
<div>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</div>
|
||||
<div class="time-detail">{{ scope.row.checkOutTime }}</div>
|
||||
</div>
|
||||
<span v-else class="text-muted">未签退</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="工作时长" min-width="100" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.workDuration">{{ scope.row.workDuration }}小时</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="签到状态" min-width="100" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="attendanceStatusOptions" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="签到地点" prop="checkInLocation" min-width="150" align="left" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="工作内容" prop="workContent" min-width="200" align="left" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="操作" width="120" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<div class="action-buttons">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="查看日历" placement="top">
|
||||
<el-button link type="success" icon="Calendar" @click="handleCalendar(scope.row)" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<div class="pagination-container">
|
||||
<pagination v-show="total > 0" :total="total" :page="queryParams.pageNum" :limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog title="考勤详情" v-model="viewDialogVisible" width="600px" append-to-body>
|
||||
<div v-if="currentRecord" class="detail-container">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="学生姓名">{{ currentRecord.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">{{ currentRecord.studentNumber }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ currentRecord.className }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实习单位">{{ currentRecord.companyName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="签到时间">
|
||||
{{ currentRecord.checkInTime || '未签到' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签退时间">
|
||||
{{ currentRecord.checkOutTime || '未签退' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工作时长">
|
||||
{{ currentRecord.workDuration ? currentRecord.workDuration + '小时' : '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签到状态">
|
||||
<dict-tag :options="attendanceStatusOptions" :value="currentRecord.status" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签到地点" :span="2">{{ currentRecord.checkInLocation || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工作内容" :span="2">
|
||||
<div style="white-space: pre-wrap">{{ currentRecord.workContent || '-' }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">
|
||||
<div style="white-space: pre-wrap">{{ currentRecord.remark || '-' }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer-right">
|
||||
<el-button @click="viewDialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 考勤日历对话框 -->
|
||||
<el-dialog title="考勤日历" v-model="calendarDialogVisible" width="800px" append-to-body>
|
||||
<div v-if="currentStudent" class="calendar-container">
|
||||
<div class="calendar-header">
|
||||
<h4>{{ currentStudent.studentName }}({{ currentStudent.studentNumber }})的考勤记录</h4>
|
||||
<el-date-picker
|
||||
v-model="calendarMonth"
|
||||
type="month"
|
||||
placeholder="选择月份"
|
||||
format="YYYY年MM月"
|
||||
value-format="YYYY-MM"
|
||||
@change="handleMonthChange"
|
||||
/>
|
||||
</div>
|
||||
<el-calendar v-model="calendarDate">
|
||||
<template #date-cell="{ data }">
|
||||
<div class="calendar-day">
|
||||
<div class="day-number">{{ data.day.split('-').slice(2).join('') }}</div>
|
||||
<div v-if="getAttendanceStatus(data.day)" class="attendance-status">
|
||||
<el-tag :type="getStatusTagType(getAttendanceStatus(data.day))" size="small">
|
||||
{{ getStatusText(getAttendanceStatus(data.day)) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-calendar>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer-right">
|
||||
<el-button @click="calendarDialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 新增签到对话框 -->
|
||||
<el-dialog title="新增签到记录" v-model="addDialogVisible" width="600px" append-to-body>
|
||||
<el-form ref="addFormRef" :model="addForm" :rules="addFormRules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="addForm.studentName" placeholder="请输入学生姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNumber">
|
||||
<el-input v-model="addForm.studentNumber" placeholder="请输入学号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="addForm.className" placeholder="请输入班级" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习单位" prop="companyName">
|
||||
<el-input v-model="addForm.companyName" placeholder="请输入实习单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签到时间" prop="checkInTime">
|
||||
<el-date-picker
|
||||
v-model="addForm.checkInTime"
|
||||
type="datetime"
|
||||
placeholder="选择签到时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签退时间" prop="checkOutTime">
|
||||
<el-date-picker
|
||||
v-model="addForm.checkOutTime"
|
||||
type="datetime"
|
||||
placeholder="选择签退时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签到状态" prop="status">
|
||||
<el-select v-model="addForm.status" placeholder="请选择签到状态" style="width: 100%">
|
||||
<el-option v-for="item in attendanceStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工作时长" prop="workDuration">
|
||||
<el-input-number v-model="addForm.workDuration" :min="0" :max="24" :precision="1" placeholder="工作时长(小时)" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="签到地点" prop="checkInLocation">
|
||||
<el-input v-model="addForm.checkInLocation" placeholder="请输入签到地点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工作内容" prop="workContent">
|
||||
<el-input v-model="addForm.workContent" type="textarea" :rows="3" placeholder="请输入工作内容" maxlength="500" show-word-limit />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="addForm.remark" type="textarea" :rows="2" placeholder="请输入备注" maxlength="200" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer-right">
|
||||
<el-button @click="cancelAdd">取消</el-button>
|
||||
<el-button type="primary" @click="submitAdd" :loading="addLoading">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="InternshipDaily" lang="ts">
|
||||
import { listInternshipDaily, getCalendar, getStatistics, addInternshipDaily } from '@/api/zsjy/internshipDaily';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { User, Check, Warning, TrendCharts } from '@element-plus/icons-vue';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
// 响应式数据
|
||||
const internshipDailyList = ref([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const daterangeCheckTime = ref([]);
|
||||
const viewDialogVisible = ref(false);
|
||||
const calendarDialogVisible = ref(false);
|
||||
const currentRecord = ref(null);
|
||||
const currentStudent = ref(null);
|
||||
const calendarMonth = ref('');
|
||||
const calendarDate = ref(new Date());
|
||||
const calendarData = ref([]);
|
||||
const statistics = ref({});
|
||||
const addDialogVisible = ref(false);
|
||||
const addLoading = ref(false);
|
||||
|
||||
// 新增表单数据
|
||||
const addForm = ref({
|
||||
studentName: '',
|
||||
studentNumber: '',
|
||||
className: '',
|
||||
companyName: '',
|
||||
checkInTime: '',
|
||||
checkOutTime: '',
|
||||
workDuration: null,
|
||||
status: '1',
|
||||
checkInLocation: '',
|
||||
workContent: '',
|
||||
remark: ''
|
||||
});
|
||||
|
||||
// 新增表单验证规则
|
||||
const addFormRules = ref({
|
||||
studentName: [{ required: true, message: '请输入学生姓名', trigger: 'blur' }],
|
||||
studentNumber: [{ required: true, message: '请输入学号', trigger: 'blur' }],
|
||||
className: [{ required: true, message: '请输入班级', trigger: 'blur' }],
|
||||
companyName: [{ required: true, message: '请输入实习单位', trigger: 'blur' }],
|
||||
checkInTime: [{ required: true, message: '请选择签到时间', trigger: 'change' }],
|
||||
status: [{ required: true, message: '请选择签到状态', trigger: 'change' }]
|
||||
});
|
||||
|
||||
// 查询参数
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
studentName: '',
|
||||
studentNumber: '',
|
||||
companyName: '',
|
||||
status: '',
|
||||
checkTimeStart: '',
|
||||
checkTimeEnd: ''
|
||||
});
|
||||
|
||||
// 字典数据
|
||||
const attendanceStatusOptions = ref([
|
||||
{ label: '未签到', value: '0', elTagType: 'info' },
|
||||
{ label: '已签到', value: '1', elTagType: 'success' },
|
||||
{ label: '迟到', value: '2', elTagType: 'warning' },
|
||||
{ label: '早退', value: '3', elTagType: 'danger' }
|
||||
]);
|
||||
|
||||
// 查询列表
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
|
||||
// 处理日期范围
|
||||
if (daterangeCheckTime.value && daterangeCheckTime.value.length === 2) {
|
||||
queryParams.value.checkTimeStart = daterangeCheckTime.value[0];
|
||||
queryParams.value.checkTimeEnd = daterangeCheckTime.value[1];
|
||||
} else {
|
||||
queryParams.value.checkTimeStart = '';
|
||||
queryParams.value.checkTimeEnd = '';
|
||||
}
|
||||
|
||||
listInternshipDaily(queryParams.value).then((response) => {
|
||||
internshipDailyList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 获取统计数据
|
||||
const getStatisticsData = () => {
|
||||
console.log('正在获取统计数据...');
|
||||
getStatistics()
|
||||
.then((response) => {
|
||||
console.log('统计数据响应:', response);
|
||||
statistics.value = response.data || {};
|
||||
console.log('设置的统计数据:', statistics.value);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取统计数据失败:', error);
|
||||
});
|
||||
};
|
||||
|
||||
// 搜索按钮操作
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 重置按钮操作
|
||||
const resetQuery = () => {
|
||||
daterangeCheckTime.value = [];
|
||||
proxy.resetForm('queryFormRef');
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
studentName: '',
|
||||
studentNumber: '',
|
||||
companyName: '',
|
||||
status: '',
|
||||
checkTimeStart: '',
|
||||
checkTimeEnd: ''
|
||||
};
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
// 多选框选中数据
|
||||
const handleSelectionChange = (selection) => {
|
||||
// 多选处理逻辑
|
||||
};
|
||||
|
||||
// 新增按钮操作
|
||||
const handleAdd = () => {
|
||||
resetAddForm();
|
||||
addDialogVisible.value = true;
|
||||
};
|
||||
|
||||
// 重置新增表单
|
||||
const resetAddForm = () => {
|
||||
addForm.value = {
|
||||
studentName: '',
|
||||
studentNumber: '',
|
||||
className: '',
|
||||
companyName: '',
|
||||
checkInTime: '',
|
||||
checkOutTime: '',
|
||||
workDuration: null,
|
||||
status: '1',
|
||||
checkInLocation: '',
|
||||
workContent: '',
|
||||
remark: ''
|
||||
};
|
||||
if (proxy.$refs.addFormRef) {
|
||||
proxy.$refs.addFormRef.resetFields();
|
||||
}
|
||||
};
|
||||
|
||||
// 取消新增
|
||||
const cancelAdd = () => {
|
||||
addDialogVisible.value = false;
|
||||
resetAddForm();
|
||||
};
|
||||
|
||||
// 提交新增
|
||||
const submitAdd = () => {
|
||||
proxy.$refs.addFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
addLoading.value = true;
|
||||
|
||||
addInternshipDaily(addForm.value)
|
||||
.then((response) => {
|
||||
proxy.$modal.msgSuccess('新增签到记录成功');
|
||||
addDialogVisible.value = false;
|
||||
getList();
|
||||
})
|
||||
.finally(() => {
|
||||
addLoading.value = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleView = (row) => {
|
||||
currentRecord.value = { ...row };
|
||||
viewDialogVisible.value = true;
|
||||
};
|
||||
|
||||
// 查看考勤日历
|
||||
const handleCalendar = (row) => {
|
||||
currentStudent.value = { ...row };
|
||||
calendarMonth.value = new Date().toISOString().slice(0, 7); // 当前月份
|
||||
calendarDate.value = new Date();
|
||||
calendarDialogVisible.value = true;
|
||||
loadCalendarData();
|
||||
};
|
||||
|
||||
// 月份变化处理
|
||||
const handleMonthChange = (month) => {
|
||||
calendarMonth.value = month;
|
||||
loadCalendarData();
|
||||
};
|
||||
|
||||
// 加载日历数据
|
||||
const loadCalendarData = () => {
|
||||
if (!currentStudent.value || !calendarMonth.value) return;
|
||||
|
||||
const params = {
|
||||
month: calendarMonth.value
|
||||
};
|
||||
|
||||
getCalendar(currentStudent.value.studentId, params).then((response) => {
|
||||
calendarData.value = response.data || [];
|
||||
});
|
||||
};
|
||||
|
||||
// 获取考勤状态
|
||||
const getAttendanceStatus = (date) => {
|
||||
const record = calendarData.value.find((item) => item.checkDate === date);
|
||||
return record ? record.status : null;
|
||||
};
|
||||
|
||||
// 获取状态标签类型
|
||||
const getStatusTagType = (status) => {
|
||||
const statusMap = {
|
||||
'0': 'info',
|
||||
'1': 'success',
|
||||
'2': 'warning',
|
||||
'3': 'danger'
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
};
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status) => {
|
||||
const statusMap = {
|
||||
'0': '未签到',
|
||||
'1': '正常',
|
||||
'2': '迟到',
|
||||
'3': '早退'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
};
|
||||
|
||||
// 导出按钮操作
|
||||
const handleExport = () => {
|
||||
proxy.download(
|
||||
'zsjy/internship/daily/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`实习日常记录_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getStatisticsData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
// 继承后勤管理的样式
|
||||
.page-container {
|
||||
.search-btn-container {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.button-card {
|
||||
margin-bottom: 20px;
|
||||
|
||||
.card-header-vertical {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.toolbar-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.table-card {
|
||||
.table-container {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 统计卡片样式 */
|
||||
.stat-card {
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
height: 90px;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5px 12px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.stat-icon {
|
||||
font-size: 24px;
|
||||
margin-right: 12px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
flex: 1;
|
||||
|
||||
.stat-value {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 13px;
|
||||
opacity: 0.7;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.stat-card-primary {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-success {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-warning {
|
||||
background: linear-gradient(135deg, #ff9a56 0%, #ffad56 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-info {
|
||||
background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格样式 */
|
||||
.scroll-table {
|
||||
:deep(.el-table__header-wrapper) {
|
||||
.el-table__header {
|
||||
th {
|
||||
background-color: #f8f9fa;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-table__body-wrapper) {
|
||||
.el-table__row {
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 学生信息样式 */
|
||||
.student-info {
|
||||
.student-name {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.student-number,
|
||||
.student-class {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
|
||||
/* 时间详情样式 */
|
||||
.time-detail {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.text-muted {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
/* 操作按钮样式 */
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 对话框样式 */
|
||||
.dialog-footer-right {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
/* 详情容器样式 */
|
||||
.detail-container {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
/* 日历相关样式 */
|
||||
.calendar-container {
|
||||
.calendar-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
|
||||
h4 {
|
||||
margin: 0;
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-day {
|
||||
height: 60px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.day-number {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.attendance-status {
|
||||
.el-tag {
|
||||
font-size: 10px;
|
||||
padding: 0 4px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.stat-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,365 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="新增实习信息" width="80%" :before-close="handleClose" draggable destroy-on-close>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px" class="form-container">
|
||||
<el-row :gutter="24">
|
||||
<!-- 基本信息 -->
|
||||
<el-col :span="24">
|
||||
<div class="form-section-title">基本信息</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="form.studentName" placeholder="学生姓名" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="form.studentNo" placeholder="学号" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习状态" prop="internshipStatus">
|
||||
<el-select v-model="form.internshipStatus" placeholder="请选择实习状态" style="width: 100%">
|
||||
<el-option v-for="dict in internship_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习津贴" prop="internshipAllowance">
|
||||
<el-input-number
|
||||
v-model="form.internshipAllowance"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
placeholder="实习津贴"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 实习单位信息 -->
|
||||
<el-col :span="24">
|
||||
<div class="form-section-title">实习单位信息</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习单位名称" prop="companyName">
|
||||
<el-input v-model="form.companyName" placeholder="请输入实习单位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位联系人" prop="companyContact">
|
||||
<el-input v-model="form.companyContact" placeholder="请输入单位联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位地址" prop="companyAddress">
|
||||
<el-input v-model="form.companyAddress" placeholder="请输入单位地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人电话" prop="companyPhone">
|
||||
<el-input v-model="form.companyPhone" placeholder="请输入联系人电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="行业类型" prop="companyIndustry">
|
||||
<el-input v-model="form.companyIndustry" placeholder="请输入行业类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位规模" prop="companyScale">
|
||||
<el-select v-model="form.companyScale" placeholder="请选择单位规模" clearable style="width: 100%">
|
||||
<el-option label="20人以下" value="1" />
|
||||
<el-option label="20-99人" value="2" />
|
||||
<el-option label="100-499人" value="3" />
|
||||
<el-option label="500-999人" value="4" />
|
||||
<el-option label="1000人以上" value="5" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 岗位信息 -->
|
||||
<el-col :span="24">
|
||||
<div class="form-section-title">岗位信息</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位名称" prop="internshipPosition">
|
||||
<el-input v-model="form.internshipPosition" placeholder="请输入岗位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工作时长" prop="workHours">
|
||||
<el-input v-model="form.workHours" placeholder="请输入工作时长" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位职责" prop="positionDuties">
|
||||
<el-input v-model="form.positionDuties" placeholder="请输入岗位职责" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 实习周期 -->
|
||||
<el-col :span="24">
|
||||
<div class="form-section-title">实习周期</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习开始日期" prop="internshipStartDate">
|
||||
<el-date-picker
|
||||
v-model="form.internshipStartDate"
|
||||
type="date"
|
||||
placeholder="请选择实习开始日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习结束日期" prop="internshipEndDate">
|
||||
<el-date-picker
|
||||
v-model="form.internshipEndDate"
|
||||
type="date"
|
||||
placeholder="请选择实习结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 联系方式和其他信息 -->
|
||||
<el-col :span="24">
|
||||
<div class="form-section-title">联系方式和其他信息</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位联系人" prop="contactPersonName">
|
||||
<el-input v-model="form.contactPersonName" placeholder="请输入单位联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人电话" prop="contactPersonPhone">
|
||||
<el-input v-model="form.contactPersonPhone" placeholder="请输入联系人电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习协议状态" prop="agreementStatus">
|
||||
<el-select v-model="form.agreementStatus" placeholder="请选择实习协议状态" style="width: 100%">
|
||||
<el-option label="已签署" value="1" />
|
||||
<el-option label="未签署" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 备注 -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注信息" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="handleSubmit">保存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="AddDialog" lang="ts">
|
||||
import { ref, reactive, watch, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { addInternshipInfo } from '@/api/zsjy/internship';
|
||||
import { InternshipInfoAddBO } from '@/api/zsjy/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { internship_status } = toRefs<any>(proxy?.useDict('internship_status'));
|
||||
|
||||
// Props定义
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
studentInfo?: {
|
||||
studentId: string;
|
||||
studentName: string;
|
||||
studentNo: string;
|
||||
};
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: false,
|
||||
studentInfo: () => ({
|
||||
studentId: '',
|
||||
studentName: '',
|
||||
studentNo: ''
|
||||
})
|
||||
});
|
||||
|
||||
// Emits定义
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean];
|
||||
'success': [];
|
||||
}>();
|
||||
|
||||
const visible = ref(false);
|
||||
const formRef = ref();
|
||||
const submitLoading = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const form = reactive<InternshipInfoAddBO>({
|
||||
studentId: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
internshipStatus: '1',
|
||||
companyName: '',
|
||||
companyAddress: '',
|
||||
companyIndustry: '',
|
||||
companyScale: '',
|
||||
internshipPosition: '',
|
||||
positionDuties: '',
|
||||
internshipAllowance: 0,
|
||||
workHours: '',
|
||||
accommodationAddress: '',
|
||||
accommodationType: '',
|
||||
accommodationCost: 0,
|
||||
internshipStartDate: '',
|
||||
internshipEndDate: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
agreementStatus: '1',
|
||||
remark: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
internshipStatus: [{ required: true, message: '请选择实习状态', trigger: 'change' }],
|
||||
companyName: [{ required: true, message: '请输入实习单位名称', trigger: 'blur' }],
|
||||
companyAddress: [{ required: true, message: '请输入单位地址', trigger: 'blur' }],
|
||||
internshipPosition: [{ required: true, message: '请输入岗位名称', trigger: 'blur' }],
|
||||
contactPersonName: [{ required: true, message: '请输入单位联系人', trigger: 'blur' }],
|
||||
contactPersonPhone: [
|
||||
{ required: true, message: '请输入联系人电话', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
|
||||
],
|
||||
internshipStartDate: [{ required: true, message: '请选择实习开始日期', trigger: 'change' }],
|
||||
internshipEndDate: [{ required: true, message: '请选择实习结束日期', trigger: 'change' }],
|
||||
agreementStatus: [{ required: true, message: '请选择实习协议状态', trigger: 'change' }]
|
||||
});
|
||||
|
||||
// 监听弹窗显示状态
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newVal) => {
|
||||
visible.value = newVal;
|
||||
if (newVal && props.studentInfo) {
|
||||
form.studentId = props.studentInfo.studentId;
|
||||
form.studentName = props.studentInfo.studentName;
|
||||
form.studentNo = props.studentInfo.studentNo;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听visible变化,同步到父组件
|
||||
watch(
|
||||
() => visible.value,
|
||||
(newVal) => {
|
||||
emit('update:modelValue', newVal);
|
||||
}
|
||||
);
|
||||
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
Object.assign(form, {
|
||||
studentId: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
internshipStatus: '1',
|
||||
companyName: '',
|
||||
companyAddress: '',
|
||||
companyIndustry: '',
|
||||
companyScale: '',
|
||||
internshipPosition: '',
|
||||
positionDuties: '',
|
||||
internshipAllowance: 0,
|
||||
workHours: '',
|
||||
accommodationAddress: '',
|
||||
accommodationType: '',
|
||||
accommodationCost: 0,
|
||||
internshipStartDate: '',
|
||||
internshipEndDate: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
agreementStatus: '1',
|
||||
remark: ''
|
||||
});
|
||||
formRef.value?.clearValidate();
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
resetForm();
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
await formRef.value.validate();
|
||||
submitLoading.value = true;
|
||||
|
||||
console.log('=== 前端提交实习信息 ===');
|
||||
console.log('1. 表单验证通过');
|
||||
console.log('2. 提交的数据:', JSON.stringify(form, null, 2));
|
||||
|
||||
const response = await addInternshipInfo(form);
|
||||
console.log('3. 后端响应:', response);
|
||||
console.log('4. 响应状态码:', response.code);
|
||||
console.log('5. 响应消息:', response.msg);
|
||||
|
||||
if (response.code === 200) {
|
||||
console.log('6. 新增成功');
|
||||
ElMessage.success('新增实习信息成功');
|
||||
handleClose();
|
||||
emit('success');
|
||||
} else {
|
||||
console.error('7. 新增失败,后端返回错误:', response.msg);
|
||||
ElMessage.error(response.msg || '新增实习信息失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('=== 前端提交失败 ===');
|
||||
console.error('错误对象:', error);
|
||||
console.error('错误信息:', error.message);
|
||||
console.error('错误响应:', error.response);
|
||||
ElMessage.error('新增实习信息失败');
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
console.log('=== 前端提交流程结束 ===');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-container {
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.form-section-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 2px solid #409eff;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,439 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="编辑实习信息" width="80%" :before-close="handleClose" draggable destroy-on-close>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px" class="form-container" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<!-- 基本信息 -->
|
||||
<el-col :span="24">
|
||||
<div class="form-section-title">基本信息</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="form.studentName" placeholder="学生姓名" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="form.studentNo" placeholder="学号" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习状态" prop="internshipStatus">
|
||||
<el-select v-model="form.internshipStatus" placeholder="请选择实习状态" style="width: 100%">
|
||||
<el-option v-for="dict in internship_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习津贴" prop="internshipAllowance">
|
||||
<el-input-number
|
||||
v-model="form.internshipAllowance"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
placeholder="实习津贴"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 实习单位信息 -->
|
||||
<el-col :span="24">
|
||||
<div class="form-section-title">实习单位信息</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习单位名称" prop="companyName">
|
||||
<el-input v-model="form.companyName" placeholder="请输入实习单位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位联系人" prop="companyContact">
|
||||
<el-input v-model="form.companyContact" placeholder="请输入单位联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位地址" prop="companyAddress">
|
||||
<el-input v-model="form.companyAddress" placeholder="请输入单位地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人电话" prop="companyPhone">
|
||||
<el-input v-model="form.companyPhone" placeholder="请输入联系人电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="行业类型" prop="companyIndustry">
|
||||
<el-input v-model="form.companyIndustry" placeholder="请输入行业类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位规模" prop="companyScale">
|
||||
<el-select v-model="form.companyScale" placeholder="请选择单位规模" clearable style="width: 100%">
|
||||
<el-option label="20人以下" value="1" />
|
||||
<el-option label="20-99人" value="2" />
|
||||
<el-option label="100-499人" value="3" />
|
||||
<el-option label="500-999人" value="4" />
|
||||
<el-option label="1000人以上" value="5" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 岗位信息 -->
|
||||
<el-col :span="24">
|
||||
<div class="form-section-title">岗位信息</div>
|
||||
</el-col>
|
||||
<!-- 岗位名称 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位名称" prop="internshipPosition">
|
||||
<el-input v-model="form.internshipPosition" placeholder="请输入岗位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 岗位职责 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位职责" prop="positionDuties">
|
||||
<el-input v-model="form.positionDuties" placeholder="请输入岗位职责" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 实习津贴 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习津贴" prop="internshipAllowance">
|
||||
<el-input-number v-model="form.internshipAllowance" :min="0" :precision="2" placeholder="请输入实习津贴" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 工作时长 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工作时长" prop="workHours">
|
||||
<el-input v-model="form.workHours" placeholder="请输入工作时长" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第四分区:实习时间信息 -->
|
||||
<el-divider content-position="left">实习时间信息</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<!-- 实习开始日期 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习开始日期" prop="internshipStartDate">
|
||||
<el-date-picker
|
||||
v-model="form.internshipStartDate"
|
||||
type="date"
|
||||
placeholder="请选择实习开始日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 实习结束日期 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习结束日期" prop="internshipEndDate">
|
||||
<el-date-picker
|
||||
v-model="form.internshipEndDate"
|
||||
type="date"
|
||||
placeholder="请选择实习结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 实际结束日期 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实际结束日期" prop="actualEndDate">
|
||||
<el-date-picker
|
||||
v-model="form.actualEndDate"
|
||||
type="date"
|
||||
placeholder="请选择实际结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第五分区:联系方式和其他信息 -->
|
||||
<el-divider content-position="left">联系方式和其他信息</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<!-- 单位联系人 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位联系人" prop="contactPersonName">
|
||||
<el-input v-model="form.contactPersonName" placeholder="请输入单位联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 联系人电话 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人电话" prop="contactPersonPhone">
|
||||
<el-input v-model="form.contactPersonPhone" placeholder="请输入联系人电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 实习协议状态 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实习协议状态" prop="agreementStatus">
|
||||
<el-select v-model="form.agreementStatus" placeholder="请选择实习协议状态" style="width: 100%">
|
||||
<el-option label="已签署" value="1" />
|
||||
<el-option label="未签署" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 备注 -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注信息" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="handleSubmit">保存</el-button>
|
||||
<el-button type="danger" @click="handleDelete">删除</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="EditDialog" lang="ts">
|
||||
import { ref, reactive, watch, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { getInternshipInfo, updateInternshipInfo, delInternshipInfo } from '@/api/zsjy/internship';
|
||||
import { InternshipInfoEditBO } from '@/api/zsjy/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { internship_status } = toRefs<any>(proxy?.useDict('internship_status'));
|
||||
|
||||
// Props定义
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
studentId?: string;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: false,
|
||||
studentId: ''
|
||||
});
|
||||
|
||||
// Emits定义
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean];
|
||||
'success': [];
|
||||
}>();
|
||||
|
||||
const visible = ref(false);
|
||||
const formRef = ref();
|
||||
const loading = ref(false);
|
||||
const submitLoading = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const form = reactive<InternshipInfoEditBO>({
|
||||
internshipId: '',
|
||||
studentId: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
internshipStatus: '1',
|
||||
companyName: '',
|
||||
companyAddress: '',
|
||||
companyIndustry: '',
|
||||
companyScale: '',
|
||||
internshipPosition: '',
|
||||
positionDuties: '',
|
||||
internshipAllowance: 0,
|
||||
workHours: '',
|
||||
accommodationAddress: '',
|
||||
accommodationType: '',
|
||||
accommodationCost: 0,
|
||||
internshipStartDate: '',
|
||||
internshipEndDate: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
agreementStatus: '1',
|
||||
actualEndDate: '',
|
||||
remark: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
internshipStatus: [{ required: true, message: '请选择实习状态', trigger: 'change' }],
|
||||
companyName: [{ required: true, message: '请输入实习单位名称', trigger: 'blur' }],
|
||||
companyAddress: [{ required: true, message: '请输入单位地址', trigger: 'blur' }],
|
||||
internshipPosition: [{ required: true, message: '请输入岗位名称', trigger: 'blur' }],
|
||||
contactPersonName: [{ required: true, message: '请输入单位联系人', trigger: 'blur' }],
|
||||
contactPersonPhone: [
|
||||
{ required: true, message: '请输入联系人电话', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
|
||||
],
|
||||
internshipStartDate: [{ required: true, message: '请选择实习开始日期', trigger: 'change' }],
|
||||
internshipEndDate: [{ required: true, message: '请选择实习结束日期', trigger: 'change' }],
|
||||
agreementStatus: [{ required: true, message: '请选择实习协议状态', trigger: 'change' }]
|
||||
});
|
||||
|
||||
// 监听弹窗显示状态
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newVal) => {
|
||||
visible.value = newVal;
|
||||
if (newVal && props.studentId) {
|
||||
getInternshipDetail();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(visible, (newVal) => {
|
||||
emit('update:modelValue', newVal);
|
||||
});
|
||||
|
||||
// 获取实习信息详情
|
||||
const getInternshipDetail = async () => {
|
||||
if (!props.studentId) {
|
||||
ElMessage.error('参数错误');
|
||||
return;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getInternshipInfo(props.studentId);
|
||||
const data = res.data;
|
||||
|
||||
// 填充表单数据
|
||||
Object.assign(form, {
|
||||
internshipId: data.internshipId,
|
||||
studentId: data.studentId,
|
||||
studentName: data.studentName,
|
||||
studentNo: data.studentNo,
|
||||
internshipStatus: data.internshipStatus,
|
||||
companyName: data.companyName,
|
||||
companyAddress: data.companyAddress,
|
||||
companyIndustry: data.companyIndustry,
|
||||
companyScale: data.companyScale,
|
||||
internshipPosition: data.internshipPosition || data.positionName,
|
||||
positionDuties: data.positionDuties,
|
||||
internshipAllowance: data.internshipAllowance,
|
||||
workHours: data.workHours,
|
||||
accommodationAddress: data.accommodationAddress,
|
||||
accommodationType: data.accommodationType,
|
||||
accommodationCost: data.accommodationCost,
|
||||
internshipStartDate: data.internshipStartDate || data.startDate,
|
||||
internshipEndDate: data.internshipEndDate || data.endDate,
|
||||
contactPersonName: data.contactPersonName || data.companyContact,
|
||||
contactPersonPhone: data.contactPersonPhone || data.companyPhone,
|
||||
agreementStatus: data.agreementStatus || '1',
|
||||
actualEndDate: data.actualEndDate,
|
||||
remark: data.remark
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('获取实习信息失败:', error);
|
||||
ElMessage.error('获取实习信息失败');
|
||||
handleClose();
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
Object.assign(form, {
|
||||
internshipId: '',
|
||||
studentId: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
internshipStatus: '1',
|
||||
companyName: '',
|
||||
companyAddress: '',
|
||||
companyIndustry: '',
|
||||
companyScale: '',
|
||||
companyContact: '',
|
||||
companyPhone: '',
|
||||
positionName: '',
|
||||
positionDuties: '',
|
||||
internshipAllowance: 0,
|
||||
workHours: '',
|
||||
accommodationAddress: '',
|
||||
accommodationType: '',
|
||||
accommodationCost: 0,
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
actualEndDate: '',
|
||||
remark: ''
|
||||
});
|
||||
formRef.value?.clearValidate();
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
resetForm();
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
await formRef.value.validate();
|
||||
submitLoading.value = true;
|
||||
|
||||
await updateInternshipInfo(form);
|
||||
ElMessage.success('修改实习信息成功');
|
||||
handleClose();
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('修改实习信息失败:', error);
|
||||
ElMessage.error('修改实习信息失败');
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 删除实习信息
|
||||
const handleDelete = async () => {
|
||||
try {
|
||||
await ElMessageBox.confirm('确认删除该实习信息?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
await delInternshipInfo(form.internshipId);
|
||||
ElMessage.success('删除实习信息成功');
|
||||
handleClose();
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
if (error === 'cancel') return;
|
||||
console.error('删除实习信息失败:', error);
|
||||
ElMessage.error('删除实习信息失败');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-container {
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.form-section-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 2px solid #409eff;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -32,8 +32,8 @@
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="实习公司" prop="internshipCompany">
|
||||
<el-input v-model="queryParams.internshipCompany" placeholder="请输入实习公司名称" clearable @keyup.enter="handleQuery" />
|
||||
<el-form-item label="实习公司" prop="companyName">
|
||||
<el-input v-model="queryParams.companyName" placeholder="请输入实习公司名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -93,7 +93,7 @@
|
||||
<div class="statistics-card internshiping">
|
||||
<div class="statistics-content">
|
||||
<div class="statistics-number">{{ statisticsData.internshipCount || 0 }}</div>
|
||||
<div class="statistics-label">实习中</div>
|
||||
<div class="statistics-label">已实习</div>
|
||||
</div>
|
||||
<div class="statistics-icon">
|
||||
<el-icon><Loading /></el-icon>
|
||||
@@ -103,9 +103,9 @@
|
||||
<el-col :span="6">
|
||||
<div class="statistics-card completed">
|
||||
<div class="statistics-content">
|
||||
<div class="statistics-number">{{ statisticsData.internshipCount || 0 }}</div>
|
||||
<div class="statistics-label">已完成</div>
|
||||
<div class="statistics-rate">实习率:{{ statisticsData.internshipRate || '0.00%' }}</div>
|
||||
<div class="statistics-number">{{ statisticsData.internshipRate || '0.00%' }}</div>
|
||||
<div class="statistics-label">实习率</div>
|
||||
<div class="statistics-description">已实习学生占比</div>
|
||||
</div>
|
||||
<div class="statistics-icon">
|
||||
<el-icon><CircleCheck /></el-icon>
|
||||
@@ -128,24 +128,29 @@
|
||||
<el-table v-loading="loading" border :data="internshipList" @row-dblclick="handleView">
|
||||
<el-table-column label="学号" align="center" prop="studentNo" width="120" />
|
||||
<el-table-column label="姓名" align="center" prop="studentName" width="100" />
|
||||
<el-table-column label="性别" align="center" prop="gender" width="80" />
|
||||
<el-table-column label="班级" align="center" prop="className" width="180" />
|
||||
<el-table-column label="班主任" align="center" prop="classMasterName" width="100" />
|
||||
<el-table-column label="实习状态" align="center" prop="internshipStatus" width="100">
|
||||
<el-table-column label="性别" align="center" prop="gender" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="internship_status" :value="scope.row.internshipStatus" />
|
||||
<dict-tag :options="sys_user_sex" :value="scope.row.gender" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实习公司" align="center" prop="internshipCompany" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="实习岗位" align="center" prop="internshipPosition" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="实习开始时间" align="center" prop="internshipStartTime" width="120">
|
||||
<el-table-column label="班级" align="center" prop="className" width="180" />
|
||||
<el-table-column label="班主任" align="center" prop="classTeacherName" width="100" />
|
||||
<el-table-column label="实习状态" align="center" prop="internshipStatus" width="100">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.internshipStartTime">{{ parseTime(scope.row.internshipStartTime, '{y}-{m}-{d}') }}</span>
|
||||
<span v-if="scope.row.internshipStatus === 'null' || !scope.row.internshipStatus" class="status-tag not-started">未实习</span>
|
||||
<dict-tag v-else :options="internship_status" :value="scope.row.internshipStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实习公司" align="center" prop="companyName" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="实习岗位" align="center" prop="internshipPosition" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="实习开始时间" align="center" prop="internshipStartDate" width="120">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.internshipStartDate">{{ parseTime(scope.row.internshipStartDate, '{y}-{m}-{d}') }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实习地点" align="center" prop="internshipLocation" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||
<el-table-column label="实习地点" align="center" prop="companyAddress" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
@@ -153,11 +158,30 @@
|
||||
type="primary"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['zsjy:internship:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="新增实习信息" placement="top" v-if="!scope.row.internshipId">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Plus"
|
||||
size="default"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['zsjy:internship:add']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="编辑实习信息" placement="top" v-if="scope.row.internshipId">
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
icon="Edit"
|
||||
size="default"
|
||||
@click="handleEdit(scope.row)"
|
||||
v-hasPermi="['zsjy:internship:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -168,34 +192,49 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 学生实习详情对话框 -->
|
||||
<el-dialog title="学生实习详情" v-model="dialog.visible" width="800px" append-to-body>
|
||||
<el-dialog title="学生实习详情" v-model="dialog.visible" width="900px" append-to-body>
|
||||
<div v-if="studentDetail" class="student-detail">
|
||||
<el-descriptions title="基本信息" :column="2" border>
|
||||
<el-descriptions-item label="学号">{{ studentDetail.studentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">{{ studentDetail.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{ studentDetail.gender }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号">{{ studentDetail.mobile }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号">{{ studentDetail.phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学院">{{ studentDetail.collegeName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">{{ studentDetail.majorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ studentDetail.className }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班主任">{{ studentDetail.classMasterName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班主任">{{ studentDetail.classTeacherName }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions title="实习信息" :column="2" border class="mt-4">
|
||||
<el-descriptions-item label="实习状态">
|
||||
<dict-tag :options="internship_status" :value="studentDetail.internshipStatus" />
|
||||
<span v-if="studentDetail.internshipStatus === 'null' || !studentDetail.internshipStatus" class="status-tag not-started">未实习</span>
|
||||
<dict-tag v-else :options="internship_status" :value="studentDetail.internshipStatus" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="实习公司">{{ studentDetail.internshipCompany || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实习公司">{{ studentDetail.companyName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实习岗位">{{ studentDetail.internshipPosition || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实习地点">{{ studentDetail.internshipLocation || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实习地点">{{ studentDetail.companyAddress || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实习开始时间">
|
||||
<span v-if="studentDetail.internshipStartTime">{{ parseTime(studentDetail.internshipStartTime, '{y}-{m}-{d}') }}</span>
|
||||
<span v-if="studentDetail.internshipStartDate">{{ parseTime(studentDetail.internshipStartDate, '{y}-{m}-{d}') }}</span>
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="实习结束时间">
|
||||
<span v-if="studentDetail.internshipEndTime">{{ parseTime(studentDetail.internshipEndTime, '{y}-{m}-{d}') }}</span>
|
||||
<span v-if="studentDetail.internshipEndDate">{{ parseTime(studentDetail.internshipEndDate, '{y}-{m}-{d}') }}</span>
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单位联系人">{{ studentDetail.contactPersonName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人电话">{{ studentDetail.contactPersonPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实习津贴">
|
||||
<span v-if="studentDetail.internshipAllowance && studentDetail.internshipAllowance > 0"
|
||||
>{{ studentDetail.internshipAllowance }}元/月</span
|
||||
>
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="协议状态">
|
||||
<el-tag v-if="studentDetail.agreementStatus === '1'" type="success">已签署</el-tag>
|
||||
<el-tag v-else-if="studentDetail.agreementStatus === '2'" type="warning">未签署</el-tag>
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ studentDetail.remark || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<template #footer>
|
||||
@@ -204,6 +243,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 新增弹窗 -->
|
||||
<AddDialog v-model="showAddDialog" :student-info="selectedStudentInfo" @success="handleDialogSuccess" />
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<EditDialog v-model="showEditDialog" :student-id="selectedStudentId" @success="handleDialogSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -213,9 +258,12 @@ import { InternshipInfoVO, InternshipInfoQuery, ClassInfoVO, InternshipStatistic
|
||||
import { ComponentInternalInstance, getCurrentInstance, reactive, ref, toRefs } from 'vue';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { download } from '@/utils/request';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import AddDialog from './components/AddDialog.vue';
|
||||
import EditDialog from './components/EditDialog.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { internship_status } = toRefs<any>(proxy?.useDict('internship_status'));
|
||||
const { internship_status, sys_user_sex } = toRefs<any>(proxy?.useDict('internship_status', 'sys_user_sex'));
|
||||
|
||||
const internshipList = ref<InternshipInfoVO[]>([]);
|
||||
const classOptions = ref<ClassInfoVO[]>([]);
|
||||
@@ -231,6 +279,20 @@ const total = ref(0);
|
||||
const dateRange = ref<[string, string]>([]);
|
||||
const studentDetail = ref<InternshipInfoVO>();
|
||||
|
||||
// 弹窗相关状态
|
||||
const showAddDialog = ref(false);
|
||||
const showEditDialog = ref(false);
|
||||
const selectedStudentInfo = ref<{
|
||||
studentId: string;
|
||||
studentName: string;
|
||||
studentNo: string;
|
||||
}>({
|
||||
studentId: '',
|
||||
studentName: '',
|
||||
studentNo: ''
|
||||
});
|
||||
const selectedStudentId = ref('');
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -239,9 +301,9 @@ const data = reactive({
|
||||
studentNo: '',
|
||||
classId: '',
|
||||
internshipStatus: '',
|
||||
internshipCompany: '',
|
||||
startTimeBegin: '',
|
||||
startTimeEnd: ''
|
||||
companyName: '',
|
||||
internshipStartDateBegin: '',
|
||||
internshipStartDateEnd: ''
|
||||
} as InternshipInfoQuery,
|
||||
dialog: {
|
||||
visible: false,
|
||||
@@ -256,19 +318,33 @@ const getList = async () => {
|
||||
loading.value = true;
|
||||
// 处理日期范围
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
queryParams.value.startTimeBegin = dateRange.value[0];
|
||||
queryParams.value.startTimeEnd = dateRange.value[1];
|
||||
queryParams.value.internshipStartDateBegin = dateRange.value[0];
|
||||
queryParams.value.internshipStartDateEnd = dateRange.value[1];
|
||||
} else {
|
||||
queryParams.value.startTimeBegin = '';
|
||||
queryParams.value.startTimeEnd = '';
|
||||
queryParams.value.internshipStartDateBegin = '';
|
||||
queryParams.value.internshipStartDateEnd = '';
|
||||
}
|
||||
|
||||
console.log('=== 前端调试日志 ===');
|
||||
console.log('1. 查询参数:', JSON.stringify(queryParams.value, null, 2));
|
||||
|
||||
try {
|
||||
const res = await listInternshipInfo(queryParams.value);
|
||||
console.log('2. API响应完整数据:', JSON.stringify(res, null, 2));
|
||||
console.log('3. res.rows类型:', typeof res.rows, '长度:', res.rows ? res.rows.length : 'undefined');
|
||||
console.log('4. res.total:', res.total);
|
||||
console.log('5. res.code:', res.code);
|
||||
console.log('6. res.msg:', res.msg);
|
||||
|
||||
internshipList.value = res.rows;
|
||||
total.value = res.total;
|
||||
|
||||
console.log('7. 赋值后 internshipList.value:', internshipList.value);
|
||||
console.log('8. 赋值后 total.value:', total.value);
|
||||
|
||||
loading.value = false;
|
||||
} catch (error) {
|
||||
console.error('API调用失败:', error);
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
@@ -349,6 +425,27 @@ const handleExport = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/** 新增实习信息按钮操作 */
|
||||
const handleAdd = (row: InternshipInfoVO) => {
|
||||
selectedStudentInfo.value = {
|
||||
studentId: row.studentId,
|
||||
studentName: row.studentName,
|
||||
studentNo: row.studentNo
|
||||
};
|
||||
showAddDialog.value = true;
|
||||
};
|
||||
|
||||
/** 编辑实习信息按钮操作 */
|
||||
const handleEdit = (row: InternshipInfoVO) => {
|
||||
selectedStudentId.value = row.studentId;
|
||||
showEditDialog.value = true;
|
||||
};
|
||||
|
||||
/** 弹窗操作成功后刷新列表 */
|
||||
const handleDialogSuccess = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
dialog.value.visible = false;
|
||||
@@ -381,9 +478,13 @@ const cancel = () => {
|
||||
color: white;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
height: 100px; /* 设置固定高度,确保所有卡片高度一致 */
|
||||
|
||||
.statistics-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center; /* 内容垂直居中 */
|
||||
|
||||
.statistics-number {
|
||||
font-size: 28px;
|
||||
@@ -401,6 +502,12 @@ const cancel = () => {
|
||||
opacity: 0.8;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.statistics-description {
|
||||
font-size: 12px;
|
||||
opacity: 0.8;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.statistics-icon {
|
||||
@@ -445,5 +552,18 @@ const cancel = () => {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
display: inline-block;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
|
||||
&.not-started {
|
||||
background-color: #f56c6c;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,318 @@
|
||||
<template>
|
||||
<div class="monthly-detail">
|
||||
<el-row :gutter="20">
|
||||
<!-- 左侧详情内容 -->
|
||||
<el-col :span="16">
|
||||
<el-card shadow="never" class="mb-4">
|
||||
<template #header>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="font-medium">基本信息</span>
|
||||
<dict-tag :options="internship_monthly_status" :value="detail.reviewStatus" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="总结月份">
|
||||
{{ detail.summaryMonth }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="技能评分" span="2">
|
||||
<div class="flex gap-4 flex-wrap">
|
||||
<el-tag v-if="detail.professionalSkills" :type="getScoreTagType(detail.professionalSkills)">
|
||||
专业技能: {{ detail.professionalSkills }}分
|
||||
</el-tag>
|
||||
<el-tag v-if="detail.communicationSkills" :type="getScoreTagType(detail.communicationSkills)">
|
||||
沟通技能: {{ detail.communicationSkills }}分
|
||||
</el-tag>
|
||||
<el-tag v-if="detail.teamworkAbility" :type="getScoreTagType(detail.teamworkAbility)">
|
||||
团队协作: {{ detail.teamworkAbility }}分
|
||||
</el-tag>
|
||||
<el-tag v-if="detail.learningAbility" :type="getScoreTagType(detail.learningAbility)">
|
||||
学习能力: {{ detail.learningAbility }}分
|
||||
</el-tag>
|
||||
<el-tag v-if="detail.workAttitude" :type="getScoreTagType(detail.workAttitude)">
|
||||
工作态度: {{ detail.workAttitude }}分
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总字数">
|
||||
<el-tag :type="getWordCountTagType(detail.wordCount)">{{ detail.wordCount || 0 }}字</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否逾期">
|
||||
<el-tag v-if="detail.isOverdue === 1" type="danger">逾期</el-tag>
|
||||
<el-tag v-else type="success">正常</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<span class="font-medium">总结内容</span>
|
||||
</template>
|
||||
|
||||
<div class="space-y-6">
|
||||
<div v-if="detail.workContent">
|
||||
<h4 class="text-base font-medium mb-2 text-gray-800">工作内容</h4>
|
||||
<div class="bg-gray-50 p-4 rounded-md">
|
||||
<p class="text-gray-700 leading-relaxed whitespace-pre-wrap">{{ detail.workContent }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.achievements">
|
||||
<h4 class="text-base font-medium mb-2 text-gray-800">成果成就</h4>
|
||||
<div class="bg-blue-50 p-4 rounded-md">
|
||||
<p class="text-gray-700 leading-relaxed whitespace-pre-wrap">{{ detail.achievements }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.learningGains">
|
||||
<h4 class="text-base font-medium mb-2 text-gray-800">学习收获</h4>
|
||||
<div class="bg-green-50 p-4 rounded-md">
|
||||
<p class="text-gray-700 leading-relaxed whitespace-pre-wrap">{{ detail.learningGains }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.problemsEncountered">
|
||||
<h4 class="text-base font-medium mb-2 text-gray-800">问题困难</h4>
|
||||
<div class="bg-yellow-50 p-4 rounded-md">
|
||||
<p class="text-gray-700 leading-relaxed whitespace-pre-wrap">{{ detail.problemsEncountered }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.solutions">
|
||||
<h4 class="text-base font-medium mb-2 text-gray-800">解决方案</h4>
|
||||
<div class="bg-purple-50 p-4 rounded-md">
|
||||
<p class="text-gray-700 leading-relaxed whitespace-pre-wrap">{{ detail.solutions }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.nextMonthPlan">
|
||||
<h4 class="text-base font-medium mb-2 text-gray-800">下月计划</h4>
|
||||
<div class="bg-indigo-50 p-4 rounded-md">
|
||||
<p class="text-gray-700 leading-relaxed whitespace-pre-wrap">{{ detail.nextMonthPlan }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.remark">
|
||||
<h4 class="text-base font-medium mb-2 text-gray-800">备注说明</h4>
|
||||
<div class="bg-gray-50 p-4 rounded-md">
|
||||
<p class="text-gray-700 leading-relaxed whitespace-pre-wrap">{{ detail.remark }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<!-- 右侧信息面板 -->
|
||||
<el-col :span="8">
|
||||
<el-card shadow="never" class="mb-4">
|
||||
<template #header>
|
||||
<span class="font-medium">审批信息</span>
|
||||
</template>
|
||||
|
||||
<div class="space-y-4">
|
||||
<div class="flex justify-between">
|
||||
<span>审核状态:</span>
|
||||
<dict-tag :options="internship_monthly_status" :value="detail.status" />
|
||||
</div>
|
||||
|
||||
<div v-if="detail.submitTime" class="flex justify-between">
|
||||
<span>提交时间:</span>
|
||||
<span class="text-sm">{{ parseTime(detail.submitTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.auditTime" class="flex justify-between">
|
||||
<span>审核时间:</span>
|
||||
<span class="text-sm">{{ parseTime(detail.auditTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.auditBy" class="flex justify-between">
|
||||
<span>审核人:</span>
|
||||
<span class="text-sm">{{ detail.auditByName || detail.auditBy }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.auditScore" class="flex justify-between">
|
||||
<span>审核评分:</span>
|
||||
<el-tag :type="getScoreTagType(detail.auditScore)">{{ detail.auditScore }}分</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card v-if="detail.auditComment" shadow="never" class="mb-4">
|
||||
<template #header>
|
||||
<span class="font-medium">审核意见</span>
|
||||
</template>
|
||||
|
||||
<div class="bg-blue-50 p-3 rounded-md">
|
||||
<p class="text-gray-700 leading-relaxed whitespace-pre-wrap">{{ detail.auditComment }}</p>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mb-4">
|
||||
<template #header>
|
||||
<span class="font-medium">时间记录</span>
|
||||
</template>
|
||||
|
||||
<div class="space-y-3">
|
||||
<div class="flex justify-between">
|
||||
<span>创建时间:</span>
|
||||
<span class="text-sm">{{ parseTime(detail.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.updateTime" class="flex justify-between">
|
||||
<span>最后更新:</span>
|
||||
<span class="text-sm">{{ parseTime(detail.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.createByName" class="flex justify-between">
|
||||
<span>创建人:</span>
|
||||
<span class="text-sm">{{ detail.createByName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<span class="font-medium">统计数据</span>
|
||||
</template>
|
||||
|
||||
<div class="space-y-3">
|
||||
<div class="flex justify-between">
|
||||
<span>总字数:</span>
|
||||
<el-tag :type="getWordCountTagType(detail.wordCount)">{{ detail.wordCount || 0 }}字</el-tag>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between">
|
||||
<span>自评分数:</span>
|
||||
<el-tag :type="getScoreTagType(detail.selfScore)">{{ detail.selfScore }}分</el-tag>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.auditScore" class="flex justify-between">
|
||||
<span>审核评分:</span>
|
||||
<el-tag :type="getScoreTagType(detail.auditScore)">{{ detail.auditScore }}分</el-tag>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between">
|
||||
<span>逾期状态:</span>
|
||||
<el-tag v-if="detail.isOverdue === 1" type="danger">逾期</el-tag>
|
||||
<el-tag v-else type="success">正常</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<el-row class="mt-6">
|
||||
<el-col :span="24" class="text-center">
|
||||
<el-button @click="handleClose">关闭</el-button>
|
||||
<el-button
|
||||
v-if="detail.reviewStatus === 3"
|
||||
type="primary"
|
||||
@click="handleEdit"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="detail.reviewStatus === 3"
|
||||
type="success"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
提交审核
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getInternshipMonthly, submitInternshipMonthly } from '@/api/zsjy/internshipMonthly'
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance
|
||||
const { internship_monthly_status } = toRefs<any>(proxy?.useDict('internship_monthly_status'))
|
||||
|
||||
const emit = defineEmits(['edit', 'close'])
|
||||
|
||||
// 详情数据
|
||||
const detail = ref<any>({})
|
||||
const loading = ref(false)
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = async (monthlyId: string | number) => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInternshipMonthly(monthlyId)
|
||||
detail.value = res.data || {}
|
||||
} catch (error) {
|
||||
console.error('获取月度总结详情失败:', error)
|
||||
proxy?.$modal.msgError('获取详情失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 根据分数获取标签类型 */
|
||||
const getScoreTagType = (score: number) => {
|
||||
if (!score) return 'info'
|
||||
if (score >= 9) return 'success'
|
||||
if (score >= 7) return 'warning'
|
||||
if (score >= 5) return ''
|
||||
return 'danger'
|
||||
}
|
||||
|
||||
/** 获取字数标签类型 */
|
||||
const getWordCountTagType = (count: number) => {
|
||||
if (!count) return 'info'
|
||||
if (count < 100) return 'info'
|
||||
if (count < 500) return 'warning'
|
||||
if (count < 1000) return 'success'
|
||||
return 'danger'
|
||||
}
|
||||
|
||||
/** 编辑操作 */
|
||||
const handleEdit = () => {
|
||||
emit('edit', detail.value.monthlyId)
|
||||
}
|
||||
|
||||
/** 提交审核操作 */
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
await proxy?.$modal.confirm('确认提交该月度总结?提交后将无法再次编辑')
|
||||
await submitInternshipMonthly(detail.value.monthlyId)
|
||||
proxy?.$modal.msgSuccess('提交成功')
|
||||
// 重新加载详情
|
||||
await resetForm(detail.value.monthlyId)
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 关闭操作 */
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
resetForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.monthly-detail {
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.space-y-6 > :not([hidden]) ~ :not([hidden]) {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.space-y-3 > :not([hidden]) ~ :not([hidden]) {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.whitespace-pre-wrap {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,590 @@
|
||||
<template>
|
||||
<el-form ref="monthlyFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<!-- 左侧表单 -->
|
||||
<el-col :span="16">
|
||||
<el-card shadow="never" class="mb-4">
|
||||
<template #header>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="font-medium">基本信息</span>
|
||||
<el-button
|
||||
v-if="form.monthlyId && form.reviewStatus === 3"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleAutoSave"
|
||||
:loading="autoSaving"
|
||||
>
|
||||
{{ autoSaving ? '保存中...' : '保存草稿' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-form-item label="总结月份" prop="summaryMonth">
|
||||
<el-date-picker
|
||||
v-model="form.summaryMonth"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
placeholder="请选择总结月份"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
style="width: 300px"
|
||||
@change="checkMonthDuplicate"
|
||||
/>
|
||||
<el-text class="ml-2" size="small" type="info">选择要总结的月份</el-text>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mb-4">
|
||||
<template #header>
|
||||
<span class="font-medium">能力自评(1-10分)</span>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业技能" prop="professionalSkills">
|
||||
<el-input-number
|
||||
v-model="form.professionalSkills"
|
||||
:min="1"
|
||||
:max="10"
|
||||
:precision="0"
|
||||
placeholder="1-10分"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
style="width: 150px"
|
||||
/>
|
||||
<el-text class="ml-2" size="small" type="info">专业技能掌握程度</el-text>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="沟通技能" prop="communicationSkills">
|
||||
<el-input-number
|
||||
v-model="form.communicationSkills"
|
||||
:min="1"
|
||||
:max="10"
|
||||
:precision="0"
|
||||
placeholder="1-10分"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
style="width: 150px"
|
||||
/>
|
||||
<el-text class="ml-2" size="small" type="info">沟通表达能力</el-text>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="团队协作" prop="teamworkAbility">
|
||||
<el-input-number
|
||||
v-model="form.teamworkAbility"
|
||||
:min="1"
|
||||
:max="10"
|
||||
:precision="0"
|
||||
placeholder="1-10分"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
style="width: 150px"
|
||||
/>
|
||||
<el-text class="ml-2" size="small" type="info">团队合作能力</el-text>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学习能力" prop="learningAbility">
|
||||
<el-input-number
|
||||
v-model="form.learningAbility"
|
||||
:min="1"
|
||||
:max="10"
|
||||
:precision="0"
|
||||
placeholder="1-10分"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
style="width: 150px"
|
||||
/>
|
||||
<el-text class="ml-2" size="small" type="info">学习新知识能力</el-text>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工作态度" prop="workAttitude">
|
||||
<el-input-number
|
||||
v-model="form.workAttitude"
|
||||
:min="1"
|
||||
:max="10"
|
||||
:precision="0"
|
||||
placeholder="1-10分"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
style="width: 150px"
|
||||
/>
|
||||
<el-text class="ml-2" size="small" type="info">工作认真负责程度</el-text>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<span class="font-medium">工作总结内容</span>
|
||||
</template>
|
||||
|
||||
<el-form-item label="工作内容" prop="workContent">
|
||||
<el-input
|
||||
v-model="form.workContent"
|
||||
type="textarea"
|
||||
:rows="6"
|
||||
placeholder="请详细描述本月的主要工作内容和任务完成情况(必填,最多500字)"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
show-word-limit
|
||||
:maxlength="500"
|
||||
@input="updateWordCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="成果成就" prop="achievements">
|
||||
<el-input
|
||||
v-model="form.achievements"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请描述本月取得的主要成果和成就(最多300字)"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
show-word-limit
|
||||
:maxlength="300"
|
||||
@input="updateWordCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="学习收获" prop="learningGains">
|
||||
<el-input
|
||||
v-model="form.learningGains"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请分享本月的学习心得和收获(最多300字)"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
show-word-limit
|
||||
:maxlength="300"
|
||||
@input="updateWordCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="问题困难" prop="problemsEncountered">
|
||||
<el-input
|
||||
v-model="form.problemsEncountered"
|
||||
type="textarea"
|
||||
:rows="6"
|
||||
placeholder="请描述遇到的问题、困难以及解决方案(包含问题和解决办法,最多1000字)"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
show-word-limit
|
||||
:maxlength="1000"
|
||||
@input="updateWordCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="自我评价" prop="selfEvaluation">
|
||||
<el-input
|
||||
v-model="form.selfEvaluation"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请对本月的工作表现进行自我评价(最多300字)"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
show-word-limit
|
||||
:maxlength="300"
|
||||
@input="updateWordCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="下月计划" prop="nextMonthPlan">
|
||||
<el-input
|
||||
v-model="form.nextMonthPlan"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请制定下个月的工作计划和目标(最多300字)"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
show-word-limit
|
||||
:maxlength="300"
|
||||
@input="updateWordCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注说明" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="其他需要说明的内容(最多200字)"
|
||||
:disabled="form.reviewStatus !== undefined && form.reviewStatus !== 3"
|
||||
show-word-limit
|
||||
:maxlength="200"
|
||||
@input="updateWordCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<!-- 右侧信息面板 -->
|
||||
<el-col :span="8">
|
||||
<el-card shadow="never" class="mb-4">
|
||||
<template #header>
|
||||
<span class="font-medium">统计信息</span>
|
||||
</template>
|
||||
|
||||
<div class="space-y-3">
|
||||
<div class="flex justify-between">
|
||||
<span>总字数:</span>
|
||||
<el-tag :type="getWordCountTagType(form.wordCount)">{{ form.wordCount || 0 }}字</el-tag>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span>状态:</span>
|
||||
<dict-tag :options="internship_monthly_status" :value="form.reviewStatus" />
|
||||
</div>
|
||||
<div v-if="form.submitTime" class="flex justify-between">
|
||||
<span>提交时间:</span>
|
||||
<span class="text-sm">{{ parseTime(form.submitTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</div>
|
||||
<div v-if="form.createTime" class="flex justify-between">
|
||||
<span>创建时间:</span>
|
||||
<span class="text-sm">{{ parseTime(form.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mb-4">
|
||||
<template #header>
|
||||
<span class="font-medium">填写提示</span>
|
||||
</template>
|
||||
|
||||
<div class="text-sm text-gray-600 space-y-2">
|
||||
<div>• 工作内容为必填项,最多500字</div>
|
||||
<div>• 其他项目选填,建议填写完整</div>
|
||||
<div>• 自评分数范围:1-10分</div>
|
||||
<div>• 支持自动保存草稿功能</div>
|
||||
<div>• 提交后将无法再次编辑</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card v-if="monthDuplicateCheck.show" shadow="never">
|
||||
<template #header>
|
||||
<span class="font-medium">月份检查</span>
|
||||
</template>
|
||||
|
||||
<el-alert
|
||||
:type="monthDuplicateCheck.type"
|
||||
:title="monthDuplicateCheck.message"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="mt-6">
|
||||
<el-col :span="24" class="text-center">
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
v-if="form.reviewStatus === undefined || form.reviewStatus === 3"
|
||||
type="primary"
|
||||
@click="handleSubmit('draft')"
|
||||
:loading="submitting"
|
||||
>
|
||||
保存草稿
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="form.reviewStatus === undefined || form.reviewStatus === 3"
|
||||
type="success"
|
||||
@click="handleSubmit('submit')"
|
||||
:loading="submitting"
|
||||
>
|
||||
提交审核
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
getInternshipMonthly,
|
||||
addInternshipMonthly,
|
||||
updateInternshipMonthly,
|
||||
autosaveInternshipMonthly,
|
||||
checkSummaryMonth,
|
||||
getMonthlyTemplate,
|
||||
getCurrentInternshipInfo
|
||||
} from '@/api/zsjy/internshipMonthly'
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance
|
||||
const { internship_monthly_status } = toRefs<any>(proxy?.useDict('internship_monthly_status'))
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
|
||||
const monthlyFormRef = ref<ElFormInstance>()
|
||||
const submitting = ref(false)
|
||||
const autoSaving = ref(false)
|
||||
|
||||
// 表单数据
|
||||
const initFormData = {
|
||||
monthlyId: undefined,
|
||||
internshipId: undefined,
|
||||
summaryMonth: '',
|
||||
workContent: '',
|
||||
achievements: '',
|
||||
learningGains: '',
|
||||
problemsEncountered: '',
|
||||
selfEvaluation: '',
|
||||
nextMonthPlan: '',
|
||||
professionalSkills: undefined,
|
||||
communicationSkills: undefined,
|
||||
teamworkAbility: undefined,
|
||||
learningAbility: undefined,
|
||||
workAttitude: undefined,
|
||||
wordCount: 0,
|
||||
remark: '',
|
||||
reviewStatus: undefined,
|
||||
submitTime: undefined,
|
||||
createTime: undefined
|
||||
}
|
||||
|
||||
const form = ref({ ...initFormData })
|
||||
|
||||
// 表单验证规则
|
||||
const rules = ref({
|
||||
summaryMonth: [
|
||||
{ required: true, message: '总结月份不能为空', trigger: 'change' }
|
||||
],
|
||||
workContent: [
|
||||
{ required: true, message: '工作内容不能为空', trigger: 'blur' },
|
||||
{ min: 10, message: '工作内容至少需要10个字符', trigger: 'blur' },
|
||||
{ max: 500, message: '工作内容不能超过500个字符', trigger: 'blur' }
|
||||
],
|
||||
professionalSkills: [
|
||||
{ required: true, message: '专业技能不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 1, max: 10, message: '专业技能必须在1-10之间', trigger: 'blur' }
|
||||
],
|
||||
communicationSkills: [
|
||||
{ required: true, message: '沟通技能不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 1, max: 10, message: '沟通技能必须在1-10之间', trigger: 'blur' }
|
||||
],
|
||||
teamworkAbility: [
|
||||
{ required: true, message: '团队协作不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 1, max: 10, message: '团队协作必须在1-10之间', trigger: 'blur' }
|
||||
],
|
||||
learningAbility: [
|
||||
{ required: true, message: '学习能力不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 1, max: 10, message: '学习能力必须在1-10之间', trigger: 'blur' }
|
||||
],
|
||||
workAttitude: [
|
||||
{ required: true, message: '工作态度不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 1, max: 10, message: '工作态度必须在1-10之间', trigger: 'blur' }
|
||||
],
|
||||
problemsEncountered: [
|
||||
{ required: true, message: '问题困难不能为空', trigger: 'blur' },
|
||||
{ min: 10, message: '问题困难至少需要10个字符', trigger: 'blur' },
|
||||
{ max: 1000, message: '问题困难不能超过1000个字符', trigger: 'blur' }
|
||||
],
|
||||
selfEvaluation: [
|
||||
{ required: true, message: '自我评价不能为空', trigger: 'blur' },
|
||||
{ max: 300, message: '自我评价不能超过300个字符', trigger: 'blur' }
|
||||
],
|
||||
nextMonthPlan: [
|
||||
{ max: 300, message: '下月计划不能超过300个字符', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ max: 200, message: '备注说明不能超过200个字符', trigger: 'blur' }
|
||||
]
|
||||
})
|
||||
|
||||
// 月份重复检查
|
||||
const monthDuplicateCheck = ref({
|
||||
show: false,
|
||||
type: 'info',
|
||||
message: ''
|
||||
})
|
||||
|
||||
// 自动保存定时器
|
||||
let autoSaveTimer: NodeJS.Timeout | null = null
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = async (monthlyId?: string | number) => {
|
||||
form.value = { ...initFormData }
|
||||
monthDuplicateCheck.value.show = false
|
||||
|
||||
if (monthlyId) {
|
||||
try {
|
||||
const res = await getInternshipMonthly(monthlyId)
|
||||
form.value = { ...res.data }
|
||||
updateWordCount()
|
||||
} catch (error) {
|
||||
console.error('获取月度总结详情失败:', error)
|
||||
}
|
||||
} else {
|
||||
// 新增时获取当前月份模板和学生实习信息
|
||||
const currentMonth = new Date().toISOString().substring(0, 7)
|
||||
form.value.summaryMonth = currentMonth
|
||||
await loadMonthlyTemplate(currentMonth)
|
||||
|
||||
// 获取学生当前实习信息
|
||||
try {
|
||||
const internshipRes = await getCurrentInternshipInfo()
|
||||
if (internshipRes.code === 200 && internshipRes.data) {
|
||||
form.value.internshipId = internshipRes.data.internshipId
|
||||
} else {
|
||||
// 如果没有进行中的实习记录,提示用户
|
||||
proxy?.$modal.msgError('您当前没有进行中的实习记录,无法创建月度总结')
|
||||
emit('success') // 关闭对话框
|
||||
return
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取学生实习信息失败:', error)
|
||||
proxy?.$modal.msgError('获取实习信息失败,请稍后重试')
|
||||
emit('success') // 关闭对话框
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
nextTick(() => {
|
||||
monthlyFormRef.value?.clearValidate()
|
||||
})
|
||||
}
|
||||
|
||||
/** 加载月份模板 */
|
||||
const loadMonthlyTemplate = async (month: string) => {
|
||||
try {
|
||||
const res = await getMonthlyTemplate(month)
|
||||
if (res.data) {
|
||||
// 如果有模板数据,可以预填充一些内容
|
||||
// form.value.nextMonthPlan = res.data.suggestedPlan || ''
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('获取月份模板失败,将使用空模板')
|
||||
}
|
||||
}
|
||||
|
||||
/** 检查月份重复 */
|
||||
const checkMonthDuplicate = async () => {
|
||||
if (!form.value.summaryMonth) return
|
||||
|
||||
try {
|
||||
const res = await checkSummaryMonth(form.value.summaryMonth)
|
||||
if (res.data.exists && (!form.value.monthlyId || res.data.monthlyId !== form.value.monthlyId)) {
|
||||
monthDuplicateCheck.value = {
|
||||
show: true,
|
||||
type: 'warning',
|
||||
message: '该月份已存在总结记录,请选择其他月份'
|
||||
}
|
||||
} else {
|
||||
monthDuplicateCheck.value = {
|
||||
show: true,
|
||||
type: 'success',
|
||||
message: '该月份可以创建总结'
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
monthDuplicateCheck.value = {
|
||||
show: true,
|
||||
type: 'error',
|
||||
message: '检查月份失败,请重试'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 更新字数统计 */
|
||||
const updateWordCount = () => {
|
||||
const content = [
|
||||
form.value.workContent,
|
||||
form.value.achievements,
|
||||
form.value.learningGains,
|
||||
form.value.problemsEncountered,
|
||||
form.value.selfEvaluation,
|
||||
form.value.nextMonthPlan,
|
||||
form.value.remark
|
||||
].join('')
|
||||
|
||||
form.value.wordCount = content.length
|
||||
|
||||
// 设置自动保存定时器
|
||||
if (form.value.monthlyId && form.value.reviewStatus === 3) {
|
||||
if (autoSaveTimer) {
|
||||
clearTimeout(autoSaveTimer)
|
||||
}
|
||||
autoSaveTimer = setTimeout(() => {
|
||||
handleAutoSave()
|
||||
}, 5000) // 5秒后自动保存
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取字数标签类型 */
|
||||
const getWordCountTagType = (count: number) => {
|
||||
if (count < 100) return 'info'
|
||||
if (count < 500) return 'warning'
|
||||
if (count < 1000) return 'success'
|
||||
return 'danger'
|
||||
}
|
||||
|
||||
/** 自动保存草稿 */
|
||||
const handleAutoSave = async () => {
|
||||
if (!form.value.monthlyId || form.value.reviewStatus !== 3) return
|
||||
|
||||
autoSaving.value = true
|
||||
try {
|
||||
await autosaveInternshipMonthly(form.value)
|
||||
proxy?.$message.success('草稿已自动保存')
|
||||
} catch (error) {
|
||||
console.error('自动保存失败:', error)
|
||||
} finally {
|
||||
autoSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
const handleSubmit = async (type: 'draft' | 'submit') => {
|
||||
if (!monthlyFormRef.value) return
|
||||
|
||||
const valid = await monthlyFormRef.value.validate().catch(() => false)
|
||||
if (!valid) return
|
||||
|
||||
submitting.value = true
|
||||
try {
|
||||
updateWordCount()
|
||||
|
||||
const formData = {
|
||||
...form.value,
|
||||
reviewStatus: type === 'draft' ? 3 : 0, // 草稿=3,待审核=0
|
||||
submitTime: type === 'submit' ? new Date() : undefined
|
||||
}
|
||||
|
||||
if (form.value.monthlyId) {
|
||||
await updateInternshipMonthly(formData)
|
||||
} else {
|
||||
await addInternshipMonthly(formData)
|
||||
}
|
||||
|
||||
proxy?.$modal.msgSuccess(type === 'draft' ? '保存成功' : '提交成功')
|
||||
emit('success')
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 取消操作 */
|
||||
const handleCancel = () => {
|
||||
emit('success')
|
||||
}
|
||||
|
||||
// 清理定时器
|
||||
onUnmounted(() => {
|
||||
if (autoSaveTimer) {
|
||||
clearTimeout(autoSaveTimer)
|
||||
}
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
resetForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.space-y-3 > :not([hidden]) ~ :not([hidden]) {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.space-y-2 > :not([hidden]) ~ :not([hidden]) {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,388 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 搜索区域 -->
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<!-- 第一行:搜索条件 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="总结月份" prop="summaryMonth">
|
||||
<el-date-picker
|
||||
v-model="queryParams.summaryMonth"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
placeholder="请选择总结月份"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审核状态" prop="reviewStatus">
|
||||
<el-select v-model="queryParams.reviewStatus" placeholder="请选择审核状态" clearable style="width: 100%">
|
||||
<el-option label="草稿" value="3" />
|
||||
<el-option label="待审核" value="0" />
|
||||
<el-option label="已审核" value="1" />
|
||||
<el-option label="审核拒绝" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="专业技能" prop="professionalSkills">
|
||||
<el-input-number
|
||||
v-model="queryParams.professionalSkills"
|
||||
:min="1"
|
||||
:max="10"
|
||||
placeholder="请输入专业技能评分"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['zsjy:internshipmonthly:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['zsjy:internshipmonthly:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['zsjy:internshipmonthly:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['zsjy:internshipmonthly:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="monthlyList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="总结月份" align="center" prop="summaryMonth" width="120" />
|
||||
<el-table-column label="工作内容" align="center" prop="workContent" :show-overflow-tooltip="true" min-width="200" />
|
||||
<el-table-column label="综合评分" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="专业/沟通/团队/学习/态度" placement="top">
|
||||
<el-tag :type="getScoreTagType(getAverageScore(scope.row))">
|
||||
{{ getAverageScore(scope.row).toFixed(1) }}分
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字数统计" align="center" width="100">
|
||||
<template #default="scope">
|
||||
{{ scope.row.wordCount || 0 }}字
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" align="center" prop="reviewStatus" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="internship_monthly_status" :value="scope.row.reviewStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否逾期" align="center" prop="isOverdue" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.isOverdue === 1" type="danger">逾期</el-tag>
|
||||
<el-tag v-else type="success">正常</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交时间" align="center" prop="submitTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.submitTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<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="200" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- 查看详情 -->
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['zsjy:internshipmonthly:list']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 编辑(只有草稿状态才能编辑) -->
|
||||
<el-tooltip content="编辑" placement="top" v-if="scope.row.reviewStatus === 3">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['zsjy:internshipmonthly:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 提交(只有草稿状态才能提交) -->
|
||||
<el-tooltip content="提交" placement="top" v-if="scope.row.reviewStatus === 3">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
@click="handleSubmit(scope.row)"
|
||||
v-hasPermi="['zsjy:internshipmonthly:submit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 删除(只有草稿状态才能删除) -->
|
||||
<el-tooltip content="删除" placement="top" v-if="scope.row.reviewStatus === 3">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['zsjy:internshipmonthly:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改月度总结对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="1000px" append-to-body>
|
||||
<MonthlyForm ref="monthlyFormRef" @success="getList" />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 月度总结详情对话框 -->
|
||||
<el-dialog title="月度总结详情" v-model="detailDialog.visible" width="1000px" append-to-body>
|
||||
<MonthlyDetail ref="monthlyDetailRef" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="InternshipMonthly" lang="ts">
|
||||
import {
|
||||
listInternshipMonthly,
|
||||
getInternshipMonthly,
|
||||
delInternshipMonthly,
|
||||
submitInternshipMonthly,
|
||||
exportInternshipMonthly
|
||||
} from '@/api/zsjy/internshipMonthly'
|
||||
import MonthlyForm from './form.vue'
|
||||
import MonthlyDetail from './detail.vue'
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance
|
||||
const { internship_monthly_status } = toRefs<any>(proxy?.useDict('internship_monthly_status'))
|
||||
|
||||
const monthlyList = ref<any[]>([])
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref<Array<string | number>>([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
})
|
||||
|
||||
const detailDialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
})
|
||||
|
||||
const initFormData: any = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
summaryMonth: undefined,
|
||||
reviewStatus: undefined,
|
||||
professionalSkills: undefined
|
||||
}
|
||||
const data = reactive<PageData<any, any>>({
|
||||
form: {},
|
||||
queryParams: { ...initFormData },
|
||||
rules: {}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>()
|
||||
const monthlyFormRef = ref<ComponentRef<typeof MonthlyForm>>()
|
||||
const monthlyDetailRef = ref<ComponentRef<typeof MonthlyDetail>>()
|
||||
|
||||
/** 查询月度总结列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
const res = await listInternshipMonthly(queryParams.value)
|
||||
monthlyList.value = res.rows
|
||||
total.value = res.total
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: any) => {
|
||||
ids.value = selection.map((item: any) => item.monthlyId)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
dialog.visible = true
|
||||
dialog.title = '添加月度总结'
|
||||
nextTick(() => {
|
||||
monthlyFormRef.value?.resetForm()
|
||||
})
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: any) => {
|
||||
dialog.visible = true
|
||||
dialog.title = '修改月度总结'
|
||||
nextTick(() => {
|
||||
const monthlyId = row?.monthlyId || ids.value[0]
|
||||
monthlyFormRef.value?.resetForm(monthlyId)
|
||||
})
|
||||
}
|
||||
|
||||
/** 查看详情操作 */
|
||||
const handleDetail = async (row: any) => {
|
||||
detailDialog.visible = true
|
||||
nextTick(() => {
|
||||
monthlyDetailRef.value?.resetForm(row.monthlyId)
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交审批操作 */
|
||||
const handleSubmit = async (row: any) => {
|
||||
try {
|
||||
await proxy?.$modal.confirm('确认提交该月度总结?提交后将无法再次编辑')
|
||||
await submitInternshipMonthly(row.monthlyId)
|
||||
await getList()
|
||||
proxy?.$modal.msgSuccess('提交成功')
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: any) => {
|
||||
const monthlyIds = row?.monthlyId || ids.value
|
||||
try {
|
||||
await proxy?.$modal.confirm('是否确认删除月度总结编号为"' + monthlyIds + '"的数据项?')
|
||||
await delInternshipMonthly(monthlyIds)
|
||||
await getList()
|
||||
proxy?.$modal.msgSuccess('删除成功')
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.$download('zsjy/internship/monthly/export', {
|
||||
...queryParams.value
|
||||
}, `月度总结_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
/** 计算五项技能的平均分 */
|
||||
const getAverageScore = (row: any) => {
|
||||
const scores = [
|
||||
row.professionalSkills || 0,
|
||||
row.communicationSkills || 0,
|
||||
row.teamworkAbility || 0,
|
||||
row.learningAbility || 0,
|
||||
row.workAttitude || 0
|
||||
].filter(score => score > 0)
|
||||
|
||||
if (scores.length === 0) return 0
|
||||
return scores.reduce((sum, score) => sum + score, 0) / scores.length
|
||||
}
|
||||
|
||||
/** 根据分数获取标签类型 */
|
||||
const getScoreTagType = (score: number) => {
|
||||
if (score >= 9) return 'success'
|
||||
if (score >= 7) return 'warning'
|
||||
if (score >= 5) return ''
|
||||
return 'danger'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 操作按钮样式优化 - 参考后勤管理页面 */
|
||||
:deep(.el-table__fixed-right) {
|
||||
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
:deep(.el-table__fixed-right .el-table__cell) {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover .el-table__cell) {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
/* 操作列按钮间距优化 */
|
||||
.small-padding .el-button + .el-button {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
/* 确保操作按钮在固定列中居中对齐 */
|
||||
.small-padding {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.small-padding .el-tooltip {
|
||||
display: inline-block;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.small-padding .el-tooltip:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
/* 分页容器样式 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user