From 594d0c5df37d5065a3545c4012553bfd9d475e88 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Sat, 25 Oct 2025 09:51:06 +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 --- .../xgss/wsjc/components/SingleRoomCheck.vue | 2 +- mobile/src/pages/xgss/xssswsjc/xssswsjc.vue | 145 ++++++++++++++++-- 2 files changed, 137 insertions(+), 10 deletions(-) diff --git a/mobile/src/pages/xgss/wsjc/components/SingleRoomCheck.vue b/mobile/src/pages/xgss/wsjc/components/SingleRoomCheck.vue index 5925b91f..cfbfc1d4 100644 --- a/mobile/src/pages/xgss/wsjc/components/SingleRoomCheck.vue +++ b/mobile/src/pages/xgss/wsjc/components/SingleRoomCheck.vue @@ -387,7 +387,7 @@ 请假信息 - 请假中 + diff --git a/mobile/src/pages/xgss/xssswsjc/xssswsjc.vue b/mobile/src/pages/xgss/xssswsjc/xssswsjc.vue index 14b69561..c4793cfa 100644 --- a/mobile/src/pages/xgss/xssswsjc/xssswsjc.vue +++ b/mobile/src/pages/xgss/xssswsjc/xssswsjc.vue @@ -117,16 +117,12 @@ 宿舍信息 - + 校区: {{ item.campusName || '-' }} - - 宿舍区: - {{ item.areaName || '-' }} - @@ -207,6 +203,35 @@ + + + + + + + {{ currentViewItem ? currentViewItem.roomName : '' }} - 查看检查 + + + + + + + + @@ -214,9 +239,13 @@ import { request } from '@/common/request.js'; import { getDict, getDictLabel, getDictTagType } from '@/common/dict.js'; import { userManager } from '@/utils/user.js'; +import SingleRoomCheck from '../wsjc/components/SingleRoomCheck.vue'; export default { name: 'DormHygieneCheck', + components: { + SingleRoomCheck, + }, data() { return { loading: false, @@ -239,6 +268,14 @@ export default { xg_dorm_hygiene_check_type: [], xg_dorm_hygiene_check_level: [], xg_dorm_hygiene_grade: [], + + // 查看弹窗相关 + showViewPopup: false, + currentViewItem: null, + currentViewData: null, + currentViewRoomInfo: null, + currentViewCheckInfo: null, + popupHeight: 600, }; }, @@ -257,6 +294,12 @@ export default { uni.$on('refreshCheckList', this.handleRefreshEvent); }, + onReady() { + // 计算弹窗高度(屏幕高度的70%) + const systemInfo = uni.getSystemInfoSync(); + this.popupHeight = systemInfo.windowHeight * 0.7; + }, + beforeDestroy() { // 移除事件监听 uni.$off('refreshCheckList', this.handleRefreshEvent); @@ -487,10 +530,73 @@ export default { }, // 查看检查 - handleView(item) { - uni.navigateTo({ - url: `/pages/xgss/xssswsjc/xssswsjcDetail?id=${item.id}&type=view`, - }); + async handleView(item) { + try { + uni.showLoading({ title: '加载中...' }); + + // 加载检查记录详情 + const res = await request({ + url: `/dormHygieneCheck/dormHygieneCheck/${item.id}`, + method: 'GET', + }); + + uni.hideLoading(); + + if (res && res.code === 200 && res.data) { + this.currentViewItem = item; + this.currentViewData = res.data; + + // 构造房间信息 + this.currentViewRoomInfo = { + id: item.roomId, + roomName: item.roomName, + roomCode: item.roomCode, + campusId: item.campusId, + campusName: item.campusName, + areaId: item.areaId, + areaName: item.areaName, + buildingId: item.buildingId, + buildingName: item.buildingName, + }; + + // 构造检查基础信息 + this.currentViewCheckInfo = { + checkTitle: item.checkTitle, + checkDate: item.checkDate, + checkerId: item.checkerId, + checkerName: item.checkerName, + checkType: item.checkType, + checkLevel: item.checkLevel, + campusId: item.campusId, + campusName: item.campusName, + buildingId: item.buildingId, + buildingName: item.buildingName, + }; + + this.showViewPopup = true; + } else { + uni.showToast({ + title: res?.msg || '加载失败', + icon: 'none', + }); + } + } catch (error) { + uni.hideLoading(); + console.error('❌ 加载检查记录失败:', error); + uni.showToast({ + title: '加载失败', + icon: 'none', + }); + } + }, + + // 查看检查弹窗关闭处理 + handleViewPopupClose() { + this.showViewPopup = false; + this.currentViewItem = null; + this.currentViewData = null; + this.currentViewRoomInfo = null; + this.currentViewCheckInfo = null; }, // 修改检查 @@ -903,4 +1009,25 @@ export default { ::v-deep .u-button { border-radius: 8rpx; } + +// 查看弹窗样式 +.popup-container { + background-color: #fff; + border-radius: 20rpx 20rpx 0 0; +} + +.popup-header { + padding: 30rpx; + border-bottom: 2rpx solid #f0f0f0; +} + +.popup-title { + font-size: 32rpx; + font-weight: 600; + color: #303133; +} + +.popup-scroll { + overflow-y: auto; +}