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; },