From b098b9ec44d2a22d3e4f172c43eccddfbe0bd57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwuzhen=E2=80=9D?= Date: Mon, 19 Oct 2026 08:43:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(dorm):=20=E7=82=B9=E5=90=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=90=8E=E6=88=BF=E9=97=B4=E5=8D=A1=E7=89=87=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E5=B1=95=E7=A4=BA=E6=9C=AC=E6=AC=A1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提交结果里已有在寝、请假、不在人数,卡片原先只标记已点名,人数仍停在加载时的 0。 Co-authored-by: Cursor --- mobile/src/pages/xgss/ssdm/ssdmCheck.vue | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/mobile/src/pages/xgss/ssdm/ssdmCheck.vue b/mobile/src/pages/xgss/ssdm/ssdmCheck.vue index c1be96b7..fd0107ec 100644 --- a/mobile/src/pages/xgss/ssdm/ssdmCheck.vue +++ b/mobile/src/pages/xgss/ssdm/ssdmCheck.vue @@ -303,19 +303,24 @@ export default { this.showRoomPopup = true; }, - handleRollCallSubmit() { - if (this.currentRoom) { - // 标记为已完成 - if (!this.completedRooms.includes(this.currentRoom.roomId)) { - this.completedRooms.push(this.currentRoom.roomId); + handleRollCallSubmit(submitData) { + const room = this.currentRoom; + if (room) { + if (!this.completedRooms.includes(room.roomId)) { + this.completedRooms.push(room.roomId); } - // 更新房间的统计信息 - const idx = this.rooms.findIndex((r) => r.roomId === this.currentRoom.roomId); + const idx = this.rooms.findIndex((r) => r.roomId === room.roomId); if (idx >= 0) { - this.rooms[idx].isCompleted = true; + const counts = submitData || {}; + const countOf = (value) => (value === undefined || value === null ? 0 : value); + this.$set(this.rooms[idx], 'isCompleted', true); + this.$set(this.rooms[idx], 'presentCount', countOf(counts.presentCount)); + this.$set(this.rooms[idx], 'leaveCount', countOf(counts.leaveCount)); + this.$set(this.rooms[idx], 'absentCount', countOf(counts.absentCount)); + this.$set(this.rooms[idx], 'emptyCount', countOf(counts.emptyCount)); } } - uni.showToast({ title: `${this.currentRoom?.roomName || ''} 点名完成`, icon: 'success' }); + uni.showToast({ title: `${room?.roomName || ''} 点名完成`, icon: 'success' }); this.showRoomPopup = false; this.currentRoom = null; },