From 14fe56b734077b3dc318b6f0ca313f661de824da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Fri, 24 Oct 2025 17:45:57 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=85=A5=E4=BD=8F?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/dms/studentDormInfo/index.js | 59 +++ config.js | 2 +- pages.json | 19 +- pages/dormitory/studentDormInfo/index.vue | 278 ++++++++++ .../studentDormInfo/informationCollection.vue | 480 ++++++++++++++++++ static/images/workbench/studentDormInfo.png | Bin 0 -> 3053 bytes 6 files changed, 835 insertions(+), 3 deletions(-) create mode 100644 api/dms/studentDormInfo/index.js create mode 100644 pages/dormitory/studentDormInfo/index.vue create mode 100644 pages/dormitory/studentDormInfo/informationCollection.vue create mode 100644 static/images/workbench/studentDormInfo.png diff --git a/api/dms/studentDormInfo/index.js b/api/dms/studentDormInfo/index.js new file mode 100644 index 0000000..70d6498 --- /dev/null +++ b/api/dms/studentDormInfo/index.js @@ -0,0 +1,59 @@ +import request from '@/utils/request' + +// 查询宿舍学生关联列表 +export function listStudent(query) { + return request({ + url: '/dormitory/srs-dormitory-student/list', + method: 'get', + params: query + }) +} + +// 新增宿舍学生关联 +export function addStudent(data) { + return request({ + url: '/dormitory/srs-dormitory-student/add', + method: 'post', + data: data + }) +} + +// 获取校区 +export function listAllCampus() { + return request({ + url: '/dormitory/dms-dormitory/listAllCampus', + method: 'get' + }) +} + +// 根据校区id获取园区 +export function listParkByCampus(id) { + return request({ + url: '/dormitory/dms-dormitory/listParkByCampus/' + id, + method: 'get' + }) +} + +// 根据园区id获取楼栋 +export function listBuildingByPark(id) { + return request({ + url: '/dormitory/dms-dormitory/listBuildingByPark/' + id, + method: 'get' + }) +} + +// 根据楼栋id获取楼层 +export function listFloorByBuilding(id) { + return request({ + url: '/dormitory/dms-dormitory/listFloorByBuilding/' + id, + method: 'get' + }) +} + +// 根据楼层id获取宿舍号 +export function listAllRoomByFloor(id) { + return request({ + url: '/dormitory/dms-dormitory/listAllRoomByFloor/' + id, + method: 'get' + }) +} \ No newline at end of file diff --git a/config.js b/config.js index baedf0a..de16370 100644 --- a/config.js +++ b/config.js @@ -3,7 +3,7 @@ module.exports = { // baseUrl: 'http://zhxg.gxsdxy.cn/prod_api', // baseUrl: 'http://172.16.96.111:8085', // baseUrl: 'http://192.168.211.22:8085', - baseUrl: 'http://localhost:8088', + baseUrl: 'http://localhost:8085', // 应用信息 appInfo: { // 应用名称 diff --git a/pages.json b/pages.json index 3a8df26..14f3856 100644 --- a/pages.json +++ b/pages.json @@ -209,8 +209,7 @@ "navigationBarBackgroundColor": "#1890FF", "navigationBarTextStyle": "white" } - }, - { + }, { "path": "pages/record/record", "style": { "navigationBarTitleText": "住宿记录", @@ -218,6 +217,22 @@ "navigationBarBackgroundColor": "#1890FF", "navigationBarTextStyle": "white" } + }, { + "path": "pages/dormitory/studentDormInfo/index", + "style": { + "navigationBarTitleText": "学生入住信息收集", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#1890FF", + "navigationBarTextStyle": "white" + } + }, { + "path": "pages/dormitory/studentDormInfo/informationCollection", + "style": { + "navigationBarTitleText": "信息收集", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#1890FF", + "navigationBarTextStyle": "white" + } }, { "path": "pages/addapply/addapply", "style": { diff --git a/pages/dormitory/studentDormInfo/index.vue b/pages/dormitory/studentDormInfo/index.vue new file mode 100644 index 0000000..e64a85f --- /dev/null +++ b/pages/dormitory/studentDormInfo/index.vue @@ -0,0 +1,278 @@ + + + + + \ No newline at end of file diff --git a/pages/dormitory/studentDormInfo/informationCollection.vue b/pages/dormitory/studentDormInfo/informationCollection.vue new file mode 100644 index 0000000..3931898 --- /dev/null +++ b/pages/dormitory/studentDormInfo/informationCollection.vue @@ -0,0 +1,480 @@ + + + + + \ No newline at end of file diff --git a/static/images/workbench/studentDormInfo.png b/static/images/workbench/studentDormInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..9f45642cc085faedb16c28a6422b0a387396994e GIT binary patch literal 3053 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 literal 0 HcmV?d00001 From b1e82d0ba3f56759cc5531c90c904fdb690313ba Mon Sep 17 00:00:00 2001 From: "962704835@qq.com" Date: Sat, 25 Oct 2025 03:20:44 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=85=A5=E4=BD=8F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/dms/studentDormInfo/index.js | 20 +- pages/dormitory/studentDormInfo/index.vue | 409 ++++++++++++++++-- .../studentDormInfo/informationCollection.vue | 56 ++- 3 files changed, 432 insertions(+), 53 deletions(-) diff --git a/api/dms/studentDormInfo/index.js b/api/dms/studentDormInfo/index.js index 70d6498..f7df997 100644 --- a/api/dms/studentDormInfo/index.js +++ b/api/dms/studentDormInfo/index.js @@ -56,4 +56,22 @@ export function listAllRoomByFloor(id) { url: '/dormitory/dms-dormitory/listAllRoomByFloor/' + id, method: 'get' }) -} \ No newline at end of file +} + +// 修改证件照 +export function submitOwnInfo(data){ + return request({ + url:'/comprehensive/extraInfo/submitOwnInfo', + method:'POST', + data + }) +} + +// 查询年级列表 +export function listGrade(query = null) { + return request({ + url: '/cph/grade/list', + method: 'get', + params: query + }) +} diff --git a/pages/dormitory/studentDormInfo/index.vue b/pages/dormitory/studentDormInfo/index.vue index e64a85f..5168be0 100644 --- a/pages/dormitory/studentDormInfo/index.vue +++ b/pages/dormitory/studentDormInfo/index.vue @@ -1,11 +1,86 @@ @@ -109,11 +109,19 @@ listBuildingByPark, listFloorByBuilding, listAllRoomByFloor, - addStudent + addStudent, + submitOwnInfo as submitExtraInfo } from "@/api/dms/studentDormInfo/index.js" import { getUserProfile } from '@/api/system/user' + import { + previewImg + } from "@/utils/uploadImg.js" + import { + checkPic + } from "@/utils/checkPic.js" + import uploadFile from "@/plugins/upload.js"; export default { data() { return { @@ -135,6 +143,7 @@ stuName: '', displayText: '', isInStudentsleep: '是', + photoData: '' }, // 校区选项 campusOptions: [], @@ -292,13 +301,25 @@ // 证件照上传 handleUpload() { uni.chooseImage({ - count: 1, - sizeType: ['compressed'], - sourceType: ['album', 'camera'], - success: (res) => { - this.form.photo = res.tempFilePaths[0]; + count: 3, + success: async (img) => { + let bool = await checkPic(img.tempFiles[0]); + if (bool) { + uploadFile('/common/upload', img.tempFilePaths[0]).then((res) => { + // if (this.form.photo !== "") { + // this.form.photo = this.form.photo + "," + JSON.parse(res) + // .fileName; + // } else { + // this.form.photo = JSON.parse(res).fileName; + // } + this.form.photoData = img.tempFilePaths[0]; + this.form.photo = JSON.parse(res).fileName; + }) + } + } - }); + }) + }, // 提交表单 async handleSubmit() { @@ -325,7 +346,7 @@ // 模拟提交 uni.showLoading({ title: '提交中...' - }); + }); // 添加入住信息 let res = await addStudent(this.form); if (res.code == 200) { @@ -334,7 +355,16 @@ title: '提交成功', icon: 'success' }); - setTimeout(() => { + // 上次图片头像 + let data = submitExtraInfo({ + userId: this.user.data.userId, + whitePhoto: this.form.photo + }) + // if (data.code == 200) { + // console.log(data); + // } + + setTimeout(() => { // 重置表单 this.form = { campusName: '', @@ -348,7 +378,7 @@ photo: '' }; uni.navigateTo({ - url: `/pages/dormitory/studentDormInfo/index` + url: `/pages/dormitory/studentDormInfo/index` }) }, 1000); } From 07e7a65ae5929df910f52375efd7d50a31a643d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Mon, 27 Oct 2025 17:50:50 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=85=A5=E4=BD=8F=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/dormitory/studentDormInfo/index.vue | 475 +++++++++++++++++++--- 1 file changed, 429 insertions(+), 46 deletions(-) diff --git a/pages/dormitory/studentDormInfo/index.vue b/pages/dormitory/studentDormInfo/index.vue index 5168be0..327479e 100644 --- a/pages/dormitory/studentDormInfo/index.vue +++ b/pages/dormitory/studentDormInfo/index.vue @@ -1,7 +1,7 @@ @@ -116,6 +169,9 @@ import { listAllCampus, listParkByCampus, + listBuildingByPark, + listFloorByBuilding, + listAllRoomByFloor, listStudent } from "@/api/dms/studentDormInfo/index.js" import { @@ -140,23 +196,39 @@ stuName: null, gradeId: null, campusId: null, - parkId:null, + parkId: null, + buildingId: null, + floorId: null, + dormitoryId: null, dormArea: null, // 宿舍区筛选参数 parkName: null // 园区筛选参数 }, dormInfo: [], isLoading: false, hasMore: true, + total: 0, // 存储接口返回的总数据条数 // 筛选下拉选项数据 gradeList: [], dormAreaList: [], parkList: [], + // 楼栋选项(按园区联动) + buildingOptions: [], + // 楼层选项(下拉框) + floorOptions: [], + // 宿舍号选项(下拉框) + dormOptions: [], // 筛选选中索引 gradeIndex: 0, dormAreaIndex: 0, parkIndex: 0, + buildingIndex: 0, + floorIndex: 0, + dormIndex: 0, searchTimer: null, - roleGroup: null + roleGroup: null, + // 存储搜索区高度(非学生有搜索区,学生无) + searchAreaHeight: 0, + } }, onShow() { @@ -165,6 +237,21 @@ this.getUserProfile() this.listGrade() this.listAllCampus() + this.scrollToTop() + // 页面渲染完成后,计算搜索区高度并设置内边距 + this.$nextTick(() => { + this.calcSearchAreaHeight() + this.setScrollContentPadding() + }) + }, + watch: { + // 监听角色变化,重新设置内边距(防止角色切换导致适配问题) + roleGroup() { + this.$nextTick(() => { + this.calcSearchAreaHeight() + this.setScrollContentPadding() + }) + } }, methods: { // 重置分页数据(用于刷新或重新加载) @@ -172,8 +259,57 @@ this.queryParams.pageNum = 1 this.dormInfo = [] this.hasMore = true + this.total = 0 // 重置总条数 }, + // 计算搜索区高度 + calcSearchAreaHeight() { + if (this.roleGroup !== '学生') { + const query = uni.createSelectorQuery().in(this) + query.select('.fixed-search-wrap') + .boundingClientRect(rect => { + // 转换rpx为px(1rpx≈0.5px,根据实际设备像素比调整) + this.searchAreaHeight = rect ? Math.ceil(rect.height) : 145 // 145px≈290rpx + }) + .exec() + } else { + this.searchAreaHeight = 0 + } + console.log(this.searchAreaHeight); + }, + + // 动态设置滚动内容的顶部内边距 + setScrollContentPadding() { + const scrollContent = document.querySelector('.scroll-content') + if (scrollContent) { + if (this.roleGroup !== '学生') { + // 非学生:内边距=搜索区高度 - 60rpx(额外间距) + const paddingTop = this.searchAreaHeight - 30 // 10px≈20rpx + scrollContent.style.paddingTop = `${paddingTop}px` + } else { + // 学生:内边距=20rpx(仅基础间距) + scrollContent.style.paddingTop = '10px' // 10px≈20rpx + } + } + }, + + // 滚动条回到顶部的方法 + scrollToTop() { + // 1. scroll-view 自身回顶 + if (this.$refs.scrollRef) { + this.$refs.scrollRef.scrollTo({ + scrollTop: 0, + duration: 300 + }) + } + // 2. 页面级回顶(兜底) + uni.pageScrollTo({ + scrollTop: 0, + duration: 300 + }) + }, + + // 查询列表数据 async getList() { if (this.isLoading || !this.hasMore) { @@ -187,13 +323,17 @@ const res = await listStudent(this.queryParams) if (res.code === 200) { const newData = res.rows || [] + this.total = res.total || 0 // 从接口获取总数据条数(需确保接口返回 total) + // 第一页覆盖数据,后续页追加 this.dormInfo = this.queryParams.pageNum === 1 ? newData : [...this.dormInfo, ...newData] - this.hasMore = newData.length === this.queryParams.pageSize + // 关键判断:当前已加载条数 >= 总条数 → 无更多数据 + this.hasMore = this.dormInfo.length < this.total } else { uni.showToast({ title: '加载失败', icon: 'none' }) + this.hasMore = false // 加载失败时停止后续请求 } } catch (err) { console.error('加载数据出错:', err) @@ -201,6 +341,7 @@ title: '网络错误', icon: 'none' }) + this.hasMore = false // 异常时停止后续请求 } finally { this.isLoading = false // 最终兜底:无论如何都停止刷新 @@ -309,6 +450,8 @@ this.queryParams.gradeId = selectedGrade.gradeId || null this.resetData() this.getList() + this.scrollToTop() + this.$nextTick(() => this.setScrollContentPadding()) }, // 宿舍区筛选 @@ -318,7 +461,9 @@ this.queryParams.campusId = selectedArea.id || null this.resetData() this.getList() - + this.resetDorm() + this.scrollToTop() + this.$nextTick(() => this.setScrollContentPadding()) if (this.queryParams.campusId) { // 根据校区id获取园区 let res = await listParkByCampus(this.queryParams.campusId) @@ -330,13 +475,119 @@ } }, + // 宿舍区选择,重置园区等其他选择 + resetDorm() { + this.parkList = [] + this.parkIndex = 0 + this.buildingOptions = [] + this.buildingIndex = 0 + this.floorIndex = 0 + this.floorOptions = [] + this.dormIndex = 0 + this.dormOptions = [] + }, + + // 判断是否选择上一个选项 + isDorm(data) { + if (data == '楼层') { + if (this.queryParams.buildingId == null) { + uni.showToast({ + title: '请先选择楼栋', + icon: 'none' + }); + return + } + } else if (data == '宿舍号') { + if (this.queryParams.floorId == null) { + uni.showToast({ + title: '请先选择楼层', + icon: 'none' + }); + return + } + } else { + if (this.queryParams.campusId == null) { + uni.showToast({ + title: '请先选择宿舍区', + icon: 'none' + }); + return + } + } + }, + // 园区筛选 - handleParkChange(e) { + async handleParkChange(e) { + this.parkIndex = e.detail.value const selectedPark = this.parkList[this.parkIndex] this.queryParams.parkId = selectedPark.id || null this.resetData() this.getList() + this.scrollToTop() + this.$nextTick(() => this.setScrollContentPadding()) + this.buildingOptions = [] + this.buildingIndex = 0 + this.floorIndex = 0 + this.floorOptions = [] + this.dormIndex = 0 + this.dormOptions = [] + + if (this.queryParams.parkId) { + // 根据园区id获取楼栋 + let res = await listBuildingByPark(this.queryParams.parkId) + if (res.code == 200) { + this.buildingOptions = [{ + name: '全部' + }, ...res.data] + } + } + }, + + // 楼栋筛选 + async handleBuildingChange(e) { + this.buildingIndex = e.detail.value + const selectedBuilding = this.buildingOptions[this.buildingIndex] + this.queryParams.buildingId = selectedBuilding.id || null + this.floorIndex = 0 + this.floorOptions = [] + this.dormIndex = 0 + this.dormOptions = [] + if (this.queryParams.buildingId) { + // 根据楼栋id获取楼层 + let res = await listFloorByBuilding(this.queryParams.buildingId) + if (res.code == 200) { + this.floorOptions = [{ + floor: '全部' + }, ...res.data] + + } + } + }, + + // 楼层筛选 + async handleFloorChange(e) { + this.floorIndex = e.detail.value + const selectedFloor = this.floorOptions[this.floorIndex] + this.queryParams.floorId = selectedFloor.id || null + this.dormIndex = 0 + this.dormOptions = [] + if (this.queryParams.floorId) { + // 根据楼栋id获取楼层 + let res = await listAllRoomByFloor(this.queryParams.floorId) + if (res.code == 200) { + this.dormOptions = [{ + roomNo: '全部' + }, ...res.data] + } + } + }, + + // 宿舍号筛选 + handleDormChange(e) { + this.dormIndex = e.detail.value + const selectedDorm = this.dormOptions[this.dormIndex] + this.queryParams.dormitoryId = selectedDorm.id || null }, // 重置筛选 @@ -344,6 +595,9 @@ this.gradeIndex = 0 this.dormAreaIndex = 0 this.parkIndex = 0 + this.buildingIndex = 0 + this.floorIndex = 0 + this.dormIndex = 0 // 重置筛选参数,保留分页基础参数 this.queryParams = { ...this.queryParams, @@ -351,17 +605,48 @@ dormArea: null, parkName: null, roomNo: null, - stuName: null + stuName: null, + campusId: null, + parkId: null, + buildingId: null, + floorId: null, + dormitoryId: null, + dormArea: null, // 宿舍区筛选参数 + parkName: null // 园区筛选参数 } this.resetData() this.getList() + this.scrollToTop() + this.$nextTick(() => this.setScrollContentPadding()) }, // 手动搜索 handleSearch() { this.resetData() this.getList() + this.scrollToTop() + this.$nextTick(() => this.setScrollContentPadding()) }, + addRecordsPopup() { + if (this.queryParams.parkId == null) { + uni.showToast({ + title: '请先选择园区', + icon: 'none' + }); + return + } + this.$refs.popupTime.open('center'); + }, + onCancel() { + this.$refs.popupTime.close(); + }, + topersonalReporting() { + this.resetData() + this.getList() + this.scrollToTop() + this.$nextTick(() => this.setScrollContentPadding()) + this.$refs.popupTime.close(); + } }, destroyed() { clearTimeout(this.searchTimer) @@ -373,23 +658,24 @@ .page-container { position: relative; height: 100vh; - padding-top: 44px; - /* 预留原生title高度 */ background-color: #f5f7fa; box-sizing: border-box; + /* 禁止页面滚动 */ + overflow: hidden; } - /* 固定搜索区:收缩时无空白 */ + /* 固定搜索区*/ .fixed-search-wrap { position: fixed; top: 44px; + /* 原生title高度 */ left: 0; right: 0; z-index: 90; background-color: #fff; - /* 背景改为白色,与页面融合 */ border-bottom: 1px solid #eee; padding: 14px; + box-sizing: border-box; } /* 触发器:样式简洁,点击区域大 */ @@ -422,10 +708,25 @@ /* 滚动容器:调整顶部内边距,适应搜索区高度变化 */ .scroll-container { - height: 100%; + position: absolute; + top: 44px; + /* 与原生title对齐 */ + left: 0; + right: 0; + bottom: 60px; + /* 预留添加按钮高度 */ width: 100%; - padding-top: 290rpx; - padding-bottom: 120rpx; + overflow-y: auto; + overflow-x: hidden; + } + + /* 滚动内容容器:处理内边距,避免内容被遮挡 */ + .scroll-content { + /* 底部预留加载状态高度 */ + padding-bottom: 40rpx; + /* 左右内边距 */ + padding-left: 20rpx; + padding-right: 20rpx; box-sizing: border-box; } @@ -448,7 +749,8 @@ } .dorm-list { - padding: 20rpx; + // padding: 20rpx; + padding: 0; } .dorm-item { @@ -606,4 +908,85 @@ .btn-icon { margin-right: 6rpx; } + + .popup-time, + .popup-audit { + width: 80%; + + .popup-content { + width: 600rpx; + height: 750rpx; + padding: 40rpx 50rpx 40rpx; + + .title { + text-align: center; + padding-bottom: 20rpx; + font-weight: bold; + font-size: 32rpx; + color: #3D3D3D; + border-bottom: 1px solid #F5F5F7; + } + + .form-item { + width: 100%; + margin-top: 40rpx; + padding: 0 50rpx; + + label { + font-weight: bold; + color: #202020; + } + + picker { + margin-top: 20rpx; + border: 1px solid darkgray; + height: 72rpx; + line-height: 72rpx; + padding-left: 8px; + border-radius: 10rpx; + + .uni-input { + display: flex; + color: #202020; + + .val { + flex: 1; + } + + .uni-icons { + margin: 0 20rpx; + opacity: 0.5; + } + } + } + } + + .btns { + display: flex; + margin-top: 50rpx; + position: absolute; + bottom: 0; + left: 0; + right: 0; + + button { + flex: 1; + border-radius: 0; + height: 80rpx; + line-height: 80rpx; + + &:first-child { + background-color: #ffffff; + border-top: 1px solid #F5F5F7; + } + + &:last-child { + background-color: #258FE4; + border-top: 1px solid #258FE4; + } + } + } + + } + } \ No newline at end of file From 1d61d6a2bdba073804c343d3d275c73e9fdc5a4b Mon Sep 17 00:00:00 2001 From: "962704835@qq.com" Date: Mon, 27 Oct 2025 18:49:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=85=A5=E4=BD=8F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8C=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/dormitory/studentDormInfo/index.vue | 30 +++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/pages/dormitory/studentDormInfo/index.vue b/pages/dormitory/studentDormInfo/index.vue index 327479e..4c97977 100644 --- a/pages/dormitory/studentDormInfo/index.vue +++ b/pages/dormitory/studentDormInfo/index.vue @@ -55,11 +55,11 @@ - + - 宿舍号 + 宿舍 - {{ dormOptions[dormIndex] ? dormOptions[dormIndex].roomNo : '请输入'}} + {{ dormValue || '请输入'}} @@ -228,7 +228,7 @@ roleGroup: null, // 存储搜索区高度(非学生有搜索区,学生无) searchAreaHeight: 0, - + dormValue: '' } }, onShow() { @@ -485,6 +485,7 @@ this.floorOptions = [] this.dormIndex = 0 this.dormOptions = [] + this.dormValue = '' }, // 判断是否选择上一个选项 @@ -532,7 +533,7 @@ this.floorOptions = [] this.dormIndex = 0 this.dormOptions = [] - + this.dormValue = '' if (this.queryParams.parkId) { // 根据园区id获取楼栋 let res = await listBuildingByPark(this.queryParams.parkId) @@ -553,6 +554,7 @@ this.floorOptions = [] this.dormIndex = 0 this.dormOptions = [] + this.dormValue = '' if (this.queryParams.buildingId) { // 根据楼栋id获取楼层 let res = await listFloorByBuilding(this.queryParams.buildingId) @@ -572,6 +574,7 @@ this.queryParams.floorId = selectedFloor.id || null this.dormIndex = 0 this.dormOptions = [] + this.dormValue = '' if (this.queryParams.floorId) { // 根据楼栋id获取楼层 let res = await listAllRoomByFloor(this.queryParams.floorId) @@ -598,6 +601,7 @@ this.buildingIndex = 0 this.floorIndex = 0 this.dormIndex = 0 + this.dormValue = '' // 重置筛选参数,保留分页基础参数 this.queryParams = { ...this.queryParams, @@ -641,6 +645,22 @@ this.$refs.popupTime.close(); }, topersonalReporting() { + + if (this.queryParams.buildingId != null) { + this.dormValue = this.buildingOptions[this.buildingIndex].name + } + if (this.queryParams.floorId != null) { + const data = `${this.floorOptions[this.floorIndex].floor}` + if (!data.includes("栋")) { + this.dormValue = this.buildingOptions[this.buildingIndex].name + ' ' + this.floorOptions[this.floorIndex].floor + "层" + } else { + this.dormValue = this.buildingOptions[this.buildingIndex].name + ' ' + this.floorOptions[this.floorIndex].floor + } + } + if (this.queryParams.dormitoryId != null) { + this.dormValue = this.dormOptions[this.dormIndex].roomNo + } + console.log(this.dormValue); this.resetData() this.getList() this.scrollToTop() From bba0a5cefe404b2dce5d3c3cf4d781295c2293d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Fri, 31 Oct 2025 15:18:41 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=85=A5=E4=BD=8F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/dms/studentDormInfo/index.js | 11 +++++++++-- pages/dormitory/studentDormInfo/index.vue | 17 +++++++++++++---- .../studentDormInfo/informationCollection.vue | 4 ++-- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/api/dms/studentDormInfo/index.js b/api/dms/studentDormInfo/index.js index f7df997..c1615db 100644 --- a/api/dms/studentDormInfo/index.js +++ b/api/dms/studentDormInfo/index.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 查询宿舍学生关联列表 export function listStudent(query) { return request({ - url: '/dormitory/srs-dormitory-student/list', + url: '/dormitory/srs-dormitory-student/checkInInformation', method: 'get', params: query }) @@ -12,7 +12,7 @@ export function listStudent(query) { // 新增宿舍学生关联 export function addStudent(data) { return request({ - url: '/dormitory/srs-dormitory-student/add', + url: '/dormitory/srs-dormitory-student/addCheckInInformation', method: 'post', data: data }) @@ -75,3 +75,10 @@ export function listGrade(query = null) { params: query }) } + +// 查询学院名称 +export function getDeptName() { + return request({ + url: '/system/dept/name' + }) +} diff --git a/pages/dormitory/studentDormInfo/index.vue b/pages/dormitory/studentDormInfo/index.vue index 4c97977..e45ad61 100644 --- a/pages/dormitory/studentDormInfo/index.vue +++ b/pages/dormitory/studentDormInfo/index.vue @@ -126,7 +126,7 @@ - + + +