|
@@ -134,6 +134,7 @@
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-button type="primary" icon="check" size="small" @click="handleAddRoom">分配给班级</el-button>
|
|
<el-button type="primary" icon="check" size="small" @click="handleAddRoom">分配给班级</el-button>
|
|
|
<el-button type="warning" icon="RefreshLeft" size="small" @click="handleBatchRecall">批量收回宿舍</el-button>
|
|
<el-button type="warning" icon="RefreshLeft" size="small" @click="handleBatchRecall">批量收回宿舍</el-button>
|
|
|
|
|
+ <el-button type="danger" icon="UserFilled" size="small" @click="handleBatchStayaway">批量退宿床位</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12" style="text-align: right">
|
|
<el-col :span="12" style="text-align: right">
|
|
|
<el-button
|
|
<el-button
|
|
@@ -358,7 +359,7 @@
|
|
|
|
|
|
|
|
<script setup name="DormRoomTreeManagement" lang="ts">
|
|
<script setup name="DormRoomTreeManagement" lang="ts">
|
|
|
import { ref, computed, reactive, onMounted, nextTick, watch, getCurrentInstance } from 'vue';
|
|
import { ref, computed, reactive, onMounted, nextTick, watch, getCurrentInstance } from 'vue';
|
|
|
-import { InfoFilled, House, Avatar } from '@element-plus/icons-vue';
|
|
|
|
|
|
|
+import { InfoFilled, House, Avatar, UserFilled } from '@element-plus/icons-vue';
|
|
|
import type { DormBuildingTreeVO } from '@/api/xg/xgss/dormBedStudent/dormBedStudent/types';
|
|
import type { DormBuildingTreeVO } from '@/api/xg/xgss/dormBedStudent/dormBedStudent/types';
|
|
|
import type { DormTreeNode, BedInfo } from '@/api/xg/xgss/xsssfjgl/types';
|
|
import type { DormTreeNode, BedInfo } from '@/api/xg/xgss/xsssfjgl/types';
|
|
|
import type { DormRoomVO } from '@/api/xg/xgss/dormRoom/types';
|
|
import type { DormRoomVO } from '@/api/xg/xgss/dormRoom/types';
|
|
@@ -375,7 +376,7 @@ import ElMessageBox from 'element-plus/es/components/message-box/index';
|
|
|
import RoomDialog from './components/RoomDialog.vue';
|
|
import RoomDialog from './components/RoomDialog.vue';
|
|
|
import BedDialog from './components/BedDialog.vue';
|
|
import BedDialog from './components/BedDialog.vue';
|
|
|
import ClassAllocationDialog from './components/ClassAllocationDialog.vue';
|
|
import ClassAllocationDialog from './components/ClassAllocationDialog.vue';
|
|
|
-import { batchRecallDormBeds, batchRecallClassAllocation } from '@/api/xg/xgss/dormBedStudent/dormBedStudent';
|
|
|
|
|
|
|
+import { batchRecallDormBeds, batchRecallClassAllocation, classTeacherStayawaySelectedBeds } from '@/api/xg/xgss/dormBedStudent/dormBedStudent';
|
|
|
|
|
|
|
|
// const { proxy } = getCurrentInstance();
|
|
// const { proxy } = getCurrentInstance();
|
|
|
|
|
|
|
@@ -712,6 +713,39 @@ const handleBatchRecall = async () => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/** 批量退宿床位 */
|
|
|
|
|
+const handleBatchStayaway = async () => {
|
|
|
|
|
+ if (!selectedBuilding.value) {
|
|
|
|
|
+ ElMessage.warning('请先选择宿舍楼');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const selectedBeds = selectedRows.value.filter((row) => row.isBed).map((row) => row.id);
|
|
|
|
|
+ if (selectedBeds.length === 0) {
|
|
|
|
|
+ ElMessage.warning('请先选择要退宿的床位');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ const content = `确认退宿选中的 ${selectedBeds.length} 个床位吗?\n\n重要提示:退宿后,这些床位上学生的床位信息将被清空,同时该床位归还学校。`;
|
|
|
|
|
+ await ElMessageBox.confirm(content, '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ await classTeacherStayawaySelectedBeds(selectedBeds);
|
|
|
|
|
+ ElMessage.success('批量退宿成功');
|
|
|
|
|
+ // 刷新数据
|
|
|
|
|
+ selectableRowsCache.value = [];
|
|
|
|
|
+ loadRoomData();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ ElMessage.error('批量退宿失败');
|
|
|
|
|
+ console.error(e);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
/** 全部展开 */
|
|
/** 全部展开 */
|
|
|
const expandAll = async () => {
|
|
const expandAll = async () => {
|
|
|
if (expandAllLoading.value || selectionLoading.value || !roomList.value?.length) return;
|
|
if (expandAllLoading.value || selectionLoading.value || !roomList.value?.length) return;
|