From a1ae56409aba23227b87e2d46a25ee2d8982d281 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Wed, 30 Jul 2025 15:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/XgClassMsgServiceImpl.java | 3 +- .../xg/xsjcxx/classmsg/classMsg/index.vue | 86 ++++++-- .../xsjcxx/stuMsgAudit/stuMsgDetailDialog.vue | 167 +++++++++++----- .../xg/xsjcxx/stuMsgAudit/stuMsgDialog.vue | 183 ++++++++++++------ .../views/xg/xsjcxx/stuPersonalMsg/index.vue | 162 +++++++++++----- .../xg/xsjcxx/studentMsg/studentMsg/index.vue | 54 +++++- 6 files changed, 472 insertions(+), 183 deletions(-) diff --git a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java index 1c8ab4a4..232b0918 100644 --- a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java +++ b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java @@ -79,7 +79,8 @@ public class XgClassMsgServiceImpl implements IXgClassMsgService { private LambdaQueryWrapper buildQueryWrapper(XgClassMsgBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.orderByAsc(XgClassMsg::getId); + // lqw.orderByAsc(XgClassMsg::getId); + lqw.orderByDesc(XgClassMsg::getCreateTime); lqw.eq(bo.getCollegeId() != null, XgClassMsg::getCollegeId, bo.getCollegeId()); lqw.eq(bo.getMajorId() != null, XgClassMsg::getMajorId, bo.getMajorId()); lqw.like(StringUtils.isNotBlank(bo.getClassName()), XgClassMsg::getClassName, bo.getClassName()); diff --git a/web/src/views/xg/xsjcxx/classmsg/classMsg/index.vue b/web/src/views/xg/xsjcxx/classmsg/classMsg/index.vue index 95d26d7f..f5ca4e85 100644 --- a/web/src/views/xg/xsjcxx/classmsg/classMsg/index.vue +++ b/web/src/views/xg/xsjcxx/classmsg/classMsg/index.vue @@ -74,9 +74,10 @@ - + @@ -87,7 +88,8 @@ @@ -159,11 +161,12 @@ - + + @@ -210,8 +213,9 @@ - - + + @@ -284,10 +288,11 @@ - + + @@ -427,7 +432,55 @@ interface PageData { rules: Record; } +interface ComponentInternalInstance { + proxy?: any; +} const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const { + xg_class_status, + is_graduation, + wenhuachengdu, + xg_political_status, + sys_user_sex, + xg_nation, + sys_question_category, + sys_item_enable, + sys_item_required, + sys_item_delete, + house_hold_register_type, + marital_status, + sys_yesno, + xg_family_economic, + xg_blood_type, + disability_type, + zsjy_education_level, + xg_training_mode, + admission_category, + student_status +} = toRefs( + proxy?.useDict( + 'xg_class_status', + 'is_graduation', + 'wenhuachengdu', + 'xg_political_status', + 'sys_user_sex', + 'xg_nation', + 'sys_question_category', + 'sys_item_enable', + 'sys_item_required', + 'sys_item_delete', + 'house_hold_register_type', + 'marital_status', + 'sys_yesno', + 'xg_family_economic', + 'xg_blood_type', + 'disability_type', + 'zsjy_education_level', + 'xg_training_mode', + 'admission_category', + 'student_status' + ) +); const classMsgList = ref([]); const buttonLoading = ref(false); @@ -458,7 +511,7 @@ const initFormData: ClassMsgForm = { majorName: undefined, classCode: undefined, className: undefined, - classType: undefined, + classType: '4', grade: undefined, enrollmentYear: undefined, schoolSystem: undefined, @@ -476,7 +529,7 @@ const initFormData: ClassMsgForm = { deputyMonitorId: undefined, deputyMonitorName: undefined, classStatus: 1, - isGraduation: 0, + isGraduation: '0', graduationDate: undefined, plannedCapacity: undefined, currentStudentCount: undefined, @@ -671,17 +724,12 @@ const handleUpdate = async (row?: ClassMsgVO) => { // 确保classType是数字类型 if (form.value.classType !== undefined) { - form.value.classType = Number(form.value.classType); + form.value.classType = String(form.value.classType); } - // 确保classStatus是数字类型 - if (form.value.classStatus !== undefined) { - form.value.classStatus = Number(form.value.classStatus); - } - - // 确保isGraduation是数字类型 + // 确保isGraduation是字符串类型 if (form.value.isGraduation !== undefined) { - form.value.isGraduation = Number(form.value.isGraduation); + form.value.isGraduation = String(form.value.isGraduation); } // 获取该学院下的专业列表 diff --git a/web/src/views/xg/xsjcxx/stuMsgAudit/stuMsgDetailDialog.vue b/web/src/views/xg/xsjcxx/stuMsgAudit/stuMsgDetailDialog.vue index a8d51171..54039429 100644 --- a/web/src/views/xg/xsjcxx/stuMsgAudit/stuMsgDetailDialog.vue +++ b/web/src/views/xg/xsjcxx/stuMsgAudit/stuMsgDetailDialog.vue @@ -199,8 +199,9 @@ - - + + @@ -251,10 +252,11 @@ - + + @@ -280,24 +282,27 @@ - - + + - - + + - - + + @@ -306,24 +311,27 @@ - - + + - - + + - - + + @@ -332,8 +340,9 @@ - - + + @@ -449,10 +458,11 @@ - + + @@ -482,11 +492,12 @@ - + + @@ -500,18 +511,20 @@ - - + + - + + @@ -574,11 +587,12 @@ - + + @@ -609,19 +623,21 @@ - + + - + + @@ -630,19 +646,21 @@ - + + - - + + @@ -726,19 +744,47 @@ import request from '@/utils/request'; const { proxy } = getCurrentInstance() as any; // 字典数据 -const { wenhuachengdu, xg_political_status, sys_user_sex, xg_nation, sys_question_category, sys_item_enable, sys_item_required, sys_item_delete } = - toRefs( - proxy?.useDict( - 'wenhuachengdu', - 'xg_political_status', - 'sys_user_sex', - 'xg_nation', - 'sys_question_category', - 'sys_item_enable', - 'sys_item_required', - 'sys_item_delete' - ) - ); +const { + house_hold_register_type, + marital_status, + sys_yesno, + xg_family_economic, + xg_blood_type, + disability_type, + zsjy_education_level, + xg_training_mode, + admission_category, + student_status, + wenhuachengdu, + xg_political_status, + sys_user_sex, + xg_nation, + sys_question_category, + sys_item_enable, + sys_item_required, + sys_item_delete +} = toRefs( + proxy?.useDict( + 'house_hold_register_type', + 'marital_status', + 'sys_yesno', + 'xg_family_economic', + 'xg_blood_type', + 'disability_type', + 'zsjy_education_level', + 'xg_training_mode', + 'admission_category', + 'student_status', + 'wenhuachengdu', + 'xg_political_status', + 'sys_user_sex', + 'xg_nation', + 'sys_question_category', + 'sys_item_enable', + 'sys_item_required', + 'sys_item_delete' + ) +); // Props 定义 interface Props { visible: boolean; @@ -909,6 +955,25 @@ const getUserHistoryData = async (batchId: number, userId?: number) => { // 将历史数据填充到表单中 const historyData = res.data; + // 将是否字段的数值转换为字符串 + const booleanFields = [ + 'isPoorStudent', + 'isMinority', + 'isOrphan', + 'isLeftBehindChild', + 'isSingleChild', + 'isLowIncome', + 'hasLoan', + 'isDisabled', + 'isBoarder' + ]; + + booleanFields.forEach((field) => { + if (historyData[field] !== undefined && historyData[field] !== null) { + historyData[field] = String(historyData[field]); + } + }); + // 遍历历史数据,将非空字段赋值给表单 Object.keys(historyData).forEach((key) => { if (historyData[key] !== null && historyData[key] !== undefined && historyData[key] !== '') { @@ -1542,8 +1607,8 @@ const handleClose = () => { border: 1px solid var(--el-border-color); border-radius: 6px; overflow: hidden; - width: 120px; - height: 150px; + /* width: 120px; + height: 150px; */ display: flex; align-items: center; justify-content: center; diff --git a/web/src/views/xg/xsjcxx/stuMsgAudit/stuMsgDialog.vue b/web/src/views/xg/xsjcxx/stuMsgAudit/stuMsgDialog.vue index fd5f0169..1946ebd5 100644 --- a/web/src/views/xg/xsjcxx/stuMsgAudit/stuMsgDialog.vue +++ b/web/src/views/xg/xsjcxx/stuMsgAudit/stuMsgDialog.vue @@ -344,8 +344,9 @@ - - + + @@ -451,10 +452,11 @@ - + + @@ -524,8 +526,9 @@ - - + + @@ -540,8 +543,9 @@ - - + + @@ -556,8 +560,9 @@ - - + + @@ -578,8 +583,9 @@ - - + + @@ -594,8 +600,9 @@ - - + + @@ -610,8 +617,9 @@ - - + + @@ -628,8 +636,9 @@ - - + + @@ -901,10 +910,11 @@ - + + @@ -966,11 +976,12 @@ - + + @@ -1000,8 +1011,9 @@ - - + + @@ -1016,10 +1028,11 @@ - + + @@ -1162,11 +1175,12 @@ - + + @@ -1237,10 +1251,11 @@ - + + @@ -1259,9 +1274,10 @@ - + + @@ -1278,19 +1294,21 @@ - + + - - + + @@ -1409,19 +1427,47 @@ import request from '@/utils/request'; const { proxy } = getCurrentInstance() as any; // 字典数据 -const { wenhuachengdu, xg_political_status, sys_user_sex, xg_nation, sys_question_category, sys_item_enable, sys_item_required, sys_item_delete } = - toRefs( - proxy?.useDict( - 'wenhuachengdu', - 'xg_political_status', - 'sys_user_sex', - 'xg_nation', - 'sys_question_category', - 'sys_item_enable', - 'sys_item_required', - 'sys_item_delete' - ) - ); +const { + student_status, + admission_category, + xg_training_mode, + zsjy_education_level, + disability_type, + xg_blood_type, + xg_family_economic, + sys_yesno, + marital_status, + house_hold_register_type, + wenhuachengdu, + xg_political_status, + sys_user_sex, + xg_nation, + sys_question_category, + sys_item_enable, + sys_item_required, + sys_item_delete +} = toRefs( + proxy?.useDict( + 'student_status', + 'admission_category', + 'xg_training_mode', + 'zsjy_education_level', + 'disability_type', + 'xg_blood_type', + 'xg_family_economic', + 'sys_yesno', + 'marital_status', + 'house_hold_register_type', + 'wenhuachengdu', + 'xg_political_status', + 'sys_user_sex', + 'xg_nation', + 'sys_question_category', + 'sys_item_enable', + 'sys_item_required', + 'sys_item_delete' + ) +); // Props 定义 interface Props { visible: boolean; @@ -1589,6 +1635,25 @@ const getUserHistoryData = async (batchId: number, userId: number) => { // 将历史数据填充到表单中 const historyData = res.data; + // const data = res.data; + // 将是否字段的数值转换为字符串 + const booleanFields = [ + 'isPoorStudent', + 'isMinority', + 'isOrphan', + 'isLeftBehindChild', + 'isSingleChild', + 'isLowIncome', + 'hasLoan', + 'isDisabled', + 'isBoarder' + ]; + + booleanFields.forEach((field) => { + if (historyData[field] !== undefined && historyData[field] !== null) { + historyData[field] = String(historyData[field]); + } + }); // 遍历历史数据,将非空字段赋值给表单 Object.keys(historyData).forEach((key) => { @@ -1695,6 +1760,7 @@ const getRegionName = (code: string) => { /** 根据婚姻状况代码获取标签 */ const getMaritalStatusLabel = (value: string | number) => { + console.log('marital_status.value', marital_status.value); // 修复:0 也是有效值,需要正确处理 if (value === null || value === undefined || value === '') return ''; @@ -1807,7 +1873,7 @@ const getFieldOriginalValue = (fieldName: string) => { case 'sourceRegion': return getRegionName(originalValue); case 'maritalStatus': - return getMaritalStatusLabel(originalValue); + return getDictLabel(marital_status.value, originalValue); case 'isPoorStudent': case 'isMinority': case 'isOrphan': @@ -1817,15 +1883,22 @@ const getFieldOriginalValue = (fieldName: string) => { case 'hasLoan': case 'isDisabled': case 'hasScholarship': - return getYesNoLabel(originalValue); + return getDictLabel(sys_yesno.value, originalValue); case 'bloodType': - return getBloodTypeLabel(originalValue); + return getDictLabel(xg_blood_type.value, originalValue); case 'disabilityType': - return getDisabilityTypeLabel(originalValue); + return getDictLabel(disability_type.value, originalValue); case 'academicLevel': - return getAcademicLevelLabel(originalValue); + return getDictLabel(zsjy_education_level.value, originalValue); case 'studentStatus': - return getStudentStatusLabel(originalValue); + return getDictLabel(student_status.value, originalValue); + case 'birthDate': + case 'enrollmentDate': + // 只取YYYY-MM-DD,去掉时分秒 + if (originalValue && typeof originalValue === 'string') { + return originalValue.split(' ')[0]; + } + return originalValue; default: return originalValue; } diff --git a/web/src/views/xg/xsjcxx/stuPersonalMsg/index.vue b/web/src/views/xg/xsjcxx/stuPersonalMsg/index.vue index b5429a46..434e0d65 100644 --- a/web/src/views/xg/xsjcxx/stuPersonalMsg/index.vue +++ b/web/src/views/xg/xsjcxx/stuPersonalMsg/index.vue @@ -170,8 +170,9 @@ - - + + @@ -222,10 +223,11 @@ - + + @@ -251,24 +253,27 @@ - - + + - - + + - - + + @@ -277,24 +282,27 @@ - - + + - - + + - - + + @@ -303,8 +311,9 @@ - - + + @@ -424,10 +433,11 @@ - + + @@ -457,11 +467,12 @@ - + + @@ -475,18 +486,20 @@ - - + + - + + @@ -551,11 +564,12 @@ - + + @@ -593,19 +607,21 @@ - + + - + + @@ -614,19 +630,21 @@ - + + - - + + @@ -705,19 +723,47 @@ import ElMessage from 'element-plus/es/components/message/index'; const { proxy } = getCurrentInstance() as any; // 字典数据 -const { wenhuachengdu, xg_political_status, sys_user_sex, xg_nation, sys_question_category, sys_item_enable, sys_item_required, sys_item_delete } = - toRefs( - proxy?.useDict( - 'wenhuachengdu', - 'xg_political_status', - 'sys_user_sex', - 'xg_nation', - 'sys_question_category', - 'sys_item_enable', - 'sys_item_required', - 'sys_item_delete' - ) - ); +const { + student_status, + admission_category, + xg_training_mode, + zsjy_education_level, + disability_type, + xg_blood_type, + xg_family_economic, + sys_yesno, + marital_status, + house_hold_register_type, + wenhuachengdu, + xg_political_status, + sys_user_sex, + xg_nation, + sys_question_category, + sys_item_enable, + sys_item_required, + sys_item_delete +} = toRefs( + proxy?.useDict( + 'student_status', + 'admission_category', + 'xg_training_mode', + 'zsjy_education_level', + 'disability_type', + 'xg_blood_type', + 'xg_family_economic', + 'sys_yesno', + 'marital_status', + 'house_hold_register_type', + 'wenhuachengdu', + 'xg_political_status', + 'sys_user_sex', + 'xg_nation', + 'sys_question_category', + 'sys_item_enable', + 'sys_item_required', + 'sys_item_delete' + ) +); // 响应式数据 const activeTab = ref('basic'); // 默认显示基础信息 const regionOptions = ref([]); // 行政区划选项 @@ -841,6 +887,24 @@ const getPersonalInfoData = async () => { }); if (response.code === 200) { const data = response.data; + // 将是否字段的数值转换为字符串 + const booleanFields = [ + 'isPoorStudent', + 'isMinority', + 'isOrphan', + 'isLeftBehindChild', + 'isSingleChild', + 'isLowIncome', + 'hasLoan', + 'isDisabled', + 'isBoarder' + ]; + + booleanFields.forEach((field) => { + if (data[field] !== undefined && data[field] !== null) { + data[field] = String(data[field]); + } + }); // 将API返回的数据映射到表单 Object.assign(form, data); } else { diff --git a/web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue b/web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue index b25dae53..ad28f5ef 100644 --- a/web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue +++ b/web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue @@ -2068,11 +2068,30 @@ const handleDetail = async (row: StudentVO) => { try { const res = await service.get(`/studentMsg/studentMsg/${studentId}`); if (res && res.code === 200) { - Object.assign(detailForm, res.data); + const data = res.data; + // 将是否字段的数值转换为字符串 + const booleanFields = [ + 'isPoorStudent', + 'isMinority', + 'isOrphan', + 'isLeftBehindChild', + 'isSingleChild', + 'isLowIncome', + 'hasLoan', + 'isDisabled', + 'isBoarder' + ]; + + booleanFields.forEach((field) => { + if (data[field] !== undefined && data[field] !== null) { + data[field] = String(data[field]); + } + }); + Object.assign(detailForm, data); // 确保学历层次为数字类型,避免类型不匹配导致的显示问题 - if (detailForm.academicLevel !== undefined && detailForm.academicLevel !== null) { - detailForm.academicLevel = Number(detailForm.academicLevel); - } + // if (detailForm.academicLevel !== undefined && detailForm.academicLevel !== null) { + // detailForm.academicLevel = Number(detailForm.academicLevel); + // } detailDialog.visible = true; activeDetailTab.value = 'basic'; // 重置到第一个tab页 } else { @@ -2272,11 +2291,30 @@ const handleUpdate = async (row?: StudentForm) => { if (res && res.code === 200) { dialog.visible = true; dialog.title = '修改学生'; - Object.assign(form, res.data); + const data = res.data; + // 将是否字段的数值转换为字符串 + const booleanFields = [ + 'isPoorStudent', + 'isMinority', + 'isOrphan', + 'isLeftBehindChild', + 'isSingleChild', + 'isLowIncome', + 'hasLoan', + 'isDisabled', + 'isBoarder' + ]; + + booleanFields.forEach((field) => { + if (data[field] !== undefined && data[field] !== null) { + data[field] = String(data[field]); + } + }); + Object.assign(form, data); // 确保学历层次为数字类型,避免类型不匹配导致的显示问题 - if (form.academicLevel !== undefined && form.academicLevel !== null) { - form.academicLevel = Number(form.academicLevel); - } + // if (form.academicLevel !== undefined && form.academicLevel !== null) { + // form.academicLevel = Number(form.academicLevel); + // } // 注意:如果需要专业和班级选项,可能需要额外的接口调用 // majorOptions.value = data.data.majors; // classOptions.value = data.data.classes;